Skip to content

Commit

Permalink
Add rentableOrRentedBy query in dedicated filter
Browse files Browse the repository at this point in the history
  • Loading branch information
samaradel committed Nov 4, 2024
1 parent 3b3e9a7 commit 9ea5155
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/grid_client/src/modules/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ class FilterOptions {
@Expose() @IsOptional() @Transform(({ value }) => NodeStatus[value]) @IsEnum(NodeStatus) status?: NodeStatus;
@Expose() @IsOptional() @IsString() region?: string;
@Expose() @IsOptional() @IsBoolean() healthy?: boolean;
@Expose() @IsOptional() @IsInt() rentableOrRentedBy?: number;
}

enum CertificationType {
Expand Down
1 change: 1 addition & 0 deletions packages/grid_client/src/primitives/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ class Nodes {
healthy: options.healthy,
sort_by: SortBy.FreeCRU,
sort_order: SortOrder.Desc,
rentable_or_rented_by: options.rentableOrRentedBy,
};

if (options.gateway) {
Expand Down
1 change: 1 addition & 0 deletions packages/playground/src/types/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface SelectionDetailsFilters {
certified?: boolean;
dedicated?: boolean;
exclusiveFor?: string;
rentable_or_rented_by?: number;
}

export interface NumericValidator {
Expand Down
1 change: 1 addition & 0 deletions packages/playground/src/utils/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export function normalizeNodeFilters(
country: options.location.country,
gateway: options.gateway,
healthy: true,
rentableOrRentedBy: filters.dedicated ? options.twinId : undefined,
};
}

Expand Down

0 comments on commit 9ea5155

Please sign in to comment.