src/cost/dto/register-cost-endpoint.dto.ts
Data Transfer Object to register Cost Endpoints in Turo
Properties |
| config |
Type : KubecostConfig | AWSConfig | AzureConfig
|
Decorators :
@ApiProperty()
|
| endpointType |
Type : string
|
Decorators :
@ApiProperty()
|
|
Endpoint type eg: kubecost |
| label |
Type : string
|
Decorators :
@ApiProperty()
|
|
Label to be used by endpoint's internal query API to fetch raw data eg: app:traefik |
| name |
Type : string
|
Decorators :
@ApiProperty()
|
| projectID |
Type : number
|
Decorators :
@ApiProperty()
|
|
Project ID |
import { AWSConfig } from "../../providers/aws/aws.types";
import { KubecostConfig } from "../../providers/kubecost/kubecost.types";
import { ApiProperty } from "@nestjs/swagger";
import {
IsNotEmpty,
IsNumber,
IsString,
ValidateNested,
} from "class-validator";
import { AzureConfig } from "../../providers/azure/azure.types";
/**
* Data Transfer Object to register Cost Endpoints in Turo
*/
export class RegisterCostEndpointDto {
@ApiProperty()
@IsString()
@IsNotEmpty()
name: string;
/**
* Project ID
*/
@ApiProperty()
@IsNotEmpty()
@IsNumber()
projectID: number;
@ApiProperty()
@IsNotEmpty()
@ValidateNested({ each: true })
config: KubecostConfig | AWSConfig | AzureConfig;
/**
* Endpoint type eg: kubecost
*/
@ApiProperty()
@IsNotEmpty()
@IsString()
endpointType: string;
/**
* Label to be used by endpoint's
* internal query API to fetch raw data
* eg: app:traefik
*/
@ApiProperty()
@IsNotEmpty()
@IsString()
label: string;
}