GetIpList

Get IP List for Use (svr, proxy) under the App

Request address

POST
http://OmsAddress/app/newoms.php/webservice/business/app/get-ip-list?cmd=10010&ip-type=webservicerest&access-token=AccessTokenVal

POST request parameter description

Parameter name Data type Description Whether the field is required Remarks
app_id integer app id Yes
zone_id integer game zone id. If zone_id is 0, it means to get the ip addresses of the hosts in use from all zones under app_id. The default value is 0. No
type integer ip type of the query. 1: tcapsvr, 2: tcaproxy, 4: cold backup host Yes
only_own integer Whether to query only exclusive hosts. 0: No. 1: Yes. The default value is 1. No

Data Parameters

Use json format to represent the record related information. The following is an example:

{
    "app_id": 2,
    "zone_id": 3,
    "type": 1,
    "only_own": 0
}

Return Syntax

Return Parameter Description

  1. When the returned status code is not 200, it indicates that the query was unsuccessful, and the returned data is error information

  2. When the returned status code is 200, it indicates that the query was successful, and the returned IP is of the specified type of host

Request Example

Send A Request through the Curl Method

For the parameters in the command, please refer to the "Description of POST Request Parameters" on this page. For the method to obtain access-token, see: Get access-token

curl -H "Content-type: application/json" -X "POST" -d '{
    "app_id": 2,
    "zone_id": 3,
    "type": 1,
    "only_own": 0
}' http://omsaddress/app/newoms.php/webservice/business/app/get-ip-list?cmd=10010&ip-type=webservicerest&access-token=\

Return Example

Successful Return Example

Status of http request = 200

[
    "10.12.136.74"
]

Failed Return Example

Status of http request != 200

{
    "name": "Unauthorized",
    "message": "You are requesting with an invalid credential.",
    "code": 0,
    "status": 401,
    "type": "yii\\web UnauthorizedHttpException"
}
{
    "app_id": [
        "ip(10.29.89.68) not in whitelist to query zones info(cmd:10010) of set_id:126 app_id:2"
    ]
}

results matching ""

    No results matching ""