Skip to main content
Resource Center/Resource Pool/VM Instance Operations

AttachVmNicToVm

AttachVmNicToVm

POST/zstack/v1/vm-instances/{vmInstanceUuid}/nices/{vmNicUuid}

Operation ID

AttachVmNicToVm

Since

4.0.0

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

application/json

Path Parameters

  • vmNicUuid
    StringRequired

    The NIC UUID.

  • vmInstanceUuid
    ListRequired

    The VM UUID.

Body Fields

  • systemTags
    List

    Optional. The system tags。

  • userTags
    List

    Optional. The user tags.

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • error
    ErrorCodeRequired

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

    • code
      StringRequired

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

    • description
      StringRequired

      The brief description of the error.

    • details
      StringRequired

      The details about the error.

    • elaboration
      StringRequired

      The reserved field. Default value: null.

    • opaque
      LinkedHashMapRequired

      The reserved field. Default value: null.

    • cause
      ErrorCodeRequired

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

  • inventory
    VmInstanceInventoryRequired

    See inventory

    • uuid
      StringRequired

      The VM UUID.

    • name
      StringRequired

      The VM name.

    • description
      StringRequired

      The detailed description of the VM.

    • zoneUuid
      StringRequired

      The zone UUID.

    • clusterUuid
      StringRequired

      The cluster UUID.

    • imageUuid
      StringRequired

      The image UUID.

    • hostUuid
      StringRequired

      The host UUID.

    • lastHostUuid
      StringRequired

      The UUID of the host on which the VM instance was running last time.

    • instanceOfferingUuid
      StringRequired

      The instance offering UUID.

    • rootVolumeUuid
      StringRequired

      The root volume UUID.

    • platform
      StringRequired

      The platform on which the VM instance is running.

    • defaultL3NetworkUuid
      StringRequired

      The UUID of the default L3 network.

    • type
      StringRequired

      The VM instance type.

    • hypervisorType
      StringRequired

      The hypervisor type of the VM instance.

    • memorySize
      LongRequired

      The memory size.

    • cpuNum
      IntegerRequired

      The number of CPU cores of the VM instance.

    • cpuSpeed
      LongRequired

      The CPU speed.

    • allocatorStrategy
      StringRequired

      The allocator strategy.

    • createDate
      TimestampRequired

      The time when the VM instance was created.

    • lastOpDate
      TimestampRequired

      The time when the VM instance was last modified.

    • state
      StringRequired

      The state of the VM instance.

    • vmNics
      ListRequired

      See vmNics.

      • uuid
        StringRequired

        The UUID of the NIC.

      • vmInstanceUuid
        StringRequired

        The VM UUID.

      • l3NetworkUuid
        StringRequired

        The L3 network UUID.

      • ip
        StringRequired

        The IP address of the NIC.

      • mac
        StringRequired

        The MAC address of the NIC.

      • hypervisorType
        StringRequired

        The virtualization type.

      • netmask
        StringRequired

        The netmask of the NIC.

      • gateway
        StringRequired

        The gateway IP address.

      • metaData
        StringRequired

        The metadata.

      • ipVersion
        IntegerRequired

        The version of the IP address.

      • deviceId
        IntegerRequired

        The device ID.

      • type
        StringRequired

        The NIC type.

      • createDate
        TimestampRequired

        The time when the NIC was added.

      • lastOpDate
        TimestampRequired

        The time when the NIC was last modified.

      • usedIps
        ListRequired

        See usedIps

        • uuid
          StringRequired

          The IP address UUID.

        • ipRangeUuid
          StringRequired

          The IP range UUID.

        • l3NetworkUuid
          StringRequired

          The L3 network UUID.

        • ipVersion
          IntegerRequired

          The IP version.

        • ip
          StringRequired

          The IP address.

        • netmask
          StringRequired

          The netmask.

        • gateway
          StringRequired

          The gateway.

        • usedFor
          StringRequired

          The intended use.

        • ipInLong
          longRequired

          The IP address represented as a long integer.

        • vmNicUuid
          StringRequired

          The VM NIC UUID.

        • createDate
          TimestampRequired

          The time when the IP address was used.

        • lastOpDate
          TimestampRequired

          The time when the IP address was last modified.

    • allVolumes
      ListRequired

      See allVolumes.

      • uuid
        StringRequired

        The volume UUID.

      • name
        StringRequired

        The volume name.

      • description
        StringRequired

        The detailed description of the volume.

      • primaryStorageUuid
        StringRequired

        The primary storage UUID.

      • vmInstanceUuid
        StringRequired

        The bare metal instance UUID.

      • diskOfferingUuid
        StringRequired

        The volume offering UUID.

      • rootImageUuid
        StringRequired

        The root image UUID.

      • installPath
        StringRequired

        The installation path of the volume in the primary storage.

      • type
        StringRequired

        The type of the volume.

      • format
        StringRequired

        The format of the volume.

      • size
        LongRequired

        The size of the volume.

      • actualSize
        LongRequired

        The actual storage space that the volume takes up.

      • deviceId
        IntegerRequired

        The device ID.

      • state
        StringRequired

        The state of the volume.

      • status
        StringRequired

        The status of the volume.

      • createDate
        TimestampRequired

        The time when the volume was created.

      • lastOpDate
        TimestampRequired

        The time when the volume was last modified.

      • isShareable
        BooleanRequired

        Indicates whether the volume is shareable.

      • volumeQos
        StringRequired

        The QoS of the volume, for example, 1048576.