Skip to content

Commit

Permalink
Merge pull request #1953 from cloud-barista/update-swagger-doc
Browse files Browse the repository at this point in the history
[Workflow] Update Swagger REST API doc
  • Loading branch information
seokho-son authored Jan 6, 2025
2 parents 3517795 + 06036e4 commit 91e9c8f
Show file tree
Hide file tree
Showing 4 changed files with 400 additions and 35 deletions.
12 changes: 4 additions & 8 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX
github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=
github.com/gorilla/sessions v1.3.0 h1:XYlkq7KcpOB2ZhHBPv5WpjMIxrQosiZanfoy1HLZFzg=
github.com/gorilla/sessions v1.3.0/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
Expand All @@ -483,6 +482,8 @@ github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w=
Expand Down Expand Up @@ -572,33 +573,28 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
Expand Down
150 changes: 141 additions & 9 deletions src/api/rest/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,97 @@ const docTemplate = `{
}
}
},
"/ns/{nsId}/cmd/k8sCluster/{k8sClusterId}": {
"post": {
"description": "Send a command to specified Container in K8sCluster\n[note] This feature is not intended for general use\nThis API is provided as an exceptional and limited function for specific purposes such as migration.\nKubernetes resource information required as input for this API is not currently provided, and its availability in the future is uncertain.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"[Kubernetes] Cluster's Container Remote Command"
],
"summary": "Send a command to specified Container in K8sCluster",
"operationId": "PostCmdK8sCluster",
"parameters": [
{
"type": "string",
"default": "default",
"description": "Namespace ID",
"name": "nsId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "k8scluster01",
"description": "K8sCluster ID",
"name": "k8sClusterId",
"in": "path",
"required": true
},
{
"type": "string",
"default": "mynamespace",
"description": "Namespace in K8sCluster to apply the command",
"name": "k8sClusterNamespace",
"in": "query",
"required": true
},
{
"type": "string",
"default": "mypod",
"description": "Pod Name in K8sCluster to apply the command",
"name": "k8sClusterPodName",
"in": "query",
"required": true
},
{
"type": "string",
"description": "Container Name in K8sCluster to apply the command",
"name": "k8sClusterContainerName",
"in": "query"
},
{
"description": "K8sCluster's Container Command Request",
"name": "k8sClusterContainerCmdReq",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.TbK8sClusterContainerCmdReq"
}
},
{
"type": "string",
"description": "Custom request ID",
"name": "x-request-id",
"in": "header"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/model.TbK8sClusterContainerCmdResult"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/model.SimpleMsg"
}
}
}
}
},
"/ns/{nsId}/cmd/mci/{mciId}": {
"post": {
"description": "Send a command to specified MCI",
Expand Down Expand Up @@ -3023,7 +3114,7 @@ const docTemplate = `{
},
{
"type": "string",
"default": "nodegroup01",
"default": "k8snodegroup01",
"description": "K8sNodeGroup Name",
"name": "k8sNodeGroupName",
"in": "path",
Expand Down Expand Up @@ -3094,7 +3185,7 @@ const docTemplate = `{
},
{
"type": "string",
"default": "nodegroup01",
"default": "k8snodegroup01",
"description": "K8sNodeGroup Name",
"name": "k8sNodeGroupName",
"in": "path",
Expand Down Expand Up @@ -14026,6 +14117,47 @@ const docTemplate = `{
}
}
},
"model.TbK8sClusterContainerCmdReq": {
"type": "object",
"required": [
"command"
],
"properties": {
"command": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"echo hello"
]
}
}
},
"model.TbK8sClusterContainerCmdResult": {
"type": "object",
"properties": {
"command": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"err": {},
"stderr": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"stdout": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
"model.TbK8sClusterDynamicReq": {
"type": "object",
"required": [
Expand Down Expand Up @@ -14078,12 +14210,12 @@ const docTemplate = `{
"name": {
"description": "K8sCluster name if it is not empty.",
"type": "string",
"example": "k8scluster-01"
"example": "k8scluster01"
},
"nodeGroupName": {
"description": "NodeGroup name if it is not empty",
"type": "string",
"example": "k8snodegroup-01"
"example": "k8snodegroup01"
},
"onAutoScaling": {
"type": "string",
Expand Down Expand Up @@ -14144,7 +14276,7 @@ const docTemplate = `{
"id": {
"description": "Id is unique identifier for the object, same as Name",
"type": "string",
"example": "k8scluster-01"
"example": "k8scluster01"
},
"label": {
"description": "Label is for describing the object by keywords",
Expand All @@ -14156,7 +14288,7 @@ const docTemplate = `{
"name": {
"description": "Name is human-readable string to represent the object",
"type": "string",
"example": "k8scluster-01"
"example": "k8scluster01"
},
"resourceType": {
"description": "ResourceType is the type of the resource",
Expand Down Expand Up @@ -14220,7 +14352,7 @@ const docTemplate = `{
"name": {
"description": "(1) K8sCluster Info",
"type": "string",
"example": "k8scluster-01"
"example": "k8scluster01"
},
"securityGroupIds": {
"type": "array",
Expand Down Expand Up @@ -14303,7 +14435,7 @@ const docTemplate = `{
"name": {
"description": "K8sNodeGroup name if it is not empty.",
"type": "string",
"example": "k8snodegroup-01"
"example": "k8snodegroup01"
},
"onAutoScaling": {
"type": "string",
Expand Down Expand Up @@ -14396,7 +14528,7 @@ const docTemplate = `{
},
"name": {
"type": "string",
"example": "k8snodegroup-01"
"example": "k8snodegroup01"
},
"onAutoScaling": {
"description": "autoscale config.",
Expand Down
Loading

0 comments on commit 91e9c8f

Please sign in to comment.