Add a single configuration element instance
post
/rest/{version}/configuration/configElements
Adds a single instance of the specified configuration element type to the system configuration. The client making the POST request must already possess the configuration lock or the request fails. If the configuration element type is a singleton - meaning only one instance can exist in the system configuration - the instance must first be created using POST, supplying only the element type in the POST request. The instance can then be edited via a subsequent PUT request. For any element type that supports multiple instances, the key attribute(s) sent in the POST request must not duplicate the key attribute(s) for any already configured instance. The client can supply as many non-key attributes and sub-elements in the POST request for an element type that supports multiple instances. If the client attempts to create a singleton element type that has already been created, or if the key attributes duplicate an existing instance, the SBC returns a 409 Conflict. If one or more attributes or sub-elements in the request is syntactically invalid, the POST request fails and the system configuration is left unmodified.
Request
Path Parameters
-
version: string
For this release, the value is "v1.0".
Header Parameters
-
Authorization:
The value in the Authorization header must be the string "Bearer <access token>", where <access token> is a valid, unexpired token received in response to a prior /auth/token request.
Supported Media Types
- application/xml
The client must supply the element type in all POST requests. If the element type being created is a singleton, no other information is required in the request body. If the element type being created can have multiple instances, the key attribute(s) for the type must be provided using <attribute> tags.
Nested Schema : items
Type:
object
Response
Supported Media Types
- application/xml
200 Response
Successful creation of the requested instance. The complete configuration data (all supported attributes and sub-elements) are returned in the response body.
Nested Schema : links
Type:
object
Nested Schema : messages
Type:
object
Nested Schema : items
Type:
object
400 Response
The request is malformed. For example, one or more attribute or sub-element values may be syntactically invalid.
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
401 Response
The client is not authorized.
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
403 Response
This request requires the client to have administrator privileges.
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
404 Response
Unsupported versionId in URI, or requested element type not supported
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
409 Response
Attempt to create an existing singleton element type, or the supplied key attribute values already exist for a configured element instance.
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
423 Response
The request requires the configuration lock and failed because the client does not currently own the lock. If another client or user currently owns the configuration lock, the error message is "Resource locked by another user". If no client or user owns the configuration lock, the error message is "User does not have the lock".
Nested Schema : data
Type:
object
Nested Schema : links
Type:
object
Examples
The following example shows how to add a single configuration element instance by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL
curl -X POST \ --header 'Accept: application/xml' \ --header 'Authorization: Bearer <token>' \ -d@request.xml \ 'https://10.0.0.2/rest/v1.0/configuration/configElements?elementType=ntp-config'
The following shows an example of the contents of the request.xml
file sent as the request body.
<?xml version="1.0" encoding="UTF-8"?> <configElement> <elementType>ntp-config</elementType> <attribute> <name>server</name> <value>10.0.0.12</value> </attribute> </configElement>
Example of the Response Headers
The following shows an example of the response headers.
HTTP/1.1 200 OK Date: Wed, 08 Aug 2018 12:26:21 GMT Cache-Control: no-cache Content-Length: 495 Content-Type: application/xml Connection: keep-alive Keep-Alive: timeout=60, max=99 Last-Modified: Wed, 08 Aug 2018 12:26:21 GMT X-Appweb-Seq: 144
Example of the Response Body
The following example shows the contents of the response body in XML format.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response> <data> <configElement> <elementType>ntp-config</elementType> <attribute> <name>server</name> <value>10.0.0.12</value> </attribute> <attribute> <name>last-modified-by</name> <value>REST-admin@10.0.0.4</value> </attribute> <attribute> <name>last-modified-date</name> <value>2018-08-08 12:26:21</value> </attribute> </configElement> </data> <messages/> <links/> </response>