@gpuai/sdk 0.5.3 → 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.
Files changed (218) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/BillingApi.d.ts +2 -2
  4. package/dist/apis/BillingApi.js +2 -2
  5. package/dist/apis/EndpointsApi.d.ts +150 -0
  6. package/dist/apis/EndpointsApi.js +379 -0
  7. package/dist/apis/InstancesApi.d.ts +15 -0
  8. package/dist/apis/InstancesApi.js +45 -0
  9. package/dist/apis/JobsApi.d.ts +172 -0
  10. package/dist/apis/JobsApi.js +444 -0
  11. package/dist/apis/OperationsApi.d.ts +17 -0
  12. package/dist/apis/OperationsApi.js +48 -0
  13. package/dist/apis/SecretsApi.d.ts +123 -0
  14. package/dist/apis/SecretsApi.js +328 -0
  15. package/dist/apis/index.d.ts +3 -0
  16. package/dist/apis/index.js +3 -0
  17. package/dist/esm/apis/BillingApi.d.ts +2 -2
  18. package/dist/esm/apis/BillingApi.js +2 -2
  19. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  20. package/dist/esm/apis/EndpointsApi.js +375 -0
  21. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  22. package/dist/esm/apis/InstancesApi.js +45 -0
  23. package/dist/esm/apis/JobsApi.d.ts +172 -0
  24. package/dist/esm/apis/JobsApi.js +440 -0
  25. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  26. package/dist/esm/apis/OperationsApi.js +48 -0
  27. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  28. package/dist/esm/apis/SecretsApi.js +324 -0
  29. package/dist/esm/apis/index.d.ts +3 -0
  30. package/dist/esm/apis/index.js +3 -0
  31. package/dist/esm/models/Balance.d.ts +6 -0
  32. package/dist/esm/models/Balance.js +2 -0
  33. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +3 -0
  34. package/dist/esm/models/CreateWebhookEndpointRequest.js +4 -1
  35. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  36. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  37. package/dist/esm/models/Endpoint.d.ts +147 -0
  38. package/dist/esm/models/Endpoint.js +121 -0
  39. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  40. package/dist/esm/models/EndpointCreate.js +63 -0
  41. package/dist/esm/models/EndpointList.d.ts +33 -0
  42. package/dist/esm/models/EndpointList.js +44 -0
  43. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  44. package/dist/esm/models/EndpointMachine.js +84 -0
  45. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  46. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  47. package/dist/esm/models/Job.d.ts +352 -0
  48. package/dist/esm/models/Job.js +254 -0
  49. package/dist/esm/models/JobAttempt.d.ts +176 -0
  50. package/dist/esm/models/JobAttempt.js +147 -0
  51. package/dist/esm/models/JobCreate.d.ts +153 -0
  52. package/dist/esm/models/JobCreate.js +84 -0
  53. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  54. package/dist/esm/models/JobGpuTypes.js +48 -0
  55. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  56. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  57. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  58. package/dist/esm/models/JobLogChunk.js +55 -0
  59. package/dist/esm/models/JobLogs.d.ts +39 -0
  60. package/dist/esm/models/JobLogs.js +48 -0
  61. package/dist/esm/models/JobPage.d.ts +39 -0
  62. package/dist/esm/models/JobPage.js +48 -0
  63. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  64. package/dist/esm/models/JobSharingHint.js +51 -0
  65. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  66. package/dist/esm/models/JobTelemetry.js +56 -0
  67. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  68. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  69. package/dist/esm/models/JobTrial.d.ts +79 -0
  70. package/dist/esm/models/JobTrial.js +73 -0
  71. package/dist/esm/models/Secret.d.ts +62 -0
  72. package/dist/esm/models/Secret.js +63 -0
  73. package/dist/esm/models/SecretCreate.d.ts +44 -0
  74. package/dist/esm/models/SecretCreate.js +49 -0
  75. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  76. package/dist/esm/models/SecretImportItem.js +47 -0
  77. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  78. package/dist/esm/models/SecretImportRequest.js +46 -0
  79. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  80. package/dist/esm/models/SecretImportResult.js +51 -0
  81. package/dist/esm/models/SecretList.d.ts +33 -0
  82. package/dist/esm/models/SecretList.js +44 -0
  83. package/dist/esm/models/SecretPut.d.ts +38 -0
  84. package/dist/esm/models/SecretPut.js +45 -0
  85. package/dist/esm/models/WebhookEndpoint.d.ts +3 -0
  86. package/dist/esm/models/WebhookEndpoint.js +4 -1
  87. package/dist/esm/models/index.d.ts +25 -0
  88. package/dist/esm/models/index.js +25 -0
  89. package/dist/esm/runtime.js +1 -1
  90. package/dist/models/Balance.d.ts +6 -0
  91. package/dist/models/Balance.js +2 -0
  92. package/dist/models/CreateWebhookEndpointRequest.d.ts +3 -0
  93. package/dist/models/CreateWebhookEndpointRequest.js +4 -1
  94. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  95. package/dist/models/DedicatedIPOffer.js +94 -0
  96. package/dist/models/Endpoint.d.ts +147 -0
  97. package/dist/models/Endpoint.js +129 -0
  98. package/dist/models/EndpointCreate.d.ts +80 -0
  99. package/dist/models/EndpointCreate.js +70 -0
  100. package/dist/models/EndpointList.d.ts +33 -0
  101. package/dist/models/EndpointList.js +51 -0
  102. package/dist/models/EndpointMachine.d.ts +90 -0
  103. package/dist/models/EndpointMachine.js +92 -0
  104. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  105. package/dist/models/EndpointReplicaCounts.js +54 -0
  106. package/dist/models/Job.d.ts +352 -0
  107. package/dist/models/Job.js +262 -0
  108. package/dist/models/JobAttempt.d.ts +176 -0
  109. package/dist/models/JobAttempt.js +155 -0
  110. package/dist/models/JobCreate.d.ts +153 -0
  111. package/dist/models/JobCreate.js +92 -0
  112. package/dist/models/JobGpuTypes.d.ts +39 -0
  113. package/dist/models/JobGpuTypes.js +55 -0
  114. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  115. package/dist/models/JobGpuTypesDataInner.js +66 -0
  116. package/dist/models/JobLogChunk.d.ts +50 -0
  117. package/dist/models/JobLogChunk.js +62 -0
  118. package/dist/models/JobLogs.d.ts +39 -0
  119. package/dist/models/JobLogs.js +55 -0
  120. package/dist/models/JobPage.d.ts +39 -0
  121. package/dist/models/JobPage.js +55 -0
  122. package/dist/models/JobSharingHint.d.ts +46 -0
  123. package/dist/models/JobSharingHint.js +58 -0
  124. package/dist/models/JobTelemetry.d.ts +51 -0
  125. package/dist/models/JobTelemetry.js +63 -0
  126. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  127. package/dist/models/JobTelemetryPoint.js +66 -0
  128. package/dist/models/JobTrial.d.ts +79 -0
  129. package/dist/models/JobTrial.js +81 -0
  130. package/dist/models/Secret.d.ts +62 -0
  131. package/dist/models/Secret.js +70 -0
  132. package/dist/models/SecretCreate.d.ts +44 -0
  133. package/dist/models/SecretCreate.js +56 -0
  134. package/dist/models/SecretImportItem.d.ts +38 -0
  135. package/dist/models/SecretImportItem.js +54 -0
  136. package/dist/models/SecretImportRequest.d.ts +39 -0
  137. package/dist/models/SecretImportRequest.js +53 -0
  138. package/dist/models/SecretImportResult.d.ts +44 -0
  139. package/dist/models/SecretImportResult.js +58 -0
  140. package/dist/models/SecretList.d.ts +33 -0
  141. package/dist/models/SecretList.js +51 -0
  142. package/dist/models/SecretPut.d.ts +38 -0
  143. package/dist/models/SecretPut.js +52 -0
  144. package/dist/models/WebhookEndpoint.d.ts +3 -0
  145. package/dist/models/WebhookEndpoint.js +4 -1
  146. package/dist/models/index.d.ts +25 -0
  147. package/dist/models/index.js +25 -0
  148. package/dist/runtime.js +1 -1
  149. package/docs/Balance.md +2 -0
  150. package/docs/BillingApi.md +2 -2
  151. package/docs/DedicatedIPOffer.md +56 -0
  152. package/docs/Endpoint.md +68 -0
  153. package/docs/EndpointCreate.md +50 -0
  154. package/docs/EndpointList.md +34 -0
  155. package/docs/EndpointMachine.md +50 -0
  156. package/docs/EndpointReplicaCounts.md +36 -0
  157. package/docs/EndpointsApi.md +544 -0
  158. package/docs/InstancesApi.md +68 -1
  159. package/docs/Job.md +125 -0
  160. package/docs/JobAttempt.md +69 -0
  161. package/docs/JobCreate.md +66 -0
  162. package/docs/JobGpuTypes.md +36 -0
  163. package/docs/JobGpuTypesDataInner.md +42 -0
  164. package/docs/JobLogChunk.md +40 -0
  165. package/docs/JobLogs.md +36 -0
  166. package/docs/JobPage.md +36 -0
  167. package/docs/JobSharingHint.md +39 -0
  168. package/docs/JobTelemetry.md +40 -0
  169. package/docs/JobTelemetryPoint.md +42 -0
  170. package/docs/JobTrial.md +46 -0
  171. package/docs/JobsApi.md +609 -0
  172. package/docs/OperationsApi.md +76 -0
  173. package/docs/Secret.md +45 -0
  174. package/docs/SecretCreate.md +38 -0
  175. package/docs/SecretImportItem.md +36 -0
  176. package/docs/SecretImportRequest.md +36 -0
  177. package/docs/SecretImportResult.md +38 -0
  178. package/docs/SecretList.md +34 -0
  179. package/docs/SecretPut.md +36 -0
  180. package/docs/SecretsApi.md +450 -0
  181. package/package.json +1 -1
  182. package/src/apis/BillingApi.ts +2 -2
  183. package/src/apis/EndpointsApi.ts +481 -0
  184. package/src/apis/InstancesApi.ts +52 -0
  185. package/src/apis/JobsApi.ts +551 -0
  186. package/src/apis/OperationsApi.ts +59 -0
  187. package/src/apis/SecretsApi.ts +413 -0
  188. package/src/apis/index.ts +3 -0
  189. package/src/models/Balance.ts +8 -0
  190. package/src/models/CreateWebhookEndpointRequest.ts +4 -1
  191. package/src/models/DedicatedIPOffer.ts +165 -0
  192. package/src/models/Endpoint.ts +247 -0
  193. package/src/models/EndpointCreate.ts +132 -0
  194. package/src/models/EndpointList.ts +74 -0
  195. package/src/models/EndpointMachine.ts +151 -0
  196. package/src/models/EndpointReplicaCounts.ts +75 -0
  197. package/src/models/Job.ts +538 -0
  198. package/src/models/JobAttempt.ts +267 -0
  199. package/src/models/JobCreate.ts +221 -0
  200. package/src/models/JobGpuTypes.ts +83 -0
  201. package/src/models/JobGpuTypesDataInner.ts +104 -0
  202. package/src/models/JobLogChunk.ts +93 -0
  203. package/src/models/JobLogs.ts +83 -0
  204. package/src/models/JobPage.ts +83 -0
  205. package/src/models/JobSharingHint.ts +86 -0
  206. package/src/models/JobTelemetry.ts +101 -0
  207. package/src/models/JobTelemetryPoint.ts +102 -0
  208. package/src/models/JobTrial.ts +132 -0
  209. package/src/models/Secret.ts +111 -0
  210. package/src/models/SecretCreate.ts +83 -0
  211. package/src/models/SecretImportItem.ts +75 -0
  212. package/src/models/SecretImportRequest.ts +82 -0
  213. package/src/models/SecretImportResult.ts +84 -0
  214. package/src/models/SecretList.ts +74 -0
  215. package/src/models/SecretPut.ts +74 -0
  216. package/src/models/WebhookEndpoint.ts +4 -1
  217. package/src/models/index.ts +25 -0
  218. package/src/runtime.ts +1 -1
