@gpuai/sdk 0.3.12 → 0.3.14
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 +36 -0
- package/README.md +38 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/InferenceApi.d.ts +19 -0
- package/dist/apis/InferenceApi.js +51 -0
- package/dist/apis/MarketApi.d.ts +56 -0
- package/dist/apis/MarketApi.js +112 -0
- package/dist/apis/WatchApi.d.ts +109 -0
- package/dist/apis/WatchApi.js +286 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
- package/dist/esm/apis/AutolaunchApi.js +282 -0
- package/dist/esm/apis/InferenceApi.d.ts +19 -0
- package/dist/esm/apis/InferenceApi.js +51 -0
- package/dist/esm/apis/MarketApi.d.ts +56 -0
- package/dist/esm/apis/MarketApi.js +108 -0
- package/dist/esm/apis/WatchApi.d.ts +109 -0
- package/dist/esm/apis/WatchApi.js +282 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AutolaunchRule.d.ts +181 -0
- package/dist/esm/models/AutolaunchRule.js +142 -0
- package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
- package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
- package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/esm/models/AutolaunchRulePage.js +48 -0
- package/dist/esm/models/Embedding.d.ts +51 -0
- package/dist/esm/models/Embedding.js +59 -0
- package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/esm/models/EmbeddingsRequest.js +60 -0
- package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
- package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/esm/models/EmbeddingsResponse.js +65 -0
- package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/esm/models/EmbeddingsUsage.js +47 -0
- package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/esm/models/MarketHistoryPoint.js +55 -0
- package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/esm/models/MarketHistoryResponse.js +60 -0
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/WatchRule.d.ts +141 -0
- package/dist/esm/models/WatchRule.js +117 -0
- package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
- package/dist/esm/models/WatchRuleCreate.js +72 -0
- package/dist/esm/models/WatchRulePage.d.ts +39 -0
- package/dist/esm/models/WatchRulePage.js +48 -0
- package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/esm/models/WatchRuleUpdate.js +68 -0
- package/dist/esm/models/index.d.ts +15 -0
- package/dist/esm/models/index.js +15 -0
- package/dist/models/AutolaunchRule.d.ts +181 -0
- package/dist/models/AutolaunchRule.js +150 -0
- package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/models/AutolaunchRuleCreate.js +92 -0
- package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/models/AutolaunchRuleDisarm.js +50 -0
- package/dist/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/models/AutolaunchRulePage.js +55 -0
- package/dist/models/Embedding.d.ts +51 -0
- package/dist/models/Embedding.js +67 -0
- package/dist/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/models/EmbeddingsRequest.js +68 -0
- package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/models/EmbeddingsRequestInput.js +53 -0
- package/dist/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/models/EmbeddingsResponse.js +73 -0
- package/dist/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/models/EmbeddingsUsage.js +54 -0
- package/dist/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/models/MarketHistoryPoint.js +62 -0
- package/dist/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/models/MarketHistoryResponse.js +67 -0
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/WatchRule.d.ts +141 -0
- package/dist/models/WatchRule.js +125 -0
- package/dist/models/WatchRuleCreate.d.ts +87 -0
- package/dist/models/WatchRuleCreate.js +80 -0
- package/dist/models/WatchRulePage.d.ts +39 -0
- package/dist/models/WatchRulePage.js +55 -0
- package/dist/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/models/WatchRuleUpdate.js +76 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.js +15 -0
- package/docs/AutolaunchApi.md +390 -0
- package/docs/AutolaunchRule.md +69 -0
- package/docs/AutolaunchRuleCreate.md +50 -0
- package/docs/AutolaunchRuleDisarm.md +35 -0
- package/docs/AutolaunchRulePage.md +36 -0
- package/docs/Embedding.md +38 -0
- package/docs/EmbeddingsRequest.md +42 -0
- package/docs/EmbeddingsRequestInput.md +33 -0
- package/docs/EmbeddingsResponse.md +40 -0
- package/docs/EmbeddingsUsage.md +37 -0
- package/docs/InferenceApi.md +83 -0
- package/docs/MarketApi.md +98 -0
- package/docs/MarketHistoryPoint.md +43 -0
- package/docs/MarketHistoryResponse.md +43 -0
- package/docs/WatchApi.md +389 -0
- package/docs/WatchRule.md +61 -0
- package/docs/WatchRuleCreate.md +46 -0
- package/docs/WatchRulePage.md +36 -0
- package/docs/WatchRuleUpdate.md +47 -0
- package/package.json +1 -1
- package/src/apis/AutolaunchApi.ts +360 -0
- package/src/apis/InferenceApi.ts +71 -0
- package/src/apis/MarketApi.ts +136 -0
- package/src/apis/WatchApi.ts +360 -0
- package/src/apis/index.ts +3 -0
- package/src/models/AutolaunchRule.ts +270 -0
- package/src/models/AutolaunchRuleCreate.ts +162 -0
- package/src/models/AutolaunchRuleDisarm.ts +68 -0
- package/src/models/AutolaunchRulePage.ts +83 -0
- package/src/models/Embedding.ts +96 -0
- package/src/models/EmbeddingsRequest.ts +117 -0
- package/src/models/EmbeddingsRequestInput.ts +59 -0
- package/src/models/EmbeddingsResponse.ts +120 -0
- package/src/models/EmbeddingsUsage.ts +75 -0
- package/src/models/MarketHistoryPoint.ts +103 -0
- package/src/models/MarketHistoryResponse.ts +113 -0
- package/src/models/Problem.ts +1 -0
- package/src/models/WatchRule.ts +219 -0
- package/src/models/WatchRuleCreate.ts +138 -0
- package/src/models/WatchRulePage.ts +83 -0
- package/src/models/WatchRuleUpdate.ts +135 -0
- package/src/models/index.ts +15 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GPU.ai Public Developer API
|
|
6
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@gpu.ai
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.WatchApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const WatchRule_1 = require("../models/WatchRule");
|
|
28
|
+
const WatchRuleCreate_1 = require("../models/WatchRuleCreate");
|
|
29
|
+
const WatchRulePage_1 = require("../models/WatchRulePage");
|
|
30
|
+
const WatchRuleUpdate_1 = require("../models/WatchRuleUpdate");
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
class WatchApi extends runtime.BaseAPI {
|
|
35
|
+
/**
|
|
36
|
+
* Creates request options for createWatchRule without sending the request
|
|
37
|
+
*/
|
|
38
|
+
createWatchRuleRequestOpts(requestParameters) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (requestParameters['watchRuleCreate'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('watchRuleCreate', 'Required parameter "watchRuleCreate" was null or undefined when calling createWatchRule().');
|
|
42
|
+
}
|
|
43
|
+
const queryParameters = {};
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
46
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
47
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
48
|
+
}
|
|
49
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
50
|
+
const token = this.configuration.accessToken;
|
|
51
|
+
const tokenString = yield token("bearerAuth", []);
|
|
52
|
+
if (tokenString) {
|
|
53
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let urlPath = `/watch-rules`;
|
|
57
|
+
return {
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
body: (0, WatchRuleCreate_1.WatchRuleCreateToJSON)(requestParameters['watchRuleCreate']),
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
|
|
68
|
+
* Create a watch rule
|
|
69
|
+
*/
|
|
70
|
+
createWatchRuleRaw(requestParameters, initOverrides) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const requestOptions = yield this.createWatchRuleRequestOpts(requestParameters);
|
|
73
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
74
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
|
|
79
|
+
* Create a watch rule
|
|
80
|
+
*/
|
|
81
|
+
createWatchRule(requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const response = yield this.createWatchRuleRaw(requestParameters, initOverrides);
|
|
84
|
+
return yield response.value();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Creates request options for deleteWatchRule without sending the request
|
|
89
|
+
*/
|
|
90
|
+
deleteWatchRuleRequestOpts(requestParameters) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (requestParameters['id'] == null) {
|
|
93
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteWatchRule().');
|
|
94
|
+
}
|
|
95
|
+
const queryParameters = {};
|
|
96
|
+
const headerParameters = {};
|
|
97
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
98
|
+
const token = this.configuration.accessToken;
|
|
99
|
+
const tokenString = yield token("bearerAuth", []);
|
|
100
|
+
if (tokenString) {
|
|
101
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
let urlPath = `/watch-rules/{id}`;
|
|
105
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
106
|
+
return {
|
|
107
|
+
path: urlPath,
|
|
108
|
+
method: 'DELETE',
|
|
109
|
+
headers: headerParameters,
|
|
110
|
+
query: queryParameters,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
|
|
116
|
+
* Delete a watch rule
|
|
117
|
+
*/
|
|
118
|
+
deleteWatchRuleRaw(requestParameters, initOverrides) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const requestOptions = yield this.deleteWatchRuleRequestOpts(requestParameters);
|
|
121
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
122
|
+
return new runtime.VoidApiResponse(response);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
|
|
127
|
+
* Delete a watch rule
|
|
128
|
+
*/
|
|
129
|
+
deleteWatchRule(requestParameters, initOverrides) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
yield this.deleteWatchRuleRaw(requestParameters, initOverrides);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Creates request options for getWatchRule without sending the request
|
|
136
|
+
*/
|
|
137
|
+
getWatchRuleRequestOpts(requestParameters) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
if (requestParameters['id'] == null) {
|
|
140
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWatchRule().');
|
|
141
|
+
}
|
|
142
|
+
const queryParameters = {};
|
|
143
|
+
const headerParameters = {};
|
|
144
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
145
|
+
const token = this.configuration.accessToken;
|
|
146
|
+
const tokenString = yield token("bearerAuth", []);
|
|
147
|
+
if (tokenString) {
|
|
148
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
let urlPath = `/watch-rules/{id}`;
|
|
152
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
153
|
+
return {
|
|
154
|
+
path: urlPath,
|
|
155
|
+
method: 'GET',
|
|
156
|
+
headers: headerParameters,
|
|
157
|
+
query: queryParameters,
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
|
|
163
|
+
* Get a watch rule
|
|
164
|
+
*/
|
|
165
|
+
getWatchRuleRaw(requestParameters, initOverrides) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const requestOptions = yield this.getWatchRuleRequestOpts(requestParameters);
|
|
168
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
169
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
|
|
174
|
+
* Get a watch rule
|
|
175
|
+
*/
|
|
176
|
+
getWatchRule(requestParameters, initOverrides) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
const response = yield this.getWatchRuleRaw(requestParameters, initOverrides);
|
|
179
|
+
return yield response.value();
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Creates request options for listWatchRules without sending the request
|
|
184
|
+
*/
|
|
185
|
+
listWatchRulesRequestOpts(requestParameters) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const queryParameters = {};
|
|
188
|
+
if (requestParameters['cursor'] != null) {
|
|
189
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
190
|
+
}
|
|
191
|
+
if (requestParameters['limit'] != null) {
|
|
192
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
193
|
+
}
|
|
194
|
+
const headerParameters = {};
|
|
195
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
196
|
+
const token = this.configuration.accessToken;
|
|
197
|
+
const tokenString = yield token("bearerAuth", []);
|
|
198
|
+
if (tokenString) {
|
|
199
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
let urlPath = `/watch-rules`;
|
|
203
|
+
return {
|
|
204
|
+
path: urlPath,
|
|
205
|
+
method: 'GET',
|
|
206
|
+
headers: headerParameters,
|
|
207
|
+
query: queryParameters,
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
|
|
213
|
+
* List watch rules
|
|
214
|
+
*/
|
|
215
|
+
listWatchRulesRaw(requestParameters, initOverrides) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const requestOptions = yield this.listWatchRulesRequestOpts(requestParameters);
|
|
218
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
219
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRulePage_1.WatchRulePageFromJSON)(jsonValue));
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
|
|
224
|
+
* List watch rules
|
|
225
|
+
*/
|
|
226
|
+
listWatchRules() {
|
|
227
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
228
|
+
const response = yield this.listWatchRulesRaw(requestParameters, initOverrides);
|
|
229
|
+
return yield response.value();
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Creates request options for updateWatchRule without sending the request
|
|
234
|
+
*/
|
|
235
|
+
updateWatchRuleRequestOpts(requestParameters) {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
if (requestParameters['id'] == null) {
|
|
238
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateWatchRule().');
|
|
239
|
+
}
|
|
240
|
+
if (requestParameters['watchRuleUpdate'] == null) {
|
|
241
|
+
throw new runtime.RequiredError('watchRuleUpdate', 'Required parameter "watchRuleUpdate" was null or undefined when calling updateWatchRule().');
|
|
242
|
+
}
|
|
243
|
+
const queryParameters = {};
|
|
244
|
+
const headerParameters = {};
|
|
245
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
246
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
247
|
+
const token = this.configuration.accessToken;
|
|
248
|
+
const tokenString = yield token("bearerAuth", []);
|
|
249
|
+
if (tokenString) {
|
|
250
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
let urlPath = `/watch-rules/{id}`;
|
|
254
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
255
|
+
return {
|
|
256
|
+
path: urlPath,
|
|
257
|
+
method: 'PATCH',
|
|
258
|
+
headers: headerParameters,
|
|
259
|
+
query: queryParameters,
|
|
260
|
+
body: (0, WatchRuleUpdate_1.WatchRuleUpdateToJSON)(requestParameters['watchRuleUpdate']),
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
|
|
266
|
+
* Update a watch rule
|
|
267
|
+
*/
|
|
268
|
+
updateWatchRuleRaw(requestParameters, initOverrides) {
|
|
269
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
const requestOptions = yield this.updateWatchRuleRequestOpts(requestParameters);
|
|
271
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
272
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
|
|
277
|
+
* Update a watch rule
|
|
278
|
+
*/
|
|
279
|
+
updateWatchRule(requestParameters, initOverrides) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
const response = yield this.updateWatchRuleRaw(requestParameters, initOverrides);
|
|
282
|
+
return yield response.value();
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.WatchApi = WatchApi;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './AutolaunchApi';
|
|
1
2
|
export * from './BillingApi';
|
|
2
3
|
export * from './CommunityApi';
|
|
3
4
|
export * from './EnvironmentsApi';
|
|
@@ -5,6 +6,7 @@ export * from './FineTuningApi';
|
|
|
5
6
|
export * from './GpuTypesApi';
|
|
6
7
|
export * from './InferenceApi';
|
|
7
8
|
export * from './InstancesApi';
|
|
9
|
+
export * from './MarketApi';
|
|
8
10
|
export * from './MetaApi';
|
|
9
11
|
export * from './OperationsApi';
|
|
10
12
|
export * from './PricingApi';
|
|
@@ -12,4 +14,5 @@ export * from './RegistryCredentialsApi';
|
|
|
12
14
|
export * from './SshKeysApi';
|
|
13
15
|
export * from './TemplatesApi';
|
|
14
16
|
export * from './UsageApi';
|
|
17
|
+
export * from './WatchApi';
|
|
15
18
|
export * from './WebhooksApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AutolaunchApi"), exports);
|
|
19
20
|
__exportStar(require("./BillingApi"), exports);
|
|
20
21
|
__exportStar(require("./CommunityApi"), exports);
|
|
21
22
|
__exportStar(require("./EnvironmentsApi"), exports);
|
|
@@ -23,6 +24,7 @@ __exportStar(require("./FineTuningApi"), exports);
|
|
|
23
24
|
__exportStar(require("./GpuTypesApi"), exports);
|
|
24
25
|
__exportStar(require("./InferenceApi"), exports);
|
|
25
26
|
__exportStar(require("./InstancesApi"), exports);
|
|
27
|
+
__exportStar(require("./MarketApi"), exports);
|
|
26
28
|
__exportStar(require("./MetaApi"), exports);
|
|
27
29
|
__exportStar(require("./OperationsApi"), exports);
|
|
28
30
|
__exportStar(require("./PricingApi"), exports);
|
|
@@ -30,4 +32,5 @@ __exportStar(require("./RegistryCredentialsApi"), exports);
|
|
|
30
32
|
__exportStar(require("./SshKeysApi"), exports);
|
|
31
33
|
__exportStar(require("./TemplatesApi"), exports);
|
|
32
34
|
__exportStar(require("./UsageApi"), exports);
|
|
35
|
+
__exportStar(require("./WatchApi"), exports);
|
|
33
36
|
__exportStar(require("./WebhooksApi"), exports);
|
|
@@ -0,0 +1,109 @@
|
|
|
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 AutolaunchRule } from '../models/AutolaunchRule';
|
|
14
|
+
import { type AutolaunchRuleCreate } from '../models/AutolaunchRuleCreate';
|
|
15
|
+
import { type AutolaunchRuleDisarm } from '../models/AutolaunchRuleDisarm';
|
|
16
|
+
import { type AutolaunchRulePage } from '../models/AutolaunchRulePage';
|
|
17
|
+
export interface CreateAutolaunchRuleRequest {
|
|
18
|
+
autolaunchRuleCreate: AutolaunchRuleCreate;
|
|
19
|
+
idempotencyKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteAutolaunchRuleRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DisarmAutolaunchRuleRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
autolaunchRuleDisarm: AutolaunchRuleDisarm;
|
|
27
|
+
}
|
|
28
|
+
export interface GetAutolaunchRuleRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ListAutolaunchRulesRequest {
|
|
32
|
+
cursor?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare class AutolaunchApi extends runtime.BaseAPI {
|
|
39
|
+
/**
|
|
40
|
+
* Creates request options for createAutolaunchRule without sending the request
|
|
41
|
+
*/
|
|
42
|
+
createAutolaunchRuleRequestOpts(requestParameters: CreateAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a standing, pre-approved purchase order. When the condition holds and the live price is at or under `max_price_per_hour`, the platform launches the frozen `spec` with no further confirmation from anyone — the customer is approving NOW for a purchase that happens LATER, while nobody is watching. SCOPE. Requires the `autolaunch:write` scope, which is granted only EXPLICITLY. It is deliberately NOT covered by `full_access`, `standard` or `read_only`: `instances:write` is real-time authority, exercised with someone present, whereas this is a standing, frozen authorization that fires days later unattended. Treating them as the same authority class would have handed unattended spend authority to every key ever issued, including keys minted long before this resource existed. Most existing keys therefore receive 403 here; the correct response is to mint a key whose scopes map includes `{\"autolaunch\": \"write\"}`, never to retry, to substitute a key, or to fall back to a watch rule. CONSENT. `acknowledged_max_total_usd` is REQUIRED and must equal `max_price_per_hour × max_runtime_hours` to within one cent. It is the API-level expression of \"a valid confirmation must come AFTER the price\": a caller that never computed the number cannot have shown it to anyone, and a caller that displayed a different number disagrees with what is about to be stored. Show the figure to the person approving the rule, then send it back. TWO PRICES, TWO UNITS. `threshold` is the TRIGGER, in dollars per GPU-hour — the same unit the market chart and watch rules speak in. `max_price_per_hour` is the CEILING, in dollars per hour for the WHOLE instance. A 4-GPU rule triggering under $4.00/GPU-hr typically carries a $16.00/hr ceiling. Conflating them scales the customer\'s spend authorization by their GPU count. FROZEN SPEC. `spec` is the full create-instance body the rule replays, validated at creation with the same validation a live create runs, so a spec that could never launch is refused while a human is present rather than at 3 a.m. `spec.offering_id` is REJECTED — offering identity churns between catalog polls, so a pin produces a rule that can never fire, which is the worst outcome here because the customer believes a purchase is armed. `spec.auto_terminate_hours` is overwritten from `max_runtime_hours` and must not be used to widen the bound. Organizations are limited to 10 active rules; the 422 names the limit. The organization spending limit still applies as a backstop at fire time — a launch must fit both its own ceiling and the org cap.
|
|
45
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
46
|
+
*/
|
|
47
|
+
createAutolaunchRuleRaw(requestParameters: CreateAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a standing, pre-approved purchase order. When the condition holds and the live price is at or under `max_price_per_hour`, the platform launches the frozen `spec` with no further confirmation from anyone — the customer is approving NOW for a purchase that happens LATER, while nobody is watching. SCOPE. Requires the `autolaunch:write` scope, which is granted only EXPLICITLY. It is deliberately NOT covered by `full_access`, `standard` or `read_only`: `instances:write` is real-time authority, exercised with someone present, whereas this is a standing, frozen authorization that fires days later unattended. Treating them as the same authority class would have handed unattended spend authority to every key ever issued, including keys minted long before this resource existed. Most existing keys therefore receive 403 here; the correct response is to mint a key whose scopes map includes `{\"autolaunch\": \"write\"}`, never to retry, to substitute a key, or to fall back to a watch rule. CONSENT. `acknowledged_max_total_usd` is REQUIRED and must equal `max_price_per_hour × max_runtime_hours` to within one cent. It is the API-level expression of \"a valid confirmation must come AFTER the price\": a caller that never computed the number cannot have shown it to anyone, and a caller that displayed a different number disagrees with what is about to be stored. Show the figure to the person approving the rule, then send it back. TWO PRICES, TWO UNITS. `threshold` is the TRIGGER, in dollars per GPU-hour — the same unit the market chart and watch rules speak in. `max_price_per_hour` is the CEILING, in dollars per hour for the WHOLE instance. A 4-GPU rule triggering under $4.00/GPU-hr typically carries a $16.00/hr ceiling. Conflating them scales the customer\'s spend authorization by their GPU count. FROZEN SPEC. `spec` is the full create-instance body the rule replays, validated at creation with the same validation a live create runs, so a spec that could never launch is refused while a human is present rather than at 3 a.m. `spec.offering_id` is REJECTED — offering identity churns between catalog polls, so a pin produces a rule that can never fire, which is the worst outcome here because the customer believes a purchase is armed. `spec.auto_terminate_hours` is overwritten from `max_runtime_hours` and must not be used to widen the bound. Organizations are limited to 10 active rules; the 422 names the limit. The organization spending limit still applies as a backstop at fire time — a launch must fit both its own ceiling and the org cap.
|
|
50
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
51
|
+
*/
|
|
52
|
+
createAutolaunchRule(requestParameters: CreateAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
53
|
+
/**
|
|
54
|
+
* Creates request options for deleteAutolaunchRule without sending the request
|
|
55
|
+
*/
|
|
56
|
+
deleteAutolaunchRuleRequestOpts(requestParameters: DeleteAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
57
|
+
/**
|
|
58
|
+
* Deletes the rule and withdraws its pre-approved spend cap immediately. Requires only the `autolaunch:read` scope, for the same reason the disarm PATCH does. Deleting an already-deleted rule returns 404.
|
|
59
|
+
* Cancel an auto-launch rule
|
|
60
|
+
*/
|
|
61
|
+
deleteAutolaunchRuleRaw(requestParameters: DeleteAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
62
|
+
/**
|
|
63
|
+
* Deletes the rule and withdraws its pre-approved spend cap immediately. Requires only the `autolaunch:read` scope, for the same reason the disarm PATCH does. Deleting an already-deleted rule returns 404.
|
|
64
|
+
* Cancel an auto-launch rule
|
|
65
|
+
*/
|
|
66
|
+
deleteAutolaunchRule(requestParameters: DeleteAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for disarmAutolaunchRule without sending the request
|
|
69
|
+
*/
|
|
70
|
+
disarmAutolaunchRuleRequestOpts(requestParameters: DisarmAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
71
|
+
/**
|
|
72
|
+
* Disarms a rule. The body must be exactly `{\"enabled\": false}` and nothing else. Requires only the `autolaunch:read` scope — cancelling a standing spend authorization is deliberately never harder than holding one, so a key narrowed since it created a rule can still stop that rule. This is the entire update surface, and the absence is the design. Changing a ceiling, a runtime bound, the targeting or the frozen spec is a DIFFERENT bounded purchase, so it requires deleting the rule and creating a new one through the consent gate. Re-arming is refused too: a fired rule consumed its one shot, so `{\"enabled\": true}` would resurrect a purchase order that was already consented to and spent.
|
|
73
|
+
* Disarm an auto-launch rule
|
|
74
|
+
*/
|
|
75
|
+
disarmAutolaunchRuleRaw(requestParameters: DisarmAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
76
|
+
/**
|
|
77
|
+
* Disarms a rule. The body must be exactly `{\"enabled\": false}` and nothing else. Requires only the `autolaunch:read` scope — cancelling a standing spend authorization is deliberately never harder than holding one, so a key narrowed since it created a rule can still stop that rule. This is the entire update surface, and the absence is the design. Changing a ceiling, a runtime bound, the targeting or the frozen spec is a DIFFERENT bounded purchase, so it requires deleting the rule and creating a new one through the consent gate. Re-arming is refused too: a fired rule consumed its one shot, so `{\"enabled\": true}` would resurrect a purchase order that was already consented to and spent.
|
|
78
|
+
* Disarm an auto-launch rule
|
|
79
|
+
*/
|
|
80
|
+
disarmAutolaunchRule(requestParameters: DisarmAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates request options for getAutolaunchRule without sending the request
|
|
83
|
+
*/
|
|
84
|
+
getAutolaunchRuleRequestOpts(requestParameters: GetAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
85
|
+
/**
|
|
86
|
+
* Fetches one auto-launch rule, including the frozen launch spec. Requires the `autolaunch:read` scope. A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
|
|
87
|
+
* Get an auto-launch rule
|
|
88
|
+
*/
|
|
89
|
+
getAutolaunchRuleRaw(requestParameters: GetAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
90
|
+
/**
|
|
91
|
+
* Fetches one auto-launch rule, including the frozen launch spec. Requires the `autolaunch:read` scope. A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
|
|
92
|
+
* Get an auto-launch rule
|
|
93
|
+
*/
|
|
94
|
+
getAutolaunchRule(requestParameters: GetAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates request options for listAutolaunchRules without sending the request
|
|
97
|
+
*/
|
|
98
|
+
listAutolaunchRulesRequestOpts(requestParameters: ListAutolaunchRulesRequest): Promise<runtime.RequestOpts>;
|
|
99
|
+
/**
|
|
100
|
+
* Lists this organization\'s auto-launch rules. Requires the `autolaunch:read` scope, which `standard` and `full_access` keys carry. Rules belonging to other organizations are never returned, and rules created through the dashboard are included — the list is the organization\'s, not the key\'s.
|
|
101
|
+
* List auto-launch rules
|
|
102
|
+
*/
|
|
103
|
+
listAutolaunchRulesRaw(requestParameters: ListAutolaunchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRulePage>>;
|
|
104
|
+
/**
|
|
105
|
+
* Lists this organization\'s auto-launch rules. Requires the `autolaunch:read` scope, which `standard` and `full_access` keys carry. Rules belonging to other organizations are never returned, and rules created through the dashboard are included — the list is the organization\'s, not the key\'s.
|
|
106
|
+
* List auto-launch rules
|
|
107
|
+
*/
|
|
108
|
+
listAutolaunchRules(requestParameters?: ListAutolaunchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRulePage>;
|
|
109
|
+
}
|