1. NAT的端口转发规则列表

1.1. 描述

获取NAT的端口转发规则列表

1.2. 请求地址

请求地址的格式如下:

https://<区域服务地址>/v1/nat/portforward/list

1.3. 请求参数

参数名称 类型 是否必须 描述
projectId String 项目ID
natId String NatID
curPage Integer 当前页码,默认值1
perPage Integer 每页显示条数,默认值10

1.4. 请求示例

以获取华东一区某NAT下的端口转发规则列表为例:

1.4.1. 请求地址

POST https://cn-east-1.api.yovole.com/v1/nat/portforward/list HTTP/1.1
  x-ycs-timestamp: 2019-06-19T14:26:26Z
  x-ycs-requestid: 2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9
  x-ycs-security-authorization: Authorization: YCS1-HMAC-SHA1 Credential=08e206fb-7b41-45b7-8076-8d43e8aeea89,SignedHeaders=content-type;x-ycs-requestid;x-ycs-timestamp,Signature=2RFjU7C9gICCrQfpAIfAJHqRRlQ=

1.4.2. 接口请求参数

{
  "projectId": "xxxxxxxxxxx",
  "natId": "xxxxxxxxxxx",
  "curPage":1,
  "perPage":10
}

1.5. 返回结果示例

1.5.1. 返回正确结果示例

{
  "requestId": "5570e9eb-c9f5-40c3-a3c1-4131848040ea",
  "success": true,
  "code": 200,
  "message": null,
  "model": null,
  "pager": {
    "curPage": 1,
    "perPage": 10,
    "totalRecords": 4,
    "totalPages": 1,
    "pageData": [
      {
        "id": "07bbc04f-d100-415f-b305-d89a1c0c9c21",
        "name": "create test",
        "regionSn": "CN-EAST-1",
        "vpcId": "f14c4e48-006f-42e6-94e1-ca40865c297c",
        "natId": "69515a7d-957b-4e22-926c-c172ca627dd5",
        "protocol": "UDP",
        "sourcePort": 8887,
        "targetPort": 8888,
        "targetIp": "10.3.20.125"
      },
      {
        "id": "d81c5305-8f63-4ed8-8e92-682a1d5b225a",
        "name": "create test",
        "regionSn": "CN-EAST-1",
        "vpcId": "f14c4e48-006f-42e6-94e1-ca40865c297c",
        "natId": "69515a7d-957b-4e22-926c-c172ca627dd5",
        "protocol": "TCP",
        "sourcePort": 8888,
        "targetPort": 8888,
        "targetIp": "10.3.20.125"
      },
      {
        "id": "b07c8f2c-2c07-4298-8e9d-300209f2795a",
        "name": "test2",
        "regionSn": "CN-EAST-1",
        "vpcId": "f14c4e48-006f-42e6-94e1-ca40865c297c",
        "natId": "69515a7d-957b-4e22-926c-c172ca627dd5",
        "protocol": "TCP",
        "sourcePort": 82,
        "targetPort": 81,
        "targetIp": "10.3.20.125"
      },
      {
        "id": "097d567f-c7ef-4119-8ded-4131d14863ae",
        "name": "test1",
        "regionSn": "CN-EAST-1",
        "vpcId": "f14c4e48-006f-42e6-94e1-ca40865c297c",
        "natId": "69515a7d-957b-4e22-926c-c172ca627dd5",
        "protocol": "TCP",
        "sourcePort": 81,
        "targetPort": 81,
        "targetIp": "10.3.20.125"
      }
    ]
  }
}

1.5.2. 返回错误结果示例

{
  "requestId": "19c0e7ff-5554-4e90-b3a5-3aab644a8e30",
  "success": false,
  "code": 401,
  "message": "client enabled is false",
  "errorCode": "InvalidUserAccount"
}

1.6. 错误码

可以通过错误返回结果中的code、errorCode和message字段了解错误分类和具体的错误原因。

该接口没有特殊错误码,错误码信息和简单的错误分析方法可以参考公共错误码

results matching ""

    No results matching ""