@longvansoftware/service-js-client 1.9.8 → 1.9.9
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 +1 -0
- package/dist/src/graphql/computing/mutations.js +31 -1
- package/dist/src/graphql/computing/queries.d.ts +4 -0
- package/dist/src/graphql/computing/queries.js +53 -1
- package/dist/src/lib/computing/index.d.ts +5 -0
- package/dist/src/lib/computing/index.js +87 -0
- package/package.json +1 -1
@@ -14,3 +14,4 @@ export declare const REMOVE_COMPUTING_IN_CLUSTER: import("graphql").DocumentNode
|
|
14
14
|
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
|
+
export declare const CREATE_COMPUTING_FOR_DC: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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.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!) {
|
@@ -221,3 +221,33 @@ exports.UPDATE_DESCRIPTION_COMPUTING = (0, graphql_tag_1.gql) `
|
|
221
221
|
)
|
222
222
|
}
|
223
223
|
`;
|
224
|
+
exports.CREATE_COMPUTING_FOR_DC = (0, graphql_tag_1.gql) `
|
225
|
+
mutation CreateComputingForDC(
|
226
|
+
$name: String!
|
227
|
+
$username: String!
|
228
|
+
$password: String!
|
229
|
+
$description: String!
|
230
|
+
$templateId: String!
|
231
|
+
$interfaces: [InterfacesInput]!
|
232
|
+
$cpu: CpuInput!
|
233
|
+
$ram: RamInput!
|
234
|
+
$resourcePoolId: String!
|
235
|
+
$disks: [DiskInput!]!
|
236
|
+
) {
|
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
|
248
|
+
) {
|
249
|
+
computingId
|
250
|
+
message
|
251
|
+
}
|
252
|
+
}
|
253
|
+
`;
|
@@ -18,3 +18,7 @@ export declare const GET_COMPUTING_BY_CLUSTER: import("graphql").DocumentNode;
|
|
18
18
|
export declare const GET_COMPUTING_BY_SERVICE: import("graphql").DocumentNode;
|
19
19
|
export declare const GET_EDGES: import("graphql").DocumentNode;
|
20
20
|
export declare const GET_PORT_NATS_BY_SERVICE_ID: import("graphql").DocumentNode;
|
21
|
+
export declare const GET_TEMPLATE: import("graphql").DocumentNode;
|
22
|
+
export declare const GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID: import("graphql").DocumentNode;
|
23
|
+
export declare const GET_AVAILABLE_STORAGES_FOR_DC: import("graphql").DocumentNode;
|
24
|
+
export declare const GET_RESOUCE_POOL_BY_SERVICE: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
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;
|
3
|
+
exports.GET_RESOUCE_POOL_BY_SERVICE = exports.GET_AVAILABLE_STORAGES_FOR_DC = exports.GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID = exports.GET_TEMPLATE = 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!) {
|
@@ -413,3 +413,55 @@ exports.GET_PORT_NATS_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
|
|
413
413
|
}
|
414
414
|
}
|
415
415
|
`;
|
416
|
+
exports.GET_TEMPLATE = (0, graphql_tag_1.gql) `
|
417
|
+
query {
|
418
|
+
getTemplates {
|
419
|
+
id
|
420
|
+
name
|
421
|
+
status
|
422
|
+
osType
|
423
|
+
username
|
424
|
+
createdStamp
|
425
|
+
updatedStamp
|
426
|
+
}
|
427
|
+
}
|
428
|
+
`;
|
429
|
+
exports.GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID = (0, graphql_tag_1.gql) `
|
430
|
+
query GetAvailableSubnetIPsByResourcePoolId($resourcePoolId: String!) {
|
431
|
+
getAvailableSubnetIPsByResourcePoolId(resourcePoolId: $resourcePoolId) {
|
432
|
+
parentSubnetId
|
433
|
+
address
|
434
|
+
description
|
435
|
+
status
|
436
|
+
rangeIpType
|
437
|
+
createTime
|
438
|
+
updateTime
|
439
|
+
}
|
440
|
+
}
|
441
|
+
`;
|
442
|
+
exports.GET_AVAILABLE_STORAGES_FOR_DC = (0, graphql_tag_1.gql) `
|
443
|
+
query GetAvailableStoragesForDC($resourcePoolId: String!) {
|
444
|
+
getAvailableStoragesForDC(resourcePoolId: $resourcePoolId) {
|
445
|
+
id
|
446
|
+
partnerId
|
447
|
+
configId
|
448
|
+
virtualId
|
449
|
+
name
|
450
|
+
status
|
451
|
+
platform
|
452
|
+
description
|
453
|
+
createdStamp
|
454
|
+
updatedStamp
|
455
|
+
}
|
456
|
+
}
|
457
|
+
`;
|
458
|
+
exports.GET_RESOUCE_POOL_BY_SERVICE = (0, graphql_tag_1.gql) `
|
459
|
+
query GetResourcePoolsByService($serviceId: String!) {
|
460
|
+
getResourcePoolsByService(serviceId: $serviceId) {
|
461
|
+
id
|
462
|
+
name
|
463
|
+
status
|
464
|
+
platform
|
465
|
+
}
|
466
|
+
}
|
467
|
+
`;
|
@@ -46,4 +46,9 @@ export declare class ComputingService extends Service {
|
|
46
46
|
addPortNat(data: any): Promise<any>;
|
47
47
|
getPortNatsByServiceId(serviceId: any): Promise<any>;
|
48
48
|
updateDescriptionComputing(computingId: string, description: string, updateBy: string): Promise<any>;
|
49
|
+
getTemplates(): Promise<any>;
|
50
|
+
getAvailableSubnetIPsByResourcePoolId(resourcePoolId: string): Promise<any>;
|
51
|
+
getAvailableStoragesForDC(resourcePoolId: string): Promise<any>;
|
52
|
+
getResourcePoolsByService(serviceId: string): Promise<any>;
|
53
|
+
createComputingForDC(data: any): Promise<any>;
|
49
54
|
}
|
@@ -647,5 +647,92 @@ class ComputingService extends serviceSDK_1.Service {
|
|
647
647
|
}
|
648
648
|
});
|
649
649
|
}
|
650
|
+
getTemplates() {
|
651
|
+
return __awaiter(this, void 0, void 0, function* () {
|
652
|
+
const query = queries_1.GET_TEMPLATE;
|
653
|
+
const variables = {};
|
654
|
+
try {
|
655
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
656
|
+
return response.getTemplates;
|
657
|
+
}
|
658
|
+
catch (error) {
|
659
|
+
console.log(`Error fetching get getTemplates method: ${error}`);
|
660
|
+
throw error;
|
661
|
+
}
|
662
|
+
});
|
663
|
+
}
|
664
|
+
getAvailableSubnetIPsByResourcePoolId(resourcePoolId) {
|
665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
666
|
+
const query = queries_1.GET_AVAILABLE_SUBNET_IPS_BY_RESOURCEPOLL_ID;
|
667
|
+
const variables = {
|
668
|
+
resourcePoolId,
|
669
|
+
};
|
670
|
+
try {
|
671
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
672
|
+
return response.getAvailableSubnetIPsByResourcePoolId;
|
673
|
+
}
|
674
|
+
catch (error) {
|
675
|
+
console.log(`Error fetching get getAvailableSubnetIPsByResourcePoolId method: ${error}`);
|
676
|
+
throw error;
|
677
|
+
}
|
678
|
+
});
|
679
|
+
}
|
680
|
+
getAvailableStoragesForDC(resourcePoolId) {
|
681
|
+
return __awaiter(this, void 0, void 0, function* () {
|
682
|
+
const query = queries_1.GET_AVAILABLE_STORAGES_FOR_DC;
|
683
|
+
const variables = {
|
684
|
+
resourcePoolId,
|
685
|
+
};
|
686
|
+
try {
|
687
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
688
|
+
return response.getAvailableStoragesForDC;
|
689
|
+
}
|
690
|
+
catch (error) {
|
691
|
+
console.log(`Error fetching get getAvailableStoragesForDC method: ${error}`);
|
692
|
+
throw error;
|
693
|
+
}
|
694
|
+
});
|
695
|
+
}
|
696
|
+
getResourcePoolsByService(serviceId) {
|
697
|
+
return __awaiter(this, void 0, void 0, function* () {
|
698
|
+
const query = queries_1.GET_RESOUCE_POOL_BY_SERVICE;
|
699
|
+
const variables = {
|
700
|
+
serviceId,
|
701
|
+
};
|
702
|
+
try {
|
703
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
704
|
+
return response.getResourcePoolsByService;
|
705
|
+
}
|
706
|
+
catch (error) {
|
707
|
+
console.log(`Error fetching get getResourcePoolsByService method: ${error}`);
|
708
|
+
throw error;
|
709
|
+
}
|
710
|
+
});
|
711
|
+
}
|
712
|
+
createComputingForDC(data) {
|
713
|
+
return __awaiter(this, void 0, void 0, function* () {
|
714
|
+
const mutation = mutations_1.CREATE_COMPUTING_FOR_DC;
|
715
|
+
const variables = {
|
716
|
+
name: data === null || data === void 0 ? void 0 : data.name,
|
717
|
+
username: data === null || data === void 0 ? void 0 : data.username,
|
718
|
+
password: data === null || data === void 0 ? void 0 : data.password,
|
719
|
+
description: data === null || data === void 0 ? void 0 : data.description,
|
720
|
+
templateId: data === null || data === void 0 ? void 0 : data.templateId,
|
721
|
+
interfaces: data === null || data === void 0 ? void 0 : data.interfaces,
|
722
|
+
cpu: data === null || data === void 0 ? void 0 : data.cpu,
|
723
|
+
ram: data === null || data === void 0 ? void 0 : data.ram,
|
724
|
+
resourcePoolId: data === null || data === void 0 ? void 0 : data.resourcePoolId,
|
725
|
+
disks: data === null || data === void 0 ? void 0 : data.disks,
|
726
|
+
};
|
727
|
+
try {
|
728
|
+
const response = yield this.graphqlMutationV2(mutation, variables);
|
729
|
+
return response.createComputingForDC;
|
730
|
+
}
|
731
|
+
catch (error) {
|
732
|
+
console.log(`Error fetching get createComputingForDC method: ${error}`);
|
733
|
+
throw error;
|
734
|
+
}
|
735
|
+
});
|
736
|
+
}
|
650
737
|
}
|
651
738
|
exports.ComputingService = ComputingService;
|