dto.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { CreateIndexParam } from "@zilliz/milvus2-sdk-node/dist/milvus/types";
  2. import {
  3. IsString,
  4. IsEnum,
  5. IsOptional,
  6. IsObject,
  7. IsArray,
  8. } from "class-validator";
  9. class KeyValuePair {
  10. key: string;
  11. value: string;
  12. }
  13. export enum ManageType {
  14. DELETE = "delete",
  15. CREATE = "create",
  16. }
  17. export class ManageIndexDto {
  18. @IsEnum(ManageType, { message: "Type allow delete and create" })
  19. readonly type: ManageType;
  20. @IsString()
  21. readonly collection_name: string;
  22. @IsString()
  23. readonly field_name: string;
  24. @IsObject()
  25. @IsOptional()
  26. readonly extra_params?: CreateIndexParam;
  27. }
  28. export class DescribeIndexDto {
  29. @IsString()
  30. readonly collection_name: string;
  31. @IsString()
  32. @IsOptional()
  33. readonly field_name?: string;
  34. }
  35. export class GetIndexStateDto {
  36. @IsString()
  37. readonly collection_name: string;
  38. @IsString()
  39. @IsOptional()
  40. readonly field_name?: string;
  41. }
  42. export class GetIndexProgressDto {
  43. @IsString()
  44. readonly collection_name: string;
  45. @IsString()
  46. readonly index_name: string;
  47. @IsString()
  48. @IsOptional()
  49. readonly field_name?: string;
  50. }