Skip to content

Latest commit

 

History

History
145 lines (116 loc) · 3.03 KB

General - Configuration Settings Batch.adoc

File metadata and controls

145 lines (116 loc) · 3.03 KB

General - Configuration Settings Batch

The /api/edge/batch.json endpoint allows you to make batch queries/deletions/updates to specific parts of the device’s configuration.

It does not support a HTTP GET.

This method is CSRF protected so also requires a X-CSRF-TOKEN (see Sensitive Requests (CSRF Protection)).

Request

Root

Name Type Values Description

SET (Optional)

Object

JSON configuration

The JSON configuration attributes to set.

DELETE (Optional)

Object

JSON configuration

The JSON configuration attributes to delete.

GET (Optional)

Object

JSON configuration

The JSON configuration attributes to get.

Response

Root

Name Type Values Description

SET

Object

status object

An object that contains status values for the set request.

DELETE

Object

status object

An object that contains status values for the deletion request.

SESSION_ID

String

A session ID

The authorisation string for this session that confirms the user is correctly authenticated.

GET

String

JSON configuration

The requested section of the configuration after the operation is performed (defaults to the requested section for deletion/setting by default).

COMMIT

Object

status object

An object that contains status values for the configuration commit request.

SAVE

Object

status object

An object that contains status values for the configuration save request.

success

Boolean

true or false

Whether the API request was successful.

status Object

Name Type Values Description

failure (Optional)

String

A boolean encapsulated in a string (e.g. "0" or "1")

Whether the operation failed.

success

String

A boolean encapsulated in a string (e.g. "0" or "1")

Whether the configuration settings batch operation was successful.

Examples

Set UNMS Hostname & Enable

POST /api/edge/batch.json Request
{
    "SET":{"system":{"host-name":"<hostname>"},"service":{"unms":{"disable":null}}},
    "GET":{"system":null,"service":null}
}
POST /api/edge/batch.json Response
{
    "SET": {"failure": "0", "success": "1"},
    "SESSION_ID": "session_id",
    "GET": {
             "system": { system as json },
             "service": { service as json },
             ....
           },
    "COMMIT": {"failure": "0", "success": "1"},
    "SAVE": {"success": "1"},
    "success": true
}

Delete Custom Attribute

POST /api/edge/batch.json Request
{"DELETE":{"custom-attribute":null}}
POST /api/edge/batch.json Response
{"DELETE": {"failure": "0", "success": "1"}, "SESSION_ID": "742dfcc13b8d449aa36a4a1847bfcef7", "GET": { .. Configuration .. }, "COMMIT": {"failure": "0", "success": "1"}, "SAVE": {"success": "1"}, "success": true}