Skip to content

Commit

Permalink
Support SQL DB APIs for AWS, Azure, GCP, and NCP
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Nov 15, 2024
2 parents 23a0ca5 + 9fab67c commit b2749b8
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 533 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ services:

# # mc-terrarium (PoC): resource extentions such as VPN for CB-Tumblebug by using OpenTofu
# mc-terrarium:
# image: cloudbaristaorg/mc-terrarium:0.0.10
# image: cloudbaristaorg/mc-terrarium:0.0.16
# container_name: mc-terrarium
# # build:
# # context: .
Expand All @@ -180,6 +180,7 @@ services:
# env_file:
# - ${HOME}/.cloud-barista/secrets/credentials # AWS credentials
# - ${HOME}/.cloud-barista/secrets/credential-azure.env # Azure credentials
# - ${HOME}/.cloud-barista/secrets/credential-ncp.env # NCP credentials
# volumes:
# - ${HOME}/.cloud-barista/secrets:/app/secrets:ro # GCP credentials
# - ./container-volume/mc-terrarium-container/.terrarium:/app/.terrarium
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cloud-barista/cb-tumblebug
go 1.23.0

require (
github.com/cloud-barista/mc-terrarium v0.0.12
github.com/cloud-barista/mc-terrarium v0.0.16
github.com/fsnotify/fsnotify v1.7.0
github.com/go-playground/validator/v10 v10.17.0
github.com/go-resty/resty/v2 v2.13.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ github.com/cloud-barista/mc-terrarium v0.0.9 h1:bJrGg0VZyflw1ncyrD8/6qzMW0YiK2LD
github.com/cloud-barista/mc-terrarium v0.0.9/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cloud-barista/mc-terrarium v0.0.10 h1:WrK/bHyiQZ9ZxRLVoUTY4c3CVH7z+vEzdh7yxo9X4ZM=
github.com/cloud-barista/mc-terrarium v0.0.10/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cloud-barista/mc-terrarium v0.0.15 h1:1yJjCsNMwYZJyYSku9HQPOdj1PwAf5ybYI+DqB1TKsc=
github.com/cloud-barista/mc-terrarium v0.0.15/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cloud-barista/mc-terrarium v0.0.16 h1:0TpSnFk5IpStpQc1YJSbMzB8q1jgVZ639Cjh7YAyxh4=
github.com/cloud-barista/mc-terrarium v0.0.16/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4=
github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec=
Expand Down
2 changes: 2 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ github.com/cloud-barista/mc-terrarium v0.0.11 h1:qfwie72bzJzYSca24BugO23Iv9aq4gI
github.com/cloud-barista/mc-terrarium v0.0.11/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cloud-barista/mc-terrarium v0.0.12 h1:A8vGrm7bF6xBwta9uy5BguMEzUUn3X1WvP7xaacJ014=
github.com/cloud-barista/mc-terrarium v0.0.12/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cloud-barista/mc-terrarium v0.0.16 h1:0TpSnFk5IpStpQc1YJSbMzB8q1jgVZ639Cjh7YAyxh4=
github.com/cloud-barista/mc-terrarium v0.0.16/go.mod h1:iQxZNRa04d7mHA0h5dEPfF7ch1SBUS/ZFGUynKsKJ6I=
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
Expand Down
77 changes: 5 additions & 72 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8166,7 +8166,7 @@ const docTemplate = `{
},
"/ns/{nsId}/resources/sqlDb": {
"get": {
"description": "Get all SQL Databases",
"description": "Get all SQL Databases (TBD)",
"consumes": [
"application/json"
],
Expand All @@ -8176,7 +8176,7 @@ const docTemplate = `{
"tags": [
"[Infra Resource] SQL Database Management (under development)"
],
"summary": "Get all SQL Databases",
"summary": "Get all SQL Databases (TBD)",
"operationId": "GetAllSqlDb",
"parameters": [
{
Expand Down Expand Up @@ -8227,7 +8227,7 @@ const docTemplate = `{
}
},
"post": {
"description": "Create a SQL Databases\n\n- Supported CSPs: AWS (Upcoming CSPs: Azure, GCP, NCP)\n\n- Please check the values ​​required for each CSP through the ` + "`" + `requiredCSPResource` + "`" + ` property.\n",
"description": "Create a SQL Databases\n\nSupported CSPs: AWS, Azure, GCP, NCP\n- Note - ` + "`" + `connectionName` + "`" + ` example: aws-ap-northeast-2, azure-koreacentral, gcp-asia-northeast3, ncpvpc-kr\n\n- Note - Please check the ` + "`" + `requiredCSPResource` + "`" + ` property which includes CSP specific values.\n\n- Note - You can find the API usage examples on this link, https://github.com/cloud-barista/mc-terrarium/discussions/110\n",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -8420,73 +8420,6 @@ const docTemplate = `{
}
}
},
"/ns/{nsId}/resources/sqlDb/{sqlDbId}/request/{requestId}": {
"get": {
"description": "Check the status of a specific request by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra Resource] SQL Database Management (under development)"
],
"summary": "Check the status of a specific request by its ID",
"operationId": "GetRequestStatusOfSqlDb",
"parameters": [
{
"type": "string",
"default": "default",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "sqldb01",
"description": "SQL DB ID",
"name": "sqlDbId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Request ID",
"name": "requestId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/resources/sshKey": {
"get": {
"description": "List all SSH Keys or SSH Keys' ID",
Expand Down Expand Up @@ -12348,7 +12281,7 @@ const docTemplate = `{
"properties": {
"resourceGroup": {
"type": "string",
"example": "rg-xxxx"
"example": "koreacentral"
}
}
},
Expand All @@ -12371,7 +12304,7 @@ const docTemplate = `{
"properties": {
"subnetID": {
"type": "string",
"example": "subnet-xxxx"
"example": "123456"
}
}
},
Expand Down
77 changes: 5 additions & 72 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -8159,7 +8159,7 @@
},
"/ns/{nsId}/resources/sqlDb": {
"get": {
"description": "Get all SQL Databases",
"description": "Get all SQL Databases (TBD)",
"consumes": [
"application/json"
],
Expand All @@ -8169,7 +8169,7 @@
"tags": [
"[Infra Resource] SQL Database Management (under development)"
],
"summary": "Get all SQL Databases",
"summary": "Get all SQL Databases (TBD)",
"operationId": "GetAllSqlDb",
"parameters": [
{
Expand Down Expand Up @@ -8220,7 +8220,7 @@
}
},
"post": {
"description": "Create a SQL Databases\n\n- Supported CSPs: AWS (Upcoming CSPs: Azure, GCP, NCP)\n\n- Please check the values ​​required for each CSP through the `requiredCSPResource` property.\n",
"description": "Create a SQL Databases\n\nSupported CSPs: AWS, Azure, GCP, NCP\n- Note - `connectionName` example: aws-ap-northeast-2, azure-koreacentral, gcp-asia-northeast3, ncpvpc-kr\n\n- Note - Please check the `requiredCSPResource` property which includes CSP specific values.\n\n- Note - You can find the API usage examples on this link, https://github.com/cloud-barista/mc-terrarium/discussions/110\n",
"consumes": [
"application/json"
],
Expand Down Expand Up @@ -8413,73 +8413,6 @@
}
}
},
"/ns/{nsId}/resources/sqlDb/{sqlDbId}/request/{requestId}": {
"get": {
"description": "Check the status of a specific request by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra Resource] SQL Database Management (under development)"
],
"summary": "Check the status of a specific request by its ID",
"operationId": "GetRequestStatusOfSqlDb",
"parameters": [
{
"type": "string",
"default": "default",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "sqldb01",
"description": "SQL DB ID",
"name": "sqlDbId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Request ID",
"name": "requestId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/resources/sshKey": {
"get": {
"description": "List all SSH Keys or SSH Keys' ID",
Expand Down Expand Up @@ -12341,7 +12274,7 @@
"properties": {
"resourceGroup": {
"type": "string",
"example": "rg-xxxx"
"example": "koreacentral"
}
}
},
Expand All @@ -12364,7 +12297,7 @@
"properties": {
"subnetID": {
"type": "string",
"example": "subnet-xxxx"
"example": "123456"
}
}
},
Expand Down
68 changes: 9 additions & 59 deletions src/api/rest/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6213,8 +6213,8 @@ paths:
get:
tags:
- "[Infra Resource] SQL Database Management (under development)"
summary: Get all SQL Databases
description: Get all SQL Databases
summary: Get all SQL Databases (TBD)
description: Get all SQL Databases (TBD)
operationId: GetAllSqlDb
parameters:
- name: nsId
Expand Down Expand Up @@ -6265,9 +6265,12 @@ paths:
description: |
Create a SQL Databases
- Supported CSPs: AWS (Upcoming CSPs: Azure, GCP, NCP)
Supported CSPs: AWS, Azure, GCP, NCP
- Note - `connectionName` example: aws-ap-northeast-2, azure-koreacentral, gcp-asia-northeast3, ncpvpc-kr
- Please check the values ​​required for each CSP through the `requiredCSPResource` property.
- Note - Please check the `requiredCSPResource` property which includes CSP specific values.
- Note - You can find the API usage examples on this link, https://github.com/cloud-barista/mc-terrarium/discussions/110
operationId: PostSqlDb
parameters:
- name: nsId
Expand Down Expand Up @@ -6416,59 +6419,6 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/model.SimpleMsg'
/ns/{nsId}/resources/sqlDb/{sqlDbId}/request/{requestId}:
get:
tags:
- "[Infra Resource] SQL Database Management (under development)"
summary: Check the status of a specific request by its ID
description: Check the status of a specific request by its ID
operationId: GetRequestStatusOfSqlDb
parameters:
- name: nsId
in: path
description: Namespace ID
required: true
schema:
type: string
default: default
- name: sqlDbId
in: path
description: SQL DB ID
required: true
schema:
type: string
default: sqldb01
- name: requestId
in: path
description: Request ID
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/model.Response'
"400":
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/model.SimpleMsg'
"500":
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/model.SimpleMsg'
"503":
description: Service Unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/model.SimpleMsg'
/ns/{nsId}/resources/sshKey:
get:
tags:
Expand Down Expand Up @@ -9259,7 +9209,7 @@ components:
properties:
resourceGroup:
type: string
example: rg-xxxx
example: koreacentral
model.RequiredCSPResource:
type: object
properties:
Expand All @@ -9274,7 +9224,7 @@ components:
properties:
subnetID:
type: string
example: subnet-xxxx
example: "123456"
model.ResourceCountOverview:
type: object
properties:
Expand Down
Loading

0 comments on commit b2749b8

Please sign in to comment.