Skip to content

Commit

Permalink
feat: add workspace apis for kusion server
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-hm19 committed Nov 11, 2024
1 parent 21b0d49 commit 69f9b25
Show file tree
Hide file tree
Showing 11 changed files with 1,075 additions and 70 deletions.
249 changes: 249 additions & 0 deletions api/openapispec/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2054,6 +2054,174 @@ const docTemplate = `{
}
}
},
"/api/v1/workspaces/configs/validate": {
"post": {
"description": "Validate the configurations in the specified workspace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workspace"
],
"summary": "Validate workspace configurations",
"operationId": "validateWorkspaceConfigs",
"parameters": [
{
"description": "Workspace configurations to be validated",
"name": "workspace",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WorkspaceConfigs"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/request.WorkspaceConfigs"
}
},
"400": {
"description": "Bad Request",
"schema": {}
},
"401": {
"description": "Unauthorized",
"schema": {}
},
"404": {
"description": "Not Found",
"schema": {}
},
"429": {
"description": "Too Many Requests",
"schema": {}
},
"500": {
"description": "Internal Server Error",
"schema": {}
}
}
}
},
"/api/v1/workspaces/configs/{id}": {
"get": {
"description": "Get configurations in the specified workspace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workspace"
],
"summary": "get workspace configurations",
"operationId": "getWorkspaceConfigs",
"parameters": [
{
"type": "integer",
"description": "Workspace ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/request.WorkspaceConfigs"
}
},
"400": {
"description": "Bad Request",
"schema": {}
},
"401": {
"description": "Unauthorized",
"schema": {}
},
"404": {
"description": "Not Found",
"schema": {}
},
"429": {
"description": "Too Many Requests",
"schema": {}
},
"500": {
"description": "Internal Server Error",
"schema": {}
}
}
},
"put": {
"description": "Update the configurations in the specified workspace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"workspace"
],
"summary": "Update workspace configurations",
"operationId": "updateWorkspaceConfigs",
"parameters": [
{
"type": "integer",
"description": "Workspace ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated workspace configurations",
"name": "workspace",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WorkspaceConfigs"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/request.WorkspaceConfigs"
}
},
"400": {
"description": "Bad Request",
"schema": {}
},
"401": {
"description": "Unauthorized",
"schema": {}
},
"404": {
"description": "Not Found",
"schema": {}
},
"429": {
"description": "Too Many Requests",
"schema": {}
},
"500": {
"description": "Internal Server Error",
"schema": {}
}
}
}
},
"/api/v1/workspaces/{id}": {
"get": {
"description": "Get workspace information by workspace ID",
Expand Down Expand Up @@ -3348,6 +3516,35 @@ const docTemplate = `{
}
}
},
"request.WorkspaceConfigs": {
"type": "object",
"properties": {
"context": {
"description": "Context contains workspace-level configurations, such as runtimes, topologies, and metadata, etc.",
"allOf": [
{
"$ref": "#/definitions/v1.GenericConfig"
}
]
},
"modules": {
"description": "Modules are the configs of a set of modules.",
"allOf": [
{
"$ref": "#/definitions/v1.ModuleConfigs"
}
]
},
"secretStore": {
"description": "SecretStore represents a secure external location for storing secrets.",
"allOf": [
{
"$ref": "#/definitions/v1.SecretStore"
}
]
}
}
},
"url.URL": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3475,6 +3672,19 @@ const docTemplate = `{
}
}
},
"v1.Configs": {
"type": "object",
"properties": {
"default": {
"description": "Default is default block of the module config.",
"allOf": [
{
"$ref": "#/definitions/v1.GenericConfig"
}
]
}
}
},
"v1.FakeProvider": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3510,6 +3720,45 @@ const docTemplate = `{
"type": "object",
"additionalProperties": {}
},
"v1.ModuleConfig": {
"type": "object",
"properties": {
"configs": {
"description": "Configs contains all levels of module configs",
"allOf": [
{
"$ref": "#/definitions/v1.Configs"
}
]
},
"path": {
"description": "Path is the path of the module. It can be a local path or a remote URL",
"type": "string"
},
"version": {
"description": "Version is the version of the module.",
"type": "string"
}
}
},
"v1.ModuleConfigs": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/v1.ModuleConfig"
}
},
"v1.ModulePatcherConfig": {
"type": "object",
"properties": {
"projectSelector": {
"description": "ProjectSelector contains the selected projects.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"v1.OnPremisesProvider": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 69f9b25

Please sign in to comment.