@nexgencloud/hyperstack-sdk-typescript 1.54.7-alpha → 1.55.4-alpha
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/README.md +2 -2
- package/api.ts +231 -0
- package/common.ts +2 -2
- package/dist/api.d.ts +187 -0
- package/dist/api.js +76 -0
- package/dist/common.js +2 -0
- package/dist/esm/api.d.ts +187 -0
- package/dist/esm/api.js +76 -0
- package/dist/esm/common.js +2 -0
- package/dist/esm/hyperstackHeaders.d.ts +24 -0
- package/dist/esm/hyperstackHeaders.js +68 -0
- package/dist/hyperstackHeaders.d.ts +24 -0
- package/dist/hyperstackHeaders.js +72 -0
- package/hyperstackHeaders.ts +78 -0
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -16466,6 +16466,42 @@ const VirtualMachineApiAxiosParamCreator = function (configuration) {
|
|
|
16466
16466
|
options: localVarRequestOptions,
|
|
16467
16467
|
};
|
|
16468
16468
|
}),
|
|
16469
|
+
/**
|
|
16470
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
16471
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
16472
|
+
* @param {number} vmId
|
|
16473
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
16474
|
+
* @param {*} [options] Override http request option.
|
|
16475
|
+
* @throws {RequiredError}
|
|
16476
|
+
*/
|
|
16477
|
+
toggleEnhancedMetricsForAVM: (vmId_1, payload_1, ...args_1) => __awaiter(this, [vmId_1, payload_1, ...args_1], void 0, function* (vmId, payload, options = {}) {
|
|
16478
|
+
// verify required parameter 'vmId' is not null or undefined
|
|
16479
|
+
(0, common_1.assertParamExists)('toggleEnhancedMetricsForAVM', 'vmId', vmId);
|
|
16480
|
+
// verify required parameter 'payload' is not null or undefined
|
|
16481
|
+
(0, common_1.assertParamExists)('toggleEnhancedMetricsForAVM', 'payload', payload);
|
|
16482
|
+
const localVarPath = `/core/virtual-machines/{vm_id}/enhanced-metrics`
|
|
16483
|
+
.replace(`{${"vm_id"}}`, encodeURIComponent(String(vmId)));
|
|
16484
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
16485
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
16486
|
+
let baseOptions;
|
|
16487
|
+
if (configuration) {
|
|
16488
|
+
baseOptions = configuration.baseOptions;
|
|
16489
|
+
}
|
|
16490
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
16491
|
+
const localVarHeaderParameter = {};
|
|
16492
|
+
const localVarQueryParameter = {};
|
|
16493
|
+
// authentication apiKey required
|
|
16494
|
+
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "api_key", configuration);
|
|
16495
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
16496
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
16497
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
16498
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
16499
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(payload, localVarRequestOptions, configuration);
|
|
16500
|
+
return {
|
|
16501
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
16502
|
+
options: localVarRequestOptions,
|
|
16503
|
+
};
|
|
16504
|
+
}),
|
|
16469
16505
|
};
|
|
16470
16506
|
};
|
|
16471
16507
|
exports.VirtualMachineApiAxiosParamCreator = VirtualMachineApiAxiosParamCreator;
|
|
@@ -16815,6 +16851,23 @@ const VirtualMachineApiFp = function (configuration) {
|
|
|
16815
16851
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
16816
16852
|
});
|
|
16817
16853
|
},
|
|
16854
|
+
/**
|
|
16855
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
16856
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
16857
|
+
* @param {number} vmId
|
|
16858
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
16859
|
+
* @param {*} [options] Override http request option.
|
|
16860
|
+
* @throws {RequiredError}
|
|
16861
|
+
*/
|
|
16862
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
16863
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16864
|
+
var _a, _b, _c;
|
|
16865
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.toggleEnhancedMetricsForAVM(vmId, payload, options);
|
|
16866
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
16867
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['VirtualMachineApi.toggleEnhancedMetricsForAVM']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
16868
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
16869
|
+
});
|
|
16870
|
+
},
|
|
16818
16871
|
};
|
|
16819
16872
|
};
|
|
16820
16873
|
exports.VirtualMachineApiFp = VirtualMachineApiFp;
|
|
@@ -17044,6 +17097,17 @@ const VirtualMachineApiFactory = function (configuration, basePath, axios) {
|
|
|
17044
17097
|
stopVM(vmId, options) {
|
|
17045
17098
|
return localVarFp.stopVM(vmId, options).then((request) => request(axios, basePath));
|
|
17046
17099
|
},
|
|
17100
|
+
/**
|
|
17101
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
17102
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
17103
|
+
* @param {number} vmId
|
|
17104
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
17105
|
+
* @param {*} [options] Override http request option.
|
|
17106
|
+
* @throws {RequiredError}
|
|
17107
|
+
*/
|
|
17108
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
17109
|
+
return localVarFp.toggleEnhancedMetricsForAVM(vmId, payload, options).then((request) => request(axios, basePath));
|
|
17110
|
+
},
|
|
17047
17111
|
};
|
|
17048
17112
|
};
|
|
17049
17113
|
exports.VirtualMachineApiFactory = VirtualMachineApiFactory;
|
|
@@ -17293,6 +17357,18 @@ class VirtualMachineApi extends base_1.BaseAPI {
|
|
|
17293
17357
|
stopVM(vmId, options) {
|
|
17294
17358
|
return (0, exports.VirtualMachineApiFp)(this.configuration).stopVM(vmId, options).then((request) => request(this.axios, this.basePath));
|
|
17295
17359
|
}
|
|
17360
|
+
/**
|
|
17361
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
17362
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
17363
|
+
* @param {number} vmId
|
|
17364
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
17365
|
+
* @param {*} [options] Override http request option.
|
|
17366
|
+
* @throws {RequiredError}
|
|
17367
|
+
* @memberof VirtualMachineApi
|
|
17368
|
+
*/
|
|
17369
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
17370
|
+
return (0, exports.VirtualMachineApiFp)(this.configuration).toggleEnhancedMetricsForAVM(vmId, payload, options).then((request) => request(this.axios, this.basePath));
|
|
17371
|
+
}
|
|
17296
17372
|
}
|
|
17297
17373
|
exports.VirtualMachineApi = VirtualMachineApi;
|
|
17298
17374
|
/**
|
package/dist/common.js
CHANGED
|
@@ -24,6 +24,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
26
26
|
const base_1 = require("./base");
|
|
27
|
+
const hyperstackHeaders_1 = require("./hyperstackHeaders");
|
|
27
28
|
/**
|
|
28
29
|
*
|
|
29
30
|
* @export
|
|
@@ -155,6 +156,7 @@ const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, confi
|
|
|
155
156
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
156
157
|
var _a;
|
|
157
158
|
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
159
|
+
(0, hyperstackHeaders_1.applyHyperstackHeaders)(axiosRequestArgs);
|
|
158
160
|
return axios.request(axiosRequestArgs);
|
|
159
161
|
};
|
|
160
162
|
};
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -1767,6 +1767,43 @@ export interface CompatibleFlavor {
|
|
|
1767
1767
|
*/
|
|
1768
1768
|
'reason'?: string;
|
|
1769
1769
|
}
|
|
1770
|
+
/**
|
|
1771
|
+
*
|
|
1772
|
+
* @export
|
|
1773
|
+
* @interface CompatibleImage
|
|
1774
|
+
*/
|
|
1775
|
+
export interface CompatibleImage {
|
|
1776
|
+
/**
|
|
1777
|
+
* JSON constraints object
|
|
1778
|
+
* @type {object}
|
|
1779
|
+
* @memberof CompatibleImage
|
|
1780
|
+
*/
|
|
1781
|
+
'constraints'?: object;
|
|
1782
|
+
/**
|
|
1783
|
+
*
|
|
1784
|
+
* @type {number}
|
|
1785
|
+
* @memberof CompatibleImage
|
|
1786
|
+
*/
|
|
1787
|
+
'image_id'?: number;
|
|
1788
|
+
/**
|
|
1789
|
+
*
|
|
1790
|
+
* @type {string}
|
|
1791
|
+
* @memberof CompatibleImage
|
|
1792
|
+
*/
|
|
1793
|
+
'image_name'?: string;
|
|
1794
|
+
/**
|
|
1795
|
+
* Either \'hard\' or \'soft\'
|
|
1796
|
+
* @type {string}
|
|
1797
|
+
* @memberof CompatibleImage
|
|
1798
|
+
*/
|
|
1799
|
+
'link_type'?: string;
|
|
1800
|
+
/**
|
|
1801
|
+
*
|
|
1802
|
+
* @type {string}
|
|
1803
|
+
* @memberof CompatibleImage
|
|
1804
|
+
*/
|
|
1805
|
+
'reason'?: string;
|
|
1806
|
+
}
|
|
1770
1807
|
/**
|
|
1771
1808
|
*
|
|
1772
1809
|
* @export
|
|
@@ -2665,6 +2702,12 @@ export interface CreateInstancesPayload {
|
|
|
2665
2702
|
* @memberof CreateInstancesPayload
|
|
2666
2703
|
*/
|
|
2667
2704
|
'enable_port_randomization'?: boolean;
|
|
2705
|
+
/**
|
|
2706
|
+
* When true, the Hyperstack VM Agent is opted in for this VM and metrics ingestion is allowed by the prom-gateway. The agent must still be installed on the VM (typically via user_data cloud-init).
|
|
2707
|
+
* @type {boolean}
|
|
2708
|
+
* @memberof CreateInstancesPayload
|
|
2709
|
+
*/
|
|
2710
|
+
'enhanced_monitoring_enabled'?: boolean;
|
|
2668
2711
|
/**
|
|
2669
2712
|
* The name of the [environment](https://docs.hyperstack.cloud/docs/api-reference/core-resources/environments/) in which the virtual machine is to be created.
|
|
2670
2713
|
* @type {string}
|
|
@@ -4056,6 +4099,12 @@ export interface FlavorFields {
|
|
|
4056
4099
|
* @memberof FlavorFields
|
|
4057
4100
|
*/
|
|
4058
4101
|
'id'?: number;
|
|
4102
|
+
/**
|
|
4103
|
+
* Image compatibility restrictions for this flavor (flavor → image links)
|
|
4104
|
+
* @type {ImageRestrictions}
|
|
4105
|
+
* @memberof FlavorFields
|
|
4106
|
+
*/
|
|
4107
|
+
'image_restrictions'?: ImageRestrictions;
|
|
4059
4108
|
/**
|
|
4060
4109
|
*
|
|
4061
4110
|
* @type {Array<LableResonse>}
|
|
@@ -4804,6 +4853,31 @@ export interface ImageGetResponse {
|
|
|
4804
4853
|
*/
|
|
4805
4854
|
'type'?: string;
|
|
4806
4855
|
}
|
|
4856
|
+
/**
|
|
4857
|
+
*
|
|
4858
|
+
* @export
|
|
4859
|
+
* @interface ImageRestrictions
|
|
4860
|
+
*/
|
|
4861
|
+
export interface ImageRestrictions {
|
|
4862
|
+
/**
|
|
4863
|
+
* List of images this flavor is allowed to launch, with link metadata
|
|
4864
|
+
* @type {Array<CompatibleImage>}
|
|
4865
|
+
* @memberof ImageRestrictions
|
|
4866
|
+
*/
|
|
4867
|
+
'compatible_images'?: Array<CompatibleImage>;
|
|
4868
|
+
/**
|
|
4869
|
+
* Whether the flavor is restricted to a set of images
|
|
4870
|
+
* @type {boolean}
|
|
4871
|
+
* @memberof ImageRestrictions
|
|
4872
|
+
*/
|
|
4873
|
+
'has_image_restrictions'?: boolean;
|
|
4874
|
+
/**
|
|
4875
|
+
* Either \'hard\', \'soft\', or null if no restrictions
|
|
4876
|
+
* @type {string}
|
|
4877
|
+
* @memberof ImageRestrictions
|
|
4878
|
+
*/
|
|
4879
|
+
'restriction_type'?: string;
|
|
4880
|
+
}
|
|
4807
4881
|
/**
|
|
4808
4882
|
*
|
|
4809
4883
|
* @export
|
|
@@ -4959,6 +5033,19 @@ export interface Instance {
|
|
|
4959
5033
|
*/
|
|
4960
5034
|
'status'?: boolean;
|
|
4961
5035
|
}
|
|
5036
|
+
/**
|
|
5037
|
+
*
|
|
5038
|
+
* @export
|
|
5039
|
+
* @interface InstanceEnhancedMetricsFields
|
|
5040
|
+
*/
|
|
5041
|
+
export interface InstanceEnhancedMetricsFields {
|
|
5042
|
+
/**
|
|
5043
|
+
*
|
|
5044
|
+
* @type {boolean}
|
|
5045
|
+
* @memberof InstanceEnhancedMetricsFields
|
|
5046
|
+
*/
|
|
5047
|
+
'enabled'?: boolean;
|
|
5048
|
+
}
|
|
4962
5049
|
/**
|
|
4963
5050
|
*
|
|
4964
5051
|
* @export
|
|
@@ -5100,6 +5187,12 @@ export interface InstanceFields {
|
|
|
5100
5187
|
* @memberof InstanceFields
|
|
5101
5188
|
*/
|
|
5102
5189
|
'created_at'?: string;
|
|
5190
|
+
/**
|
|
5191
|
+
*
|
|
5192
|
+
* @type {InstanceEnhancedMetricsFields}
|
|
5193
|
+
* @memberof InstanceFields
|
|
5194
|
+
*/
|
|
5195
|
+
'enhanced_metrics'?: InstanceEnhancedMetricsFields;
|
|
5103
5196
|
/**
|
|
5104
5197
|
*
|
|
5105
5198
|
* @type {InstanceEnvironmentFields}
|
|
@@ -10140,6 +10233,63 @@ export interface UserDefaultChoicesForUserResponse {
|
|
|
10140
10233
|
*/
|
|
10141
10234
|
'user_default_choices'?: Array<UserDefaultChoiceForUserFields>;
|
|
10142
10235
|
}
|
|
10236
|
+
/**
|
|
10237
|
+
*
|
|
10238
|
+
* @export
|
|
10239
|
+
* @interface UserEnhancedMetricsPayload
|
|
10240
|
+
*/
|
|
10241
|
+
export interface UserEnhancedMetricsPayload {
|
|
10242
|
+
/**
|
|
10243
|
+
* Set to true to opt this VM into Enhanced Metrics, false to opt out.
|
|
10244
|
+
* @type {boolean}
|
|
10245
|
+
* @memberof UserEnhancedMetricsPayload
|
|
10246
|
+
*/
|
|
10247
|
+
'enabled': boolean;
|
|
10248
|
+
}
|
|
10249
|
+
/**
|
|
10250
|
+
*
|
|
10251
|
+
* @export
|
|
10252
|
+
* @interface UserEnhancedMetricsResponse
|
|
10253
|
+
*/
|
|
10254
|
+
export interface UserEnhancedMetricsResponse {
|
|
10255
|
+
/**
|
|
10256
|
+
* One-liner the user can run inside the VM to install the agent when enabling. Omitted when disabling.
|
|
10257
|
+
* @type {string}
|
|
10258
|
+
* @memberof UserEnhancedMetricsResponse
|
|
10259
|
+
*/
|
|
10260
|
+
'install_command'?: string;
|
|
10261
|
+
/**
|
|
10262
|
+
*
|
|
10263
|
+
* @type {string}
|
|
10264
|
+
* @memberof UserEnhancedMetricsResponse
|
|
10265
|
+
*/
|
|
10266
|
+
'message'?: string;
|
|
10267
|
+
/**
|
|
10268
|
+
*
|
|
10269
|
+
* @type {UserEnhancedMetricsResponseFields}
|
|
10270
|
+
* @memberof UserEnhancedMetricsResponse
|
|
10271
|
+
*/
|
|
10272
|
+
'metrics'?: UserEnhancedMetricsResponseFields;
|
|
10273
|
+
/**
|
|
10274
|
+
*
|
|
10275
|
+
* @type {boolean}
|
|
10276
|
+
* @memberof UserEnhancedMetricsResponse
|
|
10277
|
+
*/
|
|
10278
|
+
'status'?: boolean;
|
|
10279
|
+
}
|
|
10280
|
+
/**
|
|
10281
|
+
*
|
|
10282
|
+
* @export
|
|
10283
|
+
* @interface UserEnhancedMetricsResponseFields
|
|
10284
|
+
*/
|
|
10285
|
+
export interface UserEnhancedMetricsResponseFields {
|
|
10286
|
+
/**
|
|
10287
|
+
*
|
|
10288
|
+
* @type {boolean}
|
|
10289
|
+
* @memberof UserEnhancedMetricsResponseFields
|
|
10290
|
+
*/
|
|
10291
|
+
'enabled'?: boolean;
|
|
10292
|
+
}
|
|
10143
10293
|
/**
|
|
10144
10294
|
*
|
|
10145
10295
|
* @export
|
|
@@ -19085,6 +19235,15 @@ export declare const VirtualMachineApiAxiosParamCreator: (configuration?: Config
|
|
|
19085
19235
|
* @throws {RequiredError}
|
|
19086
19236
|
*/
|
|
19087
19237
|
stopVM: (vmId: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
19238
|
+
/**
|
|
19239
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
19240
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
19241
|
+
* @param {number} vmId
|
|
19242
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
19243
|
+
* @param {*} [options] Override http request option.
|
|
19244
|
+
* @throws {RequiredError}
|
|
19245
|
+
*/
|
|
19246
|
+
toggleEnhancedMetricsForAVM: (vmId: number, payload: UserEnhancedMetricsPayload, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
19088
19247
|
};
|
|
19089
19248
|
/**
|
|
19090
19249
|
* VirtualMachineApi - functional programming interface
|
|
@@ -19270,6 +19429,15 @@ export declare const VirtualMachineApiFp: (configuration?: Configuration) => {
|
|
|
19270
19429
|
* @throws {RequiredError}
|
|
19271
19430
|
*/
|
|
19272
19431
|
stopVM(vmId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResponseModel>>;
|
|
19432
|
+
/**
|
|
19433
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
19434
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
19435
|
+
* @param {number} vmId
|
|
19436
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
19437
|
+
* @param {*} [options] Override http request option.
|
|
19438
|
+
* @throws {RequiredError}
|
|
19439
|
+
*/
|
|
19440
|
+
toggleEnhancedMetricsForAVM(vmId: number, payload: UserEnhancedMetricsPayload, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserEnhancedMetricsResponse>>;
|
|
19273
19441
|
};
|
|
19274
19442
|
/**
|
|
19275
19443
|
* VirtualMachineApi - factory interface
|
|
@@ -19455,6 +19623,15 @@ export declare const VirtualMachineApiFactory: (configuration?: Configuration, b
|
|
|
19455
19623
|
* @throws {RequiredError}
|
|
19456
19624
|
*/
|
|
19457
19625
|
stopVM(vmId: number, options?: RawAxiosRequestConfig): AxiosPromise<ResponseModel>;
|
|
19626
|
+
/**
|
|
19627
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
19628
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
19629
|
+
* @param {number} vmId
|
|
19630
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
19631
|
+
* @param {*} [options] Override http request option.
|
|
19632
|
+
* @throws {RequiredError}
|
|
19633
|
+
*/
|
|
19634
|
+
toggleEnhancedMetricsForAVM(vmId: number, payload: UserEnhancedMetricsPayload, options?: RawAxiosRequestConfig): AxiosPromise<UserEnhancedMetricsResponse>;
|
|
19458
19635
|
};
|
|
19459
19636
|
/**
|
|
19460
19637
|
* VirtualMachineApi - object-oriented interface
|
|
@@ -19662,6 +19839,16 @@ export declare class VirtualMachineApi extends BaseAPI {
|
|
|
19662
19839
|
* @memberof VirtualMachineApi
|
|
19663
19840
|
*/
|
|
19664
19841
|
stopVM(vmId: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<ResponseModel, any, {}, any>>;
|
|
19842
|
+
/**
|
|
19843
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
19844
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
19845
|
+
* @param {number} vmId
|
|
19846
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
19847
|
+
* @param {*} [options] Override http request option.
|
|
19848
|
+
* @throws {RequiredError}
|
|
19849
|
+
* @memberof VirtualMachineApi
|
|
19850
|
+
*/
|
|
19851
|
+
toggleEnhancedMetricsForAVM(vmId: number, payload: UserEnhancedMetricsPayload, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<UserEnhancedMetricsResponse, any, {}, any>>;
|
|
19665
19852
|
}
|
|
19666
19853
|
/**
|
|
19667
19854
|
* @export
|
package/dist/esm/api.js
CHANGED
|
@@ -16259,6 +16259,42 @@ export const VirtualMachineApiAxiosParamCreator = function (configuration) {
|
|
|
16259
16259
|
options: localVarRequestOptions,
|
|
16260
16260
|
};
|
|
16261
16261
|
}),
|
|
16262
|
+
/**
|
|
16263
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
16264
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
16265
|
+
* @param {number} vmId
|
|
16266
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
16267
|
+
* @param {*} [options] Override http request option.
|
|
16268
|
+
* @throws {RequiredError}
|
|
16269
|
+
*/
|
|
16270
|
+
toggleEnhancedMetricsForAVM: (vmId_1, payload_1, ...args_1) => __awaiter(this, [vmId_1, payload_1, ...args_1], void 0, function* (vmId, payload, options = {}) {
|
|
16271
|
+
// verify required parameter 'vmId' is not null or undefined
|
|
16272
|
+
assertParamExists('toggleEnhancedMetricsForAVM', 'vmId', vmId);
|
|
16273
|
+
// verify required parameter 'payload' is not null or undefined
|
|
16274
|
+
assertParamExists('toggleEnhancedMetricsForAVM', 'payload', payload);
|
|
16275
|
+
const localVarPath = `/core/virtual-machines/{vm_id}/enhanced-metrics`
|
|
16276
|
+
.replace(`{${"vm_id"}}`, encodeURIComponent(String(vmId)));
|
|
16277
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
16278
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
16279
|
+
let baseOptions;
|
|
16280
|
+
if (configuration) {
|
|
16281
|
+
baseOptions = configuration.baseOptions;
|
|
16282
|
+
}
|
|
16283
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
16284
|
+
const localVarHeaderParameter = {};
|
|
16285
|
+
const localVarQueryParameter = {};
|
|
16286
|
+
// authentication apiKey required
|
|
16287
|
+
yield setApiKeyToObject(localVarHeaderParameter, "api_key", configuration);
|
|
16288
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
16289
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
16290
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
16291
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
16292
|
+
localVarRequestOptions.data = serializeDataIfNeeded(payload, localVarRequestOptions, configuration);
|
|
16293
|
+
return {
|
|
16294
|
+
url: toPathString(localVarUrlObj),
|
|
16295
|
+
options: localVarRequestOptions,
|
|
16296
|
+
};
|
|
16297
|
+
}),
|
|
16262
16298
|
};
|
|
16263
16299
|
};
|
|
16264
16300
|
/**
|
|
@@ -16607,6 +16643,23 @@ export const VirtualMachineApiFp = function (configuration) {
|
|
|
16607
16643
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
16608
16644
|
});
|
|
16609
16645
|
},
|
|
16646
|
+
/**
|
|
16647
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
16648
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
16649
|
+
* @param {number} vmId
|
|
16650
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
16651
|
+
* @param {*} [options] Override http request option.
|
|
16652
|
+
* @throws {RequiredError}
|
|
16653
|
+
*/
|
|
16654
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
16655
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16656
|
+
var _a, _b, _c;
|
|
16657
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.toggleEnhancedMetricsForAVM(vmId, payload, options);
|
|
16658
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
16659
|
+
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['VirtualMachineApi.toggleEnhancedMetricsForAVM']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
16660
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
16661
|
+
});
|
|
16662
|
+
},
|
|
16610
16663
|
};
|
|
16611
16664
|
};
|
|
16612
16665
|
/**
|
|
@@ -16835,6 +16888,17 @@ export const VirtualMachineApiFactory = function (configuration, basePath, axios
|
|
|
16835
16888
|
stopVM(vmId, options) {
|
|
16836
16889
|
return localVarFp.stopVM(vmId, options).then((request) => request(axios, basePath));
|
|
16837
16890
|
},
|
|
16891
|
+
/**
|
|
16892
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
16893
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
16894
|
+
* @param {number} vmId
|
|
16895
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
16896
|
+
* @param {*} [options] Override http request option.
|
|
16897
|
+
* @throws {RequiredError}
|
|
16898
|
+
*/
|
|
16899
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
16900
|
+
return localVarFp.toggleEnhancedMetricsForAVM(vmId, payload, options).then((request) => request(axios, basePath));
|
|
16901
|
+
},
|
|
16838
16902
|
};
|
|
16839
16903
|
};
|
|
16840
16904
|
/**
|
|
@@ -17083,6 +17147,18 @@ export class VirtualMachineApi extends BaseAPI {
|
|
|
17083
17147
|
stopVM(vmId, options) {
|
|
17084
17148
|
return VirtualMachineApiFp(this.configuration).stopVM(vmId, options).then((request) => request(this.axios, this.basePath));
|
|
17085
17149
|
}
|
|
17150
|
+
/**
|
|
17151
|
+
* Enable or disable the Hyperstack VM Agent (Enhanced Metrics) for an existing virtual machine. The agent itself must be installed/removed manually inside the VM — the response includes the install command when enabling.
|
|
17152
|
+
* @summary Enable or disable Enhanced Metrics for a virtual machine
|
|
17153
|
+
* @param {number} vmId
|
|
17154
|
+
* @param {UserEnhancedMetricsPayload} payload
|
|
17155
|
+
* @param {*} [options] Override http request option.
|
|
17156
|
+
* @throws {RequiredError}
|
|
17157
|
+
* @memberof VirtualMachineApi
|
|
17158
|
+
*/
|
|
17159
|
+
toggleEnhancedMetricsForAVM(vmId, payload, options) {
|
|
17160
|
+
return VirtualMachineApiFp(this.configuration).toggleEnhancedMetricsForAVM(vmId, payload, options).then((request) => request(this.axios, this.basePath));
|
|
17161
|
+
}
|
|
17086
17162
|
}
|
|
17087
17163
|
/**
|
|
17088
17164
|
* @export
|
package/dist/esm/common.js
CHANGED
|
@@ -21,6 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import { RequiredError } from "./base";
|
|
24
|
+
import { applyHyperstackHeaders } from "./hyperstackHeaders";
|
|
24
25
|
/**
|
|
25
26
|
*
|
|
26
27
|
* @export
|
|
@@ -144,6 +145,7 @@ export const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH
|
|
|
144
145
|
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
145
146
|
var _a;
|
|
146
147
|
const axiosRequestArgs = Object.assign(Object.assign({}, axiosArgs.options), { url: (axios.defaults.baseURL ? '' : (_a = configuration === null || configuration === void 0 ? void 0 : configuration.basePath) !== null && _a !== void 0 ? _a : basePath) + axiosArgs.url });
|
|
148
|
+
applyHyperstackHeaders(axiosRequestArgs);
|
|
147
149
|
return axios.request(axiosRequestArgs);
|
|
148
150
|
};
|
|
149
151
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forced Hyperstack client identification headers.
|
|
3
|
+
*
|
|
4
|
+
* Maintained in sdk-generator (util/typescript/hyperstackHeaders.ts) and copied into
|
|
5
|
+
* the generated SDK by the `add-hyperstack-headers` task. Do not edit in the SDK repo.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HYPERSTACK_CLIENT_HEADER: string;
|
|
8
|
+
export declare const USER_AGENT_HEADER: string;
|
|
9
|
+
export declare const HYPERSTACK_CLIENT: string;
|
|
10
|
+
/**
|
|
11
|
+
* User-Agent is a forbidden header name in browsers: XHR and fetch silently drop any
|
|
12
|
+
* attempt to set it. It is therefore only emitted under Node, and browser traffic is
|
|
13
|
+
* identified by Hyperstack-Client alone.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HYPERSTACK_USER_AGENT: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Forces the identification headers onto axios request args.
|
|
18
|
+
*
|
|
19
|
+
* Any caller-supplied variant is stripped case-insensitively first. Mutates and
|
|
20
|
+
* returns the same object so it can wrap the generated axiosRequestArgs expression.
|
|
21
|
+
*/
|
|
22
|
+
export declare const applyHyperstackHeaders: <T extends {
|
|
23
|
+
headers?: any;
|
|
24
|
+
}>(args: T) => T;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Forced Hyperstack client identification headers.
|
|
5
|
+
*
|
|
6
|
+
* Maintained in sdk-generator (util/typescript/hyperstackHeaders.ts) and copied into
|
|
7
|
+
* the generated SDK by the `add-hyperstack-headers` task. Do not edit in the SDK repo.
|
|
8
|
+
*/
|
|
9
|
+
const SDK_NAME = 'hyperstack-typescript-sdk';
|
|
10
|
+
const SDK_VERSION = 'v1.55.4-alpha';
|
|
11
|
+
export const HYPERSTACK_CLIENT_HEADER = 'Hyperstack-Client';
|
|
12
|
+
export const USER_AGENT_HEADER = 'User-Agent';
|
|
13
|
+
const FORCED = [HYPERSTACK_CLIENT_HEADER.toLowerCase(), USER_AGENT_HEADER.toLowerCase()];
|
|
14
|
+
/** Printable ASCII only, capped at 256 chars. */
|
|
15
|
+
const sanitize = (value) => String(value).replace(/[^\x20-\x7e]/g, '').slice(0, 256);
|
|
16
|
+
const normalizeOs = (value) => {
|
|
17
|
+
const v = String(value || '').toLowerCase();
|
|
18
|
+
if (v.indexOf('darwin') === 0 || v.indexOf('mac') === 0)
|
|
19
|
+
return 'darwin';
|
|
20
|
+
if (v.indexOf('win') === 0)
|
|
21
|
+
return 'windows';
|
|
22
|
+
if (v.indexOf('linux') === 0)
|
|
23
|
+
return 'linux';
|
|
24
|
+
return v.replace(/ /g, '-') || 'unknown';
|
|
25
|
+
};
|
|
26
|
+
const normalizeArch = (value) => {
|
|
27
|
+
const v = String(value || '').toLowerCase();
|
|
28
|
+
if (v === 'x64' || v === 'x86_64' || v === 'amd64')
|
|
29
|
+
return 'x86_64';
|
|
30
|
+
if (v === 'arm64' || v === 'aarch64')
|
|
31
|
+
return 'arm64';
|
|
32
|
+
if (v === 'ia32' || v === 'x86' || v === 'i386')
|
|
33
|
+
return '386';
|
|
34
|
+
return v || 'unknown';
|
|
35
|
+
};
|
|
36
|
+
const proc = typeof process !== 'undefined' ? process : undefined;
|
|
37
|
+
const isNode = !!(proc && proc.versions && proc.versions.node);
|
|
38
|
+
export const HYPERSTACK_CLIENT = sanitize(SDK_NAME + '/' + SDK_VERSION);
|
|
39
|
+
/**
|
|
40
|
+
* User-Agent is a forbidden header name in browsers: XHR and fetch silently drop any
|
|
41
|
+
* attempt to set it. It is therefore only emitted under Node, and browser traffic is
|
|
42
|
+
* identified by Hyperstack-Client alone.
|
|
43
|
+
*/
|
|
44
|
+
export const HYPERSTACK_USER_AGENT = isNode
|
|
45
|
+
? sanitize(HYPERSTACK_CLIENT + ' (Node.js/' + proc.versions.node + '; '
|
|
46
|
+
+ normalizeOs(proc.platform) + '/' + normalizeArch(proc.arch) + ')')
|
|
47
|
+
: undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Forces the identification headers onto axios request args.
|
|
50
|
+
*
|
|
51
|
+
* Any caller-supplied variant is stripped case-insensitively first. Mutates and
|
|
52
|
+
* returns the same object so it can wrap the generated axiosRequestArgs expression.
|
|
53
|
+
*/
|
|
54
|
+
export const applyHyperstackHeaders = function (args) {
|
|
55
|
+
const headers = {};
|
|
56
|
+
const existing = (args && args.headers) || {};
|
|
57
|
+
Object.keys(existing).forEach((key) => {
|
|
58
|
+
if (FORCED.indexOf(key.toLowerCase()) === -1) {
|
|
59
|
+
headers[key] = existing[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
headers[HYPERSTACK_CLIENT_HEADER] = HYPERSTACK_CLIENT;
|
|
63
|
+
if (HYPERSTACK_USER_AGENT) {
|
|
64
|
+
headers[USER_AGENT_HEADER] = HYPERSTACK_USER_AGENT;
|
|
65
|
+
}
|
|
66
|
+
args.headers = headers;
|
|
67
|
+
return args;
|
|
68
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forced Hyperstack client identification headers.
|
|
3
|
+
*
|
|
4
|
+
* Maintained in sdk-generator (util/typescript/hyperstackHeaders.ts) and copied into
|
|
5
|
+
* the generated SDK by the `add-hyperstack-headers` task. Do not edit in the SDK repo.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HYPERSTACK_CLIENT_HEADER: string;
|
|
8
|
+
export declare const USER_AGENT_HEADER: string;
|
|
9
|
+
export declare const HYPERSTACK_CLIENT: string;
|
|
10
|
+
/**
|
|
11
|
+
* User-Agent is a forbidden header name in browsers: XHR and fetch silently drop any
|
|
12
|
+
* attempt to set it. It is therefore only emitted under Node, and browser traffic is
|
|
13
|
+
* identified by Hyperstack-Client alone.
|
|
14
|
+
*/
|
|
15
|
+
export declare const HYPERSTACK_USER_AGENT: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Forces the identification headers onto axios request args.
|
|
18
|
+
*
|
|
19
|
+
* Any caller-supplied variant is stripped case-insensitively first. Mutates and
|
|
20
|
+
* returns the same object so it can wrap the generated axiosRequestArgs expression.
|
|
21
|
+
*/
|
|
22
|
+
export declare const applyHyperstackHeaders: <T extends {
|
|
23
|
+
headers?: any;
|
|
24
|
+
}>(args: T) => T;
|