|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../core/resource'; |
| 4 | +import * as NodesAPI from './nodes'; |
| 5 | +import { APIPromise } from '../core/api-promise'; |
| 6 | +import { RequestOptions } from '../internal/request-options'; |
| 7 | +import { path } from '../internal/utils/path'; |
| 8 | + |
| 9 | +export class Zones extends APIResource { |
| 10 | + /** |
| 11 | + * List all available zones |
| 12 | + */ |
| 13 | + list(options?: RequestOptions): APIPromise<ZoneListResponse> { |
| 14 | + return this._client.get('/v0/zones', options); |
| 15 | + } |
| 16 | + |
| 17 | + /** |
| 18 | + * Get detailed information about a specific zone |
| 19 | + */ |
| 20 | + get(id: string, options?: RequestOptions): APIPromise<ZoneGetResponse> { |
| 21 | + return this._client.get(path`/v0/zones/${id}`, options); |
| 22 | + } |
| 23 | +} |
| 24 | + |
| 25 | +export interface ZoneListResponse { |
| 26 | + data: Array<ZoneListResponse.Data>; |
| 27 | + |
| 28 | + object: string; |
| 29 | +} |
| 30 | + |
| 31 | +export namespace ZoneListResponse { |
| 32 | + export interface Data { |
| 33 | + /** |
| 34 | + * The available capacity on this cluster, in the shape of consecutive |
| 35 | + * "availability rectangles". |
| 36 | + */ |
| 37 | + available_capacity: Array<Data.AvailableCapacity>; |
| 38 | + |
| 39 | + delivery_type: 'K8s' | 'VM'; |
| 40 | + |
| 41 | + hardware_type: NodesAPI.AcceleratorType; |
| 42 | + |
| 43 | + interconnect_type: 'Infiniband' | 'None'; |
| 44 | + |
| 45 | + name: string; |
| 46 | + |
| 47 | + object: string; |
| 48 | + |
| 49 | + region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica'; |
| 50 | + } |
| 51 | + |
| 52 | + export namespace Data { |
| 53 | + export interface AvailableCapacity { |
| 54 | + /** |
| 55 | + * Unix timestamp in seconds since epoch |
| 56 | + */ |
| 57 | + end_timestamp: number; |
| 58 | + |
| 59 | + /** |
| 60 | + * The number of nodes available during this time period |
| 61 | + */ |
| 62 | + quantity: number; |
| 63 | + |
| 64 | + /** |
| 65 | + * Unix timestamp in seconds since epoch |
| 66 | + */ |
| 67 | + start_timestamp: number; |
| 68 | + } |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +export interface ZoneGetResponse { |
| 73 | + /** |
| 74 | + * The available capacity on this cluster, in the shape of consecutive |
| 75 | + * "availability rectangles". |
| 76 | + */ |
| 77 | + available_capacity: Array<ZoneGetResponse.AvailableCapacity>; |
| 78 | + |
| 79 | + delivery_type: 'K8s' | 'VM'; |
| 80 | + |
| 81 | + hardware_type: NodesAPI.AcceleratorType; |
| 82 | + |
| 83 | + interconnect_type: 'Infiniband' | 'None'; |
| 84 | + |
| 85 | + name: string; |
| 86 | + |
| 87 | + object: string; |
| 88 | + |
| 89 | + region: 'NorthAmerica' | 'AsiaPacific' | 'EuropeMiddleEastAfrica'; |
| 90 | +} |
| 91 | + |
| 92 | +export namespace ZoneGetResponse { |
| 93 | + export interface AvailableCapacity { |
| 94 | + /** |
| 95 | + * Unix timestamp in seconds since epoch |
| 96 | + */ |
| 97 | + end_timestamp: number; |
| 98 | + |
| 99 | + /** |
| 100 | + * The number of nodes available during this time period |
| 101 | + */ |
| 102 | + quantity: number; |
| 103 | + |
| 104 | + /** |
| 105 | + * Unix timestamp in seconds since epoch |
| 106 | + */ |
| 107 | + start_timestamp: number; |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +export declare namespace Zones { |
| 112 | + export { type ZoneListResponse as ZoneListResponse, type ZoneGetResponse as ZoneGetResponse }; |
| 113 | +} |
0 commit comments