add elb acl&certificate api & add swagger common components

This commit is contained in:
TangBin
2019-06-12 15:28:55 +08:00
parent 41a1f0a80f
commit 99bcbfb735
10 changed files with 318 additions and 6 deletions

View File

@@ -1,7 +1,8 @@
parameters:
- $ref: "../parameters/image.yaml#/imageId"
head:
summary: 获取指定镜像详情信息
parameters:
- $ref: "../parameters/image.yaml#/imageId"
responses:
200:
description: 镜像信息
@@ -91,7 +92,6 @@ head:
put:
parameters:
- $ref: "../parameters/image.yaml#/imageId"
- $ref: "../parameters/image.yaml#/x-image-meta-name"
- $ref: "../parameters/image.yaml#/x-image-meta-is_public"
- $ref: "../parameters/image.yaml#/x-image-meta-description"
@@ -109,7 +109,6 @@ put:
- glance
get:
parameters:
- $ref: "../parameters/image.yaml#/imageId"
- in: query
name: format
type: string

View File

@@ -148,6 +148,16 @@ paths:
/loadbalancers/{loadbalancerId}:
$ref: "./loadbalancer/loadbalancer.yaml"
/cached_loadbalancer_acls:
$ref: "./loadbalancer/loadbalancercachedacl.yaml"
/cached_loadbalancer_acls/{loadbalancerlistenerId}:
$ref: "./loadbalancer/loadbalancercachedacls.yaml"
/cached_loadbalancercertificates:
$ref: "./loadbalancer/loadbalancercachedcertificate.yaml"
/cached_loadbalancercertificates/{loadbalancerlistenerId}:
$ref: "./loadbalancer/loadbalancercachedcertificates.yaml"
/loadbalancerlisteners:
$ref: "./loadbalancer/loadbalancerlisteners.yaml"
/loadbalancerlisteners/{loadbalancerlistenerId}:

View File

@@ -6,7 +6,7 @@ get:
200:
description: 实例信息
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerResponse"
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedAclListResponse"
tags:
- loadbalancers
delete:

View File

@@ -0,0 +1,21 @@
parameters:
- $ref: "../parameters/loadbalancer.yaml#/loadbalancercachedaclId"
get:
summary: 获取指定ACL缓存详情
responses:
200:
description: ACL信息
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedAclResponse"
tags:
- loadbalanceracls
delete:
summary: 删除指定ACL缓存
responses:
200:
description: 被删除ACL信息
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedAclResponse"
tags:
- loadbalanceracls

View File

@@ -0,0 +1,11 @@
get:
summary: 按指定条件列出ACL缓存
parameters:
- $ref: "../parameters/loadbalancer.yaml#/acl_id"
responses:
200:
description: ACL缓存列表
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedAclListResponse"
tags:
- loadbalanceracls

View File

@@ -0,0 +1,21 @@
parameters:
- $ref: "../parameters/loadbalancer.yaml#/loadbalancercachedcertificateId"
get:
summary: 获取指定证书缓存详情
responses:
200:
description: 证书缓存信息
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedCertificateResponse"
tags:
- loadbalancercertificates
delete:
summary: 删除指定证书缓存
responses:
200:
description: 被删除证书缓存信息
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedCertificateResponse"
tags:
- loadbalancercertificates

View File

@@ -0,0 +1,11 @@
get:
summary: 按指定条件列出证书缓存
parameters:
- $ref: "../parameters/loadbalancer.yaml#/certificate_id"
responses:
200:
description: 证书缓存列表
schema:
$ref: "../schemas/loadbalancer.yaml#/LoadbalancerCachedCertificateListResponse"
tags:
- loadbalancercertificates

View File

@@ -19,6 +19,19 @@ loadbalancerbackendId:
type: string
in: path
required: true
loadbalancercachedaclId:
name: loadbalancercachedaclId
type: string
in: path
required: true
description: 访问控制缓存id
loadbalancercachedcertificateId:
name: loadbalancercachedcertificateId
type: string
in: path
required: true
description: 证书缓存id
address:
name: address
@@ -53,4 +66,14 @@ port:
name: port
in: query
type: integer
description: 指定real port
description: 指定real port
acl_id:
name: acl_id
in: query
type: string
description: 指定loadbalaner本地访问控制id
certificate_id:
name: certificate_id
in: query
type: string
description: 指定loadbalaner本地证id

View File

