6. RESTful APIs

This is a reference for the z/VM Cloud Connector RESTful API.

6.1. Response Data Definition

The following table gives a reference of general response data definition of each z/VM Cloud Connector RESTful API. In case of encountering an error, those information will be helpful to report bug/issue.

Name In Type Description
overallRC body integer The overall return code for API request.
rc body integer The return code for API request.
rs body integer The reason code for API request.
errmsg body string The error message returned for API request. It can be empty if no error occur.
modID body integer The module ID that causes the error to occur.
output body dict The return data from API request.

The following detail API description will only cover output part as it’s different for each API. (This document is a beta version now)

6.2. Version

Lists version of this API.

6.2.1. Get zvm cloud connect version

GET /

  • Request:

    No parameters needed.

  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    Return the version of the zvm cloud connect API.

Name In Type Description
output body dict The return data from API request.
min_version header string Min version of zvm cloud connector.
max_version header string Max version of zvm cloud connector.
version header string version of zvm cloud connector.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output":
    {
        "min_version": "1.0",
        "max_version": "1.0", 
        "version": "1.0"
    }
}

6.3. token

6.3.1. Create token

POST /token

Get a valid token to perform further request by using user and password.

  • Request:
Name In Type Description
user body string user
password body string password
  • Request sample:
{
    "token":
    {
        "user": "user01",
        "password": "password",
    }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
X-Auth-Token header string The token returned to client if authorized.

6.4. Guest(s)

Lists, creates, shows details for, updates, and deletes guests.

6.4.1. List Guests

GET /guests

List names of all the VMs on this host

  • Request:

    None

  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body list Guests list
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": ["v1", "v2"]
}

6.4.2. Create Guest

POST /guests

Create a vm in z/VM

  • Request:
Name In Type Description
guest body dict Guest dict
userid body string The userid of the guest to be created
vcpus body integer vcpus count.
memory body integer Memory size of the guest, in MBytes.
user_profile (Optional) body string Profile of guest.
disk_list (Optional) body list A list of disks info for the guest It has one dictionary that contain some of the below keys for each disk, the root disk should be the first element in the list.
size body string size of disk, case insensitive, the unit can be in Megabytes (M), Gigabytes (G), or number of cylinders/blocks, for example, please use 512M, 1g or just 2000.
format body string Format of disk, can be ext2, ext3, ext4, xfs.
is_boot_disk body bool is boot disk or not. For the root disk, this key must be set to indicate the image that will be deployed on this disk.
disk_pool (Optional) body string disk pool, if not specified, the disk will be created by using the value from configure file, the format is ECKD:eckdpoolname or FBA:fbapoolname.
  • Request sample:
{
  "guest":
  {
      "userid": "id001",
      "vcpus": 1,
      "memory": 1024,
      "user_profile": "",
      "disk_list":[
      {
          "size": "1g",
          "is_boot_disk": True,
          "disk_pool": "ECKD:eckdpool1"
      },
      {
          "size": "200000",
          "disk_pool": "FBA:fbapool1",
          "format": "ext3"
      }]
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No Response

6.4.3. Guest add disks

POST /guests/{userid}/disks

Add disks for a guest

  • Request:
Name In Type Description
userid path string Guest userid
disk_info body dict A dict to describe disk info.
disk_list (Optional) body list A list of disks info for the guest It has one dictionary that contain some of the below keys for each disk, the root disk should be the first element in the list.
size body string size of disk, case insensitive, the unit can be in Megabytes (M), Gigabytes (G), or number of cylinders/blocks, for example, please use 512M, 1g or just 2000.
format body string Format of disk, can be ext2, ext3, ext4, xfs.
is_boot_disk body bool is boot disk or not. For the root disk, this key must be set to indicate the image that will be deployed on this disk.
disk_pool (Optional) body string disk pool, if not specified, the disk will be created by using the value from configure file, the format is ECKD:eckdpoolname or FBA:fbapoolname.
  • Request sample:
{
  "disk_info":
  {
      "disk_list":[
      {
          "size": "1g",
          "is_boot_disk": True,
          "disk_pool": "ECKD:eckdpool1"
      },
      {
          "size": "200000",
          "disk_pool": "FBA:fbapool1",
          "format": "ext3"
      }]
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No Response

6.4.4. Guest delete disks

DELETE /guests/{userid}/disks

Delete disks form a guest

  • Request:
Name In Type Description
userid path string Guest userid
vdev_info body dict A dict to describe vdev list to be deleted.
vdev_list body list Disk vdev list of guest It has one list contains the vdev for delete, for example, ['0101','0102']
  • Request sample:
{
  "vdev_info":
  {
      "vdev_list":['0101', '0102']
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No Response

6.4.5. Get Guests stats including cpu and memory

GET /guests/stats

Get guests cpu, memory information.

  • Request:
Name In Type Description
userid path string, list A single userid string or a list of guest userids
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict cpu and memory statics of guest
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {}
}

6.4.6. Get Guests vnics info

GET /guests/vnicsinfo

Get guests virtual nic information.

  • Request:
Name In Type Description
userid path string, list A single userid string or a list of guest userids
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict vNICs statistics of one guest.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {}
}

6.4.7. Get Guests nic info

GET /guests/nics

Get guests nic information, including userid, nic number, vswitch, nic id and comments.

  • Request:
Name In Type Description
userid (Optional) path string Guest userid.
nic_id (Optional) path string nic identifier.
vswitch (Optional) path string vswitch name.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body list List describing nic information, including userid, nic number, vswitch, nic id and comments.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": [("id0001", "1000", "vsw01", "1111-2222", None)]
}

6.4.8. Show Guest definition

GET /guests/{userid}

Display the user direct by the given userid.

  • Request:
Name In Type Description
userid path string Guest userid
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict Dictionary describing user direct and check info result
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {"user_direct": ["USER1", "INCLUDE PROFILE"]}
}

6.4.9. Delete Guest

DELETE /guests/{userid}

Delete a guest.

  • Request:
Name In Type Description
userid path string Guest userid
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No Response

6.4.10. Get Guest info

GET /guests/{userid}/info

Get running information of guest.

  • Request:
Name In Type Description
userid path string Guest userid
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict Status of guest.
max_mem_kb body integer The maximum memory in KBytes can be allocated for this guest.
num_cpu body integer The count of virtual CPUs for the guest.
cpu_time_us body integer The CPU time used in microseconds.
power_state body string Power status of guest, can be either on or off.
mem_kb body integer Meemory size used by the guest, in KBytes.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output":
    {
        "max_mem_kb": 1,
        "num_cpu": 1,
        "cpu_time_us": 0,
        "power_state": "off",
        "mem_kb": 0
    }
}

6.4.11. Get Guest nic info

GET /guests/{userid}/nic

Return the nic and vswitch pair for specified guest

  • Request:
Name In Type Description
userid path string Guest userid
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict vNIC and vswitch pair of guest.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {"2000": "VSW1"}
}

6.4.12. Create Guest nic

POST /guests/{userid}/nic

Create a virtual nic on giving guest.

  • Request:
