@longvansoftware/service-js-client 1.3.5 → 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.
@@ -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
+ `;
@@ -11,3 +11,7 @@ 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
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.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;
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!) {
@@ -205,6 +205,78 @@ exports.GET_COMPUTINGS = (0, graphql_tag_1.gql) `
205
205
  lastBackup
206
206
  backupSequence
207
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
208
280
  }
209
281
  }
210
282
  `;
@@ -32,4 +32,11 @@ export declare class ComputingService extends Service {
32
32
  networkUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
33
33
  diskUsageStartTime(computingId: string, type: string, startTime: string): Promise<any>;
34
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>;
35
42
  }
@@ -426,5 +426,123 @@ class ComputingService extends serviceSDK_1.Service {
426
426
  }
427
427
  });
428
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
+ }
429
547
  }
430
548
  exports.ComputingService = ComputingService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [