Editing the configuration of a site

You can edit settings for a site. You can change the site name and other options for the default Primary and Secondary sites.

Method and URI

To update the site of {siteId}, use a PUT method and a URI:

PUT     https://{hostname|IPv4}/api/site/{siteId}

Tip

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

Parameters

None.

Data

The data key-value pairs are the same as for a site. For more information, follow the instructions in Adding a site.

Example: Edit the configuration of a site

As you can see in the IBM Spectrum Protect Plus interface in your web browser, every site allows you to specify throttles to restrict the bandwidth that IBM Spectrum Protect Plus uses.

For example, assume that you added a site that is named Dallas ({siteId} 3100). You want to assign the following values to this site:

  • Rename it Singapore

  • Remove all throttles

  • Add the description BlueMachines Singapore Data Center.

A Python snippet that is similar to the following example can be used to update the configuration of a site:

site_id = "3100"    # Dallas

_data = f'''{{
    "name":        "Singapore",
    "description": "BlueMachines Singapore Data Center",
    "defaultSite": false,
    "throttles":   [],
    "loadBalanceRatio": 100
    }}'''

requests.put('https://10.0.0.100/api/site/' + site_id,
    headers={...}, data=_data, verify=...)

After you run the Python snippet, ensure that you get a response with the HTTP status of 200 (OK) and that the site is updated. This request is similar to the one that you used to create the site; compare the HTTP request method, the URI, the data values, and the HTTP status code in the response.