@nirvana-labs/nirvana 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +7 -12
- package/package.json +1 -1
- package/resources/compute/compute.d.mts +2 -2
- package/resources/compute/compute.d.mts.map +1 -1
- package/resources/compute/compute.d.ts +2 -2
- package/resources/compute/compute.d.ts.map +1 -1
- package/resources/compute/compute.js +2 -2
- package/resources/compute/compute.js.map +1 -1
- package/resources/compute/compute.mjs +2 -2
- package/resources/compute/compute.mjs.map +1 -1
- package/resources/compute/index.d.mts +1 -1
- package/resources/compute/index.d.ts +1 -1
- package/resources/compute/index.js +2 -2
- package/resources/compute/index.js.map +1 -1
- package/resources/compute/index.mjs +1 -1
- package/resources/compute/vms/availability.d.mts +130 -0
- package/resources/compute/vms/availability.d.mts.map +1 -0
- package/resources/compute/vms/availability.d.ts +130 -0
- package/resources/compute/vms/availability.d.ts.map +1 -0
- package/resources/compute/vms/availability.js +56 -0
- package/resources/compute/vms/availability.js.map +1 -0
- package/resources/compute/vms/availability.mjs +52 -0
- package/resources/compute/vms/availability.mjs.map +1 -0
- package/resources/compute/vms/index.d.mts +1 -0
- package/resources/compute/vms/index.d.mts.map +1 -1
- package/resources/compute/vms/index.d.ts +1 -0
- package/resources/compute/vms/index.d.ts.map +1 -1
- package/resources/compute/vms/index.js +3 -1
- package/resources/compute/vms/index.js.map +1 -1
- package/resources/compute/vms/index.mjs +1 -0
- package/resources/compute/vms/index.mjs.map +1 -1
- package/resources/compute/vms/vms.d.mts +5 -1
- package/resources/compute/vms/vms.d.mts.map +1 -1
- package/resources/compute/vms/vms.d.ts +5 -1
- package/resources/compute/vms/vms.d.ts.map +1 -1
- package/resources/compute/vms/vms.js +5 -1
- package/resources/compute/vms/vms.js.map +1 -1
- package/resources/compute/vms/vms.mjs +5 -1
- package/resources/compute/vms/vms.mjs.map +1 -1
- package/resources/compute/vms/volumes.d.mts +1 -1
- package/resources/compute/vms/volumes.d.ts +1 -1
- package/resources/compute/volumes/availability.d.mts +61 -0
- package/resources/compute/volumes/availability.d.mts.map +1 -0
- package/resources/compute/volumes/availability.d.ts +61 -0
- package/resources/compute/volumes/availability.d.ts.map +1 -0
- package/resources/compute/volumes/availability.js +49 -0
- package/resources/compute/volumes/availability.js.map +1 -0
- package/resources/compute/volumes/availability.mjs +45 -0
- package/resources/compute/volumes/availability.mjs.map +1 -0
- package/resources/compute/volumes/index.d.mts +3 -0
- package/resources/compute/volumes/index.d.mts.map +1 -0
- package/resources/compute/volumes/index.d.ts +3 -0
- package/resources/compute/volumes/index.d.ts.map +1 -0
- package/resources/compute/volumes/index.js +9 -0
- package/resources/compute/volumes/index.js.map +1 -0
- package/resources/compute/volumes/index.mjs +4 -0
- package/resources/compute/volumes/index.mjs.map +1 -0
- package/resources/compute/volumes/volumes.d.mts +150 -0
- package/resources/compute/volumes/volumes.d.mts.map +1 -0
- package/resources/compute/volumes/volumes.d.ts +150 -0
- package/resources/compute/volumes/volumes.d.ts.map +1 -0
- package/resources/compute/volumes/volumes.js +83 -0
- package/resources/compute/volumes/volumes.js.map +1 -0
- package/resources/compute/volumes/volumes.mjs +78 -0
- package/resources/compute/volumes/volumes.mjs.map +1 -0
- package/resources/compute/volumes.d.mts +1 -145
- package/resources/compute/volumes.d.mts.map +1 -1
- package/resources/compute/volumes.d.ts +1 -145
- package/resources/compute/volumes.d.ts.map +1 -1
- package/resources/compute/volumes.js +2 -71
- package/resources/compute/volumes.js.map +1 -1
- package/resources/compute/volumes.mjs +1 -69
- package/resources/compute/volumes.mjs.map +1 -1
- package/resources/networking/index.d.mts +1 -1
- package/resources/networking/index.d.ts +1 -1
- package/resources/networking/index.js +2 -2
- package/resources/networking/index.js.map +1 -1
- package/resources/networking/index.mjs +1 -1
- package/resources/networking/networking.d.mts +2 -2
- package/resources/networking/networking.d.ts +2 -2
- package/resources/networking/networking.js +2 -2
- package/resources/networking/networking.js.map +1 -1
- package/resources/networking/networking.mjs +2 -2
- package/resources/networking/vpcs/availability.d.mts +62 -0
- package/resources/networking/vpcs/availability.d.mts.map +1 -0
- package/resources/networking/vpcs/availability.d.ts +62 -0
- package/resources/networking/vpcs/availability.d.ts.map +1 -0
- package/resources/networking/vpcs/availability.js +40 -0
- package/resources/networking/vpcs/availability.js.map +1 -0
- package/resources/networking/vpcs/availability.mjs +36 -0
- package/resources/networking/vpcs/availability.mjs.map +1 -0
- package/resources/networking/vpcs/index.d.mts +3 -0
- package/resources/networking/vpcs/index.d.mts.map +1 -0
- package/resources/networking/vpcs/index.d.ts +3 -0
- package/resources/networking/vpcs/index.d.ts.map +1 -0
- package/resources/networking/vpcs/index.js +9 -0
- package/resources/networking/vpcs/index.js.map +1 -0
- package/resources/networking/vpcs/index.mjs +4 -0
- package/resources/networking/vpcs/index.mjs.map +1 -0
- package/resources/networking/vpcs/vpcs.d.mts +157 -0
- package/resources/networking/vpcs/vpcs.d.mts.map +1 -0
- package/resources/networking/vpcs/vpcs.d.ts +157 -0
- package/resources/networking/vpcs/vpcs.d.ts.map +1 -0
- package/resources/networking/vpcs/vpcs.js +81 -0
- package/resources/networking/vpcs/vpcs.js.map +1 -0
- package/resources/networking/vpcs/vpcs.mjs +76 -0
- package/resources/networking/vpcs/vpcs.mjs.map +1 -0
- package/resources/networking/vpcs.d.mts +1 -152
- package/resources/networking/vpcs.d.mts.map +1 -1
- package/resources/networking/vpcs.d.ts +1 -152
- package/resources/networking/vpcs.d.ts.map +1 -1
- package/resources/networking/vpcs.js +2 -69
- package/resources/networking/vpcs.js.map +1 -1
- package/resources/networking/vpcs.mjs +1 -67
- package/resources/networking/vpcs.mjs.map +1 -1
- package/src/resources/compute/compute.ts +10 -10
- package/src/resources/compute/index.ts +1 -1
- package/src/resources/compute/vms/availability.ts +172 -0
- package/src/resources/compute/vms/index.ts +7 -0
- package/src/resources/compute/vms/vms.ts +19 -1
- package/src/resources/compute/vms/volumes.ts +1 -1
- package/src/resources/compute/volumes/availability.ts +91 -0
- package/src/resources/compute/volumes/index.ts +18 -0
- package/src/resources/compute/volumes/volumes.ts +213 -0
- package/src/resources/compute/volumes.ts +1 -191
- package/src/resources/networking/index.ts +1 -1
- package/src/resources/networking/networking.ts +2 -2
- package/src/resources/networking/vpcs/availability.ts +83 -0
- package/src/resources/networking/vpcs/index.ts +17 -0
- package/src/resources/networking/vpcs/vpcs.ts +220 -0
- package/src/resources/networking/vpcs.ts +1 -198
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Availability extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Check Volume Create Availability
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const availability =
|
|
16
|
+
* await client.compute.volumes.availability.create({
|
|
17
|
+
* name: 'my-data-volume',
|
|
18
|
+
* size: 100,
|
|
19
|
+
* vm_id: 'vm_id',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body: AvailabilityCreateParams, options?: RequestOptions): APIPromise<string> {
|
|
24
|
+
return this._client.post('/v1/compute/volumes/availability', {
|
|
25
|
+
body,
|
|
26
|
+
...options,
|
|
27
|
+
headers: buildHeaders([{ Accept: 'text/plain' }, options?.headers]),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Check Volume Update Availability
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const availability =
|
|
37
|
+
* await client.compute.volumes.availability.update(
|
|
38
|
+
* 'volume_id',
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
update(volumeID: string, body: AvailabilityUpdateParams, options?: RequestOptions): APIPromise<string> {
|
|
43
|
+
return this._client.patch(path`/v1/compute/volumes/${volumeID}/availability`, {
|
|
44
|
+
body,
|
|
45
|
+
...options,
|
|
46
|
+
headers: buildHeaders([{ Accept: 'text/plain' }, options?.headers]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type AvailabilityCreateResponse = string;
|
|
52
|
+
|
|
53
|
+
export type AvailabilityUpdateResponse = string;
|
|
54
|
+
|
|
55
|
+
export interface AvailabilityCreateParams {
|
|
56
|
+
/**
|
|
57
|
+
* Name of the volume.
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Size of the volume in GB.
|
|
63
|
+
*/
|
|
64
|
+
size: number;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* ID of the VM the volume is attached to.
|
|
68
|
+
*/
|
|
69
|
+
vm_id: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface AvailabilityUpdateParams {
|
|
73
|
+
/**
|
|
74
|
+
* Name of the volume.
|
|
75
|
+
*/
|
|
76
|
+
name?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Size of the volume in GB.
|
|
80
|
+
*/
|
|
81
|
+
size?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare namespace Availability {
|
|
85
|
+
export {
|
|
86
|
+
type AvailabilityCreateResponse as AvailabilityCreateResponse,
|
|
87
|
+
type AvailabilityUpdateResponse as AvailabilityUpdateResponse,
|
|
88
|
+
type AvailabilityCreateParams as AvailabilityCreateParams,
|
|
89
|
+
type AvailabilityUpdateParams as AvailabilityUpdateParams,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Availability,
|
|
5
|
+
type AvailabilityCreateResponse,
|
|
6
|
+
type AvailabilityUpdateResponse,
|
|
7
|
+
type AvailabilityCreateParams,
|
|
8
|
+
type AvailabilityUpdateParams,
|
|
9
|
+
} from './availability';
|
|
10
|
+
export {
|
|
11
|
+
Volumes,
|
|
12
|
+
type StorageType,
|
|
13
|
+
type Volume,
|
|
14
|
+
type VolumeKind,
|
|
15
|
+
type VolumeList,
|
|
16
|
+
type VolumeCreateParams,
|
|
17
|
+
type VolumeUpdateParams,
|
|
18
|
+
} from './volumes';
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as OperationsAPI from '../../operations';
|
|
5
|
+
import * as Shared from '../../shared';
|
|
6
|
+
import * as AvailabilityAPI from './availability';
|
|
7
|
+
import {
|
|
8
|
+
Availability,
|
|
9
|
+
AvailabilityCreateParams,
|
|
10
|
+
AvailabilityCreateResponse,
|
|
11
|
+
AvailabilityUpdateParams,
|
|
12
|
+
AvailabilityUpdateResponse,
|
|
13
|
+
} from './availability';
|
|
14
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
15
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
16
|
+
import { path } from '../../../internal/utils/path';
|
|
17
|
+
|
|
18
|
+
export class Volumes extends APIResource {
|
|
19
|
+
availability: AvailabilityAPI.Availability = new AvailabilityAPI.Availability(this._client);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Create a Volume. Only data volumes can be created.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const operation = await client.compute.volumes.create({
|
|
27
|
+
* name: 'my-data-volume',
|
|
28
|
+
* size: 100,
|
|
29
|
+
* vm_id: 'vm_id',
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
create(body: VolumeCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
34
|
+
return this._client.post('/v1/compute/volumes', { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Update a Volume. Boot or data volumes can be updated.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const operation = await client.compute.volumes.update(
|
|
43
|
+
* 'volume_id',
|
|
44
|
+
* );
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
update(
|
|
48
|
+
volumeID: string,
|
|
49
|
+
body: VolumeUpdateParams,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
52
|
+
return this._client.patch(path`/v1/compute/volumes/${volumeID}`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* List all volumes
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const volumeList = await client.compute.volumes.list();
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
list(options?: RequestOptions): APIPromise<VolumeList> {
|
|
64
|
+
return this._client.get('/v1/compute/volumes', options);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Delete a Volume. Boot or data volumes can be deleted.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const operation = await client.compute.volumes.delete(
|
|
73
|
+
* 'volume_id',
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
delete(volumeID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
78
|
+
return this._client.delete(path`/v1/compute/volumes/${volumeID}`, options);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Get a Volume.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const volume = await client.compute.volumes.get(
|
|
87
|
+
* 'volume_id',
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
get(volumeID: string, options?: RequestOptions): APIPromise<Volume> {
|
|
92
|
+
return this._client.get(path`/v1/compute/volumes/${volumeID}`, options);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Storage type the volume is using.
|
|
98
|
+
*/
|
|
99
|
+
export type StorageType = 'nvme';
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Volume details.
|
|
103
|
+
*/
|
|
104
|
+
export interface Volume {
|
|
105
|
+
/**
|
|
106
|
+
* Unique identifier for the volume.
|
|
107
|
+
*/
|
|
108
|
+
id: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* When the volume was created.
|
|
112
|
+
*/
|
|
113
|
+
created_at: string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Volume kind.
|
|
117
|
+
*/
|
|
118
|
+
kind: VolumeKind;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Name of the volume.
|
|
122
|
+
*/
|
|
123
|
+
name: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Size of the volume in GB.
|
|
127
|
+
*/
|
|
128
|
+
size: number;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Status of the resource.
|
|
132
|
+
*/
|
|
133
|
+
status: Shared.ResourceStatus;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Storage type the volume is using.
|
|
137
|
+
*/
|
|
138
|
+
type: StorageType;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* When the volume was updated.
|
|
142
|
+
*/
|
|
143
|
+
updated_at: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* ID of the VM the volume is attached to.
|
|
147
|
+
*/
|
|
148
|
+
vm_id: string | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Name of the VM the volume is attached to.
|
|
152
|
+
*/
|
|
153
|
+
vm_name: string | null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Volume kind.
|
|
158
|
+
*/
|
|
159
|
+
export type VolumeKind = 'boot' | 'data';
|
|
160
|
+
|
|
161
|
+
export interface VolumeList {
|
|
162
|
+
items: Array<Volume>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface VolumeCreateParams {
|
|
166
|
+
/**
|
|
167
|
+
* Name of the volume.
|
|
168
|
+
*/
|
|
169
|
+
name: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Size of the volume in GB.
|
|
173
|
+
*/
|
|
174
|
+
size: number;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* ID of the VM the volume is attached to.
|
|
178
|
+
*/
|
|
179
|
+
vm_id: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface VolumeUpdateParams {
|
|
183
|
+
/**
|
|
184
|
+
* Name of the volume.
|
|
185
|
+
*/
|
|
186
|
+
name?: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Size of the volume in GB.
|
|
190
|
+
*/
|
|
191
|
+
size?: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
Volumes.Availability = Availability;
|
|
195
|
+
|
|
196
|
+
export declare namespace Volumes {
|
|
197
|
+
export {
|
|
198
|
+
type StorageType as StorageType,
|
|
199
|
+
type Volume as Volume,
|
|
200
|
+
type VolumeKind as VolumeKind,
|
|
201
|
+
type VolumeList as VolumeList,
|
|
202
|
+
type VolumeCreateParams as VolumeCreateParams,
|
|
203
|
+
type VolumeUpdateParams as VolumeUpdateParams,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export {
|
|
207
|
+
Availability as Availability,
|
|
208
|
+
type AvailabilityCreateResponse as AvailabilityCreateResponse,
|
|
209
|
+
type AvailabilityUpdateResponse as AvailabilityUpdateResponse,
|
|
210
|
+
type AvailabilityCreateParams as AvailabilityCreateParams,
|
|
211
|
+
type AvailabilityUpdateParams as AvailabilityUpdateParams,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
@@ -1,193 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import * as OperationsAPI from '../operations';
|
|
5
|
-
import * as Shared from '../shared';
|
|
6
|
-
import { APIPromise } from '../../core/api-promise';
|
|
7
|
-
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
-
import { path } from '../../internal/utils/path';
|
|
9
|
-
|
|
10
|
-
export class Volumes extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Create a Volume. Only data volumes can be created.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const operation = await client.compute.volumes.create({
|
|
17
|
-
* name: 'my-data-volume',
|
|
18
|
-
* size: 100,
|
|
19
|
-
* vm_id: 'vm_id',
|
|
20
|
-
* });
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
create(body: VolumeCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
24
|
-
return this._client.post('/v1/compute/volumes', { body, ...options });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Update a Volume. Boot or data volumes can be updated.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* const operation = await client.compute.volumes.update(
|
|
33
|
-
* 'volume_id',
|
|
34
|
-
* );
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
update(
|
|
38
|
-
volumeID: string,
|
|
39
|
-
body: VolumeUpdateParams,
|
|
40
|
-
options?: RequestOptions,
|
|
41
|
-
): APIPromise<OperationsAPI.Operation> {
|
|
42
|
-
return this._client.patch(path`/v1/compute/volumes/${volumeID}`, { body, ...options });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* List all volumes
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* const volumeList = await client.compute.volumes.list();
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
list(options?: RequestOptions): APIPromise<VolumeList> {
|
|
54
|
-
return this._client.get('/v1/compute/volumes', options);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Delete a Volume. Boot or data volumes can be deleted.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const operation = await client.compute.volumes.delete(
|
|
63
|
-
* 'volume_id',
|
|
64
|
-
* );
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
delete(volumeID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
68
|
-
return this._client.delete(path`/v1/compute/volumes/${volumeID}`, options);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Get a Volume.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* const volume = await client.compute.volumes.get(
|
|
77
|
-
* 'volume_id',
|
|
78
|
-
* );
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
get(volumeID: string, options?: RequestOptions): APIPromise<Volume> {
|
|
82
|
-
return this._client.get(path`/v1/compute/volumes/${volumeID}`, options);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Storage type the volume is using.
|
|
88
|
-
*/
|
|
89
|
-
export type StorageType = 'nvme';
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Volume details.
|
|
93
|
-
*/
|
|
94
|
-
export interface Volume {
|
|
95
|
-
/**
|
|
96
|
-
* Unique identifier for the volume.
|
|
97
|
-
*/
|
|
98
|
-
id: string;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* When the volume was created.
|
|
102
|
-
*/
|
|
103
|
-
created_at: string;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Volume kind.
|
|
107
|
-
*/
|
|
108
|
-
kind: VolumeKind;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Name of the volume.
|
|
112
|
-
*/
|
|
113
|
-
name: string;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Size of the volume in GB.
|
|
117
|
-
*/
|
|
118
|
-
size: number;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Status of the resource.
|
|
122
|
-
*/
|
|
123
|
-
status: Shared.ResourceStatus;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Storage type the volume is using.
|
|
127
|
-
*/
|
|
128
|
-
type: StorageType;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* When the volume was updated.
|
|
132
|
-
*/
|
|
133
|
-
updated_at: string;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* ID of the VM the volume is attached to.
|
|
137
|
-
*/
|
|
138
|
-
vm_id: string | null;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Name of the VM the volume is attached to.
|
|
142
|
-
*/
|
|
143
|
-
vm_name: string | null;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Volume kind.
|
|
148
|
-
*/
|
|
149
|
-
export type VolumeKind = 'boot' | 'data';
|
|
150
|
-
|
|
151
|
-
export interface VolumeList {
|
|
152
|
-
items: Array<Volume>;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export interface VolumeCreateParams {
|
|
156
|
-
/**
|
|
157
|
-
* Name of the volume.
|
|
158
|
-
*/
|
|
159
|
-
name: string;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Size of the volume in GB.
|
|
163
|
-
*/
|
|
164
|
-
size: number;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* ID of the VM the volume is attached to.
|
|
168
|
-
*/
|
|
169
|
-
vm_id: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface VolumeUpdateParams {
|
|
173
|
-
/**
|
|
174
|
-
* Name of the volume.
|
|
175
|
-
*/
|
|
176
|
-
name?: string;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Size of the volume in GB.
|
|
180
|
-
*/
|
|
181
|
-
size?: number;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export declare namespace Volumes {
|
|
185
|
-
export {
|
|
186
|
-
type StorageType as StorageType,
|
|
187
|
-
type Volume as Volume,
|
|
188
|
-
type VolumeKind as VolumeKind,
|
|
189
|
-
type VolumeList as VolumeList,
|
|
190
|
-
type VolumeCreateParams as VolumeCreateParams,
|
|
191
|
-
type VolumeUpdateParams as VolumeUpdateParams,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
3
|
+
export * from './volumes/index';
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
FirewallRuleUpdateParams,
|
|
12
12
|
FirewallRules,
|
|
13
13
|
} from './firewall-rules';
|
|
14
|
-
import * as VPCsAPI from './vpcs';
|
|
15
|
-
import { Subnet, VPC, VPCCreateParams, VPCList, VPCUpdateParams, VPCs } from './vpcs';
|
|
14
|
+
import * as VPCsAPI from './vpcs/vpcs';
|
|
15
|
+
import { Subnet, VPC, VPCCreateParams, VPCList, VPCUpdateParams, VPCs } from './vpcs/vpcs';
|
|
16
16
|
|
|
17
17
|
export class Networking extends APIResource {
|
|
18
18
|
vpcs: VPCsAPI.VPCs = new VPCsAPI.VPCs(this._client);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
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 Availability extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Check if a VPC can be created
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const availability =
|
|
16
|
+
* await client.networking.vpcs.availability.create({
|
|
17
|
+
* name: 'my-vpc',
|
|
18
|
+
* region: 'us-wdc-1',
|
|
19
|
+
* subnet_name: 'my-subnet',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body: AvailabilityCreateParams, options?: RequestOptions): APIPromise<unknown> {
|
|
24
|
+
return this._client.post('/v1/networking/vpcs/availability', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Check if a VPC can be updated
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const availability =
|
|
33
|
+
* await client.networking.vpcs.availability.update(
|
|
34
|
+
* 'vpc_id',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
update(vpcID: string, body: AvailabilityUpdateParams, options?: RequestOptions): APIPromise<unknown> {
|
|
39
|
+
return this._client.patch(path`/v1/networking/vpcs/${vpcID}/availability`, { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type AvailabilityCreateResponse = unknown;
|
|
44
|
+
|
|
45
|
+
export type AvailabilityUpdateResponse = unknown;
|
|
46
|
+
|
|
47
|
+
export interface AvailabilityCreateParams {
|
|
48
|
+
/**
|
|
49
|
+
* Name of the VPC.
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Region the resource is in.
|
|
55
|
+
*/
|
|
56
|
+
region: Shared.RegionName;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Name of the subnet to create.
|
|
60
|
+
*/
|
|
61
|
+
subnet_name: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface AvailabilityUpdateParams {
|
|
65
|
+
/**
|
|
66
|
+
* Name of the VPC.
|
|
67
|
+
*/
|
|
68
|
+
name?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Name of the subnet to create.
|
|
72
|
+
*/
|
|
73
|
+
subnet_name?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export declare namespace Availability {
|
|
77
|
+
export {
|
|
78
|
+
type AvailabilityCreateResponse as AvailabilityCreateResponse,
|
|
79
|
+
type AvailabilityUpdateResponse as AvailabilityUpdateResponse,
|
|
80
|
+
type AvailabilityCreateParams as AvailabilityCreateParams,
|
|
81
|
+
type AvailabilityUpdateParams as AvailabilityUpdateParams,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Availability,
|
|
5
|
+
type AvailabilityCreateResponse,
|
|
6
|
+
type AvailabilityUpdateResponse,
|
|
7
|
+
type AvailabilityCreateParams,
|
|
8
|
+
type AvailabilityUpdateParams,
|
|
9
|
+
} from './availability';
|
|
10
|
+
export {
|
|
11
|
+
VPCs,
|
|
12
|
+
type Subnet,
|
|
13
|
+
type VPC,
|
|
14
|
+
type VPCList,
|
|
15
|
+
type VPCCreateParams,
|
|
16
|
+
type VPCUpdateParams,
|
|
17
|
+
} from './vpcs';
|