Skip to content

Commit

Permalink
update price api. (eclipse-xpanse#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice1319 authored May 28, 2024
1 parent 23cc080 commit e7ae8cb
Show file tree
Hide file tree
Showing 6 changed files with 487 additions and 340 deletions.
659 changes: 369 additions & 290 deletions src/xpanse-api/api.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/xpanse-api/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export { DeployVariableKind } from './models/DeployVariableKind';
export { DeployedService } from './models/DeployedService';
export { DeployedServiceDetails } from './models/DeployedServiceDetails';
export { Deployment } from './models/Deployment';
export { FlavorPriceResult } from './models/FlavorPriceResult';
export type { FlavorsWithPrice } from './models/FlavorsWithPrice';
export type { Link } from './models/Link';
export { Metric } from './models/Metric';
Expand All @@ -52,7 +53,6 @@ export { ServiceModificationAuditDetails } from './models/ServiceModificationAud
export type { ServicePolicy } from './models/ServicePolicy';
export type { ServicePolicyCreateRequest } from './models/ServicePolicyCreateRequest';
export type { ServicePolicyUpdateRequest } from './models/ServicePolicyUpdateRequest';
export type { ServicePrice } from './models/ServicePrice';
export type { ServiceProviderContactDetails } from './models/ServiceProviderContactDetails';
export { ServiceStateManagementTaskDetails } from './models/ServiceStateManagementTaskDetails';
export { ServiceTemplateDetailVo } from './models/ServiceTemplateDetailVo';
Expand All @@ -76,6 +76,7 @@ export { MonitorService } from './services/MonitorService';
export { ServiceCatalogService } from './services/ServiceCatalogService';
export { ServiceModificationService } from './services/ServiceModificationService';
export { ServicePoliciesManagementService } from './services/ServicePoliciesManagementService';
export { ServicePricesService } from './services/ServicePricesService';
export { ServiceService } from './services/ServiceService';
export { ServiceStatusManagementService } from './services/ServiceStatusManagementService';
export { ServiceVendorService } from './services/ServiceVendorService';
Expand Down
36 changes: 36 additions & 0 deletions src/xpanse-api/generated/models/FlavorPriceResult.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: Huawei Inc.
*/

/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Price } from './Price';
export type FlavorPriceResult = {
/**
* The name of the flavor.
*/
flavorName: string;
/**
* The billing mode of the price.
*/
billingMode: FlavorPriceResult.billingMode;
recurringPrice?: Price;
oneTimePaymentPrice?: Price;
/**
* Error reason when price calculation fails.
*/
errorMessage?: string;
successful?: boolean;
};
export namespace FlavorPriceResult {
/**
* The billing mode of the price.
*/
export enum billingMode {
FIXED = 'Fixed',
PAY_PER_USE = 'Pay per Use',
}
}
14 changes: 0 additions & 14 deletions src/xpanse-api/generated/models/ServicePrice.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/xpanse-api/generated/services/CloudResourcesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,7 @@
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
import type { ServicePrice } from '../models/ServicePrice';
export class CloudResourcesService {
/**
* List existing cloud resource names with kind<br>Required role:<b> admin</b> or <b>user</b>
* @param templateId id of the service template
* @param region region name of the service
* @param flavorName flavor name of the service
* @param billingMode mode of billing
* @returns ServicePrice OK
* @throws ApiError
*/
public static getServicePriceByFlavor(
templateId: string,
region: string,
flavorName: string,
billingMode: 'Fixed' | 'Pay per Use'
): CancelablePromise<ServicePrice> {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/pricing/{templateId}/{region}/{flavorName}/{billingMode}',
path: {
templateId: templateId,
region: region,
flavorName: flavorName,
billingMode: billingMode,
},
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
422: `Unprocessable Entity`,
500: `Internal Server Error`,
502: `Bad Gateway`,
},
});
}
/**
* List existing cloud resource names with kind<br>Required role:<b> admin</b> or <b>user</b>
* @param csp name of the cloud service provider
Expand Down
80 changes: 80 additions & 0 deletions src/xpanse-api/generated/services/ServicePricesService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: Huawei Inc.
*/

/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
import type { FlavorPriceResult } from '../models/FlavorPriceResult';
export class ServicePricesService {
/**
* Get the price of one specific flavor of the service.<br>Required role:<b> admin</b> or <b>user</b>
* @param templateId id of the service template
* @param region region name of the service
* @param billingMode mode of billing
* @param flavorName flavor name of the service
* @returns FlavorPriceResult OK
* @throws ApiError
*/
public static getServicePriceByFlavor(
templateId: string,
region: string,
billingMode: 'Fixed' | 'Pay per Use',
flavorName: string
): CancelablePromise<FlavorPriceResult> {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/pricing/{templateId}/{region}/{billingMode}/{flavorName}',
path: {
templateId: templateId,
region: region,
billingMode: billingMode,
flavorName: flavorName,
},
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
422: `Unprocessable Entity`,
500: `Internal Server Error`,
502: `Bad Gateway`,
},
});
}
/**
* Get the prices of all flavors of the service<br>Required role:<b> admin</b> or <b>user</b>
* @param templateId id of the service template
* @param region region name of the service
* @param billingMode mode of billing
* @returns FlavorPriceResult OK
* @throws ApiError
*/
public static getPricesByService(
templateId: string,
region: string,
billingMode: 'Fixed' | 'Pay per Use'
): CancelablePromise<Array<FlavorPriceResult>> {
return __request(OpenAPI, {
method: 'GET',
url: '/xpanse/pricing/service/{templateId}/{region}/{billingMode}',
path: {
templateId: templateId,
region: region,
billingMode: billingMode,
},
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
422: `Unprocessable Entity`,
500: `Internal Server Error`,
502: `Bad Gateway`,
},
});
}
}

0 comments on commit e7ae8cb

Please sign in to comment.