Filters, sorting, and partials

The RecoverPoint for VMs new RESTful API fully supports filters, sorting, and partials.

Filters

Filtering in the new RecoverPoint for VMs new RESTful API is accomplished by using the field name as a query parameter.

For example, the following call filters the list of consistency groups by a specific consistency group name:

curl -X GET https://{plugin-server}/api/v1/groups?name=cg_Win2k16_PRD05

Also, filtering can be done by multiple values of the same field.

For example, the following call filters the list of consistency groups by two names:

curl -X GET https://{plugin-server}/api/v1/groups?name=cg_Win2k16_PRD05,cg_Ubuntu16_PRD01

Finally, filtering can be done by multiple fields at the same time.

For example, the following call filters the list of protected VMs by production role and specific vCenter Server:

curl -X GET https://{plugin-server}/api/v1/vms?vcName=IdanK_vCenter.lab.dell.com&role=PRODUCTION

Sorting

Sorting in the new RecoverPoint for VMs New RESTful API is accomplished by using the sort query parameter.

Sorting can be done by specifying the field name, to sort it in ascending order.

For example, the following call lists all consistency groups, sorted by name in ascending order:

curl -X GET https://{plugin-server}/api/v1/groups?sort=name

To sort the field name in descending order, and the minus - sign before the field name. For example, the following call lists all consistency groups, sorted by name in descending order:

curl -X GET https://{plugin-server}/api/v1/groups?sort=-name

Sorting can be done by multiple fields at the same time.

For example, the following call sorts lists of all consistency groups, sorted first by priority (ascending) and then by name (descending):

curl -X GET https://{plugin-server}/api/v1/groups?sort=bandwidthPriority,-name

Partials

The new RecoverPoint for VMs RESTful API supports the use of partials, which enables the ability to return specific fields.

The use of partials is accomplished by using the fields query parameter.

For example, the following call lists all protected VMs but only the name, ID, vCenter Servername, and vRPA cluster name fields are returned:

curl -X GET https://{plugin-server}/api/v1/vms?fields=name,id,vcName,rpClusterName

Tying it all together

The new RecoverPoint for VMs RESTful API fully supports the use of filters, sorting, and partials in the same request. For example, the following call lists all protected VMs:

curl -X GET https://{plugin-server}/api/v1/vms

Example output:

[
    {
        "copyId": "1720145492_433dff4829580b89_0",
        "esxClusterId": "109b5ca1-2bda-46c6-b7e1-d61b81480aed_c7",
        "esxClusterName": "Tokyo_HA1",
        "groupId": "1720145492",
        "groupName": "cg_Win2k16_PRD05",
        "guestOsType": "WINDOWS",
        "id": "109b5ca1-2bda-46c6-b7e1-d61b81480aed_fa8ba3ed-be9f-7aa6-e811-bc503a255f68",
        "localMacAddressReplication": false,
        "name": "rp.Win2k16_PRD05.copy.shadow",
        "protectFutureNewVmdks": true,
        "replicaVmdkDiskProvisioningType": "SAME_AS_SOURCE",
        "replicateVmHardware": true,
        "role": "REPLICA",
        "rpClusterId": "433dff4829580b89",
        "rpClusterName": "Tokyo",
        "status": "ACTIVE",
        "vcId": "109b5ca1-2bda-46c6-b7e1-d61b81480aed",
        "vcName": "IdanK_vCenter2.lab.dell.com",
        "vmFolderInInventory": "Tokyo/vm/rp.Win2k16_PRD05.copy.shadow",
        "vmReplicationId": "ed7e3947fdfa51b5",
        "vmdks": [
            {
                "included": true,
                "name": "Hard disk 2",
                "path": "SCSI (0:1)",
                "sizeInMB": 10240
            },
            {
                "included": true,
                "name": "Hard disk 1",
                "path": "SCSI (0:0)",
                "sizeInMB": 20480
            }
        ]
    },
    {
        "copyId": "1720145492_12560a07b180d47_0",
        "esxClusterId": "697bcf66-144d-4cae-930d-6364f96350ac_c52",
        "esxClusterName": "Venice_HA1",
        "groupId": "1720145492",
        "groupName": "cg_Win2k16_PRD05",
        "guestOsType": "WINDOWS",
        "id": "697bcf66-144d-4cae-930d-6364f96350ac_50166721-a07b-8a06-4e12-90e9701f278c",
        "localMacAddressReplication": false,
        "name": "Win2k16_PRD05",
        "protectFutureNewVmdks": true,
        "replicaVmdkDiskProvisioningType": "SAME_AS_SOURCE",
        "replicateVmHardware": true,
        "role": "PRODUCTION",
        "rpClusterId": "12560a07b180d47",
        "rpClusterName": "Venice",
        "status": "ACTIVE",
        "vcId": "697bcf66-144d-4cae-930d-6364f96350ac",
        "vcName": "IdanK_vCenter.lab.dell.com",
        "vmFolderInInventory": "Venice/vm/Win2k16_PRD05",
        "vmReplicationId": "ed7e3947fdfa51b5",
        "vmToolsVersion": "10246",
        "vmdks": [
            {
                "included": true,
                "name": "Hard disk 2",
                "path": "SCSI (0:1)",
                "sizeInMB": 10240
            },
            {
                "included": true,
                "name": "Hard disk 1",
                "path": "SCSI (0:0)",
                "sizeInMB": 20480
            }
        ]
    },
    {
        "copyId": "778643668_433dff4829580b89_0",
        "esxClusterId": "109b5ca1-2bda-46c6-b7e1-d61b81480aed_c7",
        "esxClusterName": "Tokyo_HA1",
        "groupId": "778643668",
        "groupName": "cg_Ubuntu16_PRD01",
        "guestOsType": "LINUX",
        "id": "109b5ca1-2bda-46c6-b7e1-d61b81480aed_5034a87b-66c1-56dd-3021-b86181a35250",
        "localMacAddressReplication": false,
        "name": "Ubuntu16_PRD01",
        "protectFutureNewVmdks": true,
        "replicaVmdkDiskProvisioningType": "SAME_AS_SOURCE",
        "replicateVmHardware": true,
        "role": "PRODUCTION",
        "rpClusterId": "433dff4829580b89",
        "rpClusterName": "Tokyo",
        "status": "PAUSED",
        "vcId": "109b5ca1-2bda-46c6-b7e1-d61b81480aed",
        "vcName": "IdanK_vCenter2.lab.dell.com",
        "vmFolderInInventory": "Tokyo/vm/Ubuntu16_PRD01",
        "vmReplicationId": "bc200d75c258921d",
        "vmToolsVersion": "10304",
        "vmdks": [
            {
                "included": true,
                "name": "Hard disk 1",
                "path": "SCSI (0:0)",
                "sizeInMB": 16384
            }
        ]
    },
    {
        "copyId": "778643668_12560a07b180d47_0",
        "esxClusterId": "697bcf66-144d-4cae-930d-6364f96350ac_c52",
        "esxClusterName": "Venice_HA1",
        "groupId": "778643668",
        "groupName": "cg_Ubuntu16_PRD01",
        "guestOsType": "LINUX",
        "id": "697bcf66-144d-4cae-930d-6364f96350ac_d4d828b2-7ff9-3e75-e301-415e4c934bd6",
        "localMacAddressReplication": false,
        "name": "rp.Ubuntu16_PRD01.copy.shadow",
        "protectFutureNewVmdks": true,
        "replicaVmdkDiskProvisioningType": "SAME_AS_SOURCE",
        "replicateVmHardware": true,
        "role": "REPLICA",
        "rpClusterId": "12560a07b180d47",
        "rpClusterName": "Venice",
        "status": "PAUSED",
        "vcId": "697bcf66-144d-4cae-930d-6364f96350ac",
        "vcName": "IdanK_vCenter.lab.dell.com",
        "vmFolderInInventory": "Venice/vm/rp.Ubuntu16_PRD01.copy.shadow",
        "vmReplicationId": "bc200d75c258921d",
        "vmdks": [
            {
                "included": true,
                "name": "Hard disk 1",
                "path": "SCSI (0:0)",
                "sizeInMB": 16384
            }
        ]
    }
]

Finally, here is an example that shows only protected VMs with the role of Replica, sorted by name and showing only specific fields:

curl -X GET https://{plugin-server}/api/v1/vms?vcName=IdanK_vCenter.lab.dell.com&role=REPLICA&sort=name&fields=name,id,rpClusterName

Example output:

[
    {
        "id": "697bcf66-144d-4cae-930d-6364f96350ac_d4d828b2-7ff9-3e75-e301-415e4c934bd6",
        "name": "rp.Ubuntu16_PRD01.copy.shadow",
        "rpClusterName": "Venice"
    }
]