From 902e5be7fa037801323ee6095243c1e0546aba11 Mon Sep 17 00:00:00 2001 From: Alice1319 Date: Mon, 18 Dec 2023 09:37:13 +0800 Subject: [PATCH] update api. --- .../content/credentials/AddCredential.tsx | 6 +- .../content/policies/AddOrUpdatePolicy.tsx | 20 +- src/components/content/policies/Policies.tsx | 16 +- .../policies/add/PolicyCreateResultStatus.tsx | 4 +- .../policies/add/useCreatePolicyRequest.ts | 6 +- .../delete/useDeletePolicyRequest.tsx | 4 +- .../update/PolicyUpdateResultStatus.tsx | 4 +- .../policies/update/useUpdatePolicyRequest.ts | 6 +- .../useListPoliciesManagementServiceQuery.ts | 4 +- src/xpanse-api/api.json | 1184 +++++++++++------ src/xpanse-api/generated/core/OpenAPI.ts | 2 +- src/xpanse-api/generated/index.ts | 13 +- .../generated/models/BackendSystemStatus.ts | 1 + .../generated/models/DeployedService.ts | 26 +- .../models/DeployedServiceDetails.ts | 26 +- .../generated/models/ServiceDetailVo.ts | 128 -- .../models/{PolicyVo.ts => ServicePolicy.ts} | 24 +- .../models/ServicePolicyCreateRequest.ts | 24 + .../models/ServicePolicyUpdateRequest.ts | 24 + src/xpanse-api/generated/models/ServiceVo.ts | 112 -- .../models/{Policy.ts => UserPolicy.ts} | 6 +- ...eRequest.ts => UserPolicyCreateRequest.ts} | 6 +- ...eRequest.ts => UserPolicyUpdateRequest.ts} | 6 +- .../VendorHostedDeployedServiceDetails.ts | 26 +- .../models/VendorHostedServiceDetailsVo.ts | 119 -- .../services/CredentialsManagementService.ts | 9 +- .../ServicePoliciesManagementService.ts | 136 ++ .../services/ServiceResourceService.ts | 88 ++ .../generated/services/ServiceService.ts | 10 +- ...ce.ts => UserPoliciesManagementService.ts} | 28 +- 30 files changed, 1233 insertions(+), 835 deletions(-) delete mode 100644 src/xpanse-api/generated/models/ServiceDetailVo.ts rename src/xpanse-api/generated/models/{PolicyVo.ts => ServicePolicy.ts} (53%) create mode 100644 src/xpanse-api/generated/models/ServicePolicyCreateRequest.ts create mode 100644 src/xpanse-api/generated/models/ServicePolicyUpdateRequest.ts delete mode 100644 src/xpanse-api/generated/models/ServiceVo.ts rename src/xpanse-api/generated/models/{Policy.ts => UserPolicy.ts} (92%) rename src/xpanse-api/generated/models/{PolicyCreateRequest.ts => UserPolicyCreateRequest.ts} (86%) rename src/xpanse-api/generated/models/{PolicyUpdateRequest.ts => UserPolicyUpdateRequest.ts} (87%) delete mode 100644 src/xpanse-api/generated/models/VendorHostedServiceDetailsVo.ts create mode 100644 src/xpanse-api/generated/services/ServicePoliciesManagementService.ts create mode 100644 src/xpanse-api/generated/services/ServiceResourceService.ts rename src/xpanse-api/generated/services/{PoliciesManagementService.ts => UserPoliciesManagementService.ts} (83%) diff --git a/src/components/content/credentials/AddCredential.tsx b/src/components/content/credentials/AddCredential.tsx index a17a27401..6e3fb4b90 100644 --- a/src/components/content/credentials/AddCredential.tsx +++ b/src/components/content/credentials/AddCredential.tsx @@ -75,7 +75,11 @@ function AddCredential({ role, onCancel }: { role: string | undefined; onCancel: const credentialCapabilitiesQuery = useQuery({ queryKey: ['credentialCapabilitiesQuery', currentCsp, currentType], - queryFn: () => CredentialsManagementService.getCredentialCapabilities(currentCsp, currentType), + queryFn: () => + CredentialsManagementService.getCredentialCapabilities( + currentCsp ?? CredentialVariables.csp.HUAWEI, + currentType + ), staleTime: 60000, enabled: currentCsp !== undefined && currentType !== undefined, }); diff --git a/src/components/content/policies/AddOrUpdatePolicy.tsx b/src/components/content/policies/AddOrUpdatePolicy.tsx index 0b13d368f..76c080ed5 100644 --- a/src/components/content/policies/AddOrUpdatePolicy.tsx +++ b/src/components/content/policies/AddOrUpdatePolicy.tsx @@ -7,9 +7,9 @@ import React, { useRef, useState } from 'react'; import { CloudServiceProvider, CredentialVariables, - PolicyCreateRequest, - PolicyUpdateRequest, - Policy, + UserPolicy, + UserPolicyCreateRequest, + UserPolicyUpdateRequest, } from '../../../xpanse-api/generated'; import '../../../styles/policies.css'; import { Alert, Button, Card, Form, Image, Radio, RadioChangeEvent, Select, Upload, UploadFile } from 'antd'; @@ -28,13 +28,13 @@ export const AddOrUpdatePolicy = ({ currentPolicyService, getCancelUpdateStatus, }: { - currentPolicyService: Policy | undefined; + currentPolicyService: UserPolicy | undefined; getCancelUpdateStatus: (arg: boolean) => void; }): React.JSX.Element => { const [form] = Form.useForm(); const policyContent = useRef(currentPolicyService?.policy ?? ''); - const [createPolicyRequest, setCreatePolicyRequest] = useState(undefined); - const [updatePolicyRequest, setUpdatePolicyRequest] = useState(undefined); + const [createPolicyRequest, setCreatePolicyRequest] = useState(undefined); + const [updatePolicyRequest, setUpdatePolicyRequest] = useState(undefined); const [isEnabled, setIsEnabled] = useState(false); const [isUpdated, setIsUpdated] = useState(false); const files = useRef([]); @@ -42,9 +42,9 @@ export const AddOrUpdatePolicy = ({ const createPoliciesManagementServiceRequest = useCreatePolicyRequest(); const updatePoliciesManagementServiceRequest = useUpdatePolicyRequest(); - const onFinish = (policyRequest: { csp: Policy.csp; enabled: boolean; policy: string }) => { + const onFinish = (policyRequest: { csp: UserPolicy.csp; enabled: boolean; policy: string }) => { if (currentPolicyService === undefined) { - const policyCreateRequest: PolicyCreateRequest = policyRequest as PolicyCreateRequest; + const policyCreateRequest: UserPolicyCreateRequest = policyRequest as UserPolicyCreateRequest; policyCreateRequest.csp = policyRequest.csp; policyCreateRequest.enabled = policyRequest.enabled; policyCreateRequest.policy = policyRequest.policy; @@ -55,7 +55,7 @@ export const AddOrUpdatePolicy = ({ setIsUpdated(comparePolicyUpdateRequestResult(policyRequest)); return; } - const policyUpdateRequest: PolicyUpdateRequest = policyRequest as PolicyUpdateRequest; + const policyUpdateRequest: UserPolicyUpdateRequest = policyRequest as UserPolicyUpdateRequest; policyUpdateRequest.id = currentPolicyService.id; policyUpdateRequest.csp = policyRequest.csp; policyUpdateRequest.enabled = policyRequest.enabled; @@ -66,7 +66,7 @@ export const AddOrUpdatePolicy = ({ }; const comparePolicyUpdateRequestResult = (policyRequest: { - csp: Policy.csp; + csp: UserPolicy.csp; enabled: boolean; policy: string; }): boolean => { diff --git a/src/components/content/policies/Policies.tsx b/src/components/content/policies/Policies.tsx index eeea502d1..374f0a548 100644 --- a/src/components/content/policies/Policies.tsx +++ b/src/components/content/policies/Policies.tsx @@ -8,7 +8,7 @@ import { Button, Image, Modal, Popconfirm, Popover, Space, Table } from 'antd'; import { ColumnsType } from 'antd/es/table'; import '../../../styles/policies.css'; import useListPoliciesManagementServiceQuery from './useListPoliciesManagementServiceQuery'; -import { AbstractCredentialInfo, CloudServiceProvider, Policy } from '../../../xpanse-api/generated'; +import { AbstractCredentialInfo, CloudServiceProvider, UserPolicy } from '../../../xpanse-api/generated'; import { ColumnFilterItem } from 'antd/es/table/interface'; import PoliciesManagementServiceListError from './PoliciesManagementServiceListError'; import { CloseCircleOutlined, EditOutlined, PlusCircleOutlined, SyncOutlined } from '@ant-design/icons'; @@ -20,10 +20,10 @@ import { cspMap } from '../common/csp/CspLogo'; function Policies(): React.JSX.Element { const [id, setId] = useState(''); - const [currentPolicyService, setCurrentPolicyService] = useState(undefined); + const [currentPolicyService, setCurrentPolicyService] = useState(undefined); const [cspFilters, setCspFilters] = useState([]); const [enabledFilters, setEnabledFilters] = useState([]); - const [policiesManagementServiceList, setPoliciesManagementServiceList] = useState([]); + const [policiesManagementServiceList, setPoliciesManagementServiceList] = useState([]); const listPoliciesManagementServiceQuery = useListPoliciesManagementServiceQuery(); const [isOpenAddOrUpdatePolicyModal, setIsOpenAddOrUpdatePolicyModal] = useState(false); @@ -42,7 +42,7 @@ function Policies(): React.JSX.Element { return ; } - const columns: ColumnsType = [ + const columns: ColumnsType = [ { title: 'Policy ID', dataIndex: 'id', @@ -87,7 +87,7 @@ function Policies(): React.JSX.Element { { title: 'Content', dataIndex: 'policy', - render: (_text: string, record: Policy) => { + render: (_text: string, record: UserPolicy) => { return ( { + render: (_text: string, record: UserPolicy) => { return ( <> @@ -160,7 +160,7 @@ function Policies(): React.JSX.Element { }, ]; - const deleteCurrentPolicy = (record: Policy) => { + const deleteCurrentPolicy = (record: UserPolicy) => { setId(record.id); deletePoliciesManagementServiceRequest.mutate(record.id); }; @@ -185,7 +185,7 @@ function Policies(): React.JSX.Element { setIsOpenAddOrUpdatePolicyModal(false); refreshPoliciesManagementServiceList(); }; - const updatePoliciesManagementService = (record: Policy) => { + const updatePoliciesManagementService = (record: UserPolicy) => { setCurrentPolicyService(record); setIsOpenAddOrUpdatePolicyModal(true); }; diff --git a/src/components/content/policies/add/PolicyCreateResultStatus.tsx b/src/components/content/policies/add/PolicyCreateResultStatus.tsx index e11dd6ad5..4253a490e 100644 --- a/src/components/content/policies/add/PolicyCreateResultStatus.tsx +++ b/src/components/content/policies/add/PolicyCreateResultStatus.tsx @@ -5,7 +5,7 @@ import { Alert } from 'antd'; import React from 'react'; -import { ApiError, Policy, Response } from '../../../../xpanse-api/generated'; +import { ApiError, Response, UserPolicy } from '../../../../xpanse-api/generated'; import PolicySubmitResultDetails from '../PolicySubmitResultDetails'; export default function PolicyCreateResultStatus({ @@ -17,7 +17,7 @@ export default function PolicyCreateResultStatus({ isError: boolean; isSuccess: boolean; error: Error | null; - currentPolicyService: Policy | undefined; + currentPolicyService: UserPolicy | undefined; }): React.JSX.Element { if (isError) { if (error instanceof ApiError && 'details' in error.body) { diff --git a/src/components/content/policies/add/useCreatePolicyRequest.ts b/src/components/content/policies/add/useCreatePolicyRequest.ts index 02bf16692..2bb787403 100644 --- a/src/components/content/policies/add/useCreatePolicyRequest.ts +++ b/src/components/content/policies/add/useCreatePolicyRequest.ts @@ -4,12 +4,12 @@ */ import { useMutation } from '@tanstack/react-query'; -import { PoliciesManagementService, PolicyCreateRequest } from '../../../../xpanse-api/generated'; +import { UserPoliciesManagementService, UserPolicyCreateRequest } from '../../../../xpanse-api/generated'; export function useCreatePolicyRequest() { return useMutation({ - mutationFn: (requestBody: PolicyCreateRequest) => { - return PoliciesManagementService.addPolicy(requestBody); + mutationFn: (requestBody: UserPolicyCreateRequest) => { + return UserPoliciesManagementService.addUserPolicy(requestBody); }, }); } diff --git a/src/components/content/policies/delete/useDeletePolicyRequest.tsx b/src/components/content/policies/delete/useDeletePolicyRequest.tsx index d9f26f578..dff474b60 100644 --- a/src/components/content/policies/delete/useDeletePolicyRequest.tsx +++ b/src/components/content/policies/delete/useDeletePolicyRequest.tsx @@ -4,12 +4,12 @@ */ import { useMutation } from '@tanstack/react-query'; -import { PoliciesManagementService } from '../../../../xpanse-api/generated'; +import { UserPoliciesManagementService } from '../../../../xpanse-api/generated'; export function useDeletePolicyRequest() { return useMutation({ mutationFn: (id: string) => { - return PoliciesManagementService.deletePolicy(id); + return UserPoliciesManagementService.deleteUserPolicy(id); }, }); } diff --git a/src/components/content/policies/update/PolicyUpdateResultStatus.tsx b/src/components/content/policies/update/PolicyUpdateResultStatus.tsx index 500a1fbc4..63d115937 100644 --- a/src/components/content/policies/update/PolicyUpdateResultStatus.tsx +++ b/src/components/content/policies/update/PolicyUpdateResultStatus.tsx @@ -5,7 +5,7 @@ import { Alert } from 'antd'; import React from 'react'; -import { ApiError, Policy, Response } from '../../../../xpanse-api/generated'; +import { ApiError, Response, UserPolicy } from '../../../../xpanse-api/generated'; import PolicySubmitResultDetails from '../PolicySubmitResultDetails'; export default function PolicyUpdateResultStatus({ @@ -17,7 +17,7 @@ export default function PolicyUpdateResultStatus({ isError: boolean; isSuccess: boolean; error: Error | null; - currentPolicyService: Policy | undefined; + currentPolicyService: UserPolicy | undefined; }): React.JSX.Element { if (isError) { if (error instanceof ApiError && 'details' in error.body) { diff --git a/src/components/content/policies/update/useUpdatePolicyRequest.ts b/src/components/content/policies/update/useUpdatePolicyRequest.ts index 5b4e650c3..337d49213 100644 --- a/src/components/content/policies/update/useUpdatePolicyRequest.ts +++ b/src/components/content/policies/update/useUpdatePolicyRequest.ts @@ -4,12 +4,12 @@ */ import { useMutation } from '@tanstack/react-query'; -import { PoliciesManagementService, PolicyUpdateRequest } from '../../../../xpanse-api/generated'; +import { UserPoliciesManagementService, UserPolicyUpdateRequest } from '../../../../xpanse-api/generated'; export function useUpdatePolicyRequest() { return useMutation({ - mutationFn: (requestBody: PolicyUpdateRequest) => { - return PoliciesManagementService.updatePolicy(requestBody); + mutationFn: (requestBody: UserPolicyUpdateRequest) => { + return UserPoliciesManagementService.updateUserPolicy(requestBody); }, }); } diff --git a/src/components/content/policies/useListPoliciesManagementServiceQuery.ts b/src/components/content/policies/useListPoliciesManagementServiceQuery.ts index f2556347b..8c4ce8839 100644 --- a/src/components/content/policies/useListPoliciesManagementServiceQuery.ts +++ b/src/components/content/policies/useListPoliciesManagementServiceQuery.ts @@ -4,13 +4,13 @@ */ import { useQuery } from '@tanstack/react-query'; -import { PoliciesManagementService } from '../../../xpanse-api/generated'; +import { UserPoliciesManagementService } from '../../../xpanse-api/generated'; export default function useListPoliciesManagementServiceQuery() { return useQuery({ queryKey: ['listPoliciesManagementService'], queryFn: () => { - return PoliciesManagementService.listPolicies(undefined, undefined); + return UserPoliciesManagementService.listUserPolicies(); }, refetchOnWindowFocus: false, }); diff --git a/src/xpanse-api/api.json b/src/xpanse-api/api.json index f831a9be6..7784fe451 100644 --- a/src/xpanse-api/api.json +++ b/src/xpanse-api/api.json @@ -3,30 +3,32 @@ "info": { "title": "Xpanse API", "description": "RESTful Services to interact with Xpanse runtime", - "version": "1.0.3-SNAPSHOT" + "version": "1.0.6-SNAPSHOT" }, "servers": [{ "url": "http://localhost:8080", "description": "Generated server url" }], "security": [ { "OAuth2 Flow": ["openid", "profile", "urn:zitadel:iam:org:project:roles", "urn:zitadel:iam:user:metadata"] } ], "tags": [ + { "name": "Auth Management", "description": "APIs for user authentication and authorization." }, + { "name": "Service Policies Management", "description": "APIs for managing service's infra policies." }, + { "name": "Service", "description": "APIs to manage the service instances" }, + { + "name": "Service Catalog", + "description": "APIs to query service templates which are available for the user to order." + }, { "name": "Credentials Management", "description": "APIs for managing user's cloud provider credentials" }, { "name": "Service Vendor", "description": "APIs to manage service templates." }, { "name": "WorkFlow", "description": "APIs to manage the WorkFlow" }, { "name": "Admin", "description": "APIs for administrating Xpanse" }, - { "name": "Policies Management", "description": "APIs for managing user's infra policies." }, { "name": "Service Catalog", "description": "APIs to query the services which are available for the user to order." }, - { "name": "Auth Management", "description": "APIs for user authentication and authorization." }, - { "name": "Service", "description": "APIs to manage the service instances" }, - { - "name": "Service Catalog", - "description": "APIs to query service templates which are available for the user to order." - }, + { "name": "User Policies Management", "description": "APIs for managing user's infra policies." }, { "name": "Credentials Management", "description": "APIs for managing isv's cloud provider credentials" }, - { "name": "Monitor", "description": "APIs for getting metrics of deployed services." } + { "name": "Monitor", "description": "APIs for getting metrics of deployed services." }, + { "name": "Service Resource", "description": "APIs to manage the service instances" } ], "paths": { "/xpanse/workflow/task/{id}": { @@ -48,22 +50,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -86,22 +88,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -151,22 +153,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -199,22 +201,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -237,22 +239,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -307,27 +309,147 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "422": { "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "204": { "description": "No Content" } + } + } + }, + "/xpanse/services/stop/{id}": { + "put": { + "tags": ["Service Resource"], + "description": "Start a task to deploy service using registered service template.
Required role: admin or user", + "operationId": "stopService", + "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/DeployedService" } } + } + } + } + } + }, + "/xpanse/services/start/{id}": { + "put": { + "tags": ["Service Resource"], + "description": "Start the service by the service id.
Required role: admin or user", + "operationId": "startService", + "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "204": { "description": "No Content" } + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/DeployedService" } } + } + } + } + } + }, + "/xpanse/services/restart/{id}": { + "put": { + "tags": ["Service Resource"], + "description": "Start a task to deploy service using registered service template.
Required role: admin or user", + "operationId": "restartService", + "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/DeployedService" } } + } + } } } }, @@ -350,22 +472,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -404,22 +526,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -450,22 +572,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -503,22 +625,115 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "422": { "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/ServiceTemplateDetailVo" } } + } + } + } + } + }, + "/xpanse/service/policies": { + "get": { + "tags": ["Service Policies Management"], + "description": "List the policies belongs to the service.
Required role: admin or isv", + "operationId": "listServicePolicies", + "parameters": [ + { + "name": "serviceTemplateId", + "in": "query", + "description": "The id of registered service template which the policy belongs to.", + "required": true, + "schema": { "type": "string" } + } + ], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ServicePolicy" } } + } + } + } + } + }, + "put": { + "tags": ["Service Policies Management"], + "description": "Update the policy belongs to the registered service template.
Required role: admin or isv", + "operationId": "updateServicePolicy", + "requestBody": { + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/ServicePolicyUpdateRequest" } } + }, + "required": true + }, + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -526,7 +741,50 @@ "200": { "description": "OK", "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/ServiceTemplateDetailVo" } } + "application/json": { "schema": { "$ref": "#/components/schemas/ServicePolicy" } } + } + } + } + }, + "post": { + "tags": ["Service Policies Management"], + "description": "Add policy for the registered service template.
Required role: admin or isv", + "operationId": "addServicePolicy", + "requestBody": { + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/ServicePolicyCreateRequest" } } + }, + "required": true + }, + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/ServicePolicy" } } } } } @@ -534,9 +792,9 @@ }, "/xpanse/policies": { "get": { - "tags": ["Policies Management"], + "tags": ["User Policies Management"], "description": "List the policies defined by the user.
Required role: admin or user", - "operationId": "listPolicies", + "operationId": "listUserPolicies", "parameters": [ { "name": "cspName", @@ -570,22 +828,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -594,19 +852,19 @@ "description": "OK", "content": { "application/json": { - "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Policy" } } + "schema": { "type": "array", "items": { "$ref": "#/components/schemas/UserPolicy" } } } } } } }, "put": { - "tags": ["Policies Management"], + "tags": ["User Policies Management"], "description": "Update the policy created by the user.
Required role: admin or user", - "operationId": "updatePolicy", + "operationId": "updateUserPolicy", "requestBody": { "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/PolicyUpdateRequest" } } + "application/json": { "schema": { "$ref": "#/components/schemas/UserPolicyUpdateRequest" } } }, "required": true }, @@ -615,39 +873,39 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "200": { "description": "OK", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Policy" } } } + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPolicy" } } } } } }, "post": { - "tags": ["Policies Management"], + "tags": ["User Policies Management"], "description": "Add policy created by the user.
Required role: admin or user", - "operationId": "addPolicy", + "operationId": "addUserPolicy", "requestBody": { "content": { - "application/json": { "schema": { "$ref": "#/components/schemas/PolicyCreateRequest" } } + "application/json": { "schema": { "$ref": "#/components/schemas/UserPolicyCreateRequest" } } }, "required": true }, @@ -656,29 +914,29 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "200": { "description": "OK", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Policy" } } } + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPolicy" } } } } } } @@ -724,22 +982,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -772,22 +1030,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -810,22 +1068,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -880,22 +1138,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -979,9 +1237,10 @@ "destroy successful", "destroy failed", "migrating", - "migration_success", - "migration_failed", - "manual cleanup required" + "migration successful", + "migration failed", + "manual cleanup required", + "rollback failed" ] } } @@ -991,22 +1250,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1037,22 +1296,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1078,22 +1337,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1182,22 +1441,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1232,22 +1491,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1280,22 +1539,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1314,27 +1573,27 @@ "tags": ["WorkFlow"], "description": "Query the tasks that need to be done by me
Required role: admin or user", "operationId": "queryTodoTasks", - "responses": { - "500": { - "description": "Internal Server Error", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, - "422": { - "description": "Unprocessable Entity", + "responses": { + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1360,22 +1619,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1466,9 +1725,10 @@ "destroy successful", "destroy failed", "migrating", - "migration_success", - "migration_failed", - "manual cleanup required" + "migration successful", + "migration failed", + "manual cleanup required", + "rollback failed" ] } } @@ -1478,22 +1738,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1531,22 +1791,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1579,22 +1839,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1629,22 +1889,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1658,69 +1918,142 @@ } } }, - "/xpanse/policies/{id}": { + "/xpanse/service/policies/{id}": { "get": { - "tags": ["Policies Management"], - "description": "Get the details of the policy created by the user.
Required role: admin or user", - "operationId": "getPolicyDetails", + "tags": ["Service Policies Management"], + "description": "Get details of policy belongs to the registered service template.
Required role: admin or isv", + "operationId": "getServicePolicyDetails", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "422": { "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "200": { + "description": "OK", + "content": { + "application/json": { "schema": { "$ref": "#/components/schemas/ServicePolicy" } } + } + } + } + }, + "delete": { + "tags": ["Service Policies Management"], + "description": "Delete the policy belongs to the registered service template.
Required role: admin or isv", + "operationId": "deleteServicePolicy", + "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "403": { + "description": "Forbidden", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "502": { + "description": "Bad Gateway", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "204": { "description": "No Content" } + } + } + }, + "/xpanse/policies/{id}": { + "get": { + "tags": ["User Policies Management"], + "description": "Get the details of the policy created by the user.
Required role: admin or user", + "operationId": "getPolicyDetails", + "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], + "responses": { + "500": { + "description": "Internal Server Error", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "400": { + "description": "Bad Request", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, + "422": { + "description": "Unprocessable Entity", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "200": { "description": "OK", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Policy" } } } + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserPolicy" } } } } } }, "delete": { - "tags": ["Policies Management"], + "tags": ["User Policies Management"], "description": "Delete the policy created by the user.
Required role: admin or user", - "operationId": "deletePolicy", + "operationId": "deleteUserPolicy", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { "500": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1793,22 +2126,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1834,22 +2167,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1880,22 +2213,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -1967,22 +2300,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2042,22 +2375,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2107,22 +2440,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2221,22 +2554,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2280,22 +2613,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2316,26 +2649,26 @@ "operationId": "openApi", "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }], "responses": { - "500": { - "description": "Internal Server Error", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, - "422": { - "description": "Unprocessable Entity", + "500": { + "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2373,22 +2706,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2412,22 +2745,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2447,22 +2780,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2485,22 +2818,22 @@ "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "422": { - "description": "Unprocessable Entity", - "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } - }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, - "401": { - "description": "Unauthorized", + "422": { + "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } }, + "401": { + "description": "Unauthorized", + "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } + }, "502": { "description": "Bad Gateway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" } } } @@ -2630,6 +2963,97 @@ }, "description": "The variables list of the credential" }, + "DeployedService": { + "required": [ + "category", + "createTime", + "csp", + "id", + "lastModifiedTime", + "name", + "serviceDeploymentState", + "serviceHostingType", + "serviceState", + "version" + ], + "type": "object", + "properties": { + "id": { "type": "string", "description": "The ID of the service", "format": "uuid" }, + "category": { + "type": "string", + "description": "The catalog of the service", + "enum": [ + "ai", + "compute", + "container", + "storage", + "network", + "database", + "mediaService", + "security", + "middleware", + "others" + ] + }, + "name": { "type": "string", "description": "The name of the service" }, + "customerServiceName": { + "type": "string", + "description": "Customer's name for the service. Used only for customer's reference.If not provided, this value will be auto-generated" + }, + "version": { "type": "string", "description": "The version of the service" }, + "csp": { + "type": "string", + "description": "The provider of the service", + "enum": ["huawei", "flexibleEngine", "openstack", "scs", "alicloud", "aws", "azure", "google"] + }, + "flavor": { "type": "string", "description": "The flavor of the service" }, + "serviceDeploymentState": { + "type": "string", + "description": "The deployment state of the service", + "enum": [ + "deploying", + "deployment successful", + "deployment failed", + "destroying", + "destroy successful", + "destroy failed", + "migrating", + "migration successful", + "migration failed", + "manual cleanup required", + "rollback failed" + ] + }, + "serviceState": { + "type": "string", + "description": "The run state of the service", + "enum": [ + "notRunning", + "running", + "starting", + "startingFailed", + "stopping", + "stopped", + "stoppingFailed" + ] + }, + "serviceHostingType": { + "type": "string", + "description": "Defines which cloud service account is used for deploying cloud resources.", + "enum": ["self", "service-vendor"] + }, + "createTime": { + "type": "string", + "description": "Time of register service.", + "format": "date-time" + }, + "lastModifiedTime": { + "type": "string", + "description": "Time of update service.", + "format": "date-time" + } + } + }, "Billing": { "required": ["currency", "model", "period"], "type": "object", @@ -2913,7 +3337,43 @@ "links": { "type": "array", "items": { "$ref": "#/components/schemas/Link" } } } }, - "PolicyUpdateRequest": { + "ServicePolicyUpdateRequest": { + "required": ["id"], + "type": "object", + "properties": { + "id": { "type": "string", "description": "The id of the policy.", "format": "uuid" }, + "policy": { "type": "string", "description": "The policy." }, + "enabled": { + "type": "boolean", + "description": "Is the policy enabled. true:enabled;false:disabled." + } + } + }, + "ServicePolicy": { + "required": ["createTime", "enabled", "id", "lastModifiedTime", "policy", "serviceTemplateId"], + "type": "object", + "properties": { + "id": { "type": "string", "description": "The id of the policy.", "format": "uuid" }, + "policy": { "type": "string", "description": "The valid policy belongs to the service." }, + "serviceTemplateId": { + "type": "string", + "description": "The id of registered service template which the policy belongs to.", + "format": "uuid" + }, + "enabled": { "type": "boolean", "description": "Is the policy enabled." }, + "createTime": { + "type": "string", + "description": "Time of the policy created.", + "format": "date-time" + }, + "lastModifiedTime": { + "type": "string", + "description": "Time of the policy updated.", + "format": "date-time" + } + } + }, + "UserPolicyUpdateRequest": { "required": ["id"], "type": "object", "properties": { @@ -2930,7 +3390,7 @@ } } }, - "Policy": { + "UserPolicy": { "required": ["createTime", "csp", "enabled", "id", "lastModifiedTime", "policy"], "type": "object", "properties": { @@ -3054,7 +3514,23 @@ "id": { "type": "string", "description": "The id of the service to migrate", "format": "uuid" } } }, - "PolicyCreateRequest": { + "ServicePolicyCreateRequest": { + "required": ["enabled", "policy", "serviceTemplateId"], + "type": "object", + "properties": { + "serviceTemplateId": { + "type": "string", + "description": "The id of registered service template which the policy belongs to.", + "format": "uuid" + }, + "policy": { "type": "string", "description": "The policy." }, + "enabled": { + "type": "boolean", + "description": "Is the policy enabled. true:enabled;false:disabled." + } + } + }, + "UserPolicyCreateRequest": { "required": ["csp", "enabled", "policy"], "type": "object", "properties": { @@ -3168,82 +3644,6 @@ } } }, - "DeployedService": { - "required": [ - "category", - "createTime", - "csp", - "id", - "lastModifiedTime", - "name", - "serviceDeploymentState", - "serviceHostingType", - "version" - ], - "type": "object", - "properties": { - "id": { "type": "string", "description": "The ID of the service", "format": "uuid" }, - "category": { - "type": "string", - "description": "The catalog of the service", - "enum": [ - "ai", - "compute", - "container", - "storage", - "network", - "database", - "mediaService", - "security", - "middleware", - "others" - ] - }, - "name": { "type": "string", "description": "The name of the service" }, - "customerServiceName": { - "type": "string", - "description": "Customer's name for the service. Used only for customer's reference.If not provided, this value will be auto-generated" - }, - "version": { "type": "string", "description": "The version of the service" }, - "csp": { - "type": "string", - "description": "The provider of the service", - "enum": ["huawei", "flexibleEngine", "openstack", "scs", "alicloud", "aws", "azure", "google"] - }, - "flavor": { "type": "string", "description": "The flavor of the service" }, - "serviceDeploymentState": { - "type": "string", - "description": "The state of the service", - "enum": [ - "deploying", - "deployment successful", - "deployment failed", - "destroying", - "destroy successful", - "destroy failed", - "migrating", - "migration_success", - "migration_failed", - "manual cleanup required" - ] - }, - "serviceHostingType": { - "type": "string", - "description": "Defines which cloud service account is used for deploying cloud resources.", - "enum": ["self", "service-vendor"] - }, - "createTime": { - "type": "string", - "description": "Time of register service.", - "format": "date-time" - }, - "lastModifiedTime": { - "type": "string", - "description": "Time of update service.", - "format": "date-time" - } - } - }, "DeployResource": { "required": ["kind", "name", "properties", "resourceId"], "type": "object", @@ -3288,6 +3688,7 @@ "name", "serviceDeploymentState", "serviceHostingType", + "serviceState", "version" ], "type": "object", @@ -3323,7 +3724,7 @@ "flavor": { "type": "string", "description": "The flavor of the service" }, "serviceDeploymentState": { "type": "string", - "description": "The state of the service", + "description": "The deployment state of the service", "enum": [ "deploying", "deployment successful", @@ -3332,9 +3733,23 @@ "destroy successful", "destroy failed", "migrating", - "migration_success", - "migration_failed", - "manual cleanup required" + "migration successful", + "migration failed", + "manual cleanup required", + "rollback failed" + ] + }, + "serviceState": { + "type": "string", + "description": "The run state of the service", + "enum": [ + "notRunning", + "running", + "starting", + "startingFailed", + "stopping", + "stopped", + "stoppingFailed" ] }, "serviceHostingType": { @@ -3380,6 +3795,7 @@ "name", "serviceDeploymentState", "serviceHostingType", + "serviceState", "version" ], "type": "object", @@ -3415,7 +3831,7 @@ "flavor": { "type": "string", "description": "The flavor of the service" }, "serviceDeploymentState": { "type": "string", - "description": "The state of the service", + "description": "The deployment state of the service", "enum": [ "deploying", "deployment successful", @@ -3424,9 +3840,23 @@ "destroy successful", "destroy failed", "migrating", - "migration_success", - "migration_failed", - "manual cleanup required" + "migration successful", + "migration failed", + "manual cleanup required", + "rollback failed" + ] + }, + "serviceState": { + "type": "string", + "description": "The run state of the service", + "enum": [ + "notRunning", + "running", + "starting", + "startingFailed", + "stopping", + "stopped", + "stoppingFailed" ] }, "serviceHostingType": { @@ -3518,7 +3948,13 @@ "backendSystemType": { "type": "string", "description": "The type of backend system.", - "enum": ["IdentityProvider", "Database", "Terraform Boot", "PolicyMan"] + "enum": [ + "IdentityProvider", + "Database", + "Terraform Boot", + "PolicyMan", + "OpenTelemetry Collector" + ] }, "name": { "type": "string", "description": "The name of backend system." }, "healthStatus": { diff --git a/src/xpanse-api/generated/core/OpenAPI.ts b/src/xpanse-api/generated/core/OpenAPI.ts index 23d2de115..07521752f 100644 --- a/src/xpanse-api/generated/core/OpenAPI.ts +++ b/src/xpanse-api/generated/core/OpenAPI.ts @@ -26,7 +26,7 @@ export type OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = { BASE: 'http://localhost:8080', - VERSION: '1.0.3-SNAPSHOT', + VERSION: '1.0.6-SNAPSHOT', WITH_CREDENTIALS: false, CREDENTIALS: 'include', TOKEN: undefined, diff --git a/src/xpanse-api/generated/index.ts b/src/xpanse-api/generated/index.ts index 8a007579a..0abb23e99 100644 --- a/src/xpanse-api/generated/index.ts +++ b/src/xpanse-api/generated/index.ts @@ -33,15 +33,18 @@ export { Metric } from './models/Metric'; export { MetricItem } from './models/MetricItem'; export { MigrateRequest } from './models/MigrateRequest'; export { Ocl } from './models/Ocl'; -export { Policy } from './models/Policy'; -export { PolicyCreateRequest } from './models/PolicyCreateRequest'; -export { PolicyUpdateRequest } from './models/PolicyUpdateRequest'; export type { Region } from './models/Region'; export { Response } from './models/Response'; +export type { ServicePolicy } from './models/ServicePolicy'; +export type { ServicePolicyCreateRequest } from './models/ServicePolicyCreateRequest'; +export type { ServicePolicyUpdateRequest } from './models/ServicePolicyUpdateRequest'; export { ServiceTemplateDetailVo } from './models/ServiceTemplateDetailVo'; export { SystemStatus } from './models/SystemStatus'; export type { TokenResponse } from './models/TokenResponse'; export { UserOrderableServiceVo } from './models/UserOrderableServiceVo'; +export { UserPolicy } from './models/UserPolicy'; +export { UserPolicyCreateRequest } from './models/UserPolicyCreateRequest'; +export { UserPolicyUpdateRequest } from './models/UserPolicyUpdateRequest'; export { VendorHostedDeployedServiceDetails } from './models/VendorHostedDeployedServiceDetails'; export type { WorkFlowTask } from './models/WorkFlowTask'; @@ -49,8 +52,10 @@ export { AdminService } from './services/AdminService'; export { AuthManagementService } from './services/AuthManagementService'; export { CredentialsManagementService } from './services/CredentialsManagementService'; export { MonitorService } from './services/MonitorService'; -export { PoliciesManagementService } from './services/PoliciesManagementService'; export { ServiceService } from './services/ServiceService'; export { ServiceCatalogService } from './services/ServiceCatalogService'; +export { ServicePoliciesManagementService } from './services/ServicePoliciesManagementService'; +export { ServiceResourceService } from './services/ServiceResourceService'; export { ServiceVendorService } from './services/ServiceVendorService'; +export { UserPoliciesManagementService } from './services/UserPoliciesManagementService'; export { WorkFlowService } from './services/WorkFlowService'; diff --git a/src/xpanse-api/generated/models/BackendSystemStatus.ts b/src/xpanse-api/generated/models/BackendSystemStatus.ts index 54bc45763..fed8eba3d 100644 --- a/src/xpanse-api/generated/models/BackendSystemStatus.ts +++ b/src/xpanse-api/generated/models/BackendSystemStatus.ts @@ -43,6 +43,7 @@ export namespace BackendSystemStatus { DATABASE = 'Database', TERRAFORM_BOOT = 'Terraform Boot', POLICY_MAN = 'PolicyMan', + OPEN_TELEMETRY_COLLECTOR = 'OpenTelemetry Collector', } /** diff --git a/src/xpanse-api/generated/models/DeployedService.ts b/src/xpanse-api/generated/models/DeployedService.ts index f141ab1e1..5d71da327 100644 --- a/src/xpanse-api/generated/models/DeployedService.ts +++ b/src/xpanse-api/generated/models/DeployedService.ts @@ -38,9 +38,13 @@ export type DeployedService = { */ flavor?: string; /** - * The state of the service + * The deployment state of the service */ serviceDeploymentState: DeployedService.serviceDeploymentState; + /** + * The run state of the service + */ + serviceState: DeployedService.serviceState; /** * Defines which cloud service account is used for deploying cloud resources. */ @@ -87,7 +91,7 @@ export namespace DeployedService { } /** - * The state of the service + * The deployment state of the service */ export enum serviceDeploymentState { DEPLOYING = 'deploying', @@ -97,9 +101,23 @@ export namespace DeployedService { DESTROY_SUCCESSFUL = 'destroy successful', DESTROY_FAILED = 'destroy failed', MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', + MIGRATION_SUCCESSFUL = 'migration successful', + MIGRATION_FAILED = 'migration failed', MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', + ROLLBACK_FAILED = 'rollback failed', + } + + /** + * The run state of the service + */ + export enum serviceState { + NOT_RUNNING = 'notRunning', + RUNNING = 'running', + STARTING = 'starting', + STARTING_FAILED = 'startingFailed', + STOPPING = 'stopping', + STOPPED = 'stopped', + STOPPING_FAILED = 'stoppingFailed', } /** diff --git a/src/xpanse-api/generated/models/DeployedServiceDetails.ts b/src/xpanse-api/generated/models/DeployedServiceDetails.ts index a5471779d..624f27485 100644 --- a/src/xpanse-api/generated/models/DeployedServiceDetails.ts +++ b/src/xpanse-api/generated/models/DeployedServiceDetails.ts @@ -41,9 +41,13 @@ export type DeployedServiceDetails = { */ flavor?: string; /** - * The state of the service + * The deployment state of the service */ serviceDeploymentState: DeployedServiceDetails.serviceDeploymentState; + /** + * The run state of the service + */ + serviceState: DeployedServiceDetails.serviceState; /** * Defines which cloud service account is used for deploying cloud resources. */ @@ -103,7 +107,7 @@ export namespace DeployedServiceDetails { } /** - * The state of the service + * The deployment state of the service */ export enum serviceDeploymentState { DEPLOYING = 'deploying', @@ -113,9 +117,23 @@ export namespace DeployedServiceDetails { DESTROY_SUCCESSFUL = 'destroy successful', DESTROY_FAILED = 'destroy failed', MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', + MIGRATION_SUCCESSFUL = 'migration successful', + MIGRATION_FAILED = 'migration failed', MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', + ROLLBACK_FAILED = 'rollback failed', + } + + /** + * The run state of the service + */ + export enum serviceState { + NOT_RUNNING = 'notRunning', + RUNNING = 'running', + STARTING = 'starting', + STARTING_FAILED = 'startingFailed', + STOPPING = 'stopping', + STOPPED = 'stopped', + STOPPING_FAILED = 'stoppingFailed', } /** diff --git a/src/xpanse-api/generated/models/ServiceDetailVo.ts b/src/xpanse-api/generated/models/ServiceDetailVo.ts deleted file mode 100644 index 99788d720..000000000 --- a/src/xpanse-api/generated/models/ServiceDetailVo.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * SPDX-FileCopyrightText: Huawei Inc. - */ - -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { DeployRequest } from './DeployRequest'; -import type { DeployResource } from './DeployResource'; - -export type ServiceDetailVo = { - /** - * The ID of the service - */ - id: string; - /** - * The catalog of the service - */ - category: ServiceDetailVo.category; - /** - * The name of the service - */ - name: string; - /** - * Customer's name for the service. Used only for customer's reference.If not provided, this value will be auto-generated - */ - customerServiceName?: string; - /** - * The version of the service - */ - version: string; - /** - * The provider of the service - */ - csp: ServiceDetailVo.csp; - /** - * The flavor of the service - */ - flavor?: string; - /** - * The state of the service - */ - serviceDeploymentState: ServiceDetailVo.serviceDeploymentState; - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - serviceHostingType: ServiceDetailVo.serviceHostingType; - /** - * Time of register service. - */ - createTime: string; - /** - * Time of update service. - */ - lastModifiedTime: string; - deployRequest: DeployRequest; - /** - * The resource list of the deployed service. - */ - deployResources?: Array; - /** - * The properties of the deployed service. - */ - deployedServiceProperties?: Record; - /** - * The result message of the deployed service. - */ - resultMessage?: string; -}; - -export namespace ServiceDetailVo { - /** - * The catalog of the service - */ - export enum category { - AI = 'ai', - COMPUTE = 'compute', - CONTAINER = 'container', - STORAGE = 'storage', - NETWORK = 'network', - DATABASE = 'database', - MEDIA_SERVICE = 'mediaService', - SECURITY = 'security', - MIDDLEWARE = 'middleware', - OTHERS = 'others', - } - - /** - * The provider of the service - */ - export enum csp { - HUAWEI = 'huawei', - FLEXIBLE_ENGINE = 'flexibleEngine', - OPENSTACK = 'openstack', - SCS = 'scs', - ALICLOUD = 'alicloud', - AWS = 'aws', - AZURE = 'azure', - GOOGLE = 'google', - } - - /** - * The state of the service - */ - export enum serviceDeploymentState { - DEPLOYING = 'deploying', - DEPLOYMENT_SUCCESSFUL = 'deployment successful', - DEPLOYMENT_FAILED = 'deployment failed', - DESTROYING = 'destroying', - DESTROY_SUCCESSFUL = 'destroy successful', - DESTROY_FAILED = 'destroy failed', - MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', - MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', - } - - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - export enum serviceHostingType { - SELF = 'self', - SERVICE_VENDOR = 'service-vendor', - } -} diff --git a/src/xpanse-api/generated/models/PolicyVo.ts b/src/xpanse-api/generated/models/ServicePolicy.ts similarity index 53% rename from src/xpanse-api/generated/models/PolicyVo.ts rename to src/xpanse-api/generated/models/ServicePolicy.ts index afca07aeb..e7e3e6f67 100644 --- a/src/xpanse-api/generated/models/PolicyVo.ts +++ b/src/xpanse-api/generated/models/ServicePolicy.ts @@ -8,19 +8,19 @@ /* tslint:disable */ /* eslint-disable */ -export type PolicyVo = { +export type ServicePolicy = { /** * The id of the policy. */ id: string; /** - * The valid policy created by the user. + * The valid policy belongs to the service. */ policy: string; /** - * The csp which the policy belongs to. + * The id of registered service template which the policy belongs to. */ - csp: PolicyVo.csp; + serviceTemplateId: string; /** * Is the policy enabled. */ @@ -34,19 +34,3 @@ export type PolicyVo = { */ lastModifiedTime: string; }; - -export namespace PolicyVo { - /** - * The csp which the policy belongs to. - */ - export enum csp { - HUAWEI = 'huawei', - FLEXIBLE_ENGINE = 'flexibleEngine', - OPENSTACK = 'openstack', - SCS = 'scs', - ALICLOUD = 'alicloud', - AWS = 'aws', - AZURE = 'azure', - GOOGLE = 'google', - } -} diff --git a/src/xpanse-api/generated/models/ServicePolicyCreateRequest.ts b/src/xpanse-api/generated/models/ServicePolicyCreateRequest.ts new file mode 100644 index 000000000..aad17c235 --- /dev/null +++ b/src/xpanse-api/generated/models/ServicePolicyCreateRequest.ts @@ -0,0 +1,24 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: Huawei Inc. + */ + +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ServicePolicyCreateRequest = { + /** + * The id of registered service template which the policy belongs to. + */ + serviceTemplateId: string; + /** + * The policy. + */ + policy: string; + /** + * Is the policy enabled. true:enabled;false:disabled. + */ + enabled: boolean; +}; diff --git a/src/xpanse-api/generated/models/ServicePolicyUpdateRequest.ts b/src/xpanse-api/generated/models/ServicePolicyUpdateRequest.ts new file mode 100644 index 000000000..c962941ed --- /dev/null +++ b/src/xpanse-api/generated/models/ServicePolicyUpdateRequest.ts @@ -0,0 +1,24 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: Huawei Inc. + */ + +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ServicePolicyUpdateRequest = { + /** + * The id of the policy. + */ + id: string; + /** + * The policy. + */ + policy?: string; + /** + * Is the policy enabled. true:enabled;false:disabled. + */ + enabled?: boolean; +}; diff --git a/src/xpanse-api/generated/models/ServiceVo.ts b/src/xpanse-api/generated/models/ServiceVo.ts deleted file mode 100644 index ef4a67699..000000000 --- a/src/xpanse-api/generated/models/ServiceVo.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * SPDX-FileCopyrightText: Huawei Inc. - */ - -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ServiceVo = { - /** - * The ID of the service - */ - id: string; - /** - * The catalog of the service - */ - category: ServiceVo.category; - /** - * The name of the service - */ - name: string; - /** - * Customer's name for the service. Used only for customer's reference.If not provided, this value will be auto-generated - */ - customerServiceName?: string; - /** - * The version of the service - */ - version: string; - /** - * The provider of the service - */ - csp: ServiceVo.csp; - /** - * The flavor of the service - */ - flavor?: string; - /** - * The state of the service - */ - serviceDeploymentState: ServiceVo.serviceDeploymentState; - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - serviceHostingType: ServiceVo.serviceHostingType; - /** - * Time of register service. - */ - createTime: string; - /** - * Time of update service. - */ - lastModifiedTime: string; -}; - -export namespace ServiceVo { - /** - * The catalog of the service - */ - export enum category { - AI = 'ai', - COMPUTE = 'compute', - CONTAINER = 'container', - STORAGE = 'storage', - NETWORK = 'network', - DATABASE = 'database', - MEDIA_SERVICE = 'mediaService', - SECURITY = 'security', - MIDDLEWARE = 'middleware', - OTHERS = 'others', - } - - /** - * The provider of the service - */ - export enum csp { - HUAWEI = 'huawei', - FLEXIBLE_ENGINE = 'flexibleEngine', - OPENSTACK = 'openstack', - SCS = 'scs', - ALICLOUD = 'alicloud', - AWS = 'aws', - AZURE = 'azure', - GOOGLE = 'google', - } - - /** - * The state of the service - */ - export enum serviceDeploymentState { - DEPLOYING = 'deploying', - DEPLOYMENT_SUCCESSFUL = 'deployment successful', - DEPLOYMENT_FAILED = 'deployment failed', - DESTROYING = 'destroying', - DESTROY_SUCCESSFUL = 'destroy successful', - DESTROY_FAILED = 'destroy failed', - MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', - MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', - } - - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - export enum serviceHostingType { - SELF = 'self', - SERVICE_VENDOR = 'service-vendor', - } -} diff --git a/src/xpanse-api/generated/models/Policy.ts b/src/xpanse-api/generated/models/UserPolicy.ts similarity index 92% rename from src/xpanse-api/generated/models/Policy.ts rename to src/xpanse-api/generated/models/UserPolicy.ts index bd3dc1d53..05c279101 100644 --- a/src/xpanse-api/generated/models/Policy.ts +++ b/src/xpanse-api/generated/models/UserPolicy.ts @@ -8,7 +8,7 @@ /* tslint:disable */ /* eslint-disable */ -export type Policy = { +export type UserPolicy = { /** * The id of the policy. */ @@ -20,7 +20,7 @@ export type Policy = { /** * The csp which the policy belongs to. */ - csp: Policy.csp; + csp: UserPolicy.csp; /** * Is the policy enabled. */ @@ -35,7 +35,7 @@ export type Policy = { lastModifiedTime: string; }; -export namespace Policy { +export namespace UserPolicy { /** * The csp which the policy belongs to. */ diff --git a/src/xpanse-api/generated/models/PolicyCreateRequest.ts b/src/xpanse-api/generated/models/UserPolicyCreateRequest.ts similarity index 86% rename from src/xpanse-api/generated/models/PolicyCreateRequest.ts rename to src/xpanse-api/generated/models/UserPolicyCreateRequest.ts index 9ba33e1ed..fa5753bbf 100644 --- a/src/xpanse-api/generated/models/PolicyCreateRequest.ts +++ b/src/xpanse-api/generated/models/UserPolicyCreateRequest.ts @@ -8,11 +8,11 @@ /* tslint:disable */ /* eslint-disable */ -export type PolicyCreateRequest = { +export type UserPolicyCreateRequest = { /** * The csp which the policy belongs to. */ - csp: PolicyCreateRequest.csp; + csp: UserPolicyCreateRequest.csp; /** * The policy. */ @@ -23,7 +23,7 @@ export type PolicyCreateRequest = { enabled: boolean; }; -export namespace PolicyCreateRequest { +export namespace UserPolicyCreateRequest { /** * The csp which the policy belongs to. */ diff --git a/src/xpanse-api/generated/models/PolicyUpdateRequest.ts b/src/xpanse-api/generated/models/UserPolicyUpdateRequest.ts similarity index 87% rename from src/xpanse-api/generated/models/PolicyUpdateRequest.ts rename to src/xpanse-api/generated/models/UserPolicyUpdateRequest.ts index f79dac288..6f16414d2 100644 --- a/src/xpanse-api/generated/models/PolicyUpdateRequest.ts +++ b/src/xpanse-api/generated/models/UserPolicyUpdateRequest.ts @@ -8,7 +8,7 @@ /* tslint:disable */ /* eslint-disable */ -export type PolicyUpdateRequest = { +export type UserPolicyUpdateRequest = { /** * The id of the policy. */ @@ -16,7 +16,7 @@ export type PolicyUpdateRequest = { /** * The csp which the policy belongs to. */ - csp?: PolicyUpdateRequest.csp; + csp?: UserPolicyUpdateRequest.csp; /** * The policy. */ @@ -27,7 +27,7 @@ export type PolicyUpdateRequest = { enabled?: boolean; }; -export namespace PolicyUpdateRequest { +export namespace UserPolicyUpdateRequest { /** * The csp which the policy belongs to. */ diff --git a/src/xpanse-api/generated/models/VendorHostedDeployedServiceDetails.ts b/src/xpanse-api/generated/models/VendorHostedDeployedServiceDetails.ts index f50006ad6..4f3549dac 100644 --- a/src/xpanse-api/generated/models/VendorHostedDeployedServiceDetails.ts +++ b/src/xpanse-api/generated/models/VendorHostedDeployedServiceDetails.ts @@ -40,9 +40,13 @@ export type VendorHostedDeployedServiceDetails = { */ flavor?: string; /** - * The state of the service + * The deployment state of the service */ serviceDeploymentState: VendorHostedDeployedServiceDetails.serviceDeploymentState; + /** + * The run state of the service + */ + serviceState: VendorHostedDeployedServiceDetails.serviceState; /** * Defines which cloud service account is used for deploying cloud resources. */ @@ -94,7 +98,7 @@ export namespace VendorHostedDeployedServiceDetails { } /** - * The state of the service + * The deployment state of the service */ export enum serviceDeploymentState { DEPLOYING = 'deploying', @@ -104,9 +108,23 @@ export namespace VendorHostedDeployedServiceDetails { DESTROY_SUCCESSFUL = 'destroy successful', DESTROY_FAILED = 'destroy failed', MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', + MIGRATION_SUCCESSFUL = 'migration successful', + MIGRATION_FAILED = 'migration failed', MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', + ROLLBACK_FAILED = 'rollback failed', + } + + /** + * The run state of the service + */ + export enum serviceState { + NOT_RUNNING = 'notRunning', + RUNNING = 'running', + STARTING = 'starting', + STARTING_FAILED = 'startingFailed', + STOPPING = 'stopping', + STOPPED = 'stopped', + STOPPING_FAILED = 'stoppingFailed', } /** diff --git a/src/xpanse-api/generated/models/VendorHostedServiceDetailsVo.ts b/src/xpanse-api/generated/models/VendorHostedServiceDetailsVo.ts deleted file mode 100644 index 102faee2a..000000000 --- a/src/xpanse-api/generated/models/VendorHostedServiceDetailsVo.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * SPDX-FileCopyrightText: Huawei Inc. - */ - -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -import type { DeployRequest } from './DeployRequest'; - -export type VendorHostedServiceDetailsVo = { - /** - * The ID of the service - */ - id: string; - /** - * The catalog of the service - */ - category: VendorHostedServiceDetailsVo.category; - /** - * The name of the service - */ - name: string; - /** - * Customer's name for the service. Used only for customer's reference.If not provided, this value will be auto-generated - */ - customerServiceName?: string; - /** - * The version of the service - */ - version: string; - /** - * The provider of the service - */ - csp: VendorHostedServiceDetailsVo.csp; - /** - * The flavor of the service - */ - flavor?: string; - /** - * The state of the service - */ - serviceDeploymentState: VendorHostedServiceDetailsVo.serviceDeploymentState; - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - serviceHostingType: VendorHostedServiceDetailsVo.serviceHostingType; - /** - * Time of register service. - */ - createTime: string; - /** - * Time of update service. - */ - lastModifiedTime: string; - deployRequest: DeployRequest; - /** - * The properties of the deployed service. - */ - deployedServiceProperties?: Record; -}; - -export namespace VendorHostedServiceDetailsVo { - /** - * The catalog of the service - */ - export enum category { - AI = 'ai', - COMPUTE = 'compute', - CONTAINER = 'container', - STORAGE = 'storage', - NETWORK = 'network', - DATABASE = 'database', - MEDIA_SERVICE = 'mediaService', - SECURITY = 'security', - MIDDLEWARE = 'middleware', - OTHERS = 'others', - } - - /** - * The provider of the service - */ - export enum csp { - HUAWEI = 'huawei', - FLEXIBLE_ENGINE = 'flexibleEngine', - OPENSTACK = 'openstack', - SCS = 'scs', - ALICLOUD = 'alicloud', - AWS = 'aws', - AZURE = 'azure', - GOOGLE = 'google', - } - - /** - * The state of the service - */ - export enum serviceDeploymentState { - DEPLOYING = 'deploying', - DEPLOYMENT_SUCCESSFUL = 'deployment successful', - DEPLOYMENT_FAILED = 'deployment failed', - DESTROYING = 'destroying', - DESTROY_SUCCESSFUL = 'destroy successful', - DESTROY_FAILED = 'destroy failed', - MIGRATING = 'migrating', - MIGRATION_SUCCESS = 'migration_success', - MIGRATION_FAILED = 'migration_failed', - MANUAL_CLEANUP_REQUIRED = 'manual cleanup required', - } - - /** - * Defines which cloud service account is used for deploying cloud resources. - */ - export enum serviceHostingType { - SELF = 'self', - SERVICE_VENDOR = 'service-vendor', - } -} diff --git a/src/xpanse-api/generated/services/CredentialsManagementService.ts b/src/xpanse-api/generated/services/CredentialsManagementService.ts index cd6f5d739..b68232905 100644 --- a/src/xpanse-api/generated/services/CredentialsManagementService.ts +++ b/src/xpanse-api/generated/services/CredentialsManagementService.ts @@ -14,7 +14,6 @@ import type { Link } from '../models/Link'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; -import { CredentialVariables } from '../models/CredentialVariables'; export class CredentialsManagementService { /** @@ -263,14 +262,14 @@ export class CredentialsManagementService { /** * List the credential capabilities defined by the cloud service provider.
Required role: isv or admin or user * @param cspName name of the cloud service provider. - * @param type? The type of credential. - * @param name? The name of credential. + * @param type The type of credential. + * @param name The name of credential. * @returns AbstractCredentialInfo OK * @throws ApiError */ public static getCredentialCapabilities( - cspName: CredentialVariables.csp | undefined, - type?: CredentialVariables.type | undefined, + cspName: 'huawei' | 'flexibleEngine' | 'openstack' | 'scs' | 'alicloud' | 'aws' | 'azure' | 'google', + type?: 'variables' | 'http_authentication' | 'api_key' | 'oauth2', name?: string ): CancelablePromise> { return __request(OpenAPI, { diff --git a/src/xpanse-api/generated/services/ServicePoliciesManagementService.ts b/src/xpanse-api/generated/services/ServicePoliciesManagementService.ts new file mode 100644 index 000000000..52ea84823 --- /dev/null +++ b/src/xpanse-api/generated/services/ServicePoliciesManagementService.ts @@ -0,0 +1,136 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: Huawei Inc. + */ + +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ServicePolicy } from '../models/ServicePolicy'; +import type { ServicePolicyCreateRequest } from '../models/ServicePolicyCreateRequest'; +import type { ServicePolicyUpdateRequest } from '../models/ServicePolicyUpdateRequest'; + +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; + +export class ServicePoliciesManagementService { + /** + * List the policies belongs to the service.
Required role: admin or isv + * @param serviceTemplateId The id of registered service template which the policy belongs to. + * @returns ServicePolicy OK + * @throws ApiError + */ + public static listServicePolicies(serviceTemplateId: string): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/xpanse/service/policies', + query: { + serviceTemplateId: serviceTemplateId, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Update the policy belongs to the registered service template.
Required role: admin or isv + * @param requestBody + * @returns ServicePolicy OK + * @throws ApiError + */ + public static updateServicePolicy(requestBody: ServicePolicyUpdateRequest): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/xpanse/service/policies', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Add policy for the registered service template.
Required role: admin or isv + * @param requestBody + * @returns ServicePolicy OK + * @throws ApiError + */ + public static addServicePolicy(requestBody: ServicePolicyCreateRequest): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/xpanse/service/policies', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Get details of policy belongs to the registered service template.
Required role: admin or isv + * @param id + * @returns ServicePolicy OK + * @throws ApiError + */ + public static getServicePolicyDetails(id: string): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/xpanse/service/policies/{id}', + path: { + id: id, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Delete the policy belongs to the registered service template.
Required role: admin or isv + * @param id + * @returns void + * @throws ApiError + */ + public static deleteServicePolicy(id: string): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/xpanse/service/policies/{id}', + path: { + id: id, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } +} diff --git a/src/xpanse-api/generated/services/ServiceResourceService.ts b/src/xpanse-api/generated/services/ServiceResourceService.ts new file mode 100644 index 000000000..118b0dedd --- /dev/null +++ b/src/xpanse-api/generated/services/ServiceResourceService.ts @@ -0,0 +1,88 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: Huawei Inc. + */ + +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { DeployedService } from '../models/DeployedService'; + +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; + +export class ServiceResourceService { + /** + * Start a task to deploy service using registered service template.
Required role: admin or user + * @param id + * @returns DeployedService OK + * @throws ApiError + */ + public static stopService(id: string): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/xpanse/services/stop/{id}', + path: { + id: id, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Start the service by the service id.
Required role: admin or user + * @param id + * @returns DeployedService OK + * @throws ApiError + */ + public static startService(id: string): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/xpanse/services/start/{id}', + path: { + id: id, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } + + /** + * Start a task to deploy service using registered service template.
Required role: admin or user + * @param id + * @returns DeployedService OK + * @throws ApiError + */ + public static restartService(id: string): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/xpanse/services/restart/{id}', + path: { + id: id, + }, + errors: { + 400: `Bad Request`, + 401: `Unauthorized`, + 403: `Forbidden`, + 422: `Unprocessable Entity`, + 500: `Internal Server Error`, + 502: `Bad Gateway`, + }, + }); + } +} diff --git a/src/xpanse-api/generated/services/ServiceService.ts b/src/xpanse-api/generated/services/ServiceService.ts index 46ea5c4db..94a914ca5 100644 --- a/src/xpanse-api/generated/services/ServiceService.ts +++ b/src/xpanse-api/generated/services/ServiceService.ts @@ -52,9 +52,10 @@ export class ServiceService { | 'destroy successful' | 'destroy failed' | 'migrating' - | 'migration_success' - | 'migration_failed' + | 'migration successful' + | 'migration failed' | 'manual cleanup required' + | 'rollback failed' ): CancelablePromise> { return __request(OpenAPI, { method: 'GET', @@ -156,9 +157,10 @@ export class ServiceService { | 'destroy successful' | 'destroy failed' | 'migrating' - | 'migration_success' - | 'migration_failed' + | 'migration successful' + | 'migration failed' | 'manual cleanup required' + | 'rollback failed' ): CancelablePromise> { return __request(OpenAPI, { method: 'GET', diff --git a/src/xpanse-api/generated/services/PoliciesManagementService.ts b/src/xpanse-api/generated/services/UserPoliciesManagementService.ts similarity index 83% rename from src/xpanse-api/generated/services/PoliciesManagementService.ts rename to src/xpanse-api/generated/services/UserPoliciesManagementService.ts index 36787498d..163a8b73b 100644 --- a/src/xpanse-api/generated/services/PoliciesManagementService.ts +++ b/src/xpanse-api/generated/services/UserPoliciesManagementService.ts @@ -7,26 +7,26 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Policy } from '../models/Policy'; -import type { PolicyCreateRequest } from '../models/PolicyCreateRequest'; -import type { PolicyUpdateRequest } from '../models/PolicyUpdateRequest'; +import type { UserPolicy } from '../models/UserPolicy'; +import type { UserPolicyCreateRequest } from '../models/UserPolicyCreateRequest'; +import type { UserPolicyUpdateRequest } from '../models/UserPolicyUpdateRequest'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; -export class PoliciesManagementService { +export class UserPoliciesManagementService { /** * List the policies defined by the user.
Required role: admin or user * @param cspName Name of csp which the policy belongs to. * @param enabled Is the policy enabled. - * @returns Policy OK + * @returns UserPolicy OK * @throws ApiError */ - public static listPolicies( + public static listUserPolicies( cspName?: 'huawei' | 'flexibleEngine' | 'openstack' | 'scs' | 'alicloud' | 'aws' | 'azure' | 'google', enabled?: boolean - ): CancelablePromise> { + ): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/xpanse/policies', @@ -48,10 +48,10 @@ export class PoliciesManagementService { /** * Update the policy created by the user.
Required role: admin or user * @param requestBody - * @returns Policy OK + * @returns UserPolicy OK * @throws ApiError */ - public static updatePolicy(requestBody: PolicyUpdateRequest): CancelablePromise { + public static updateUserPolicy(requestBody: UserPolicyUpdateRequest): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/xpanse/policies', @@ -71,10 +71,10 @@ export class PoliciesManagementService { /** * Add policy created by the user.
Required role: admin or user * @param requestBody - * @returns Policy OK + * @returns UserPolicy OK * @throws ApiError */ - public static addPolicy(requestBody: PolicyCreateRequest): CancelablePromise { + public static addUserPolicy(requestBody: UserPolicyCreateRequest): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/xpanse/policies', @@ -94,10 +94,10 @@ export class PoliciesManagementService { /** * Get the details of the policy created by the user.
Required role: admin or user * @param id - * @returns Policy OK + * @returns UserPolicy OK * @throws ApiError */ - public static getPolicyDetails(id: string): CancelablePromise { + public static getPolicyDetails(id: string): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/xpanse/policies/{id}', @@ -121,7 +121,7 @@ export class PoliciesManagementService { * @returns void * @throws ApiError */ - public static deletePolicy(id: string): CancelablePromise { + public static deleteUserPolicy(id: string): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/xpanse/policies/{id}',