Getting resource group information

Get a list of resource groups and information about each resource group.

Method and URI

To get information about all resource groups, use a GET method and a URI:

GET     https://{hostname|IP}/api/security/resourcepool

To get information about a specific resource group, use a GET method and a URI:

GET     https://{hostname|IP}/api/security/resourcepool/{resourcepoolId}

Tip

To get a {resourcepoolId} value based on its name, follow the instructions in Getting a {resourcepoolId}.

Parameters

None.

Data

None.

Example 1: Get information about all resource groups

In this example, a Python snippet is used to get information about all resource groups:

requests.get('https://' + spp_ipv4 + '/api/security/resourcepool',
    headers={...}, data="", verify=...)
_images/reference_accounts_resourcegroup_get01.png

Figure 93 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click Accounts > Resource Group and click Refresh.

The response body for the Python snippet displays a list of all resource groups. The HTTP status of the response is 200 (OK). There are four resource groups in the list.

{
    "links": {...},
    "total": 4,
    "resourcePools": [
        {
            "links": {...},
            "name": "Hypervisor All Resource Group",
            "description": "Includes all Hypervisor resources on the system",
            "total": 0,
            "resources": [
                {
                    "metadata": {
                        "path": "Hypervisor/All:0",
                        "name": "Hypervisor All",
                        "href_host": "http://localhost:8082"
                    },
                    "include": true,
                    "path": "root:0/hypervisor.all:0",
                    "displayName": "Hypervisor all"
                },
                {
                    "metadata": {
                        "path": "System Configuration/VADP Proxy/All:0",
                        "name": "VADP proxy All",
                        "href_host": "http://localhost:8082"
                    },
                    "include": true,
                    "path": "root:0/proxy:0/proxy.type:vmdkbackup.vadpproxy",
                    "displayName": "VADP proxy all"
                },
                {
                    "metadata": null,
                    "include": true,
                    "path": "root:0/policy:0/policytype:serviceprovider.recovery
.file",
                    "displayName": "Unknown"
                },
                {
                    "metadata": {
                        "id": "1030",
                        "path": "Job/Hypervisor Recovery:1030",
                        "name": "Hypervisor Recovery",
                        "typeTitle": "Hypervisor Recovery",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/policy/types/1030"
                    },
                    "include": true,
                    "path": "root:0/policy:0/policytype:serviceprovider.recovery
.hypervisor",
                    "displayName": "Hypervisor recovery"
                },
                {
                    "metadata": {
                        "id": "1027",
                        "path": "Job/Hypervisor Inventory:1027",
                        "name": "Hypervisor Inventory",
                        "typeTitle": "Hypervisor Inventory",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/policy/types/1027"
                    },
                    "include": true,
                    "path": "root:0/policy:0/policytype:serviceprovider.catalog.
hypervisor",
                    "displayName": "Hypervisor inventory"
                },
                {
                    "metadata": {
                        "id": "1028",
                        "path": "Job/Hypervisor Backup:1028",
                        "name": "Hypervisor Backup",
                        "typeTitle": "Hypervisor Backup",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/policy/types/1028"
                    },
                    "include": true,
                    "path": "root:0/policy:0/policytype:serviceprovider.protecti
on.hypervisor",
                    "displayName": "Hypervisor backup"
                },
                {
                    "metadata": {
                        "id": "allstorageprofiles",
                        "path": "SLA Policy/All:allstorageprofiles",
                        "name": "All SLA Policies",
                        "typeTitle": "All SLA Policies",
                        "href_host": "",
                        "href_path": "allstorageprofiles"
                    },
                    "include": true,
                    "path": "root:0/storageprofile:0",
                    "displayName": "All SLA policies"
                },
                {
                    "metadata": {
                        "id": "allscripts",
                        "path": "System Configuration/Scripts/All:allscripts",
                        "name": "All Scripts",
                        "typeTitle": "All Scripts",
                        "href_host": "",
                        "href_path": "allscripts"
                    },
                    "include": true,
                    "path": "root:0/script:0",
                    "displayName": "All scripts"
                },
                {
                    "metadata": {
                        "id": "allschedules",
                        "path": "Schedule/All:allschedules",
                        "name": "All Schedules",
                        "typeTitle": "All Schedules",
                        "href_host": "",
                        "href_path": "allschedules"
                    },
                    "include": true,
                    "path": "root:0/trigger:0",
                    "displayName": "All schedules"
                },
                {
                    "metadata": {
                        "id": null,
                        "path": "Report/VM Environment",
                        "name": "VM Environment",
                        "category": "",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/report/categories/VM%20Envi
ronment"
                    },
                    "include": true,
                    "path": "root:0/report:0/reportcategory:VMEnvironmentCategor
yName",
                    "displayName": "VM environment"
                },
                {
                    "metadata": {
                        "id": "1014",
                        "path": "Report/Protection/VM SLA Policy Compliance",
                        "name": "VM SLA Policy Compliance",
                        "parentId": "",
                        "category": "Protection",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/report/1014"
                    },
                    "include": true,
                    "path": "root:0/report:0/reportcategory:ProtectionCategoryNa
me/report:1014",
                    "displayName": "VM SLA policy compliance"
                },
                {
                    "metadata": {
                        "id": "1011",
                        "path": "Report/Protection/VM Backup History",
                        "name": "VM Backup History",
                        "parentId": "",
                        "category": "Protection",
                        "href_host": "http://localhost:8082",
                        "href_path": "/api/endeavour/report/1011"
                    },
                    "include": true,
                    "path": "root:0/report:0/reportcategory:ProtectionCategoryNa
me/report:1011",
                    "displayName": "VM backup history"
                },
                {
                    "metadata": {
                        "id": "1002",
                        "path": "Report/Protection/Protected VMs",
                        "name": "Protected VMs",
                        "parentId": "",
                        "category": "Protection",
                        "href_host": "http:/localhost/:8082",
                        "href_path": "/api/endeavour/report/1002"
                    },
                    "include": true,
                    "path": "root:0/report:0/reportcategory:ProtectionCategoryNa
me/report:1002",
                    "displayName": "Protected VMs"
                },
                {
                    "metadata": {
                        "id": "allkeys",
                        "path": "System Configuration/Keys/All:allkeys",
                        "name": "All Keys",
                        "href_host": "",
                        "href_path": "allkeys"
                    },
                    "include": true,
                    "path": "root:0/identity:0/identitytype:key:0",
                    "displayName": "All keys"
                },
                {
                    "metadata": {
                        "id": "allcertificates",
                        "path": "System Configuration/Certificates//All:allcerti
ficates",
                        "name": "All Certificates",
                        "href_host": "",
                        "href_path": "allcertificates"
                    },
                    "include": true,
                    "path": "root:0/certificate:0",
                    "displayName": "All certificates"
                },
                {
                    "metadata": {
                        "id": "allcloud",
                        "path": "System Configuration/Cloud//All:allcloud",
                        "name": "All Cloud",
                        "href_host": "",
                        "href_path": "allcloud"
                    },
                    "include": true,
                    "path": "root:0/cloud:0",
                    "displayName": "All cloud"
                },
                {
                    "metadata": {
                        "id": "allcredentials",
                        "path": "Accounts/Identity/All:allcredentials",
                        "name": "All Identities",
                        "href_host": "",
                        "href_path": "allcredentials"
                    },
                    "include": true,
                    "path": "root:0/identity:0/identitytype:credential:0",
                    "displayName": "All identities"
                },
                {
                    "metadata": {
                        "id": "9",
                        "name": "Dashboard",
                        "path": "Screen/Dashboard:1",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/9"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:9",
                    "displayName": "Dashboard"
                },
                {
                    "metadata": {
                        "id": "10",
                        "name": "File Restore",
                        "path": "Screen/FileRestore:1",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/10"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:10",
                    "displayName": "File restore"
                },
                {
                    "metadata": {
                        "id": "100",
                        "name": "VMware Backup",
                        "path": "Screen/VMware Backup:100",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/100"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:100",
                    "displayName": "VMware Backup"
                },
                {
                    "metadata": {
                        "id": "101",
                        "name": "VMware Restore",
                        "path": "Screen/VMware Restore:101",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/101"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:101",
                    "displayName": "VMware Restore"
                },
                {
                    "metadata": {
                        "id": "110",
                        "name": "HyperV Backup",
                        "path": "Screen/HyperV Backup:110",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/110"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:110",
                    "displayName": "HyperV Backup"
                },
                {
                    "metadata": {
                        "id": "111",
                        "name": "HyperV Restore",
                        "path": "Screen/HyperV Restore:111",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/111"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:111",
                    "displayName": "HyperV Restore"
                },
                {
                    "metadata": {
                        "id": "13",
                        "name": "SLA Policy",
                        "path": "Screen/Policy Overview:1",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/13"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:13",
                    "displayName": "SLA policy"
                },
                {
                    "metadata": {
                        "id": "14",
                        "name": "Backup Storage",
                        "path": "Screen/BackupStorage:14",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/14"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:14",
                    "displayName": "Backup storage"
                },
                {
                    "metadata": {
                        "id": "5",
                        "name": "Report",
                        "path": "Screen/Reports:5",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/5"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:5",
                    "displayName": "Report"
                },
                {
                    "metadata": {
                        "id": "30",
                        "name": "Identity",
                        "path": "Screen/Identity:30",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/30"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:30",
                    "displayName": "Identity"
                },
                {
                    "metadata": {
                        "id": "31",
                        "name": "Keys and Certificates",
                        "path": "Screen/Keys and Certificates:30",
                        "href_host": "http:/localhost:8082",
                        "href_path": "/api/screen/31"
                    },
                    "include": true,
                    "path": "root:0/screen:0/screen:31",
                    "displayName": "Keys and certificates"
                },
                {
                    "metadata": {
                        "id": "site",
                        "name": "Site",
                        "path": "System Configuration/Site/All:site",
                        "href_host": "http:/localhost:8082",
                        "href_path": ""
                    },
                    "include": true,
                    "path": "root:0/site:0",
                    "displayName": "Site"
                }
            ],
            "rbacPath": "resourcepool:0/resourcepool:1000",
            "id": "1000"
        },
        {
            "links": {...}
            },
            "name": "Database All Resource Group",
            ...,
            "rbacPath": "resourcepool:0/resourcepool:999",
            "id": "999"
        },
        {
            "links": {...},
            "name": "All Resources",
            "description": "Includes every resource in the system. ",
            ...,
            "rbacPath": "resourcepool:0/resourcepool:1001",
            "id": "1001"
        },
        {
            "links": {...},
            "name": "BlueMachines - Dallas",
            "description": "",
            "total": 0,
            "resources": [
                {
                    "metadata": {
                        "href_host": "",
                        "href_path": "",
                        "id": "1001",
                        "name": "10.0.0.10",
                        "typeTitle": "Hypervisor",
                        "path": "Hypervisor:hypervisor/VMware:vmware/vCenters:vc
enters/10.0.0.10:1001"
                    },
                    "include": true,
                    "path": "root:0/hypervisor.all:0/hypervisor.type:vmware/hype
rvisor:1001",
                    "displayName": "10.0.0.10"
                },
                {
                    "metadata": {
                        "href_host": "",
                        "href_path": "",
                        "id": "all",
                        "name": "All",
                        "typeTitle": "All",
                        "path": "Screen:screen/All:all"
                    },
                    "include": true,
                    "path": "root:0/screen:0",
                    "displayName": "All"
                }
            ],
            "rbacPath": "resourcepool:0/resourcepool:1002",
            "id": "1002"
        }
    ]
}

Example 2: Get information about a specific resource group

In this example, a Python snippet is used to get information about a specific resource group: BlueMachines - Dallas ({resourcepoolId} 1002).

resourcepool_id = "1002"

requests.get('https://' + spp_ipv4 + '/api/security/resourcepool/'
     + resourcepool_id,
     headers={...}, data="", verify=...)

The response will show information about the resource group. The HTTP status of the response is 200 (OK).