@longvansoftware/service-js-client 1.3.4 → 1.3.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/dist/src/graphql/computing/mutations.d.ts +3 -0
- package/dist/src/graphql/computing/mutations.js +36 -1
- package/dist/src/graphql/computing/queries.d.ts +5 -0
- package/dist/src/graphql/computing/queries.js +97 -1
- package/dist/src/lib/computing/index.d.ts +8 -0
- package/dist/src/lib/computing/index.js +134 -0
- package/package.json +1 -1
@@ -8,3 +8,6 @@ export declare const POWER_OFF: import("graphql").DocumentNode;
|
|
8
8
|
export declare const CREATE_SNAP_SHOT: import("graphql").DocumentNode;
|
9
9
|
export declare const ROLLBACK_SNAPSHOT: import("graphql").DocumentNode;
|
10
10
|
export declare const DELETE_SNAPSHOT: import("graphql").DocumentNode;
|
11
|
+
export declare const CREATE_CLUSTER: import("graphql").DocumentNode;
|
12
|
+
export declare const ADD_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
|
13
|
+
export declare const REMOVE_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DELETE_SNAPSHOT = exports.ROLLBACK_SNAPSHOT = exports.CREATE_SNAP_SHOT = exports.POWER_OFF = exports.POWER_ON = exports.REMOVE_PORT_NAT = exports.UPDATE_PORT_NAT = exports.CREATE_PORT_NAT = exports.UPDATE_DESCRIPTION_PORTNAT = exports.RESTARTVM = void 0;
|
3
|
+
exports.REMOVE_COMPUTING_IN_CLUSTER = exports.ADD_COMPUTING_IN_CLUSTER = exports.CREATE_CLUSTER = exports.DELETE_SNAPSHOT = exports.ROLLBACK_SNAPSHOT = exports.CREATE_SNAP_SHOT = exports.POWER_OFF = exports.POWER_ON = exports.REMOVE_PORT_NAT = exports.UPDATE_PORT_NAT = exports.CREATE_PORT_NAT = exports.UPDATE_DESCRIPTION_PORTNAT = exports.RESTARTVM = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.RESTARTVM = (0, graphql_tag_1.gql) `
|
6
6
|
mutation Restart($computingId: String!, $actor: String!) {
|
@@ -108,3 +108,38 @@ exports.DELETE_SNAPSHOT = (0, graphql_tag_1.gql) `
|
|
108
108
|
)
|
109
109
|
}
|
110
110
|
`;
|
111
|
+
exports.CREATE_CLUSTER = (0, graphql_tag_1.gql) `
|
112
|
+
mutation CreateCluster($ownerId: String!, $name: String!) {
|
113
|
+
createCluster(ownerId: $ownerId, name: $name) {
|
114
|
+
id
|
115
|
+
name
|
116
|
+
description
|
117
|
+
}
|
118
|
+
}
|
119
|
+
`;
|
120
|
+
exports.ADD_COMPUTING_IN_CLUSTER = (0, graphql_tag_1.gql) `
|
121
|
+
mutation AddComputingInCluster(
|
122
|
+
$clusterId: String!
|
123
|
+
$computingId: String!
|
124
|
+
$userId: String!
|
125
|
+
) {
|
126
|
+
addComputingInCluster(
|
127
|
+
clusterId: $clusterId
|
128
|
+
computingId: $computingId
|
129
|
+
userId: $userId
|
130
|
+
)
|
131
|
+
}
|
132
|
+
`;
|
133
|
+
exports.REMOVE_COMPUTING_IN_CLUSTER = (0, graphql_tag_1.gql) `
|
134
|
+
mutation RemoveComputingInCluster(
|
135
|
+
$clusterId: String!
|
136
|
+
$computingId: String!
|
137
|
+
$userId: String!
|
138
|
+
) {
|
139
|
+
removeComputingInCluster(
|
140
|
+
clusterId: $clusterId
|
141
|
+
computingId: $computingId
|
142
|
+
userId: $userId
|
143
|
+
)
|
144
|
+
}
|
145
|
+
`;
|
@@ -10,3 +10,8 @@ export declare const CPU_USAGE_DATE_RANGE: import("graphql").DocumentNode;
|
|
10
10
|
export declare const NETWORK_USAGE_DATE_RANGE: import("graphql").DocumentNode;
|
11
11
|
export declare const DISK_USAGE_DATE_RANGE: import("graphql").DocumentNode;
|
12
12
|
export declare const BACKUP_POINT: import("graphql").DocumentNode;
|
13
|
+
export declare const GET_COMPUTINGS: import("graphql").DocumentNode;
|
14
|
+
export declare const GET_LAB_INSTANCE: import("graphql").DocumentNode;
|
15
|
+
export declare const GET_CLUSTERS: import("graphql").DocumentNode;
|
16
|
+
export declare const GET_CLUSTER: import("graphql").DocumentNode;
|
17
|
+
export declare const GET_COMPUTING_BY_CLUSTER: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BACKUP_POINT = exports.DISK_USAGE_DATE_RANGE = exports.NETWORK_USAGE_DATE_RANGE = exports.CPU_USAGE_DATE_RANGE = exports.RAM_USAGE_DATE_RANGE = exports.DISK_USAGE_START_TIME = exports.NETWORK_USAGE_START_TIME = exports.CPU_USAGE_START_TIME = exports.RAM_USAGE_START_TIME = exports.SNAP_SHOTS = exports.PORTNATS = exports.COMPUTING_DETAIL = void 0;
|
3
|
+
exports.GET_COMPUTING_BY_CLUSTER = exports.GET_CLUSTER = exports.GET_CLUSTERS = exports.GET_LAB_INSTANCE = exports.GET_COMPUTINGS = exports.BACKUP_POINT = exports.DISK_USAGE_DATE_RANGE = exports.NETWORK_USAGE_DATE_RANGE = exports.CPU_USAGE_DATE_RANGE = exports.RAM_USAGE_DATE_RANGE = exports.DISK_USAGE_START_TIME = exports.NETWORK_USAGE_START_TIME = exports.CPU_USAGE_START_TIME = exports.RAM_USAGE_START_TIME = exports.SNAP_SHOTS = exports.PORTNATS = exports.COMPUTING_DETAIL = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
exports.COMPUTING_DETAIL = (0, graphql_tag_1.gql) `
|
6
6
|
query ComputingDetail($computingId: String!) {
|
@@ -184,3 +184,99 @@ exports.BACKUP_POINT = (0, graphql_tag_1.gql) `
|
|
184
184
|
}
|
185
185
|
}
|
186
186
|
`;
|
187
|
+
exports.GET_COMPUTINGS = (0, graphql_tag_1.gql) `
|
188
|
+
query GetComputings($userId: String!) {
|
189
|
+
getComputings(userId: $userId) {
|
190
|
+
id
|
191
|
+
name
|
192
|
+
username
|
193
|
+
password
|
194
|
+
state
|
195
|
+
os
|
196
|
+
ips
|
197
|
+
province
|
198
|
+
console
|
199
|
+
consoleCookieName
|
200
|
+
consoleCookieValue
|
201
|
+
existPortNat
|
202
|
+
ipConnect
|
203
|
+
portConnect
|
204
|
+
protocolConnect
|
205
|
+
lastBackup
|
206
|
+
backupSequence
|
207
|
+
serviceId
|
208
|
+
status
|
209
|
+
statusDetail
|
210
|
+
}
|
211
|
+
}
|
212
|
+
`;
|
213
|
+
exports.GET_LAB_INSTANCE = (0, graphql_tag_1.gql) `
|
214
|
+
query GetLabInstance($articleId: String!, $userId: String!) {
|
215
|
+
getLabInstance(articleId: $articleId, userId: $userId) {
|
216
|
+
id
|
217
|
+
name
|
218
|
+
username
|
219
|
+
password
|
220
|
+
state
|
221
|
+
os
|
222
|
+
ips
|
223
|
+
province
|
224
|
+
console
|
225
|
+
consoleCookieName
|
226
|
+
consoleCookieValue
|
227
|
+
existPortNat
|
228
|
+
ipConnect
|
229
|
+
portConnect
|
230
|
+
protocolConnect
|
231
|
+
lastBackup
|
232
|
+
backupSequence
|
233
|
+
serviceId
|
234
|
+
status
|
235
|
+
statusDetail
|
236
|
+
}
|
237
|
+
}
|
238
|
+
`;
|
239
|
+
exports.GET_CLUSTERS = (0, graphql_tag_1.gql) `
|
240
|
+
query getClusters($ownerId: String!) {
|
241
|
+
getClusters(ownerId: $ownerId) {
|
242
|
+
id
|
243
|
+
name
|
244
|
+
description
|
245
|
+
}
|
246
|
+
}
|
247
|
+
`;
|
248
|
+
exports.GET_CLUSTER = (0, graphql_tag_1.gql) `
|
249
|
+
query getCluster($clusterId: String!) {
|
250
|
+
getCluster(clusterId: $clusterId) {
|
251
|
+
id
|
252
|
+
name
|
253
|
+
description
|
254
|
+
}
|
255
|
+
}
|
256
|
+
`;
|
257
|
+
exports.GET_COMPUTING_BY_CLUSTER = (0, graphql_tag_1.gql) `
|
258
|
+
query GetComputingByCluster($clusterId: String!) {
|
259
|
+
getComputingByCluster(clusterId: $clusterId) {
|
260
|
+
id
|
261
|
+
name
|
262
|
+
username
|
263
|
+
password
|
264
|
+
state
|
265
|
+
os
|
266
|
+
ips
|
267
|
+
province
|
268
|
+
console
|
269
|
+
consoleCookieName
|
270
|
+
consoleCookieValue
|
271
|
+
existPortNat
|
272
|
+
ipConnect
|
273
|
+
portConnect
|
274
|
+
protocolConnect
|
275
|
+
lastBackup
|
276
|
+
backupSequence
|
277
|
+
serviceId
|
278
|
+
status
|
279
|
+
statusDetail
|
280
|
+
}
|
281
|
+
}
|
282
|
+
`;
|
@@ -31,4 +31,12 @@ export declare class ComputingService extends Service {
|
|
31
31
|
diskUsageDateRange(computingId: string, type: string, fromDate: any, toDate: any): Promise<any>;
|
32
32
|
networkUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
|
33
33
|
diskUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
|
34
|
+
getComputings(userId: string): Promise<any>;
|
35
|
+
getLabInstance(articleId: string, userId: string): Promise<any>;
|
36
|
+
createCluster(ownerId: string, name: string): Promise<any>;
|
37
|
+
addComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
|
38
|
+
removeComputingInCluster(clusterId: string, computingId: string, userId: string): Promise<any>;
|
39
|
+
getClusters(ownerId: string): Promise<any>;
|
40
|
+
getCluster(clusterId: string): Promise<any>;
|
41
|
+
getComputingByCluster(clusterId: string): Promise<any>;
|
34
42
|
}
|
@@ -410,5 +410,139 @@ class ComputingService extends serviceSDK_1.Service {
|
|
410
410
|
}
|
411
411
|
});
|
412
412
|
}
|
413
|
+
getComputings(userId) {
|
414
|
+
return __awaiter(this, void 0, void 0, function* () {
|
415
|
+
const query = queries_1.GET_COMPUTINGS;
|
416
|
+
const variables = {
|
417
|
+
userId,
|
418
|
+
};
|
419
|
+
try {
|
420
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
421
|
+
return response.getComputings;
|
422
|
+
}
|
423
|
+
catch (error) {
|
424
|
+
console.log(`Error fetching get getComputings method: ${error}`);
|
425
|
+
throw error;
|
426
|
+
}
|
427
|
+
});
|
428
|
+
}
|
429
|
+
getLabInstance(articleId, userId) {
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
431
|
+
const query = queries_1.GET_LAB_INSTANCE;
|
432
|
+
const variables = {
|
433
|
+
articleId,
|
434
|
+
userId,
|
435
|
+
};
|
436
|
+
try {
|
437
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
438
|
+
return response.getLabInstance;
|
439
|
+
}
|
440
|
+
catch (error) {
|
441
|
+
console.log(`Error fetching get getLabInstance method: ${error}`);
|
442
|
+
throw error;
|
443
|
+
}
|
444
|
+
});
|
445
|
+
}
|
446
|
+
createCluster(ownerId, name) {
|
447
|
+
return __awaiter(this, void 0, void 0, function* () {
|
448
|
+
const mutation = mutations_1.CREATE_CLUSTER;
|
449
|
+
const variables = {
|
450
|
+
ownerId,
|
451
|
+
name,
|
452
|
+
};
|
453
|
+
try {
|
454
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
455
|
+
return response.createCluster;
|
456
|
+
}
|
457
|
+
catch (error) {
|
458
|
+
console.log(`Error fetching get createCluster method: ${error}`);
|
459
|
+
throw error;
|
460
|
+
}
|
461
|
+
});
|
462
|
+
}
|
463
|
+
addComputingInCluster(clusterId, computingId, userId) {
|
464
|
+
return __awaiter(this, void 0, void 0, function* () {
|
465
|
+
const mutation = mutations_1.ADD_COMPUTING_IN_CLUSTER;
|
466
|
+
const variables = {
|
467
|
+
clusterId,
|
468
|
+
computingId,
|
469
|
+
userId,
|
470
|
+
};
|
471
|
+
try {
|
472
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
473
|
+
return response.addComputingInCluster;
|
474
|
+
}
|
475
|
+
catch (error) {
|
476
|
+
console.log(`Error fetching get addComputingInCluster method: ${error}`);
|
477
|
+
throw error;
|
478
|
+
}
|
479
|
+
});
|
480
|
+
}
|
481
|
+
removeComputingInCluster(clusterId, computingId, userId) {
|
482
|
+
return __awaiter(this, void 0, void 0, function* () {
|
483
|
+
const mutation = mutations_1.REMOVE_COMPUTING_IN_CLUSTER;
|
484
|
+
const variables = {
|
485
|
+
clusterId,
|
486
|
+
computingId,
|
487
|
+
userId,
|
488
|
+
};
|
489
|
+
try {
|
490
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
491
|
+
return response.removeComputingInCluster;
|
492
|
+
}
|
493
|
+
catch (error) {
|
494
|
+
console.log(`Error fetching get removeComputingInCluster method: ${error}`);
|
495
|
+
throw error;
|
496
|
+
}
|
497
|
+
});
|
498
|
+
}
|
499
|
+
getClusters(ownerId) {
|
500
|
+
return __awaiter(this, void 0, void 0, function* () {
|
501
|
+
const query = queries_1.GET_CLUSTERS;
|
502
|
+
const variables = {
|
503
|
+
ownerId,
|
504
|
+
};
|
505
|
+
try {
|
506
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
507
|
+
return response.getClusters;
|
508
|
+
}
|
509
|
+
catch (error) {
|
510
|
+
console.log(`Error fetching get getClusters method: ${error}`);
|
511
|
+
throw error;
|
512
|
+
}
|
513
|
+
});
|
514
|
+
}
|
515
|
+
getCluster(clusterId) {
|
516
|
+
return __awaiter(this, void 0, void 0, function* () {
|
517
|
+
const query = queries_1.GET_CLUSTER;
|
518
|
+
const variables = {
|
519
|
+
clusterId,
|
520
|
+
};
|
521
|
+
try {
|
522
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
523
|
+
return response.getCluster;
|
524
|
+
}
|
525
|
+
catch (error) {
|
526
|
+
console.log(`Error fetching get getCluster method: ${error}`);
|
527
|
+
throw error;
|
528
|
+
}
|
529
|
+
});
|
530
|
+
}
|
531
|
+
getComputingByCluster(clusterId) {
|
532
|
+
return __awaiter(this, void 0, void 0, function* () {
|
533
|
+
const query = queries_1.GET_COMPUTING_BY_CLUSTER;
|
534
|
+
const variables = {
|
535
|
+
clusterId,
|
536
|
+
};
|
537
|
+
try {
|
538
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
539
|
+
return response.getComputingByCluster;
|
540
|
+
}
|
541
|
+
catch (error) {
|
542
|
+
console.log(`Error fetching get getComputingByCluster method: ${error}`);
|
543
|
+
throw error;
|
544
|
+
}
|
545
|
+
});
|
546
|
+
}
|
413
547
|
}
|
414
548
|
exports.ComputingService = ComputingService;
|