@longvansoftware/service-js-client 1.9.1 → 1.9.2

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.
@@ -12,3 +12,4 @@ export declare const CREATE_CLUSTER: import("graphql").DocumentNode;
12
12
  export declare const ADD_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
13
13
  export declare const REMOVE_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode;
14
14
  export declare const STOP_USE_COMPUTING: import("graphql").DocumentNode;
15
+ export declare const ADD_PORT_NAT: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STOP_USE_COMPUTING = 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;
3
+ exports.ADD_PORT_NAT = exports.STOP_USE_COMPUTING = 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!) {
@@ -181,3 +181,30 @@ exports.STOP_USE_COMPUTING = (0, graphql_tag_1.gql) `
181
181
  }
182
182
  }
183
183
  `;
184
+ exports.ADD_PORT_NAT = (0, graphql_tag_1.gql) `
185
+ mutation AddPortNat(
186
+ $edgeId: String!
187
+ $serviceId: String
188
+ $computingId: String
189
+ $originalAddress: String!
190
+ $originalPort: String!
191
+ $translatedAddress: String!
192
+ $translatedPort: String!
193
+ $action: String!
194
+ $description: String
195
+ $createBy: String
196
+ ) {
197
+ addPortNat(
198
+ edgeId: $edgeId
199
+ serviceId: $serviceId
200
+ computingId: $computingId
201
+ originalAddress: $originalAddress
202
+ originalPort: $originalPort
203
+ translatedAddress: $translatedAddress
204
+ translatedPort: $translatedPort
205
+ action: $action
206
+ description: $description
207
+ createBy: $createBy
208
+ )
209
+ }
210
+ `;
@@ -16,3 +16,5 @@ export declare const GET_CLUSTERS: import("graphql").DocumentNode;
16
16
  export declare const GET_CLUSTER: import("graphql").DocumentNode;
17
17
  export declare const GET_COMPUTING_BY_CLUSTER: import("graphql").DocumentNode;
18
18
  export declare const GET_COMPUTING_BY_SERVICE: import("graphql").DocumentNode;
19
+ export declare const GET_EDGES: import("graphql").DocumentNode;
20
+ export declare const GET_PORT_NATS_BY_SERVICE_ID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_COMPUTING_BY_SERVICE = 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;
3
+ exports.GET_PORT_NATS_BY_SERVICE_ID = exports.GET_EDGES = exports.GET_COMPUTING_BY_SERVICE = 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!) {
@@ -379,3 +379,31 @@ exports.GET_COMPUTING_BY_SERVICE = (0, graphql_tag_1.gql) `
379
379
  }
380
380
  }
381
381
  `;
382
+ exports.GET_EDGES = (0, graphql_tag_1.gql) `
383
+ query getEdges($serviceId: String!) {
384
+ getEdges(serviceId: $serviceId) {
385
+ id
386
+ name
387
+ status
388
+ partnerId
389
+ createdStamp
390
+ description
391
+ }
392
+ }
393
+ `;
394
+ exports.GET_PORT_NATS_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
395
+ query getPortNatsByServiceId($serviceId: String!) {
396
+ getPortNatsByServiceId(serviceId: $serviceId) {
397
+ id
398
+ action
399
+ protocol
400
+ originalAddress
401
+ originalPort
402
+ translatedAddress
403
+ translatedPort
404
+ description
405
+ status
406
+ domain
407
+ }
408
+ }
409
+ `;
@@ -42,4 +42,7 @@ export declare class ComputingService extends Service {
42
42
  getComputingByCluster(clusterId: string): Promise<any>;
43
43
  getComputingByService(serviceId: string): Promise<any>;
44
44
  stopUseComputing(computingId: string, userId: string): Promise<any>;
45
+ getEdges(serviceId: string): Promise<any>;
46
+ addPortNat(data: any): Promise<any>;
47
+ getPortNatsByServiceId(serviceId: any): Promise<any>;
45
48
  }
@@ -583,5 +583,51 @@ class ComputingService extends serviceSDK_1.Service {
583
583
  }
584
584
  });
585
585
  }
586
+ getEdges(serviceId) {
587
+ return __awaiter(this, void 0, void 0, function* () {
588
+ const query = queries_1.GET_EDGES;
589
+ const variables = {
590
+ serviceId
591
+ };
592
+ try {
593
+ const response = yield this.graphqlQueryV2(query, variables);
594
+ return response.getEdges;
595
+ }
596
+ catch (error) {
597
+ console.log(`Error fetching get getEdges method: ${error}`);
598
+ throw error;
599
+ }
600
+ });
601
+ }
602
+ addPortNat(data) {
603
+ return __awaiter(this, void 0, void 0, function* () {
604
+ const mutation = mutations_1.ADD_PORT_NAT;
605
+ const variables = Object.assign({}, data);
606
+ try {
607
+ const response = yield this.graphqlMutationV2(mutation, variables);
608
+ return response.addPortNat;
609
+ }
610
+ catch (error) {
611
+ console.log(`Error fetching get addPortNat method: ${error}`);
612
+ throw error;
613
+ }
614
+ });
615
+ }
616
+ getPortNatsByServiceId(serviceId) {
617
+ return __awaiter(this, void 0, void 0, function* () {
618
+ const query = queries_1.GET_PORT_NATS_BY_SERVICE_ID;
619
+ const variables = {
620
+ serviceId
621
+ };
622
+ try {
623
+ const response = yield this.graphqlQueryV2(query, variables);
624
+ return response.getPortNatsByServiceId;
625
+ }
626
+ catch (error) {
627
+ console.log(`Error fetching get getPortNatsByServiceId method: ${error}`);
628
+ throw error;
629
+ }
630
+ });
631
+ }
586
632
  }
587
633
  exports.ComputingService = ComputingService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [