@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,450 @@
|
|
|
1
|
+
# SecretsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.gpu.ai/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createSecret**](SecretsApi.md#createsecret) | **POST** /secrets | Create a secret |
|
|
8
|
+
| [**deleteSecret**](SecretsApi.md#deletesecret) | **DELETE** /secrets/{name} | Delete a secret |
|
|
9
|
+
| [**getSecret**](SecretsApi.md#getsecret) | **GET** /secrets/{name} | Get a secret\'s metadata |
|
|
10
|
+
| [**importSecrets**](SecretsApi.md#importsecrets) | **POST** /secrets/import | Import secrets |
|
|
11
|
+
| [**listSecrets**](SecretsApi.md#listsecrets) | **GET** /secrets | List secrets |
|
|
12
|
+
| [**putSecret**](SecretsApi.md#putsecret) | **PUT** /secrets/{name} | Create or replace a secret |
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## createSecret
|
|
17
|
+
|
|
18
|
+
> Secret createSecret(secretCreate)
|
|
19
|
+
|
|
20
|
+
Create a secret
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Example
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import {
|
|
28
|
+
Configuration,
|
|
29
|
+
SecretsApi,
|
|
30
|
+
} from '@gpuai/sdk';
|
|
31
|
+
import type { CreateSecretRequest } from '@gpuai/sdk';
|
|
32
|
+
|
|
33
|
+
async function example() {
|
|
34
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
35
|
+
const config = new Configuration({
|
|
36
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
37
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
38
|
+
});
|
|
39
|
+
const api = new SecretsApi(config);
|
|
40
|
+
|
|
41
|
+
const body = {
|
|
42
|
+
// SecretCreate
|
|
43
|
+
secretCreate: ...,
|
|
44
|
+
} satisfies CreateSecretRequest;
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const data = await api.createSecret(body);
|
|
48
|
+
console.log(data);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Run the test
|
|
55
|
+
example().catch(console.error);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Parameters
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
| Name | Type | Description | Notes |
|
|
62
|
+
|------------- | ------------- | ------------- | -------------|
|
|
63
|
+
| **secretCreate** | [SecretCreate](SecretCreate.md) | | |
|
|
64
|
+
|
|
65
|
+
### Return type
|
|
66
|
+
|
|
67
|
+
[**Secret**](Secret.md)
|
|
68
|
+
|
|
69
|
+
### Authorization
|
|
70
|
+
|
|
71
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
72
|
+
|
|
73
|
+
### HTTP request headers
|
|
74
|
+
|
|
75
|
+
- **Content-Type**: `application/json`
|
|
76
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### HTTP response details
|
|
80
|
+
| Status code | Description | Response headers |
|
|
81
|
+
|-------------|-------------|------------------|
|
|
82
|
+
| **201** | Created (metadata only; no value). | - |
|
|
83
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
84
|
+
| **0** | Error response (RFC 7807) | - |
|
|
85
|
+
|
|
86
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## deleteSecret
|
|
90
|
+
|
|
91
|
+
> deleteSecret(name)
|
|
92
|
+
|
|
93
|
+
Delete a secret
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
### Example
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import {
|
|
101
|
+
Configuration,
|
|
102
|
+
SecretsApi,
|
|
103
|
+
} from '@gpuai/sdk';
|
|
104
|
+
import type { DeleteSecretRequest } from '@gpuai/sdk';
|
|
105
|
+
|
|
106
|
+
async function example() {
|
|
107
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
108
|
+
const config = new Configuration({
|
|
109
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
110
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
111
|
+
});
|
|
112
|
+
const api = new SecretsApi(config);
|
|
113
|
+
|
|
114
|
+
const body = {
|
|
115
|
+
// string | The secret\'s name.
|
|
116
|
+
name: name_example,
|
|
117
|
+
} satisfies DeleteSecretRequest;
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
const data = await api.deleteSecret(body);
|
|
121
|
+
console.log(data);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error(error);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Run the test
|
|
128
|
+
example().catch(console.error);
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Parameters
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
| Name | Type | Description | Notes |
|
|
135
|
+
|------------- | ------------- | ------------- | -------------|
|
|
136
|
+
| **name** | `string` | The secret\'s name. | [Defaults to `undefined`] |
|
|
137
|
+
|
|
138
|
+
### Return type
|
|
139
|
+
|
|
140
|
+
`void` (Empty response body)
|
|
141
|
+
|
|
142
|
+
### Authorization
|
|
143
|
+
|
|
144
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
145
|
+
|
|
146
|
+
### HTTP request headers
|
|
147
|
+
|
|
148
|
+
- **Content-Type**: Not defined
|
|
149
|
+
- **Accept**: `application/problem+json`
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
### HTTP response details
|
|
153
|
+
| Status code | Description | Response headers |
|
|
154
|
+
|-------------|-------------|------------------|
|
|
155
|
+
| **204** | Deleted. | - |
|
|
156
|
+
| **404** | Error response (RFC 7807) | - |
|
|
157
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
158
|
+
| **0** | Error response (RFC 7807) | - |
|
|
159
|
+
|
|
160
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## getSecret
|
|
164
|
+
|
|
165
|
+
> Secret getSecret(name)
|
|
166
|
+
|
|
167
|
+
Get a secret\'s metadata
|
|
168
|
+
|
|
169
|
+
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.
|
|
170
|
+
|
|
171
|
+
### Example
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
import {
|
|
175
|
+
Configuration,
|
|
176
|
+
SecretsApi,
|
|
177
|
+
} from '@gpuai/sdk';
|
|
178
|
+
import type { GetSecretRequest } from '@gpuai/sdk';
|
|
179
|
+
|
|
180
|
+
async function example() {
|
|
181
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
182
|
+
const config = new Configuration({
|
|
183
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
184
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
185
|
+
});
|
|
186
|
+
const api = new SecretsApi(config);
|
|
187
|
+
|
|
188
|
+
const body = {
|
|
189
|
+
// string | The secret\'s name.
|
|
190
|
+
name: name_example,
|
|
191
|
+
} satisfies GetSecretRequest;
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
const data = await api.getSecret(body);
|
|
195
|
+
console.log(data);
|
|
196
|
+
} catch (error) {
|
|
197
|
+
console.error(error);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Run the test
|
|
202
|
+
example().catch(console.error);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Parameters
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
| Name | Type | Description | Notes |
|
|
209
|
+
|------------- | ------------- | ------------- | -------------|
|
|
210
|
+
| **name** | `string` | The secret\'s name. | [Defaults to `undefined`] |
|
|
211
|
+
|
|
212
|
+
### Return type
|
|
213
|
+
|
|
214
|
+
[**Secret**](Secret.md)
|
|
215
|
+
|
|
216
|
+
### Authorization
|
|
217
|
+
|
|
218
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
219
|
+
|
|
220
|
+
### HTTP request headers
|
|
221
|
+
|
|
222
|
+
- **Content-Type**: Not defined
|
|
223
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
### HTTP response details
|
|
227
|
+
| Status code | Description | Response headers |
|
|
228
|
+
|-------------|-------------|------------------|
|
|
229
|
+
| **200** | The secret (no value). | - |
|
|
230
|
+
| **404** | Error response (RFC 7807) | - |
|
|
231
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
232
|
+
| **0** | Error response (RFC 7807) | - |
|
|
233
|
+
|
|
234
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
## importSecrets
|
|
238
|
+
|
|
239
|
+
> SecretImportResult importSecrets(secretImportRequest)
|
|
240
|
+
|
|
241
|
+
Import secrets
|
|
242
|
+
|
|
243
|
+
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.
|
|
244
|
+
|
|
245
|
+
### Example
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
import {
|
|
249
|
+
Configuration,
|
|
250
|
+
SecretsApi,
|
|
251
|
+
} from '@gpuai/sdk';
|
|
252
|
+
import type { ImportSecretsRequest } from '@gpuai/sdk';
|
|
253
|
+
|
|
254
|
+
async function example() {
|
|
255
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
256
|
+
const config = new Configuration({
|
|
257
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
258
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
259
|
+
});
|
|
260
|
+
const api = new SecretsApi(config);
|
|
261
|
+
|
|
262
|
+
const body = {
|
|
263
|
+
// SecretImportRequest
|
|
264
|
+
secretImportRequest: ...,
|
|
265
|
+
} satisfies ImportSecretsRequest;
|
|
266
|
+
|
|
267
|
+
try {
|
|
268
|
+
const data = await api.importSecrets(body);
|
|
269
|
+
console.log(data);
|
|
270
|
+
} catch (error) {
|
|
271
|
+
console.error(error);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Run the test
|
|
276
|
+
example().catch(console.error);
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Parameters
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
| Name | Type | Description | Notes |
|
|
283
|
+
|------------- | ------------- | ------------- | -------------|
|
|
284
|
+
| **secretImportRequest** | [SecretImportRequest](SecretImportRequest.md) | | |
|
|
285
|
+
|
|
286
|
+
### Return type
|
|
287
|
+
|
|
288
|
+
[**SecretImportResult**](SecretImportResult.md)
|
|
289
|
+
|
|
290
|
+
### Authorization
|
|
291
|
+
|
|
292
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
293
|
+
|
|
294
|
+
### HTTP request headers
|
|
295
|
+
|
|
296
|
+
- **Content-Type**: `application/json`
|
|
297
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
### HTTP response details
|
|
301
|
+
| Status code | Description | Response headers |
|
|
302
|
+
|-------------|-------------|------------------|
|
|
303
|
+
| **200** | What the import did, by name. | - |
|
|
304
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
305
|
+
| **0** | Error response (RFC 7807) | - |
|
|
306
|
+
|
|
307
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
## listSecrets
|
|
311
|
+
|
|
312
|
+
> SecretList listSecrets()
|
|
313
|
+
|
|
314
|
+
List secrets
|
|
315
|
+
|
|
316
|
+
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.
|
|
317
|
+
|
|
318
|
+
### Example
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
import {
|
|
322
|
+
Configuration,
|
|
323
|
+
SecretsApi,
|
|
324
|
+
} from '@gpuai/sdk';
|
|
325
|
+
import type { ListSecretsRequest } from '@gpuai/sdk';
|
|
326
|
+
|
|
327
|
+
async function example() {
|
|
328
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
329
|
+
const config = new Configuration({
|
|
330
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
331
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
332
|
+
});
|
|
333
|
+
const api = new SecretsApi(config);
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
const data = await api.listSecrets();
|
|
337
|
+
console.log(data);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
console.error(error);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Run the test
|
|
344
|
+
example().catch(console.error);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Parameters
|
|
348
|
+
|
|
349
|
+
This endpoint does not need any parameter.
|
|
350
|
+
|
|
351
|
+
### Return type
|
|
352
|
+
|
|
353
|
+
[**SecretList**](SecretList.md)
|
|
354
|
+
|
|
355
|
+
### Authorization
|
|
356
|
+
|
|
357
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
358
|
+
|
|
359
|
+
### HTTP request headers
|
|
360
|
+
|
|
361
|
+
- **Content-Type**: Not defined
|
|
362
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
### HTTP response details
|
|
366
|
+
| Status code | Description | Response headers |
|
|
367
|
+
|-------------|-------------|------------------|
|
|
368
|
+
| **200** | The organization\'s secrets (no values). | - |
|
|
369
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
370
|
+
| **0** | Error response (RFC 7807) | - |
|
|
371
|
+
|
|
372
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
## putSecret
|
|
376
|
+
|
|
377
|
+
> Secret putSecret(name, secretPut)
|
|
378
|
+
|
|
379
|
+
Create or replace a secret
|
|
380
|
+
|
|
381
|
+
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.
|
|
382
|
+
|
|
383
|
+
### Example
|
|
384
|
+
|
|
385
|
+
```ts
|
|
386
|
+
import {
|
|
387
|
+
Configuration,
|
|
388
|
+
SecretsApi,
|
|
389
|
+
} from '@gpuai/sdk';
|
|
390
|
+
import type { PutSecretRequest } from '@gpuai/sdk';
|
|
391
|
+
|
|
392
|
+
async function example() {
|
|
393
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
394
|
+
const config = new Configuration({
|
|
395
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
396
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
397
|
+
});
|
|
398
|
+
const api = new SecretsApi(config);
|
|
399
|
+
|
|
400
|
+
const body = {
|
|
401
|
+
// string | The secret\'s name.
|
|
402
|
+
name: name_example,
|
|
403
|
+
// SecretPut
|
|
404
|
+
secretPut: ...,
|
|
405
|
+
} satisfies PutSecretRequest;
|
|
406
|
+
|
|
407
|
+
try {
|
|
408
|
+
const data = await api.putSecret(body);
|
|
409
|
+
console.log(data);
|
|
410
|
+
} catch (error) {
|
|
411
|
+
console.error(error);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Run the test
|
|
416
|
+
example().catch(console.error);
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Parameters
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
| Name | Type | Description | Notes |
|
|
423
|
+
|------------- | ------------- | ------------- | -------------|
|
|
424
|
+
| **name** | `string` | The secret\'s name. | [Defaults to `undefined`] |
|
|
425
|
+
| **secretPut** | [SecretPut](SecretPut.md) | | |
|
|
426
|
+
|
|
427
|
+
### Return type
|
|
428
|
+
|
|
429
|
+
[**Secret**](Secret.md)
|
|
430
|
+
|
|
431
|
+
### Authorization
|
|
432
|
+
|
|
433
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
434
|
+
|
|
435
|
+
### HTTP request headers
|
|
436
|
+
|
|
437
|
+
- **Content-Type**: `application/json`
|
|
438
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
### HTTP response details
|
|
442
|
+
| Status code | Description | Response headers |
|
|
443
|
+
|-------------|-------------|------------------|
|
|
444
|
+
| **200** | Value replaced (metadata only). | - |
|
|
445
|
+
| **201** | Created (metadata only). | - |
|
|
446
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
447
|
+
| **0** | Error response (RFC 7807) | - |
|
|
448
|
+
|
|
449
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
450
|
+
|