An IP region table is a file that contains all the IP subnets in one region. By default, three IP region tables are available in the system: "predefined_cernet", "predefined_cnc" and "predefined_ct". The administrator can import customized IP region tables to the system. When the IP region is associated with the specified gateway, the IP region route will be generated. When the destination IP address of the packet matches any entry in the IP region table, the packet hits this IP region route.
| Field Group Name | Field Name | Type | Description |
|---|---|---|---|
| default | name | string | Sets the name of the IP region table. |
| export | export_url | string | Sets the URL to which the IP region table is exported. |
| ipregion_table | table | asso | |
| ipregion_route | route | asso |
{
"IPRegion": {
"meta": {
"abstract": false,
"verbose_name": IP Region,
},
"fieldgroups": [
{
"fields": [
{
"verbose_name": field_verbose_name1,
"field_name": field_name1
},
...
],
"group_name": field_group_name1
},
...
]
}
}
{
"targets": [<target>]
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| targets | string or list | specify the target asso you want to perform action on. And target asso can be one or more. |
{
"config_change": true|false,
"msg": <msg>
}
| Parameter | Type | Description |
|---|---|---|
| config_change | bool | Whether the action causes configuration change. |
| msg | sring | Empty when action is performed successfully, otherwise it represents the error info. |
{
"targets": [<target>]
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description | |||||
|---|---|---|---|---|---|---|---|
| targets | string or list | specify the target asso you want to perform action on. Can be empty or not specified when there is no target asso needed. | |||||
| name | string | Sets the name of the IP region table. | |||||
| using | UnionField (Nested Field. It should be a dict.)
|
Format
{
"import_url": xxxx
}
|
{
"config_change": true|false,
"msg": <msg>
}
| Parameter | Type | Description |
|---|---|---|
| config_change | bool | Whether the action causes configuration change. |
| msg | sring | Empty when action is performed successfully, otherwise it represents the error info. |
{
"IPRegion": [
{
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
},
...
]
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
| field_group_name | URI | (optional) Target field group name to query. Available names are: default, export, ipregion_table, ipregion_route, Notice: There could only be one field_group_name or field_name in the URL. And if both field_group_name and field_name are not specified, will try to query default field_group data. |
| field_name | URI | (optional) Target field name to query. Available names are: name, export_url, table, route, Notice: There could only be one field_group_name or field_name in the URL. |
| Field Group Name | Field Name | Type | Description |
|---|---|---|---|
| default | name | string | Sets the name of the IP region table. |
| export | export_url | string | Sets the URL to which the IP region table is exported. |
| ipregion_table | table | asso | |
| ipregion_route | route | asso |
{
"IPRegion": {
"instance_id":<instance_id>,
<field1>:<value1>,
<field2>:<value2>,
...
}
}
When some field_group name is provided:
{
"IPRegion": {
"instance_id":<instance_id>,
<field1>:<value1>,
<field2>:<value2>,
...
}
}
When some field name is provided:
{
"IPRegion": {
"instance_id":<instance_id>,
<field>:<value>,
}
}
{
<field_name>:<value>
}
When field name is not specified in URL:
Notice: The fields not provided are left untouched.
{
<field_name1>:<value1>,
<field_name2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
| field_name | URI | (optional) Target field name to update. Available field names are: export_url, |
| Field Name | Type | Description |
|---|---|---|
| export_url | string | Sets the URL to which the IP region table is exported. |
All configuration fields and their values are replied:
{
"IPRegion": {
"instance_id":<instance_id>,
<field1>:<value1>,
<field2>:<value2>,
...
<field_group1>: {
<field3>:<value3>,
<field4>:<value4>,
...
},
<field_group2>: {
<field5>:<value5>,
<field6>:<value6>,
...
},
...
}
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"IPRegion": {
"instance_id":<instance_id>,
"table":[
{
<field1>:<value1>,
<field2>:<value2>,
...
}
]
}
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"IPRegion": {
"instance_id":<instance_id>,
"route":[
{
<field1>:<value1>,
<field2>:<value2>,
...
}
]
}
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| gateway | ipaddr | |
| priority | uint32 | |
| weight | uint32 | |
| start_port | uint32 | |
| end_port | uint32 |
{
"IPRegionRoute": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}