add networkinterfaces api docs

This commit is contained in:
ioito
2019-07-22 21:14:28 +08:00
parent aac4d5bdf5
commit 9fefa312bd
5 changed files with 102 additions and 2 deletions
+6 -2
View File
@@ -334,7 +334,6 @@ paths:
/keypairs/{keypairId}:
$ref: "./keypair/keypair.yaml"
/elasticips:
$ref: "./elasticip/elasticips.yaml"
/elasticips/{elasticipId}:
@@ -348,4 +347,9 @@ paths:
/elasticips/{elasticipId}/purge:
$ref: "./elasticip/purge.yaml"
/elasticips/{elasticipId}/sync:
$ref: "./elasticip/sync.yaml"
$ref: "./elasticip/sync.yaml"
/networkinterfaces:
$ref: "./networkinterface/networkinterfaces.yaml"
/networkinterfaces/{networkinterfaceId}:
$ref: "./networkinterface/networkinterface.yaml"
@@ -0,0 +1,11 @@
get:
summary: 获取指定虚拟网卡详情信息
parameters:
- $ref: "../parameters/networkinterface.yaml#/networkinterfaceId"
responses:
200:
description: 虚拟网卡详情信息
schema:
$ref: "../schemas/networkinterface.yaml#/NetworkinterfaceResponse"
tags:
- networkinterfaces
@@ -0,0 +1,14 @@
get:
summary: 按指定条件列出虚拟网卡列表
parameters:
- $ref: '../parameters/common.yaml#/limit'
- $ref: '../parameters/common.yaml#/offset'
- $ref: '../parameters/common.yaml#/cloudregion'
- $ref: '../parameters/common.yaml#/zone'
responses:
200:
description: 虚拟网卡列表信息
schema:
$ref: "../schemas/networkinterface.yaml#/NetworkinterfaceListResponse"
tags:
- networkinterfaces
+6
View File
@@ -0,0 +1,6 @@
networkinterfaceId:
name: networkinterfaceId
required: true
in: path
type: string
description: 虚拟网卡名称或ID,建议使用ID
+65
View File
@@ -0,0 +1,65 @@
Networkinterface:
allOf:
- $ref: './common.yaml#/StatusStandaloneResponse'
- $ref: './common.yaml#/ExternalizedResourceBaseResponse'
- type: object
properties:
mac:
type: string
example: fa:16:3e:f4:51:76
description: 虚拟网卡MAC地址
associate_id:
type: string
example: 1d18dea0-14a4-4d94-8f18-3a827a0cb124
description: 虚拟网卡绑定设备ID
associate_type:
type: string
example: vip
description: 虚拟网卡绑定设备类型
networks:
type: array
items:
$ref: '#/NetworkinterfaceNetwork'
NetworkinterfaceNetwork:
type: object
properties:
ip_addr:
type: string
example: "192.168.0.240"
description: 虚拟网卡IP地址
network_id:
type: string
example: 19b09a31-1884-4b3f-84cd-ac03827c567d
description: 虚拟网卡所在子网ID
networkinterface_id:
type: string
example: 231aab7c-9106-471a-822c-6dfa605915f7
description: 虚拟网卡ID
primary:
type: boolean
example: true
description: 是否是主IP
NetworkinterfaceListResponse:
type: object
properties:
limit:
type: integer
example: 20
networkinterfaces:
type: array
items:
$ref: '#/Networkinterface'
total:
type: integer
example: 124
NetworkinterfaceResponse:
type: object
properties:
networkinterface:
type: object
$ref: '#/Networkinterface'