Skip to content

Commit 7837d7d

Browse files
feat(api): api update
1 parent a2c6478 commit 7837d7d

5 files changed

Lines changed: 153 additions & 15 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-73c29dd8765024819248125163d7c3e2d7dcdae819088fd7b1c3f0db5b3b89c0.yml
3-
openapi_spec_hash: 9a1923a47f368e9262d54060fe7f2a80
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company%2Fsfc-nodes-d41b5a590956acc71242ed938a212ee64655756fbd4c2af91db937f97f4fd4f5.yml
3+
openapi_spec_hash: 19777fc4ebc8a243cf8ce3a9ad0e1da4
44
config_hash: e5ed8abf8452457d45fc10488ad15bd2

api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ Types:
2929

3030
- <code><a href="./src/resources/nodes.ts">AcceleratorType</a></code>
3131
- <code><a href="./src/resources/nodes.ts">CreateNodesRequest</a></code>
32+
- <code><a href="./src/resources/nodes.ts">ErrorContent</a></code>
3233
- <code><a href="./src/resources/nodes.ts">ErrorDetail</a></code>
34+
- <code><a href="./src/resources/nodes.ts">ErrorObject</a></code>
35+
- <code><a href="./src/resources/nodes.ts">ErrorType</a></code>
3336
- <code><a href="./src/resources/nodes.ts">ExtendNodeRequest</a></code>
37+
- <code><a href="./src/resources/nodes.ts">ListResponseNode</a></code>
3438
- <code><a href="./src/resources/nodes.ts">Node</a></code>
3539
- <code><a href="./src/resources/nodes.ts">NodeType</a></code>
3640
- <code><a href="./src/resources/nodes.ts">ProcurementStatus</a></code>

src/client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ import { APIPromise } from './core/api-promise';
1919
import {
2020
AcceleratorType,
2121
CreateNodesRequest,
22+
ErrorContent,
2223
ErrorDetail,
24+
ErrorObject,
25+
ErrorType,
2326
ExtendNodeRequest,
27+
ListResponseNode,
2428
Node,
2529
NodeType,
2630
Nodes,
@@ -752,8 +756,12 @@ export declare namespace SFCNodes {
752756
Nodes as Nodes,
753757
type AcceleratorType as AcceleratorType,
754758
type CreateNodesRequest as CreateNodesRequest,
759+
type ErrorContent as ErrorContent,
755760
type ErrorDetail as ErrorDetail,
761+
type ErrorObject as ErrorObject,
762+
type ErrorType as ErrorType,
756763
type ExtendNodeRequest as ExtendNodeRequest,
764+
type ListResponseNode as ListResponseNode,
757765
type Node as Node,
758766
type NodeType as NodeType,
759767
type ProcurementStatus as ProcurementStatus,

src/resources/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ export {
44
Nodes,
55
type AcceleratorType,
66
type CreateNodesRequest,
7+
type ErrorContent,
78
type ErrorDetail,
9+
type ErrorObject,
10+
type ErrorType,
811
type ExtendNodeRequest,
12+
type ListResponseNode,
913
type Node,
1014
type NodeType,
1115
type ProcurementStatus,

src/resources/nodes.ts

Lines changed: 135 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../core/resource';
4+
import * as NodesAPI from './nodes';
45

56
export class Nodes extends APIResource {}
67

@@ -9,16 +10,25 @@ export type AcceleratorType = 'H100' | 'H200';
910
export 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

3551
export 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+
5285
export 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

64159
export 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

97212
export 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
*/
106224
export type Zone = 'hayesvalley';
107225

108226
export 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

Comments
 (0)