@gpuai/sdk 0.5.4 → 0.5.6
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/.openapi-generator/FILES +56 -0
- package/README.md +50 -2
- package/dist/apis/EndpointsApi.d.ts +150 -0
- package/dist/apis/EndpointsApi.js +379 -0
- package/dist/apis/InstancesApi.d.ts +15 -0
- package/dist/apis/InstancesApi.js +45 -0
- package/dist/apis/JobsApi.d.ts +172 -0
- package/dist/apis/JobsApi.js +444 -0
- package/dist/apis/OperationsApi.d.ts +17 -0
- package/dist/apis/OperationsApi.js +48 -0
- package/dist/apis/SecretsApi.d.ts +123 -0
- package/dist/apis/SecretsApi.js +328 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/EndpointsApi.d.ts +150 -0
- package/dist/esm/apis/EndpointsApi.js +375 -0
- package/dist/esm/apis/InstancesApi.d.ts +15 -0
- package/dist/esm/apis/InstancesApi.js +45 -0
- package/dist/esm/apis/JobsApi.d.ts +172 -0
- package/dist/esm/apis/JobsApi.js +440 -0
- package/dist/esm/apis/OperationsApi.d.ts +17 -0
- package/dist/esm/apis/OperationsApi.js +48 -0
- package/dist/esm/apis/SecretsApi.d.ts +123 -0
- package/dist/esm/apis/SecretsApi.js +324 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
- package/dist/esm/models/DedicatedIPOffer.js +87 -0
- package/dist/esm/models/Endpoint.d.ts +147 -0
- package/dist/esm/models/Endpoint.js +121 -0
- package/dist/esm/models/EndpointCreate.d.ts +80 -0
- package/dist/esm/models/EndpointCreate.js +63 -0
- package/dist/esm/models/EndpointList.d.ts +33 -0
- package/dist/esm/models/EndpointList.js +44 -0
- package/dist/esm/models/EndpointMachine.d.ts +90 -0
- package/dist/esm/models/EndpointMachine.js +84 -0
- package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
- package/dist/esm/models/EndpointReplicaCounts.js +47 -0
- package/dist/esm/models/Job.d.ts +352 -0
- package/dist/esm/models/Job.js +254 -0
- package/dist/esm/models/JobAttempt.d.ts +176 -0
- package/dist/esm/models/JobAttempt.js +147 -0
- package/dist/esm/models/JobCreate.d.ts +153 -0
- package/dist/esm/models/JobCreate.js +84 -0
- package/dist/esm/models/JobGpuTypes.d.ts +39 -0
- package/dist/esm/models/JobGpuTypes.js +48 -0
- package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
- package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
- package/dist/esm/models/JobLogChunk.d.ts +50 -0
- package/dist/esm/models/JobLogChunk.js +55 -0
- package/dist/esm/models/JobLogs.d.ts +39 -0
- package/dist/esm/models/JobLogs.js +48 -0
- package/dist/esm/models/JobPage.d.ts +39 -0
- package/dist/esm/models/JobPage.js +48 -0
- package/dist/esm/models/JobSharingHint.d.ts +46 -0
- package/dist/esm/models/JobSharingHint.js +51 -0
- package/dist/esm/models/JobTelemetry.d.ts +51 -0
- package/dist/esm/models/JobTelemetry.js +56 -0
- package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
- package/dist/esm/models/JobTelemetryPoint.js +59 -0
- package/dist/esm/models/JobTrial.d.ts +79 -0
- package/dist/esm/models/JobTrial.js +73 -0
- package/dist/esm/models/Operation.d.ts +6 -0
- package/dist/esm/models/Operation.js +2 -0
- package/dist/esm/models/Secret.d.ts +62 -0
- package/dist/esm/models/Secret.js +63 -0
- package/dist/esm/models/SecretCreate.d.ts +44 -0
- package/dist/esm/models/SecretCreate.js +49 -0
- package/dist/esm/models/SecretImportItem.d.ts +38 -0
- package/dist/esm/models/SecretImportItem.js +47 -0
- package/dist/esm/models/SecretImportRequest.d.ts +39 -0
- package/dist/esm/models/SecretImportRequest.js +46 -0
- package/dist/esm/models/SecretImportResult.d.ts +44 -0
- package/dist/esm/models/SecretImportResult.js +51 -0
- package/dist/esm/models/SecretList.d.ts +33 -0
- package/dist/esm/models/SecretList.js +44 -0
- package/dist/esm/models/SecretPut.d.ts +38 -0
- package/dist/esm/models/SecretPut.js +45 -0
- package/dist/esm/models/index.d.ts +25 -0
- package/dist/esm/models/index.js +25 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/DedicatedIPOffer.d.ts +98 -0
- package/dist/models/DedicatedIPOffer.js +94 -0
- package/dist/models/Endpoint.d.ts +147 -0
- package/dist/models/Endpoint.js +129 -0
- package/dist/models/EndpointCreate.d.ts +80 -0
- package/dist/models/EndpointCreate.js +70 -0
- package/dist/models/EndpointList.d.ts +33 -0
- package/dist/models/EndpointList.js +51 -0
- package/dist/models/EndpointMachine.d.ts +90 -0
- package/dist/models/EndpointMachine.js +92 -0
- package/dist/models/EndpointReplicaCounts.d.ts +38 -0
- package/dist/models/EndpointReplicaCounts.js +54 -0
- package/dist/models/Job.d.ts +352 -0
- package/dist/models/Job.js +262 -0
- package/dist/models/JobAttempt.d.ts +176 -0
- package/dist/models/JobAttempt.js +155 -0
- package/dist/models/JobCreate.d.ts +153 -0
- package/dist/models/JobCreate.js +92 -0
- package/dist/models/JobGpuTypes.d.ts +39 -0
- package/dist/models/JobGpuTypes.js +55 -0
- package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
- package/dist/models/JobGpuTypesDataInner.js +66 -0
- package/dist/models/JobLogChunk.d.ts +50 -0
- package/dist/models/JobLogChunk.js +62 -0
- package/dist/models/JobLogs.d.ts +39 -0
- package/dist/models/JobLogs.js +55 -0
- package/dist/models/JobPage.d.ts +39 -0
- package/dist/models/JobPage.js +55 -0
- package/dist/models/JobSharingHint.d.ts +46 -0
- package/dist/models/JobSharingHint.js +58 -0
- package/dist/models/JobTelemetry.d.ts +51 -0
- package/dist/models/JobTelemetry.js +63 -0
- package/dist/models/JobTelemetryPoint.d.ts +56 -0
- package/dist/models/JobTelemetryPoint.js +66 -0
- package/dist/models/JobTrial.d.ts +79 -0
- package/dist/models/JobTrial.js +81 -0
- package/dist/models/Operation.d.ts +6 -0
- package/dist/models/Operation.js +2 -0
- package/dist/models/Secret.d.ts +62 -0
- package/dist/models/Secret.js +70 -0
- package/dist/models/SecretCreate.d.ts +44 -0
- package/dist/models/SecretCreate.js +56 -0
- package/dist/models/SecretImportItem.d.ts +38 -0
- package/dist/models/SecretImportItem.js +54 -0
- package/dist/models/SecretImportRequest.d.ts +39 -0
- package/dist/models/SecretImportRequest.js +53 -0
- package/dist/models/SecretImportResult.d.ts +44 -0
- package/dist/models/SecretImportResult.js +58 -0
- package/dist/models/SecretList.d.ts +33 -0
- package/dist/models/SecretList.js +51 -0
- package/dist/models/SecretPut.d.ts +38 -0
- package/dist/models/SecretPut.js +52 -0
- package/dist/models/index.d.ts +25 -0
- package/dist/models/index.js +25 -0
- package/dist/runtime.js +1 -1
- package/docs/DedicatedIPOffer.md +56 -0
- package/docs/Endpoint.md +68 -0
- package/docs/EndpointCreate.md +50 -0
- package/docs/EndpointList.md +34 -0
- package/docs/EndpointMachine.md +50 -0
- package/docs/EndpointReplicaCounts.md +36 -0
- package/docs/EndpointsApi.md +544 -0
- package/docs/InstancesApi.md +68 -1
- package/docs/Job.md +125 -0
- package/docs/JobAttempt.md +69 -0
- package/docs/JobCreate.md +66 -0
- package/docs/JobGpuTypes.md +36 -0
- package/docs/JobGpuTypesDataInner.md +42 -0
- package/docs/JobLogChunk.md +40 -0
- package/docs/JobLogs.md +36 -0
- package/docs/JobPage.md +36 -0
- package/docs/JobSharingHint.md +39 -0
- package/docs/JobTelemetry.md +40 -0
- package/docs/JobTelemetryPoint.md +42 -0
- package/docs/JobTrial.md +46 -0
- package/docs/JobsApi.md +609 -0
- package/docs/Operation.md +2 -0
- package/docs/OperationsApi.md +76 -0
- package/docs/Secret.md +45 -0
- package/docs/SecretCreate.md +38 -0
- package/docs/SecretImportItem.md +36 -0
- package/docs/SecretImportRequest.md +36 -0
- package/docs/SecretImportResult.md +38 -0
- package/docs/SecretList.md +34 -0
- package/docs/SecretPut.md +36 -0
- package/docs/SecretsApi.md +450 -0
- package/package.json +1 -1
- package/src/apis/EndpointsApi.ts +481 -0
- package/src/apis/InstancesApi.ts +52 -0
- package/src/apis/JobsApi.ts +551 -0
- package/src/apis/OperationsApi.ts +59 -0
- package/src/apis/SecretsApi.ts +413 -0
- package/src/apis/index.ts +3 -0
- package/src/models/DedicatedIPOffer.ts +165 -0
- package/src/models/Endpoint.ts +247 -0
- package/src/models/EndpointCreate.ts +132 -0
- package/src/models/EndpointList.ts +74 -0
- package/src/models/EndpointMachine.ts +151 -0
- package/src/models/EndpointReplicaCounts.ts +75 -0
- package/src/models/Job.ts +538 -0
- package/src/models/JobAttempt.ts +267 -0
- package/src/models/JobCreate.ts +221 -0
- package/src/models/JobGpuTypes.ts +83 -0
- package/src/models/JobGpuTypesDataInner.ts +104 -0
- package/src/models/JobLogChunk.ts +93 -0
- package/src/models/JobLogs.ts +83 -0
- package/src/models/JobPage.ts +83 -0
- package/src/models/JobSharingHint.ts +86 -0
- package/src/models/JobTelemetry.ts +101 -0
- package/src/models/JobTelemetryPoint.ts +102 -0
- package/src/models/JobTrial.ts +132 -0
- package/src/models/Operation.ts +8 -0
- package/src/models/Secret.ts +111 -0
- package/src/models/SecretCreate.ts +83 -0
- package/src/models/SecretImportItem.ts +75 -0
- package/src/models/SecretImportRequest.ts +82 -0
- package/src/models/SecretImportResult.ts +84 -0
- package/src/models/SecretList.ts +74 -0
- package/src/models/SecretPut.ts +74 -0
- package/src/models/index.ts +25 -0
- package/src/runtime.ts +1 -1
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* GPU.ai Public Developer API
|
|
5
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@gpu.ai
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type Job,
|
|
18
|
+
JobFromJSON,
|
|
19
|
+
JobToJSON,
|
|
20
|
+
} from '../models/Job';
|
|
21
|
+
import {
|
|
22
|
+
type JobCreate,
|
|
23
|
+
JobCreateFromJSON,
|
|
24
|
+
JobCreateToJSON,
|
|
25
|
+
} from '../models/JobCreate';
|
|
26
|
+
import {
|
|
27
|
+
type JobGpuTypes,
|
|
28
|
+
JobGpuTypesFromJSON,
|
|
29
|
+
JobGpuTypesToJSON,
|
|
30
|
+
} from '../models/JobGpuTypes';
|
|
31
|
+
import {
|
|
32
|
+
type JobLogs,
|
|
33
|
+
JobLogsFromJSON,
|
|
34
|
+
JobLogsToJSON,
|
|
35
|
+
} from '../models/JobLogs';
|
|
36
|
+
import {
|
|
37
|
+
type JobPage,
|
|
38
|
+
JobPageFromJSON,
|
|
39
|
+
JobPageToJSON,
|
|
40
|
+
} from '../models/JobPage';
|
|
41
|
+
import {
|
|
42
|
+
type JobTelemetry,
|
|
43
|
+
JobTelemetryFromJSON,
|
|
44
|
+
JobTelemetryToJSON,
|
|
45
|
+
} from '../models/JobTelemetry';
|
|
46
|
+
import {
|
|
47
|
+
type JobTrial,
|
|
48
|
+
JobTrialFromJSON,
|
|
49
|
+
JobTrialToJSON,
|
|
50
|
+
} from '../models/JobTrial';
|
|
51
|
+
import {
|
|
52
|
+
type Problem,
|
|
53
|
+
ProblemFromJSON,
|
|
54
|
+
ProblemToJSON,
|
|
55
|
+
} from '../models/Problem';
|
|
56
|
+
|
|
57
|
+
export interface CancelJobRequest {
|
|
58
|
+
id: string;
|
|
59
|
+
idempotencyKey?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface CreateJobRequest {
|
|
63
|
+
jobCreate: JobCreate;
|
|
64
|
+
idempotencyKey?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface GetJobRequest {
|
|
68
|
+
id: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface GetJobLogsRequest {
|
|
72
|
+
id: string;
|
|
73
|
+
after?: number;
|
|
74
|
+
limit?: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface GetJobTelemetryRequest {
|
|
78
|
+
id: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ListJobsRequest {
|
|
82
|
+
status?: ListJobsStatusEnum;
|
|
83
|
+
cursor?: string;
|
|
84
|
+
limit?: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
export class JobsApi extends runtime.BaseAPI {
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Creates request options for cancelJob without sending the request
|
|
94
|
+
*/
|
|
95
|
+
async cancelJobRequestOpts(requestParameters: CancelJobRequest): Promise<runtime.RequestOpts> {
|
|
96
|
+
if (requestParameters['id'] == null) {
|
|
97
|
+
throw new runtime.RequiredError(
|
|
98
|
+
'id',
|
|
99
|
+
'Required parameter "id" was null or undefined when calling cancelJob().'
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const queryParameters: any = {};
|
|
104
|
+
|
|
105
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
106
|
+
|
|
107
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
108
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
112
|
+
const token = this.configuration.accessToken;
|
|
113
|
+
const tokenString = await token("bearerAuth", []);
|
|
114
|
+
|
|
115
|
+
if (tokenString) {
|
|
116
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
let urlPath = `/jobs/{id}/cancel`;
|
|
121
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
path: urlPath,
|
|
125
|
+
method: 'POST',
|
|
126
|
+
headers: headerParameters,
|
|
127
|
+
query: queryParameters,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Cancels a job. A queued job is cancelled at once. A running job is stopped the next time its machine reports, within a few seconds, and shows `cancel_requested` until then. Cancelling a job that has already finished returns it unchanged. Requires the `instances:write` scope.
|
|
133
|
+
* Cancel a job
|
|
134
|
+
*/
|
|
135
|
+
async cancelJobRaw(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
|
|
136
|
+
const requestOptions = await this.cancelJobRequestOpts(requestParameters);
|
|
137
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
138
|
+
|
|
139
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Cancels a job. A queued job is cancelled at once. A running job is stopped the next time its machine reports, within a few seconds, and shows `cancel_requested` until then. Cancelling a job that has already finished returns it unchanged. Requires the `instances:write` scope.
|
|
144
|
+
* Cancel a job
|
|
145
|
+
*/
|
|
146
|
+
async cancelJob(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
|
|
147
|
+
const response = await this.cancelJobRaw(requestParameters, initOverrides);
|
|
148
|
+
return await response.value();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Creates request options for createJob without sending the request
|
|
153
|
+
*/
|
|
154
|
+
async createJobRequestOpts(requestParameters: CreateJobRequest): Promise<runtime.RequestOpts> {
|
|
155
|
+
if (requestParameters['jobCreate'] == null) {
|
|
156
|
+
throw new runtime.RequiredError(
|
|
157
|
+
'jobCreate',
|
|
158
|
+
'Required parameter "jobCreate" was null or undefined when calling createJob().'
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const queryParameters: any = {};
|
|
163
|
+
|
|
164
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
165
|
+
|
|
166
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
167
|
+
|
|
168
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
169
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
173
|
+
const token = this.configuration.accessToken;
|
|
174
|
+
const tokenString = await token("bearerAuth", []);
|
|
175
|
+
|
|
176
|
+
if (tokenString) {
|
|
177
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
let urlPath = `/jobs`;
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
path: urlPath,
|
|
185
|
+
method: 'POST',
|
|
186
|
+
headers: headerParameters,
|
|
187
|
+
query: queryParameters,
|
|
188
|
+
body: JobCreateToJSON(requestParameters['jobCreate']),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Queues a batch job: a container image, a command, and the GPU it needs. The platform places it on a machine in your organization\'s job pool, starting a machine when none has room, and terminates machines that have been empty for a few minutes. Requires the `instances:write` scope, because a job can start a machine. Three opt-ins decide how the job is placed. `max_wait_seconds` lets the job wait for space on a machine you are already paying for before a new one is started. `allow_sharing` lets the job run on the same GPU as other jobs from your own organization. A GPU is never shared with another customer. `allow_restart` lets the platform stop and rerun the job, which sharing needs. A job shares a GPU only when `allow_sharing` and `allow_restart` are both true and its memory is known, from `memory_hint_mb` or from the peaks of earlier finished jobs with the same name or image. Any other job gets a whole GPU. Sharing is also limited by compute. Jobs share a GPU only while the sum of their expected compute duties (the share of time each keeps the GPU busy) stays at or under 100%, so two jobs that saturate the GPU never share one. A job\'s duty comes from `compute_hint_pct` or from the measured utilization of earlier finished jobs with the same name or image. A job with neither counts as 100% and gets a GPU to itself until it has been measured. The memory reservation is not a hard cap. A job that exits out of GPU memory, or that is stopped for outgrowing its reservation on a full GPU, is run again with a larger reservation, then with a whole GPU, up to `max_retries`. Every job gets a checkpoint directory that survives those reruns on the same machine. Billing: the machines a job runs on are instances of your organization and are billed like any instance. `attributed_cost_usd` on the job is its share of that, for display. Free trial: when this deployment runs one, an organization\'s first jobs are free up to a cap (GET /jobs/trial). Their attributed cost is credited back to the balance as they run.
|
|
194
|
+
* Submit a job
|
|
195
|
+
*/
|
|
196
|
+
async createJobRaw(requestParameters: CreateJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
|
|
197
|
+
const requestOptions = await this.createJobRequestOpts(requestParameters);
|
|
198
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
199
|
+
|
|
200
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Queues a batch job: a container image, a command, and the GPU it needs. The platform places it on a machine in your organization\'s job pool, starting a machine when none has room, and terminates machines that have been empty for a few minutes. Requires the `instances:write` scope, because a job can start a machine. Three opt-ins decide how the job is placed. `max_wait_seconds` lets the job wait for space on a machine you are already paying for before a new one is started. `allow_sharing` lets the job run on the same GPU as other jobs from your own organization. A GPU is never shared with another customer. `allow_restart` lets the platform stop and rerun the job, which sharing needs. A job shares a GPU only when `allow_sharing` and `allow_restart` are both true and its memory is known, from `memory_hint_mb` or from the peaks of earlier finished jobs with the same name or image. Any other job gets a whole GPU. Sharing is also limited by compute. Jobs share a GPU only while the sum of their expected compute duties (the share of time each keeps the GPU busy) stays at or under 100%, so two jobs that saturate the GPU never share one. A job\'s duty comes from `compute_hint_pct` or from the measured utilization of earlier finished jobs with the same name or image. A job with neither counts as 100% and gets a GPU to itself until it has been measured. The memory reservation is not a hard cap. A job that exits out of GPU memory, or that is stopped for outgrowing its reservation on a full GPU, is run again with a larger reservation, then with a whole GPU, up to `max_retries`. Every job gets a checkpoint directory that survives those reruns on the same machine. Billing: the machines a job runs on are instances of your organization and are billed like any instance. `attributed_cost_usd` on the job is its share of that, for display. Free trial: when this deployment runs one, an organization\'s first jobs are free up to a cap (GET /jobs/trial). Their attributed cost is credited back to the balance as they run.
|
|
205
|
+
* Submit a job
|
|
206
|
+
*/
|
|
207
|
+
async createJob(requestParameters: CreateJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
|
|
208
|
+
const response = await this.createJobRaw(requestParameters, initOverrides);
|
|
209
|
+
return await response.value();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Creates request options for getJob without sending the request
|
|
214
|
+
*/
|
|
215
|
+
async getJobRequestOpts(requestParameters: GetJobRequest): Promise<runtime.RequestOpts> {
|
|
216
|
+
if (requestParameters['id'] == null) {
|
|
217
|
+
throw new runtime.RequiredError(
|
|
218
|
+
'id',
|
|
219
|
+
'Required parameter "id" was null or undefined when calling getJob().'
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const queryParameters: any = {};
|
|
224
|
+
|
|
225
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
226
|
+
|
|
227
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
228
|
+
const token = this.configuration.accessToken;
|
|
229
|
+
const tokenString = await token("bearerAuth", []);
|
|
230
|
+
|
|
231
|
+
if (tokenString) {
|
|
232
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
let urlPath = `/jobs/{id}`;
|
|
237
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
path: urlPath,
|
|
241
|
+
method: 'GET',
|
|
242
|
+
headers: headerParameters,
|
|
243
|
+
query: queryParameters,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Returns one job with its attempts. Requires the `instances:read` scope.
|
|
249
|
+
* Get a job
|
|
250
|
+
*/
|
|
251
|
+
async getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
|
|
252
|
+
const requestOptions = await this.getJobRequestOpts(requestParameters);
|
|
253
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
254
|
+
|
|
255
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Returns one job with its attempts. Requires the `instances:read` scope.
|
|
260
|
+
* Get a job
|
|
261
|
+
*/
|
|
262
|
+
async getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
|
|
263
|
+
const response = await this.getJobRaw(requestParameters, initOverrides);
|
|
264
|
+
return await response.value();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Creates request options for getJobLogs without sending the request
|
|
269
|
+
*/
|
|
270
|
+
async getJobLogsRequestOpts(requestParameters: GetJobLogsRequest): Promise<runtime.RequestOpts> {
|
|
271
|
+
if (requestParameters['id'] == null) {
|
|
272
|
+
throw new runtime.RequiredError(
|
|
273
|
+
'id',
|
|
274
|
+
'Required parameter "id" was null or undefined when calling getJobLogs().'
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const queryParameters: any = {};
|
|
279
|
+
|
|
280
|
+
if (requestParameters['after'] != null) {
|
|
281
|
+
queryParameters['after'] = requestParameters['after'];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (requestParameters['limit'] != null) {
|
|
285
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
289
|
+
|
|
290
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
291
|
+
const token = this.configuration.accessToken;
|
|
292
|
+
const tokenString = await token("bearerAuth", []);
|
|
293
|
+
|
|
294
|
+
if (tokenString) {
|
|
295
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
let urlPath = `/jobs/{id}/logs`;
|
|
300
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
301
|
+
|
|
302
|
+
return {
|
|
303
|
+
path: urlPath,
|
|
304
|
+
method: 'GET',
|
|
305
|
+
headers: headerParameters,
|
|
306
|
+
query: queryParameters,
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Returns the job\'s combined standard output and standard error, in chunks, across all attempts. Pass the `next_after` of one response as `after` on the next to read on from there. Output is uploaded every few seconds while the job runs, and stored output is capped at about 8 MB per attempt. Requires the `instances:read` scope.
|
|
312
|
+
* Read a job\'s output
|
|
313
|
+
*/
|
|
314
|
+
async getJobLogsRaw(requestParameters: GetJobLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobLogs>> {
|
|
315
|
+
const requestOptions = await this.getJobLogsRequestOpts(requestParameters);
|
|
316
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
317
|
+
|
|
318
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobLogsFromJSON(jsonValue));
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Returns the job\'s combined standard output and standard error, in chunks, across all attempts. Pass the `next_after` of one response as `after` on the next to read on from there. Output is uploaded every few seconds while the job runs, and stored output is capped at about 8 MB per attempt. Requires the `instances:read` scope.
|
|
323
|
+
* Read a job\'s output
|
|
324
|
+
*/
|
|
325
|
+
async getJobLogs(requestParameters: GetJobLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobLogs> {
|
|
326
|
+
const response = await this.getJobLogsRaw(requestParameters, initOverrides);
|
|
327
|
+
return await response.value();
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Creates request options for getJobTelemetry without sending the request
|
|
332
|
+
*/
|
|
333
|
+
async getJobTelemetryRequestOpts(requestParameters: GetJobTelemetryRequest): Promise<runtime.RequestOpts> {
|
|
334
|
+
if (requestParameters['id'] == null) {
|
|
335
|
+
throw new runtime.RequiredError(
|
|
336
|
+
'id',
|
|
337
|
+
'Required parameter "id" was null or undefined when calling getJobTelemetry().'
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const queryParameters: any = {};
|
|
342
|
+
|
|
343
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
344
|
+
|
|
345
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
346
|
+
const token = this.configuration.accessToken;
|
|
347
|
+
const tokenString = await token("bearerAuth", []);
|
|
348
|
+
|
|
349
|
+
if (tokenString) {
|
|
350
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
let urlPath = `/jobs/{id}/telemetry`;
|
|
355
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
356
|
+
|
|
357
|
+
return {
|
|
358
|
+
path: urlPath,
|
|
359
|
+
method: 'GET',
|
|
360
|
+
headers: headerParameters,
|
|
361
|
+
query: queryParameters,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Returns the job\'s peak GPU memory, its reservation, and up to the 720 most recent memory points. The machine samples every 2 seconds and stores one point per report, the highest sample in that window. Points are kept for 30 days. Requires the `instances:read` scope.
|
|
367
|
+
* Read a job\'s GPU memory telemetry
|
|
368
|
+
*/
|
|
369
|
+
async getJobTelemetryRaw(requestParameters: GetJobTelemetryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobTelemetry>> {
|
|
370
|
+
const requestOptions = await this.getJobTelemetryRequestOpts(requestParameters);
|
|
371
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
372
|
+
|
|
373
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobTelemetryFromJSON(jsonValue));
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Returns the job\'s peak GPU memory, its reservation, and up to the 720 most recent memory points. The machine samples every 2 seconds and stores one point per report, the highest sample in that window. Points are kept for 30 days. Requires the `instances:read` scope.
|
|
378
|
+
* Read a job\'s GPU memory telemetry
|
|
379
|
+
*/
|
|
380
|
+
async getJobTelemetry(requestParameters: GetJobTelemetryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobTelemetry> {
|
|
381
|
+
const response = await this.getJobTelemetryRaw(requestParameters, initOverrides);
|
|
382
|
+
return await response.value();
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Creates request options for getJobTrial without sending the request
|
|
387
|
+
*/
|
|
388
|
+
async getJobTrialRequestOpts(): Promise<runtime.RequestOpts> {
|
|
389
|
+
const queryParameters: any = {};
|
|
390
|
+
|
|
391
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
392
|
+
|
|
393
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
394
|
+
const token = this.configuration.accessToken;
|
|
395
|
+
const tokenString = await token("bearerAuth", []);
|
|
396
|
+
|
|
397
|
+
if (tokenString) {
|
|
398
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
let urlPath = `/jobs/trial`;
|
|
403
|
+
|
|
404
|
+
return {
|
|
405
|
+
path: urlPath,
|
|
406
|
+
method: 'GET',
|
|
407
|
+
headers: headerParameters,
|
|
408
|
+
query: queryParameters,
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Reports the Jobs free trial for this organization. When the deployment runs one, an organization\'s first jobs are free up to `cap_cents`: the cost attributed to its jobs is credited back to its balance as they run, until the credits reach the cap. One trial per organization, for organizations that had not used Jobs before the trial started. `enabled` is false when there is no trial. Requires the `instances:read` scope.
|
|
414
|
+
* Whether this organization\'s first jobs are free
|
|
415
|
+
*/
|
|
416
|
+
async getJobTrialRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobTrial>> {
|
|
417
|
+
const requestOptions = await this.getJobTrialRequestOpts();
|
|
418
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
419
|
+
|
|
420
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobTrialFromJSON(jsonValue));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Reports the Jobs free trial for this organization. When the deployment runs one, an organization\'s first jobs are free up to `cap_cents`: the cost attributed to its jobs is credited back to its balance as they run, until the credits reach the cap. One trial per organization, for organizations that had not used Jobs before the trial started. `enabled` is false when there is no trial. Requires the `instances:read` scope.
|
|
425
|
+
* Whether this organization\'s first jobs are free
|
|
426
|
+
*/
|
|
427
|
+
async getJobTrial(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobTrial> {
|
|
428
|
+
const response = await this.getJobTrialRaw(initOverrides);
|
|
429
|
+
return await response.value();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Creates request options for listJobGpuTypes without sending the request
|
|
434
|
+
*/
|
|
435
|
+
async listJobGpuTypesRequestOpts(): Promise<runtime.RequestOpts> {
|
|
436
|
+
const queryParameters: any = {};
|
|
437
|
+
|
|
438
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
439
|
+
|
|
440
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
441
|
+
const token = this.configuration.accessToken;
|
|
442
|
+
const tokenString = await token("bearerAuth", []);
|
|
443
|
+
|
|
444
|
+
if (tokenString) {
|
|
445
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
let urlPath = `/jobs/gpu-types`;
|
|
450
|
+
|
|
451
|
+
return {
|
|
452
|
+
path: urlPath,
|
|
453
|
+
method: 'GET',
|
|
454
|
+
headers: headerParameters,
|
|
455
|
+
query: queryParameters,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Returns the GPU types the suppliers that run jobs rent as a one-GPU machine, smallest memory first. A type is listed when one of them offered it in the last 7 days, in stock or not. `available_now` says whether one has such a machine to rent now, and `price_per_gpu_hour` is the cheapest retail price of it at that read (a guide, not a quote: the launch prices it again). When `complete` is true, `POST /jobs` refuses any other `gpu_type` with a 422 (and a `min_vram_gb` larger than every listed type), instead of queueing a job that could never start. When `complete` is false the list may be partial or empty, and a job for any known GPU model is accepted and waits for a machine. Requires the `instances:read` scope.
|
|
461
|
+
* List the GPU types a job can run on
|
|
462
|
+
*/
|
|
463
|
+
async listJobGpuTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobGpuTypes>> {
|
|
464
|
+
const requestOptions = await this.listJobGpuTypesRequestOpts();
|
|
465
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
466
|
+
|
|
467
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobGpuTypesFromJSON(jsonValue));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Returns the GPU types the suppliers that run jobs rent as a one-GPU machine, smallest memory first. A type is listed when one of them offered it in the last 7 days, in stock or not. `available_now` says whether one has such a machine to rent now, and `price_per_gpu_hour` is the cheapest retail price of it at that read (a guide, not a quote: the launch prices it again). When `complete` is true, `POST /jobs` refuses any other `gpu_type` with a 422 (and a `min_vram_gb` larger than every listed type), instead of queueing a job that could never start. When `complete` is false the list may be partial or empty, and a job for any known GPU model is accepted and waits for a machine. Requires the `instances:read` scope.
|
|
472
|
+
* List the GPU types a job can run on
|
|
473
|
+
*/
|
|
474
|
+
async listJobGpuTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobGpuTypes> {
|
|
475
|
+
const response = await this.listJobGpuTypesRaw(initOverrides);
|
|
476
|
+
return await response.value();
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Creates request options for listJobs without sending the request
|
|
481
|
+
*/
|
|
482
|
+
async listJobsRequestOpts(requestParameters: ListJobsRequest): Promise<runtime.RequestOpts> {
|
|
483
|
+
const queryParameters: any = {};
|
|
484
|
+
|
|
485
|
+
if (requestParameters['status'] != null) {
|
|
486
|
+
queryParameters['status'] = requestParameters['status'];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (requestParameters['cursor'] != null) {
|
|
490
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (requestParameters['limit'] != null) {
|
|
494
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
498
|
+
|
|
499
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
500
|
+
const token = this.configuration.accessToken;
|
|
501
|
+
const tokenString = await token("bearerAuth", []);
|
|
502
|
+
|
|
503
|
+
if (tokenString) {
|
|
504
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
let urlPath = `/jobs`;
|
|
509
|
+
|
|
510
|
+
return {
|
|
511
|
+
path: urlPath,
|
|
512
|
+
method: 'GET',
|
|
513
|
+
headers: headerParameters,
|
|
514
|
+
query: queryParameters,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Lists this organization\'s jobs, newest first. Requires the `instances:read` scope. Jobs belonging to other organizations are never returned.
|
|
520
|
+
* List jobs
|
|
521
|
+
*/
|
|
522
|
+
async listJobsRaw(requestParameters: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobPage>> {
|
|
523
|
+
const requestOptions = await this.listJobsRequestOpts(requestParameters);
|
|
524
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
525
|
+
|
|
526
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobPageFromJSON(jsonValue));
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Lists this organization\'s jobs, newest first. Requires the `instances:read` scope. Jobs belonging to other organizations are never returned.
|
|
531
|
+
* List jobs
|
|
532
|
+
*/
|
|
533
|
+
async listJobs(requestParameters: ListJobsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobPage> {
|
|
534
|
+
const response = await this.listJobsRaw(requestParameters, initOverrides);
|
|
535
|
+
return await response.value();
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* @export
|
|
542
|
+
*/
|
|
543
|
+
export const ListJobsStatusEnum = {
|
|
544
|
+
Queued: 'queued',
|
|
545
|
+
Assigned: 'assigned',
|
|
546
|
+
Running: 'running',
|
|
547
|
+
Succeeded: 'succeeded',
|
|
548
|
+
Failed: 'failed',
|
|
549
|
+
Cancelled: 'cancelled'
|
|
550
|
+
} as const;
|
|
551
|
+
export type ListJobsStatusEnum = typeof ListJobsStatusEnum[keyof typeof ListJobsStatusEnum];
|
|
@@ -24,6 +24,10 @@ import {
|
|
|
24
24
|
ProblemToJSON,
|
|
25
25
|
} from '../models/Problem';
|
|
26
26
|
|
|
27
|
+
export interface CancelOperationRequest {
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
export interface GetOperationRequest {
|
|
28
32
|
id: string;
|
|
29
33
|
}
|
|
@@ -33,6 +37,61 @@ export interface GetOperationRequest {
|
|
|
33
37
|
*/
|
|
34
38
|
export class OperationsApi extends runtime.BaseAPI {
|
|
35
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Creates request options for cancelOperation without sending the request
|
|
42
|
+
*/
|
|
43
|
+
async cancelOperationRequestOpts(requestParameters: CancelOperationRequest): Promise<runtime.RequestOpts> {
|
|
44
|
+
if (requestParameters['id'] == null) {
|
|
45
|
+
throw new runtime.RequiredError(
|
|
46
|
+
'id',
|
|
47
|
+
'Required parameter "id" was null or undefined when calling cancelOperation().'
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const queryParameters: any = {};
|
|
52
|
+
|
|
53
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
54
|
+
|
|
55
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
56
|
+
const token = this.configuration.accessToken;
|
|
57
|
+
const tokenString = await token("bearerAuth", []);
|
|
58
|
+
|
|
59
|
+
if (tokenString) {
|
|
60
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let urlPath = `/operations/{id}/cancel`;
|
|
65
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
path: urlPath,
|
|
69
|
+
method: 'POST',
|
|
70
|
+
headers: headerParameters,
|
|
71
|
+
query: queryParameters,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Cancels an instance.create operation that is still pending or in_progress and has no resource_id yet. Nothing is created or billed for a cancelled launch; if the supplier finishes creating the machine after the cancel, it is terminated right away. Cancelling an operation that already finished returns it unchanged, so the call is safe to repeat. Scoped like GET /operations/{id}: only the key that started the operation can cancel it. Requires the `instances:write` scope.
|
|
77
|
+
* Cancel a launch that has not created its instance yet
|
|
78
|
+
*/
|
|
79
|
+
async cancelOperationRaw(requestParameters: CancelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Operation>> {
|
|
80
|
+
const requestOptions = await this.cancelOperationRequestOpts(requestParameters);
|
|
81
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
82
|
+
|
|
83
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OperationFromJSON(jsonValue));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Cancels an instance.create operation that is still pending or in_progress and has no resource_id yet. Nothing is created or billed for a cancelled launch; if the supplier finishes creating the machine after the cancel, it is terminated right away. Cancelling an operation that already finished returns it unchanged, so the call is safe to repeat. Scoped like GET /operations/{id}: only the key that started the operation can cancel it. Requires the `instances:write` scope.
|
|
88
|
+
* Cancel a launch that has not created its instance yet
|
|
89
|
+
*/
|
|
90
|
+
async cancelOperation(requestParameters: CancelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Operation> {
|
|
91
|
+
const response = await this.cancelOperationRaw(requestParameters, initOverrides);
|
|
92
|
+
return await response.value();
|
|
93
|
+
}
|
|
94
|
+
|
|
36
95
|
/**
|
|
37
96
|
* Creates request options for getOperation without sending the request
|
|
38
97
|
*/
|