@azure/monitor-query-metrics 1.0.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.
- package/LICENSE +21 -0
- package/README.md +243 -0
- package/dist/browser/api/index.d.ts +4 -0
- package/dist/browser/api/index.d.ts.map +1 -0
- package/dist/browser/api/index.js +5 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/metricsContext.d.ts +15 -0
- package/dist/browser/api/metricsContext.d.ts.map +1 -0
- package/dist/browser/api/metricsContext.js +38 -0
- package/dist/browser/api/metricsContext.js.map +1 -0
- package/dist/browser/api/operations.d.ts +9 -0
- package/dist/browser/api/operations.d.ts.map +1 -0
- package/dist/browser/api/operations.js +49 -0
- package/dist/browser/api/operations.js.map +1 -0
- package/dist/browser/api/options.d.ts +57 -0
- package/dist/browser/api/options.d.ts.map +1 -0
- package/dist/browser/api/options.js +4 -0
- package/dist/browser/api/options.js.map +1 -0
- package/dist/browser/index.d.ts +5 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +6 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/internalMetricsClient.d.ts +15 -0
- package/dist/browser/internalMetricsClient.d.ts.map +1 -0
- package/dist/browser/internalMetricsClient.js +23 -0
- package/dist/browser/internalMetricsClient.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/metricsClient.d.ts +28 -0
- package/dist/browser/metricsClient.d.ts.map +1 -0
- package/dist/browser/metricsClient.js +48 -0
- package/dist/browser/metricsClient.js.map +1 -0
- package/dist/browser/models/index.d.ts +2 -0
- package/dist/browser/models/index.d.ts.map +1 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +141 -0
- package/dist/browser/models/models.d.ts.map +1 -0
- package/dist/browser/models/models.js +136 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/models.d.ts +167 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +46 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.js +186 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/browser/utils.d.ts +13 -0
- package/dist/browser/utils.d.ts.map +1 -0
- package/dist/browser/utils.js +54 -0
- package/dist/browser/utils.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +4 -0
- package/dist/commonjs/api/index.d.ts.map +1 -0
- package/dist/commonjs/api/index.js +10 -0
- package/dist/commonjs/api/index.js.map +1 -0
- package/dist/commonjs/api/metricsContext.d.ts +15 -0
- package/dist/commonjs/api/metricsContext.d.ts.map +1 -0
- package/dist/commonjs/api/metricsContext.js +41 -0
- package/dist/commonjs/api/metricsContext.js.map +1 -0
- package/dist/commonjs/api/operations.d.ts +9 -0
- package/dist/commonjs/api/operations.d.ts.map +1 -0
- package/dist/commonjs/api/operations.js +54 -0
- package/dist/commonjs/api/operations.js.map +1 -0
- package/dist/commonjs/api/options.d.ts +57 -0
- package/dist/commonjs/api/options.d.ts.map +1 -0
- package/dist/commonjs/api/options.js +5 -0
- package/dist/commonjs/api/options.js.map +1 -0
- package/dist/commonjs/index.d.ts +5 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +13 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/internalMetricsClient.d.ts +15 -0
- package/dist/commonjs/internalMetricsClient.d.ts.map +1 -0
- package/dist/commonjs/internalMetricsClient.js +27 -0
- package/dist/commonjs/internalMetricsClient.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/metricsClient.d.ts +28 -0
- package/dist/commonjs/metricsClient.d.ts.map +1 -0
- package/dist/commonjs/metricsClient.js +52 -0
- package/dist/commonjs/metricsClient.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +2 -0
- package/dist/commonjs/models/index.d.ts.map +1 -0
- package/dist/commonjs/models/index.js +8 -0
- package/dist/commonjs/models/index.js.map +1 -0
- package/dist/commonjs/models/models.d.ts +141 -0
- package/dist/commonjs/models/models.d.ts.map +1 -0
- package/dist/commonjs/models/models.js +157 -0
- package/dist/commonjs/models/models.js.map +1 -0
- package/dist/commonjs/models.d.ts +167 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +49 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +189 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/commonjs/utils.d.ts +13 -0
- package/dist/commonjs/utils.d.ts.map +1 -0
- package/dist/commonjs/utils.js +60 -0
- package/dist/commonjs/utils.js.map +1 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/api/index.d.ts.map +1 -0
- package/dist/esm/api/index.js +5 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/metricsContext.d.ts +15 -0
- package/dist/esm/api/metricsContext.d.ts.map +1 -0
- package/dist/esm/api/metricsContext.js +38 -0
- package/dist/esm/api/metricsContext.js.map +1 -0
- package/dist/esm/api/operations.d.ts +9 -0
- package/dist/esm/api/operations.d.ts.map +1 -0
- package/dist/esm/api/operations.js +49 -0
- package/dist/esm/api/operations.js.map +1 -0
- package/dist/esm/api/options.d.ts +57 -0
- package/dist/esm/api/options.d.ts.map +1 -0
- package/dist/esm/api/options.js +4 -0
- package/dist/esm/api/options.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internalMetricsClient.d.ts +15 -0
- package/dist/esm/internalMetricsClient.d.ts.map +1 -0
- package/dist/esm/internalMetricsClient.js +23 -0
- package/dist/esm/internalMetricsClient.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/metricsClient.d.ts +28 -0
- package/dist/esm/metricsClient.d.ts.map +1 -0
- package/dist/esm/metricsClient.js +48 -0
- package/dist/esm/metricsClient.js.map +1 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.d.ts.map +1 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +141 -0
- package/dist/esm/models/models.d.ts.map +1 -0
- package/dist/esm/models/models.js +136 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/models.d.ts +167 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +46 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.js +186 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/esm/utils.d.ts +13 -0
- package/dist/esm/utils.d.ts.map +1 -0
- package/dist/esm/utils.js +54 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/react-native/api/index.d.ts +4 -0
- package/dist/react-native/api/index.d.ts.map +1 -0
- package/dist/react-native/api/index.js +5 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/metricsContext.d.ts +15 -0
- package/dist/react-native/api/metricsContext.d.ts.map +1 -0
- package/dist/react-native/api/metricsContext.js +38 -0
- package/dist/react-native/api/metricsContext.js.map +1 -0
- package/dist/react-native/api/operations.d.ts +9 -0
- package/dist/react-native/api/operations.d.ts.map +1 -0
- package/dist/react-native/api/operations.js +49 -0
- package/dist/react-native/api/operations.js.map +1 -0
- package/dist/react-native/api/options.d.ts +57 -0
- package/dist/react-native/api/options.d.ts.map +1 -0
- package/dist/react-native/api/options.js +4 -0
- package/dist/react-native/api/options.js.map +1 -0
- package/dist/react-native/index.d.ts +5 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +6 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/internalMetricsClient.d.ts +15 -0
- package/dist/react-native/internalMetricsClient.d.ts.map +1 -0
- package/dist/react-native/internalMetricsClient.js +23 -0
- package/dist/react-native/internalMetricsClient.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/metricsClient.d.ts +28 -0
- package/dist/react-native/metricsClient.d.ts.map +1 -0
- package/dist/react-native/metricsClient.js +48 -0
- package/dist/react-native/metricsClient.js.map +1 -0
- package/dist/react-native/models/index.d.ts +2 -0
- package/dist/react-native/models/index.d.ts.map +1 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +141 -0
- package/dist/react-native/models/models.d.ts.map +1 -0
- package/dist/react-native/models/models.js +136 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/models.d.ts +167 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +46 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/react-native/static-helpers/urlTemplate.js +186 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/utils.d.ts +13 -0
- package/dist/react-native/utils.d.ts.map +1 -0
- package/dist/react-native/utils.js +54 -0
- package/dist/react-native/utils.js.map +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,yCAOqB;AAHnB,sGAAA,SAAS,OAAA;AACT,6HAAA,gCAAgC,OAAA;AAGlC,8CAa2B;AADzB,yGAAA,aAAa,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { MetricsClient } from \"./metricsClient.js\";\nexport {\n MetricsQueryResourcesOptions,\n MetricsQueryResult,\n QueryTimeInterval,\n Durations,\n KnownMonitorMetricsQueryAudience,\n MetricsClientOptions,\n} from \"./models.js\";\nexport {\n ResourceIdList,\n MetricResultsResponse,\n MetricResultsResponseValuesItem,\n Metric,\n MetricUnit,\n TimeSeriesElement,\n MetadataValue,\n MetricValue,\n ErrorResponse,\n ErrorDetail,\n ErrorAdditionalInfo,\n KnownVersions,\n} from \"./models/index.js\";\nexport { MetricsClientOptionalParams } from \"./api/index.js\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MetricsClientOptionalParams } from "./api/index.js";
|
|
2
|
+
import type { QueryResourcesOptionalParams } from "./api/options.js";
|
|
3
|
+
import type { ResourceIdList, MetricResultsResponse } from "./models/models.js";
|
|
4
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
5
|
+
import type { Pipeline } from "@azure/core-rest-pipeline";
|
|
6
|
+
export { MetricsClientOptionalParams } from "./api/metricsContext.js";
|
|
7
|
+
export declare class MetricsClient {
|
|
8
|
+
private _client;
|
|
9
|
+
/** The pipeline used by this client to make requests */
|
|
10
|
+
readonly pipeline: Pipeline;
|
|
11
|
+
constructor(endpointParam: string, credential: TokenCredential, options?: MetricsClientOptionalParams);
|
|
12
|
+
/** Lists the metric values for multiple resources. */
|
|
13
|
+
queryResources(subscriptionId: string, metricNamespace: string, metricNames: string[], batchRequest: ResourceIdList, options?: QueryResourcesOptionalParams): Promise<MetricResultsResponse>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=internalMetricsClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalMetricsClient.d.ts","sourceRoot":"","sources":["../../src/internalMetricsClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAGlF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAiB;IAChC,wDAAwD;IACxD,SAAgB,QAAQ,EAAE,QAAQ,CAAC;gBAGjC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,2BAAgC;IAW3C,sDAAsD;IACtD,cAAc,CACZ,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EAAE,EACrB,YAAY,EAAE,cAAc,EAC5B,OAAO,GAAE,4BAAqD,GAC7D,OAAO,CAAC,qBAAqB,CAAC;CAUlC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.MetricsClient = void 0;
|
|
6
|
+
const index_js_1 = require("./api/index.js");
|
|
7
|
+
const operations_js_1 = require("./api/operations.js");
|
|
8
|
+
class MetricsClient {
|
|
9
|
+
_client;
|
|
10
|
+
/** The pipeline used by this client to make requests */
|
|
11
|
+
pipeline;
|
|
12
|
+
constructor(endpointParam, credential, options = {}) {
|
|
13
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
14
|
+
const userAgentPrefix = prefixFromOptions;
|
|
15
|
+
this._client = (0, index_js_1.createMetrics)(endpointParam, credential, {
|
|
16
|
+
...options,
|
|
17
|
+
userAgentOptions: { userAgentPrefix },
|
|
18
|
+
});
|
|
19
|
+
this.pipeline = this._client.pipeline;
|
|
20
|
+
}
|
|
21
|
+
/** Lists the metric values for multiple resources. */
|
|
22
|
+
queryResources(subscriptionId, metricNamespace, metricNames, batchRequest, options = { requestOptions: {} }) {
|
|
23
|
+
return (0, operations_js_1.queryResources)(this._client, subscriptionId, metricNamespace, metricNames, batchRequest, options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.MetricsClient = MetricsClient;
|
|
27
|
+
//# sourceMappingURL=internalMetricsClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalMetricsClient.js","sourceRoot":"","sources":["../../src/internalMetricsClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,6CAA+C;AAC/C,uDAAqD;AAQrD,MAAa,aAAa;IAChB,OAAO,CAAiB;IAChC,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,YACE,aAAqB,EACrB,UAA2B,EAC3B,UAAuC,EAAE;QAEzC,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,IAAA,wBAAa,EAAC,aAAa,EAAE,UAAU,EAAE;YACtD,GAAG,OAAO;YACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;SACtC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACxC,CAAC;IAED,sDAAsD;IACtD,cAAc,CACZ,cAAsB,EACtB,eAAuB,EACvB,WAAqB,EACrB,YAA4B,EAC5B,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;QAE9D,OAAO,IAAA,8BAAc,EACnB,IAAI,CAAC,OAAO,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,YAAY,EACZ,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AApCD,sCAoCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MetricsContext, MetricsClientOptionalParams } from \"./api/index.js\";\nimport { createMetrics } from \"./api/index.js\";\nimport { queryResources } from \"./api/operations.js\";\nimport type { QueryResourcesOptionalParams } from \"./api/options.js\";\nimport type { ResourceIdList, MetricResultsResponse } from \"./models/models.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\n\nexport { MetricsClientOptionalParams } from \"./api/metricsContext.js\";\n\nexport class MetricsClient {\n private _client: MetricsContext;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: MetricsClientOptionalParams = {},\n ) {\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions;\n this._client = createMetrics(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n }\n\n /** Lists the metric values for multiple resources. */\n queryResources(\n subscriptionId: string,\n metricNamespace: string,\n metricNames: string[],\n batchRequest: ResourceIdList,\n options: QueryResourcesOptionalParams = { requestOptions: {} },\n ): Promise<MetricResultsResponse> {\n return queryResources(\n this._client,\n subscriptionId,\n metricNamespace,\n metricNames,\n batchRequest,\n options,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAA8C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.logger = void 0;
|
|
6
|
+
const logger_1 = require("@azure/logger");
|
|
7
|
+
exports.logger = (0, logger_1.createClientLogger)("monitor-query-metrics");
|
|
8
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"monitor-query-metrics\");\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
2
|
+
import type { Pipeline } from "@azure/core-rest-pipeline";
|
|
3
|
+
import { type MetricsClientOptions, type MetricsQueryResourcesOptions, type MetricsQueryResult } from "./models.js";
|
|
4
|
+
/**
|
|
5
|
+
* Client for querying Azure Monitor metrics.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MetricsClient {
|
|
8
|
+
private readonly _client;
|
|
9
|
+
/** The pipeline used by this client to make requests */
|
|
10
|
+
readonly pipeline: Pipeline;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new MetricsClient.
|
|
13
|
+
* @param endpoint - The endpoint URL for the metrics service.
|
|
14
|
+
* @param tokenCredential - The token credential to use for authentication.
|
|
15
|
+
* @param options - Optional configuration options.
|
|
16
|
+
*/
|
|
17
|
+
constructor(endpoint: string, tokenCredential: TokenCredential, options?: MetricsClientOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Query metrics for multiple Azure resources.
|
|
20
|
+
* @param resourceIds - Array of resource IDs to query metrics for.
|
|
21
|
+
* @param metricNames - Array of metric names to query.
|
|
22
|
+
* @param metricNamespace - The namespace of the metrics.
|
|
23
|
+
* @param options - Optional query parameters.
|
|
24
|
+
* @returns Promise resolving to an array of metrics query results.
|
|
25
|
+
*/
|
|
26
|
+
queryResources(resourceIds: string[], metricNames: string[], metricNamespace: string, options?: MetricsQueryResourcesOptions): Promise<MetricsQueryResult[]>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=metricsClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metricsClient.d.ts","sourceRoot":"","sources":["../../src/metricsClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAM1D,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,wDAAwD;IACxD,SAAgB,QAAQ,EAAE,QAAQ,CAAC;IAEnC;;;;;OAKG;gBAED,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,eAAe,EAChC,OAAO,GAAE,oBAAyB;IAapC;;;;;;;OAOG;IACG,cAAc,CAClB,WAAW,EAAE,MAAM,EAAE,EACrB,WAAW,EAAE,MAAM,EAAE,EACrB,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAkBjC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.MetricsClient = void 0;
|
|
6
|
+
const internalMetricsClient_js_1 = require("./internalMetricsClient.js");
|
|
7
|
+
const utils_js_1 = require("./utils.js");
|
|
8
|
+
const models_js_1 = require("./models.js");
|
|
9
|
+
/**
|
|
10
|
+
* Client for querying Azure Monitor metrics.
|
|
11
|
+
*/
|
|
12
|
+
class MetricsClient {
|
|
13
|
+
_client;
|
|
14
|
+
/** The pipeline used by this client to make requests */
|
|
15
|
+
pipeline;
|
|
16
|
+
/**
|
|
17
|
+
* Create a new MetricsClient.
|
|
18
|
+
* @param endpoint - The endpoint URL for the metrics service.
|
|
19
|
+
* @param tokenCredential - The token credential to use for authentication.
|
|
20
|
+
* @param options - Optional configuration options.
|
|
21
|
+
*/
|
|
22
|
+
constructor(endpoint, tokenCredential, options = {}) {
|
|
23
|
+
this._client = new internalMetricsClient_js_1.MetricsClient(endpoint, tokenCredential, {
|
|
24
|
+
...options,
|
|
25
|
+
credentials: {
|
|
26
|
+
scopes: options.credentials?.scopes ?? [
|
|
27
|
+
options.audience ?? models_js_1.KnownMonitorMetricsQueryAudience.AzurePublicCloud + "/.default",
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
this.pipeline = this._client.pipeline;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Query metrics for multiple Azure resources.
|
|
35
|
+
* @param resourceIds - Array of resource IDs to query metrics for.
|
|
36
|
+
* @param metricNames - Array of metric names to query.
|
|
37
|
+
* @param metricNamespace - The namespace of the metrics.
|
|
38
|
+
* @param options - Optional query parameters.
|
|
39
|
+
* @returns Promise resolving to an array of metrics query results.
|
|
40
|
+
*/
|
|
41
|
+
async queryResources(resourceIds, metricNames, metricNamespace, options = {}) {
|
|
42
|
+
// Extract subscription ID from the first resource ID
|
|
43
|
+
// Format: /subscriptions/{subscriptionId}/...
|
|
44
|
+
const subscriptionId = (0, utils_js_1.getSubscriptionFromResourceId)(resourceIds[0]);
|
|
45
|
+
const internalOptions = (0, utils_js_1.mapToInternalQueryOptions)(options);
|
|
46
|
+
const response = await this._client.queryResources(subscriptionId, metricNamespace, metricNames, { resourceids: resourceIds }, internalOptions);
|
|
47
|
+
// Convert the response to the expected format
|
|
48
|
+
return (response.values || []).map(utils_js_1.createMetricsQueryResult);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.MetricsClient = MetricsClient;
|
|
52
|
+
//# sourceMappingURL=metricsClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metricsClient.js","sourceRoot":"","sources":["../../src/metricsClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,yEAAoF;AAEpF,yCAIoB;AACpB,2CAKqB;AAErB;;GAEG;AACH,MAAa,aAAa;IACP,OAAO,CAAwB;IAChD,wDAAwD;IACxC,QAAQ,CAAW;IAEnC;;;;;OAKG;IACH,YACE,QAAgB,EAChB,eAAgC,EAChC,UAAgC,EAAE;QAElC,IAAI,CAAC,OAAO,GAAG,IAAI,wCAAqB,CAAC,QAAQ,EAAE,eAAe,EAAE;YAClE,GAAG,OAAO;YACV,WAAW,EAAE;gBACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI;oBACrC,OAAO,CAAC,QAAQ,IAAI,4CAAgC,CAAC,gBAAgB,GAAG,WAAW;iBACpF;aACF;SACF,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IACxC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,cAAc,CAClB,WAAqB,EACrB,WAAqB,EACrB,eAAuB,EACvB,UAAwC,EAAE;QAE1C,qDAAqD;QACrD,8CAA8C;QAC9C,MAAM,cAAc,GAAG,IAAA,wCAA6B,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAErE,MAAM,eAAe,GAAG,IAAA,oCAAyB,EAAC,OAAO,CAAC,CAAC;QAE3D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAChD,cAAc,EACd,eAAe,EACf,WAAW,EACX,EAAE,WAAW,EAAE,WAAW,EAAE,EAC5B,eAAe,CAChB,CAAC;QAEF,8CAA8C;QAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,mCAAwB,CAAC,CAAC;IAC/D,CAAC;CACF;AA1DD,sCA0DC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { MetricsClient as InternalMetricsClient } from \"./internalMetricsClient.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport {\n mapToInternalQueryOptions,\n createMetricsQueryResult,\n getSubscriptionFromResourceId,\n} from \"./utils.js\";\nimport {\n KnownMonitorMetricsQueryAudience,\n type MetricsClientOptions,\n type MetricsQueryResourcesOptions,\n type MetricsQueryResult,\n} from \"./models.js\";\n\n/**\n * Client for querying Azure Monitor metrics.\n */\nexport class MetricsClient {\n private readonly _client: InternalMetricsClient;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n /**\n * Create a new MetricsClient.\n * @param endpoint - The endpoint URL for the metrics service.\n * @param tokenCredential - The token credential to use for authentication.\n * @param options - Optional configuration options.\n */\n constructor(\n endpoint: string,\n tokenCredential: TokenCredential,\n options: MetricsClientOptions = {},\n ) {\n this._client = new InternalMetricsClient(endpoint, tokenCredential, {\n ...options,\n credentials: {\n scopes: options.credentials?.scopes ?? [\n options.audience ?? KnownMonitorMetricsQueryAudience.AzurePublicCloud + \"/.default\",\n ],\n },\n });\n this.pipeline = this._client.pipeline;\n }\n\n /**\n * Query metrics for multiple Azure resources.\n * @param resourceIds - Array of resource IDs to query metrics for.\n * @param metricNames - Array of metric names to query.\n * @param metricNamespace - The namespace of the metrics.\n * @param options - Optional query parameters.\n * @returns Promise resolving to an array of metrics query results.\n */\n async queryResources(\n resourceIds: string[],\n metricNames: string[],\n metricNamespace: string,\n options: MetricsQueryResourcesOptions = {},\n ): Promise<MetricsQueryResult[]> {\n // Extract subscription ID from the first resource ID\n // Format: /subscriptions/{subscriptionId}/...\n const subscriptionId = getSubscriptionFromResourceId(resourceIds[0]);\n\n const internalOptions = mapToInternalQueryOptions(options);\n\n const response = await this._client.queryResources(\n subscriptionId,\n metricNamespace,\n metricNames,\n { resourceids: resourceIds },\n internalOptions,\n );\n\n // Convert the response to the expected format\n return (response.values || []).map(createMetricsQueryResult);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,+BAA+B,EAC/B,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,aAAa,GACd,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.KnownVersions = void 0;
|
|
6
|
+
var models_js_1 = require("./models.js");
|
|
7
|
+
Object.defineProperty(exports, "KnownVersions", { enumerable: true, get: function () { return models_js_1.KnownVersions; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,yCAaqB;AADnB,0GAAA,aAAa,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n ResourceIdList,\n MetricResultsResponse,\n MetricResultsResponseValuesItem,\n Metric,\n MetricUnit,\n TimeSeriesElement,\n MetadataValue,\n MetricValue,\n ErrorResponse,\n ErrorDetail,\n ErrorAdditionalInfo,\n KnownVersions,\n} from \"./models.js\";\n"]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/** The comma separated list of resource IDs to query metrics for. */
|
|
2
|
+
export interface ResourceIdList {
|
|
3
|
+
/** The list of resource IDs to query metrics for. */
|
|
4
|
+
resourceids?: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function resourceIdListSerializer(item: ResourceIdList): any;
|
|
7
|
+
/** The metrics result for a resource. */
|
|
8
|
+
export interface MetricResultsResponse {
|
|
9
|
+
/** The collection of metric data responses per resource, per metric. */
|
|
10
|
+
values?: MetricResultsResponseValuesItem[];
|
|
11
|
+
}
|
|
12
|
+
export declare function metricResultsResponseDeserializer(item: any): MetricResultsResponse;
|
|
13
|
+
export declare function metricResultsResponseValuesItemArrayDeserializer(result: Array<MetricResultsResponseValuesItem>): any[];
|
|
14
|
+
/** The metric data response for a resource. */
|
|
15
|
+
export interface MetricResultsResponseValuesItem {
|
|
16
|
+
/** The start time, in datetime format, for which the data was retrieved. */
|
|
17
|
+
startTime: string;
|
|
18
|
+
/** The end time, in datetime format, for which the data was retrieved. */
|
|
19
|
+
endTime: string;
|
|
20
|
+
/**
|
|
21
|
+
* The interval (window size) for which the metric data was returned in ISO 8601
|
|
22
|
+
* duration format with a special case for 'FULL' value that returns single
|
|
23
|
+
* datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).
|
|
24
|
+
* This may be adjusted and different from what was originally requested if
|
|
25
|
+
* AutoAdjustTimegrain=true is specified.
|
|
26
|
+
*/
|
|
27
|
+
interval?: string;
|
|
28
|
+
/** The namespace of the metrics been queried */
|
|
29
|
+
namespace?: string;
|
|
30
|
+
/** The region of the resource been queried for metrics. */
|
|
31
|
+
resourceRegion?: string;
|
|
32
|
+
/** The resource that has been queried for metrics. */
|
|
33
|
+
resourceId?: string;
|
|
34
|
+
/** The value of the collection. */
|
|
35
|
+
metrics: Metric[];
|
|
36
|
+
}
|
|
37
|
+
export declare function metricResultsResponseValuesItemDeserializer(item: any): MetricResultsResponseValuesItem;
|
|
38
|
+
export declare function metricArrayDeserializer(result: Array<Metric>): any[];
|
|
39
|
+
/** The result data of a query. */
|
|
40
|
+
export interface Metric {
|
|
41
|
+
/** The metric Id. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** The resource type of the metric resource. */
|
|
44
|
+
type: string;
|
|
45
|
+
/** The name and the display name of the metric, i.e. it is localizable string. */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Detailed description of this metric. */
|
|
48
|
+
description?: string;
|
|
49
|
+
/** 'Success' or the error details on query failures for this metric. */
|
|
50
|
+
errorCode?: string;
|
|
51
|
+
/** Error message encountered querying this specific metric. */
|
|
52
|
+
errorMessage?: string;
|
|
53
|
+
/** The unit of the metric. */
|
|
54
|
+
unit: MetricUnit;
|
|
55
|
+
/** The time series returned when a data query is performed. */
|
|
56
|
+
timeseries: TimeSeriesElement[];
|
|
57
|
+
}
|
|
58
|
+
export declare function metricDeserializer(item: any): Metric;
|
|
59
|
+
export declare function localizableStringDeserializer(item: any): string;
|
|
60
|
+
/** The unit of the metric. */
|
|
61
|
+
export type MetricUnit = "Count" | "Bytes" | "Seconds" | "CountPerSecond" | "BytesPerSecond" | "Percent" | "MilliSeconds" | "ByteSeconds" | "Unspecified" | "Cores" | "MilliCores" | "NanoCores" | "BitsPerSecond";
|
|
62
|
+
export declare function timeSeriesElementArrayDeserializer(result: Array<TimeSeriesElement>): any[];
|
|
63
|
+
/**
|
|
64
|
+
* A time series result type. The discriminator value is always TimeSeries in this
|
|
65
|
+
* case.
|
|
66
|
+
*/
|
|
67
|
+
export interface TimeSeriesElement {
|
|
68
|
+
/** The metadata values returned if $filter was specified in the call. */
|
|
69
|
+
metadatavalues?: MetadataValue[];
|
|
70
|
+
/**
|
|
71
|
+
* An array of data points representing the metric values. This is only returned
|
|
72
|
+
* if a result type of data is specified.
|
|
73
|
+
*/
|
|
74
|
+
data?: MetricValue[];
|
|
75
|
+
}
|
|
76
|
+
export declare function timeSeriesElementDeserializer(item: any): TimeSeriesElement;
|
|
77
|
+
export declare function metadataValueArrayDeserializer(result: Array<MetadataValue>): any[];
|
|
78
|
+
/** Represents a metric metadata value. */
|
|
79
|
+
export interface MetadataValue {
|
|
80
|
+
/** The name of the metadata. */
|
|
81
|
+
name?: string;
|
|
82
|
+
/** The value of the metadata. */
|
|
83
|
+
value?: string;
|
|
84
|
+
}
|
|
85
|
+
export declare function metadataValueDeserializer(item: any): MetadataValue;
|
|
86
|
+
export declare function metricValueArrayDeserializer(result: Array<MetricValue>): any[];
|
|
87
|
+
/** Represents a metric value. */
|
|
88
|
+
export interface MetricValue {
|
|
89
|
+
/** The timestamp for the metric value in ISO 8601 format. */
|
|
90
|
+
timeStamp: Date;
|
|
91
|
+
/** The average value in the time range. */
|
|
92
|
+
average?: number;
|
|
93
|
+
/** The least value in the time range. */
|
|
94
|
+
minimum?: number;
|
|
95
|
+
/** The greatest value in the time range. */
|
|
96
|
+
maximum?: number;
|
|
97
|
+
/** The sum of all of the values in the time range. */
|
|
98
|
+
total?: number;
|
|
99
|
+
/**
|
|
100
|
+
* The number of samples in the time range. Can be used to determine the number of
|
|
101
|
+
* values that contributed to the average value.
|
|
102
|
+
*/
|
|
103
|
+
count?: number;
|
|
104
|
+
}
|
|
105
|
+
export declare function metricValueDeserializer(item: any): MetricValue;
|
|
106
|
+
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */
|
|
107
|
+
export interface ErrorResponse {
|
|
108
|
+
/** The error object. */
|
|
109
|
+
error?: ErrorDetail;
|
|
110
|
+
}
|
|
111
|
+
export declare function errorResponseDeserializer(item: any): ErrorResponse;
|
|
112
|
+
/** The error detail. */
|
|
113
|
+
export interface ErrorDetail {
|
|
114
|
+
/** The error code. */
|
|
115
|
+
readonly code?: string;
|
|
116
|
+
/** The error message. */
|
|
117
|
+
readonly message?: string;
|
|
118
|
+
/** The error target. */
|
|
119
|
+
readonly target?: string;
|
|
120
|
+
/** The error details. */
|
|
121
|
+
readonly details?: ErrorDetail[];
|
|
122
|
+
/** The error additional info. */
|
|
123
|
+
readonly additionalInfo?: ErrorAdditionalInfo[];
|
|
124
|
+
}
|
|
125
|
+
export declare function errorDetailDeserializer(item: any): ErrorDetail;
|
|
126
|
+
export declare function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[];
|
|
127
|
+
export declare function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[];
|
|
128
|
+
/** The resource management error additional info. */
|
|
129
|
+
export interface ErrorAdditionalInfo {
|
|
130
|
+
/** The additional info type. */
|
|
131
|
+
readonly type?: string;
|
|
132
|
+
/** The additional info. */
|
|
133
|
+
readonly info?: any;
|
|
134
|
+
}
|
|
135
|
+
export declare function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo;
|
|
136
|
+
/** Service API versions */
|
|
137
|
+
export declare enum KnownVersions {
|
|
138
|
+
/** The 2024-02-01 API version. */
|
|
139
|
+
V20240201 = "2024-02-01"
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAKA,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,qDAAqD;IACrD,WAAW,CAAC,EAAE,MA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IAAI,CAAC,EAAE,GAAG,CAAC;CACrB;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,GAAG,GAAG,mBAAmB,CAK9E;AAED,2BAA2B;AAC3B,oBAAY,aAAa;IACvB,kCAAkC;IAClC,SAAS,eAAe;CACzB"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.KnownVersions = void 0;
|
|
6
|
+
exports.resourceIdListSerializer = resourceIdListSerializer;
|
|
7
|
+
exports.metricResultsResponseDeserializer = metricResultsResponseDeserializer;
|
|
8
|
+
exports.metricResultsResponseValuesItemArrayDeserializer = metricResultsResponseValuesItemArrayDeserializer;
|
|
9
|
+
exports.metricResultsResponseValuesItemDeserializer = metricResultsResponseValuesItemDeserializer;
|
|
10
|
+
exports.metricArrayDeserializer = metricArrayDeserializer;
|
|
11
|
+
exports.metricDeserializer = metricDeserializer;
|
|
12
|
+
exports.localizableStringDeserializer = localizableStringDeserializer;
|
|
13
|
+
exports.timeSeriesElementArrayDeserializer = timeSeriesElementArrayDeserializer;
|
|
14
|
+
exports.timeSeriesElementDeserializer = timeSeriesElementDeserializer;
|
|
15
|
+
exports.metadataValueArrayDeserializer = metadataValueArrayDeserializer;
|
|
16
|
+
exports.metadataValueDeserializer = metadataValueDeserializer;
|
|
17
|
+
exports.metricValueArrayDeserializer = metricValueArrayDeserializer;
|
|
18
|
+
exports.metricValueDeserializer = metricValueDeserializer;
|
|
19
|
+
exports.errorResponseDeserializer = errorResponseDeserializer;
|
|
20
|
+
exports.errorDetailDeserializer = errorDetailDeserializer;
|
|
21
|
+
exports.errorDetailArrayDeserializer = errorDetailArrayDeserializer;
|
|
22
|
+
exports.errorAdditionalInfoArrayDeserializer = errorAdditionalInfoArrayDeserializer;
|
|
23
|
+
exports.errorAdditionalInfoDeserializer = errorAdditionalInfoDeserializer;
|
|
24
|
+
function resourceIdListSerializer(item) {
|
|
25
|
+
return {
|
|
26
|
+
resourceids: !item["resourceids"]
|
|
27
|
+
? item["resourceids"]
|
|
28
|
+
: item["resourceids"].map((p) => {
|
|
29
|
+
return p;
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function metricResultsResponseDeserializer(item) {
|
|
34
|
+
return {
|
|
35
|
+
values: !item["values"]
|
|
36
|
+
? item["values"]
|
|
37
|
+
: metricResultsResponseValuesItemArrayDeserializer(item["values"]),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function metricResultsResponseValuesItemArrayDeserializer(result) {
|
|
41
|
+
return result.map((item) => {
|
|
42
|
+
return metricResultsResponseValuesItemDeserializer(item);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function metricResultsResponseValuesItemDeserializer(item) {
|
|
46
|
+
return {
|
|
47
|
+
startTime: item["starttime"],
|
|
48
|
+
endTime: item["endtime"],
|
|
49
|
+
interval: item["interval"],
|
|
50
|
+
namespace: item["namespace"],
|
|
51
|
+
resourceRegion: item["resourceregion"],
|
|
52
|
+
resourceId: item["resourceid"],
|
|
53
|
+
metrics: metricArrayDeserializer(item["value"]),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function metricArrayDeserializer(result) {
|
|
57
|
+
return result.map((item) => {
|
|
58
|
+
return metricDeserializer(item);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function metricDeserializer(item) {
|
|
62
|
+
return {
|
|
63
|
+
id: item["id"],
|
|
64
|
+
type: item["type"],
|
|
65
|
+
name: localizableStringDeserializer(item["name"]),
|
|
66
|
+
description: item["displayDescription"],
|
|
67
|
+
errorCode: item["errorCode"],
|
|
68
|
+
errorMessage: item["errorMessage"],
|
|
69
|
+
unit: item["unit"],
|
|
70
|
+
timeseries: timeSeriesElementArrayDeserializer(item["timeseries"]),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function localizableStringDeserializer(item) {
|
|
74
|
+
const deserialized = {
|
|
75
|
+
value: item["value"],
|
|
76
|
+
localizedValue: item["localizedValue"],
|
|
77
|
+
};
|
|
78
|
+
return deserialized.localizedValue || deserialized.value;
|
|
79
|
+
}
|
|
80
|
+
function timeSeriesElementArrayDeserializer(result) {
|
|
81
|
+
return result.map((item) => {
|
|
82
|
+
return timeSeriesElementDeserializer(item);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function timeSeriesElementDeserializer(item) {
|
|
86
|
+
return {
|
|
87
|
+
metadatavalues: !item["metadatavalues"]
|
|
88
|
+
? item["metadatavalues"]
|
|
89
|
+
: metadataValueArrayDeserializer(item["metadatavalues"]),
|
|
90
|
+
data: !item["data"] ? item["data"] : metricValueArrayDeserializer(item["data"]),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function metadataValueArrayDeserializer(result) {
|
|
94
|
+
return result.map((item) => {
|
|
95
|
+
return metadataValueDeserializer(item);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function metadataValueDeserializer(item) {
|
|
99
|
+
return {
|
|
100
|
+
name: !item["name"] ? item["name"] : localizableStringDeserializer(item["name"]),
|
|
101
|
+
value: item["value"],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function metricValueArrayDeserializer(result) {
|
|
105
|
+
return result.map((item) => {
|
|
106
|
+
return metricValueDeserializer(item);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function metricValueDeserializer(item) {
|
|
110
|
+
return {
|
|
111
|
+
timeStamp: new Date(item["timeStamp"]),
|
|
112
|
+
average: item["average"],
|
|
113
|
+
minimum: item["minimum"],
|
|
114
|
+
maximum: item["maximum"],
|
|
115
|
+
total: item["total"],
|
|
116
|
+
count: item["count"],
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function errorResponseDeserializer(item) {
|
|
120
|
+
return {
|
|
121
|
+
error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function errorDetailDeserializer(item) {
|
|
125
|
+
return {
|
|
126
|
+
code: item["code"],
|
|
127
|
+
message: item["message"],
|
|
128
|
+
target: item["target"],
|
|
129
|
+
details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]),
|
|
130
|
+
additionalInfo: !item["additionalInfo"]
|
|
131
|
+
? item["additionalInfo"]
|
|
132
|
+
: errorAdditionalInfoArrayDeserializer(item["additionalInfo"]),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function errorDetailArrayDeserializer(result) {
|
|
136
|
+
return result.map((item) => {
|
|
137
|
+
return errorDetailDeserializer(item);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function errorAdditionalInfoArrayDeserializer(result) {
|
|
141
|
+
return result.map((item) => {
|
|
142
|
+
return errorAdditionalInfoDeserializer(item);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function errorAdditionalInfoDeserializer(item) {
|
|
146
|
+
return {
|
|
147
|
+
type: item["type"],
|
|
148
|
+
info: item["info"],
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/** Service API versions */
|
|
152
|
+
var KnownVersions;
|
|
153
|
+
(function (KnownVersions) {
|
|
154
|
+
/** The 2024-02-01 API version. */
|
|
155
|
+
KnownVersions["V20240201"] = "2024-02-01";
|
|
156
|
+
})(KnownVersions || (exports.KnownVersions = KnownVersions = {}));
|
|
157
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC,4DAQC;AAQD,8EAMC;AAED,4GAMC;AA0BD,kGAYC;AAED,0DAIC;AAsBD,gDAWC;AAUD,sEAMC;AAkBD,gFAIC;AAgBD,sEAOC;AAED,wEAIC;AAUD,8DAKC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Content":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/** The comma separated list of resource IDs to query metrics for. */\nexport interface ResourceIdList {\n /** The list of resource IDs to query metrics for. */\n resourceids?: string[];\n}\n\nexport function resourceIdListSerializer(item: ResourceIdList): any {\n return {\n resourceids: !item[\"resourceids\"]\n ? item[\"resourceids\"]\n : item[\"resourceids\"].map((p: string) => {\n return p;\n }),\n };\n}\n\n/** The metrics result for a resource. */\nexport interface MetricResultsResponse {\n /** The collection of metric data responses per resource, per metric. */\n values?: MetricResultsResponseValuesItem[];\n}\n\nexport function metricResultsResponseDeserializer(item: any): MetricResultsResponse {\n return {\n values: !item[\"values\"]\n ? item[\"values\"]\n : metricResultsResponseValuesItemArrayDeserializer(item[\"values\"]),\n };\n}\n\nexport function metricResultsResponseValuesItemArrayDeserializer(\n result: Array<MetricResultsResponseValuesItem>,\n): any[] {\n return result.map((item: any) => {\n return metricResultsResponseValuesItemDeserializer(item);\n });\n}\n\n/** The metric data response for a resource. */\nexport interface MetricResultsResponseValuesItem {\n /** The start time, in datetime format, for which the data was retrieved. */\n startTime: string;\n /** The end time, in datetime format, for which the data was retrieved. */\n endTime: string;\n /**\n * The interval (window size) for which the metric data was returned in ISO 8601\n * duration format with a special case for 'FULL' value that returns single\n * datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*).\n * This may be adjusted and different from what was originally requested if\n * AutoAdjustTimegrain=true is specified.\n */\n interval?: string;\n /** The namespace of the metrics been queried */\n namespace?: string;\n /** The region of the resource been queried for metrics. */\n resourceRegion?: string;\n /** The resource that has been queried for metrics. */\n resourceId?: string;\n /** The value of the collection. */\n metrics: Metric[];\n}\n\nexport function metricResultsResponseValuesItemDeserializer(\n item: any,\n): MetricResultsResponseValuesItem {\n return {\n startTime: item[\"starttime\"],\n endTime: item[\"endtime\"],\n interval: item[\"interval\"],\n namespace: item[\"namespace\"],\n resourceRegion: item[\"resourceregion\"],\n resourceId: item[\"resourceid\"],\n metrics: metricArrayDeserializer(item[\"value\"]),\n };\n}\n\nexport function metricArrayDeserializer(result: Array<Metric>): any[] {\n return result.map((item: any) => {\n return metricDeserializer(item);\n });\n}\n\n/** The result data of a query. */\nexport interface Metric {\n /** The metric Id. */\n id: string;\n /** The resource type of the metric resource. */\n type: string;\n /** The name and the display name of the metric, i.e. it is localizable string. */\n name: string;\n /** Detailed description of this metric. */\n description?: string;\n /** 'Success' or the error details on query failures for this metric. */\n errorCode?: string;\n /** Error message encountered querying this specific metric. */\n errorMessage?: string;\n /** The unit of the metric. */\n unit: MetricUnit;\n /** The time series returned when a data query is performed. */\n timeseries: TimeSeriesElement[];\n}\n\nexport function metricDeserializer(item: any): Metric {\n return {\n id: item[\"id\"],\n type: item[\"type\"],\n name: localizableStringDeserializer(item[\"name\"]),\n description: item[\"displayDescription\"],\n errorCode: item[\"errorCode\"],\n errorMessage: item[\"errorMessage\"],\n unit: item[\"unit\"],\n timeseries: timeSeriesElementArrayDeserializer(item[\"timeseries\"]),\n };\n}\n\n/** The localizable string class. */\ninterface LocalizableString {\n /** The invariant value. */\n value: string;\n /** The display name. */\n localizedValue?: string;\n}\n\nexport function localizableStringDeserializer(item: any): string {\n const deserialized: LocalizableString = {\n value: item[\"value\"],\n localizedValue: item[\"localizedValue\"],\n };\n return deserialized.localizedValue || deserialized.value;\n}\n\n/** The unit of the metric. */\nexport type MetricUnit =\n | \"Count\"\n | \"Bytes\"\n | \"Seconds\"\n | \"CountPerSecond\"\n | \"BytesPerSecond\"\n | \"Percent\"\n | \"MilliSeconds\"\n | \"ByteSeconds\"\n | \"Unspecified\"\n | \"Cores\"\n | \"MilliCores\"\n | \"NanoCores\"\n | \"BitsPerSecond\";\n\nexport function timeSeriesElementArrayDeserializer(result: Array<TimeSeriesElement>): any[] {\n return result.map((item: any) => {\n return timeSeriesElementDeserializer(item);\n });\n}\n\n/**\n * A time series result type. The discriminator value is always TimeSeries in this\n * case.\n */\nexport interface TimeSeriesElement {\n /** The metadata values returned if $filter was specified in the call. */\n metadatavalues?: MetadataValue[];\n /**\n * An array of data points representing the metric values. This is only returned\n * if a result type of data is specified.\n */\n data?: MetricValue[];\n}\n\nexport function timeSeriesElementDeserializer(item: any): TimeSeriesElement {\n return {\n metadatavalues: !item[\"metadatavalues\"]\n ? item[\"metadatavalues\"]\n : metadataValueArrayDeserializer(item[\"metadatavalues\"]),\n data: !item[\"data\"] ? item[\"data\"] : metricValueArrayDeserializer(item[\"data\"]),\n };\n}\n\nexport function metadataValueArrayDeserializer(result: Array<MetadataValue>): any[] {\n return result.map((item: any) => {\n return metadataValueDeserializer(item);\n });\n}\n\n/** Represents a metric metadata value. */\nexport interface MetadataValue {\n /** The name of the metadata. */\n name?: string;\n /** The value of the metadata. */\n value?: string;\n}\n\nexport function metadataValueDeserializer(item: any): MetadataValue {\n return {\n name: !item[\"name\"] ? item[\"name\"] : localizableStringDeserializer(item[\"name\"]),\n value: item[\"value\"],\n };\n}\n\nexport function metricValueArrayDeserializer(result: Array<MetricValue>): any[] {\n return result.map((item: any) => {\n return metricValueDeserializer(item);\n });\n}\n\n/** Represents a metric value. */\nexport interface MetricValue {\n /** The timestamp for the metric value in ISO 8601 format. */\n timeStamp: Date;\n /** The average value in the time range. */\n average?: number;\n /** The least value in the time range. */\n minimum?: number;\n /** The greatest value in the time range. */\n maximum?: number;\n /** The sum of all of the values in the time range. */\n total?: number;\n /**\n * The number of samples in the time range. Can be used to determine the number of\n * values that contributed to the average value.\n */\n count?: number;\n}\n\nexport function metricValueDeserializer(item: any): MetricValue {\n return {\n timeStamp: new Date(item[\"timeStamp\"]),\n average: item[\"average\"],\n minimum: item[\"minimum\"],\n maximum: item[\"maximum\"],\n total: item[\"total\"],\n count: item[\"count\"],\n };\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */\nexport interface ErrorResponse {\n /** The error object. */\n error?: ErrorDetail;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorDetailDeserializer(item[\"error\"]),\n };\n}\n\n/** The error detail. */\nexport interface ErrorDetail {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: ErrorDetail[];\n /** The error additional info. */\n readonly additionalInfo?: ErrorAdditionalInfo[];\n}\n\nexport function errorDetailDeserializer(item: any): ErrorDetail {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n target: item[\"target\"],\n details: !item[\"details\"] ? item[\"details\"] : errorDetailArrayDeserializer(item[\"details\"]),\n additionalInfo: !item[\"additionalInfo\"]\n ? item[\"additionalInfo\"]\n : errorAdditionalInfoArrayDeserializer(item[\"additionalInfo\"]),\n };\n}\n\nexport function errorDetailArrayDeserializer(result: Array<ErrorDetail>): any[] {\n return result.map((item: any) => {\n return errorDetailDeserializer(item);\n });\n}\n\nexport function errorAdditionalInfoArrayDeserializer(result: Array<ErrorAdditionalInfo>): any[] {\n return result.map((item: any) => {\n return errorAdditionalInfoDeserializer(item);\n });\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfo {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: any;\n}\n\nexport function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo {\n return {\n type: item[\"type\"],\n info: item[\"info\"],\n };\n}\n\n/** Service API versions */\nexport enum KnownVersions {\n /** The 2024-02-01 API version. */\n V20240201 = \"2024-02-01\",\n}\n"]}
|