Skip to main content
Resource Center/Hardware/Host Operations/PCI Device Operations
POSTPCI Device OperationsSince 3.5.0SynchronousAuth Required

AttachMdevDeviceToVm

AttachMdevDeviceToVm

Execution Availability

Try It Out

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

Path Parameters

Request Inputs

Path Parameters

  • mdevDeviceUuidStringRequired

    The MDEV device UUID.

  • vmInstanceUuidStringRequired

    The VM instance UUID.

Body Fields

  • 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.

  • inventoryMdevDeviceInventoryRequired

    See inventory

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The detailed description of the resource.

    • parentUuidStringRequired

      The UUID of the physical PCI device.

    • hostUuidStringRequired

      The host UUID.

    • vmInstanceUuidStringRequired

      The VM instance UUID.

    • mdevSpecUuidStringRequired

      The UUID of the MDEV device specification.

    • createDateTimestampRequired

      The creation date.

    • lastOpDateTimestampRequired

      The last operation date.

    • typeMdevDeviceTypeRequired

      See type.

      • GPU_Video_ControllerMdevDeviceTypeRequired

        The GPU video controller.

    • stateMdevDeviceStateRequired

      See state.

      • EnabledMdevDeviceStateRequired

        The MDEV device is enabled.

      • DisabledMdevDeviceStateRequired

        The MDEV device is disabled.

    • statusMdevDeviceStatusRequired

      See status.

      • ActiveMdevDeviceStatusRequired

        The active status.

      • AttachedMdevDeviceStatusRequired

        The attached status.

Endpoint

POST/zstack/v1/mdev-devices/{mdevDeviceUuid}/vm-instances/{vmInstanceUuid}

/zstack/v1/mdev-devices/{mdevDeviceUuid}/vm-instances/{vmInstanceUuid}

Operation ID

AttachMdevDeviceToVm

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/mdev-devices/{mdevDeviceUuid}/vm-instances/{vmInstanceUuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "2b29e6effba34e848164039e02511b89", "name": "GRID M60-2A", "parentUuid": "e9e3fe7b21644a19ac33e84dd27e3175", "hostUuid": "af505b47d522413d99d361b93cf92d2a", "mdevSpecUuid": "072b847576c34b419a29b16f62198e09", "type": "GPU_Video_Controller", "state": "Enabled", "status": "Active", "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