Updating Information
You can update an IP filter group.
Request Interface
HTTP Request
PUT /ip-filter/group/{ipFilterGroupName}
Parameter
|
Path Parameter |
Value |
Required |
Description |
Default Value |
|---|---|---|---|---|
|
ipFilterGroupName |
string |
true |
IP filter group name |
- |
|
Request Parameter |
Value |
Required |
Description |
Default Value |
|---|---|---|---|---|
| description | string | false |
Description of IP filter group. 256 characters or less. |
No update |
| allowlist | array | false |
Allowlist of IP addresses. Array of strings. Use numeric characters and certain symbols (. /) only. Empty arrays are not allowed. |
No update |
Response Interface
If the request is processed successfully, the following response is returned in JSON format.
{
"ipFilterGroupName": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"description": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"allowlist": [
"xxx.xxx.xxx.xxx",
"xxx.xxx.xxx.xxx"
]
}
|
Property Name |
Value |
Description |
|---|---|---|
|
ipFilterGroupName |
string |
IP filter group name |
|
description |
string |
Description of IP filter group |
|
allowlist |
array |
Allowlist of IP addresses |
If the request is processed unsuccessfully, a response is returned in the following JSON format.
{
"code": "xxxxxxx",
"message": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ipAddressError": [
{
"code": "xxxxxxx",
"message": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"index": 0
},
{
"code": "xxxxxxx",
"message": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"index": 1
}
]
}
|
Property Name |
Value |
Description |
|---|---|---|
|
code |
string |
Error code |
|
message |
string |
Error message |
|
ipAddressError |
array |
IP address with an error |
| code | string | Error code for the input IP address |
| message | string | Error message for the input IP address |
| index | integer | Array element number for the input IP address (zero-based) |
Examples
public static void main(String[] args) { String host = "https://www.webconnect.hulft.com"; String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; String ipFilterGroupName = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; try { URL url = new URL(host + "/api/v2/ip-filter/group/" + ipFilterGroupName); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); String putData = "{\"allowlist\": [\"192.0.2.0/24\"]," + "\"description\": \"description\"" + "}"; connection.setRequestMethod("PUT"); connection.setDoOutput(true); connection.setDoInput(true); connection.setRequestProperty("Authorization", "Bearer " + apiKey); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Content-Length", Integer.toString(putData.length())); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))) { writer.write(putData); } try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { String line; while ((line = reader.readLine()) != null) { System.out.println(line); } } } catch (IOException ex) { // error } }
// load jquery var host = 'https://www.webconnect.hulft.com'; var apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; var ipFilterGroupName = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $.ajax({ type: 'PUT', url: host + '/api/v2/ip-filter/group/' + ipFilterGroupName, headers: { Authorization: 'Bearer ' + apiKey }, contentType: 'application/json', data: JSON.stringify({ "allowlist": ["192.0.2.0/24"], "description": "description1" }) }).done(function(data, status, xhr) { console.log(data); }).fail(function(data, status, xhr) { console.log(data); });