diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi.yaml b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi.yaml index e033d03c48..a8f8022388 100644 --- a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi.yaml +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi.yaml @@ -532,6 +532,108 @@ paths: '404': description: Project or job not found + /projects/{projectId}/devspaces: + get: + summary: Returns the DevSpaces workspace for a project + description: | + Retrieves the OpenShift Dev Spaces workspace associated with the project. + Returns 404 if no workspace exists for this project. + parameters: + - in: path + name: projectId + schema: + type: string + required: true + description: UUID of the project + responses: + '200': + description: DevSpaces workspace information + content: + application/json: + schema: + $ref: '#/components/schemas/DevSpacesWorkspace' + '404': + description: No DevSpaces workspace exists for this project + + post: + summary: Creates a DevSpaces workspace for a project + description: | + Creates an OpenShift Dev Spaces workspace for Ansible development. + If a workspace already exists for this project, returns the existing workspace (idempotent). + + The workspace will: + - Clone the project's target repository (where migrated Ansible code lives) + - Provide a browser-based IDE (VS Code) with Ansible tooling + - Be accessible via the URL returned in the response once status reaches 'running' + parameters: + - in: path + name: projectId + schema: + type: string + required: true + description: UUID of the project + responses: + '201': + description: DevSpaces workspace created successfully + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: UUID of the created workspace + status: + $ref: '#/components/schemas/DevSpacesWorkspaceStatus' + message: + type: string + description: Confirmation message + required: + - id + - status + - message + '200': + description: DevSpaces workspace already exists (idempotent) + content: + application/json: + schema: + $ref: '#/components/schemas/DevSpacesWorkspace' + '404': + description: Project not found + '409': + description: Workspace is being deleted, cannot create yet + + delete: + summary: Deletes the DevSpaces workspace for a project + description: | + Stops and deletes the OpenShift Dev Spaces workspace associated with the project. + This removes the Kubernetes DevWorkspace resource and all associated data. + parameters: + - in: path + name: projectId + schema: + type: string + required: true + description: UUID of the project + responses: + '200': + description: DevSpaces workspace deleted successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: Confirmation message + deletedWorkspaceId: + type: string + description: UUID of the deleted workspace + required: + - message + '404': + description: No DevSpaces workspace exists for this project + components: securitySchemes: callbackSignature: @@ -909,3 +1011,40 @@ components: required: - name - durationSeconds + + DevSpacesWorkspaceStatus: + type: string + enum: + - starting + - running + - stopped + - failed + description: | + Status of the DevSpaces workspace: + - starting: Workspace is being provisioned (pod creation, image pull, networking) + - running: Workspace is ready and accessible via URL + - stopped: Workspace has been stopped but not deleted + - failed: Workspace provisioning or runtime failed + + DevSpacesWorkspace: + type: object + properties: + id: + type: string + description: UUID for the DevSpaces workspace + status: + $ref: '#/components/schemas/DevSpacesWorkspaceStatus' + url: + type: string + description: IDE access URL (only present when status is 'running') + createdAt: + type: string + format: date-time + description: Date/time when the workspace was created + errorDetails: + type: string + description: Error information if status is 'failed' + required: + - id + - status + - createdAt diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/apis/Api.server.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/apis/Api.server.ts index 9c42965f62..5b26dd90a2 100644 --- a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/apis/Api.server.ts +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/apis/Api.server.ts @@ -19,6 +19,7 @@ // ****************************************************************** // * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * // ****************************************************************** +import { DevSpacesWorkspace } from '../models/DevSpacesWorkspace.model'; import { MigrationPhase } from '../models/MigrationPhase.model'; import { Module } from '../models/Module.model'; import { ModulePhase } from '../models/ModulePhase.model'; @@ -28,6 +29,8 @@ import { ProjectsPostRequest } from '../models/ProjectsPostRequest.model'; import { ProjectsProjectIdCollectArtifactsPost200Response } from '../models/ProjectsProjectIdCollectArtifactsPost200Response.model'; import { ProjectsProjectIdCollectArtifactsPostRequest } from '../models/ProjectsProjectIdCollectArtifactsPostRequest.model'; import { ProjectsProjectIdDelete200Response } from '../models/ProjectsProjectIdDelete200Response.model'; +import { ProjectsProjectIdDevspacesDelete200Response } from '../models/ProjectsProjectIdDevspacesDelete200Response.model'; +import { ProjectsProjectIdDevspacesPost201Response } from '../models/ProjectsProjectIdDevspacesPost201Response.model'; import { ProjectsProjectIdModulesModuleIdCancelPostRequest } from '../models/ProjectsProjectIdModulesModuleIdCancelPostRequest.model'; import { ProjectsProjectIdModulesModuleIdRunPostRequest } from '../models/ProjectsProjectIdModulesModuleIdRunPostRequest.model'; import { ProjectsProjectIdModulesPostRequest } from '../models/ProjectsProjectIdModulesPostRequest.model'; @@ -85,6 +88,37 @@ export type ProjectsProjectIdDelete = { }; response: ProjectsProjectIdDelete200Response; }; +/** + * @public + */ +export type ProjectsProjectIdDevspacesDelete = { + path: { + projectId: string; + }; + response: ProjectsProjectIdDevspacesDelete200Response | void; +}; +/** + * @public + */ +export type ProjectsProjectIdDevspacesGet = { + path: { + projectId: string; + }; + response: DevSpacesWorkspace | void; +}; +/** + * @public + */ +export type ProjectsProjectIdDevspacesPost = { + path: { + projectId: string; + }; + response: + | ProjectsProjectIdDevspacesPost201Response + | DevSpacesWorkspace + | void + | void; +}; /** * @public */ @@ -191,6 +225,12 @@ export type EndpointMap = { '#_delete|/projects/{projectId}': ProjectsProjectIdDelete; + '#_delete|/projects/{projectId}/devspaces': ProjectsProjectIdDevspacesDelete; + + '#get|/projects/{projectId}/devspaces': ProjectsProjectIdDevspacesGet; + + '#post|/projects/{projectId}/devspaces': ProjectsProjectIdDevspacesPost; + '#get|/projects/{projectId}': ProjectsProjectIdGet; '#get|/projects/{projectId}/log': ProjectsProjectIdLogGet; diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts new file mode 100644 index 0000000000..1034d4920b --- /dev/null +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts @@ -0,0 +1,43 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DevSpacesWorkspaceStatus } from '../models/DevSpacesWorkspaceStatus.model'; + +/** + * @public + */ +export interface DevSpacesWorkspace { + /** + * UUID for the DevSpaces workspace + */ + id: string; + status: DevSpacesWorkspaceStatus; + /** + * IDE access URL (only present when status is 'running') + */ + url?: string; + /** + * Date/time when the workspace was created + */ + createdAt: Date; + /** + * Error information if status is 'failed' + */ + errorDetails?: string; +} diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts new file mode 100644 index 0000000000..d0485b7dae --- /dev/null +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type DevSpacesWorkspaceStatus = + | 'starting' + | 'running' + | 'stopped' + | 'failed'; diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts new file mode 100644 index 0000000000..58e482f89c --- /dev/null +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts @@ -0,0 +1,33 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ProjectsProjectIdDevspacesDelete200Response { + /** + * Confirmation message + */ + message: string; + /** + * UUID of the deleted workspace + */ + deletedWorkspaceId?: string; +} diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts new file mode 100644 index 0000000000..b67ecfca69 --- /dev/null +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts @@ -0,0 +1,35 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DevSpacesWorkspaceStatus } from '../models/DevSpacesWorkspaceStatus.model'; + +/** + * @public + */ +export interface ProjectsProjectIdDevspacesPost201Response { + /** + * UUID of the created workspace + */ + id: string; + status: DevSpacesWorkspaceStatus; + /** + * Confirmation message + */ + message: string; +} diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/index.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/index.ts index f0b98e6c33..772a136429 100644 --- a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/index.ts +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/models/index.ts @@ -18,6 +18,8 @@ export * from '../models/AAPCredentials.model'; export * from '../models/AgentMetrics.model'; export * from '../models/Artifact.model'; export * from '../models/ArtifactType.model'; +export * from '../models/DevSpacesWorkspace.model'; +export * from '../models/DevSpacesWorkspaceStatus.model'; export * from '../models/GitRepoAuth.model'; export * from '../models/Job.model'; export * from '../models/JobStatusEnum.model'; @@ -34,6 +36,8 @@ export * from '../models/ProjectsPostRequest.model'; export * from '../models/ProjectsProjectIdCollectArtifactsPost200Response.model'; export * from '../models/ProjectsProjectIdCollectArtifactsPostRequest.model'; export * from '../models/ProjectsProjectIdDelete200Response.model'; +export * from '../models/ProjectsProjectIdDevspacesDelete200Response.model'; +export * from '../models/ProjectsProjectIdDevspacesPost201Response.model'; export * from '../models/ProjectsProjectIdModulesModuleIdCancelPostRequest.model'; export * from '../models/ProjectsProjectIdModulesModuleIdRunPostRequest.model'; export * from '../models/ProjectsProjectIdModulesPostRequest.model'; diff --git a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/router.ts b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/router.ts index 14b3cf5bb6..913e57fe2f 100644 --- a/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/router.ts +++ b/workspaces/x2a/plugins/x2a-backend/src/schema/openapi/generated/router.ts @@ -803,6 +803,142 @@ export const spec = { } } } + }, + "/projects/{projectId}/devspaces": { + "get": { + "summary": "Returns the DevSpaces workspace for a project", + "description": "Retrieves the OpenShift Dev Spaces workspace associated with the project.\nReturns 404 if no workspace exists for this project.\n", + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string" + }, + "required": true, + "description": "UUID of the project" + } + ], + "responses": { + "200": { + "description": "DevSpaces workspace information", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DevSpacesWorkspace" + } + } + } + }, + "404": { + "description": "No DevSpaces workspace exists for this project" + } + } + }, + "post": { + "summary": "Creates a DevSpaces workspace for a project", + "description": "Creates an OpenShift Dev Spaces workspace for Ansible development.\nIf a workspace already exists for this project, returns the existing workspace (idempotent).\n\nThe workspace will:\n- Clone the project's target repository (where migrated Ansible code lives)\n- Provide a browser-based IDE (VS Code) with Ansible tooling\n- Be accessible via the URL returned in the response once status reaches 'running'\n", + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string" + }, + "required": true, + "description": "UUID of the project" + } + ], + "responses": { + "200": { + "description": "DevSpaces workspace already exists (idempotent)", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DevSpacesWorkspace" + } + } + } + }, + "201": { + "description": "DevSpaces workspace created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "UUID of the created workspace" + }, + "status": { + "$ref": "#/components/schemas/DevSpacesWorkspaceStatus" + }, + "message": { + "type": "string", + "description": "Confirmation message" + } + }, + "required": [ + "id", + "status", + "message" + ] + } + } + } + }, + "404": { + "description": "Project not found" + }, + "409": { + "description": "Workspace is being deleted, cannot create yet" + } + } + }, + "delete": { + "summary": "Deletes the DevSpaces workspace for a project", + "description": "Stops and deletes the OpenShift Dev Spaces workspace associated with the project.\nThis removes the Kubernetes DevWorkspace resource and all associated data.\n", + "parameters": [ + { + "in": "path", + "name": "projectId", + "schema": { + "type": "string" + }, + "required": true, + "description": "UUID of the project" + } + ], + "responses": { + "200": { + "description": "DevSpaces workspace deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Confirmation message" + }, + "deletedWorkspaceId": { + "type": "string", + "description": "UUID of the deleted workspace" + } + }, + "required": [ + "message" + ] + } + } + } + }, + "404": { + "description": "No DevSpaces workspace exists for this project" + } + } + } } }, "components": { @@ -1257,6 +1393,46 @@ export const spec = { "name", "durationSeconds" ] + }, + "DevSpacesWorkspaceStatus": { + "type": "string", + "enum": [ + "starting", + "running", + "stopped", + "failed" + ], + "description": "Status of the DevSpaces workspace:\n- starting: Workspace is being provisioned (pod creation, image pull, networking)\n- running: Workspace is ready and accessible via URL\n- stopped: Workspace has been stopped but not deleted\n- failed: Workspace provisioning or runtime failed\n" + }, + "DevSpacesWorkspace": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "UUID for the DevSpaces workspace" + }, + "status": { + "$ref": "#/components/schemas/DevSpacesWorkspaceStatus" + }, + "url": { + "type": "string", + "description": "IDE access URL (only present when status is 'running')" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date/time when the workspace was created" + }, + "errorDetails": { + "type": "string", + "description": "Error information if status is 'failed'" + } + }, + "required": [ + "id", + "status", + "createdAt" + ] } } } diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/apis/Api.client.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/apis/Api.client.ts index 0fc7d698e6..ca1497b072 100644 --- a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/apis/Api.client.ts +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/apis/Api.client.ts @@ -22,6 +22,7 @@ import { FetchApi } from '../types/fetch'; import crossFetch from 'cross-fetch'; import { pluginId } from '../pluginId'; import * as parser from 'uri-template'; +import { DevSpacesWorkspace } from '../models/DevSpacesWorkspace.model'; import { MigrationPhase } from '../models/MigrationPhase.model'; import { Module } from '../models/Module.model'; import { ModulePhase } from '../models/ModulePhase.model'; @@ -31,6 +32,8 @@ import { ProjectsPostRequest } from '../models/ProjectsPostRequest.model'; import { ProjectsProjectIdCollectArtifactsPost200Response } from '../models/ProjectsProjectIdCollectArtifactsPost200Response.model'; import { ProjectsProjectIdCollectArtifactsPostRequest } from '../models/ProjectsProjectIdCollectArtifactsPostRequest.model'; import { ProjectsProjectIdDelete200Response } from '../models/ProjectsProjectIdDelete200Response.model'; +import { ProjectsProjectIdDevspacesDelete200Response } from '../models/ProjectsProjectIdDevspacesDelete200Response.model'; +import { ProjectsProjectIdDevspacesPost201Response } from '../models/ProjectsProjectIdDevspacesPost201Response.model'; import { ProjectsProjectIdModulesModuleIdCancelPostRequest } from '../models/ProjectsProjectIdModulesModuleIdCancelPostRequest.model'; import { ProjectsProjectIdModulesModuleIdRunPostRequest } from '../models/ProjectsProjectIdModulesModuleIdRunPostRequest.model'; import { ProjectsProjectIdModulesPostRequest } from '../models/ProjectsProjectIdModulesPostRequest.model'; @@ -101,6 +104,30 @@ export type ProjectsProjectIdDelete = { projectId: string; }; }; +/** + * @public + */ +export type ProjectsProjectIdDevspacesDelete = { + path: { + projectId: string; + }; +}; +/** + * @public + */ +export type ProjectsProjectIdDevspacesGet = { + path: { + projectId: string; + }; +}; +/** + * @public + */ +export type ProjectsProjectIdDevspacesPost = { + path: { + projectId: string; + }; +}; /** * @public */ @@ -318,6 +345,91 @@ export class DefaultApiClient { }); } + /** + * Stops and deletes the OpenShift Dev Spaces workspace associated with the project. This removes the Kubernetes DevWorkspace resource and all associated data. + * Deletes the DevSpaces workspace for a project + * @param projectId - UUID of the project + */ + public async projectsProjectIdDevspacesDelete( + // @ts-ignore + request: ProjectsProjectIdDevspacesDelete, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/projects/{projectId}/devspaces`; + + const uri = parser.parse(uriTemplate).expand({ + projectId: request.path.projectId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'DELETE', + }); + } + + /** + * Retrieves the OpenShift Dev Spaces workspace associated with the project. Returns 404 if no workspace exists for this project. + * Returns the DevSpaces workspace for a project + * @param projectId - UUID of the project + */ + public async projectsProjectIdDevspacesGet( + // @ts-ignore + request: ProjectsProjectIdDevspacesGet, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/projects/{projectId}/devspaces`; + + const uri = parser.parse(uriTemplate).expand({ + projectId: request.path.projectId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Creates an OpenShift Dev Spaces workspace for Ansible development. If a workspace already exists for this project, returns the existing workspace (idempotent). The workspace will: - Clone the project's target repository (where migrated Ansible code lives) - Provide a browser-based IDE (VS Code) with Ansible tooling - Be accessible via the URL returned in the response once status reaches 'running' + * Creates a DevSpaces workspace for a project + * @param projectId - UUID of the project + */ + public async projectsProjectIdDevspacesPost( + // @ts-ignore + request: ProjectsProjectIdDevspacesPost, + options?: RequestOptions, + ): Promise< + TypedResponse< + DevSpacesWorkspace | ProjectsProjectIdDevspacesPost201Response + > + > { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/projects/{projectId}/devspaces`; + + const uri = parser.parse(uriTemplate).expand({ + projectId: request.path.projectId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + }); + } + /** * Returns a project by ID. * @param projectId - diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts new file mode 100644 index 0000000000..1034d4920b --- /dev/null +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspace.model.ts @@ -0,0 +1,43 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DevSpacesWorkspaceStatus } from '../models/DevSpacesWorkspaceStatus.model'; + +/** + * @public + */ +export interface DevSpacesWorkspace { + /** + * UUID for the DevSpaces workspace + */ + id: string; + status: DevSpacesWorkspaceStatus; + /** + * IDE access URL (only present when status is 'running') + */ + url?: string; + /** + * Date/time when the workspace was created + */ + createdAt: Date; + /** + * Error information if status is 'failed' + */ + errorDetails?: string; +} diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts new file mode 100644 index 0000000000..d0485b7dae --- /dev/null +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/DevSpacesWorkspaceStatus.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type DevSpacesWorkspaceStatus = + | 'starting' + | 'running' + | 'stopped' + | 'failed'; diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts new file mode 100644 index 0000000000..58e482f89c --- /dev/null +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesDelete200Response.model.ts @@ -0,0 +1,33 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ProjectsProjectIdDevspacesDelete200Response { + /** + * Confirmation message + */ + message: string; + /** + * UUID of the deleted workspace + */ + deletedWorkspaceId?: string; +} diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts new file mode 100644 index 0000000000..b67ecfca69 --- /dev/null +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/ProjectsProjectIdDevspacesPost201Response.model.ts @@ -0,0 +1,35 @@ +/* + * Copyright Red Hat, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DevSpacesWorkspaceStatus } from '../models/DevSpacesWorkspaceStatus.model'; + +/** + * @public + */ +export interface ProjectsProjectIdDevspacesPost201Response { + /** + * UUID of the created workspace + */ + id: string; + status: DevSpacesWorkspaceStatus; + /** + * Confirmation message + */ + message: string; +} diff --git a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/index.ts b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/index.ts index f0b98e6c33..772a136429 100644 --- a/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/index.ts +++ b/workspaces/x2a/plugins/x2a-common/client/src/schema/openapi/generated/models/index.ts @@ -18,6 +18,8 @@ export * from '../models/AAPCredentials.model'; export * from '../models/AgentMetrics.model'; export * from '../models/Artifact.model'; export * from '../models/ArtifactType.model'; +export * from '../models/DevSpacesWorkspace.model'; +export * from '../models/DevSpacesWorkspaceStatus.model'; export * from '../models/GitRepoAuth.model'; export * from '../models/Job.model'; export * from '../models/JobStatusEnum.model'; @@ -34,6 +36,8 @@ export * from '../models/ProjectsPostRequest.model'; export * from '../models/ProjectsProjectIdCollectArtifactsPost200Response.model'; export * from '../models/ProjectsProjectIdCollectArtifactsPostRequest.model'; export * from '../models/ProjectsProjectIdDelete200Response.model'; +export * from '../models/ProjectsProjectIdDevspacesDelete200Response.model'; +export * from '../models/ProjectsProjectIdDevspacesPost201Response.model'; export * from '../models/ProjectsProjectIdModulesModuleIdCancelPostRequest.model'; export * from '../models/ProjectsProjectIdModulesModuleIdRunPostRequest.model'; export * from '../models/ProjectsProjectIdModulesPostRequest.model'; diff --git a/workspaces/x2a/plugins/x2a-common/report.api.md b/workspaces/x2a/plugins/x2a-common/report.api.md index e4047c535a..d195919299 100644 --- a/workspaces/x2a/plugins/x2a-common/report.api.md +++ b/workspaces/x2a/plugins/x2a-common/report.api.md @@ -95,6 +95,9 @@ export class DefaultApiClient { projectsPost(request: ProjectsPost, options?: RequestOptions): Promise>; projectsProjectIdCollectArtifactsPost(request: ProjectsProjectIdCollectArtifactsPost, options?: RequestOptions): Promise>; projectsProjectIdDelete(request: ProjectsProjectIdDelete, options?: RequestOptions): Promise>; + projectsProjectIdDevspacesDelete(request: ProjectsProjectIdDevspacesDelete, options?: RequestOptions): Promise>; + projectsProjectIdDevspacesGet(request: ProjectsProjectIdDevspacesGet, options?: RequestOptions): Promise>; + projectsProjectIdDevspacesPost(request: ProjectsProjectIdDevspacesPost, options?: RequestOptions): Promise>; projectsProjectIdGet(request: ProjectsProjectIdGet, options?: RequestOptions): Promise>; projectsProjectIdLogGet(request: ProjectsProjectIdLogGet, options?: RequestOptions): Promise>; projectsProjectIdModulesGet(request: ProjectsProjectIdModulesGet, options?: RequestOptions): Promise>>; @@ -106,6 +109,19 @@ export class DefaultApiClient { projectsProjectIdRunPost(request: ProjectsProjectIdRunPost, options?: RequestOptions): Promise>; } +// @public (undocumented) +export interface DevSpacesWorkspace { + createdAt: Date; + errorDetails?: string; + id: string; + // (undocumented) + status: DevSpacesWorkspaceStatus; + url?: string; +} + +// @public (undocumented) +export type DevSpacesWorkspaceStatus = 'starting' | 'running' | 'stopped' | 'failed'; + // @public export const githubProvider: ScmProvider; @@ -290,6 +306,41 @@ export interface ProjectsProjectIdDelete200Response { deletedCount: number; } +// @public (undocumented) +export type ProjectsProjectIdDevspacesDelete = { + path: { + projectId: string; + }; +}; + +// @public (undocumented) +export interface ProjectsProjectIdDevspacesDelete200Response { + deletedWorkspaceId?: string; + message: string; +} + +// @public (undocumented) +export type ProjectsProjectIdDevspacesGet = { + path: { + projectId: string; + }; +}; + +// @public (undocumented) +export type ProjectsProjectIdDevspacesPost = { + path: { + projectId: string; + }; +}; + +// @public (undocumented) +export interface ProjectsProjectIdDevspacesPost201Response { + id: string; + message: string; + // (undocumented) + status: DevSpacesWorkspaceStatus; +} + // @public (undocumented) export type ProjectsProjectIdGet = { path: { diff --git a/workspaces/x2a/plugins/x2a/report.api.md b/workspaces/x2a/plugins/x2a/report.api.md index b5cb563fc8..3782a4f54a 100644 --- a/workspaces/x2a/plugins/x2a/report.api.md +++ b/workspaces/x2a/plugins/x2a/report.api.md @@ -145,12 +145,12 @@ readonly "project.abbreviation": string; readonly "project.createdBy": string; readonly "project.noModules": string; readonly "project.statuses.none": string; +readonly "project.statuses.failed": string; readonly "project.statuses.created": string; readonly "project.statuses.initializing": string; readonly "project.statuses.initialized": string; readonly "project.statuses.inProgress": string; readonly "project.statuses.completed": string; -readonly "project.statuses.failed": string; readonly "common.newProject": string; readonly "emptyPage.noConversionInitiatedYet": string; readonly "emptyPage.noConversionInitiatedYetDescription": string;