@@ -0,0 +1,111 @@
ResourceBaseResponse:
type: object
properties:
created_at:
type: string
example: 2019-06-10T03:39:02.000000Z
description: 创建时间
readOnly: true
updated_at:
type: string
example: 2019-06-11T03:39:02.000000Z
description: 更新时间
readOnly: true
deleted_at:
type: string
example: 2019-06-12T03:39:02.000000Z
description: 删除时间
readOnly: true
deleted:
type: boolean
example: true
description: 已删除
readOnly: true
ProjectizedResourceBaseResponse:
- type: object
properties:
project_id:
type: string
example: cb58813d83284a7f95040901639013d3
description: 资源所属项目ID
readOnly: true
domain_id:
type: string
example: 9c06c2082007459f81b6e355eedf22fd
description: 资源所属域ID
readOnly: true
ExternalizedResourceBaseResponse:
- type: object
properties:
external_id:
type: string
example: i-7948b8d96f
description: 资源External ID
readOnly: true
StandaloneResponse:
allOf:
- $ref: '#/ResourceBaseResponse'
- type: object
properties:
id:
type: string
example: fc06c2082007459f81b6e355eedf22fd
description: 资源ID
readOnly: true
name:
type: string
example: webserver
description: 资源名称
readOnly: true
description:
type: string
example: onecloud webserver
description: 资源描述
readOnly: true
StatusStandaloneResponse:
allOf:
- $ref: '#/StandaloneResponse'
- type: object
properties:
status:
type: string
example: running
description: 资源状态
readOnly: true
VirtualResourceBaseResponse:
allOf:
- $ref: '#/StatusStandaloneResponse'
- $ref: '#/ProjectizedResourceBaseResponse'
- type: object
properties:
project_src:
type: string
example: local
description: 资源Src
readOnly: true
is_system:
type: boolean
description: 系统资源
readOnly: true
SharableVirtualResourceBaseResponse:
allOf:
- $ref: '#/VirtualResourceBaseResponse'
- $ref: '#/ProjectizedResourceBaseResponse'
- type: object
properties:
is_public:
type: boolean
description: Is Public?
readOnly: true
public_scope:
type: string
example: system
description: public_scope
readOnly: true

View File

@@ -209,3 +209,108 @@ LoadbalancerBackendResponse:
loadbalancerbackend:
type: object
$ref: '#/LoadbalancerBackend'
LoadbalancerAclEntry:
type: object
properties:
cidr:
type: string
example: 192.168.0.1/24
description: 网段
readOnly: true
comment:
type: string
description: 注释
readOnly: true
LoadbalancerAclEntries:
type: array
items:
$ref: '#/LoadbalancerAclEntry'
LoadbalancerCachedAcl:
allOf:
- $ref: "./common.yaml#/SharableVirtualResourceBaseResponse"
- $ref: "./common.yaml#/ExternalizedResourceBaseResponse"
- type: object
properties:
acl_id:
type: string
description: 所属的本地访问控制uuid
acl_entries:
$ref: "#/LoadbalancerAclEntries"
LoadbalancerCachedAclResponse:
$ref: "#/LoadbalancerCachedAcl"
LoadbalancerCachedAclListResponse:
type: object
properties:
cached_loadbalancer_acls:
type: array
items:
$ref: "#/LoadbalancerCachedAcl"
LoadbalancerCachedCertificate:
allOf:
- $ref: "./common.yaml#/SharableVirtualResourceBaseResponse"
- $ref: "./common.yaml#/ExternalizedResourceBaseResponse"
- type: object
properties:
certificate_id:
type: string
example: ab58813d83284a7f95040901639013d3
description: 所属的本地证书uuid
readOnly: true
private_key:
type: string
description: 私钥内容
readOnly: true
publicKey_algorithm:
type: string
description: 公钥算法
readOnly: true
publicKey_bitLen:
type: int
description: 公钥长度
readOnly: true
signature_algorithm:
type: string
description: 签名算法
readOnly: true
fingerprint:
type: string
example: sha1:da:39:a3:ee:5e:6b:4b:0d:32:55:bf:ef:95:60:18:90:af:d8:07:09
description: 证书指纹
readOnly: true
not_before:
type: string
example: 2019-05-23T11:50:33.000000Z
description: 最早生效时间
readOnly: true
not_after:
type: string
example: 2020-05-23T11:50:33.000000Z
description: 失效时间
readOnly: true
common_name:
type: string
example: www.onecloud.com
description: 域名
readOnly: true
subject_alternative_names:
type: string
example: ''
description: 附加域名
readOnly: true
LoadbalancerCachedCertificateResponse:
$ref: "#/LoadbalancerCachedCertificate"
LoadbalancerCachedCertificateListResponse:
type: object
properties:
cached_loadbalancercertificates:
type: array
items:
$ref: "#/LoadbalancerCachedCertificate"