UpdateBareMetal2Gateway

API Request

URLs
PUT zstack/v1/baremetal2/gateways/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateBareMetal2Gateway": {
    "sshPort": 22.0,
    "password": "password",
    "name": "NEW_BM_GATEWAY",
    "description": "This is a new bare metal gateway.",
    "managementIp": "192.168.0.10"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateBareMetal2Gateway":{"sshPort":22.0,"password":"password","name":"NEW_BM_GATEWAY","description":"This is a new bare metal gateway.","managementIp":"192.168.0.10"}}' http://localhost:8080/zstack/v1/baremetal2/gateways/bb000d56b8143341a57a76b7344b9b65/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
sshPort Integer body(contained in the updateBareMetal2Gateway structure) Optional. The SSH port. 4.0.0
username String body(contained in the updateBareMetal2Gateway structure) Optional. The username of the gateway. 4.0.0
password String body(contained in the updateBareMetal2Gateway structure) Optional. The password of the gateway. 4.0.0
uuid String url The gateway UUID. 4.0.0
name String body(contained in the updateBareMetal2Gateway structure) Optional. The name of the gateway. 4.0.0
description String body(contained in the updateBareMetal2Gateway structure) Optional. The detailed description of the gateway. 4.0.0
managementIp String body(contained in the updateBareMetal2Gateway structure) Optional. The IP address of the management node. 4.0.0
systemTags List body Optional. The system tags. 4.0.0
userTags List body Optional. The user tags. 4.0.0

API Response

Sample Response
{
  "inventory": {
    "username": "username",
    "password": "password",
    "sshPort": 22.0,
    "zoneUuid": "e5337859dc214ce49ce31acea22a3bab",
    "name": "BM_GATEWAY",
    "uuid": "ce1634f0ff72403fbb457b1630420096",
    "description": "This is a bare metal gateway.",
    "managementIp": "192.168.0.10",
    "state": "Enabled",
    "status": "Connected",
    "createDate": "Nov 14, 2017 10:20:57 PM",
    "lastOpDate": "Nov 14, 2017 10:20:57 PM"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 4.0.0
inventory BareMetal2GatewayInventory See inventory. 4.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 4.0.0
description String The brief description of the error. 4.0.0
details String The details about the error. 4.0.0
elaboration String The reserved field. Default value: null. 4.0.0
opaque LinkedHashMap The reserved field. Default value: null. 4.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.0.0
#inventory
Name Type Description Starting Version
attachedClusterUuids List The attached cluster UUIDs. 4.0.0
username String The username of the gateway. 4.0.0
sshPort Integer The SSH port. 4.0.0
zoneUuid String The zone UUID. 4.0.0
name String The name of the gateway. 4.0.0
uuid String The UUID of the gateway. 4.0.0
clusterUuid String The cluster UUID. 4.0.0
description String The detailed description of the gateway. 4.0.0
managementIp String The IP address of the management node. 4.0.0
hypervisorType String The virtualization type. 4.0.0
state String The state of the gateway. 4.0.0
status String The connection status of the gateway. 4.0.0
totalCpuCapacity Long The total processing capacity of CPU. 4.0.0
availableCpuCapacity Long The available processing capacity of CPU. 4.0.0
cpuSockets Integer 4.0.0
totalMemoryCapacity Long The total memory size. 4.0.0
availableMemoryCapacity Long The available memory size. 4.0.0
cpuNum Integer The number of CPU cores. 4.0.0
createDate Timestamp The time when the gateway was created. 4.0.0
lastOpDate Timestamp The time when the was gateway last modified. 4.0.0
provisionNic BareMetal2GatewayProvisionNicInventory See provisionNic. 4.0.0
#provisionNic
Name Type Description Starting Version
uuid String The NIC UUID. 4.0.0
networkUuid String The deployment network UUID. 4.0.0
interfaceName String The name of the NIC. 4.0.0
ip String The IP address of the NIC. 4.0.0
netmask String The netmask of the NIC. 4.0.0
gateway String The gateway. 4.0.0
metadata String 4.0.0
createDate Timestamp The time when the NIC was created. 4.0.0
lastOpDate Timestamp The time when the NIC was last modified. 4.0.0

SDK Sample

Java SDK
UpdateBareMetal2GatewayAction action = new UpdateBareMetal2GatewayAction();
action.sshPort = 22.0;
action.password = "password";
action.uuid = "bb000d56b8143341a57a76b7344b9b65";
action.name = "NEW_BM_GATEWAY";
action.description = "This is a new bare metal gateway.";
action.managementIp = "192.168.0.10";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateBareMetal2GatewayAction.Result res = action.call();
Python SDK
UpdateBareMetal2GatewayAction action = UpdateBareMetal2GatewayAction()
action.sshPort = 22.0
action.password = "password"
action.uuid = "bb000d56b8143341a57a76b7344b9b65"
action.name = "NEW_BM_GATEWAY"
action.description = "This is a new bare metal gateway."
action.managementIp = "192.168.0.10"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateBareMetal2GatewayAction.Result res = action.call()