Assign sites

post

/rest/{versionId}/inventory/device-mgmt/sites/{managingSiteId}/assign

Use this (POST) method to assign sites to managing site. A site is used to group Network Functions (NFs) and devices based on their physical location.

Request

Path Parameters
Back to Top

Response

200 Response

Assigned sites successfully.

400 Response

The user input is invalid.

401 Response

The user is unauthorized.

403 Response

The user doesn't have the required permission

404 Response

The resource URI of your input request cannot be found

409 Response

The assign sites are already managed by managing site

500 Response

An internal server error has occurred while processing the request.
Back to Top

Examples

Examples of Accessing the API

See Authenticate page to acquire a token.

The following example shows how to use curl to assign sites.

curl -X POST \
    -d @request.json \
    -H @auth_header.txt \
    "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/device-mgmt/sites/<managingSiteId>/assign"

The following example shows how to use Python to assign sites.

import requests
import json
headers = {
	"Accept": "application/json",
	"Authorization": "Bearer <auth-token>"
}
with open("request.json") as f: data = json.load(f)
url  = "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/device-mgmt/sites/<managingSiteId>/assign"
resp = requests.post(url, headers=headers, data=data)

Note:

Use the Retrieves all Sites API to find the managingSiteId parameter.

Example of the Request Body

The following shows an example of the contents of the request file sent as the request body.

{
  "assignSiteIds": [
    "22",
    "21"
  ]
}

Example of the Response Body

The following example shows the contents of the response body.

{
  "assignedSites": [
    {
      "isMgmtEnabled": false,
      "noOfMCE": "1",
      "noOfNetworkFunctions": "2",
      "siteDescription": "newDesc",
      "siteId": "1",
      "siteName": "local",
      "siteRegistrationId": "YF7MH51V1"
    },
    {
      "isMgmtEnabled": false,
      "noOfMCE": "0",
      "noOfNetworkFunctions": "0",
      "siteId": "22",
      "siteName": "siteTest",
      "siteRegistrationId": "JH789JRJ22"
    },
    {
      "isMgmtEnabled": false,
      "noOfMCE": "0",
      "noOfNetworkFunctions": "0",
      "siteId": "21",
      "siteName": "test",
      "siteRegistrationId": "63KGGOLX21"
    }
  ],
    "managingSite": {
    "isMgmtEnabled": false,
    "noOfMCE": "1",
    "noOfNetworkFunctions": "2",
    "siteDescription": "newDesc",
    "siteId": "1",
    "siteName": "local",
    "siteRegistrationId": "YF7MH51V1"
  }
}
Back to Top