MetricsAdvisorAdministrationClient class
Client class for interacting with Azure Metrics Advisor Service to perform management operations
Constructors
Metrics |
Creates an instance of MetricsAdvisorAdministrationClient. Example usage:
|
Properties
endpoint |
Url to service endpoint |
Methods
create |
Creates anomaly alerting configuration for a given metric |
create |
Adds a new data feed for a specific data source and provided settings |
create |
Creates data source credential for the given id |
create |
Creates an anomaly detection configuration for a given metric |
create |
Adds a new hook |
delete |
Deletes metric anomaly alert configuration for the given configuration id |
delete |
Deletes a data feed for the given data feed id |
delete |
Deletes data source credential for the given id |
delete |
Deletes a metric anomaly detection configuration for the given configuration id |
delete |
Deletes hook for the given hook id |
get |
Retrieves metric anomaly alert configuration for the given configuration id |
get |
Retrieves data feed for the given data feed id |
get |
Retrieves data feed ingestion progress for the given data feed id |
get |
Retrieves data source credential for the given id |
get |
Retrieves metric anomaly detection configuration for the given configuration id |
get |
Retrieves hook for the given hook id |
list |
Returns an async iterable iterator to list anamoly alert configurations associated with the given detection configuration.
Example using
Example using
Example using
|
list |
Returns an async iterable iterator to list data feed ingestion status based on options
Example using
Example using
Example using
|
list |
Returns an async iterable iterator to list data feeds based on options
Example using
Example using
Example using
|
list |
Returns an async iterable iterator to list data source credentials based on options
Example using
Example using
Example using
|
list |
Returns an async iterable iterator to list anomaly detection configurations based on options
Example using
Example using
Example using
|
list |
Returns an async iterable iterator to list hooks based on options
Example using
Example using
Example using
|
refresh |
Refreshes or resets data feed ingestion progress for the given data feed id |
update |
Updates an anomaly alert configuration for the given configuration id |
update |
Updates a data feed given its id |
update |
Updates data source credential for the given id |
update |
Updates a metric anomaly detection configuration for the given configuration id |
update |
Updates hook for the given hook id |
Constructor Details
MetricsAdvisorAdministrationClient(string, TokenCredential | MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClientOptions)
Creates an instance of MetricsAdvisorAdministrationClient.
Example usage:
import { MetricsAdvisorAdministrationClient, MetricsAdvisorKeyCredential } from "@azure/ai-metrics-advisor";
const client = new MetricsAdvisorAdministrationClient(
"<service endpoint>",
new MetricsAdvisorKeyCredential("<subscription key>", "<api key>")
);
new MetricsAdvisorAdministrationClient(endpointUrl: string, credential: TokenCredential | MetricsAdvisorKeyCredential, options?: MetricsAdvisorAdministrationClientOptions)
Parameters
- endpointUrl
-
string
Url to an Azure Metrics Advisor service endpoint
- credential
Used to authenticate requests to the service.
Used to configure the Metrics Advisor client.
Property Details
endpointUrl
Url to service endpoint
endpointUrl: string
Property Value
string
Method Details
createAlertConfig(Omit<AnomalyAlertConfiguration, "id">, OperationOptions)
Creates anomaly alerting configuration for a given metric
function createAlertConfig(config: Omit<AnomalyAlertConfiguration, "id">, options?: OperationOptions): Promise<AnomalyAlertConfiguration>
Parameters
- config
-
Omit<AnomalyAlertConfiguration, "id">
The alert configuration object to create
- options
- OperationOptions
Returns
Promise<AnomalyAlertConfiguration>
Response with Alert object
createDataFeed(DataFeedDescriptor, CreateDataFeedOptions)
Adds a new data feed for a specific data source and provided settings
function createDataFeed(feed: DataFeedDescriptor, operationOptions?: CreateDataFeedOptions): Promise<MetricsAdvisorDataFeed>
Parameters
- feed
- DataFeedDescriptor
the data feed object to create
- operationOptions
- CreateDataFeedOptions
Returns
Promise<MetricsAdvisorDataFeed>
Response with Datafeed object
createDataSourceCredential(DataSourceCredentialEntityUnion, OperationOptions)
Creates data source credential for the given id
function createDataSourceCredential(dataSourceCredential: DataSourceCredentialEntityUnion, options?: OperationOptions): Promise<DataSourceCredentialEntityUnion>
Parameters
- dataSourceCredential
- DataSourceCredentialEntityUnion
the credential entity object to create
- options
- OperationOptions
The options parameter
Returns
Promise<DataSourceCredentialEntityUnion>
createDetectionConfig(Omit<AnomalyDetectionConfiguration, "id">, OperationOptions)
Creates an anomaly detection configuration for a given metric
function createDetectionConfig(config: Omit<AnomalyDetectionConfiguration, "id">, options?: OperationOptions): Promise<AnomalyDetectionConfiguration>
Parameters
- config
-
Omit<AnomalyDetectionConfiguration, "id">
The detection configuration object to create
- options
- OperationOptions
The options parameter
Returns
Promise<AnomalyDetectionConfiguration>
Response with Detection Config object
createHook(EmailNotificationHook | WebNotificationHook, OperationOptions)
Adds a new hook
function createHook(hookInfo: EmailNotificationHook | WebNotificationHook, options?: OperationOptions): Promise<NotificationHookUnion>
Parameters
- hookInfo
Information for the new hook consists of the hook type, name, description, external link and hook parameter
- options
- OperationOptions
The options parameter.
Returns
Promise<NotificationHookUnion>
Response with Hook object
deleteAlertConfig(string, OperationOptions)
Deletes metric anomaly alert configuration for the given configuration id
function deleteAlertConfig(id: string, options?: OperationOptions): Promise<RestResponse>
Parameters
- id
-
string
id of the anomaly alert configuration to delete
- options
- OperationOptions
The options parameter.
Returns
Promise<RestResponse>
deleteDataFeed(string, OperationOptions)
Deletes a data feed for the given data feed id
function deleteDataFeed(id: string, options?: OperationOptions): Promise<RestResponse>
Parameters
- id
-
string
id of the data feed to delete
- options
- OperationOptions
The options parameter.
Returns
Promise<RestResponse>
deleteDataSourceCredential(string, OperationOptions)
Deletes data source credential for the given id
function deleteDataSourceCredential(id: string, options?: OperationOptions): Promise<RestResponse>
Parameters
- id
-
string
id of the credential entity to delete
- options
- OperationOptions
The options parameter
Returns
Promise<RestResponse>
deleteDetectionConfig(string, OperationOptions)
Deletes a metric anomaly detection configuration for the given configuration id
function deleteDetectionConfig(id: string, options?: OperationOptions): Promise<RestResponse>
Parameters
- id
-
string
id of the detection configuration to delete
- options
- OperationOptions
The options parameter.
Returns
Promise<RestResponse>
deleteHook(string, OperationOptions)
Deletes hook for the given hook id
function deleteHook(id: string, options?: OperationOptions): Promise<RestResponse>
Parameters
- id
-
string
id of the hook to delete
- options
- OperationOptions
The options parameter
Returns
Promise<RestResponse>
getAlertConfig(string, OperationOptions)
Retrieves metric anomaly alert configuration for the given configuration id
function getAlertConfig(id: string, options?: OperationOptions): Promise<AnomalyAlertConfiguration>
Parameters
- id
-
string
id of the anomaly alert configuration to retrieve
- options
- OperationOptions
The options parameter.
Returns
Promise<AnomalyAlertConfiguration>
getDataFeed(string, OperationOptions)
Retrieves data feed for the given data feed id
function getDataFeed(id: string, options?: OperationOptions): Promise<MetricsAdvisorDataFeed>
Parameters
- id
-
string
id for the data feed to retrieve
- options
- OperationOptions
The options parameter.
Returns
Promise<MetricsAdvisorDataFeed>
getDataFeedIngestionProgress(string, {})
Retrieves data feed ingestion progress for the given data feed id
function getDataFeedIngestionProgress(dataFeedId: string, options?: {}): Promise<GetIngestionProgressResponse>
Parameters
- dataFeedId
-
string
data feed id for the ingestion progress to retrieve
- options
-
{}
The options parameter.
Returns
Promise<GetIngestionProgressResponse>
getDataSourceCredential(string, OperationOptions)
Retrieves data source credential for the given id
function getDataSourceCredential(id: string, options?: OperationOptions): Promise<DataSourceCredentialEntityUnion>
Parameters
- id
-
string
id of the credential entity to retrieve
- options
- OperationOptions
The options parameter
Returns
Promise<DataSourceCredentialEntityUnion>
getDetectionConfig(string, OperationOptions)
Retrieves metric anomaly detection configuration for the given configuration id
function getDetectionConfig(id: string, options?: OperationOptions): Promise<AnomalyDetectionConfiguration>
Parameters
- id
-
string
id of the detection configuration to retrieve
- options
- OperationOptions
The options parameter.
Returns
Promise<AnomalyDetectionConfiguration>
getHook(string, OperationOptions)
Retrieves hook for the given hook id
function getHook(id: string, options?: OperationOptions): Promise<NotificationHookUnion>
Parameters
- id
-
string
id for the hook to retrieve
- options
- OperationOptions
The options parameter.
Returns
Promise<NotificationHookUnion>
listAlertConfigs(string, OperationOptions)
Returns an async iterable iterator to list anamoly alert configurations associated with the given detection configuration.
.byPage()
returns an async iterable iterator to list the alert configurations in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const alertConfigurations = client.listAlertConfigs(detectionConfigurationId);
let i = 1;
for await (const alertConfiguration of alertConfigurations){
console.log(`alertConfiguration ${i++}:`);
console.log(alertConfiguration);
}
Example using iter.next()
:
let iter = client.listAlertConfigs(detectionConfigurationId);
let result = await iter.next();
while (!result.done) {
console.log(` alert - ${result.value.id}, ${result.value.name}`);
result = await iter.next();
}
Example using byPage()
:
const pages = client.listAlertConfigs(detectionConfigurationId)
.byPage();
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value.alertConfigurations) {
console.log(`-- page ${i++}`);
for (const alert of page.value) {
console.log(`${alert}`);
}
}
page = await pages.next();
}
function listAlertConfigs(detectionConfigId: string, options?: OperationOptions): PagedAsyncIterableIterator<AnomalyAlertConfiguration, AlertConfigurationsPageResponse, undefined>
Parameters
- detectionConfigId
-
string
anomaly detection configuration unique id
- options
- OperationOptions
The options parameter.
Returns
listDataFeedIngestionStatus(string, string | Date, string | Date, ListDataFeedIngestionStatusOptions)
Returns an async iterable iterator to list data feed ingestion status based on options
.byPage()
returns an async iterable iterator to list the data feed ingestion status in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const ingestionStatusList = client.listDataFeedIngestionStatus(dataFeedId);
let i = 1;
for await (const ingestionStatus of ingestionStatusList){
console.log(`ingestionStatus ${i++}:`);
console.log(ingestionStatus);
}
Example using iter.next()
:
let iter = client.listDataFeedIngestionStatus(dataFeedId);
let result = await iter.next();
while (!result.done) {
console.log(` anomaly - ${result.value.timestamp}, ${result.value.status}, ${result.value.mesage}`);
result = await iter.next();
}
Example using byPage()
:
const pages = client.listDataFeedIngestionStatus(dataFeedId).byPage({ maxPageSize: 2 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const status of page.value) {
console.log("ingestion status-");
console.dir(status);
}
}
page = await pages.next();
}
function listDataFeedIngestionStatus(dataFeedId: string, startTime: string | Date, endTime: string | Date, options?: ListDataFeedIngestionStatusOptions): PagedAsyncIterableIterator<IngestionStatus, IngestionStatusPageResponse, PageSettings>
Parameters
- dataFeedId
-
string
data feed id for list of data feed ingestion status
- startTime
-
string | Date
The start point of time range to query data ingestion status
- endTime
-
string | Date
The end point of time range to query data ingestion status
The options parameter.
Returns
listDataFeeds(ListDataFeedsOptions)
Returns an async iterable iterator to list data feeds based on options
.byPage()
returns an async iterable iterator to list the blobs in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const dataFeedList = client.listDataFeeds({
filter: { // filter
dataFeedName: "js-blob-datafeed"
}
});
let i = 1;
for await (const datafeed of dataFeedList){
console.log(`datafeed ${i++}:`);
console.log(datafeed);
}
Example using iter.next()
:
let iter = client.listDataFeeds();
let dataFeedItem = await iter.next();
while (!dataFeedItem.done) {
console.log(`id :${dataFeedItem.value.id}, name: ${dataFeedItem.value.name}`);
dataFeedItem = await iter.next();
}
Example using byPage()
:
const pages = client.listDataFeeds().byPage({ maxPageSize: 10 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const feed of page.value) {
console.log(` ${feed.id} - ${feed.name}`);
}
}
page = await pages.next();
}
function listDataFeeds(options?: ListDataFeedsOptions): PagedAsyncIterableIterator<MetricsAdvisorDataFeed, DataFeedsPageResponse, PageSettings>
Parameters
- options
- ListDataFeedsOptions
The options parameter.
Returns
listDataSourceCredential(ListDataSourceCredentialsOptions)
Returns an async iterable iterator to list data source credentials based on options
.byPage()
returns an async iterable iterator to list the credentials in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const dataSourceCredentialList = client.listDataSourceCredential();
let i = 1;
for await (const dataSourceCredential of dataSourceCredentialList){
console.log(`dataSourceCredential ${i++}:`);
console.log(dataSourceCredential);
}
Example using iter.next()
:
let iter = client.listDataSourceCredential();
let result = await iter.next();
while (!result.done) {
console.dir(result);
result = await iter.next();
}
Example using byPage()
:
const pages = client.listDataSourceCredential().byPage({ maxPageSize: 2 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const credential of page.value) {
console.log("dataSource credential-");
console.dir(credential);
}
}
page = await pages.next();
}
function listDataSourceCredential(options?: ListDataSourceCredentialsOptions): PagedAsyncIterableIterator<DataSourceCredentialEntityUnion, CredentialsPageResponse, PageSettings>
Parameters
- options
- ListDataSourceCredentialsOptions
Returns
listDetectionConfigs(string, OperationOptions)
Returns an async iterable iterator to list anomaly detection configurations based on options
.byPage()
returns an async iterable iterator to list the anomaly detection configurations in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const anomalyDetectionList = client.listDetectionConfigs(metricId);
let i = 1;
for await (const anomaly of anomalyDetectionList){
console.log(`anomaly ${i++}:`);
console.log(anomaly);
}
Example using iter.next()
:
let iter = client.listDetectionConfigs(metricId);
let result = await iter.next();
while (!result.done) {
console.log(` anomaly - ${result.value.id}, ${result.value.name}`);
result = await iter.next();
}
Example using byPage()
:
const pages = client.listDetectionConfigs(metricId)
.byPage();
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const detectionConfiguration of page.value) {
console.log("detection configuration-");
console.dir(detectionConfiguration);
}
}
page = await pages.next();
}
function listDetectionConfigs(metricId: string, options?: OperationOptions): PagedAsyncIterableIterator<AnomalyDetectionConfiguration, DetectionConfigurationsPageResponse, undefined>
Parameters
- metricId
-
string
metric id for list of anomaly detection configurations
- options
- OperationOptions
The options parameter.
Returns
listHooks(ListHooksOptions)
Returns an async iterable iterator to list hooks based on options
.byPage()
returns an async iterable iterator to list the hooks in pages.
Example using for await
syntax:
const client = new MetricsAdvisorAdministrationClient(endpoint,
new MetricsAdvisorKeyCredential(subscriptionKey, apiKey));
const hookList = client.listHooks();
let i = 1;
for await (const hook of hookList){
console.log(`hook ${i++}:`);
console.log(hook);
}
Example using iter.next()
:
let iter = client.listHooks();
let result = await iter.next();
while (!result.done) {
console.log(` hook - ${result.value.id}`);
result = await iter.next();
}
Example using byPage()
:
const pages = client.listHooks().byPage({ maxPageSize: 2 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const hook of page.value) {
console.log("hook-");
console.dir(hook);
}
}
page = await pages.next();
}
function listHooks(options?: ListHooksOptions): PagedAsyncIterableIterator<NotificationHookUnion, HooksPageResponse, PageSettings>
Parameters
- options
- ListHooksOptions
The options parameter.
Returns
refreshDataFeedIngestion(string, string | Date, string | Date, OperationOptions)
Refreshes or resets data feed ingestion progress for the given data feed id
function refreshDataFeedIngestion(dataFeedId: string, startTime: string | Date, endTime: string | Date, options?: OperationOptions): Promise<RestResponse>
Parameters
- dataFeedId
-
string
The data feed id for the ingestion progress to refresh or reset
- startTime
-
string | Date
The start point of time range to query data ingestion status
- endTime
-
string | Date
The end point of time range to query data ingestion status
- options
- OperationOptions
The options parameter.
Returns
Promise<RestResponse>
updateAlertConfig(string, Partial<Omit<AnomalyAlertConfiguration, "id">>, OperationOptions)
Updates an anomaly alert configuration for the given configuration id
function updateAlertConfig(id: string, patch: Partial<Omit<AnomalyAlertConfiguration, "id">>, options?: OperationOptions): Promise<AnomalyAlertConfiguration>
Parameters
- id
-
string
id of the anomaly alert configuration to update
- patch
-
Partial<Omit<AnomalyAlertConfiguration, "id">>
Input to the update anomaly alert configuration operation
- options
- OperationOptions
The options parameter
Returns
Promise<AnomalyAlertConfiguration>
updateDataFeed(string, DataFeedPatch, OperationOptions)
Updates a data feed given its id
function updateDataFeed(dataFeedId: string, patch: DataFeedPatch, options?: OperationOptions): Promise<MetricsAdvisorDataFeed>
Parameters
- dataFeedId
-
string
id of the data feed to update
- patch
- DataFeedPatch
Input to the update data feed operation DataFeedPatch
- options
- OperationOptions
The options parameter.
Returns
Promise<MetricsAdvisorDataFeed>
updateDataSourceCredential(string, DataSourceCredentialPatch, OperationOptions)
Updates data source credential for the given id
function updateDataSourceCredential(id: string, patch: DataSourceCredentialPatch, options?: OperationOptions): Promise<DataSourceCredentialEntityUnion>
Parameters
- id
-
string
id of the credential entity to update
Input to the update credential entity operation DataSourceCredentialPatch
- options
- OperationOptions
The options parameter
Returns
Promise<DataSourceCredentialEntityUnion>
updateDetectionConfig(string, AnomalyDetectionConfigurationPatch, OperationOptions)
Updates a metric anomaly detection configuration for the given configuration id
function updateDetectionConfig(id: string, patch: AnomalyDetectionConfigurationPatch, options?: OperationOptions): Promise<AnomalyDetectionConfiguration>
Parameters
- id
-
string
id of the detection configuration for metric anomaly to update
Input to the update anomaly detection configuration operation AnomalyDetectionConfigurationPatch
- options
- OperationOptions
The options parameter.
Returns
Promise<AnomalyDetectionConfiguration>
updateHook(string, EmailNotificationHookPatch | WebNotificationHookPatch, OperationOptions)
Updates hook for the given hook id
function updateHook(id: string, patch: EmailNotificationHookPatch | WebNotificationHookPatch, options?: OperationOptions): Promise<NotificationHookUnion>
Parameters
- id
-
string
id of the hook to update
Input to the update hook of type Email EmailNotificationHookPatch or WebHook <xref:WebhookNotificationHookPatch>
- options
- OperationOptions
The options parameter
Returns
Promise<NotificationHookUnion>