@nirvana-labs/nirvana 1.1.1 → 1.2.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 +25 -0
- package/README.md +7 -12
- package/package.json +1 -4
- 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/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/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
|
@@ -1,146 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as OperationsAPI from "../operations.js";
|
|
3
|
-
import * as Shared from "../shared.js";
|
|
4
|
-
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
-
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
-
export declare class Volumes extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Create a Volume. Only data volumes can be created.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const operation = await client.compute.volumes.create({
|
|
13
|
-
* name: 'my-data-volume',
|
|
14
|
-
* size: 100,
|
|
15
|
-
* vm_id: 'vm_id',
|
|
16
|
-
* });
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
create(body: VolumeCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
20
|
-
/**
|
|
21
|
-
* Update a Volume. Boot or data volumes can be updated.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const operation = await client.compute.volumes.update(
|
|
26
|
-
* 'volume_id',
|
|
27
|
-
* );
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
update(volumeID: string, body: VolumeUpdateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
31
|
-
/**
|
|
32
|
-
* List all volumes
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const volumeList = await client.compute.volumes.list();
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
list(options?: RequestOptions): APIPromise<VolumeList>;
|
|
40
|
-
/**
|
|
41
|
-
* Delete a Volume. Boot or data volumes can be deleted.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const operation = await client.compute.volumes.delete(
|
|
46
|
-
* 'volume_id',
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
delete(volumeID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
51
|
-
/**
|
|
52
|
-
* Get a Volume.
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```ts
|
|
56
|
-
* const volume = await client.compute.volumes.get(
|
|
57
|
-
* 'volume_id',
|
|
58
|
-
* );
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
get(volumeID: string, options?: RequestOptions): APIPromise<Volume>;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Storage type the volume is using.
|
|
65
|
-
*/
|
|
66
|
-
export type StorageType = 'nvme';
|
|
67
|
-
/**
|
|
68
|
-
* Volume details.
|
|
69
|
-
*/
|
|
70
|
-
export interface Volume {
|
|
71
|
-
/**
|
|
72
|
-
* Unique identifier for the volume.
|
|
73
|
-
*/
|
|
74
|
-
id: string;
|
|
75
|
-
/**
|
|
76
|
-
* When the volume was created.
|
|
77
|
-
*/
|
|
78
|
-
created_at: string;
|
|
79
|
-
/**
|
|
80
|
-
* Volume kind.
|
|
81
|
-
*/
|
|
82
|
-
kind: VolumeKind;
|
|
83
|
-
/**
|
|
84
|
-
* Name of the volume.
|
|
85
|
-
*/
|
|
86
|
-
name: string;
|
|
87
|
-
/**
|
|
88
|
-
* Size of the volume in GB.
|
|
89
|
-
*/
|
|
90
|
-
size: number;
|
|
91
|
-
/**
|
|
92
|
-
* Status of the resource.
|
|
93
|
-
*/
|
|
94
|
-
status: Shared.ResourceStatus;
|
|
95
|
-
/**
|
|
96
|
-
* Storage type the volume is using.
|
|
97
|
-
*/
|
|
98
|
-
type: StorageType;
|
|
99
|
-
/**
|
|
100
|
-
* When the volume was updated.
|
|
101
|
-
*/
|
|
102
|
-
updated_at: string;
|
|
103
|
-
/**
|
|
104
|
-
* ID of the VM the volume is attached to.
|
|
105
|
-
*/
|
|
106
|
-
vm_id: string | null;
|
|
107
|
-
/**
|
|
108
|
-
* Name of the VM the volume is attached to.
|
|
109
|
-
*/
|
|
110
|
-
vm_name: string | null;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Volume kind.
|
|
114
|
-
*/
|
|
115
|
-
export type VolumeKind = 'boot' | 'data';
|
|
116
|
-
export interface VolumeList {
|
|
117
|
-
items: Array<Volume>;
|
|
118
|
-
}
|
|
119
|
-
export interface VolumeCreateParams {
|
|
120
|
-
/**
|
|
121
|
-
* Name of the volume.
|
|
122
|
-
*/
|
|
123
|
-
name: string;
|
|
124
|
-
/**
|
|
125
|
-
* Size of the volume in GB.
|
|
126
|
-
*/
|
|
127
|
-
size: number;
|
|
128
|
-
/**
|
|
129
|
-
* ID of the VM the volume is attached to.
|
|
130
|
-
*/
|
|
131
|
-
vm_id: string;
|
|
132
|
-
}
|
|
133
|
-
export interface VolumeUpdateParams {
|
|
134
|
-
/**
|
|
135
|
-
* Name of the volume.
|
|
136
|
-
*/
|
|
137
|
-
name?: string;
|
|
138
|
-
/**
|
|
139
|
-
* Size of the volume in GB.
|
|
140
|
-
*/
|
|
141
|
-
size?: number;
|
|
142
|
-
}
|
|
143
|
-
export declare namespace Volumes {
|
|
144
|
-
export { type StorageType as StorageType, type Volume as Volume, type VolumeKind as VolumeKind, type VolumeList as VolumeList, type VolumeCreateParams as VolumeCreateParams, type VolumeUpdateParams as VolumeUpdateParams, };
|
|
145
|
-
}
|
|
1
|
+
export * from "./volumes/index.js";
|
|
146
2
|
//# sourceMappingURL=volumes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumes.d.ts","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"volumes.d.ts","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":""}
|
|
@@ -1,75 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
-
class Volumes extends resource_1.APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Create a Volume. Only data volumes can be created.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const operation = await client.compute.volumes.create({
|
|
14
|
-
* name: 'my-data-volume',
|
|
15
|
-
* size: 100,
|
|
16
|
-
* vm_id: 'vm_id',
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
create(body, options) {
|
|
21
|
-
return this._client.post('/v1/compute/volumes', { body, ...options });
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Update a Volume. Boot or data volumes can be updated.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const operation = await client.compute.volumes.update(
|
|
29
|
-
* 'volume_id',
|
|
30
|
-
* );
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
update(volumeID, body, options) {
|
|
34
|
-
return this._client.patch((0, path_1.path) `/v1/compute/volumes/${volumeID}`, { body, ...options });
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* List all volumes
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```ts
|
|
41
|
-
* const volumeList = await client.compute.volumes.list();
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
list(options) {
|
|
45
|
-
return this._client.get('/v1/compute/volumes', options);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Delete a Volume. Boot or data volumes can be deleted.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* const operation = await client.compute.volumes.delete(
|
|
53
|
-
* 'volume_id',
|
|
54
|
-
* );
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
delete(volumeID, options) {
|
|
58
|
-
return this._client.delete((0, path_1.path) `/v1/compute/volumes/${volumeID}`, options);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get a Volume.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```ts
|
|
65
|
-
* const volume = await client.compute.volumes.get(
|
|
66
|
-
* 'volume_id',
|
|
67
|
-
* );
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
get(volumeID, options) {
|
|
71
|
-
return this._client.get((0, path_1.path) `/v1/compute/volumes/${volumeID}`, options);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.Volumes = Volumes;
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./volumes/index.js"), exports);
|
|
75
6
|
//# sourceMappingURL=volumes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumes.js","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"volumes.js","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
|
|
@@ -1,71 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
-
export class Volumes extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Create a Volume. Only data volumes can be created.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* const operation = await client.compute.volumes.create({
|
|
11
|
-
* name: 'my-data-volume',
|
|
12
|
-
* size: 100,
|
|
13
|
-
* vm_id: 'vm_id',
|
|
14
|
-
* });
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
create(body, options) {
|
|
18
|
-
return this._client.post('/v1/compute/volumes', { body, ...options });
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Update a Volume. Boot or data volumes can be updated.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const operation = await client.compute.volumes.update(
|
|
26
|
-
* 'volume_id',
|
|
27
|
-
* );
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
update(volumeID, body, options) {
|
|
31
|
-
return this._client.patch(path `/v1/compute/volumes/${volumeID}`, { body, ...options });
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* List all volumes
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```ts
|
|
38
|
-
* const volumeList = await client.compute.volumes.list();
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
list(options) {
|
|
42
|
-
return this._client.get('/v1/compute/volumes', options);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Delete a Volume. Boot or data volumes can be deleted.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const operation = await client.compute.volumes.delete(
|
|
50
|
-
* 'volume_id',
|
|
51
|
-
* );
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
delete(volumeID, options) {
|
|
55
|
-
return this._client.delete(path `/v1/compute/volumes/${volumeID}`, options);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get a Volume.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* const volume = await client.compute.volumes.get(
|
|
63
|
-
* 'volume_id',
|
|
64
|
-
* );
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
get(volumeID, options) {
|
|
68
|
-
return this._client.get(path `/v1/compute/volumes/${volumeID}`, options);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
2
|
+
export * from "./volumes/index.mjs";
|
|
71
3
|
//# sourceMappingURL=volumes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volumes.mjs","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"volumes.mjs","sourceRoot":"","sources":["../../src/resources/compute/volumes.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as VolumesAPI from './volumes';
|
|
5
|
-
import {
|
|
6
|
-
StorageType,
|
|
7
|
-
Volume,
|
|
8
|
-
VolumeCreateParams,
|
|
9
|
-
VolumeKind,
|
|
10
|
-
VolumeList,
|
|
11
|
-
VolumeUpdateParams,
|
|
12
|
-
Volumes,
|
|
13
|
-
} from './volumes';
|
|
14
4
|
import * as VMsAPI from './vms/vms';
|
|
15
5
|
import {
|
|
16
6
|
CPUConfig,
|
|
@@ -23,6 +13,16 @@ import {
|
|
|
23
13
|
VMUpdateParams,
|
|
24
14
|
VMs,
|
|
25
15
|
} from './vms/vms';
|
|
16
|
+
import * as VolumesAPI from './volumes/volumes';
|
|
17
|
+
import {
|
|
18
|
+
StorageType,
|
|
19
|
+
Volume,
|
|
20
|
+
VolumeCreateParams,
|
|
21
|
+
VolumeKind,
|
|
22
|
+
VolumeList,
|
|
23
|
+
VolumeUpdateParams,
|
|
24
|
+
Volumes,
|
|
25
|
+
} from './volumes/volumes';
|
|
26
26
|
|
|
27
27
|
export class Compute extends APIResource {
|
|
28
28
|
vms: VMsAPI.VMs = new VMsAPI.VMs(this._client);
|
|
@@ -0,0 +1,172 @@
|
|
|
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 * as VMsAPI from './vms';
|
|
6
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
7
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
9
|
+
import { path } from '../../../internal/utils/path';
|
|
10
|
+
|
|
11
|
+
export class Availability extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Check VM Create Availability
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const availability =
|
|
18
|
+
* await client.compute.vms.availability.create({
|
|
19
|
+
* boot_volume: { size: 100 },
|
|
20
|
+
* cpu_config: { vcpu: 2 },
|
|
21
|
+
* memory_config: { size: 2 },
|
|
22
|
+
* name: 'my-vm',
|
|
23
|
+
* os_image_name: 'ubuntu-noble-2025-04-03',
|
|
24
|
+
* public_ip_enabled: true,
|
|
25
|
+
* region: 'us-wdc-1',
|
|
26
|
+
* ssh_key: {
|
|
27
|
+
* public_key:
|
|
28
|
+
* 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',
|
|
29
|
+
* },
|
|
30
|
+
* subnet_id: '123e4567-e89b-12d3-a456-426614174000',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
create(body: AvailabilityCreateParams, options?: RequestOptions): APIPromise<string> {
|
|
35
|
+
return this._client.post('/v1/compute/vms/availability', {
|
|
36
|
+
body,
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([{ Accept: 'text/plain' }, options?.headers]),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check VM Update Availability
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const availability =
|
|
48
|
+
* await client.compute.vms.availability.update('vm_id');
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
update(vmID: string, body: AvailabilityUpdateParams, options?: RequestOptions): APIPromise<string> {
|
|
52
|
+
return this._client.patch(path`/v1/compute/vms/${vmID}/availability`, {
|
|
53
|
+
body,
|
|
54
|
+
...options,
|
|
55
|
+
headers: buildHeaders([{ Accept: 'text/plain' }, options?.headers]),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type AvailabilityCreateResponse = string;
|
|
61
|
+
|
|
62
|
+
export type AvailabilityUpdateResponse = string;
|
|
63
|
+
|
|
64
|
+
export interface AvailabilityCreateParams {
|
|
65
|
+
/**
|
|
66
|
+
* Boot volume for the VM.
|
|
67
|
+
*/
|
|
68
|
+
boot_volume: AvailabilityCreateParams.BootVolume;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* CPU configuration for the VM.
|
|
72
|
+
*/
|
|
73
|
+
cpu_config: VMsAPI.CPUConfig;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Memory configuration for the VM.
|
|
77
|
+
*/
|
|
78
|
+
memory_config: VMsAPI.MemoryConfig;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Name of the VM.
|
|
82
|
+
*/
|
|
83
|
+
name: string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Name of the OS Image to use for the VM.
|
|
87
|
+
*/
|
|
88
|
+
os_image_name: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Whether to enable public IP for the VM.
|
|
92
|
+
*/
|
|
93
|
+
public_ip_enabled: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Region the resource is in.
|
|
97
|
+
*/
|
|
98
|
+
region: Shared.RegionName;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Public SSH key configuration for the VM.
|
|
102
|
+
*/
|
|
103
|
+
ssh_key: VMsAPI.SSHKey;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* ID of the subnet to use for the VM.
|
|
107
|
+
*/
|
|
108
|
+
subnet_id: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Data volumes for the VM.
|
|
112
|
+
*/
|
|
113
|
+
data_volumes?: Array<AvailabilityCreateParams.DataVolume>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export namespace AvailabilityCreateParams {
|
|
117
|
+
/**
|
|
118
|
+
* Boot volume for the VM.
|
|
119
|
+
*/
|
|
120
|
+
export interface BootVolume {
|
|
121
|
+
/**
|
|
122
|
+
* Size of the volume in GB.
|
|
123
|
+
*/
|
|
124
|
+
size: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* VM data volume create request.
|
|
129
|
+
*/
|
|
130
|
+
export interface DataVolume {
|
|
131
|
+
/**
|
|
132
|
+
* Name of the volume.
|
|
133
|
+
*/
|
|
134
|
+
name: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Size of the volume in GB.
|
|
138
|
+
*/
|
|
139
|
+
size: number;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface AvailabilityUpdateParams {
|
|
144
|
+
/**
|
|
145
|
+
* CPU configuration for the VM.
|
|
146
|
+
*/
|
|
147
|
+
cpu_config?: VMsAPI.CPUConfig;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Memory configuration for the VM.
|
|
151
|
+
*/
|
|
152
|
+
memory_config?: VMsAPI.MemoryConfig;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Name of the VM.
|
|
156
|
+
*/
|
|
157
|
+
name?: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Whether to enable public IP for the VM.
|
|
161
|
+
*/
|
|
162
|
+
public_ip_enabled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare namespace Availability {
|
|
166
|
+
export {
|
|
167
|
+
type AvailabilityCreateResponse as AvailabilityCreateResponse,
|
|
168
|
+
type AvailabilityUpdateResponse as AvailabilityUpdateResponse,
|
|
169
|
+
type AvailabilityCreateParams as AvailabilityCreateParams,
|
|
170
|
+
type AvailabilityUpdateParams as AvailabilityUpdateParams,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export {
|
|
4
|
+
Availability,
|
|
5
|
+
type AvailabilityCreateResponse,
|
|
6
|
+
type AvailabilityUpdateResponse,
|
|
7
|
+
type AvailabilityCreateParams,
|
|
8
|
+
type AvailabilityUpdateParams,
|
|
9
|
+
} from './availability';
|
|
3
10
|
export { OSImages, type OSImageListResponse } from './os-images';
|
|
4
11
|
export {
|
|
5
12
|
VMs,
|
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as OperationsAPI from '../../operations';
|
|
5
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';
|
|
6
14
|
import * as OSImagesAPI from './os-images';
|
|
7
15
|
import { OSImageListResponse, OSImages } from './os-images';
|
|
8
16
|
import * as VolumesAPI from './volumes';
|
|
@@ -12,6 +20,7 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
12
20
|
import { path } from '../../../internal/utils/path';
|
|
13
21
|
|
|
14
22
|
export class VMs extends APIResource {
|
|
23
|
+
availability: AvailabilityAPI.Availability = new AvailabilityAPI.Availability(this._client);
|
|
15
24
|
volumes: VolumesAPI.Volumes = new VolumesAPI.Volumes(this._client);
|
|
16
25
|
osImages: OSImagesAPI.OSImages = new OSImagesAPI.OSImages(this._client);
|
|
17
26
|
|
|
@@ -30,7 +39,7 @@ export class VMs extends APIResource {
|
|
|
30
39
|
* region: 'us-wdc-1',
|
|
31
40
|
* ssh_key: {
|
|
32
41
|
* public_key:
|
|
33
|
-
* 'ssh-
|
|
42
|
+
* 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2',
|
|
34
43
|
* },
|
|
35
44
|
* subnet_id: '123e4567-e89b-12d3-a456-426614174000',
|
|
36
45
|
* });
|
|
@@ -324,6 +333,7 @@ export interface VMUpdateParams {
|
|
|
324
333
|
public_ip_enabled?: boolean;
|
|
325
334
|
}
|
|
326
335
|
|
|
336
|
+
VMs.Availability = Availability;
|
|
327
337
|
VMs.Volumes = Volumes;
|
|
328
338
|
VMs.OSImages = OSImages;
|
|
329
339
|
|
|
@@ -339,6 +349,14 @@ export declare namespace VMs {
|
|
|
339
349
|
type VMUpdateParams as VMUpdateParams,
|
|
340
350
|
};
|
|
341
351
|
|
|
352
|
+
export {
|
|
353
|
+
Availability as Availability,
|
|
354
|
+
type AvailabilityCreateResponse as AvailabilityCreateResponse,
|
|
355
|
+
type AvailabilityUpdateResponse as AvailabilityUpdateResponse,
|
|
356
|
+
type AvailabilityCreateParams as AvailabilityCreateParams,
|
|
357
|
+
type AvailabilityUpdateParams as AvailabilityUpdateParams,
|
|
358
|
+
};
|
|
359
|
+
|
|
342
360
|
export { Volumes as Volumes };
|
|
343
361
|
|
|
344
362
|
export { OSImages as OSImages, type OSImageListResponse as OSImageListResponse };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as VolumesAPI from '../volumes';
|
|
4
|
+
import * as VolumesAPI from '../volumes/volumes';
|
|
5
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
7
|
import { path } from '../../../internal/utils/path';
|
|
@@ -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
|
+
}
|