@longvansoftware/service-js-client 1.9.9 → 1.10.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.
@@ -15,3 +15,4 @@ export declare const STOP_USE_COMPUTING: import("graphql").DocumentNode;
15
15
  export declare const ADD_PORT_NAT: import("graphql").DocumentNode;
16
16
  export declare const UPDATE_DESCRIPTION_COMPUTING: import("graphql").DocumentNode;
17
17
  export declare const CREATE_COMPUTING_FOR_DC: import("graphql").DocumentNode;
18
+ export declare const UPDATE_NAME_COMPUTING: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_COMPUTING_FOR_DC = exports.UPDATE_DESCRIPTION_COMPUTING = 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;
3
+ exports.UPDATE_NAME_COMPUTING = exports.CREATE_COMPUTING_FOR_DC = exports.UPDATE_DESCRIPTION_COMPUTING = 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!) {
@@ -235,19 +235,34 @@ exports.CREATE_COMPUTING_FOR_DC = (0, graphql_tag_1.gql) `
235
235
  $disks: [DiskInput!]!
236
236
  ) {
237
237
  createComputingForDC(
238
- name: $name
239
- username: $username
240
- password: $password
241
- description: $description
242
- templateId: $templateId
243
- interfaces: $interfaces
244
- cpu: $cpu
245
- ram: $ram
246
- resourcePoolId: $resourcePoolId
247
- disks: $disks
238
+ createComputingInputForDC: {
239
+ name: $name
240
+ username: $username
241
+ password: $password
242
+ description: $description
243
+ templateId: $templateId
244
+ interfaces: $interfaces
245
+ cpu: $cpu
246
+ ram: $ram
247
+ resourcePoolId: $resourcePoolId
248
+ disks: $disks
249
+ }
248
250
  ) {
249
251
  computingId
250
252
  message
251
253
  }
252
254
  }
253
255
  `;
256
+ exports.UPDATE_NAME_COMPUTING = (0, graphql_tag_1.gql) `
257
+ mutation UpdateNameComputing(
258
+ $computingId: String!
259
+ $name: String!
260
+ $updateBy: String
261
+ ) {
262
+ updateNameComputing(
263
+ computingId: $computingId
264
+ name: $name
265
+ updateBy: $updateBy
266
+ )
267
+ }
268
+ `;
@@ -51,4 +51,5 @@ export declare class ComputingService extends Service {
51
51
  getAvailableStoragesForDC(resourcePoolId: string): Promise<any>;
52
52
  getResourcePoolsByService(serviceId: string): Promise<any>;
53
53
  createComputingForDC(data: any): Promise<any>;
54
+ updateNameComputing(computingId: string, name: string, updateBy: string): Promise<any>;
54
55
  }
@@ -734,5 +734,23 @@ class ComputingService extends serviceSDK_1.Service {
734
734
  }
735
735
  });
736
736
  }
737
+ updateNameComputing(computingId, name, updateBy) {
738
+ return __awaiter(this, void 0, void 0, function* () {
739
+ const mutation = mutations_1.UPDATE_NAME_COMPUTING;
740
+ const variables = {
741
+ computingId,
742
+ name,
743
+ updateBy,
744
+ };
745
+ try {
746
+ const response = yield this.graphqlMutationV2(mutation, variables);
747
+ return response.updateNameComputing;
748
+ }
749
+ catch (error) {
750
+ console.log(`Error fetching get updateNameComputing method: ${error}`);
751
+ throw error;
752
+ }
753
+ });
754
+ }
737
755
  }
738
756
  exports.ComputingService = ComputingService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.9.9",
3
+ "version": "1.10.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [