11// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
33import { APIResource } from '../core/resource' ;
4+ import * as NodesAPI from './nodes' ;
45
56export class Nodes extends APIResource { }
67
@@ -9,16 +10,25 @@ export type AcceleratorType = 'H100' | 'H200';
910export interface CreateNodesRequest {
1011 desired_count : number ;
1112
12- max_price_per_hour : number ;
13+ /**
14+ * Max price per hour for a node in cents
15+ */
16+ max_price_per_node_hour : number ;
1317
1418 /**
15- * End time as Unix timestamp in seconds
19+ * Zone to create the nodes in. See Zone enum for valid values.
1620 */
17- end_at ?: number ;
21+ zone : string ;
22+
23+ /**
24+ * End time as Unix timestamp in seconds. If provided, end time must be aligned to
25+ * the hour. If not provided, the node will be created as an on-demand node.
26+ */
27+ end_at ?: number | null ;
1828
1929 /**
20- * Custom node names. Names cannot follow the vm*id pattern vm*{16_hex_chars } as
21- * this is reserved for system-generated IDs.
30+ * Custom node names. Names cannot follow the vm\_{alpha_numeric_chars } as this is
31+ * reserved for system-generated IDs. Names cannot be numeric strings .
2232 */
2333 names ?: Array < string > ;
2434
@@ -28,8 +38,14 @@ export interface CreateNodesRequest {
2838 * Start time as Unix timestamp in seconds
2939 */
3040 start_at ?: number ;
41+ }
42+
43+ export interface ErrorContent {
44+ message : string ;
3145
32- zone ?: string ;
46+ type : ErrorType ;
47+
48+ details ?: Array < ErrorDetail > ;
3349}
3450
3551export interface ErrorDetail {
@@ -49,16 +65,95 @@ export interface ErrorDetail {
4965 field ?: string | null ;
5066}
5167
68+ export interface ErrorObject {
69+ error : ErrorContent ;
70+ }
71+
72+ export type ErrorType =
73+ | 'api_error'
74+ | 'invalid_request_error'
75+ | 'authentication_error'
76+ | 'idempotency_error'
77+ | 'conflict'
78+ | 'not_found'
79+ | 'request_timed_out'
80+ | 'forbidden'
81+ | 'not_implemented'
82+ | 'upgrade_required'
83+ | 'payment_required' ;
84+
5285export interface ExtendNodeRequest {
5386 /**
54- * Duration in seconds to extend the node by
87+ * Duration in seconds to extend the node Must be at least 1 hour (3600 seconds)
88+ * and a multiple of 1 hour.
5589 */
5690 duration_seconds : number ;
5791
5892 /**
5993 * Max price per hour for the extension in cents
6094 */
61- max_price_per_hour : number ;
95+ max_price_per_node_hour : number ;
96+ }
97+
98+ export interface ListResponseNode {
99+ data : Array < ListResponseNode . Data > ;
100+
101+ object : string ;
102+ }
103+
104+ export namespace ListResponseNode {
105+ export interface Data {
106+ id : string ;
107+
108+ gpu_type : NodesAPI . AcceleratorType ;
109+
110+ name : string ;
111+
112+ node_type : NodesAPI . NodeType ;
113+
114+ object : string ;
115+
116+ owner : string ;
117+
118+ /**
119+ * Node Status
120+ */
121+ status : NodesAPI . Status ;
122+
123+ /**
124+ * Creation time as Unix timestamp in seconds
125+ */
126+ created_at ?: number | null ;
127+
128+ /**
129+ * End time as Unix timestamp in seconds
130+ */
131+ end_at ?: number | null ;
132+
133+ /**
134+ * Max price per hour you're willing to pay for a node in cents
135+ */
136+ max_price_per_node_hour ?: number | null ;
137+
138+ procurement_id ?: string | null ;
139+
140+ procurement_status ?: NodesAPI . ProcurementStatus | null ;
141+
142+ /**
143+ * Start time as Unix timestamp in seconds
144+ */
145+ start_at ?: number | null ;
146+
147+ /**
148+ * Last updated time as Unix timestamp in seconds
149+ */
150+ updated_at ?: number | null ;
151+
152+ /**
153+ * Choose from these zones when creating a node
154+ */
155+ zone ?: NodesAPI . Zone | null ;
156+ }
62157}
63158
64159export interface Node {
@@ -70,47 +165,74 @@ export interface Node {
70165
71166 node_type : NodeType ;
72167
168+ object : string ;
169+
73170 owner : string ;
74171
172+ /**
173+ * Node Status
174+ */
75175 status : Status ;
76176
177+ /**
178+ * Creation time as Unix timestamp in seconds
179+ */
77180 created_at ?: number | null ;
78181
182+ /**
183+ * End time as Unix timestamp in seconds
184+ */
79185 end_at ?: number | null ;
80186
81- max_price_per_hour ?: number | null ;
187+ /**
188+ * Max price per hour you're willing to pay for a node in cents
189+ */
190+ max_price_per_node_hour ?: number | null ;
82191
83192 procurement_id ?: string | null ;
84193
85194 procurement_status ?: ProcurementStatus | null ;
86195
196+ /**
197+ * Start time as Unix timestamp in seconds
198+ */
87199 start_at ?: number | null ;
88200
201+ /**
202+ * Last updated time as Unix timestamp in seconds
203+ */
89204 updated_at ?: number | null ;
90205
91206 /**
92- * Possible zones to choose from when creating a node.
207+ * Choose from these zones when creating a node
93208 */
94209 zone ?: Zone | null ;
95210}
96211
97212export type NodeType = 'on_demand' | 'reserved' ;
98213
99- export type ProcurementStatus = 'Uninitialized ' | 'Active ' | 'Ended ' | 'AwaitingCapacity ' ;
214+ export type ProcurementStatus = 'uninitialized ' | 'active ' | 'ended ' | 'awaiting_capacity ' ;
100215
101- export type Status = 'Pending' | 'Running' | 'Terminated' | 'Failed' | 'Unknown' ;
216+ /**
217+ * Node Status
218+ */
219+ export type Status = 'pending' | 'running' | 'terminated' | 'failed' | 'unknown' ;
102220
103221/**
104- * Possible zones to choose from when creating a node.
222+ * Choose from these zones when creating a node
105223 */
106224export type Zone = 'hayesvalley' ;
107225
108226export declare namespace Nodes {
109227 export {
110228 type AcceleratorType as AcceleratorType ,
111229 type CreateNodesRequest as CreateNodesRequest ,
230+ type ErrorContent as ErrorContent ,
112231 type ErrorDetail as ErrorDetail ,
232+ type ErrorObject as ErrorObject ,
233+ type ErrorType as ErrorType ,
113234 type ExtendNodeRequest as ExtendNodeRequest ,
235+ type ListResponseNode as ListResponseNode ,
114236 type Node as Node ,
115237 type NodeType as NodeType ,
116238 type ProcurementStatus as ProcurementStatus ,
0 commit comments