Cns Volume Manager Cns Query Async

Cns Volume Manager Cns Query Async
Returns container volumes matching criteria set in the filter.

Returns container volumes matching criteria set in the filter.

This API will return partial results even when some of the volume IDs are invalid or non-existent. Invalid inputs, like empty volume ID or unknown volume ID, will be excluded from the results. For valid inputs, if the output doesn't contain information for that volume that would mean that CNS is not aware of the existence of that volume. Note that there could be duplicate volumes or missing volumes across multiple pages returned by this API when there are parallel volume provisioning operations like create, delete are in progress.

Following privileges will be required on specified entities, to perform this operation:

  • Cns.Searchable on RootFolder to search over all container volumes

Required privileges: Cns.Searchable

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsQueryAsync
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case CnsVolumeManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 9.1.0.0 APIs.


Request Body
CnsQueryAsyncRequestType of type(s) application/json
Required

Show optional properties

{
    "filter": {}
}
{
    "filter": {
        "_typeName": "string",
        "volumeIds": [
            {
                "_typeName": "string",
                "id": "string"
            }
        ],
        "names": [
            "string"
        ],
        "containerClusterIds": [
            "string"
        ],
        "storagePolicyId": "string",
        "datastores": [
            {
                "_typeName": "string",
                "type": "string",
                "value": "string"
            }
        ],
        "labels": [
            {
                "_typeName": "string",
                "key": "string",
                "value": "string"
            }
        ],
        "complianceStatus": "string",
        "datastoreAccessibilityStatus": "string",
        "cursor": {
            "_typeName": "string",
            "offset": 0,
            "limit": 0,
            "totalRecords": 0
        },
        "healthStatus": "string"
    },
    "selection": {
        "_typeName": "string",
        "names": [
            "string"
        ]
    }
}
filter
Required

All container volumes matching the criteria set in the filter will be returned. A maximum of 1000 volume ids can be provided. See CnsQueryFilter

selection
Optional

Selection spec for the query entities to return. This is an optional parameter. All volume fields would be returned if the parameter is not specified. See CnsQuerySelection

Authentication
This operation uses the following authentication methods.
Responses
200

Task to track the progress and result of this operation. For result type in task, see CnsAsyncQueryResult

Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidArgument: Thrown in case of invalid input arguments, like empty strings, invalid formats, invalid combination of inputs

CnsFault: Thrown for all other failure scenarios

Returns MethodFault of type(s) application/json
This response body class contains all of the following: Any
{
    "_typeName": "string",
    "faultCause": {
        "_typeName": "string",
        "faultCause": "MethodFault Object",
        "faultMessage": [
            {
                "_typeName": "string",
                "key": "string",
                "arg": [
                    {
                        "_typeName": "string",
                        "key": "string",
                        "value": {
                            "_typeName": "string"
                        }
                    }
                ],
                "message": "string"
            }
        ]
    },
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}
faultCause
Optional

Fault which is the cause of this fault.

array of object
faultMessage
Optional

Message which has details about the error Message can also contain a key to message catalog which can be used to generate better localized messages.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"filter":"{}"}' https://{api_host}/sdk/vim25/{release}/vsan/CnsVolumeManager/{moId}/CnsQueryAsync