@quantcdn/quant-client 2.0.12 → 3.0.0
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/README.md +49 -72
- package/dist/api/apis.d.ts +30 -0
- package/dist/api/apis.js +48 -0
- package/dist/api/applicationsApi.d.ts +104 -0
- package/dist/api/applicationsApi.js +431 -0
- package/dist/api/commandsApi.d.ts +80 -0
- package/dist/api/commandsApi.js +316 -0
- package/dist/api/composeApi.d.ts +66 -0
- package/dist/api/composeApi.js +236 -0
- package/dist/api/containersApi.d.ts +67 -0
- package/dist/api/containersApi.js +236 -0
- package/dist/api/cronApi.d.ts +151 -0
- package/dist/api/cronApi.js +681 -0
- package/dist/api/environmentsApi.d.ts +194 -0
- package/dist/api/environmentsApi.js +861 -0
- package/dist/api/sSHAccessApi.d.ts +50 -0
- package/dist/api/sSHAccessApi.js +162 -0
- package/dist/api/scalingPolicyApi.d.ts +82 -0
- package/dist/api/scalingPolicyApi.js +307 -0
- package/dist/api/variablesApi.d.ts +83 -0
- package/dist/api/variablesApi.js +313 -0
- package/dist/api/volumesApi.d.ts +97 -0
- package/dist/api/volumesApi.js +405 -0
- package/dist/api.d.ts +2 -0
- package/dist/api.js +19 -0
- package/dist/model/application.d.ts +38 -0
- package/dist/model/application.js +93 -0
- package/dist/model/command.d.ts +34 -0
- package/dist/model/command.js +73 -0
- package/dist/model/compose.d.ts +32 -0
- package/dist/model/compose.js +58 -0
- package/dist/model/configuration.d.ts +26 -0
- package/dist/model/configuration.js +30 -0
- package/dist/model/container.d.ts +38 -0
- package/dist/model/container.js +78 -0
- package/dist/model/containerEnvironmentInner.d.ts +26 -0
- package/dist/model/containerEnvironmentInner.js +33 -0
- package/dist/model/containerImageReference.d.ts +28 -0
- package/dist/model/containerImageReference.js +43 -0
- package/dist/model/containerMountPointsInner.d.ts +27 -0
- package/dist/model/containerMountPointsInner.js +38 -0
- package/dist/model/createApplicationRequest.d.ts +28 -0
- package/dist/model/createApplicationRequest.js +43 -0
- package/dist/model/createCommandRequest.d.ts +25 -0
- package/dist/model/createCommandRequest.js +28 -0
- package/dist/model/createCronJob422Response.d.ts +26 -0
- package/dist/model/createCronJob422Response.js +33 -0
- package/dist/model/createCronJobRequest.d.ts +30 -0
- package/dist/model/createCronJobRequest.js +56 -0
- package/dist/model/createEnvironmentRequest.d.ts +34 -0
- package/dist/model/createEnvironmentRequest.js +53 -0
- package/dist/model/cron.d.ts +27 -0
- package/dist/model/cron.js +38 -0
- package/dist/model/cronRun.d.ts +48 -0
- package/dist/model/cronRun.js +89 -0
- package/dist/model/environment.d.ts +45 -0
- package/dist/model/environment.js +103 -0
- package/dist/model/getEcrLoginCredentials200Response.d.ts +28 -0
- package/dist/model/getEcrLoginCredentials200Response.js +43 -0
- package/dist/model/getScalingPolicies200Response.d.ts +26 -0
- package/dist/model/getScalingPolicies200Response.js +28 -0
- package/dist/model/getSshAccessCredentials200Response.d.ts +34 -0
- package/dist/model/getSshAccessCredentials200Response.js +68 -0
- package/dist/model/getSshAccessCredentials200ResponseCredentials.d.ts +28 -0
- package/dist/model/getSshAccessCredentials200ResponseCredentials.js +43 -0
- package/dist/model/models.d.ts +78 -0
- package/dist/model/models.js +352 -0
- package/dist/model/scalingPolicy.d.ts +35 -0
- package/dist/model/scalingPolicy.js +51 -0
- package/dist/model/syncOperation.d.ts +31 -0
- package/dist/model/syncOperation.js +58 -0
- package/dist/model/syncToEnvironmentRequest.d.ts +25 -0
- package/dist/model/syncToEnvironmentRequest.js +28 -0
- package/dist/model/updateComposeRequest.d.ts +26 -0
- package/dist/model/updateComposeRequest.js +28 -0
- package/dist/model/updateCronJobRequest.d.ts +29 -0
- package/dist/model/updateCronJobRequest.js +48 -0
- package/dist/model/updateEnvironmentComposeRequest.d.ts +26 -0
- package/dist/model/updateEnvironmentComposeRequest.js +28 -0
- package/dist/model/updateEnvironmentRequest.d.ts +26 -0
- package/dist/model/updateEnvironmentRequest.js +28 -0
- package/dist/model/updateEnvironmentStateRequest.d.ts +26 -0
- package/dist/model/updateEnvironmentStateRequest.js +33 -0
- package/dist/model/updateEnvironmentVariableRequest.d.ts +25 -0
- package/dist/model/updateEnvironmentVariableRequest.js +28 -0
- package/dist/model/validateCompose200Response.d.ts +27 -0
- package/dist/model/validateCompose200Response.js +38 -0
- package/dist/model/validateComposeRequest.d.ts +25 -0
- package/dist/model/validateComposeRequest.js +28 -0
- package/dist/model/variable.d.ts +26 -0
- package/dist/model/variable.js +33 -0
- package/dist/model/volume.d.ts +32 -0
- package/dist/model/volume.js +63 -0
- package/package.json +21 -40
- package/dist/src/client.d.ts +0 -15
- package/dist/src/client.js +0 -380
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -42
- package/dist/src/interfaces.d.ts +0 -34
- package/dist/src/interfaces.js +0 -2
- package/dist/src/response.d.ts +0 -15
- package/dist/src/response.js +0 -103
- package/dist/src/types.d.ts +0 -68
- package/dist/src/types.js +0 -8
- package/dist/tests/client.test.d.ts +0 -1
- package/dist/tests/client.test.js +0 -191
- package/dist/tests/response.test.d.ts +0 -1
- package/dist/tests/response.test.js +0 -133
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QuantCloud API
|
|
4
|
+
* QuantCloud API
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CommandsApi = exports.CommandsApiApiKeys = void 0;
|
|
27
|
+
const request_1 = __importDefault(require("request"));
|
|
28
|
+
const models_1 = require("../model/models");
|
|
29
|
+
const apis_1 = require("./apis");
|
|
30
|
+
let defaultBasePath = 'http://localhost';
|
|
31
|
+
// ===============================================
|
|
32
|
+
// This file is autogenerated - Please do not edit
|
|
33
|
+
// ===============================================
|
|
34
|
+
var CommandsApiApiKeys;
|
|
35
|
+
(function (CommandsApiApiKeys) {
|
|
36
|
+
})(CommandsApiApiKeys = exports.CommandsApiApiKeys || (exports.CommandsApiApiKeys = {}));
|
|
37
|
+
class CommandsApi {
|
|
38
|
+
constructor(basePathOrUsername, password, basePath) {
|
|
39
|
+
this._basePath = defaultBasePath;
|
|
40
|
+
this._defaultHeaders = {};
|
|
41
|
+
this._useQuerystring = false;
|
|
42
|
+
this.authentications = {
|
|
43
|
+
'default': new models_1.VoidAuth(),
|
|
44
|
+
};
|
|
45
|
+
this.interceptors = [];
|
|
46
|
+
if (password) {
|
|
47
|
+
if (basePath) {
|
|
48
|
+
this.basePath = basePath;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (basePathOrUsername) {
|
|
53
|
+
this.basePath = basePathOrUsername;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
set useQuerystring(value) {
|
|
58
|
+
this._useQuerystring = value;
|
|
59
|
+
}
|
|
60
|
+
set basePath(basePath) {
|
|
61
|
+
this._basePath = basePath;
|
|
62
|
+
}
|
|
63
|
+
set defaultHeaders(defaultHeaders) {
|
|
64
|
+
this._defaultHeaders = defaultHeaders;
|
|
65
|
+
}
|
|
66
|
+
get defaultHeaders() {
|
|
67
|
+
return this._defaultHeaders;
|
|
68
|
+
}
|
|
69
|
+
get basePath() {
|
|
70
|
+
return this._basePath;
|
|
71
|
+
}
|
|
72
|
+
setDefaultAuthentication(auth) {
|
|
73
|
+
this.authentications.default = auth;
|
|
74
|
+
}
|
|
75
|
+
setApiKey(key, value) {
|
|
76
|
+
this.authentications[CommandsApiApiKeys[key]].apiKey = value;
|
|
77
|
+
}
|
|
78
|
+
addInterceptor(interceptor) {
|
|
79
|
+
this.interceptors.push(interceptor);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @summary Create a command for an environment
|
|
84
|
+
* @param organisation The organisation ID
|
|
85
|
+
* @param environment The environment ID
|
|
86
|
+
* @param createCommandRequest
|
|
87
|
+
*/
|
|
88
|
+
createCommand(organisation, environment, createCommandRequest, options = { headers: {} }) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const localVarPath = this.basePath + '/organisations/{organisation}/environments/{environment}/commands'
|
|
91
|
+
.replace('{' + 'organisation' + '}', encodeURIComponent(String(organisation)))
|
|
92
|
+
.replace('{' + 'environment' + '}', encodeURIComponent(String(environment)));
|
|
93
|
+
let localVarQueryParameters = {};
|
|
94
|
+
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
95
|
+
const produces = ['application/json'];
|
|
96
|
+
// give precedence to 'application/json'
|
|
97
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
98
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
102
|
+
}
|
|
103
|
+
let localVarFormParams = {};
|
|
104
|
+
// verify required parameter 'organisation' is not null or undefined
|
|
105
|
+
if (organisation === null || organisation === undefined) {
|
|
106
|
+
throw new Error('Required parameter organisation was null or undefined when calling createCommand.');
|
|
107
|
+
}
|
|
108
|
+
// verify required parameter 'environment' is not null or undefined
|
|
109
|
+
if (environment === null || environment === undefined) {
|
|
110
|
+
throw new Error('Required parameter environment was null or undefined when calling createCommand.');
|
|
111
|
+
}
|
|
112
|
+
// verify required parameter 'createCommandRequest' is not null or undefined
|
|
113
|
+
if (createCommandRequest === null || createCommandRequest === undefined) {
|
|
114
|
+
throw new Error('Required parameter createCommandRequest was null or undefined when calling createCommand.');
|
|
115
|
+
}
|
|
116
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
117
|
+
let localVarUseFormData = false;
|
|
118
|
+
let localVarRequestOptions = {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
qs: localVarQueryParameters,
|
|
121
|
+
headers: localVarHeaderParams,
|
|
122
|
+
uri: localVarPath,
|
|
123
|
+
useQuerystring: this._useQuerystring,
|
|
124
|
+
json: true,
|
|
125
|
+
body: models_1.ObjectSerializer.serialize(createCommandRequest, "CreateCommandRequest")
|
|
126
|
+
};
|
|
127
|
+
let authenticationPromise = Promise.resolve();
|
|
128
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
129
|
+
let interceptorPromise = authenticationPromise;
|
|
130
|
+
for (const interceptor of this.interceptors) {
|
|
131
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
132
|
+
}
|
|
133
|
+
return interceptorPromise.then(() => {
|
|
134
|
+
if (Object.keys(localVarFormParams).length) {
|
|
135
|
+
if (localVarUseFormData) {
|
|
136
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return new Promise((resolve, reject) => {
|
|
143
|
+
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
144
|
+
if (error) {
|
|
145
|
+
reject(error);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
149
|
+
body = models_1.ObjectSerializer.deserialize(body, "Command");
|
|
150
|
+
resolve({ response: response, body: body });
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @summary Get a command
|
|
164
|
+
* @param organisation The organisation ID
|
|
165
|
+
* @param environment The environment ID
|
|
166
|
+
* @param command The command ID
|
|
167
|
+
*/
|
|
168
|
+
getCommand(organisation, environment, command, options = { headers: {} }) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
const localVarPath = this.basePath + '/organisations/{organisation}/environments/{environment}/commands/{command}'
|
|
171
|
+
.replace('{' + 'organisation' + '}', encodeURIComponent(String(organisation)))
|
|
172
|
+
.replace('{' + 'environment' + '}', encodeURIComponent(String(environment)))
|
|
173
|
+
.replace('{' + 'command' + '}', encodeURIComponent(String(command)));
|
|
174
|
+
let localVarQueryParameters = {};
|
|
175
|
+
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
176
|
+
const produces = ['application/json'];
|
|
177
|
+
// give precedence to 'application/json'
|
|
178
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
179
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
183
|
+
}
|
|
184
|
+
let localVarFormParams = {};
|
|
185
|
+
// verify required parameter 'organisation' is not null or undefined
|
|
186
|
+
if (organisation === null || organisation === undefined) {
|
|
187
|
+
throw new Error('Required parameter organisation was null or undefined when calling getCommand.');
|
|
188
|
+
}
|
|
189
|
+
// verify required parameter 'environment' is not null or undefined
|
|
190
|
+
if (environment === null || environment === undefined) {
|
|
191
|
+
throw new Error('Required parameter environment was null or undefined when calling getCommand.');
|
|
192
|
+
}
|
|
193
|
+
// verify required parameter 'command' is not null or undefined
|
|
194
|
+
if (command === null || command === undefined) {
|
|
195
|
+
throw new Error('Required parameter command was null or undefined when calling getCommand.');
|
|
196
|
+
}
|
|
197
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
198
|
+
let localVarUseFormData = false;
|
|
199
|
+
let localVarRequestOptions = {
|
|
200
|
+
method: 'GET',
|
|
201
|
+
qs: localVarQueryParameters,
|
|
202
|
+
headers: localVarHeaderParams,
|
|
203
|
+
uri: localVarPath,
|
|
204
|
+
useQuerystring: this._useQuerystring,
|
|
205
|
+
json: true,
|
|
206
|
+
};
|
|
207
|
+
let authenticationPromise = Promise.resolve();
|
|
208
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
209
|
+
let interceptorPromise = authenticationPromise;
|
|
210
|
+
for (const interceptor of this.interceptors) {
|
|
211
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
212
|
+
}
|
|
213
|
+
return interceptorPromise.then(() => {
|
|
214
|
+
if (Object.keys(localVarFormParams).length) {
|
|
215
|
+
if (localVarUseFormData) {
|
|
216
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return new Promise((resolve, reject) => {
|
|
223
|
+
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
224
|
+
if (error) {
|
|
225
|
+
reject(error);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
229
|
+
body = models_1.ObjectSerializer.deserialize(body, "Command");
|
|
230
|
+
resolve({ response: response, body: body });
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @summary Get all commands for an environment
|
|
244
|
+
* @param organisation The organisation ID
|
|
245
|
+
* @param environment The environment ID
|
|
246
|
+
*/
|
|
247
|
+
listCommands(organisation, environment, options = { headers: {} }) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
const localVarPath = this.basePath + '/organisations/{organisation}/environments/{environment}/commands'
|
|
250
|
+
.replace('{' + 'organisation' + '}', encodeURIComponent(String(organisation)))
|
|
251
|
+
.replace('{' + 'environment' + '}', encodeURIComponent(String(environment)));
|
|
252
|
+
let localVarQueryParameters = {};
|
|
253
|
+
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
254
|
+
const produces = ['application/json'];
|
|
255
|
+
// give precedence to 'application/json'
|
|
256
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
257
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
261
|
+
}
|
|
262
|
+
let localVarFormParams = {};
|
|
263
|
+
// verify required parameter 'organisation' is not null or undefined
|
|
264
|
+
if (organisation === null || organisation === undefined) {
|
|
265
|
+
throw new Error('Required parameter organisation was null or undefined when calling listCommands.');
|
|
266
|
+
}
|
|
267
|
+
// verify required parameter 'environment' is not null or undefined
|
|
268
|
+
if (environment === null || environment === undefined) {
|
|
269
|
+
throw new Error('Required parameter environment was null or undefined when calling listCommands.');
|
|
270
|
+
}
|
|
271
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
272
|
+
let localVarUseFormData = false;
|
|
273
|
+
let localVarRequestOptions = {
|
|
274
|
+
method: 'GET',
|
|
275
|
+
qs: localVarQueryParameters,
|
|
276
|
+
headers: localVarHeaderParams,
|
|
277
|
+
uri: localVarPath,
|
|
278
|
+
useQuerystring: this._useQuerystring,
|
|
279
|
+
json: true,
|
|
280
|
+
};
|
|
281
|
+
let authenticationPromise = Promise.resolve();
|
|
282
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
283
|
+
let interceptorPromise = authenticationPromise;
|
|
284
|
+
for (const interceptor of this.interceptors) {
|
|
285
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
286
|
+
}
|
|
287
|
+
return interceptorPromise.then(() => {
|
|
288
|
+
if (Object.keys(localVarFormParams).length) {
|
|
289
|
+
if (localVarUseFormData) {
|
|
290
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return new Promise((resolve, reject) => {
|
|
297
|
+
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
298
|
+
if (error) {
|
|
299
|
+
reject(error);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
303
|
+
body = models_1.ObjectSerializer.deserialize(body, "Command");
|
|
304
|
+
resolve({ response: response, body: body });
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.CommandsApi = CommandsApi;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuantCloud API
|
|
3
|
+
* QuantCloud API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
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
|
+
/// <reference types="node" />
|
|
13
|
+
import http from 'http';
|
|
14
|
+
import { Compose } from '../model/compose';
|
|
15
|
+
import { ValidateCompose200Response } from '../model/validateCompose200Response';
|
|
16
|
+
import { ValidateComposeRequest } from '../model/validateComposeRequest';
|
|
17
|
+
import { Authentication, Interceptor } from '../model/models';
|
|
18
|
+
export declare enum ComposeApiApiKeys {
|
|
19
|
+
}
|
|
20
|
+
export declare class ComposeApi {
|
|
21
|
+
protected _basePath: string;
|
|
22
|
+
protected _defaultHeaders: any;
|
|
23
|
+
protected _useQuerystring: boolean;
|
|
24
|
+
protected authentications: {
|
|
25
|
+
default: Authentication;
|
|
26
|
+
};
|
|
27
|
+
protected interceptors: Interceptor[];
|
|
28
|
+
constructor(basePath?: string);
|
|
29
|
+
set useQuerystring(value: boolean);
|
|
30
|
+
set basePath(basePath: string);
|
|
31
|
+
set defaultHeaders(defaultHeaders: any);
|
|
32
|
+
get defaultHeaders(): any;
|
|
33
|
+
get basePath(): string;
|
|
34
|
+
setDefaultAuthentication(auth: Authentication): void;
|
|
35
|
+
setApiKey(key: ComposeApiApiKeys, value: string): void;
|
|
36
|
+
addInterceptor(interceptor: Interceptor): void;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @summary Get the compose file for an environment
|
|
40
|
+
* @param organisation The organisation ID
|
|
41
|
+
* @param application The application ID
|
|
42
|
+
* @param environment The environment ID
|
|
43
|
+
*/
|
|
44
|
+
getEnvironmentCompose(organisation: string, application: string, environment: string, options?: {
|
|
45
|
+
headers: {
|
|
46
|
+
[name: string]: string;
|
|
47
|
+
};
|
|
48
|
+
}): Promise<{
|
|
49
|
+
response: http.IncomingMessage;
|
|
50
|
+
body: Compose;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @summary Validate a compose file
|
|
55
|
+
* @param organisation The organisation ID
|
|
56
|
+
* @param validateComposeRequest
|
|
57
|
+
*/
|
|
58
|
+
validateCompose(organisation: string, validateComposeRequest: ValidateComposeRequest, options?: {
|
|
59
|
+
headers: {
|
|
60
|
+
[name: string]: string;
|
|
61
|
+
};
|
|
62
|
+
}): Promise<{
|
|
63
|
+
response: http.IncomingMessage;
|
|
64
|
+
body: ValidateCompose200Response;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* QuantCloud API
|
|
4
|
+
* QuantCloud API
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ComposeApi = exports.ComposeApiApiKeys = void 0;
|
|
27
|
+
const request_1 = __importDefault(require("request"));
|
|
28
|
+
const models_1 = require("../model/models");
|
|
29
|
+
const apis_1 = require("./apis");
|
|
30
|
+
let defaultBasePath = 'http://localhost';
|
|
31
|
+
// ===============================================
|
|
32
|
+
// This file is autogenerated - Please do not edit
|
|
33
|
+
// ===============================================
|
|
34
|
+
var ComposeApiApiKeys;
|
|
35
|
+
(function (ComposeApiApiKeys) {
|
|
36
|
+
})(ComposeApiApiKeys = exports.ComposeApiApiKeys || (exports.ComposeApiApiKeys = {}));
|
|
37
|
+
class ComposeApi {
|
|
38
|
+
constructor(basePathOrUsername, password, basePath) {
|
|
39
|
+
this._basePath = defaultBasePath;
|
|
40
|
+
this._defaultHeaders = {};
|
|
41
|
+
this._useQuerystring = false;
|
|
42
|
+
this.authentications = {
|
|
43
|
+
'default': new models_1.VoidAuth(),
|
|
44
|
+
};
|
|
45
|
+
this.interceptors = [];
|
|
46
|
+
if (password) {
|
|
47
|
+
if (basePath) {
|
|
48
|
+
this.basePath = basePath;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (basePathOrUsername) {
|
|
53
|
+
this.basePath = basePathOrUsername;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
set useQuerystring(value) {
|
|
58
|
+
this._useQuerystring = value;
|
|
59
|
+
}
|
|
60
|
+
set basePath(basePath) {
|
|
61
|
+
this._basePath = basePath;
|
|
62
|
+
}
|
|
63
|
+
set defaultHeaders(defaultHeaders) {
|
|
64
|
+
this._defaultHeaders = defaultHeaders;
|
|
65
|
+
}
|
|
66
|
+
get defaultHeaders() {
|
|
67
|
+
return this._defaultHeaders;
|
|
68
|
+
}
|
|
69
|
+
get basePath() {
|
|
70
|
+
return this._basePath;
|
|
71
|
+
}
|
|
72
|
+
setDefaultAuthentication(auth) {
|
|
73
|
+
this.authentications.default = auth;
|
|
74
|
+
}
|
|
75
|
+
setApiKey(key, value) {
|
|
76
|
+
this.authentications[ComposeApiApiKeys[key]].apiKey = value;
|
|
77
|
+
}
|
|
78
|
+
addInterceptor(interceptor) {
|
|
79
|
+
this.interceptors.push(interceptor);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @summary Get the compose file for an environment
|
|
84
|
+
* @param organisation The organisation ID
|
|
85
|
+
* @param application The application ID
|
|
86
|
+
* @param environment The environment ID
|
|
87
|
+
*/
|
|
88
|
+
getEnvironmentCompose(organisation, application, environment, options = { headers: {} }) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const localVarPath = this.basePath + '/organisations/{organisation}/environments/{environment}/compose'
|
|
91
|
+
.replace('{' + 'organisation' + '}', encodeURIComponent(String(organisation)))
|
|
92
|
+
.replace('{' + 'application' + '}', encodeURIComponent(String(application)))
|
|
93
|
+
.replace('{' + 'environment' + '}', encodeURIComponent(String(environment)));
|
|
94
|
+
let localVarQueryParameters = {};
|
|
95
|
+
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
96
|
+
const produces = ['application/json'];
|
|
97
|
+
// give precedence to 'application/json'
|
|
98
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
99
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
103
|
+
}
|
|
104
|
+
let localVarFormParams = {};
|
|
105
|
+
// verify required parameter 'organisation' is not null or undefined
|
|
106
|
+
if (organisation === null || organisation === undefined) {
|
|
107
|
+
throw new Error('Required parameter organisation was null or undefined when calling getEnvironmentCompose.');
|
|
108
|
+
}
|
|
109
|
+
// verify required parameter 'application' is not null or undefined
|
|
110
|
+
if (application === null || application === undefined) {
|
|
111
|
+
throw new Error('Required parameter application was null or undefined when calling getEnvironmentCompose.');
|
|
112
|
+
}
|
|
113
|
+
// verify required parameter 'environment' is not null or undefined
|
|
114
|
+
if (environment === null || environment === undefined) {
|
|
115
|
+
throw new Error('Required parameter environment was null or undefined when calling getEnvironmentCompose.');
|
|
116
|
+
}
|
|
117
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
118
|
+
let localVarUseFormData = false;
|
|
119
|
+
let localVarRequestOptions = {
|
|
120
|
+
method: 'GET',
|
|
121
|
+
qs: localVarQueryParameters,
|
|
122
|
+
headers: localVarHeaderParams,
|
|
123
|
+
uri: localVarPath,
|
|
124
|
+
useQuerystring: this._useQuerystring,
|
|
125
|
+
json: true,
|
|
126
|
+
};
|
|
127
|
+
let authenticationPromise = Promise.resolve();
|
|
128
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
129
|
+
let interceptorPromise = authenticationPromise;
|
|
130
|
+
for (const interceptor of this.interceptors) {
|
|
131
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
132
|
+
}
|
|
133
|
+
return interceptorPromise.then(() => {
|
|
134
|
+
if (Object.keys(localVarFormParams).length) {
|
|
135
|
+
if (localVarUseFormData) {
|
|
136
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return new Promise((resolve, reject) => {
|
|
143
|
+
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
144
|
+
if (error) {
|
|
145
|
+
reject(error);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
149
|
+
body = models_1.ObjectSerializer.deserialize(body, "Compose");
|
|
150
|
+
resolve({ response: response, body: body });
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @summary Validate a compose file
|
|
164
|
+
* @param organisation The organisation ID
|
|
165
|
+
* @param validateComposeRequest
|
|
166
|
+
*/
|
|
167
|
+
validateCompose(organisation, validateComposeRequest, options = { headers: {} }) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
const localVarPath = this.basePath + '/organisations/{organisation}/compose/validate'
|
|
170
|
+
.replace('{' + 'organisation' + '}', encodeURIComponent(String(organisation)));
|
|
171
|
+
let localVarQueryParameters = {};
|
|
172
|
+
let localVarHeaderParams = Object.assign({}, this._defaultHeaders);
|
|
173
|
+
const produces = ['application/json'];
|
|
174
|
+
// give precedence to 'application/json'
|
|
175
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
176
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
180
|
+
}
|
|
181
|
+
let localVarFormParams = {};
|
|
182
|
+
// verify required parameter 'organisation' is not null or undefined
|
|
183
|
+
if (organisation === null || organisation === undefined) {
|
|
184
|
+
throw new Error('Required parameter organisation was null or undefined when calling validateCompose.');
|
|
185
|
+
}
|
|
186
|
+
// verify required parameter 'validateComposeRequest' is not null or undefined
|
|
187
|
+
if (validateComposeRequest === null || validateComposeRequest === undefined) {
|
|
188
|
+
throw new Error('Required parameter validateComposeRequest was null or undefined when calling validateCompose.');
|
|
189
|
+
}
|
|
190
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
191
|
+
let localVarUseFormData = false;
|
|
192
|
+
let localVarRequestOptions = {
|
|
193
|
+
method: 'POST',
|
|
194
|
+
qs: localVarQueryParameters,
|
|
195
|
+
headers: localVarHeaderParams,
|
|
196
|
+
uri: localVarPath,
|
|
197
|
+
useQuerystring: this._useQuerystring,
|
|
198
|
+
json: true,
|
|
199
|
+
body: models_1.ObjectSerializer.serialize(validateComposeRequest, "ValidateComposeRequest")
|
|
200
|
+
};
|
|
201
|
+
let authenticationPromise = Promise.resolve();
|
|
202
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
203
|
+
let interceptorPromise = authenticationPromise;
|
|
204
|
+
for (const interceptor of this.interceptors) {
|
|
205
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
206
|
+
}
|
|
207
|
+
return interceptorPromise.then(() => {
|
|
208
|
+
if (Object.keys(localVarFormParams).length) {
|
|
209
|
+
if (localVarUseFormData) {
|
|
210
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return new Promise((resolve, reject) => {
|
|
217
|
+
(0, request_1.default)(localVarRequestOptions, (error, response, body) => {
|
|
218
|
+
if (error) {
|
|
219
|
+
reject(error);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
223
|
+
body = models_1.ObjectSerializer.deserialize(body, "ValidateCompose200Response");
|
|
224
|
+
resolve({ response: response, body: body });
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
reject(new apis_1.HttpError(response, body, response.statusCode));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
exports.ComposeApi = ComposeApi;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuantCloud API
|
|
3
|
+
* QuantCloud API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
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
|
+
/// <reference types="node" />
|
|
13
|
+
import http from 'http';
|
|
14
|
+
import { Container } from '../model/container';
|
|
15
|
+
import { Authentication, Interceptor } from '../model/models';
|
|
16
|
+
export declare enum ContainersApiApiKeys {
|
|
17
|
+
}
|
|
18
|
+
export declare class ContainersApi {
|
|
19
|
+
protected _basePath: string;
|
|
20
|
+
protected _defaultHeaders: any;
|
|
21
|
+
protected _useQuerystring: boolean;
|
|
22
|
+
protected authentications: {
|
|
23
|
+
default: Authentication;
|
|
24
|
+
};
|
|
25
|
+
protected interceptors: Interceptor[];
|
|
26
|
+
constructor(basePath?: string);
|
|
27
|
+
set useQuerystring(value: boolean);
|
|
28
|
+
set basePath(basePath: string);
|
|
29
|
+
set defaultHeaders(defaultHeaders: any);
|
|
30
|
+
get defaultHeaders(): any;
|
|
31
|
+
get basePath(): string;
|
|
32
|
+
setDefaultAuthentication(auth: Authentication): void;
|
|
33
|
+
setApiKey(key: ContainersApiApiKeys, value: string): void;
|
|
34
|
+
addInterceptor(interceptor: Interceptor): void;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @summary Get the containers in an environment
|
|
38
|
+
* @param organisation The organisation ID
|
|
39
|
+
* @param application The application ID
|
|
40
|
+
* @param environment The environment ID
|
|
41
|
+
*/
|
|
42
|
+
listContainers(organisation: string, application: string, environment: string, options?: {
|
|
43
|
+
headers: {
|
|
44
|
+
[name: string]: string;
|
|
45
|
+
};
|
|
46
|
+
}): Promise<{
|
|
47
|
+
response: http.IncomingMessage;
|
|
48
|
+
body?: any;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @summary Update a container in an environment
|
|
53
|
+
* @param organisation The organisation ID
|
|
54
|
+
* @param application The application ID
|
|
55
|
+
* @param environment The environment ID
|
|
56
|
+
* @param container The container ID
|
|
57
|
+
* @param container2
|
|
58
|
+
*/
|
|
59
|
+
updateContainer(organisation: string, application: string, environment: string, container: string, container2: Container, options?: {
|
|
60
|
+
headers: {
|
|
61
|
+
[name: string]: string;
|
|
62
|
+
};
|
|
63
|
+
}): Promise<{
|
|
64
|
+
response: http.IncomingMessage;
|
|
65
|
+
body?: any;
|
|
66
|
+
}>;
|
|
67
|
+
}
|