New sensors can be created by submitting a POST request to following URI:
HTTP Verb: POST
https://hostname/api/v1/sensors/domain
STATUS: DEPRECATED
HTTP Verb: POST
https://hostname/api/v1/sensors/create_domain
A JSON payload should be submitted alongside this request. Allowed payload parameters are:
uuid
(optional) UUID the new domain will receive on creation. It must not be in use by any existing domain. If not specified an unused random one will be asigned.
name
Name of the domain.
domain_type
(optional) A number indicating domain type. By default, the domain type is generic (1).
Available domain types:
Generic: 1
Organization: 2
Market: 3
Campus: 4
Building: 5
Service Provider: 6
Deplyment: 7
Floor: 101
parent_uuid
(optional) UUID of the parent. By default, it's the top domain of user.
mac_hashing_salt
(optional) String with MAC Hashing Salt for a Service Provider domain. If the domain_type is not equal to 6 (Service Provider), this parameter will be ignored.
visualization_range
(optional) Limit the days users can visualize the data of an organization. If the domain_type is not equal to 2 (Organization), this parameter will be ignored.
megabytes_limit
(optional) Limit the megabytes of storage for the data of an Organization. If the domain_type is not equal to 2 (Organization), this parameter will be ignored.
visualization_range
(optional) Limit the days users can visualize the data of an organization. If the domain_type is not equal to 2 (Organization), this parameter will be ignored.
megabytes_limit
(optional) Limit the megabytes of storage for the data of an Organization. If the domain_type is not equal to 2 (Organization), this parameter will be ignored.
If request is successful HTTP 200 OK status code will be returned alongside a JSON response describing the newly created sensor and a 'status' value set to true meaning that the request was successful. Keep in mind that manage permissions for the parent sensor are required in order to create a new sensor. If these permissions are missing HTTP 401 Unauthorized status code will be returned. If an unexistant parent was specified in the request HTTP 404 Not Found status code will be returned.
On the following lines you may find an execution example:
Request:
HTTP Verb: POST
URI: https://hostname/api/v1/sensors/domain?auth_token=xxxxxx
Payload: { "domain_type":"2", "parent_uuid":"697893457705749905", "name":"new_domain" }
Response:
{
"query": true,
"sensor": {
"id": 893,
"name": "new_domain",
"type": 1,
"domain_type": 2,
"uuid": "242113467595288081"
}
}
In this response "domain_type" is the domain type specified above and "type" is the sensor types. Available sensor types are: