Skip to content

Commit 91cda6d

Browse files
feat(api): api update
1 parent 64040d0 commit 91cda6d

10 files changed

Lines changed: 25 additions & 174 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company/sfc-nodes-ed778ad7a0f1a043170e872139d9b342a76c4221229ef7a0ba9d0deb6eebd5da.yml
3-
openapi_spec_hash: aad98a06f22a81ce4c8dd72a0b949ec2
1+
configured_endpoints: 13
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/the-san-francisco-compute-company/sfc-nodes-d77bec75d31462e0bc321888fb26cfc72dfdaad79951224c5409c9941b4b9dea.yml
3+
openapi_spec_hash: 63fda7c20845400a48f45dc944a6e57b
44
config_hash: a187153315a646ecf95709ee4a223df5

api.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ Methods:
2525

2626
## Images
2727

28-
Types:
29-
30-
- <code><a href="./src/resources/vms/images.ts">ImageListResponse</a></code>
31-
- <code><a href="./src/resources/vms/images.ts">ImageGetResponse</a></code>
32-
33-
Methods:
34-
35-
- <code title="get /v1/vms/images">client.vms.images.<a href="./src/resources/vms/images.ts">list</a>() -> ImageListResponse</code>
36-
- <code title="get /v1/vms/images/{image_id}">client.vms.images.<a href="./src/resources/vms/images.ts">get</a>(imageID) -> ImageGetResponse</code>
37-
3828
# Nodes
3929

4030
Types:
@@ -43,7 +33,6 @@ Types:
4333
- <code><a href="./src/resources/nodes.ts">CreateNodesRequest</a></code>
4434
- <code><a href="./src/resources/nodes.ts">ErrorContent</a></code>
4535
- <code><a href="./src/resources/nodes.ts">ErrorDetail</a></code>
46-
- <code><a href="./src/resources/nodes.ts">ErrorObject</a></code>
4736
- <code><a href="./src/resources/nodes.ts">ErrorType</a></code>
4837
- <code><a href="./src/resources/nodes.ts">ExtendNodeRequest</a></code>
4938
- <code><a href="./src/resources/nodes.ts">ListResponseNode</a></code>

src/client.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
CreateNodesRequest,
2323
ErrorContent,
2424
ErrorDetail,
25-
ErrorObject,
2625
ErrorType,
2726
ExtendNodeRequest,
2827
ListResponseNode,
@@ -789,7 +788,6 @@ export declare namespace SFCNodes {
789788
type CreateNodesRequest as CreateNodesRequest,
790789
type ErrorContent as ErrorContent,
791790
type ErrorDetail as ErrorDetail,
792-
type ErrorObject as ErrorObject,
793791
type ErrorType as ErrorType,
794792
type ExtendNodeRequest as ExtendNodeRequest,
795793
type ListResponseNode as ListResponseNode,

src/resources/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export {
66
type CreateNodesRequest,
77
type ErrorContent,
88
type ErrorDetail,
9-
type ErrorObject,
109
type ErrorType,
1110
type ExtendNodeRequest,
1211
type ListResponseNode,

src/resources/nodes.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ export interface CreateNodesRequest {
131131
*/
132132
cloud_init_user_data?: string;
133133

134+
/**
135+
* **Experimental — subject to change or removal without notice.** Enables
136+
* InfiniBand. Requires hardware in the chosen zone that supports InfiniBand.
137+
*/
138+
enable_infiniband?: boolean;
139+
134140
/**
135141
* End time as Unix timestamp in seconds If provided, end time must be aligned to
136142
* the hour If not provided, the node will be created as an autoreserved node
@@ -149,7 +155,7 @@ export interface CreateNodesRequest {
149155

150156
/**
151157
* Custom node names Names cannot begin with 'vm*' or 'n*' as this is reserved for
152-
* system-generated IDs Names cannot be numeric strings Names cannot exceed 128
158+
* system-generated IDs Names cannot be numeric strings Names cannot exceed 256
153159
* characters
154160
*/
155161
names?: Array<string>;
@@ -194,10 +200,6 @@ export interface ErrorDetail {
194200
field?: string | null;
195201
}
196202

197-
export interface ErrorObject {
198-
error: ErrorContent;
199-
}
200-
201203
export type ErrorType =
202204
| 'api_error'
203205
| 'invalid_request_error'
@@ -211,7 +213,8 @@ export type ErrorType =
211213
| 'upgrade_required'
212214
| 'payment_required'
213215
| 'service_unavailable'
214-
| 'unprocessable_entity';
216+
| 'unprocessable_entity'
217+
| 'gone';
215218

216219
export interface ExtendNodeRequest {
217220
/**
@@ -482,6 +485,12 @@ export interface NodeCreateParams {
482485
*/
483486
cloud_init_user_data?: string;
484487

488+
/**
489+
* **Experimental — subject to change or removal without notice.** Enables
490+
* InfiniBand. Requires hardware in the chosen zone that supports InfiniBand.
491+
*/
492+
enable_infiniband?: boolean;
493+
485494
/**
486495
* End time as Unix timestamp in seconds If provided, end time must be aligned to
487496
* the hour If not provided, the node will be created as an autoreserved node
@@ -500,7 +509,7 @@ export interface NodeCreateParams {
500509

501510
/**
502511
* Custom node names Names cannot begin with 'vm*' or 'n*' as this is reserved for
503-
* system-generated IDs Names cannot be numeric strings Names cannot exceed 128
512+
* system-generated IDs Names cannot be numeric strings Names cannot exceed 256
504513
* characters
505514
*/
506515
names?: Array<string>;
@@ -581,7 +590,6 @@ export declare namespace Nodes {
581590
type CreateNodesRequest as CreateNodesRequest,
582591
type ErrorContent as ErrorContent,
583592
type ErrorDetail as ErrorDetail,
584-
type ErrorObject as ErrorObject,
585593
type ErrorType as ErrorType,
586594
type ExtendNodeRequest as ExtendNodeRequest,
587595
type ListResponseNode as ListResponseNode,

src/resources/vms/images.ts

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,5 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../core/resource';
4-
import { APIPromise } from '../../core/api-promise';
5-
import { RequestOptions } from '../../internal/request-options';
6-
import { path } from '../../internal/utils/path';
74

8-
/**
9-
* Manage your Virtual Machines.
10-
*/
11-
export class Images extends APIResource {
12-
/**
13-
* List all VM Images for the authenticated account
14-
*/
15-
list(options?: RequestOptions): APIPromise<ImageListResponse> {
16-
return this._client.get('/v1/vms/images', options);
17-
}
18-
19-
/**
20-
* Get the download URL for a VM image by ID
21-
*/
22-
get(imageID: string, options?: RequestOptions): APIPromise<ImageGetResponse> {
23-
return this._client.get(path`/v1/vms/images/${imageID}`, options);
24-
}
25-
}
26-
27-
/**
28-
* Response body for listing images
29-
*/
30-
export interface ImageListResponse {
31-
data: Array<ImageListResponse.Data>;
32-
33-
has_more: boolean;
34-
35-
object: 'list';
36-
}
37-
38-
export namespace ImageListResponse {
39-
/**
40-
* Response body for individual image info (used in lists)
41-
*/
42-
export interface Data {
43-
/**
44-
* Creation timestamp as Unix timestamp in seconds
45-
*/
46-
created_at: number;
47-
48-
/**
49-
* The image ID
50-
*/
51-
image_id: string;
52-
53-
/**
54-
* Client given name of the image. Must be unique per account.
55-
*/
56-
name: string;
57-
58-
object: 'image';
59-
60-
/**
61-
* Upload status of the image
62-
*/
63-
upload_status: string;
64-
65-
/**
66-
* SHA256 hash of the image file for integrity verification
67-
*/
68-
sha256_hash?: string | null;
69-
}
70-
}
71-
72-
/**
73-
* Response body for image download presigned URL generation
74-
*/
75-
export interface ImageGetResponse {
76-
/**
77-
* The presigned URL that can be used to download the image
78-
*/
79-
download_url: string;
80-
81-
/**
82-
* Timestamp when the presigned URL expires (RFC 3339 format)
83-
*/
84-
expires_at: string;
85-
86-
/**
87-
* The image ID
88-
*/
89-
image_id: string;
90-
91-
/**
92-
* Human readable name of the image. Must be unique per account.
93-
*/
94-
name: string;
95-
96-
object: 'image';
97-
98-
/**
99-
* Size of the image file in bytes
100-
*/
101-
object_size: number;
102-
103-
/**
104-
* SHA256 hash of the image file for integrity verification
105-
*/
106-
sha256_hash: string;
107-
}
108-
109-
export declare namespace Images {
110-
export { type ImageListResponse as ImageListResponse, type ImageGetResponse as ImageGetResponse };
111-
}
5+
export class Images extends APIResource {}

src/resources/vms/index.ts

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

3-
export { Images, type ImageListResponse, type ImageGetResponse } from './images';
3+
export { Images } from './images';
44
export {
55
Script,
66
type UserData,

src/resources/vms/vms.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { APIResource } from '../../core/resource';
44
import * as ImagesAPI from './images';
5-
import { ImageGetResponse, ImageListResponse, Images } from './images';
5+
import { Images } from './images';
66
import * as ScriptAPI from './script';
77
import { Script, ScriptCreateParams, ScriptCreateResponse, ScriptRetrieveResponse, UserData } from './script';
88
import { APIPromise } from '../../core/api-promise';
@@ -112,9 +112,5 @@ export declare namespace VMs {
112112
type ScriptCreateParams as ScriptCreateParams,
113113
};
114114

115-
export {
116-
Images as Images,
117-
type ImageListResponse as ImageListResponse,
118-
type ImageGetResponse as ImageGetResponse,
119-
};
115+
export { Images as Images };
120116
}

tests/api-resources/nodes.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ describe('resource nodes', () => {
2727
max_price_per_node_hour: 1600,
2828
any_zone: false,
2929
cloud_init_user_data: 'aGVsbG8gd29ybGQ=',
30+
enable_infiniband: false,
3031
end_at: 0,
3132
forward_443: false,
32-
image_id: 'vmi_1234567890abcdef',
33+
image_id: 'image_1234567890abcdef',
3334
names: ['cuda-crunch'],
3435
node_type: 'autoreserved',
3536
start_at: 1640995200,

tests/api-resources/vms/images.test.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)