Name In Type Description
userid path string Guest userid
nic body dict The information which is used to set nic device number
vdev (Optional) body string nic device number, 1- to 4- hexadecimal digits.
nic_id (Optional) body string nic identifier
mac_addr (Optional) body string Mac address, it is only used when changing the guest’s user direct. Format should be xx:xx:xx:xx:xx:xx, and x is a hexadecimal digit.
active (Optional) body bool Whether the change will apply to the active guest.
  • Request sample:
{
  "nic":
  {
      "vdev": "1000",
      "nic_id": "1111-2222-3333",
      "mac_addr": "12:34:56:AA:BB:CC",
      "active": True
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.13. Create network interface

POST /guests/{userid}/interface

Create one or more network interfaces on giving guest.

  • Request:
Name In Type Description
userid path string Guest userid
interface body dict The information which is used to set network interface.
os_version body string guest operating system version.
guest_networks body list

Network info list of guest. It has one dictionary that contain some of the below keys for each interface. All the keys are optional :

  • ip_addr: the IP address of the interface
  • dns_addr: dns addresses list
  • gateway_addr: gateway address
  • cidr: cidr format
  • nic_vdev: nic device number, 1- to 4- hexadecimal digits
  • mac_addr: mac address
  • nic_id: nic identifier
active (Optional) body bool Whether the change will apply to the active guest.
  • Request sample:
{
  "interface":
  {
      "os_version": "rhel7.2",
      "guest_networks": [
      {   
          "ip_addr": "192.168.95.10",
          "dns_addr": ["9.0.2.1", "9.0.3.1"],
          "gateway_addr": "192.168.95.1",
          "cidr": "192.168.95.0/24",
          "nic_vdev": "1000",
          "mac_addr": "02:00:00:12:34:56",
          "nic_id": "111-222-333"
      },
      {
          "ip_addr": "192.168.95.11",
          "gateway_addr": "192.168.95.1",
          "cidr": "192.168.95.0/24",
          "nic_vdev": "2000",
          "mac_addr": "02:00:00:12:34:78",
          "nic_id": "444-555-666"
      }],
      "active": True
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.14. Start guest

Start a guest.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take start action on guest.
  • Request sample:
{
   "action": "start"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.15. Stop guest

Stop a guest.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take stop action on guest.
  • Request sample:
{
   "action": "stop"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.16. Softstop guest

Stop a guest gracefully, it will firstly shutdown the os on vm, then stop the vm.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take softstop action on guest.
  • Request sample:
{
   "action": "softstop"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.17. Pause guest

Pause a guest.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take pause action on guest.
  • Request sample:
{
   "action": "pause"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.18. Unpause guest

Unpause a guest.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take unpause action on guest.
  • Request sample:
{
   "action": "unpause"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.19. Reboot guest

Reboot a guest, this will use ‘reboot’ command on the given guest.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take reboot action on guest.
  • Request sample:
{
   "action": "reboot"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.20. Reset guest

Reset a guest, this will first gracefully logoff the guest from z/VM it is running on, then log on the guest and IPL.

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take reset action on guest.
  • Request sample:
{
   "action": "reset"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.21. Get guest console output

POST /guests/{userid}/action

Get console output of the guest.

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take get_console_output action on guest.
  • Request sample:
{
   "action": "get_console_output"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    • output: console_output

6.4.22. Deploy guest

POST /guests/{userid}/action

After guest created, deploy image onto the guest.

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take deploy action on guest.
  • Request sample:
{
  "action": "deploy",
  "image": "image1",
  "vdev": "100"
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.23. Capture guest

POST /guests/{userid}/action

  • Request:
Name In Type Description
userid path string Guest userid
action body dict Take capture action on guest.
  • Request sample:
{
  "action": "capture",
  "image": "capturedimage",
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

6.4.24. Get Guest power state

GET /guests/{userid}/power_state

Get power state of the guest.

  • Request:
Name In Type Description
userid path string Guest userid
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body string Power status of guest, can be either on or off.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": "off"
}

6.4.25. Update Guest nic

PUT /guests/{userid}/nic/{vdev}

Couple or uncouple nic with vswitch on the guest.

  • Request:
Name In Type Description
userid path string Guest userid
vdev path string nic device number, 1- to 4- hexadecimal digits.
info body dict The info used to describe the couple/uncouple action.
couple body bool couple or uncouple action.
active (Optional) body bool Whether the change will apply to the active guest.
vswitch (Optional) body string vswitch name.
  • Request sample:
{
  "info":
  {
      "couple": True,
      "active": False,
      "vswitch": "vs_name"
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.4.26. Delete Guest nic

DELETE /guests/{userid}/nic/{vdev}

  • Request:
Name In Type Description
userid path string Guest userid
vdev path string nic device number, 1- to 4- hexadecimal digits.
active (Optional) body bool Whether the change will apply to the active guest.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.5. Host

Get info from host (hypervisor) running on.

6.5.1. Get Host Info

GET /host

Get host information.

  • Request:

    No parameters needed.

  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict The dict of host information.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": 
    {
         "disk_available": 3057,
         "ipl_time": "IPL at 06/02/17 11:07:10 EDT",
         "vcpus_used": 6,
         "hypervisor_type": "zvm",
         "vcpus": 6,
         "zvm_host": "OPNSTK2",
         "memory_mb": 51200.0,
         "cpu_info": {
              "cec_model": "2817",
              "architecture": "s390x"
         },
         "disk_total": 3623,
         "hypervisor_hostname": "OPNSTK2",
         "hypervisor_version": 640,
         "disk_used": 566,
         "memory_mb_used": 0.0
    }
}

6.5.2. Get Host disk pool info

GET /host/disk/{disk}

Get disk pool information on the host.

  • Request:
Name In Type Description
disk body string The disk name to get pool information from
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict The dict of disk information.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "output":
    {
         "disk_available": 3060,
         "disk_total": 3623,
         "disk_used": 563
    },
    "errmsg": ""
}

6.6. Image(s)

Lists, creates, shows details for, updates, and deletes images.

6.6.1. List images

GET /images

Get the list of image info in image repository.

  • Request:
Name In Type Description
imagename (Optional) path string Retrieve the specified image information, if not specified, when list image, all images information will be returned.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body list The image info for specific image.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "output": [["test", "rhel7", "c73ce117eef8077c3420bfc8f473ac2f", "0:CYL", "512", "netboot", null],
               ["test2", "rhel7.3", "658c1858d2eb87dadcea6063be7b142e", "3338:CYL", "465313545", "netboot", null]],
    "errmsg": ""
}

6.6.2. Create image

POST /images

Import an image into image repository

  • Request:
Name In Type Description
image body dict The image info dict.
image_name body string Image name that can be uniquely identify an image.
url body string The location of the image to be imported, support import image from 3 types location, local file system: eg. file:///opt/images/import.img. http server: eg. http://192.168.2.1/path/to/import.img file system on remote host: in this case both url and remote_host parameter should be specified
image_meta body dict The metadata which describes image, the valid keys are os_version and md5sum, os_version is required key.
remote_host (Optional) body string The server from where the image will be import, if remote_host is None, the image will be import from the url in local server, otherwise, the format is username@ip, for example, nova@9.x.x.x or username@hostname eg.``test@test.ibm.com``
  • Request sample:
{
  "image": 
  {
     "image_name": "image1",
     "url": "file:///image1",
     "image_meta": {"os_version": "rhel6.2"}
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.6.3. Export image

PUT /images

Export the image to the specified location.

  • Request:
Name In Type Description
image body dict The image info dict.
image_name body string Image name that can be uniquely identify an image.
dest_url body string The location of the exported image, support export to 2 types location, local file system: eg. file:///opt/images/export.img file system on remote host: in this case both dest_url and remote_host parameter should be specified
remote_host (Optional) body string The server that the image will be export to, if remote_host is None, the image will be stored in the dest_path in local server, otherwise, the format is username@ip, for example, nova@9.x.x.x or username@hostname eg.``test@test.ibm.com``.
  • Request sample:
{
  "image": 
  {
     "image_name": "image1",
     "dest_url": "file:///export/to/image1",
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body dict The dict contains image info after export.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": {"image_name": "name1",
               "image_path": "/tmp/images/name1",
               "os_version": "rhel6",
               "md5sum": "121212314231"}
}

6.6.4. Get root disk size of image

GET /images/{name}/root_disk_size

Get the root disk size of the image.

  • Request:
Name In Type Description
name body string Image name that can be uniquely identify an image.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body string root disk size in units CYL or BLK of image.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "output": "3338:CYL",
    "errmsg": ""
}

6.6.5. Delete image

DELETE /images/{name}

Delete an image.

  • Request:
Name In Type Description
name body string Image name that can be uniquely identify an image.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.7. VSwitch

Lists, creates, updates, and deletes vswitch.

6.7.1. Create vswitch

POST /vswitches

Create a new vswitch.

  • Request:
Name In Type Description
name body string vswitch name.
rdev body string The real device number, a maximum of three devices.
controller (Optional) body string The vswitch’s controller. It could be userid or “*” to specifies any available controller.
connection (Optional) body string

Connection type option :

  • CONnect: Activate the real device connection.
  • DISCONnect: Do not active the real device connection.
  • NOUPLINK: the vswitch will never have connectivity through.
network_type (Optional) body string Specifies the transport mechanism to be used for switch, as follow:IP, ETHERNET.
router (Optional) body string

Connection type option :

  • NONrouter: The OSA-Express device identified in real_device_address= will not act as a router to the vswitch.
  • PRIrouter: The OSA-Express device identified in real_device_address= will act as a primary router to the vswitch.
  • Note: If the network_type is ETHERNET, this value must be unspecified, otherwise, if this value is unspecified, default is NONROUTER
vid (Optional) body string, integer The VLAN ID. This can be any of the following values: UNAWARE, AWARE or 1-4094.
port_type (Optional) body string

Port type :

  • ACCESS: The default porttype attribute for guests authorized for the virtual switch. The guest is unaware of VLAN IDs and sends and receives only untagged traffic
  • TRUNK: The default porttype attribute for guests authorized for the virtual switch. The guest is VLAN aware and sends and receives tagged traffic for those VLANs to which the guest is authorized. If the guest is also authorized to the natvid, untagged traffic sent or received by the guest is associated with the native VLAN ID (natvid) of the virtual switch.
gvrp (Optional) body string

gvrp :

  • GVRP: Indicates that the VLAN IDs in use on the virtual switch should be registered with GVRP-aware switches on the LAN. This provides dynamic VLAN registration and VLAN registration removal for networking switches. This eliminates the need to manually configure the individual port VLAN assignments.
  • NOGVRP: Do not register VLAN IDs with GVRP-aware switches on the LAN. When NOGVRP is specified VLAN port assignments must be configured manually
queue_mem (Optional) body integer A number between 1 and 8, specifying the QDIO buffer size in megabytes
native_vid (Optional) body integer The native vlan id, 1-4094 or None.
persist (Optional) body boolean Whether create the vswitch in the permanent configuration for the system.
  • Request sample:
{
  "vswitch":
  {
      "name": "vs_name",
      "rdev": "FF00",
      "controller": "*",
      "connection": "CONNECT",
      "network_type": "IP",
      "router": "NONROUTER",
      "vid": "UNAWARE",
      "port_type": "ACCESS",
      "gvrp": "GVRP",
      "queue_mem": 8,
      "native_vid": 1,
      "persist": True
  }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.7.2. List vswitches

GET /vswitches

Get the list of vswitch name on the host

  • Request:

    No parameter needed.

  • Response code:

    HTTP status code 200 on success.

  • Response contents:

Name In Type Description
output body list List of vswitches.
  • Response sample:
{
    "rs": 0,
    "overallRC": 0,
    "modID": null,
    "rc": 0,
    "errmsg": "",
    "output": ["v1", "v2"]
}

6.7.3. Grant user to vswitch

PUT /vswitches/{name}

Grant an user to access vswitch

  • Request:
Name In Type Description
name path string vswitch name.
vswitch body dict The vswitch update info.
grant_userid path string Guest userid
  • Request sample:
{
   "vswitch":
   {
      "grant_userid": "FVTUSER1"
   }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.7.4. Revoke user from vswitch

PUT /vswitches/{name}

Revoke the user access from vswitch

  • Request:
Name In Type Description
name path string vswitch name.
vswitch body dict The vswitch update info.
revoke_userid path string Guest userid
  • Request sample:
{
   "vswitch":
   {
      "revoke_userid": "FVTUSER1"
   }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.7.5. Set user VLANID to vswitch

PUT /vswitches/{name}

Set vlan id for user when connecting to the vswitch

  • Request:
Name In Type Description
name path string vswitch name.
vswitch body dict The vswitch update info.
user_vlan_id body dict A dict to describe guest userid and vlanid.
userid path string Guest userid
vlanid body integer The VLAN ID. This can be any of the value between 1-4094.
  • Request sample:
{
   "vswitch":
   {
      "user_vlan_id": {
          "userid": "FVTUSER1"
          "vlanid": 100
      }
   }
}
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.

6.7.6. Delete vswitch

DELETE /vswitches/{name}

Delete a vswitch by using given name.

  • Request:
Name In Type Description
name path string vswitch name.
  • Response code:

    HTTP status code 200 on success.

  • Response contents:

    No response.