@gpuai/sdk 0.5.4 → 0.5.5
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/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/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 +67 -0
- 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/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/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,440 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { JobFromJSON, } from '../models/Job';
|
|
25
|
+
import { JobCreateToJSON, } from '../models/JobCreate';
|
|
26
|
+
import { JobGpuTypesFromJSON, } from '../models/JobGpuTypes';
|
|
27
|
+
import { JobLogsFromJSON, } from '../models/JobLogs';
|
|
28
|
+
import { JobPageFromJSON, } from '../models/JobPage';
|
|
29
|
+
import { JobTelemetryFromJSON, } from '../models/JobTelemetry';
|
|
30
|
+
import { JobTrialFromJSON, } from '../models/JobTrial';
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export class JobsApi extends runtime.BaseAPI {
|
|
35
|
+
/**
|
|
36
|
+
* Creates request options for cancelJob without sending the request
|
|
37
|
+
*/
|
|
38
|
+
cancelJobRequestOpts(requestParameters) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (requestParameters['id'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling cancelJob().');
|
|
42
|
+
}
|
|
43
|
+
const queryParameters = {};
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
46
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
47
|
+
}
|
|
48
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
49
|
+
const token = this.configuration.accessToken;
|
|
50
|
+
const tokenString = yield token("bearerAuth", []);
|
|
51
|
+
if (tokenString) {
|
|
52
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
let urlPath = `/jobs/{id}/cancel`;
|
|
56
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
57
|
+
return {
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 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.
|
|
67
|
+
* Cancel a job
|
|
68
|
+
*/
|
|
69
|
+
cancelJobRaw(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const requestOptions = yield this.cancelJobRequestOpts(requestParameters);
|
|
72
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
73
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 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.
|
|
78
|
+
* Cancel a job
|
|
79
|
+
*/
|
|
80
|
+
cancelJob(requestParameters, initOverrides) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const response = yield this.cancelJobRaw(requestParameters, initOverrides);
|
|
83
|
+
return yield response.value();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Creates request options for createJob without sending the request
|
|
88
|
+
*/
|
|
89
|
+
createJobRequestOpts(requestParameters) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
if (requestParameters['jobCreate'] == null) {
|
|
92
|
+
throw new runtime.RequiredError('jobCreate', 'Required parameter "jobCreate" was null or undefined when calling createJob().');
|
|
93
|
+
}
|
|
94
|
+
const queryParameters = {};
|
|
95
|
+
const headerParameters = {};
|
|
96
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
97
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
98
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
99
|
+
}
|
|
100
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
101
|
+
const token = this.configuration.accessToken;
|
|
102
|
+
const tokenString = yield token("bearerAuth", []);
|
|
103
|
+
if (tokenString) {
|
|
104
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
let urlPath = `/jobs`;
|
|
108
|
+
return {
|
|
109
|
+
path: urlPath,
|
|
110
|
+
method: 'POST',
|
|
111
|
+
headers: headerParameters,
|
|
112
|
+
query: queryParameters,
|
|
113
|
+
body: JobCreateToJSON(requestParameters['jobCreate']),
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* 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.
|
|
119
|
+
* Submit a job
|
|
120
|
+
*/
|
|
121
|
+
createJobRaw(requestParameters, initOverrides) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const requestOptions = yield this.createJobRequestOpts(requestParameters);
|
|
124
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
125
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 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.
|
|
130
|
+
* Submit a job
|
|
131
|
+
*/
|
|
132
|
+
createJob(requestParameters, initOverrides) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const response = yield this.createJobRaw(requestParameters, initOverrides);
|
|
135
|
+
return yield response.value();
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Creates request options for getJob without sending the request
|
|
140
|
+
*/
|
|
141
|
+
getJobRequestOpts(requestParameters) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
if (requestParameters['id'] == null) {
|
|
144
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJob().');
|
|
145
|
+
}
|
|
146
|
+
const queryParameters = {};
|
|
147
|
+
const headerParameters = {};
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
const token = this.configuration.accessToken;
|
|
150
|
+
const tokenString = yield token("bearerAuth", []);
|
|
151
|
+
if (tokenString) {
|
|
152
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
let urlPath = `/jobs/{id}`;
|
|
156
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
157
|
+
return {
|
|
158
|
+
path: urlPath,
|
|
159
|
+
method: 'GET',
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters,
|
|
162
|
+
};
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Returns one job with its attempts. Requires the `instances:read` scope.
|
|
167
|
+
* Get a job
|
|
168
|
+
*/
|
|
169
|
+
getJobRaw(requestParameters, initOverrides) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
const requestOptions = yield this.getJobRequestOpts(requestParameters);
|
|
172
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
173
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Returns one job with its attempts. Requires the `instances:read` scope.
|
|
178
|
+
* Get a job
|
|
179
|
+
*/
|
|
180
|
+
getJob(requestParameters, initOverrides) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const response = yield this.getJobRaw(requestParameters, initOverrides);
|
|
183
|
+
return yield response.value();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Creates request options for getJobLogs without sending the request
|
|
188
|
+
*/
|
|
189
|
+
getJobLogsRequestOpts(requestParameters) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
if (requestParameters['id'] == null) {
|
|
192
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJobLogs().');
|
|
193
|
+
}
|
|
194
|
+
const queryParameters = {};
|
|
195
|
+
if (requestParameters['after'] != null) {
|
|
196
|
+
queryParameters['after'] = requestParameters['after'];
|
|
197
|
+
}
|
|
198
|
+
if (requestParameters['limit'] != null) {
|
|
199
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
200
|
+
}
|
|
201
|
+
const headerParameters = {};
|
|
202
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
203
|
+
const token = this.configuration.accessToken;
|
|
204
|
+
const tokenString = yield token("bearerAuth", []);
|
|
205
|
+
if (tokenString) {
|
|
206
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
let urlPath = `/jobs/{id}/logs`;
|
|
210
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
211
|
+
return {
|
|
212
|
+
path: urlPath,
|
|
213
|
+
method: 'GET',
|
|
214
|
+
headers: headerParameters,
|
|
215
|
+
query: queryParameters,
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* 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.
|
|
221
|
+
* Read a job\'s output
|
|
222
|
+
*/
|
|
223
|
+
getJobLogsRaw(requestParameters, initOverrides) {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
const requestOptions = yield this.getJobLogsRequestOpts(requestParameters);
|
|
226
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
227
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobLogsFromJSON(jsonValue));
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 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.
|
|
232
|
+
* Read a job\'s output
|
|
233
|
+
*/
|
|
234
|
+
getJobLogs(requestParameters, initOverrides) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
const response = yield this.getJobLogsRaw(requestParameters, initOverrides);
|
|
237
|
+
return yield response.value();
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Creates request options for getJobTelemetry without sending the request
|
|
242
|
+
*/
|
|
243
|
+
getJobTelemetryRequestOpts(requestParameters) {
|
|
244
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
+
if (requestParameters['id'] == null) {
|
|
246
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJobTelemetry().');
|
|
247
|
+
}
|
|
248
|
+
const queryParameters = {};
|
|
249
|
+
const headerParameters = {};
|
|
250
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
251
|
+
const token = this.configuration.accessToken;
|
|
252
|
+
const tokenString = yield token("bearerAuth", []);
|
|
253
|
+
if (tokenString) {
|
|
254
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
let urlPath = `/jobs/{id}/telemetry`;
|
|
258
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
259
|
+
return {
|
|
260
|
+
path: urlPath,
|
|
261
|
+
method: 'GET',
|
|
262
|
+
headers: headerParameters,
|
|
263
|
+
query: queryParameters,
|
|
264
|
+
};
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* 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.
|
|
269
|
+
* Read a job\'s GPU memory telemetry
|
|
270
|
+
*/
|
|
271
|
+
getJobTelemetryRaw(requestParameters, initOverrides) {
|
|
272
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
+
const requestOptions = yield this.getJobTelemetryRequestOpts(requestParameters);
|
|
274
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
275
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobTelemetryFromJSON(jsonValue));
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* 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.
|
|
280
|
+
* Read a job\'s GPU memory telemetry
|
|
281
|
+
*/
|
|
282
|
+
getJobTelemetry(requestParameters, initOverrides) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
const response = yield this.getJobTelemetryRaw(requestParameters, initOverrides);
|
|
285
|
+
return yield response.value();
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Creates request options for getJobTrial without sending the request
|
|
290
|
+
*/
|
|
291
|
+
getJobTrialRequestOpts() {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
const queryParameters = {};
|
|
294
|
+
const headerParameters = {};
|
|
295
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
296
|
+
const token = this.configuration.accessToken;
|
|
297
|
+
const tokenString = yield token("bearerAuth", []);
|
|
298
|
+
if (tokenString) {
|
|
299
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
let urlPath = `/jobs/trial`;
|
|
303
|
+
return {
|
|
304
|
+
path: urlPath,
|
|
305
|
+
method: 'GET',
|
|
306
|
+
headers: headerParameters,
|
|
307
|
+
query: queryParameters,
|
|
308
|
+
};
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* 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.
|
|
313
|
+
* Whether this organization\'s first jobs are free
|
|
314
|
+
*/
|
|
315
|
+
getJobTrialRaw(initOverrides) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
const requestOptions = yield this.getJobTrialRequestOpts();
|
|
318
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
319
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobTrialFromJSON(jsonValue));
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* 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.
|
|
324
|
+
* Whether this organization\'s first jobs are free
|
|
325
|
+
*/
|
|
326
|
+
getJobTrial(initOverrides) {
|
|
327
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
+
const response = yield this.getJobTrialRaw(initOverrides);
|
|
329
|
+
return yield response.value();
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Creates request options for listJobGpuTypes without sending the request
|
|
334
|
+
*/
|
|
335
|
+
listJobGpuTypesRequestOpts() {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
const queryParameters = {};
|
|
338
|
+
const headerParameters = {};
|
|
339
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
340
|
+
const token = this.configuration.accessToken;
|
|
341
|
+
const tokenString = yield token("bearerAuth", []);
|
|
342
|
+
if (tokenString) {
|
|
343
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
let urlPath = `/jobs/gpu-types`;
|
|
347
|
+
return {
|
|
348
|
+
path: urlPath,
|
|
349
|
+
method: 'GET',
|
|
350
|
+
headers: headerParameters,
|
|
351
|
+
query: queryParameters,
|
|
352
|
+
};
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* 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.
|
|
357
|
+
* List the GPU types a job can run on
|
|
358
|
+
*/
|
|
359
|
+
listJobGpuTypesRaw(initOverrides) {
|
|
360
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
const requestOptions = yield this.listJobGpuTypesRequestOpts();
|
|
362
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
363
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobGpuTypesFromJSON(jsonValue));
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* 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.
|
|
368
|
+
* List the GPU types a job can run on
|
|
369
|
+
*/
|
|
370
|
+
listJobGpuTypes(initOverrides) {
|
|
371
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
+
const response = yield this.listJobGpuTypesRaw(initOverrides);
|
|
373
|
+
return yield response.value();
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Creates request options for listJobs without sending the request
|
|
378
|
+
*/
|
|
379
|
+
listJobsRequestOpts(requestParameters) {
|
|
380
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
+
const queryParameters = {};
|
|
382
|
+
if (requestParameters['status'] != null) {
|
|
383
|
+
queryParameters['status'] = requestParameters['status'];
|
|
384
|
+
}
|
|
385
|
+
if (requestParameters['cursor'] != null) {
|
|
386
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
387
|
+
}
|
|
388
|
+
if (requestParameters['limit'] != null) {
|
|
389
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
390
|
+
}
|
|
391
|
+
const headerParameters = {};
|
|
392
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
393
|
+
const token = this.configuration.accessToken;
|
|
394
|
+
const tokenString = yield token("bearerAuth", []);
|
|
395
|
+
if (tokenString) {
|
|
396
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
let urlPath = `/jobs`;
|
|
400
|
+
return {
|
|
401
|
+
path: urlPath,
|
|
402
|
+
method: 'GET',
|
|
403
|
+
headers: headerParameters,
|
|
404
|
+
query: queryParameters,
|
|
405
|
+
};
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Lists this organization\'s jobs, newest first. Requires the `instances:read` scope. Jobs belonging to other organizations are never returned.
|
|
410
|
+
* List jobs
|
|
411
|
+
*/
|
|
412
|
+
listJobsRaw(requestParameters, initOverrides) {
|
|
413
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
+
const requestOptions = yield this.listJobsRequestOpts(requestParameters);
|
|
415
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
416
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobPageFromJSON(jsonValue));
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Lists this organization\'s jobs, newest first. Requires the `instances:read` scope. Jobs belonging to other organizations are never returned.
|
|
421
|
+
* List jobs
|
|
422
|
+
*/
|
|
423
|
+
listJobs() {
|
|
424
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
425
|
+
const response = yield this.listJobsRaw(requestParameters, initOverrides);
|
|
426
|
+
return yield response.value();
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* @export
|
|
432
|
+
*/
|
|
433
|
+
export const ListJobsStatusEnum = {
|
|
434
|
+
Queued: 'queued',
|
|
435
|
+
Assigned: 'assigned',
|
|
436
|
+
Running: 'running',
|
|
437
|
+
Succeeded: 'succeeded',
|
|
438
|
+
Failed: 'failed',
|
|
439
|
+
Cancelled: 'cancelled'
|
|
440
|
+
};
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import { type Operation } from '../models/Operation';
|
|
14
|
+
export interface CancelOperationRequest {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
14
17
|
export interface GetOperationRequest {
|
|
15
18
|
id: string;
|
|
16
19
|
}
|
|
@@ -18,6 +21,20 @@ export interface GetOperationRequest {
|
|
|
18
21
|
*
|
|
19
22
|
*/
|
|
20
23
|
export declare class OperationsApi extends runtime.BaseAPI {
|
|
24
|
+
/**
|
|
25
|
+
* Creates request options for cancelOperation without sending the request
|
|
26
|
+
*/
|
|
27
|
+
cancelOperationRequestOpts(requestParameters: CancelOperationRequest): Promise<runtime.RequestOpts>;
|
|
28
|
+
/**
|
|
29
|
+
* 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.
|
|
30
|
+
* Cancel a launch that has not created its instance yet
|
|
31
|
+
*/
|
|
32
|
+
cancelOperationRaw(requestParameters: CancelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Operation>>;
|
|
33
|
+
/**
|
|
34
|
+
* 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.
|
|
35
|
+
* Cancel a launch that has not created its instance yet
|
|
36
|
+
*/
|
|
37
|
+
cancelOperation(requestParameters: CancelOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Operation>;
|
|
21
38
|
/**
|
|
22
39
|
* Creates request options for getOperation without sending the request
|
|
23
40
|
*/
|
|
@@ -26,6 +26,54 @@ import { OperationFromJSON, } from '../models/Operation';
|
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class OperationsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for cancelOperation without sending the request
|
|
31
|
+
*/
|
|
32
|
+
cancelOperationRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['id'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling cancelOperation().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
40
|
+
const token = this.configuration.accessToken;
|
|
41
|
+
const tokenString = yield token("bearerAuth", []);
|
|
42
|
+
if (tokenString) {
|
|
43
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let urlPath = `/operations/{id}/cancel`;
|
|
47
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
48
|
+
return {
|
|
49
|
+
path: urlPath,
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: headerParameters,
|
|
52
|
+
query: queryParameters,
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 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.
|
|
58
|
+
* Cancel a launch that has not created its instance yet
|
|
59
|
+
*/
|
|
60
|
+
cancelOperationRaw(requestParameters, initOverrides) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const requestOptions = yield this.cancelOperationRequestOpts(requestParameters);
|
|
63
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
64
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OperationFromJSON(jsonValue));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 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.
|
|
69
|
+
* Cancel a launch that has not created its instance yet
|
|
70
|
+
*/
|
|
71
|
+
cancelOperation(requestParameters, initOverrides) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const response = yield this.cancelOperationRaw(requestParameters, initOverrides);
|
|
74
|
+
return yield response.value();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
29
77
|
/**
|
|
30
78
|
* Creates request options for getOperation without sending the request
|
|
31
79
|
*/
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPU.ai Public Developer API
|
|
3
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@gpu.ai
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import { type Secret } from '../models/Secret';
|
|
14
|
+
import { type SecretCreate } from '../models/SecretCreate';
|
|
15
|
+
import { type SecretImportRequest } from '../models/SecretImportRequest';
|
|
16
|
+
import { type SecretImportResult } from '../models/SecretImportResult';
|
|
17
|
+
import { type SecretList } from '../models/SecretList';
|
|
18
|
+
import { type SecretPut } from '../models/SecretPut';
|
|
19
|
+
export interface CreateSecretRequest {
|
|
20
|
+
secretCreate: SecretCreate;
|
|
21
|
+
}
|
|
22
|
+
export interface DeleteSecretRequest {
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GetSecretRequest {
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ImportSecretsRequest {
|
|
29
|
+
secretImportRequest: SecretImportRequest;
|
|
30
|
+
}
|
|
31
|
+
export interface PutSecretRequest {
|
|
32
|
+
name: string;
|
|
33
|
+
secretPut: SecretPut;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare class SecretsApi extends runtime.BaseAPI {
|
|
39
|
+
/**
|
|
40
|
+
* Creates request options for createSecret without sending the request
|
|
41
|
+
*/
|
|
42
|
+
createSecretRequestOpts(requestParameters: CreateSecretRequest): Promise<runtime.RequestOpts>;
|
|
43
|
+
/**
|
|
44
|
+
* Stores a new secret. The value crosses the wire on create, update and import only, is envelope encrypted at rest, and is never returned. The name is the environment variable the value is delivered as: a letter or underscore, then letters, digits and underscores, 128 characters at most; names starting with GPUAI_ and names the machine itself needs (PATH, HOME, LD_PRELOAD and similar) are refused. Values are at most 32 KB. Returns 409 `name_taken` when the name exists (use PUT to replace a value) and 422 `validation_failed` for a bad name or value. Every create, update, delete and use is recorded in the organization\'s audit log, without the value. Requires the `instances:write` scope.
|
|
45
|
+
* Create a secret
|
|
46
|
+
*/
|
|
47
|
+
createSecretRaw(requestParameters: CreateSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>>;
|
|
48
|
+
/**
|
|
49
|
+
* Stores a new secret. The value crosses the wire on create, update and import only, is envelope encrypted at rest, and is never returned. The name is the environment variable the value is delivered as: a letter or underscore, then letters, digits and underscores, 128 characters at most; names starting with GPUAI_ and names the machine itself needs (PATH, HOME, LD_PRELOAD and similar) are refused. Values are at most 32 KB. Returns 409 `name_taken` when the name exists (use PUT to replace a value) and 422 `validation_failed` for a bad name or value. Every create, update, delete and use is recorded in the organization\'s audit log, without the value. Requires the `instances:write` scope.
|
|
50
|
+
* Create a secret
|
|
51
|
+
*/
|
|
52
|
+
createSecret(requestParameters: CreateSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret>;
|
|
53
|
+
/**
|
|
54
|
+
* Creates request options for deleteSecret without sending the request
|
|
55
|
+
*/
|
|
56
|
+
deleteSecretRequestOpts(requestParameters: DeleteSecretRequest): Promise<runtime.RequestOpts>;
|
|
57
|
+
/**
|
|
58
|
+
* Deletes the secret. Machines already running keep the value they were given; nothing started later can receive it, and a function version or job that still names it fails its next run. Requires the `instances:write` scope.
|
|
59
|
+
* Delete a secret
|
|
60
|
+
*/
|
|
61
|
+
deleteSecretRaw(requestParameters: DeleteSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
62
|
+
/**
|
|
63
|
+
* Deletes the secret. Machines already running keep the value they were given; nothing started later can receive it, and a function version or job that still names it fails its next run. Requires the `instances:write` scope.
|
|
64
|
+
* Delete a secret
|
|
65
|
+
*/
|
|
66
|
+
deleteSecret(requestParameters: DeleteSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for getSecret without sending the request
|
|
69
|
+
*/
|
|
70
|
+
getSecretRequestOpts(requestParameters: GetSecretRequest): Promise<runtime.RequestOpts>;
|
|
71
|
+
/**
|
|
72
|
+
* Returns one secret\'s metadata. The value is never returned. Requires the `instances:read` scope. 404 `not_found` when the organization has no secret with this name.
|
|
73
|
+
* Get a secret\'s metadata
|
|
74
|
+
*/
|
|
75
|
+
getSecretRaw(requestParameters: GetSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>>;
|
|
76
|
+
/**
|
|
77
|
+
* Returns one secret\'s metadata. The value is never returned. Requires the `instances:read` scope. 404 `not_found` when the organization has no secret with this name.
|
|
78
|
+
* Get a secret\'s metadata
|
|
79
|
+
*/
|
|
80
|
+
getSecret(requestParameters: GetSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates request options for importSecrets without sending the request
|
|
83
|
+
*/
|
|
84
|
+
importSecretsRequestOpts(requestParameters: ImportSecretsRequest): Promise<runtime.RequestOpts>;
|
|
85
|
+
/**
|
|
86
|
+
* Creates or updates many secrets at once, for example the output of `infisical export` or a .env file parsed by the client (the `gpu secrets import` command parses dotenv and Infisical JSON locally and sends this request). Every item is validated before any is written. With `overwrite` false, existing secrets are left untouched and listed under `skipped`. At most 200 items. Requires the `instances:write` scope.
|
|
87
|
+
* Import secrets
|
|
88
|
+
*/
|
|
89
|
+
importSecretsRaw(requestParameters: ImportSecretsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SecretImportResult>>;
|
|
90
|
+
/**
|
|
91
|
+
* Creates or updates many secrets at once, for example the output of `infisical export` or a .env file parsed by the client (the `gpu secrets import` command parses dotenv and Infisical JSON locally and sends this request). Every item is validated before any is written. With `overwrite` false, existing secrets are left untouched and listed under `skipped`. At most 200 items. Requires the `instances:write` scope.
|
|
92
|
+
* Import secrets
|
|
93
|
+
*/
|
|
94
|
+
importSecrets(requestParameters: ImportSecretsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SecretImportResult>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates request options for listSecrets without sending the request
|
|
97
|
+
*/
|
|
98
|
+
listSecretsRequestOpts(): Promise<runtime.RequestOpts>;
|
|
99
|
+
/**
|
|
100
|
+
* Lists the organization\'s secrets by name with their metadata. Values are never returned by any read. Requires the `instances:read` scope. Returns 503 `secrets_unavailable` when secrets are switched on but no encryption key is configured, and 404 when the feature is off.
|
|
101
|
+
* List secrets
|
|
102
|
+
*/
|
|
103
|
+
listSecretsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SecretList>>;
|
|
104
|
+
/**
|
|
105
|
+
* Lists the organization\'s secrets by name with their metadata. Values are never returned by any read. Requires the `instances:read` scope. Returns 503 `secrets_unavailable` when secrets are switched on but no encryption key is configured, and 404 when the feature is off.
|
|
106
|
+
* List secrets
|
|
107
|
+
*/
|
|
108
|
+
listSecrets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SecretList>;
|
|
109
|
+
/**
|
|
110
|
+
* Creates request options for putSecret without sending the request
|
|
111
|
+
*/
|
|
112
|
+
putSecretRequestOpts(requestParameters: PutSecretRequest): Promise<runtime.RequestOpts>;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the secret\'s value, creating the secret when it does not exist (201) or replacing the value and bumping its version when it does (200). Omit `description` to keep the current one. Machines already running keep the value they were given; launches and calls from now on get the new one. Requires the `instances:write` scope.
|
|
115
|
+
* Create or replace a secret
|
|
116
|
+
*/
|
|
117
|
+
putSecretRaw(requestParameters: PutSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>>;
|
|
118
|
+
/**
|
|
119
|
+
* Sets the secret\'s value, creating the secret when it does not exist (201) or replacing the value and bumping its version when it does (200). Omit `description` to keep the current one. Machines already running keep the value they were given; launches and calls from now on get the new one. Requires the `instances:write` scope.
|
|
120
|
+
* Create or replace a secret
|
|
121
|
+
*/
|
|
122
|
+
putSecret(requestParameters: PutSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret>;
|
|
123
|
+
}
|