Save Device Group Ip Pattern
1 min
POST
{{url}}/aioc-rest-web/rest/discovery/saveDeviceGroupIpPattern
Path Parameters
- urlstringDefaulturl
Header Parameters
- HoststringDefaultlocalhost
- User-AgentstringDefaultMozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
- AcceptstringDefaultapplication/json, text/plain, */*
- Accept-LanguagestringDefaulten-US,en;q=0.5
- Accept-EncodingstringDefaultgzip, deflate
- RefererstringDefaulthttp://localhost
- Content-TypestringDefaultapplication/json
- ConnectionstringDefaultkeep-alive
- PragmastringDefaultno-cache
- Cache-ControlstringDefaultno-cache
- X-XSRF-TOKENstringDefault{{csrftoken}}
Body Parameters
- bodyobjectDefault{ "dbId": 118263, "deviceGroupId": "d8a5810e-f17e-43f4-8036-86a10c5e2ba0", "interfaceName": null, "action": "ALLOW", "ipPattern": "^10\\.20\\.40\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$" }
Responses
200
curl
curl --request POST \
--url {{url}}/aioc-rest-web/rest/discovery/saveDeviceGroupIpPattern \
--header 'accept: application/json, text/plain, */*' \
--header 'content-type: application/json' \
--header 'host: localhost' \
--header 'user-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0' \
--header 'accept-language: en-US,en;q=0.5' \
--header 'accept-encoding: gzip, deflate' \
--header 'referer: http://localhost' \
--header 'connection: keep-alive' \
--header 'pragma: no-cache' \
--header 'cache-control: no-cache' \
--header 'x-xsrf-token: {{csrftoken}}' \
--data '"{\n \"dbId\": 118263,\n \"deviceGroupId\": \"d8a5810e-f17e-43f4-8036-86a10c5e2ba0\",\n \"interfaceName\": null,\n \"action\": \"ALLOW\",\n \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$\"\n }"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", " application/json, text/plain, */*");
myHeaders.append("content-type", "application/json");
myHeaders.append("host", " localhost");
myHeaders.append("user-agent", " Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0");
myHeaders.append("accept-language", " en-US,en;q=0.5");
myHeaders.append("accept-encoding", " gzip, deflate");
myHeaders.append("referer", " http://localhost");
myHeaders.append("connection", " keep-alive");
myHeaders.append("pragma", " no-cache");
myHeaders.append("cache-control", " no-cache");
myHeaders.append("x-xsrf-token", "{{csrftoken}}");
var raw = JSON.stringify("{\n \"dbId\": 118263,\n \"deviceGroupId\": \"d8a5810e-f17e-43f4-8036-86a10c5e2ba0\",\n \"interfaceName\": null,\n \"action\": \"ALLOW\",\n \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$\"\n }");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{url}}/aioc-rest-web/rest/discovery/saveDeviceGroupIpPattern", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("{{url}}/aioc-rest-web/rest/discovery/saveDeviceGroupIpPattern")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = " application/json, text/plain, */*"
request["content-type"] = "application/json"
request["host"] = " localhost"
request["user-agent"] = " Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0"
request["accept-language"] = " en-US,en;q=0.5"
request["accept-encoding"] = " gzip, deflate"
request["referer"] = " http://localhost"
request["connection"] = " keep-alive"
request["pragma"] = " no-cache"
request["cache-control"] = " no-cache"
request["x-xsrf-token"] = "{{csrftoken}}"
request.body = JSON.dump("{\n \"dbId\": 118263,\n \"deviceGroupId\": \"d8a5810e-f17e-43f4-8036-86a10c5e2ba0\",\n \"interfaceName\": null,\n \"action\": \"ALLOW\",\n \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$\"\n }")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{url}}/aioc-rest-web/rest/discovery/saveDeviceGroupIpPattern"
payload = json.dumps("{\n \"dbId\": 118263,\n \"deviceGroupId\": \"d8a5810e-f17e-43f4-8036-86a10c5e2ba0\",\n \"interfaceName\": null,\n \"action\": \"ALLOW\",\n \"ipPattern\": \"^10\\\\.20\\\\.40\\\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$\"\n }")
headers = {
'accept': ' application/json, text/plain, */*',
'content-type': 'application/json',
'host': ' localhost',
'user-agent': ' Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0',
'accept-language': ' en-US,en;q=0.5',
'accept-encoding': ' gzip, deflate',
'referer': ' http://localhost',
'connection': ' keep-alive',
'pragma': ' no-cache',
'cache-control': ' no-cache',
'x-xsrf-token': '{{csrftoken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
{
"dbId": 140532,
"deviceGroupId": "d8a5810e-f17e-43f4-8036-86a10c5e2ba0",
"interfaceName": null,
"action": "ALLOW",
"ipPattern": "^10\\.20\\.40\\.(1([0-9][0-8])|2([0-4][0-8]|5[0-5]))$"
}