Skip to main content
Resource Center/Resource Pool/VM Instance Operations
POSTVM Instance OperationsSince 4.0.0SynchronousAuth Required

CreateVmNic

CreateVmNic

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Request Inputs

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • l3NetworkUuidStringRequired

      The L3 network UUID.

    • ipString

      Optional.

    • resourceUuidString

      Optional.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryVmInstanceInventoryRequired

    See inventory.

    • uuidStringRequired

      The NIC UUID.

    • vmInstanceUuidStringRequired

      The VM instance UUID.

    • l3NetworkUuidStringRequired

      The L3 network UUID.

    • ipStringRequired

      The IP address of the NIC.

    • macStringRequired

      The MAC address of the NIC.

    • hypervisorTypeStringRequired

      The virtualization type.

    • netmaskStringRequired

      The netmask.

    • gatewayStringRequired

      The gateway IP address.

    • metaDataStringRequired

      元数据。

    • ipVersionIntegerRequired

      The IP version.

    • deviceIdIntegerRequired

      The device ID.

    • typeStringRequired

      The NIC type.

    • createDateTimestampRequired

      The time when the NIC was created.

    • lastOpDateTimestampRequired

      The time when the NIC was last modified.

    • usedIpsListRequired

      See usedIps

      • uuidStringRequired

        The UUID of the IP address.

      • ipRangeUuidStringRequired

        The IP range UUID.

      • l3NetworkUuidStringRequired

        The L3 network UUID.

      • ipVersionIntegerRequired

        The IP version.

      • ipStringRequired

        The IP address.

      • netmaskStringRequired

        The netmask of the IP address.

      • gatewayStringRequired

        The gateway IP address.

      • usedForStringRequired

        已使用用于。

      • ipInLonglongRequired

        No description provided.

      • vmNicUuidStringRequired

        The NIC UUID.

      • createDateTimestampRequired

        The time when the IP address was used.

      • lastOpDateTimestampRequired

        The time when the IP address was last modified.

Endpoint

POST/zstack/v1/nics

/zstack/v1/nics

Operation ID

CreateVmNic

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/nics' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"l3NetworkUuid":"<l3NetworkUuid>","ip":"<ip>","resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "158c432596ab3418bbdd04583541d42d", "usedIpUuid": "acfdb23e1b0e39e48b10ee02d10ed74f", "l3NetworkUuid": "a1791966d2fd375bbb469dd0308d3be6", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0.0, "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } }

Change History

This API has no change history records yet.

View all change history