@@ -0,0 +1,413 @@
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 Problem,
18
+ ProblemFromJSON,
19
+ ProblemToJSON,
20
+ } from '../models/Problem';
21
+ import {
22
+ type Secret,
23
+ SecretFromJSON,
24
+ SecretToJSON,
25
+ } from '../models/Secret';
26
+ import {
27
+ type SecretCreate,
28
+ SecretCreateFromJSON,
29
+ SecretCreateToJSON,
30
+ } from '../models/SecretCreate';
31
+ import {
32
+ type SecretImportRequest,
33
+ SecretImportRequestFromJSON,
34
+ SecretImportRequestToJSON,
35
+ } from '../models/SecretImportRequest';
36
+ import {
37
+ type SecretImportResult,
38
+ SecretImportResultFromJSON,
39
+ SecretImportResultToJSON,
40
+ } from '../models/SecretImportResult';
41
+ import {
42
+ type SecretList,
43
+ SecretListFromJSON,
44
+ SecretListToJSON,
45
+ } from '../models/SecretList';
46
+ import {
47
+ type SecretPut,
48
+ SecretPutFromJSON,
49
+ SecretPutToJSON,
50
+ } from '../models/SecretPut';
51
+
52
+ export interface CreateSecretRequest {
53
+ secretCreate: SecretCreate;
54
+ }
55
+
56
+ export interface DeleteSecretRequest {
57
+ name: string;
58
+ }
59
+
60
+ export interface GetSecretRequest {
61
+ name: string;
62
+ }
63
+
64
+ export interface ImportSecretsRequest {
65
+ secretImportRequest: SecretImportRequest;
66
+ }
67
+
68
+ export interface PutSecretRequest {
69
+ name: string;
70
+ secretPut: SecretPut;
71
+ }
72
+
73
+ /**
74
+ *
75
+ */
76
+ export class SecretsApi extends runtime.BaseAPI {
77
+
78
+ /**
79
+ * Creates request options for createSecret without sending the request
80
+ */
81
+ async createSecretRequestOpts(requestParameters: CreateSecretRequest): Promise<runtime.RequestOpts> {
82
+ if (requestParameters['secretCreate'] == null) {
83
+ throw new runtime.RequiredError(
84
+ 'secretCreate',
85
+ 'Required parameter "secretCreate" was null or undefined when calling createSecret().'
86
+ );
87
+ }
88
+
89
+ const queryParameters: any = {};
90
+
91
+ const headerParameters: runtime.HTTPHeaders = {};
92
+
93
+ headerParameters['Content-Type'] = 'application/json';
94
+
95
+ if (this.configuration && this.configuration.accessToken) {
96
+ const token = this.configuration.accessToken;
97
+ const tokenString = await token("bearerAuth", []);
98
+
99
+ if (tokenString) {
100
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
101
+ }
102
+ }
103
+
104
+ let urlPath = `/secrets`;
105
+
106
+ return {
107
+ path: urlPath,
108
+ method: 'POST',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ body: SecretCreateToJSON(requestParameters['secretCreate']),
112
+ };
113
+ }
114
+
115
+ /**
116
+ * 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.
117
+ * Create a secret
118
+ */
119
+ async createSecretRaw(requestParameters: CreateSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>> {
120
+ const requestOptions = await this.createSecretRequestOpts(requestParameters);
121
+ const response = await this.request(requestOptions, initOverrides);
122
+
123
+ return new runtime.JSONApiResponse(response, (jsonValue) => SecretFromJSON(jsonValue));
124
+ }
125
+
126
+ /**
127
+ * 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.
128
+ * Create a secret
129
+ */
130
+ async createSecret(requestParameters: CreateSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret> {
131
+ const response = await this.createSecretRaw(requestParameters, initOverrides);
132
+ return await response.value();
133
+ }
134
+
135
+ /**
136
+ * Creates request options for deleteSecret without sending the request
137
+ */
138
+ async deleteSecretRequestOpts(requestParameters: DeleteSecretRequest): Promise<runtime.RequestOpts> {
139
+ if (requestParameters['name'] == null) {
140
+ throw new runtime.RequiredError(
141
+ 'name',
142
+ 'Required parameter "name" was null or undefined when calling deleteSecret().'
143
+ );
144
+ }
145
+
146
+ const queryParameters: any = {};
147
+
148
+ const headerParameters: runtime.HTTPHeaders = {};
149
+
150
+ if (this.configuration && this.configuration.accessToken) {
151
+ const token = this.configuration.accessToken;
152
+ const tokenString = await token("bearerAuth", []);
153
+
154
+ if (tokenString) {
155
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
156
+ }
157
+ }
158
+
159
+ let urlPath = `/secrets/{name}`;
160
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
161
+
162
+ return {
163
+ path: urlPath,
164
+ method: 'DELETE',
165
+ headers: headerParameters,
166
+ query: queryParameters,
167
+ };
168
+ }
169
+
170
+ /**
171
+ * 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.
172
+ * Delete a secret
173
+ */
174
+ async deleteSecretRaw(requestParameters: DeleteSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
175
+ const requestOptions = await this.deleteSecretRequestOpts(requestParameters);
176
+ const response = await this.request(requestOptions, initOverrides);
177
+
178
+ return new runtime.VoidApiResponse(response);
179
+ }
180
+
181
+ /**
182
+ * 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.
183
+ * Delete a secret
184
+ */
185
+ async deleteSecret(requestParameters: DeleteSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
186
+ await this.deleteSecretRaw(requestParameters, initOverrides);
187
+ }
188
+
189
+ /**
190
+ * Creates request options for getSecret without sending the request
191
+ */
192
+ async getSecretRequestOpts(requestParameters: GetSecretRequest): Promise<runtime.RequestOpts> {
193
+ if (requestParameters['name'] == null) {
194
+ throw new runtime.RequiredError(
195
+ 'name',
196
+ 'Required parameter "name" was null or undefined when calling getSecret().'
197
+ );
198
+ }
199
+
200
+ const queryParameters: any = {};
201
+
202
+ const headerParameters: runtime.HTTPHeaders = {};
203
+
204
+ if (this.configuration && this.configuration.accessToken) {
205
+ const token = this.configuration.accessToken;
206
+ const tokenString = await token("bearerAuth", []);
207
+
208
+ if (tokenString) {
209
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
210
+ }
211
+ }
212
+
213
+ let urlPath = `/secrets/{name}`;
214
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
215
+
216
+ return {
217
+ path: urlPath,
218
+ method: 'GET',
219
+ headers: headerParameters,
220
+ query: queryParameters,
221
+ };
222
+ }
223
+
224
+ /**
225
+ * 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.
226
+ * Get a secret\'s metadata
227
+ */
228
+ async getSecretRaw(requestParameters: GetSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>> {
229
+ const requestOptions = await this.getSecretRequestOpts(requestParameters);
230
+ const response = await this.request(requestOptions, initOverrides);
231
+
232
+ return new runtime.JSONApiResponse(response, (jsonValue) => SecretFromJSON(jsonValue));
233
+ }
234
+
235
+ /**
236
+ * 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.
237
+ * Get a secret\'s metadata
238
+ */
239
+ async getSecret(requestParameters: GetSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret> {
240
+ const response = await this.getSecretRaw(requestParameters, initOverrides);
241
+ return await response.value();
242
+ }
243
+
244
+ /**
245
+ * Creates request options for importSecrets without sending the request
246
+ */
247
+ async importSecretsRequestOpts(requestParameters: ImportSecretsRequest): Promise<runtime.RequestOpts> {
248
+ if (requestParameters['secretImportRequest'] == null) {
249
+ throw new runtime.RequiredError(
250
+ 'secretImportRequest',
251
+ 'Required parameter "secretImportRequest" was null or undefined when calling importSecrets().'
252
+ );
253
+ }
254
+
255
+ const queryParameters: any = {};
256
+
257
+ const headerParameters: runtime.HTTPHeaders = {};
258
+
259
+ headerParameters['Content-Type'] = 'application/json';
260
+
261
+ if (this.configuration && this.configuration.accessToken) {
262
+ const token = this.configuration.accessToken;
263
+ const tokenString = await token("bearerAuth", []);
264
+
265
+ if (tokenString) {
266
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
267
+ }
268
+ }
269
+
270
+ let urlPath = `/secrets/import`;
271
+
272
+ return {
273
+ path: urlPath,
274
+ method: 'POST',
275
+ headers: headerParameters,
276
+ query: queryParameters,
277
+ body: SecretImportRequestToJSON(requestParameters['secretImportRequest']),
278
+ };
279
+ }
280
+
281
+ /**
282
+ * 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.
283
+ * Import secrets
284
+ */
285
+ async importSecretsRaw(requestParameters: ImportSecretsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SecretImportResult>> {
286
+ const requestOptions = await this.importSecretsRequestOpts(requestParameters);
287
+ const response = await this.request(requestOptions, initOverrides);
288
+
289
+ return new runtime.JSONApiResponse(response, (jsonValue) => SecretImportResultFromJSON(jsonValue));
290
+ }
291
+
292
+ /**
293
+ * 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.
294
+ * Import secrets
295
+ */
296
+ async importSecrets(requestParameters: ImportSecretsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SecretImportResult> {
297
+ const response = await this.importSecretsRaw(requestParameters, initOverrides);
298
+ return await response.value();
299
+ }
300
+
301
+ /**
302
+ * Creates request options for listSecrets without sending the request
303
+ */
304
+ async listSecretsRequestOpts(): Promise<runtime.RequestOpts> {
305
+ const queryParameters: any = {};
306
+
307
+ const headerParameters: runtime.HTTPHeaders = {};
308
+
309
+ if (this.configuration && this.configuration.accessToken) {
310
+ const token = this.configuration.accessToken;
311
+ const tokenString = await token("bearerAuth", []);
312
+
313
+ if (tokenString) {
314
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
315
+ }
316
+ }
317
+
318
+ let urlPath = `/secrets`;
319
+
320
+ return {
321
+ path: urlPath,
322
+ method: 'GET',
323
+ headers: headerParameters,
324
+ query: queryParameters,
325
+ };
326
+ }
327
+
328
+ /**
329
+ * 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.
330
+ * List secrets
331
+ */
332
+ async listSecretsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SecretList>> {
333
+ const requestOptions = await this.listSecretsRequestOpts();
334
+ const response = await this.request(requestOptions, initOverrides);
335
+
336
+ return new runtime.JSONApiResponse(response, (jsonValue) => SecretListFromJSON(jsonValue));
337
+ }
338
+
339
+ /**
340
+ * 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.
341
+ * List secrets
342
+ */
343
+ async listSecrets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SecretList> {
344
+ const response = await this.listSecretsRaw(initOverrides);
345
+ return await response.value();
346
+ }
347
+
348
+ /**
349
+ * Creates request options for putSecret without sending the request
350
+ */
351
+ async putSecretRequestOpts(requestParameters: PutSecretRequest): Promise<runtime.RequestOpts> {
352
+ if (requestParameters['name'] == null) {
353
+ throw new runtime.RequiredError(
354
+ 'name',
355
+ 'Required parameter "name" was null or undefined when calling putSecret().'
356
+ );
357
+ }
358
+
359
+ if (requestParameters['secretPut'] == null) {
360
+ throw new runtime.RequiredError(
361
+ 'secretPut',
362
+ 'Required parameter "secretPut" was null or undefined when calling putSecret().'
363
+ );
364
+ }
365
+
366
+ const queryParameters: any = {};
367
+
368
+ const headerParameters: runtime.HTTPHeaders = {};
369
+
370
+ headerParameters['Content-Type'] = 'application/json';
371
+
372
+ if (this.configuration && this.configuration.accessToken) {
373
+ const token = this.configuration.accessToken;
374
+ const tokenString = await token("bearerAuth", []);
375
+
376
+ if (tokenString) {
377
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
378
+ }
379
+ }
380
+
381
+ let urlPath = `/secrets/{name}`;
382
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
383
+
384
+ return {
385
+ path: urlPath,
386
+ method: 'PUT',
387
+ headers: headerParameters,
388
+ query: queryParameters,
389
+ body: SecretPutToJSON(requestParameters['secretPut']),
390
+ };
391
+ }
392
+
393
+ /**
394
+ * 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.
395
+ * Create or replace a secret
396
+ */
397
+ async putSecretRaw(requestParameters: PutSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Secret>> {
398
+ const requestOptions = await this.putSecretRequestOpts(requestParameters);
399
+ const response = await this.request(requestOptions, initOverrides);
400
+
401
+ return new runtime.JSONApiResponse(response, (jsonValue) => SecretFromJSON(jsonValue));
402
+ }
403
+
404
+ /**
405
+ * 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.
406
+ * Create or replace a secret
407
+ */
408
+ async putSecret(requestParameters: PutSecretRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Secret> {
409
+ const response = await this.putSecretRaw(requestParameters, initOverrides);
410
+ return await response.value();
411
+ }
412
+
413
+ }
package/src/apis/index.ts CHANGED
@@ -3,17 +3,20 @@
3
3
  export * from './AutolaunchApi';
4
4
  export * from './BillingApi';
5
5
  export * from './CommunityApi';
6
+ export * from './EndpointsApi';
6
7
  export * from './EnvironmentsApi';
7
8
  export * from './FineTuningApi';
8
9
  export * from './FunctionsApi';
9
10
  export * from './GpuTypesApi';
10
11
  export * from './InferenceApi';
11
12
  export * from './InstancesApi';
13
+ export * from './JobsApi';
12
14
  export * from './MarketApi';
13
15
  export * from './MetaApi';
14
16
  export * from './OperationsApi';
15
17
  export * from './PricingApi';
16
18
  export * from './RegistryCredentialsApi';
19
+ export * from './SecretsApi';
17
20
  export * from './SshKeysApi';
18
21
  export * from './TemplatesApi';
19
22
  export * from './UsageApi';
@@ -58,6 +58,12 @@ export interface Balance {
58
58
  * @memberof Balance
59
59
  */
60
60
  burnCentsPerHour: number | null;
61
+ /**
62
+ * How many hours the balance lasts at the current usage: the balance divided by `burn_cents_per_hour` plus serverless inference spend over the last hour, rounded to 2 places. `null` when nothing is running or the burn rate could not be determined; 0 when the balance is at or below $0 while burning. Machines stop when the balance reaches $0.
63
+ * @type {number}
64
+ * @memberof Balance
65
+ */
66
+ runwayHours?: number | null;
61
67
  }
62
68
 
63
69
  /**
@@ -89,6 +95,7 @@ export function BalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): B
89
95
  'autoPayThresholdCents': json['auto_pay_threshold_cents'],
90
96
  'autoPayAmountCents': json['auto_pay_amount_cents'],
91
97
  'burnCentsPerHour': json['burn_cents_per_hour'],
98
+ 'runwayHours': json['runway_hours'] === undefined ? undefined : json['runway_hours'] === null ? null : json['runway_hours'],
92
99
  };
93
100
  }
94
101
 
@@ -109,6 +116,7 @@ export function BalanceToJSONTyped(value?: Balance | null, ignoreDiscriminator:
109
116
  'auto_pay_threshold_cents': value['autoPayThresholdCents'],
110
117
  'auto_pay_amount_cents': value['autoPayAmountCents'],
111
118
  'burn_cents_per_hour': value['burnCentsPerHour'],
119
+ 'runway_hours': value['runwayHours'],
112
120
  };
113
121
  }
114
122
 
@@ -43,7 +43,10 @@ export const CreateWebhookEndpointRequestEventTypesEnum = {
43
43
  InstanceTerminated: 'instance.terminated',
44
44
  InstanceFailed: 'instance.failed',
45
45
  VideoCompleted: 'video.completed',
46
- VideoFailed: 'video.failed'
46
+ VideoFailed: 'video.failed',
47
+ WatchAlertFired: 'watch.alert.fired',
48
+ BalanceLow: 'balance.low',
49
+ BalanceExhausted: 'balance.exhausted'
47
50
  } as const;
48
51
  export type CreateWebhookEndpointRequestEventTypesEnum = typeof CreateWebhookEndpointRequestEventTypesEnum[keyof typeof CreateWebhookEndpointRequestEventTypesEnum];
49
52
 
@@ -0,0 +1,165 @@
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 { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface DedicatedIPOffer
20
+ */
21
+ export interface DedicatedIPOffer {
22
+ /**
23
+ *
24
+ * @type {boolean}
25
+ * @memberof DedicatedIPOffer
26
+ */
27
+ enabled: boolean;
28
+ /**
29
+ * Ports and port ranges a launch may forward, e.g. `80,443,1024-65535`.
30
+ * @type {string}
31
+ * @memberof DedicatedIPOffer
32
+ */
33
+ allowedPorts: string;
34
+ /**
35
+ * Ports forwarded when the request names none.
36
+ * @type {Array<number>}
37
+ * @memberof DedicatedIPOffer
38
+ */
39
+ defaultPorts: Array<number>;
40
+ /**
41
+ * Most ports one address may forward.
42
+ * @type {number}
43
+ * @memberof DedicatedIPOffer
44
+ */
45
+ maxPorts: number;
46
+ /**
47
+ * USD per hour while attached, from the instance becoming running until release.
48
+ * @type {number}
49
+ * @memberof DedicatedIPOffer
50
+ */
51
+ hourlyFee: number;
52
+ /**
53
+ * USD per GB through the address, inbound and outbound.
54
+ * @type {number}
55
+ * @memberof DedicatedIPOffer
56
+ */
57
+ transferPricePerGb: number;
58
+ /**
59
+ * GB of transfer per attachment that is not charged.
60
+ * @type {number}
61
+ * @memberof DedicatedIPOffer
62
+ */
63
+ transferIncludedGb: number;
64
+ /**
65
+ * GB per attachment after which forwarding is suspended.
66
+ * @type {number}
67
+ * @memberof DedicatedIPOffer
68
+ */
69
+ transferCapGb: number;
70
+ /**
71
+ * Most dedicated IPs the organization may hold at once.
72
+ * @type {number}
73
+ * @memberof DedicatedIPOffer
74
+ */
75
+ orgLimit: number;
76
+ /**
77
+ * Dedicated IPs the organization holds now.
78
+ * @type {number}
79
+ * @memberof DedicatedIPOffer
80
+ */
81
+ orgInUse: number;
82
+ /**
83
+ * Addresses free for a new launch right now.
84
+ * @type {number}
85
+ * @memberof DedicatedIPOffer
86
+ */
87
+ available: number;
88
+ /**
89
+ * The acceptable use policy for dedicated IPs.
90
+ * @type {string}
91
+ * @memberof DedicatedIPOffer
92
+ */
93
+ acceptableUse: string;
94
+ }
95
+
96
+ /**
97
+ * Check if a given object implements the DedicatedIPOffer interface.
98
+ */
99
+ export function instanceOfDedicatedIPOffer(value: object): value is DedicatedIPOffer {
100
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
101
+ if ((!('allowedPorts' in (value as Record<string, any>)) && !('allowed_ports' in (value as Record<string, any>))) || ((value as Record<string, any>)['allowedPorts'] === undefined && (value as Record<string, any>)['allowed_ports'] === undefined)) return false;
102
+ if ((!('defaultPorts' in (value as Record<string, any>)) && !('default_ports' in (value as Record<string, any>))) || ((value as Record<string, any>)['defaultPorts'] === undefined && (value as Record<string, any>)['default_ports'] === undefined)) return false;
103
+ if ((!('maxPorts' in (value as Record<string, any>)) && !('max_ports' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxPorts'] === undefined && (value as Record<string, any>)['max_ports'] === undefined)) return false;
104
+ if ((!('hourlyFee' in (value as Record<string, any>)) && !('hourly_fee' in (value as Record<string, any>))) || ((value as Record<string, any>)['hourlyFee'] === undefined && (value as Record<string, any>)['hourly_fee'] === undefined)) return false;
105
+ if ((!('transferPricePerGb' in (value as Record<string, any>)) && !('transfer_price_per_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferPricePerGb'] === undefined && (value as Record<string, any>)['transfer_price_per_gb'] === undefined)) return false;
106
+ if ((!('transferIncludedGb' in (value as Record<string, any>)) && !('transfer_included_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferIncludedGb'] === undefined && (value as Record<string, any>)['transfer_included_gb'] === undefined)) return false;
107
+ if ((!('transferCapGb' in (value as Record<string, any>)) && !('transfer_cap_gb' in (value as Record<string, any>))) || ((value as Record<string, any>)['transferCapGb'] === undefined && (value as Record<string, any>)['transfer_cap_gb'] === undefined)) return false;
108
+ if ((!('orgLimit' in (value as Record<string, any>)) && !('org_limit' in (value as Record<string, any>))) || ((value as Record<string, any>)['orgLimit'] === undefined && (value as Record<string, any>)['org_limit'] === undefined)) return false;
109
+ if ((!('orgInUse' in (value as Record<string, any>)) && !('org_in_use' in (value as Record<string, any>))) || ((value as Record<string, any>)['orgInUse'] === undefined && (value as Record<string, any>)['org_in_use'] === undefined)) return false;
110
+ if (!('available' in value) || value['available'] === undefined) return false;
111
+ if ((!('acceptableUse' in (value as Record<string, any>)) && !('acceptable_use' in (value as Record<string, any>))) || ((value as Record<string, any>)['acceptableUse'] === undefined && (value as Record<string, any>)['acceptable_use'] === undefined)) return false;
112
+ return true;
113
+ }
114
+
115
+ export function DedicatedIPOfferFromJSON(json: any): DedicatedIPOffer {
116
+ return DedicatedIPOfferFromJSONTyped(json, false);
117
+ }
118
+
119
+ export function DedicatedIPOfferFromJSONTyped(json: any, ignoreDiscriminator: boolean): DedicatedIPOffer {
120
+ if (json == null) {
121
+ return json;
122
+ }
123
+ return {
124
+
125
+ 'enabled': json['enabled'],
126
+ 'allowedPorts': json['allowed_ports'],
127
+ 'defaultPorts': json['default_ports'],
128
+ 'maxPorts': json['max_ports'],
129
+ 'hourlyFee': json['hourly_fee'],
130
+ 'transferPricePerGb': json['transfer_price_per_gb'],
131
+ 'transferIncludedGb': json['transfer_included_gb'],
132
+ 'transferCapGb': json['transfer_cap_gb'],
133
+ 'orgLimit': json['org_limit'],
134
+ 'orgInUse': json['org_in_use'],
135
+ 'available': json['available'],
136
+ 'acceptableUse': json['acceptable_use'],
137
+ };
138
+ }
139
+
140
+ export function DedicatedIPOfferToJSON(json: any): DedicatedIPOffer {
141
+ return DedicatedIPOfferToJSONTyped(json, false);
142
+ }
143
+
144
+ export function DedicatedIPOfferToJSONTyped(value?: DedicatedIPOffer | null, ignoreDiscriminator: boolean = false): any {
145
+ if (value == null) {
146
+ return value;
147
+ }
148
+
149
+ return {
150
+
151
+ 'enabled': value['enabled'],
152
+ 'allowed_ports': value['allowedPorts'],
153
+ 'default_ports': value['defaultPorts'],
154
+ 'max_ports': value['maxPorts'],
155
+ 'hourly_fee': value['hourlyFee'],
156
+ 'transfer_price_per_gb': value['transferPricePerGb'],
157
+ 'transfer_included_gb': value['transferIncludedGb'],
158
+ 'transfer_cap_gb': value['transferCapGb'],
159
+ 'org_limit': value['orgLimit'],
160
+ 'org_in_use': value['orgInUse'],
161
+ 'available': value['available'],
162
+ 'acceptable_use': value['acceptableUse'],
163
+ };
164
+ }
165
+