File

src/cost/dto/register-cost-endpoint.dto.ts

Description

Data Transfer Object to register Cost Endpoints in Turo

Index

Properties

Properties

config
Type : KubecostConfig | AWSConfig | AzureConfig
Decorators :
@ApiProperty()
@IsNotEmpty()
@ValidateNested({each: true})
endpointType
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty()
@IsString()

Endpoint type eg: kubecost

label
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty()
@IsString()

Label to be used by endpoint's internal query API to fetch raw data eg: app:traefik

name
Type : string
Decorators :
@ApiProperty()
@IsString()
@IsNotEmpty()
projectID
Type : number
Decorators :
@ApiProperty()
@IsNotEmpty()
@IsNumber()

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;
}

results matching ""

    No results matching ""