1. 安全组列表

1.1. 描述

获取安全组列表

1.2. 请求地址

请求地址的格式如下:

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

1.3. 请求参数

参数名称 类型 是否必须 描述
projectId String 所属项目ID
nameOrSn String 安全组名称或SN
curPage Integer 当前页码,默认值1
perPage Integer 每页显示条数,默认值10

1.4. 请求示例

以华东一区获取某项目下的安全组列表为例:

1.4.1. 请求地址

POST https://cn-east-1.api.yovole.com/v1/sg/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",
  "curPage":1,
  "perPage":10
}

1.5. 返回结果示例

1.5.1. 返回正确结果示例

{
    "requestId":"93a4c029-202f-4cdb-bbac-4e6d4ea00ba1",
    "success":true,
    "code":200,
    "pager":{
        "curPage":1,
        "perPage":10,
        "totalRecords":3,
        "totalPages":1,
        "pageData":[
            {
                "id":"ab0b12ab-111a-4e7a-b2eb-75958ab0d27f",
                "name":"approve",
                "sn":"SG-218KP41",
                "regionSn":"CN-EAST-1",
                "created": "2019-06-10 12:00:00",
                "description": null
            },
            {
                "id":"e6d039d3-be74-4fc4-b82a-b55df31a3e4e",
                "name":"API Create securityGroup",
                "sn":"SG-218KP42",
                "regionSn":"CN-EAST-1",
                "created": "2019-06-10 11:20:00",
                "description": null
            },
            {
                "id":"eb667f7f-a0d4-4cc5-908a-e4175c683030",
                "name":"默认安全组",
                "sn":"SG-218KP3D",
                "regionSn":"CN-EAST-1",
                "created": "2019-06-10 10:10:00",
                "description": null
            }
        ]
    }
}

1.5.2. 返回错误结果示例

{
    "requestId": "4416235a-e9c0-453f-823a-ad491ebd74ab",
    "success": false,
    "code": 403,
    "message": "permission denied"
}

1.6. 错误码

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

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

results matching ""

    No results matching ""