@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,38 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { logger } from "../logger.js";
|
|
4
|
+
import { getClient } from "@azure-rest/core-client";
|
|
5
|
+
export function createMetrics(endpointParam, credential, options = {}) {
|
|
6
|
+
const endpointUrl = options.endpoint ?? String(endpointParam);
|
|
7
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
8
|
+
const userAgentInfo = `azsdk-js-monitor-query-metrics/1.0.0`;
|
|
9
|
+
const userAgentPrefix = prefixFromOptions
|
|
10
|
+
? `${prefixFromOptions} ${userAgentInfo}`
|
|
11
|
+
: `${userAgentInfo}`;
|
|
12
|
+
const { apiVersion: _, ...updatedOptions } = {
|
|
13
|
+
...options,
|
|
14
|
+
userAgentOptions: { userAgentPrefix },
|
|
15
|
+
loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },
|
|
16
|
+
credentials: {
|
|
17
|
+
scopes: options.credentials?.scopes ?? ["https://metrics.monitor.azure.com/.default"],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const clientContext = getClient(endpointUrl, credential, updatedOptions);
|
|
21
|
+
clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
|
|
22
|
+
const apiVersion = options.apiVersion ?? "2024-02-01";
|
|
23
|
+
clientContext.pipeline.addPolicy({
|
|
24
|
+
name: "ClientApiVersionPolicy",
|
|
25
|
+
sendRequest: (req, next) => {
|
|
26
|
+
// Use the apiVersion defined in request url directly
|
|
27
|
+
// Append one if there is no apiVersion and we have one at client options
|
|
28
|
+
const url = new URL(req.url);
|
|
29
|
+
if (!url.searchParams.get("api-version")) {
|
|
30
|
+
// eslint-disable-next-line no-param-reassign
|
|
31
|
+
req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
|
|
32
|
+
}
|
|
33
|
+
return next(req);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return { ...clientContext, apiVersion };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=metricsContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metricsContext.js","sourceRoot":"","sources":["../../../src/api/metricsContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAgBpD,MAAM,UAAU,aAAa,CAC3B,aAAqB,EACrB,UAA2B,EAC3B,UAAuC,EAAE;IAEzC,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9D,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,sCAAsC,CAAC;IAC7D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,IAAI,aAAa,EAAE;QACzC,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACvB,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG;QAC3C,GAAG,OAAO;QACV,gBAAgB,EAAE,EAAE,eAAe,EAAE;QACrC,cAAc,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE;QACzE,WAAW,EAAE;YACX,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,IAAI,CAAC,4CAA4C,CAAC;SACtF;KACF,CAAC;IACF,MAAM,aAAa,GAAG,SAAS,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACzE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAClE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,YAAY,CAAC;IACtD,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,6CAA6C;gBAC7C,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,EAAE,GAAG,aAAa,EAAE,UAAU,EAAoB,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport type { Client, ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport type { TokenCredential } from \"@azure/core-auth\";\n\nexport interface MetricsContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n}\n\n/** Optional parameters for the client. */\nexport interface MetricsClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createMetrics(\n endpointParam: string,\n credential: TokenCredential,\n options: MetricsClientOptionalParams = {},\n): MetricsContext {\n const endpointUrl = options.endpoint ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-monitor-query-metrics/1.0.0`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} ${userAgentInfo}`\n : `${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://metrics.monitor.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2024-02-01\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\")) {\n // eslint-disable-next-line no-param-reassign\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n return { ...clientContext, apiVersion } as MetricsContext;\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MetricsContext as Client } from "./index.js";
|
|
2
|
+
import type { ResourceIdList, MetricResultsResponse } from "../models/models.js";
|
|
3
|
+
import type { QueryResourcesOptionalParams } from "./options.js";
|
|
4
|
+
import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
5
|
+
export declare function _queryResourcesSend(context: Client, subscriptionId: string, metricNamespace: string, metricNames: string[], batchRequest: ResourceIdList, options?: QueryResourcesOptionalParams): StreamableMethod;
|
|
6
|
+
export declare function _queryResourcesDeserialize(result: PathUncheckedResponse): Promise<MetricResultsResponse>;
|
|
7
|
+
/** Lists the metric values for multiple resources. */
|
|
8
|
+
export declare function queryResources(context: Client, subscriptionId: string, metricNamespace: string, metricNames: string[], batchRequest: ResourceIdList, options?: QueryResourcesOptionalParams): Promise<MetricResultsResponse>;
|
|
9
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAOjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGvF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EAAE,EACrB,YAAY,EAAE,cAAc,EAC5B,OAAO,GAAE,4BAAqD,GAC7D,gBAAgB,CAgClB;AAED,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAShC;AAED,sDAAsD;AACtD,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,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,CAUhC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { resourceIdListSerializer, metricResultsResponseDeserializer, errorResponseDeserializer, } from "../models/models.js";
|
|
4
|
+
import { expandUrlTemplate } from "../static-helpers/urlTemplate.js";
|
|
5
|
+
import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client";
|
|
6
|
+
export function _queryResourcesSend(context, subscriptionId, metricNamespace, metricNames, batchRequest, options = { requestOptions: {} }) {
|
|
7
|
+
const path = expandUrlTemplate("/subscriptions/{subscriptionId}/metrics:getBatch{?api%2Dversion,starttime,endtime,interval,metricnamespace,metricnames,aggregation,top,orderby,filter,rollupby}", {
|
|
8
|
+
subscriptionId: subscriptionId,
|
|
9
|
+
"api%2Dversion": context.apiVersion,
|
|
10
|
+
starttime: options?.startTime,
|
|
11
|
+
endtime: options?.endTime,
|
|
12
|
+
interval: options?.interval,
|
|
13
|
+
metricnamespace: metricNamespace,
|
|
14
|
+
metricnames: metricNames.map((p) => {
|
|
15
|
+
return p;
|
|
16
|
+
}),
|
|
17
|
+
aggregation: options?.aggregation,
|
|
18
|
+
top: options?.top,
|
|
19
|
+
orderby: options?.orderBy,
|
|
20
|
+
filter: options?.filter,
|
|
21
|
+
rollupby: options?.rollUpBy,
|
|
22
|
+
}, {
|
|
23
|
+
allowReserved: options?.requestOptions?.skipUrlEncoding,
|
|
24
|
+
});
|
|
25
|
+
return context.path(path).post({
|
|
26
|
+
...operationOptionsToRequestParameters(options),
|
|
27
|
+
contentType: "application/json",
|
|
28
|
+
headers: {
|
|
29
|
+
accept: "application/json",
|
|
30
|
+
...options.requestOptions?.headers,
|
|
31
|
+
},
|
|
32
|
+
body: resourceIdListSerializer(batchRequest),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export async function _queryResourcesDeserialize(result) {
|
|
36
|
+
const expectedStatuses = ["200"];
|
|
37
|
+
if (!expectedStatuses.includes(result.status)) {
|
|
38
|
+
const error = createRestError(result);
|
|
39
|
+
error.details = errorResponseDeserializer(result.body);
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
return metricResultsResponseDeserializer(result.body);
|
|
43
|
+
}
|
|
44
|
+
/** Lists the metric values for multiple resources. */
|
|
45
|
+
export async function queryResources(context, subscriptionId, metricNamespace, metricNames, batchRequest, options = { requestOptions: {} }) {
|
|
46
|
+
const result = await _queryResourcesSend(context, subscriptionId, metricNamespace, metricNames, batchRequest, options);
|
|
47
|
+
return _queryResourcesDeserialize(result);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/api/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAE/F,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,cAAsB,EACtB,eAAuB,EACvB,WAAqB,EACrB,YAA4B,EAC5B,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,MAAM,IAAI,GAAG,iBAAiB,CAC5B,iKAAiK,EACjK;QACE,cAAc,EAAE,cAAc;QAC9B,eAAe,EAAE,OAAO,CAAC,UAAU;QACnC,SAAS,EAAE,OAAO,EAAE,SAAS;QAC7B,OAAO,EAAE,OAAO,EAAE,OAAO;QACzB,QAAQ,EAAE,OAAO,EAAE,QAAQ;QAC3B,eAAe,EAAE,eAAe;QAChC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;YACtC,OAAO,CAAC,CAAC;QACX,CAAC,CAAC;QACF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AO,CACR,CAAC;IACF,OAAO,0BAA0B,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { MetricsContext as Client } from \"./index.js\";\nimport type { ResourceIdList, MetricResultsResponse } from \"../models/models.js\";\nimport {\n resourceIdListSerializer,\n metricResultsResponseDeserializer,\n errorResponseDeserializer,\n} from \"../models/models.js\";\nimport { expandUrlTemplate } from \"../static-helpers/urlTemplate.js\";\nimport type { QueryResourcesOptionalParams } from \"./options.js\";\nimport type { StreamableMethod, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError, operationOptionsToRequestParameters } from \"@azure-rest/core-client\";\n\nexport function _queryResourcesSend(\n context: Client,\n subscriptionId: string,\n metricNamespace: string,\n metricNames: string[],\n batchRequest: ResourceIdList,\n options: QueryResourcesOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/subscriptions/{subscriptionId}/metrics:getBatch{?api%2Dversion,starttime,endtime,interval,metricnamespace,metricnames,aggregation,top,orderby,filter,rollupby}\",\n {\n subscriptionId: subscriptionId,\n \"api%2Dversion\": context.apiVersion,\n starttime: options?.startTime,\n endtime: options?.endTime,\n interval: options?.interval,\n metricnamespace: metricNamespace,\n metricnames: metricNames.map((p: any) => {\n return p;\n }),\n aggregation: options?.aggregation,\n top: options?.top,\n orderby: options?.orderBy,\n filter: options?.filter,\n rollupby: options?.rollUpBy,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n contentType: \"application/json\",\n headers: {\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n body: resourceIdListSerializer(batchRequest),\n });\n}\n\nexport async function _queryResourcesDeserialize(\n result: PathUncheckedResponse,\n): Promise<MetricResultsResponse> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n const error = createRestError(result);\n error.details = errorResponseDeserializer(result.body);\n throw error;\n }\n\n return metricResultsResponseDeserializer(result.body);\n}\n\n/** Lists the metric values for multiple resources. */\nexport async function queryResources(\n context: Client,\n subscriptionId: string,\n metricNamespace: string,\n metricNames: string[],\n batchRequest: ResourceIdList,\n options: QueryResourcesOptionalParams = { requestOptions: {} },\n): Promise<MetricResultsResponse> {\n const result = await _queryResourcesSend(\n context,\n subscriptionId,\n metricNamespace,\n metricNames,\n batchRequest,\n options,\n );\n return _queryResourcesDeserialize(result);\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { OperationOptions } from "@azure-rest/core-client";
|
|
2
|
+
/** Optional parameters. */
|
|
3
|
+
export interface QueryResourcesOptionalParams extends OperationOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The start time of the query. It is a string in the format
|
|
6
|
+
* 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then
|
|
7
|
+
* this parameter is required.
|
|
8
|
+
* If only starttime is specified, then endtime defaults to the current time.
|
|
9
|
+
* If no time interval is specified, the default is 1 hour.
|
|
10
|
+
*/
|
|
11
|
+
startTime?: string;
|
|
12
|
+
/** The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. */
|
|
13
|
+
endTime?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The interval (i.e. timegrain) of the query in ISO 8601 duration format.
|
|
16
|
+
* Defaults to PT1M. Special case for 'FULL' value that returns single datapoint
|
|
17
|
+
* for entire time span requested.
|
|
18
|
+
* *Examples: PT15M, PT1H, P1D, FULL*
|
|
19
|
+
*
|
|
20
|
+
* {@link Durations}
|
|
21
|
+
*/
|
|
22
|
+
interval?: string;
|
|
23
|
+
/** The list of aggregation types (comma separated) to retrieve. *Examples: average, minimum, maximum* */
|
|
24
|
+
aggregation?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The maximum number of records to retrieve per resource ID in the request.
|
|
27
|
+
* Valid only if filter is specified.
|
|
28
|
+
* Defaults to 10.
|
|
29
|
+
*/
|
|
30
|
+
top?: number;
|
|
31
|
+
/**
|
|
32
|
+
* The aggregation to use for sorting results and the direction of the sort.
|
|
33
|
+
* Only one order can be specified.
|
|
34
|
+
* *Examples: sum asc*
|
|
35
|
+
*/
|
|
36
|
+
orderBy?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The filter is used to reduce the set of metric data
|
|
39
|
+
* returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all
|
|
40
|
+
* time series of C where A = a1 and B = b1 or b2<br>**filter=A eq ‘a1’ and B eq
|
|
41
|
+
* ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid variant:<br>**filter=A eq ‘a1’
|
|
42
|
+
* and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical
|
|
43
|
+
* or operator cannot separate two different metadata names.<br>- Return all time
|
|
44
|
+
* series where A = a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and
|
|
45
|
+
* C eq ‘c1’**<br>- Return all time series where A = a1<br>**filter=A eq ‘a1’ and
|
|
46
|
+
* B eq ‘*’ and C eq ‘*’**.
|
|
47
|
+
*/
|
|
48
|
+
filter?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Dimension name(s) to rollup results by. For example if you only want to see
|
|
51
|
+
* metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't
|
|
52
|
+
* want to see separate values for each city, you can specify 'RollUpBy=City' to
|
|
53
|
+
* see the results for Seattle and Tacoma rolled up into one timeseries.
|
|
54
|
+
*/
|
|
55
|
+
rollUpBy?: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/api/options.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,2BAA2B;AAC3B,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IACpE;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yGAAyG;IACzG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/api/options.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions } from \"@azure-rest/core-client\";\n\n/** Optional parameters. */\nexport interface QueryResourcesOptionalParams extends OperationOptions {\n /**\n * The start time of the query. It is a string in the format\n * 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then\n * this parameter is required.\n * If only starttime is specified, then endtime defaults to the current time.\n * If no time interval is specified, the default is 1 hour.\n */\n startTime?: string;\n /** The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. */\n endTime?: string;\n /**\n * The interval (i.e. timegrain) of the query in ISO 8601 duration format.\n * Defaults to PT1M. Special case for 'FULL' value that returns single datapoint\n * for entire time span requested.\n * *Examples: PT15M, PT1H, P1D, FULL*\n *\n * {@link Durations}\n */\n interval?: string;\n /** The list of aggregation types (comma separated) to retrieve. *Examples: average, minimum, maximum* */\n aggregation?: string;\n /**\n * The maximum number of records to retrieve per resource ID in the request.\n * Valid only if filter is specified.\n * Defaults to 10.\n */\n top?: number;\n /**\n * The aggregation to use for sorting results and the direction of the sort.\n * Only one order can be specified.\n * *Examples: sum asc*\n */\n orderBy?: string;\n /**\n * The filter is used to reduce the set of metric data\n * returned.<br>Example:<br>Metric contains metadata A, B and C.<br>- Return all\n * time series of C where A = a1 and B = b1 or b2<br>**filter=A eq ‘a1’ and B eq\n * ‘b1’ or B eq ‘b2’ and C eq ‘*’**<br>- Invalid variant:<br>**filter=A eq ‘a1’\n * and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**<br>This is invalid because the logical\n * or operator cannot separate two different metadata names.<br>- Return all time\n * series where A = a1, B = b1 and C = c1:<br>**filter=A eq ‘a1’ and B eq ‘b1’ and\n * C eq ‘c1’**<br>- Return all time series where A = a1<br>**filter=A eq ‘a1’ and\n * B eq ‘*’ and C eq ‘*’**.\n */\n filter?: string;\n /**\n * Dimension name(s) to rollup results by. For example if you only want to see\n * metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't\n * want to see separate values for each city, you can specify 'RollUpBy=City' to\n * see the results for Seattle and Tacoma rolled up into one timeseries.\n */\n rollUpBy?: string;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { MetricsClient } from "./metricsClient.js";
|
|
2
|
+
export { MetricsQueryResourcesOptions, MetricsQueryResult, QueryTimeInterval, Durations, KnownMonitorMetricsQueryAudience, MetricsClientOptions, } from "./models.js";
|
|
3
|
+
export { ResourceIdList, MetricResultsResponse, MetricResultsResponseValuesItem, Metric, MetricUnit, TimeSeriesElement, MetadataValue, MetricValue, ErrorResponse, ErrorDetail, ErrorAdditionalInfo, KnownVersions, } from "./models/index.js";
|
|
4
|
+
export { MetricsClientOptionalParams } from "./api/index.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,gCAAgC,EAChC,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,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,mBAAmB,CAAC;AAC3B,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export { MetricsClient } from "./metricsClient.js";
|
|
4
|
+
export { Durations, KnownMonitorMetricsQueryAudience, } from "./models.js";
|
|
5
|
+
export { KnownVersions, } from "./models/index.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAIL,SAAS,EACT,gCAAgC,GAEjC,MAAM,aAAa,CAAC;AACrB,OAAO,EAYL,aAAa,GACd,MAAM,mBAAmB,CAAC","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,23 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { createMetrics } from "./api/index.js";
|
|
4
|
+
import { queryResources } from "./api/operations.js";
|
|
5
|
+
export class MetricsClient {
|
|
6
|
+
_client;
|
|
7
|
+
/** The pipeline used by this client to make requests */
|
|
8
|
+
pipeline;
|
|
9
|
+
constructor(endpointParam, credential, options = {}) {
|
|
10
|
+
const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
|
|
11
|
+
const userAgentPrefix = prefixFromOptions;
|
|
12
|
+
this._client = createMetrics(endpointParam, credential, {
|
|
13
|
+
...options,
|
|
14
|
+
userAgentOptions: { userAgentPrefix },
|
|
15
|
+
});
|
|
16
|
+
this.pipeline = this._client.pipeline;
|
|
17
|
+
}
|
|
18
|
+
/** Lists the metric values for multiple resources. */
|
|
19
|
+
queryResources(subscriptionId, metricNamespace, metricNames, batchRequest, options = { requestOptions: {} }) {
|
|
20
|
+
return queryResources(this._client, subscriptionId, metricNamespace, metricNames, batchRequest, options);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# 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,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQrD,MAAM,OAAO,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,aAAa,CAAC,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,cAAc,CACnB,IAAI,CAAC,OAAO,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,YAAY,EACZ,OAAO,CACR,CAAC;IACJ,CAAC;CACF","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 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,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,48 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { MetricsClient as InternalMetricsClient } from "./internalMetricsClient.js";
|
|
4
|
+
import { mapToInternalQueryOptions, createMetricsQueryResult, getSubscriptionFromResourceId, } from "./utils.js";
|
|
5
|
+
import { KnownMonitorMetricsQueryAudience, } from "./models.js";
|
|
6
|
+
/**
|
|
7
|
+
* Client for querying Azure Monitor metrics.
|
|
8
|
+
*/
|
|
9
|
+
export class MetricsClient {
|
|
10
|
+
_client;
|
|
11
|
+
/** The pipeline used by this client to make requests */
|
|
12
|
+
pipeline;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new MetricsClient.
|
|
15
|
+
* @param endpoint - The endpoint URL for the metrics service.
|
|
16
|
+
* @param tokenCredential - The token credential to use for authentication.
|
|
17
|
+
* @param options - Optional configuration options.
|
|
18
|
+
*/
|
|
19
|
+
constructor(endpoint, tokenCredential, options = {}) {
|
|
20
|
+
this._client = new InternalMetricsClient(endpoint, tokenCredential, {
|
|
21
|
+
...options,
|
|
22
|
+
credentials: {
|
|
23
|
+
scopes: options.credentials?.scopes ?? [
|
|
24
|
+
options.audience ?? KnownMonitorMetricsQueryAudience.AzurePublicCloud + "/.default",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
this.pipeline = this._client.pipeline;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Query metrics for multiple Azure resources.
|
|
32
|
+
* @param resourceIds - Array of resource IDs to query metrics for.
|
|
33
|
+
* @param metricNames - Array of metric names to query.
|
|
34
|
+
* @param metricNamespace - The namespace of the metrics.
|
|
35
|
+
* @param options - Optional query parameters.
|
|
36
|
+
* @returns Promise resolving to an array of metrics query results.
|
|
37
|
+
*/
|
|
38
|
+
async queryResources(resourceIds, metricNames, metricNamespace, options = {}) {
|
|
39
|
+
// Extract subscription ID from the first resource ID
|
|
40
|
+
// Format: /subscriptions/{subscriptionId}/...
|
|
41
|
+
const subscriptionId = getSubscriptionFromResourceId(resourceIds[0]);
|
|
42
|
+
const internalOptions = mapToInternalQueryOptions(options);
|
|
43
|
+
const response = await this._client.queryResources(subscriptionId, metricNamespace, metricNames, { resourceids: resourceIds }, internalOptions);
|
|
44
|
+
// Convert the response to the expected format
|
|
45
|
+
return (response.values || []).map(createMetricsQueryResult);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# 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,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gCAAgC,GAIjC,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,OAAO,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,qBAAqB,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,gCAAgC,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,6BAA6B,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAErE,MAAM,eAAe,GAAG,yBAAyB,CAAC,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,wBAAwB,CAAC,CAAC;IAC/D,CAAC;CACF","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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAYL,aAAa,GACd,MAAM,aAAa,CAAC","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,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG,CAQlE;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,MAAM,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC5C;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,GAAG,GAAG,qBAAqB,CAMlF;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