From f8515e4e9841af32ed946caccb93134fbe83b767 Mon Sep 17 00:00:00 2001 From: ioito Date: Tue, 23 Jul 2019 11:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=89=E5=85=A8=E7=BB=84ap?= =?UTF-8?q?i=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/elasticip/associate.yaml | 14 +++ docs/elasticip/change-bandwidth.yaml | 13 +++ docs/elasticip/dissociate.yaml | 13 +++ docs/elasticip/elasticip.yaml | 39 ++++++++ docs/elasticip/elasticips.yaml | 38 ++++++++ docs/elasticip/purge.yaml | 12 +++ docs/elasticip/sync.yaml | 12 +++ docs/index.yaml | 40 ++++++++ docs/keypair/keypair.yaml | 39 ++++++++ docs/keypair/keypairs.yaml | 29 ++++++ docs/network/networks.yaml | 2 +- docs/parameters/common.yaml | 12 ++- docs/parameters/elasticip.yaml | 63 +++++++++++++ docs/parameters/keypair.yaml | 13 +++ docs/parameters/secgroup.yaml | 25 +++++ docs/parameters/secgrouprule.yaml | 12 +++ docs/schemas/common.yaml | 15 ++- docs/schemas/elasticip.yaml | 126 +++++++++++++++++++++++++ docs/schemas/keypair.yaml | 90 ++++++++++++++++++ docs/schemas/secgroup.yaml | 106 +++++++++++++++++++++ docs/schemas/secgrouprule.yaml | 132 +++++++++++++++++++++++++++ docs/secgroup/add-rule.yaml | 16 ++++ docs/secgroup/clone.yaml | 16 ++++ docs/secgroup/private.yaml | 12 +++ docs/secgroup/public.yaml | 14 +++ docs/secgroup/secgroup.yaml | 39 ++++++++ docs/secgroup/secgroups.yaml | 28 ++++++ docs/secgroup/union.yaml | 16 ++++ docs/secgrouprule/secgrouprule.yaml | 39 ++++++++ docs/secgrouprule/secgrouprules.yaml | 29 ++++++ docs/storage/storages.yaml | 2 +- 31 files changed, 1052 insertions(+), 4 deletions(-) create mode 100644 docs/elasticip/associate.yaml create mode 100644 docs/elasticip/change-bandwidth.yaml create mode 100644 docs/elasticip/dissociate.yaml create mode 100644 docs/elasticip/elasticip.yaml create mode 100644 docs/elasticip/elasticips.yaml create mode 100644 docs/elasticip/purge.yaml create mode 100644 docs/elasticip/sync.yaml create mode 100644 docs/keypair/keypair.yaml create mode 100644 docs/keypair/keypairs.yaml create mode 100644 docs/parameters/elasticip.yaml create mode 100644 docs/parameters/keypair.yaml create mode 100644 docs/parameters/secgroup.yaml create mode 100644 docs/parameters/secgrouprule.yaml create mode 100644 docs/schemas/elasticip.yaml create mode 100644 docs/schemas/keypair.yaml create mode 100644 docs/schemas/secgroup.yaml create mode 100644 docs/schemas/secgrouprule.yaml create mode 100644 docs/secgroup/add-rule.yaml create mode 100644 docs/secgroup/clone.yaml create mode 100644 docs/secgroup/private.yaml create mode 100644 docs/secgroup/public.yaml create mode 100644 docs/secgroup/secgroup.yaml create mode 100644 docs/secgroup/secgroups.yaml create mode 100644 docs/secgroup/union.yaml create mode 100644 docs/secgrouprule/secgrouprule.yaml create mode 100644 docs/secgrouprule/secgrouprules.yaml diff --git a/docs/elasticip/associate.yaml b/docs/elasticip/associate.yaml new file mode 100644 index 0000000000..29c262421b --- /dev/null +++ b/docs/elasticip/associate.yaml @@ -0,0 +1,14 @@ +post: + summary: 绑定资源 + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + - $ref: "../parameters/elasticip.yaml#/instance_id" + - $ref: "../parameters/elasticip.yaml#/instance_type" + responses: + 200: + description: 弹性IP信息 + schema: + $ref: "../schemas/elasticip.yaml#ElasticIpResponse" + + tags: + - elasticips \ No newline at end of file diff --git a/docs/elasticip/change-bandwidth.yaml b/docs/elasticip/change-bandwidth.yaml new file mode 100644 index 0000000000..dce76dbbc1 --- /dev/null +++ b/docs/elasticip/change-bandwidth.yaml @@ -0,0 +1,13 @@ +post: + summary: 更改弹性IP带宽大小 + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + - $ref: "../parameters/elasticip.yaml#/bandwidth" + responses: + 200: + description: 弹性IP信息 + schema: + $ref: "../schemas/elasticip.yaml#ElasticIpResponse" + + tags: + - elasticips \ No newline at end of file diff --git a/docs/elasticip/dissociate.yaml b/docs/elasticip/dissociate.yaml new file mode 100644 index 0000000000..87a8d42d88 --- /dev/null +++ b/docs/elasticip/dissociate.yaml @@ -0,0 +1,13 @@ +post: + summary: 解绑弹性EIP + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + - $ref: "../parameters/elasticip.yaml#/auto_delete" + responses: + 200: + description: 弹性IP信息 + schema: + $ref: "../schemas/elasticip.yaml#ElasticIpResponse" + + tags: + - elasticips \ No newline at end of file diff --git a/docs/elasticip/elasticip.yaml b/docs/elasticip/elasticip.yaml new file mode 100644 index 0000000000..dba9436d5c --- /dev/null +++ b/docs/elasticip/elasticip.yaml @@ -0,0 +1,39 @@ +get: + summary: 获取指定弹性IP详情信息 + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + responses: + 200: + description: 弹性IP详情信息 + schema: + $ref: "../schemas/elasticip.yaml#/ElasticIpResponse" + tags: + - elasticips + +delete: + summary: 删除指定弹性IP + parameters: + - $ref: '../parameters/elasticip.yaml#/elasticipId' + responses: + 200: + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpResponse' + tags: + - elasticips + +put: + summary: 更新弹性IP信息 + parameters: + - $ref: '../parameters/elasticip.yaml#/elasticipId' + - in: body + name: elasticip + required: true + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpUpdate' + responses: + 200: + description: 弹性IP信息 + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpResponse' + tags: + - elasticips \ No newline at end of file diff --git a/docs/elasticip/elasticips.yaml b/docs/elasticip/elasticips.yaml new file mode 100644 index 0000000000..b4e80ef523 --- /dev/null +++ b/docs/elasticip/elasticips.yaml @@ -0,0 +1,38 @@ +post: + summary: 创建弹性IP + parameters: + - in: body + name: elasticip + required: true + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpCreate' + responses: + 200: + description: 新建弹性IP的信息 + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpResponse' + tags: + - elasticips + +get: + summary: 按指定条件列出弹性IP列表 + parameters: + - $ref: '../parameters/common.yaml#/limit' + - $ref: '../parameters/common.yaml#/offset' + - $ref: '../parameters/common.yaml#/cloudprovider' + - $ref: '../parameters/common.yaml#/cloudaccount' + - $ref: '../parameters/common.yaml#/provider' + - $ref: '../parameters/common.yaml#/brand' + - $ref: '../parameters/common.yaml#/cloud_env' + - $ref: '../parameters/common.yaml#/public_cloud' + - $ref: '../parameters/common.yaml#/private_cloud' + - $ref: '../parameters/elasticip.yaml#/usable_eip_for_associate_type' + - $ref: '../parameters/elasticip.yaml#/usable_eip_for_associate_id' + - $ref: '../parameters/elasticip.yaml#/usable' + responses: + 200: + description: 弹性IP列表信息 + schema: + $ref: '../schemas/elasticip.yaml#/ElasticIpListResponse' + tags: + - elasticips diff --git a/docs/elasticip/purge.yaml b/docs/elasticip/purge.yaml new file mode 100644 index 0000000000..c10890ab1e --- /dev/null +++ b/docs/elasticip/purge.yaml @@ -0,0 +1,12 @@ +post: + summary: 清除弹性EIP数据库记录(并不真正删除资源) + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + responses: + 200: + description: 弹性IP信息 + schema: + $ref: "../schemas/elasticip.yaml#ElasticIpResponse" + + tags: + - elasticips \ No newline at end of file diff --git a/docs/elasticip/sync.yaml b/docs/elasticip/sync.yaml new file mode 100644 index 0000000000..61cef855f4 --- /dev/null +++ b/docs/elasticip/sync.yaml @@ -0,0 +1,12 @@ +post: + summary: 同步弹性EIP状态 + parameters: + - $ref: "../parameters/elasticip.yaml#/elasticipId" + responses: + 200: + description: 弹性IP信息 + schema: + $ref: "../schemas/elasticip.yaml#ElasticIpResponse" + + tags: + - elasticips \ No newline at end of file diff --git a/docs/index.yaml b/docs/index.yaml index 6467df759e..a314e4861f 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -297,3 +297,43 @@ paths: $ref: "./serversku/enable.yaml" /serverskus/{serverskuId}/disable: $ref: "./serversku/disable.yaml" + + /secgroups: + $ref: "./secgroup/secgroups.yaml" + /secgroups/{secgroupId}: + $ref: "./secgroup/secgroup.yaml" + /secgroups/{secgroupId}/clone: + $ref: "./secgroup/clone.yaml" + /secgroups/{secgroupId}/union: + $ref: "./secgroup/union.yaml" + /secgroups/{secgroupId}/add-rule: + $ref: "./secgroup/add-rule.yaml" + /secgroups/{secgroupId}/public: + $ref: "./secgroup/public.yaml" + /secgroups/{secgroupId}/private: + $ref: "./secgroup/private.yaml" + /secgrouprules: + $ref: "./secgrouprule/secgrouprules.yaml" + /secgrouprules/{secgroupruleId}: + $ref: "./secgrouprule/secgrouprule.yaml" + + /keypairs: + $ref: "./keypair/keypairs.yaml" + /keypairs/{keypairId}: + $ref: "./keypair/keypair.yaml" + + + /elasticips: + $ref: "./elasticip/elasticips.yaml" + /elasticips/{elasticipId}: + $ref: "./elasticip/elasticip.yaml" + /elasticips/{elasticipId}/associate: + $ref: "./elasticip/associate.yaml" + /elasticips/{elasticipId}/dissociate: + $ref: "./elasticip/dissociate.yaml" + /elasticips/{elasticipId}/change-bandwidth: + $ref: "./elasticip/change-bandwidth.yaml" + /elasticips/{elasticipId}/purge: + $ref: "./elasticip/purge.yaml" + /elasticips/{elasticipId}/sync: + $ref: "./elasticip/sync.yaml" \ No newline at end of file diff --git a/docs/keypair/keypair.yaml b/docs/keypair/keypair.yaml new file mode 100644 index 0000000000..0074def153 --- /dev/null +++ b/docs/keypair/keypair.yaml @@ -0,0 +1,39 @@ +get: + summary: 获取指定秘钥详情信息 + parameters: + - $ref: "../parameters/keypair.yaml#/keypairId" + responses: + 200: + description: 秘钥详情信息 + schema: + $ref: "../schemas/keypair.yaml#/KeypairResponse" + tags: + - keypairs + +delete: + summary: 删除指定秘钥 + parameters: + - $ref: '../parameters/keypair.yaml#/keypairId' + responses: + 200: + schema: + $ref: '../schemas/keypair.yaml#/KeypairResponse' + tags: + - keypairs + +put: + summary: 更新秘钥信息 + parameters: + - $ref: '../parameters/keypair.yaml#/keypairId' + - in: body + name: keypair + required: true + schema: + $ref: '../schemas/keypair.yaml#/KeypairUpdate' + responses: + 200: + description: 秘钥信息 + schema: + $ref: '../schemas/keypair.yaml#/KeypairResponse' + tags: + - keypairs \ No newline at end of file diff --git a/docs/keypair/keypairs.yaml b/docs/keypair/keypairs.yaml new file mode 100644 index 0000000000..8ce53807c1 --- /dev/null +++ b/docs/keypair/keypairs.yaml @@ -0,0 +1,29 @@ +post: + summary: 创建秘钥 + parameters: + - in: body + name: keypair + required: true + schema: + $ref: '../schemas/keypair.yaml#/KeypairCreate' + responses: + 200: + description: 新建秘钥的信息 + schema: + $ref: '../schemas/keypair.yaml#/KeypairResponse' + tags: + - keypairs + +get: + summary: 按指定条件列出秘钥列表 + parameters: + - $ref: '../parameters/common.yaml#/limit' + - $ref: '../parameters/common.yaml#/offset' + - $ref: '../parameters/keypair.yaml#/admin' + responses: + 200: + description: 秘钥列表信息 + schema: + $ref: '../schemas/keypair.yaml#/KeypairListResponse' + tags: + - keypairs diff --git a/docs/network/networks.yaml b/docs/network/networks.yaml index fc9ffb4f6a..17db3cf86b 100644 --- a/docs/network/networks.yaml +++ b/docs/network/networks.yaml @@ -6,7 +6,7 @@ post: required: true schema: $ref: '../schemas/network.yaml#/NetworkCreate' - response: + responses: 200: description: 新建IP子网的信息 schema: diff --git a/docs/parameters/common.yaml b/docs/parameters/common.yaml index db18389fca..91f519c168 100644 --- a/docs/parameters/common.yaml +++ b/docs/parameters/common.yaml @@ -43,6 +43,11 @@ account: in: query type: string description: 根据账号过滤 +cloudaccount: + name: account + in: query + type: string + description: 根据账号过滤 cloudprovider: name: cloudprovider in: query @@ -119,5 +124,10 @@ description: public_cloud: name: public_cloud in: query - type: string + type: boolean + description: 过滤公有云资源 +private_cloud: + name: private_cloud + in: query + type: boolean description: 过滤公有云资源 diff --git a/docs/parameters/elasticip.yaml b/docs/parameters/elasticip.yaml new file mode 100644 index 0000000000..3759b44288 --- /dev/null +++ b/docs/parameters/elasticip.yaml @@ -0,0 +1,63 @@ +elasticipId: + name: elasticipId + required: true + in: path + type: string + description: 弹性IP名称或者ID + +usable_eip_for_associate_type: + name: usable_eip_for_associate_type + required: false + in: query + type: string + enum: [server] + example: server + description: 关联资源类型,和usable_eip_for_associate_id配合使用过滤可关联的eip列表 + +usable_eip_for_associate_id: + name: usable_eip_for_associate_id + required: false + in: query + type: string + example: 6c7d1cc2-1877-458c-8109-b7528a81c2d6 + description: 关联资源id,和usable_eip_for_associate_type配合使用过滤可关联的eip列表 + +usable: + name: usable + required: false + in: query + type: boolean + example: true + description: 过滤状态为ready并且未被绑定的eip列表 + +instance_id: + name: instance_id + required: true + in: body + type: string + example: 6c7d1cc2-1877-458c-8109-b7528a81c2d6 + description: 实例名称或ID + +instance_type: + name: instance_type + required: true + in: body + type: string + enum: [server] + example: server + description: 实例类型,目前仅支持server + +bandwidth: + name: bandwidth + in: body + type: integer + example: 10 + description: 修改的带宽大小,单位(Mbps),目前腾讯云和微软云不支持修改带宽 + +auto_delete: + name: auto_delete + in: body + type: boolean + default: false + example: false + description: 解绑弹性EIP后自动删除弹性EIP \ No newline at end of file diff --git a/docs/parameters/keypair.yaml b/docs/parameters/keypair.yaml new file mode 100644 index 0000000000..3f3d6a12b1 --- /dev/null +++ b/docs/parameters/keypair.yaml @@ -0,0 +1,13 @@ +keypairId: + name: keypairId + required: true + in: path + type: string + description: 秘钥对名称或者ID + +admin: + name: admin + required: false + in: path + type: boolean + description: 是否列出所有秘钥信息 diff --git a/docs/parameters/secgroup.yaml b/docs/parameters/secgroup.yaml new file mode 100644 index 0000000000..760dd37f95 --- /dev/null +++ b/docs/parameters/secgroup.yaml @@ -0,0 +1,25 @@ +secgroupId: + name: secgroupId + required: true + in: path + type: string + description: 安全组名称或者ID + +scope: + name: scope + in: body + type: string + enum: [project, domain, system] + default: system + description: specify scope, either project, domain or system + +shared_projects: + name: shared_projects + in: body + type: array + items: + type: string + example: test-project + description: 项目名称或ID + description: 共享到的项目列表, 仅scope=project有效 + diff --git a/docs/parameters/secgrouprule.yaml b/docs/parameters/secgrouprule.yaml new file mode 100644 index 0000000000..cea163ab65 --- /dev/null +++ b/docs/parameters/secgrouprule.yaml @@ -0,0 +1,12 @@ +secgroupruleId: + name: secgroupruleId + required: true + in: path + type: string + description: 安全组规则ID + +secgroup: + name: secgroup + in: body + type: string + description: 安全组名称或ID \ No newline at end of file diff --git a/docs/schemas/common.yaml b/docs/schemas/common.yaml index 29688a2677..d28cf5823d 100644 --- a/docs/schemas/common.yaml +++ b/docs/schemas/common.yaml @@ -119,4 +119,17 @@ SharableVirtualResourceBaseResponse: example: system description: public_scope readOnly: true - \ No newline at end of file + +BillingBaseResponse: + type: object + properties: + billing_type: + type: string + example: postpaid + enum: [postpaid, prepaid] + description: 资源计费类型 + expired_at: + type: string + example: "2019-06-11T03:39:02.000000Z" + description: 资源到期时间,仅对预付费类型资源有效 + \ No newline at end of file diff --git a/docs/schemas/elasticip.yaml b/docs/schemas/elasticip.yaml new file mode 100644 index 0000000000..39eaf0e1cc --- /dev/null +++ b/docs/schemas/elasticip.yaml @@ -0,0 +1,126 @@ +ElasticIpCreate: + type: object + properties: + name: + type: string + example: test-elasticip + required: true + description: 弹性IP名称 + description: + type: string + example: elasticip-description + description: 弹性IP描述 + region: + type: string + example: be2581d5-4c35-4e5d-8235-8861061b660d + required: true + description: 区域名称或ID + manager: + type: string + example: b3b6fcc4-3fa5-450a-89b5-26d855e6f102 + required: true + description: 子订阅名称或ID + charge_type: + type: string + example: bandwidth + default: triffic + description: 计费类型,traffic or bandwidth + network: + type: string + example: be2581d5-4c35-4e5d-8235-8861061b660d + description: 子网名称或ID,私有云必须指定子网 + bandwidth: + type: integer + default: 0 + description: 带宽大小 + auto_dellocate: + type: boolean + default: false + description: 是否解绑时自动删除 + ip_addr: + type: string + description: 仅私有云可以指定ip子网内的IP + +ElasticIpResponse: + type: object + properties: + elasticip: + type: object + $ref: '#/ElasticIp' + +ElasticIp: + allOf: + - $ref: "./common.yaml#/VirtualResourceBaseResponse" + - $ref: "./common.yaml#/BillingBaseResponse" + - $ref: "./common.yaml#/ExternalizedResourceBaseResponse" + - type: object + properties: + associate_id: + type: string + example: 0b50463b-929f-44a1-86e0-274f73f9de05 + description: 弹性IP绑定的设备ID + associate_type: + type: string + example: server + enum: [loadbalancer, server, natgateway] + description: 弹性IP绑定的设备类型 + bandwidth: + type: integer + example: 0 + description: 弹性IP带宽大小,单位(Mbps) + network_id: + type: string + example: be2581d5-4c35-4e5d-8235-8861061b660d + description: IP子网ID,目前仅私有云会有这个字段 + mode: + type: string + example: elastic_ip + enum: [elastic_ip, public_ip] + description: 弹性IP或固定公网IP + ip_addr: + type: stirng + example: 47.93.237.215 + description: 弹性IP地址 + charge_type: + type: string + example: traffic + enum: [traffic, bandwidth] + description: 按带宽还是按流量计费 + # bgp_type: + # type: string + # example: + # description: 目前华为云需要此字段 + auto_dellocate: + type: boolean + example: false + description: 解绑EIP时是否自动删除EIP + cloudregion_id: + type: string + example: 60c86e4a-5a44-48c3-8ddb-57799a2207e2 + description: 所在区域ID + +ElasticIpListResponse: + type: object + properties: + limit: + type: integer + example: 20 + elasticips: + type: array + items: + $ref: '#/ElasticIp' + total: + type: integer + example: 124 + +ElasticIpUpdate: + type: object + properties: + name: + type: string + example: test-keypair + description: 弹性IP名称 + description: + type: string + example: keypair-description + description: 弹性IP描述 diff --git a/docs/schemas/keypair.yaml b/docs/schemas/keypair.yaml new file mode 100644 index 0000000000..1536ce94cf --- /dev/null +++ b/docs/schemas/keypair.yaml @@ -0,0 +1,90 @@ +KeypairCreate: + type: object + properties: + name: + type: string + example: test-keypair + description: 秘钥名称 + description: + type: string + example: keypair-description + description: 秘钥描述 + scheme: + type: string + example: RSA + enum: [RSA, DSA] + default: RSA + description: 秘钥scheme + public_key: + type: string + example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXxGBcdTPHr2XB2Sr1fknLkRaU3329ltWPjp/vA94QjIGVP98ct0dj/Yu0y2w4t0yqcLSVcZyn0Jo07ErNy9RnvL2F1ecOcg7OgRL+WY3zcOm90RILEQ8/wzUpZmAmTbFSZU7MzPxfdIRyq9UW/qUd/ebX9FD3bq+9HxlJQ9hHAQXyyOJB+Ex4akxOR09ZaVmmIlipa4CHZDfAF4BnXuL+XWAaRnF/xPmUjSTTbsXGV/iKMheexgdJ9zrDycAzA2Qg938fHXpcqHWxdBzcIQ6BEbFNz1RGBAyqPT8l3PNhf+NHSnDufob7y5+bp0z7hvtucujqxOViFhMzAGmtGMZz test@all-in-one + description: 秘钥公钥 + + +KeypairResponse: + type: object + properties: + keypair: + type: object + $ref: '#/Keypair' + +Keypair: + allOf: + - $ref: "./common.yaml#/StandaloneResponse" + - type: object + properties: + scheme: + type: string + example: RSA + enum: [RSA, DSA] + description: 秘钥scheme + publick_key: + type: string + example: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXxGBcdTPHr2XB2Sr1fknLkRaU3329ltWPjp/vA94QjIGVP98ct0dj/Yu0y2w4t0yqcLSVcZyn0Jo07ErNy9RnvL2F1ecOcg7OgRL+WY3zcOm90RILEQ8/wzUpZmAmTbFSZU7MzPxfdIRyq9UW/qUd/ebX9FD3bq+9HxlJQ9hHAQXyyOJB+Ex4akxOR09ZaVmmIlipa4CHZDfAF4BnXuL+XWAaRnF/xPmUjSTTbsXGV/iKMheexgdJ9zrDycAzA2Qg938fHXpcqHWxdBzcIQ6BEbFNz1RGBAyqPT8l3PNhf+NHSnDufob7y5+bp0z7hvtucujqxOViFhMzAGmtGMZz test@all-in-one + description: 公钥 + fingerprint: + type: string + example: f6:54:e2:fe:5e:9d:36:38:bf:30:8a:0f:18:4a:49:81 + description: 私钥 + private_key_len: + type: integer + example: 0 + description: 私钥长度 + linked_guest_count: + type: integer + example: 1 + description: 关联实例数量 + owner_id: + type: string + example: e80d6618-d6a8-4e1c-8646-33949e40bade + description: 所属用户ID + owner_name: + type: string + example: test-user + description: 所属用户名称 + +KeypairListResponse: + type: object + properties: + limit: + type: integer + example: 20 + keypairs: + type: array + items: + $ref: '#/Keypair' + total: + type: integer + example: 124 + +KeypairUpdate: + type: object + properties: + name: + type: string + example: test-keypair + description: 秘钥名称 + description: + type: string + example: keypair-description + description: 秘钥描述 diff --git a/docs/schemas/secgroup.yaml b/docs/schemas/secgroup.yaml new file mode 100644 index 0000000000..d0eb0d60ea --- /dev/null +++ b/docs/schemas/secgroup.yaml @@ -0,0 +1,106 @@ +SecgroupCreate: + type: object + properties: + name: + type: string + example: test-secgroup + description: 安全组名称 + description: + type: string + example: secgrou-description + description: 安全组描述 + +SecgroupResponse: + type: object + properties: + secgroup: + type: object + $ref: '#/Secgroup' + +Secgroup: + allOf: + - $ref: "./common.yaml#/SharableVirtualResourceBaseResponse" + +SecgroupListResponse: + type: object + properties: + limit: + type: integer + example: 20 + secgroups: + type: array + items: + $ref: '#/Secgroup' + total: + type: integer + example: 124 + +SecgroupUpdate: + type: object + properties: + name: + type: string + example: test-secgroup + description: 安全组名称 + description: + type: string + example: secgrou-description + description: 安全组描述 + +SecgroupClone: + type: object + properties: + name: + type: string + example: test-clone-secgroup + description: 安全组名称 + description: + type: string + example: test-clone-secgroup-description + description: 安全组描述 + +SecgroupUnion: + type: object + properties: + secgroups: + type: array + items: + type: string + description: 待合并的安全组名称或ID列表 + +SecgroupAddRule: + type: object + properties: + priority: + type: int + example: 10 + min: 1 + max: 100 + description: 规则优先级 + protocol: + type: string + example: tcp + enum: [tcp, udp, icmp, any] + description: 规则协议类型 + ports: + type: string + example: 10-20 + description: 端口,支持单个端口或端口范围 + direction: + type: string + example: in + enum: [in, out] + description: 规则出入方向 + cidr: + type: string + example: 10.10.12.0/24 + description: 规则协议地址 + action: + type: string + example: deny + enum: [allow, deny] + description: 禁止或允许 + description: + type: string + example: test-rule + description: 规则描述 \ No newline at end of file diff --git a/docs/schemas/secgrouprule.yaml b/docs/schemas/secgrouprule.yaml new file mode 100644 index 0000000000..9a15d40d22 --- /dev/null +++ b/docs/schemas/secgrouprule.yaml @@ -0,0 +1,132 @@ +SecgroupRuleCreate: + type: object + properties: + priority: + type: int + example: 10 + min: 1 + max: 100 + description: 规则优先级 + protocol: + type: string + example: tcp + enum: [tcp, udp, icmp, any] + description: 规则协议类型 + ports: + type: string + example: 10-20 + description: 端口,支持单个端口或端口范围 + direction: + type: string + example: in + enum: [in, out] + description: 规则出入方向 + cidr: + type: string + example: 10.10.12.0/24 + description: 规则协议地址 + action: + type: string + example: deny + enum: [allow, deny] + description: 禁止或允许 + description: + type: string + example: test-rule + secgroup: + type: string + example: test-secgroup + required: true + description: 安全组名称或ID + +SecgroupRuleResponse: + type: object + properties: + secgrouprule: + type: object + $ref: '#/SecgroupRule' + +SecgroupRule: + type: object + properties: + id: + type: string + example: 37617a8d-0265-4385-8002-2ad685bd2024 + description: 安全组规则ID + priority: + type: int + example: 10 + description: 规则优先级 + protocol: + type: string + example: tcp + description: 规则协议类型 + ports: + type: string + example: 10-20 + description: 端口,支持单个端口或端口范围 + direction: + type: string + example: in + description: 规则出入方向 + cidr: + type: string + example: 10.10.12.0/24 + description: 规则协议地址 + action: + type: string + example: deny + description: 禁止或允许 + description: + type: string + example: test-rule + +SecgroupRuleListResponse: + type: object + properties: + limit: + type: integer + example: 20 + secgrouprules: + type: array + items: + $ref: '#/SecgroupRule' + total: + type: integer + example: 124 + +SecgroupRuleUpdate: + type: object + properties: + priority: + type: int + example: 10 + min: 1 + max: 100 + description: 规则优先级 + protocol: + type: string + example: tcp + enum: [tcp, udp, icmp, any] + description: 规则协议类型 + ports: + type: string + example: 10-20 + description: 端口,支持单个端口或端口范围 + direction: + type: string + example: in + enum: [in, out] + description: 规则出入方向 + cidr: + type: string + example: 10.10.12.0/24 + description: 规则协议地址 + action: + type: string + example: deny + enum: [allow, deny] + description: 禁止或允许 + description: + type: string + example: test-rule diff --git a/docs/secgroup/add-rule.yaml b/docs/secgroup/add-rule.yaml new file mode 100644 index 0000000000..33f38081a4 --- /dev/null +++ b/docs/secgroup/add-rule.yaml @@ -0,0 +1,16 @@ +post: + summary: 添加安全组规则 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupAddRule' + responses: + 200: + description: 安全组信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgroup/clone.yaml b/docs/secgroup/clone.yaml new file mode 100644 index 0000000000..87a10b9f87 --- /dev/null +++ b/docs/secgroup/clone.yaml @@ -0,0 +1,16 @@ +post: + summary: 克隆安全组及安全组下面的规则 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupClone' + responses: + 200: + description: 安全组信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgroup/private.yaml b/docs/secgroup/private.yaml new file mode 100644 index 0000000000..a474f92ba9 --- /dev/null +++ b/docs/secgroup/private.yaml @@ -0,0 +1,12 @@ +post: + summary: 取消安全组共享 + parameters: + - $ref: "../parameters/secgroup.yaml#/secgroupId" + responses: + 200: + description: 安全组信息 + schema: + $ref: "../schemas/secgroup.yaml#SecgroupResponse" + + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgroup/public.yaml b/docs/secgroup/public.yaml new file mode 100644 index 0000000000..14b21ee9ba --- /dev/null +++ b/docs/secgroup/public.yaml @@ -0,0 +1,14 @@ +post: + summary: 共享安全组 + parameters: + - $ref: "../parameters/secgroup.yaml#/secgroupId" + - $ref: "../parameters/secgroup.yaml#/scope" + - $ref: "../parameters/secgroup.yaml#/shared_projects" + responses: + 200: + description: 安全组信息 + schema: + $ref: "../schemas/secgroup.yaml#SecgroupResponse" + + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgroup/secgroup.yaml b/docs/secgroup/secgroup.yaml new file mode 100644 index 0000000000..1eafd4c29c --- /dev/null +++ b/docs/secgroup/secgroup.yaml @@ -0,0 +1,39 @@ +get: + summary: 获取指定安全组详情信息 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + responses: + 200: + description: 安全组信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups + +delete: + summary: 删除指定安全组 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + responses: + 200: + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups + +put: + summary: 更新安全组信息 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupUpdate' + responses: + 200: + description: 安全组信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgroup/secgroups.yaml b/docs/secgroup/secgroups.yaml new file mode 100644 index 0000000000..fbd6e1c09a --- /dev/null +++ b/docs/secgroup/secgroups.yaml @@ -0,0 +1,28 @@ +post: + summary: 创建安全组 + parameters: + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupCreate' + responses: + 200: + description: 新建安全组的信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups + +get: + summary: 按指定条件列出安全组列表 + parameters: + - $ref: '../parameters/common.yaml#/limit' + - $ref: '../parameters/common.yaml#/offset' + responses: + 200: + description: 安全组列表信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupListResponse' + tags: + - secgroups diff --git a/docs/secgroup/union.yaml b/docs/secgroup/union.yaml new file mode 100644 index 0000000000..f256995246 --- /dev/null +++ b/docs/secgroup/union.yaml @@ -0,0 +1,16 @@ +post: + summary: 合并安全组 + parameters: + - $ref: '../parameters/secgroup.yaml#/secgroupId' + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupUnion' + responses: + 200: + description: 安全组信息 + schema: + $ref: '../schemas/secgroup.yaml#/SecgroupResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgrouprule/secgrouprule.yaml b/docs/secgrouprule/secgrouprule.yaml new file mode 100644 index 0000000000..f06ce57ac3 --- /dev/null +++ b/docs/secgrouprule/secgrouprule.yaml @@ -0,0 +1,39 @@ +get: + summary: 获取指定安全组规则详情信息 + parameters: + - $ref: "../parameters/secgrouprule.yaml#/secgroupruleId" + responses: + 200: + description: 安全组规则详情信息 + schema: + $ref: "../schemas/secgrouprule.yaml#/SecgroupRuleResponse" + tags: + - secgroups + +delete: + summary: 删除指定安全组规则 + parameters: + - $ref: '../parameters/secgrouprule.yaml#/secgroupruleId' + responses: + 200: + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleResponse' + tags: + - secgroups + +put: + summary: 更新安全组规则信息 + parameters: + - $ref: '../parameters/secgrouprule.yaml#/secgroupruleId' + - in: body + name: secgroup + required: true + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleUpdate' + responses: + 200: + description: 安全组规则信息 + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/secgrouprule/secgrouprules.yaml b/docs/secgrouprule/secgrouprules.yaml new file mode 100644 index 0000000000..f0c5c9a34e --- /dev/null +++ b/docs/secgrouprule/secgrouprules.yaml @@ -0,0 +1,29 @@ +post: + summary: 创建安全组规则 + parameters: + - in: body + name: secgrouprule + required: true + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleCreate' + responses: + 200: + description: 新建安全组规则的信息 + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleResponse' + tags: + - secgroups + +get: + summary: 按指定条件列出安全组规则列表 + parameters: + - $ref: '../parameters/common.yaml#/limit' + - $ref: '../parameters/common.yaml#/offset' + - $ref: '../parameters/secgrouprule.yaml#/secgroup' + responses: + 200: + description: 安全组规则信息 + schema: + $ref: '../schemas/secgrouprule.yaml#/SecgroupRuleListResponse' + tags: + - secgroups \ No newline at end of file diff --git a/docs/storage/storages.yaml b/docs/storage/storages.yaml index 17d11fb486..d7717312e2 100644 --- a/docs/storage/storages.yaml +++ b/docs/storage/storages.yaml @@ -6,7 +6,7 @@ post: required: true schema: $ref: '../schemas/storage.yaml#/StorageCreate' - response: + responses: 200: description: 新建存储的信息 schema: