Getting site information

You can get a list of sites and information for each, or get information about a specific site.

Method and URI

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

GET     https://{hostname|IP}/api/site

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

GET     https://{hostname|IP}/api/site/{siteId}

Tip

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

Parameters

None.

Data

None.

Example 1: Get information about all sites

Assume that you have added a site, “Dallas”. A Python snippet that is similar to the following example can be used to request a list of all sites and their information:

requests.get('https://' + spp_ipv4 + '/api/site',
    headers={...}, verify=...)
_images/reference_site01.png

Figure 49 The same action can be taken in the IBM Spectrum Protect Plus web user interface: In the navigation pane, click System Configuration > Site.

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK).

{
    "links": {...},
    "total": 4,
    "sites": [
        {
            "links": {...},
            "id": "2000",
            "name": "Secondary",
            "description": "secondary site",
            "defaultSite": false,
            "throttles": null,
            "demo": false,
            "rbacPath": "root:0/site:0/site:2000"
        },
        {
            "links": {...},
            "id": "1000",
            "name": "Primary",
            "description": "Primary Site",
            "defaultSite": true,
            "throttles": null,
            "demo": false,
            "rbacPath": "root:0/site:0/site:1000"
        },
        {
            "links": {...},
            "id": "3110",
            "name": "Dallas",
            "description": null,
            "defaultSite": false,
            "throttles": [
                {
                    "rate": "786432000",
                    "schedules": [
                        {
                            "start": 133200,
                            "end": 165599
                        },
                        {
                            "start": 219600,
                            "end": 251999
                        },
                        ...,
                        {
                            "start": 565200,
                            "end": 590399
                        }
                    ]
                }
            ],
            "demo": false,
            "rbacPath": "root:0/site:0/site:3110"
        }
    ]
}

For information about enabling throttling for sites to limit the bandwidth used by IBM Spectrum Protect Plus, follow the instructions in Adding a site.

Example 2: Get information about a specific site

Assume that you want to get information about the site with the following {siteId}: 2000. A Python snippet that is similar to the following example can be used to request the information about this site:

site_id = "2000"

requests.get('https://' + spp_ipv4 + '/api/site/' + site_id,
    headers={...}, verify=...)

The request prompts a response that is structured as shown, with the HTTP status of 200 (OK).

{
    "links": {...},
    "id": "2000",
    "name": "Secondary",
    "description": "secondary site",
    "defaultSite": false,
    "throttles": null,
    "demo": false,
    "rbacPath": "root:0/site:0/site:2000"
}