Skip to content

Commit

Permalink
deployer changed to multiple files map (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
baixinsui authored Dec 27, 2024
1 parent 8c89119 commit fc4b606
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const AddOrUpdateServicePolicy = ({
};
setUpdatePolicyRequest(policyUpdateRequest);
updatePoliciesManagementServiceRequest.mutate({
id: currentServicePolicy.servicePolicyId,
policyId: currentServicePolicy.servicePolicyId,
policyUpdateRequest: policyUpdateRequest,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { deleteServicePolicy, DeleteServicePolicyData } from '../../../../../../

export const useDeleteServicePolicy = () => {
return useMutation({
mutationFn: (id: string) => {
mutationFn: (policyId: string) => {
const deleteData: DeleteServicePolicyData = {
id: id,
policyId: policyId,
};
return deleteServicePolicy(deleteData);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ import {

export const useUpdateServicePolicy = () => {
return useMutation({
mutationFn: ({ id, policyUpdateRequest }: { id: string; policyUpdateRequest: ServicePolicyUpdateRequest }) => {
mutationFn: ({
policyId,
policyUpdateRequest,
}: {
policyId: string;
policyUpdateRequest: ServicePolicyUpdateRequest;
}) => {
const data: UpdateServicePolicyData = {
id: id,
policyId: policyId,
requestBody: policyUpdateRequest,
};
return updateServicePolicy(data);
Expand Down
4 changes: 2 additions & 2 deletions src/components/content/common/ocl/DeploymentScript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export function DeploymentScriptText({ deployment }: { deployment: Deployment })
const yamlDocument = new YAML.Document();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
yamlDocument.contents = deployment.deployer ? deployment.deployer : deployment.scriptsRepo;
yamlDocument.contents = deployment.scriptFiles ? deployment.scriptFiles : deployment.scriptsRepo;
return (
<Popover
content={<pre className={oclDisplayStyles.oclDeploymentScript}>{yamlDocument.toString()}</pre>}
title={'Deployment Script'}
title={'Deployment Scripts'}
trigger='hover'
>
<Button className={oclDisplayStyles.oclDataHover} type={'link'}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/deployment/DeploymentInfomation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function DeploymentInfomation({ deployment }: { deployment: Deployment }): React
<Descriptions.Item label='Service Availability Config'>
<DeploymentText deployment={deployment} />
</Descriptions.Item>
<Descriptions.Item label='Deployment Script'>
<Descriptions.Item label='Deployment Scripts'>
<DeploymentScriptText deployment={deployment} />
</Descriptions.Item>
</Descriptions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { deleteUserPolicy, DeleteUserPolicyData } from '../../../../xpanse-api/g

export function useDeletePolicyRequest() {
return useMutation({
mutationFn: (id: string) => {
mutationFn: (policyId: string) => {
const data: DeleteUserPolicyData = {
id: id,
policyId: policyId,
};
return deleteUserPolicy(data);
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/content/workflows/Workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Workflows(): React.JSX.Element {
const completeFailedTasksQuery = useMutation({
mutationFn: (taskId: string) => {
const data: ManageFailedOrderData = {
id: taskId,
taskId: taskId,
retryOrder: true,
};
return manageFailedOrder(data);
Expand All @@ -79,7 +79,7 @@ function Workflows(): React.JSX.Element {
const closeFailedTasksQuery = useMutation({
mutationFn: (taskId: string) => {
const data: ManageFailedOrderData = {
id: taskId,
taskId: taskId,
retryOrder: false,
};
return manageFailedOrder(data);
Expand Down
136 changes: 68 additions & 68 deletions src/xpanse-api/generated/sdk.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ import type {
/**
* Manage failed task orders.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.id ID of the workflow task that needs to be handled
* @param data.taskId ID of the workflow task that needs to be handled
* @param data.retryOrder Controls if the order must be retried again or simply closed.
* @returns unknown OK
* @throws ApiError
*/
export const manageFailedOrder = (data: ManageFailedOrderData): CancelablePromise<ManageFailedOrderResponse> => {
return __request(OpenAPI, {
method: 'PUT',
url: '/xpanse/workflow/task/{id}',
url: '/xpanse/workflow/task/{taskId}',
path: {
id: data.id,
taskId: data.taskId,
},
query: {
retryOrder: data.retryOrder,
Expand All @@ -207,17 +207,17 @@ export const manageFailedOrder = (data: ManageFailedOrderData): CancelablePromis
/**
* Complete tasks by task ID and set global process variables .<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.id ID of the workflow task that needs to be handled
* @param data.taskId ID of the workflow task that needs to be handled
* @param data.requestBody
* @returns unknown OK
* @throws ApiError
*/
export const completeTask = (data: CompleteTaskData): CancelablePromise<CompleteTaskResponse> => {
return __request(OpenAPI, {
method: 'PUT',
url: '/xpanse/workflow/complete/task/{id}',
url: '/xpanse/workflow/complete/task/{taskId}',
path: {
id: data.id,
taskId: data.taskId,
},
body: data.requestBody,
mediaType: 'application/json',
Expand Down Expand Up @@ -718,7 +718,7 @@ export const cancelServiceTemplateRequestByRequestId = (
};

/**
* Publishes the same service template to catalog again using.<br> Required role: <b>admin</b> or <b>isv</b> </br>
* Publishes the same service template to catalog again.<br> Required role: <b>admin</b> or <b>isv</b> </br>
* @param data The data for the request.
* @param data.serviceTemplateId id of service template
* @returns ServiceTemplateRequestInfo OK
Expand Down Expand Up @@ -778,7 +778,7 @@ export const fetchUpdate = (data: FetchUpdateData): CancelablePromise<FetchUpdat
/**
* Get details of policy belongs to the registered service template.<br> Required role: <b>admin</b> or <b>isv</b> </br>
* @param data The data for the request.
* @param data.id
* @param data.policyId
* @returns ServicePolicy OK
* @throws ApiError
*/
Expand All @@ -787,9 +787,9 @@ export const getServicePolicyDetails = (
): CancelablePromise<GetServicePolicyDetailsResponse> => {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/service/policies/{id}',
url: '/xpanse/service/policies/{policyId}',
path: {
id: data.id,
policyId: data.policyId,
},
errors: {
400: 'Bad Request',
Expand All @@ -806,17 +806,17 @@ export const getServicePolicyDetails = (
/**
* Update the policy belongs to the registered service template.<br> Required role: <b>admin</b> or <b>isv</b> </br>
* @param data The data for the request.
* @param data.id ID of the policy to be updated
* @param data.policyId ID of the policy to be updated
* @param data.requestBody
* @returns ServicePolicy OK
* @throws ApiError
*/
export const updateServicePolicy = (data: UpdateServicePolicyData): CancelablePromise<UpdateServicePolicyResponse> => {
return __request(OpenAPI, {
method: 'PUT',
url: '/xpanse/service/policies/{id}',
url: '/xpanse/service/policies/{policyId}',
path: {
id: data.id,
policyId: data.policyId,
},
body: data.requestBody,
mediaType: 'application/json',
Expand All @@ -835,42 +835,16 @@ export const updateServicePolicy = (data: UpdateServicePolicyData): CancelablePr
/**
* Delete the policy belongs to the registered service template.<br> Required role: <b>admin</b> or <b>isv</b> </br>
* @param data The data for the request.
* @param data.id
* @param data.policyId
* @returns void No Content
* @throws ApiError
*/
export const deleteServicePolicy = (data: DeleteServicePolicyData): CancelablePromise<DeleteServicePolicyResponse> => {
return __request(OpenAPI, {
method: 'DELETE',
url: '/xpanse/service/policies/{id}',
url: '/xpanse/service/policies/{policyId}',
path: {
id: data.id,
},
errors: {
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
408: 'Request Timeout',
422: 'Unprocessable Entity',
500: 'Internal Server Error',
502: 'Bad Gateway',
},
});
};

/**
* Get the details of the policy created by the user.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.id
* @returns UserPolicy OK
* @throws ApiError
*/
export const getPolicyDetails = (data: GetPolicyDetailsData): CancelablePromise<GetPolicyDetailsResponse> => {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/policies/{id}',
path: {
id: data.id,
policyId: data.policyId,
},
errors: {
400: 'Bad Request',
Expand Down Expand Up @@ -913,32 +887,6 @@ export const updateUserPolicy = (data: UpdateUserPolicyData): CancelablePromise<
});
};

/**
* Delete the policy created by the user.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.id
* @returns void No Content
* @throws ApiError
*/
export const deleteUserPolicy = (data: DeleteUserPolicyData): CancelablePromise<DeleteUserPolicyResponse> => {
return __request(OpenAPI, {
method: 'DELETE',
url: '/xpanse/policies/{id}',
path: {
id: data.id,
},
errors: {
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
408: 'Request Timeout',
422: 'Unprocessable Entity',
500: 'Internal Server Error',
502: 'Bad Gateway',
},
});
};

/**
* Users in the ISV role get all cloud provider credentials added by the user for a cloud service provider.<br> Required role: <b>isv</b> </br>
* @param data The data for the request.
Expand Down Expand Up @@ -2016,6 +1964,58 @@ export const getPricesByService = (data: GetPricesByServiceData): CancelableProm
});
};

/**
* Get the details of the policy created by the user.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.policyId
* @returns UserPolicy OK
* @throws ApiError
*/
export const getPolicyDetails = (data: GetPolicyDetailsData): CancelablePromise<GetPolicyDetailsResponse> => {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/policies/{policyId}',
path: {
policyId: data.policyId,
},
errors: {
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
408: 'Request Timeout',
422: 'Unprocessable Entity',
500: 'Internal Server Error',
502: 'Bad Gateway',
},
});
};

/**
* Delete the policy created by the user.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
* @param data.policyId
* @returns void No Content
* @throws ApiError
*/
export const deleteUserPolicy = (data: DeleteUserPolicyData): CancelablePromise<DeleteUserPolicyResponse> => {
return __request(OpenAPI, {
method: 'DELETE',
url: '/xpanse/policies/{policyId}',
path: {
policyId: data.policyId,
},
errors: {
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
408: 'Request Timeout',
422: 'Unprocessable Entity',
500: 'Internal Server Error',
502: 'Bad Gateway',
},
});
};

/**
* Get metrics of a deployed service or a resource.<br> Required role: <b>admin</b> or <b>user</b> </br>
* @param data The data for the request.
Expand Down
Loading

0 comments on commit fc4b606

Please sign in to comment.