Lock or unlock a Network Function

post

/rest/{versionId}/inventory/nf-mgmt/nfs/action/{nfId}

Use this (POST) method to lock or unlock all the devices within a network function

Request

Path Parameters
Back to Top

Response

204 Response

Action executed successfully.

400 Response

The user input is invalid.

401 Response

The user is unauthorized.

403 Response

The user does not have permission for the attempted action.

404 Response

The object (resource URI, network function, and so on) of your input request cannot be found.

409 Response

The NF is already in same state as that of the targeted action.

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 lock or unlock a Network Function.

curl -X POST \
    -d @request.json \
    -H @auth_header.txt \
    "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/nf-mgmt/nfs/action/<nfId>"

The following example shows how to use Python to lock or unlock a Network Function.

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/nf-mgmt/nfs/action/<nfId>"
resp = requests.post(url, headers=headers, data=data)

Note:

Use the Get List of NFs in Device Management API to find the nfId parameter.

Example of the Request Body

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

{
  "type": "Lock"
}

Example of the Response Body

This endpoint does not return a response body.

Example 2 of Accessing this API

This example shows unlocking a Network Function.

curl -X POST \
    -d @request.json \
    -H @auth_header.txt \
    "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/nf-mgmt/nfs/action/<nfId>"

The following shows an example of the request body.

{
  "type": "Unlock"
}

The following shows an example response.

Back to Top