登録

IPフィルタグループを登録します。

Request Interface

HTTP Request

POST /ip-filter/group

Parameter

Request Parameter

Value

Required

Description

Default Value

ipFilterGroupName string true

IP filter group name.

32 characters or less.

Use alphanumeric characters and symbols (only "-" and "." allowed). You cannot specify "." or ".." by itself.

Duplicate specifications in the same account are not allowed.

Case-sensitive.

-

description

string

false

Description of IP filter group.

256 characters or less.

Blank

allowlist string true

Allowlist of IP addresses.

Array of strings.

Use numeric characters and certain symbols (. /) only.

Empty arrays are not allowed.

-

IPフィルタグループの登録数は、契約アカウントに対して100が上限です。

IPアドレスの登録数は、IPフィルタグループに対して100が上限です。

Response Interface

リクエストが正常に処理された場合、以下の JSON フォーマットでレスポンスを返却します。

{
	"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

 

リクエストが正常に処理されなかった場合、以下の JSON フォーマットでレスポンスを返却します。

{
	"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";
	try {
	URL url = new URL(host + "/api/v2/ip-filter/group");
	HttpURLConnection connection = (HttpURLConnection) url.openConnection();
	String postData = "{\"ipFilterGroupName\": \"group1\","
		 +  "\"allowlist\": [\"192.0.2.0/24\"],"
		 +  "\"description\": \"description1\""
		 +  "}";
	connection.setRequestMethod("POST");
	connection.setDoOutput(true);
	connection.setDoInput(true);
	connection.setRequestProperty("Authorization", "Bearer " + apiKey);
	connection.setRequestProperty("Content-Type", "application/json");
	connection.setRequestProperty("Content-Length", Integer.toString(postData.length()));
	try (BufferedWriter writer = 
		new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))) {
		writer.write(postData);
		}
	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';
$.ajax({
	type: 'POST',
	url: host + '/api/v2/ip-filter/group',
	headers: {
			Authorization: 'Bearer ' + apiKey
	},
	contentType: 'application/json',
	data: JSON.stringify({
		"ipFilterGroupName": "group1",
		"allowlist": ["192.0.2.0/24"],
		"description": "description1" 
	})
}).done(function(data, status, xhr) {
	console.log(data);
}).fail(function(data, status, xhr) {
	console.log(data);
});