Skip to content

Commit

Permalink
Add API to extract and refine sites info from MCIS info
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored May 21, 2024
2 parents ec2875b + 8138994 commit c2edb7a
Show file tree
Hide file tree
Showing 6 changed files with 507 additions and 12 deletions.
118 changes: 118 additions & 0 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3290,6 +3290,65 @@ const docTemplate = `{
}
}
},
"/ns/{nsId}/mcis/{mcisId}/site": {
"get": {
"description": "Get sites in MCIS",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[VPN] Sites in MCIS (under development)"
],
"summary": "Get sites in MCIS",
"parameters": [
{
"type": "string",
"default": "ns01",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "mcis01",
"description": "MCIS ID",
"name": "mcisId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SitesInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/mcis/{mcisId}/subgroup": {
"get": {
"description": "List SubGroup IDs in a specified MCIS",
Expand Down Expand Up @@ -12553,6 +12612,65 @@ const docTemplate = `{
}
}
},
"model.SiteDetail": {
"type": "object",
"properties": {
"csp": {
"type": "string",
"example": "aws"
},
"gatewaySubnetCidr": {
"type": "string",
"example": "xxx.xxx.xxx.xxx/xx"
},
"region": {
"type": "string",
"example": "ap-northeast-2"
},
"resourceGroup": {
"type": "string",
"example": "rg-xxxxx"
},
"subnet": {
"type": "string",
"example": "subnet-xxxxx"
},
"vnet": {
"type": "string",
"example": "vpc-xxxxx"
},
"zone": {
"type": "string",
"example": "ap-northeast-2a"
}
}
},
"model.SitesInfo": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"example": 3
},
"mcisId": {
"type": "string",
"example": "mcis-01"
},
"nsId": {
"type": "string",
"example": "ns-01"
},
"sites": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/model.SiteDetail"
}
}
}
}
},
"model.TfVarsGcpAwsVpnTunnel": {
"type": "object",
"required": [
Expand Down
118 changes: 118 additions & 0 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3283,6 +3283,65 @@
}
}
},
"/ns/{nsId}/mcis/{mcisId}/site": {
"get": {
"description": "Get sites in MCIS",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[VPN] Sites in MCIS (under development)"
],
"summary": "Get sites in MCIS",
"parameters": [
{
"type": "string",
"default": "ns01",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "mcis01",
"description": "MCIS ID",
"name": "mcisId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.SitesInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/common.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/mcis/{mcisId}/subgroup": {
"get": {
"description": "List SubGroup IDs in a specified MCIS",
Expand Down Expand Up @@ -12546,6 +12605,65 @@
}
}
},
"model.SiteDetail": {
"type": "object",
"properties": {
"csp": {
"type": "string",
"example": "aws"
},
"gatewaySubnetCidr": {
"type": "string",
"example": "xxx.xxx.xxx.xxx/xx"
},
"region": {
"type": "string",
"example": "ap-northeast-2"
},
"resourceGroup": {
"type": "string",
"example": "rg-xxxxx"
},
"subnet": {
"type": "string",
"example": "subnet-xxxxx"
},
"vnet": {
"type": "string",
"example": "vpc-xxxxx"
},
"zone": {
"type": "string",
"example": "ap-northeast-2a"
}
}
},
"model.SitesInfo": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"example": 3
},
"mcisId": {
"type": "string",
"example": "mcis-01"
},
"nsId": {
"type": "string",
"example": "ns-01"
},
"sites": {
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/model.SiteDetail"
}
}
}
}
},
"model.TfVarsGcpAwsVpnTunnel": {
"type": "object",
"required": [
Expand Down
82 changes: 82 additions & 0 deletions src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2794,6 +2794,48 @@ definitions:
tfVars:
$ref: '#/definitions/model.TfVarsGcpAwsVpnTunnel'
type: object
model.SiteDetail:
properties:
csp:
example: aws
type: string
gatewaySubnetCidr:
example: xxx.xxx.xxx.xxx/xx
type: string
region:
example: ap-northeast-2
type: string
resourceGroup:
example: rg-xxxxx
type: string
subnet:
example: subnet-xxxxx
type: string
vnet:
example: vpc-xxxxx
type: string
zone:
example: ap-northeast-2a
type: string
type: object
model.SitesInfo:
properties:
count:
example: 3
type: integer
mcisId:
example: mcis-01
type: string
nsId:
example: ns-01
type: string
sites:
additionalProperties:
additionalProperties:
$ref: '#/definitions/model.SiteDetail'
type: object
type: object
type: object
model.TfVarsGcpAwsVpnTunnel:
properties:
aws-region:
Expand Down Expand Up @@ -5133,6 +5175,46 @@ paths:
summary: Add VMs to NLB
tags:
- '[Infra resource] NLB management (for developer)'
/ns/{nsId}/mcis/{mcisId}/site:
get:
consumes:
- application/json
description: Get sites in MCIS
parameters:
- default: ns01
description: Namespace ID
in: path
name: nsId
required: true
type: string
- default: mcis01
description: MCIS ID
in: path
name: mcisId
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/model.SitesInfo'
"400":
description: Bad Request
schema:
$ref: '#/definitions/common.SimpleMsg'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/common.SimpleMsg'
"503":
description: Service Unavailable
schema:
$ref: '#/definitions/common.SimpleMsg'
summary: Get sites in MCIS
tags:
- '[VPN] Sites in MCIS (under development)'
/ns/{nsId}/mcis/{mcisId}/subgroup:
get:
consumes:
Expand Down
Loading

0 comments on commit c2edb7a

Please sign in to comment.