mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-29 03:51:54 +08:00
添加安全组api文档
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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"
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -6,7 +6,7 @@ post:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '../schemas/network.yaml#/NetworkCreate'
|
||||
response:
|
||||
responses:
|
||||
200:
|
||||
description: 新建IP子网的信息
|
||||
schema:
|
||||
|
||||
@@ -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: 过滤公有云资源
|
||||
|
||||
@@ -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
|
||||
@@ -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: 是否列出所有秘钥信息
|
||||
@@ -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有效
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
secgroupruleId:
|
||||
name: secgroupruleId
|
||||
required: true
|
||||
in: path
|
||||
type: string
|
||||
description: 安全组规则ID
|
||||
|
||||
secgroup:
|
||||
name: secgroup
|
||||
in: body
|
||||
type: string
|
||||
description: 安全组名称或ID
|
||||
@@ -119,4 +119,17 @@ SharableVirtualResourceBaseResponse:
|
||||
example: system
|
||||
description: public_scope
|
||||
readOnly: true
|
||||
|
||||
|
||||
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: 资源到期时间,仅对预付费类型资源有效
|
||||
|
||||
@@ -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描述
|
||||
@@ -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: 秘钥描述
|
||||
@@ -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: 规则描述
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,12 @@
|
||||
post:
|
||||
summary: 取消安全组共享
|
||||
parameters:
|
||||
- $ref: "../parameters/secgroup.yaml#/secgroupId"
|
||||
responses:
|
||||
200:
|
||||
description: 安全组信息
|
||||
schema:
|
||||
$ref: "../schemas/secgroup.yaml#SecgroupResponse"
|
||||
|
||||
tags:
|
||||
- secgroups
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -6,7 +6,7 @@ post:
|
||||
required: true
|
||||
schema:
|
||||
$ref: '../schemas/storage.yaml#/StorageCreate'
|
||||
response:
|
||||
responses:
|
||||
200:
|
||||
description: 新建存储的信息
|
||||
schema:
|
||||
|
||||
Reference in New Issue
Block a user