Skip to content

Commit

Permalink
Enhancement: Synchronization of Labels between CB-TB and CSP Resources
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-github-robot authored Feb 12, 2025
2 parents 80de090 + 176bca4 commit 9636cb4
Show file tree
Hide file tree
Showing 10 changed files with 484 additions and 87 deletions.
101 changes: 84 additions & 17 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,73 @@ const docTemplate = `{
}
}
},
"/mergeCSPLabel/{labelType}/{uid}": {
"put": {
"description": "Fetch the labels in the CSP and merge them with the existing labels",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra Resource] Common Utility"
],
"summary": "Fetch the labels in the CSP and merge them with the existing labels",
"operationId": "MergeCSPResourceLabel",
"parameters": [
{
"enum": [
"ns",
"mci",
"subGroup",
"vm",
"k8s",
"vNet",
"subnet",
"vpn",
"securityGroup",
"sshKey",
"dataDisk",
"sqlDb",
"objectStorage"
],
"type": "string",
"description": "Label Type",
"name": "labelType",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Resource uid",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Merged CSP labels successfully",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"400": {
"description": "Invalid request",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
}
}
}
},
"/ns": {
"get": {
"description": "List all namespaces or namespaces' ID",
Expand Down Expand Up @@ -10443,7 +10510,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.RequestDetails"
"$ref": "#/definitions/client.RequestDetails"
}
},
"404": {
Expand Down Expand Up @@ -10546,7 +10613,7 @@ const docTemplate = `{
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/common.RequestDetails"
"$ref": "#/definitions/client.RequestDetails"
}
}
}
Expand Down Expand Up @@ -10954,19 +11021,7 @@ const docTemplate = `{
}
}
},
"common.JSONResult": {
"type": "object"
},
"common.NumberRequest": {
"type": "object",
"properties": {
"number": {
"type": "integer",
"example": 100
}
}
},
"common.RequestDetails": {
"client.RequestDetails": {
"type": "object",
"properties": {
"endTime": {
Expand All @@ -10981,7 +11036,7 @@ const docTemplate = `{
"description": "Extracted information about the request.",
"allOf": [
{
"$ref": "#/definitions/common.RequestInfo"
"$ref": "#/definitions/client.RequestInfo"
}
]
},
Expand All @@ -10998,7 +11053,7 @@ const docTemplate = `{
}
}
},
"common.RequestInfo": {
"client.RequestInfo": {
"type": "object",
"properties": {
"body": {
Expand All @@ -11021,6 +11076,18 @@ const docTemplate = `{
}
}
},
"common.JSONResult": {
"type": "object"
},
"common.NumberRequest": {
"type": "object",
"properties": {
"number": {
"type": "integer",
"example": 100
}
}
},
"common.RestGetAllConfigResponse": {
"type": "object",
"properties": {
Expand Down
101 changes: 84 additions & 17 deletions src/api/rest/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,73 @@
}
}
},
"/mergeCSPLabel/{labelType}/{uid}": {
"put": {
"description": "Fetch the labels in the CSP and merge them with the existing labels",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Infra Resource] Common Utility"
],
"summary": "Fetch the labels in the CSP and merge them with the existing labels",
"operationId": "MergeCSPResourceLabel",
"parameters": [
{
"enum": [
"ns",
"mci",
"subGroup",
"vm",
"k8s",
"vNet",
"subnet",
"vpn",
"securityGroup",
"sshKey",
"dataDisk",
"sqlDb",
"objectStorage"
],
"type": "string",
"description": "Label Type",
"name": "labelType",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Resource uid",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Merged CSP labels successfully",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"400": {
"description": "Invalid request",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
}
}
}
},
"/ns": {
"get": {
"description": "List all namespaces or namespaces' ID",
Expand Down Expand Up @@ -10436,7 +10503,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.RequestDetails"
"$ref": "#/definitions/client.RequestDetails"
}
},
"404": {
Expand Down Expand Up @@ -10539,7 +10606,7 @@
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/common.RequestDetails"
"$ref": "#/definitions/client.RequestDetails"
}
}
}
Expand Down Expand Up @@ -10947,19 +11014,7 @@
}
}
},
"common.JSONResult": {
"type": "object"
},
"common.NumberRequest": {
"type": "object",
"properties": {
"number": {
"type": "integer",
"example": 100
}
}
},
"common.RequestDetails": {
"client.RequestDetails": {
"type": "object",
"properties": {
"endTime": {
Expand All @@ -10974,7 +11029,7 @@
"description": "Extracted information about the request.",
"allOf": [
{
"$ref": "#/definitions/common.RequestInfo"
"$ref": "#/definitions/client.RequestInfo"
}
]
},
Expand All @@ -10991,7 +11046,7 @@
}
}
},
"common.RequestInfo": {
"client.RequestInfo": {
"type": "object",
"properties": {
"body": {
Expand All @@ -11014,6 +11069,18 @@
}
}
},
"common.JSONResult": {
"type": "object"
},
"common.NumberRequest": {
"type": "object",
"properties": {
"number": {
"type": "integer",
"example": 100
}
}
},
"common.RestGetAllConfigResponse": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 9636cb4

Please sign in to comment.