Element Type
3 min
Get Element Types
GET
http://{{hostname}}/aioc-rest-web/rest/element/loadAll
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/loadAll");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request GET 'http://{{hostname}}/aioc-rest-web/rest/element/loadAll' \
--header 'Content-Type: application/json'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/loadAll",
"method": "GET",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
[
{
"dbId": -1256593,
"elementTypeId": "linux",
"elementTypeName": "Linux Server",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"dbId": -328315408,
"elementTypePropertyValue": "^Quit.*",
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"elementTypePropertyType": {
"displayName": "enforcer.terminal.behaviour.exc_last_line_patterns",
"allowMultipleValues": true,
"valuesPredefined": false,
"elementTypePropertyValues": null,
"elementTypePropertyKey": "enforcer.terminal.behaviour.exc_last_line_patterns",
"valueType": "REGEX",
"encryption": false
}
},
{
"dbId": -224107347,
"elementTypePropertyValue": ".*?(>|\\$|#|%)",
"elementTypePropertyKey": "enforcer.terminal.behaviour.prompt_pattern",
"elementTypePropertyType": {
"displayName": "enforcer.terminal.behaviour.prompt_pattern",
"allowMultipleValues": false,
"valuesPredefined": false,
"elementTypePropertyValues": null,
"elementTypePropertyKey": "enforcer.terminal.behaviour.prompt_pattern",
"valueType": "REGEX",
"encryption": false
}
},
{
"dbId": -123,
"elementTypeId": "windows",
"elementTypeName": "Windows",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"dbId": 2818341,
"elementTypePropertyValue": "true",
"elementTypePropertyKey": "discovery.dns.lookup.hostname",
"elementTypePropertyType": {
"displayName": "discovery.dns.lookup.hostname",
"allowMultipleValues": false,
"valuesPredefined": true,
"elementTypePropertyValues": [
"true",
"false"
],
"elementTypePropertyKey": "discovery.dns.lookup.hostname",
"valueType": "STRING",
"encryption": false
}
}
]
}
]
Get All Element Type Property Type
GET
http://{{hostname}}/aioc-rest-web/rest/element/loadAllElementTypePropertyType
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/loadAllElementTypePropertyType");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request GET 'http://{{hostname}}/aioc-rest-web/rest/element/loadAllElementTypePropertyType' \
--header 'Content-Type: application/json'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/loadAllElementTypePropertyType",
"method": "GET",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
[
{
"displayName": "discovery.commands.hostname.pattern",
"allowMultipleValues": false,
"valuesPredefined": false,
"elementTypePropertyValues": null,
"elementTypePropertyKey": "discovery.commands.hostname.pattern",
"valueType": "REGEX",
"encryption": false
},
{
"displayName": "shell.terminal.config.ssh.server.alive.interval",
"allowMultipleValues": false,
"valuesPredefined": false,
"elementTypePropertyValues": null,
"elementTypePropertyKey": "shell.terminal.config.ssh.server.alive.interval",
"valueType": "INT",
"encryption": false
}
..Continued
]
Save Element Type
POST
http://{{hostname}}/aioc-rest-web/rest/element/saveElementType
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/saveElementType");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"elementTypeId\": \"test_element_type\",\n \"elementTypeName\": \"Test Element Type\",\n \"vendor\": null,\n \"category\": null,\n \"elementTypeProperties\": [\n {\n \"elementTypePropertyValue\": \"do_nothing\",\n \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_z\"\n }\n ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request POST 'http://{{hostname}}/aioc-rest-web/rest/element/saveElementType' \
--header 'Content-Type: application/json' \
--data-raw '{
"elementTypeId": "test_element_type",
"elementTypeName": "Test Element Type",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"elementTypePropertyValue": "do_nothing",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z"
}
]
}'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/saveElementType",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({"elementTypeId":"test_element_type","elementTypeName":"Test Element Type","vendor":null,"category":null,"elementTypeProperties":[{"elementTypePropertyValue":"do_nothing","elementTypePropertyKey":"enforcer.terminal.behaviour.ctrl_z"}]}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
{
"dbId": 4017508,
"elementTypeId": "test_element_type",
"elementTypeName": "Test Element Type",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"dbId": 4017509,
"elementTypePropertyValue": "do_nothing",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z",
"elementTypePropertyType": {
"displayName": "enforcer.terminal.behaviour.ctrl_z",
"allowMultipleValues": false,
"valuesPredefined": true,
"elementTypePropertyValues": [
"DO_NOTHING",
"ABORT_AND_GO_TO_ROOT",
"EXECUTE_AND_GO_TO_ROOT"
],
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z",
"valueType": "STRING",
"encryption": false
}
}
]
}
Delete Element Type
POST
http://{{hostname}}/aioc-rest-web/rest/element/removeElementType
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/removeElementType");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"dbId\": 927\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request POST 'http://{{hostname}}/aioc-rest-web/rest/element/removeElementType' \
--header 'Content-Type: application/json' \
--data-raw '{
"dbId": 927
}'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/removeElementType",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({"dbId":927}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
{
"dbId": 927
}
Delete Multiple ElementTypes
POST
http://{{hostname}}/aioc-rest-web/rest/element/removeMultiElementType
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/removeMultiElementType");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n {\n \"dbId\": 930\n },\n {\n \"dbId\": 932\n }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request POST 'http://{{hostname}}/aioc-rest-web/rest/element/removeMultiElementType' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"dbId": 930
},
{
"dbId": 932
}
]'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/removeMultiElementType",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify([{"dbId":930},{"dbId":932}]),
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
[
{
"dbId": 930
},
{
"dbId": 932
}
]
Update Element Type
POST
http://{{hostname}}/aioc-rest-web/rest/element/saveElementType
csharp
var client = new RestClient("http://{{hostname}}/aioc-rest-web/rest/element/saveElementType");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"dbId\": 920,\n \"elementTypeId\": \"test_element_type\",\n \"elementTypeName\": \"Test Element Type\",\n \"vendor\": null,\n \"category\": null,\n \"elementTypeProperties\": [\n {\n \"elementTypePropertyValue\": \"do_nothing\",\n \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_z\"\n },\n {\n \"elementTypePropertyValue\": \"abort\",\n \"elementTypePropertyKey\": \"enforcer.terminal.behaviour.ctrl_c\"\n }\n ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl
curl --location -g --request POST 'http://{{hostname}}/aioc-rest-web/rest/element/saveElementType' \
--header 'Content-Type: application/json' \
--data-raw '{
"dbId": 920,
"elementTypeId": "test_element_type",
"elementTypeName": "Test Element Type",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"elementTypePropertyValue": "do_nothing",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z"
},
{
"elementTypePropertyValue": "abort",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_c"
}
]
}'javascript
var settings = {
"url": "http://{{hostname}}/aioc-rest-web/rest/element/saveElementType",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({"dbId":920,"elementTypeId":"test_element_type","elementTypeName":"Test Element Type","vendor":null,"category":null,"elementTypeProperties":[{"elementTypePropertyValue":"do_nothing","elementTypePropertyKey":"enforcer.terminal.behaviour.ctrl_z"},{"elementTypePropertyValue":"abort","elementTypePropertyKey":"enforcer.terminal.behaviour.ctrl_c"}]}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});200
{
"dbId": 4017508,
"elementTypeId": "test_element_type",
"elementTypeName": "Test Element Type",
"vendor": null,
"category": null,
"elementTypeProperties": [
{
"dbId": 4017796,
"elementTypePropertyValue": "do_nothing",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z",
"elementTypePropertyType": {
"displayName": "enforcer.terminal.behaviour.ctrl_z",
"allowMultipleValues": false,
"valuesPredefined": true,
"elementTypePropertyValues": [
"DO_NOTHING",
"ABORT_AND_GO_TO_ROOT",
"EXECUTE_AND_GO_TO_ROOT"
],
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_z",
"valueType": "STRING",
"encryption": false
}
},
{
"dbId": 4017797,
"elementTypePropertyValue": "abort",
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_c",
"elementTypePropertyType": {
"displayName": "enforcer.terminal.behaviour.ctrl_c",
"allowMultipleValues": false,
"valuesPredefined": true,
"elementTypePropertyValues": [
"DO_NOTHING",
"ABORT",
"ABORT_AND_GO_TO_ROOT",
"ABORT_AND_GO_TO_ROOT_WHEN_NO_COMMAND"
],
"elementTypePropertyKey": "enforcer.terminal.behaviour.ctrl_c",
"valueType": "STRING",
"encryption": false
}
}
]
}