Virtual service is the virtual mapping of real services on the appliance. It is used to intercept the network traffic destined for the these services. The virtual service uses the policy to distribute network traffic to the associated real service group, which further distributes the network traffic to the specified real services based on the group method.
| Field Group Name | Field Name | Type | Description |
|---|---|---|---|
| default | protocol | enum | Sets the protocol of the virtual service.Available values:
|
| default | service_name | string | |
| default | enable | boolean | The virtual service takes effect only when it is enabled. |
| policy | policies | asso | |
| policy | order_template | asso | |
| advanced | max_cps | uint32 | |
| advanced | system_mode | enum | Available values:
|
| advanced | rts | boolean | |
| advanced | interface | asso | |
| port_range | port_range | asso | |
| status | active_status | boolean | |
| statistics | current_connection_count | StorableField | |
| statistics | total_connection_count | StorableField | |
| statistics | total_bytes_in | StorableField | |
| statistics | total_bytes_out | StorableField | |
| statistics | total_packets_in | StorableField | |
| statistics | total_packets_out | StorableField | |
| statistics | average_bandwidth_in | StorableField | |
| statistics | average_bandwidth_out | StorableField | |
| statistics | qos_clientport_hits | StorableField | |
| statistics | qos_network_hits | StorableField | |
| statistics | default_hits | StorableField | |
| statistics | static_hits | StorableField | |
| statistics | backup_hits | StorableField | |
| snat | snat | asso | |
| epolicy | setting_script | asso | One virtual service can be associated with only one setting script. |
| epolicy | runtime_script | asso | One virtual service can be associated with 10 runtime scripts at most. |
| acl | acl_rule | asso | |
| acl | acl_whitelist | asso | |
| ddos_acl | ddos_rule | asso |
{
"VirtualService": {
"meta": {
"abstract": true,
"verbose_name": SLB Virtual Service,
},
"subclasses": [
{
"class_name": class_name1,
"verbose_name": verbose_name1
},
...
],
"fieldgroups": [
{
"fields": [
{
"verbose_name": field_verbose_name1,
"field_name": field_name1
},
...
],
"group_name": field_group_name1
},
...
]
}
}
| Method | GET |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/meta |
| Request Data | None |
| Response Data | {
"VirtualService": {
"meta": {
"abstract": true,
"verbose_name": "SLB Virtual Service"
},
"subclasses": [
{
"class_name": "IPVirtualService",
"verbose_name": "Layer 3 IP Virtual Service"
},
{
"class_name": "L2IPVirtualService",
"verbose_name": "Layer 2 IP Virtual Service"
},
{
"class_name": "L4VirtualService",
"verbose_name": "Layer 4 Virtual Service"
},
{
"class_name": "L7VirtualService",
"verbose_name": "Layer 7 Virtual Service"
}
],
"fieldgroups": [
{
"fields": [
{
"verbose_name": "Virtual Service Type",
"field_name": "protocol"
},
{
"verbose_name": "Virtual Service Name",
"field_name": "service_name"
},
{
"verbose_name": "Enable Virtual Service",
"field_name": "enable"
}
],
"group_name": "default"
},
{
"fields": [
{
"verbose_name": "Policies",
"field_name": "policies"
},
{
"verbose_name": "Associated Policy Order Template",
"field_name": "order_template"
}
],
"group_name": "policy"
},
{
"fields": [
{
"verbose_name": "Max Connections per Second",
"field_name": "max_cps"
},
{
"verbose_name": "Transmission Mode",
"field_name": "system_mode"
},
{
"verbose_name": "RTS",
"field_name": "rts"
},
{
"verbose_name": "Interface",
"field_name": "interface"
}
],
"group_name": "advanced"
},
{
"fields": [
{
"verbose_name": "Port Ranges",
"field_name": "port_range"
}
],
"group_name": "port_range"
},
{
"fields": [
{
"verbose_name": "Status",
"field_name": "active_status"
}
],
"group_name": "status"
},
{
"fields": [
{
"verbose_name": "Current Connection Count",
"field_name": "current_connection_count"
},
{
"verbose_name": "Total Connection Count",
"field_name": "total_connection_count"
},
{
"verbose_name": "Total Bytes in",
"field_name": "total_bytes_in"
},
{
"verbose_name": "Total Bytes out",
"field_name": "total_bytes_out"
},
{
"verbose_name": "Total Packets In",
"field_name": "total_packets_in"
},
{
"verbose_name": "Total Packets Out",
"field_name": "total_packets_out"
},
{
"verbose_name": "Average Bandwidth In",
"field_name": "average_bandwidth_in"
},
{
"verbose_name": "Average Bandwidth Out",
"field_name": "average_bandwidth_out"
},
{
"verbose_name": "QoS Client Port Hits",
"field_name": "qos_clientport_hits"
},
{
"verbose_name": "QoS Network Hits",
"field_name": "qos_network_hits"
},
{
"verbose_name": "Default Hits",
"field_name": "default_hits"
},
{
"verbose_name": "Static Hits",
"field_name": "static_hits"
},
{
"verbose_name": "Backup Hits",
"field_name": "backup_hits"
}
],
"group_name": "statistics"
},
{
"fields": [
{
"verbose_name": "SNAT",
"field_name": "snat"
}
],
"group_name": "snat"
},
{
"fields": [
{
"verbose_name": "Associated Setting Scripts",
"field_name": "setting_script"
},
{
"verbose_name": "Associated Runtime Scripts",
"field_name": "runtime_script"
}
],
"group_name": "epolicy"
},
{
"fields": [
{
"verbose_name": "Project-Id-Version: Django\nReport-Msgid-Bugs-To: \nPOT-Creation-Date: 2012-03-23 02:29+0100\nPO-Revision-Date: 2010-05-13 15:35+0200\nLast-Translator: Django team\nLanguage-Team: English |
| Comment | None |
{
"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. |
| Method | POST |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/_Enable |
| Request Data | {
"targets": "vs01"
} |
| Response Data | {
"config_change": true,
"refresh_page": false,
"msg": ""
} |
| Comment | None |
{
"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. |
| Method | POST |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/_Disable |
| Request Data | {
"targets": "vs01"
} |
| Response Data | {
"config_change": true,
"refresh_page": false,
"msg": ""
} |
| Comment | None |
{
"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. |
{
"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. |
| Method | POST |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/_Clear_Http2 |
| Request Data | None |
| Response Data | {
"config_change": true,
"refresh_page": false,
"msg": ""
} |
| Comment | None |
{
"VirtualService": [
{
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
},
...
]
}
| Method | GET |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService |
| Request Data | None |
| Response Data | {
"VirtualService": [
{
"instance_id": "vs01",
"protocol": "http",
"service_name": "vs01",
"enable": true,
"vip": "10.8.6.202",
"vport": 80,
"max_conn": 0,
"arp": true
},
{
"instance_id": "vs_ftp",
"protocol": "ftp",
"service_name": "vs_ftp",
"enable": true,
"vip": "10.8.6.203",
"vport": 21,
"max_conn": 0
}
]
} |
| Comment | None |
| Method | GET |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService?protocol=http |
| Request Data | None |
| Response Data | {
"VirtualService": [
{
"instance_id": "vs01",
"protocol": "http",
"service_name": "vs01",
"enable": true,
"vip": "10.8.6.202",
"vport": 80,
"max_conn": 0,
"arp": true
}
]
} |
| Comment | None |
| 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, policy, advanced, port_range, status, statistics, snat, epolicy, tgt_fields, acl, ddos_acl, 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: protocol, service_name, enable, policies, order_template, max_cps, system_mode, rts, interface, port_range, active_status, current_connection_count, total_connection_count, total_bytes_in, total_bytes_out, total_packets_in, total_packets_out, average_bandwidth_in, average_bandwidth_out, qos_clientport_hits, qos_network_hits, default_hits, static_hits, backup_hits, snat, setting_script, runtime_script, acl_rule, acl_whitelist, ddos_rule, Notice: There could only be one field_group_name or field_name in the URL. |
| Field Group Name | Field Name | Type | Description |
|---|---|---|---|
| default | protocol | enum | Sets the protocol of the virtual service.Available values:
|
| default | service_name | string | |
| default | enable | boolean | The virtual service takes effect only when it is enabled. |
| policy | policies | asso | |
| policy | order_template | asso | |
| advanced | max_cps | uint32 | |
| advanced | system_mode | enum | Available values:
|
| advanced | rts | boolean | |
| advanced | interface | asso | |
| port_range | port_range | asso | |
| status | active_status | boolean | |
| statistics | current_connection_count | StorableField | |
| statistics | total_connection_count | StorableField | |
| statistics | total_bytes_in | StorableField | |
| statistics | total_bytes_out | StorableField | |
| statistics | total_packets_in | StorableField | |
| statistics | total_packets_out | StorableField | |
| statistics | average_bandwidth_in | StorableField | |
| statistics | average_bandwidth_out | StorableField | |
| statistics | qos_clientport_hits | StorableField | |
| statistics | qos_network_hits | StorableField | |
| statistics | default_hits | StorableField | |
| statistics | static_hits | StorableField | |
| statistics | backup_hits | StorableField | |
| snat | snat | asso | |
| epolicy | setting_script | asso | One virtual service can be associated with only one setting script. |
| epolicy | runtime_script | asso | One virtual service can be associated with 10 runtime scripts at most. |
| acl | acl_rule | asso | |
| acl | acl_whitelist | asso | |
| ddos_acl | ddos_rule | asso |
{
"VirtualService": {
"instance_id":<instance_id>,
<field1>:<value1>,
<field2>:<value2>,
...
}
}
When some field_group name is provided:
{
"VirtualService": {
"instance_id":<instance_id>,
<field1>:<value1>,
<field2>:<value2>,
...
}
}
When some field name is provided:
{
"VirtualService": {
"instance_id":<instance_id>,
<field>:<value>,
}
}
| Method | GET |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/vs01/default |
| Request Data | None |
| Response Data | {
"VirtualService": {
"instance_id": "vs01",
"protocol": "http",
"service_name": "vs01",
"enable": true,
"vip": "10.8.6.202",
"vport": 80,
"max_conn": 0,
"arp": true
}
} |
| Comment | None |
| Method | GET |
|---|---|
| URL | https://10.8.6.91:9997/rest/apv/loadbalancing/slb/vs/VirtualService/vs01/protocol |
| Request Data | None |
| Response Data | {
"VirtualService": {
"instance_id": "vs01",
"protocol": "http"
}
} |
| Comment | None |
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"VirtualService": {
"instance_id":<instance_id>,
"policies":[
{
<field1>:<value1>,
<field2>:<value2>,
...
}
]
}
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|
{
"DefaultPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|
{
"BackupPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| precedence | uint16 |
{
"RCPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| precedence | uint16 |
{
"ICPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| cookie_name | string | |
| precedence | uint16 |
{
"PCPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| header_name | string | |
| header_pattern | string | This option is used to filter HTTP requests with the specified header's value matching this regular expression. Wildcards supported by this field include: ^: Matches the beginning of the string; $: Matches the end of the string; *: Matches any characters, but multiple consecutive asterisks are not allowed. |
| precedence | uint16 |
{
"HeaderPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| regex | string | This option is used to filter HTTP requests with requested URLs matching this regular expression. Wildcards supported by this field include: ^: Matches the beginning of the string; $: Matches the end of the string; *: Matches any characters, but multiple consecutive asterisks are not allowed. |
| precedence | uint16 |
{
"RegexPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| url_tag | string | This option is used to filter HTTP requests with the URL tag name in the URL query part matching this tag string. |
| precedence | uint16 |
{
"PUPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string |
{
"HashURLPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| host_name | string | This option is used to filter HTTP requests with the host name matching this string. |
| precedence | uint16 |
{
"QoSHostname": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| qos_string | string | This option is used to filter HTTP requests with the requested URL matching this string. |
| precedence | uint16 |
{
"QoSURLPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| prefix | string | Sets the start location of the string to be used as the session ID in the request body. |
| delimiter | string | Sets the delimiter of the string to be used as the session ID in the request body. |
| flag | enum | 0: The "Delimiter" string must exist right in front of "Prefix"; 1: The "Delimiter" string does not need to exist right in front of "Prefix".Available values:
|
| precedence | uint16 |
{
"QoSBody": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| network_ip | ipaddr | |
| netmask_prefix | UnionField | |
| port_range | GroupField | |
| precedence | uint16 |
{
"QoSClientPortPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| network_ip | ipaddr | |
| netmask_prefix | UnionField | |
| precedence | uint16 |
{
"QoSNetworkPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| redirect_from_host | string | Sets the host name used to match the requests for redirection. |
{
"RedirectPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| filetype | string | Sets the extension of the file requested by the RTSP request. |
{
"RTSPFileTypePolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string |
{
"RadiusSessIDPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string |
{
"RadiusUsernamePolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string |
{
"DNSSecPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| name | string | |
| string | string | |
| precedence | uint16 |
{
"QosDiameterPolicy": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"VirtualService": {
"instance_id":<instance_id>,
"order_template":<value>
}
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"VirtualService": {
"instance_id":<instance_id>,
"port_range":[
{
<field1>:<value1>,
<field2>:<value2>,
...
}
]
}
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| begin | port | |
| end | port |
{
"VSPortRange": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}
| Parameter | Type | Description |
|---|---|---|
| instance_id | URI | ID of the instance |
{
"VirtualService": {
"instance_id":<instance_id>,
"snat":[
{
<field1>:<value1>,
<field2>:<value2>,
...
}
]
}
}
{
<param1>:<value1>,
<param2>:<value2>,
...
}
| Parameter | Type | Description |
|---|---|---|
| ip | ipaddr | |
| mask_prefix | UnionField |
{
"SLBSNAT": {
"instance_id":<instance_id>,
<param1>:<value1>,
<param2>:<value2>,
...
}
}
{
"msg": <success-or-error-msg>
}