From 42c20e66eb874935a315132e64ce398904c97f42 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Tue, 29 Jun 2021 13:34:46 -0700 Subject: [PATCH 01/11] fix the query parameter with a space rather than nbsp --- .../ai-metrics-advisor/test/public/datafeed.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts index 1158bf677da6..b2e890befd55 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts @@ -377,7 +377,7 @@ matrix([[true, false]] as const, async (useAad) => { applicationId: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID, apiKey: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_API_KEY, query: - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" }; const actual = await client.createDataFeed({ name: appInsightsFeedName, @@ -400,7 +400,7 @@ matrix([[true, false]] as const, async (useAad) => { assert.equal(actual.source.apiKey, undefined); assert.equal( actual.source.query, - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" ); } }); From c45d35f796912eb1fcd412e972fe9308737033c7 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Tue, 29 Jun 2021 16:48:23 -0700 Subject: [PATCH 02/11] required and non-required types --- .../review/ai-metrics-advisor.api.md | 18 ++--- .../ai-metrics-advisor/src/models.ts | 76 ++++++++++++------- .../ai-metrics-advisor/src/transforms.ts | 14 +--- .../test/public/datafeed.spec.ts | 10 ++- 4 files changed, 69 insertions(+), 49 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md b/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md index 0e7c07d847a3..55e95412313e 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/review/ai-metrics-advisor.api.md @@ -107,7 +107,7 @@ export type AzureApplicationInsightsDataFeedSource = { // @public export type AzureBlobDataFeedSource = { dataSourceType: "AzureBlob"; - connectionString: string; + connectionString?: string; container: string; blobTemplate: string; authenticationType: "Basic" | "ManagedIdentity"; @@ -151,7 +151,7 @@ export type AzureDataExplorerAuthTypes = AzureDataExplorerAuthBasic | AzureDataE // @public export type AzureDataExplorerDataFeedSource = { dataSourceType: "AzureDataExplorer"; - connectionString: string; + connectionString?: string; query: string; } & AzureDataExplorerAuthTypes; @@ -181,9 +181,6 @@ export type AzureLogAnalyticsAuthTypes = LogAnalyticsAuthBasic | LogAnalyticsAut // @public export type AzureLogAnalyticsDataFeedSource = { dataSourceType: "AzureLogAnalytics"; - tenantId?: string; - clientId?: string; - clientSecret?: string; workspaceId: string; query: string; } & AzureLogAnalyticsAuthTypes; @@ -191,7 +188,7 @@ export type AzureLogAnalyticsDataFeedSource = { // @public export type AzureTableDataFeedSource = { dataSourceType: "AzureTable"; - connectionString: string; + connectionString?: string; table: string; query: string; authenticationType: "Basic"; @@ -335,7 +332,7 @@ export type DataFeedStatus = "Paused" | "Active"; // @public export type DataLakeStorageGen2AuthBasic = { authenticationType: "Basic"; - accountKey: string; + accountKey?: string; }; // @public @@ -609,7 +606,7 @@ export type InfluxDbDataFeedSource = { connectionString: string; database: string; userName: string; - password: string; + password?: string; query: string; authenticationType: "Basic"; }; @@ -722,6 +719,9 @@ export interface ListMetricSeriesDefinitionsOptions extends OperationOptions { // @public export type LogAnalyticsAuthBasic = { authenticationType: "Basic"; + tenantId: string; + clientId: string; + clientSecret?: string; }; // @public @@ -996,7 +996,7 @@ export type MetricSingleSeriesDetectionCondition = DetectionConditionsCommon & { // @public export type MongoDbDataFeedSource = { dataSourceType: "MongoDB"; - connectionString: string; + connectionString?: string; database: string; command: string; authenticationType: "Basic"; diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts index 78fcda2c5ef8..984848861316 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts @@ -275,14 +275,16 @@ export type MetricsAdvisorDataFeed = { /** * Represents an Azure Application Insights data source. + * User is required to specify azureCloud, applicationId and apiKey for Create. + * apiKey being a secret is not returned by service. */ export type AzureApplicationInsightsDataFeedSource = { dataSourceType: "AzureApplicationInsights"; - /** The Azure cloud that this Azure Application Insights in */ + /** The Azure cloud that this Azure Application Insights in. Required by user for Create*/ azureCloud?: string; - /** The application id of this Azure Application Insights */ + /** The application id of this Azure Application Insights. Required by user for Create*/ applicationId?: string; - /** The API Key that can access this Azure Application Insights */ + /** The API Key that can access this Azure Application Insights. Required by user for Create. Not returned by service */ apiKey?: string; /** The statement to query this Azure Application Insights */ query: string; @@ -292,11 +294,13 @@ export type AzureApplicationInsightsDataFeedSource = { /** * Represents an Azure Blob Storage data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type AzureBlobDataFeedSource = { dataSourceType: "AzureBlob"; - /** Azure Blob connection string */ - connectionString: string; + /** Azure Blob connection string. Required by user for Create. Not returned by service */ + connectionString?: string; /** Container */ container: string; /** Blob Template */ @@ -307,10 +311,12 @@ export type AzureBlobDataFeedSource = { /** * Represents an Azure CosmosDB data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type AzureCosmosDbDataFeedSource = { dataSourceType: "AzureCosmosDB"; - /** The connection string of this Azure CosmosDB */ + /** The connection string of this Azure CosmosDB. Required by user for Create. Not returned by service */ connectionString?: string; /** The statement to query this collection */ sqlQuery: string; @@ -368,24 +374,28 @@ export type AzureDataExplorerAuthTypes = | AzureDataExplorerAuthServicePrincipalInKeyVault; /** * Represents an Azure Data Explorer data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type AzureDataExplorerDataFeedSource = { /** Azure Data Explorer Data Source */ dataSourceType: "AzureDataExplorer"; - /** Database connection string */ - connectionString: string; + /** Database connection string. Required by user for Create. Not returned by service */ + connectionString?: string; /** Query script */ query: string; } & AzureDataExplorerAuthTypes; /** * Represents Basic Authentication Type for Azure DataLake Storage Gen2 Source + * User is required to specify accountKey for Create with Basic type. + * accountKey being a secret is not returned by service. */ export type DataLakeStorageGen2AuthBasic = { /** Authentication */ authenticationType: "Basic"; - /** Account key */ - accountKey: string; + /** Account key. Required by user for Create. Not returned by service */ + accountKey?: string; }; /** @@ -454,12 +464,14 @@ export type AzureDataLakeStorageGen2DataFeedSource = { /** * Represents an Azure Table data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type AzureTableDataFeedSource = { /** Azure Table data Source type */ dataSourceType: "AzureTable"; - /** Azure Table connection string */ - connectionString: string; + /** Azure Table connection string. Required by user for Create. Not returned by service */ + connectionString?: string; /** Table name */ table: string; /** Query script */ @@ -469,11 +481,19 @@ export type AzureTableDataFeedSource = { }; /** - * Represents Basic Authentication Type for Azure Log Analytics Source + * Represents Basic Authentication Type for Azure Log Analytics Source. + * User is required to specify clientSecret for Create with Basic type. + * clientSecret being a secret will not be returned by the service. */ export type LogAnalyticsAuthBasic = { /** Authentication */ authenticationType: "Basic"; + /** The tenant id of service principal that have access to this Log Analytics */ + tenantId: string; + /** The client id of service principal that have access to this Log Analytics. */ + clientId: string; + /** The client secret of service principal that have access to this Log Analytics. Required by user for Create. Not returned by service*/ + clientSecret?: string; }; /** @@ -509,12 +529,6 @@ export type AzureLogAnalyticsAuthTypes = */ export type AzureLogAnalyticsDataFeedSource = { dataSourceType: "AzureLogAnalytics"; - /** The tenant id of service principal that have access to this Log Analytics */ - tenantId?: string; - /** The client id of service principal that have access to this Log Analytics */ - clientId?: string; - /** The client secret of service principal that have access to this Log Analytics */ - clientSecret?: string; /** The workspace id of this Log Analytics */ workspaceId: string; /** The KQL (Kusto Query Language) query to fetch data from this Log Analytics */ @@ -523,11 +537,13 @@ export type AzureLogAnalyticsDataFeedSource = { /** * Represents an Azure Event Hubs data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type AzureEventHubsDataFeedSource = { /** Azure Event Hubs data source type */ dataSourceType: "AzureEventHubs"; - /** The connection string of this Azure Event Hubs */ + /** The connection string of this Azure Event Hubs. Required by user for Create. Not returned by service */ connectionString?: string; /** The consumer group to be used in this data feed */ consumerGroup: string; @@ -537,6 +553,8 @@ export type AzureEventHubsDataFeedSource = { /** * Represents an InfluxDB data source. + * User is required to specify password for Create. + * password being a secret is not returned by service. */ export type InfluxDbDataFeedSource = { /** InfluxDB data source type */ @@ -547,8 +565,8 @@ export type InfluxDbDataFeedSource = { database: string; /** Database access user */ userName: string; - /** Database access password */ - password: string; + /** Database access password. Required by user for Create. Not returned by service */ + password?: string; /** Query script */ query: string; /** Authentication type */ @@ -557,11 +575,13 @@ export type InfluxDbDataFeedSource = { /** * Represents a MySQL data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type MySqlDataFeedSource = { /** MySql data source */ dataSourceType: "MySql"; - /** Database connection string */ + /** Database connection string. Required by user for Create. Not returned by service */ connectionString?: string; /** Query script */ query: string; @@ -571,11 +591,13 @@ export type MySqlDataFeedSource = { /** * Represents a PostgreSQL data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type PostgreSqlDataFeedSource = { /** PostgreSQL data source */ dataSourceType: "PostgreSql"; - /** Database connection string */ + /** Database connection string. Required by user for Create. Not returned by service */ connectionString?: string; /** Query script */ query: string; @@ -585,12 +607,14 @@ export type PostgreSqlDataFeedSource = { /** * Represents a MongoDB data source. + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export type MongoDbDataFeedSource = { /** MongoDB data source */ dataSourceType: "MongoDB"; - /** MongoDB connection string */ - connectionString: string; + /** MongoDB connection string. Required by user for Create. Not returned by service */ + connectionString?: string; /** Database name */ database: string; /** Query script */ diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts index 6119119d5e3e..68e0225b728a 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/transforms.ts @@ -548,8 +548,8 @@ export function toServiceDataFeedSource( return { dataSourceType: "AzureLogAnalytics", dataSourceParameter: { - tenantId: source.tenantId!, - clientId: source.clientId!, + tenantId: source.tenantId, + clientId: source.clientId, clientSecret: source.clientSecret!, workspaceId: source.workspaceId, query: source.query @@ -560,9 +560,6 @@ export function toServiceDataFeedSource( return { dataSourceType: "AzureLogAnalytics", dataSourceParameter: { - tenantId: source.tenantId!, - clientId: source.clientId!, - clientSecret: source.clientSecret!, workspaceId: source.workspaceId, query: source.query }, @@ -827,9 +824,6 @@ export function toServiceDataFeedSourcePatch( return { dataSourceType: "AzureLogAnalytics", dataSourceParameter: { - tenantId: source.tenantId, - clientId: source.clientId, - clientSecret: source.clientSecret, workspaceId: source.workspaceId, query: source.query! }, @@ -1183,9 +1177,9 @@ export function fromServiceDataFeedDetailUnion( ...common, source: { dataSourceType: "AzureLogAnalytics", - clientId: orig14.dataSourceParameter.clientId, + clientId: orig14.dataSourceParameter.clientId!, clientSecret: orig14.dataSourceParameter.clientSecret, - tenantId: orig14.dataSourceParameter.tenantId, + tenantId: orig14.dataSourceParameter.tenantId!, query: orig14.dataSourceParameter.query, workspaceId: orig14.dataSourceParameter.workspaceId, authenticationType: "Basic" diff --git a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts index b2e890befd55..44963d785108 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts @@ -765,12 +765,14 @@ matrix([[true, false]] as const, async (useAad) => { createdLogAnalyticsId = actual.id; assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); if (actual.source.dataSourceType === "AzureLogAnalytics") { - assert.equal(actual.source.clientId, expectedSource.clientId); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); assert.equal(actual.source.query, expectedSource.query); - assert.equal(actual.source.tenantId, expectedSource.tenantId); assert.equal(actual.source.workspaceId, expectedSource.workspaceId); - assert.equal(actual.source.clientSecret, undefined); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + if (actual.source.authenticationType === "Basic") { + assert.equal(actual.source.tenantId, expectedSource.tenantId); + assert.equal(actual.source.clientId, expectedSource.clientId); + assert.equal(actual.source.clientSecret, undefined); + } } }); From 81f63cf6eccffcced7ee70bb90cb65fbf16c9a6e Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Tue, 29 Jun 2021 17:08:28 -0700 Subject: [PATCH 03/11] required and non-required types --- .../ai-metrics-advisor/src/models.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts index 984848861316..e66c30c46052 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/src/models.ts @@ -1909,33 +1909,39 @@ export interface DataSourceCredentialEntity { /** * SqlServer Data Source Credential + * User is required to specify connectionString for Create. + * connectionString being a secret is not returned by service. */ export interface DataSourceSqlConnectionString extends DataSourceCredentialEntity { /** Azure Sql Connection String credential */ type: "AzureSQLConnectionString"; - /** The connection string for SqlServer Data Source Credential */ + /** The connection string for SqlServer Data Source Credential. Required by user for Create. Not returned by service. */ connectionString?: string; } /** * DataLake Gen2 Shared Key DataSource Credential + * User is required to specify accountKey for Create. + * accountKey being a secret is not returned by service. */ export interface DataSourceDataLakeGen2SharedKey extends DataSourceCredentialEntity { /** DataLakeGen2 Shared Key DataSource credential */ type: "DataLakeGen2SharedKey"; - /** The account key of the DataLake Gen2 Shared Key DataSource Credential */ + /** The account key of the DataLake Gen2 Shared Key DataSource Credential. Required by user for Create. Not returned by service. */ accountKey?: string; } /** * Service Principal DataSource Credential + * User is required to specify clientSecret for Create. + * clientSecret being a secret is not returned by service. */ export interface DataSourceServicePrincipal extends DataSourceCredentialEntity { /** Service Principal DataSource Credential */ type: "ServicePrincipal"; /** The client id of the service principal. */ clientId: string; - /** The client secret of the service principal. */ + /** The client secret of the service principal. Required by user for Create. Not returned by service. */ clientSecret?: string; /** The tenant id of the service principal. */ tenantId: string; @@ -1943,6 +1949,8 @@ export interface DataSourceServicePrincipal extends DataSourceCredentialEntity { /** * Service Principal in KeyVault DataSource Credential + * User is required to specify keyVaultClientSecret for Create. + * keyVaultClientSecret being a secret is not returned by service. */ export interface DataSourceServicePrincipalInKeyVault extends DataSourceCredentialEntity { /** Service Principal in KeyVault DataSource Credential */ @@ -1951,7 +1959,7 @@ export interface DataSourceServicePrincipalInKeyVault extends DataSourceCredenti keyVaultEndpoint: string; /** The Client Id to access the Key Vault. */ keyVaultClientId: string; - /** The Client Secret to access the Key Vault. */ + /** The Client Secret to access the Key Vault. Required by user for Create. Not returned by service. */ keyVaultClientSecret?: string; /** The secret name of the service principal's client Id in the Key Vault. */ servicePrincipalIdNameInKV: string; From 9af1328ccd412cc29f66e68457420d5a7d2f9d5e Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 10:59:45 -0700 Subject: [PATCH 04/11] enable eventhub tests --- ...recording_creates_eventhubs_data_feed.json | 83 + ...recording_deletes_eventhubs_data_feed.json | 68 + ...recording_creates_eventhubs_data_feed.json | 59 + ...recording_deletes_eventhubs_data_feed.json | 44 + .../recording_creates_eventhubs_data_feed.js | 36 +- .../recording_deletes_eventhubs_data_feed.js | 28 +- .../recording_creates_eventhubs_data_feed.js | 26 +- .../recording_deletes_eventhubs_data_feed.js | 20 +- .../test/public/datafeed.spec.ts | 1587 +++++++++-------- 9 files changed, 1109 insertions(+), 842 deletions(-) create mode 100644 sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json create mode 100644 sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json create mode 100644 sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json create mode 100644 sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json new file mode 100644 index 000000000000..4dceee477748 --- /dev/null +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json @@ -0,0 +1,83 @@ +{ + "recordings": [ + { + "method": "POST", + "url": "https://login.microsoftonline.com/azure_tenant_id/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1331", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:18:39 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.11829.9 - SCUS ProdSlices", + "x-ms-request-id": "3f8c4ad6-0330-42f6-a047-a3eb51d04401" + } + }, + { + "method": "POST", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", + "query": {}, + "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-httpRequestFeed-162501231972906997\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", + "status": 201, + "response": "", + "responseHeaders": { + "apim-request-id": "a09a58e2-911c-4a13-8596-c5e0548b0d14", + "content-length": "0", + "date": "Wed, 30 Jun 2021 00:18:47 GMT", + "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "7225", + "x-request-id": "a09a58e2-911c-4a13-8596-c5e0548b0d14" + } + }, + { + "method": "GET", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "query": {}, + "requestBody": null, + "status": 200, + "response": "{\"dataFeedId\":\"a362818a-af39-45eb-af98-6b529b5f8150\",\"dataFeedName\":\"js-test-httpRequestFeed-162501231972906997\",\"metrics\":[{\"metricId\":\"f4df58ce-d0ab-45c4-ae17-ad77953d0c4f\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"4c7e3776-2ecf-4980-a808-018c7fdd4489\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"azure_client_id\"],\"viewers\":[],\"creator\":\"azure_client_id\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T00:18:47Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", + "responseHeaders": { + "apim-request-id": "e3a71b66-3e8d-40d9-b8dc-68b9ba132bf3", + "content-length": "1263", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:18:53 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5386", + "x-request-id": "e3a71b66-3e8d-40d9-b8dc-68b9ba132bf3" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "js-test-datafeed-": "js-test-datafeed-162501231972905455", + "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162501231972908093", + "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162501231972907287", + "js-test-cosmosFeed-": "js-test-cosmosFeed-162501231972908784", + "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162501231972906258", + "js-test-tableFeed-": "js-test-tableFeed-162501231972908470", + "js-test-httpRequestFeed-": "js-test-httpRequestFeed-162501231972906997", + "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162501231972908386", + "js-test-influxdbFeed-": "js-test-influxdbFeed-162501231972901554", + "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162501231972905000", + "js-test-mySqlFeed-": "js-test-mySqlFeed-162501231972904087", + "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162501231972901759", + "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162501231972904681" + }, + "newDate": {} + }, + "hash": "193729b4ee398f057de645b773a9512c" +} \ No newline at end of file diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json new file mode 100644 index 000000000000..d9d6ad167d76 --- /dev/null +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json @@ -0,0 +1,68 @@ +{ + "recordings": [ + { + "method": "POST", + "url": "https://login.microsoftonline.com/azure_tenant_id/oauth2/v2.0/token", + "query": {}, + "requestBody": "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F", + "status": 200, + "response": "{\"token_type\":\"Bearer\",\"expires_in\":86399,\"ext_expires_in\":86399,\"access_token\":\"access_token\"}", + "responseHeaders": { + "cache-control": "no-store, no-cache", + "content-length": "1331", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:18:53 GMT", + "expires": "-1", + "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", + "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", + "pragma": "no-cache", + "referrer-policy": "strict-origin-when-cross-origin", + "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-content-type-options": "nosniff", + "x-ms-ests-server": "2.1.11829.9 - EUS ProdSlices", + "x-ms-request-id": "d73b252a-2785-40ab-b01c-235295dd4601" + } + }, + { + "method": "DELETE", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "query": {}, + "requestBody": null, + "status": 204, + "response": "", + "responseHeaders": { + "apim-request-id": "42ce3ffc-7532-4956-8a1d-5b03fb06e124", + "content-length": "0", + "date": "Wed, 30 Jun 2021 00:18:59 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5964", + "x-request-id": "42ce3ffc-7532-4956-8a1d-5b03fb06e124" + } + }, + { + "method": "GET", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "query": {}, + "requestBody": null, + "status": 404, + "response": "{\"code\":\"404 NOT_FOUND\",\"message\":\"datafeedId is invalid.\"}", + "responseHeaders": { + "apim-request-id": "77f374e1-0c61-4f87-915c-522305ee23b3", + "content-length": "59", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:19:05 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5139", + "x-request-id": "77f374e1-0c61-4f87-915c-522305ee23b3" + } + } + ], + "uniqueTestInfo": { + "uniqueName": {}, + "newDate": {} + }, + "hash": "837ec7dcecd206f678d26092d380036b" +} \ No newline at end of file diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json new file mode 100644 index 000000000000..fb69c439dca0 --- /dev/null +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json @@ -0,0 +1,59 @@ +{ + "recordings": [ + { + "method": "POST", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", + "query": {}, + "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-httpRequestFeed-162501234543306266\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", + "status": 201, + "response": "", + "responseHeaders": { + "apim-request-id": "5679a89e-ad78-49fb-ab6a-c87ce4612640", + "content-length": "0", + "date": "Wed, 30 Jun 2021 00:19:12 GMT", + "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "7294", + "x-request-id": "5679a89e-ad78-49fb-ab6a-c87ce4612640" + } + }, + { + "method": "GET", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "query": {}, + "requestBody": null, + "status": 200, + "response": "{\"dataFeedId\":\"d014ae47-7dc7-4089-a2e6-6d0f5eb95000\",\"dataFeedName\":\"js-test-httpRequestFeed-162501234543306266\",\"metrics\":[{\"metricId\":\"54b3d024-6860-407c-aa35-f7dff05dddcc\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"1b60509a-9e6a-466f-bcbf-b5a52c208732\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"kaghiya@microsoft.com\"],\"viewers\":[],\"creator\":\"kaghiya@microsoft.com\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T00:19:12Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", + "responseHeaders": { + "apim-request-id": "6f0e52d2-6723-4d00-8d1e-3084bc3da5af", + "content-length": "1233", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:19:17 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5473", + "x-request-id": "6f0e52d2-6723-4d00-8d1e-3084bc3da5af" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "js-test-datafeed-": "js-test-datafeed-162501234543306421", + "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162501234543300868", + "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162501234543301861", + "js-test-cosmosFeed-": "js-test-cosmosFeed-162501234543300197", + "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162501234543305973", + "js-test-tableFeed-": "js-test-tableFeed-162501234543305847", + "js-test-httpRequestFeed-": "js-test-httpRequestFeed-162501234543306266", + "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162501234543307504", + "js-test-influxdbFeed-": "js-test-influxdbFeed-162501234543300179", + "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162501234543304941", + "js-test-mySqlFeed-": "js-test-mySqlFeed-162501234543307091", + "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162501234543303230", + "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162501234543308809" + }, + "newDate": {} + }, + "hash": "193729b4ee398f057de645b773a9512c" +} \ No newline at end of file diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json new file mode 100644 index 000000000000..182f8703232f --- /dev/null +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json @@ -0,0 +1,44 @@ +{ + "recordings": [ + { + "method": "DELETE", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "query": {}, + "requestBody": null, + "status": 204, + "response": "", + "responseHeaders": { + "apim-request-id": "6a7476c1-6874-4450-9dbd-d319c98c7565", + "content-length": "0", + "date": "Wed, 30 Jun 2021 00:19:18 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "962", + "x-request-id": "6a7476c1-6874-4450-9dbd-d319c98c7565" + } + }, + { + "method": "GET", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "query": {}, + "requestBody": null, + "status": 404, + "response": "{\"code\":\"404 NOT_FOUND\",\"message\":\"datafeedId is invalid.\"}", + "responseHeaders": { + "apim-request-id": "466d7228-789b-4d13-8a53-084d9c2bb618", + "content-length": "59", + "content-type": "application/json; charset=utf-8", + "date": "Wed, 30 Jun 2021 00:19:23 GMT", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "x-content-type-options": "nosniff", + "x-envoy-upstream-service-time": "5212", + "x-request-id": "466d7228-789b-4d13-8a53-084d9c2bb618" + } + } + ], + "uniqueTestInfo": { + "uniqueName": {}, + "newDate": {} + }, + "hash": "837ec7dcecd206f678d26092d380036b" +} \ No newline at end of file diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index 99351b5eda14..5693cdadeb55 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,10 +2,10 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162456611703607360","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162456611703602601","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162456611703605931","js-test-cosmosFeed-":"js-test-cosmosFeed-162456611703606158","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162456611703605594","js-test-tableFeed-":"js-test-tableFeed-162456611703601948","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162456611703601598","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162456611703605729","js-test-influxdbFeed-":"js-test-influxdbFeed-162456611703608797","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162456611703608062","js-test-mySqlFeed-":"js-test-mySqlFeed-162456611703601892","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162456611703605513","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162456611703602792"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162501549374303385","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162501549374407055","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162501549374409372","js-test-cosmosFeed-":"js-test-cosmosFeed-162501549374404583","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162501549374402830","js-test-tableFeed-":"js-test-tableFeed-162501549374403013","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162501549374403874","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162501549374401328","js-test-influxdbFeed-":"js-test-influxdbFeed-162501549374405767","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162501549374400492","js-test-mySqlFeed-":"js-test-mySqlFeed-162501549374400512","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162501549374405259","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162501549374404453"},"newDate":{}} nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fcognitiveservices.azure.com%2F.default") + .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -22,59 +22,59 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '0825421b-0412-4892-9d10-18085d133a00', + '6b9f087b-20b0-4ee8-94bc-bb82a26afd00', 'x-ms-ests-server', - '2.1.11829.9 - SCUS ProdSlices', + '2.1.11829.9 - WUS2 ProdSlices', 'Set-Cookie', - 'fpc=Ap4NeeLKqOpIlcTRHUTrwPfGLH8mAQAAAGXgZtgOAAAA; expires=Sat, 24-Jul-2021 20:21:57 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AmwyupDbd-tMrRR11faNSarGLH8mAQAAAMa7bdgOAAAA; expires=Fri, 30-Jul-2021 01:11:34 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Thu, 24 Jun 2021 20:21:56 GMT', + 'Wed, 30 Jun 2021 01:11:34 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162456611703601598","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162501549374403874","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/1409ab03-d455-465e-9df0-ef5db2cdb961', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db', 'x-request-id', - 'bf8ce3d4-e4ca-4825-9222-40ab47422d30', + '6b6026e1-388f-4ea2-9b45-422623e55dce', 'x-envoy-upstream-service-time', - '7340', + '7082', 'apim-request-id', - 'bf8ce3d4-e4ca-4825-9222-40ab47422d30', + '6b6026e1-388f-4ea2-9b45-422623e55dce', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:04 GMT' + 'Wed, 30 Jun 2021 01:11:42 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/1409ab03-d455-465e-9df0-ef5db2cdb961') - .reply(200, {"dataFeedId":"1409ab03-d455-465e-9df0-ef5db2cdb961","dataFeedName":"js-test-httpRequestFeed-162456611703601598","metrics":[{"metricId":"5b7c65ed-5f79-4281-a53d-631edc294f9a","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"6e9f6865-afa0-4524-831d-ed620e6fa5a9","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-24T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-24T20:22:04Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') + .reply(200, {"dataFeedId":"c10dc263-1583-45f7-826c-84fcb87261db","dataFeedName":"js-test-httpRequestFeed-162501549374403874","metrics":[{"metricId":"cc2d8af3-00d5-4099-a845-8b0061d4190a","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"dda000dc-2f75-422d-9a93-3064d0fcdac9","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-30T01:11:42Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', '1263', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '9af44072-c58d-46ca-86a7-bab9d1e12f52', + '96fce0e9-d1a3-451f-80dc-9ee81042275e', 'x-envoy-upstream-service-time', - '5334', + '400', 'apim-request-id', - '9af44072-c58d-46ca-86a7-bab9d1e12f52', + '96fce0e9-d1a3-451f-80dc-9ee81042275e', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:10 GMT' + 'Wed, 30 Jun 2021 01:11:43 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index 4dc578def2db..11a25eb3138c 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -5,7 +5,7 @@ module.exports.hash = "3b26ef694bf46025b536723153ef1756"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fcognitiveservices.azure.com%2F.default") + .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F") .reply(200, {"token_type":"Bearer","expires_in":86399,"ext_expires_in":86399,"access_token":"access_token"}, [ 'Cache-Control', 'no-store, no-cache', @@ -22,57 +22,57 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'e26d6036-8ed7-4299-8775-58c73aa43600', + 'a0a245b3-b5a2-4f30-a34b-ea9d1e841a01', 'x-ms-ests-server', '2.1.11829.9 - NCUS ProdSlices', 'Set-Cookie', - 'fpc=Ap4NeeLKqOpIlcTRHUTrwPfGLH8mAgAAAGXgZtgOAAAA; expires=Sat, 24-Jul-2021 20:22:11 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AmwyupDbd-tMrRR11faNSarGLH8mAgAAAMa7bdgOAAAA; expires=Fri, 30-Jul-2021 01:11:43 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Thu, 24 Jun 2021 20:22:10 GMT', + 'Wed, 30 Jun 2021 01:11:42 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/1409ab03-d455-465e-9df0-ef5db2cdb961') + .delete('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '4666cc14-a826-4061-947a-085483e932ac', + '59206ee8-119b-4f1e-b0dc-f3076de8d00b', 'x-envoy-upstream-service-time', - '5984', + '5913', 'apim-request-id', - '4666cc14-a826-4061-947a-085483e932ac', + '59206ee8-119b-4f1e-b0dc-f3076de8d00b', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:16 GMT' + 'Wed, 30 Jun 2021 01:11:49 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/1409ab03-d455-465e-9df0-ef5db2cdb961') + .get('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - 'c3d92522-51c4-4c5b-8b5a-30f3808a3793', + '18d7d916-a070-4217-9da1-50535db163ba', 'x-envoy-upstream-service-time', - '5314', + '5188', 'apim-request-id', - 'c3d92522-51c4-4c5b-8b5a-30f3808a3793', + '18d7d916-a070-4217-9da1-50535db163ba', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:22 GMT' + 'Wed, 30 Jun 2021 01:11:54 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index c2d1cf90604e..22ff2dd49df4 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,46 +2,46 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162456614300300139","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162456614300408925","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162456614300402561","js-test-cosmosFeed-":"js-test-cosmosFeed-162456614300400836","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162456614300402514","js-test-tableFeed-":"js-test-tableFeed-162456614300409086","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162456614300408284","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162456614300401025","js-test-influxdbFeed-":"js-test-influxdbFeed-162456614300401958","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162456614300402402","js-test-mySqlFeed-":"js-test-mySqlFeed-162456614300400971","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162456614300408445","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162456614300400179"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162501551554005490","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162501551554000546","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162501551554009942","js-test-cosmosFeed-":"js-test-cosmosFeed-162501551554005145","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162501551554001135","js-test-tableFeed-":"js-test-tableFeed-162501551554004299","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162501551554000108","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162501551554008257","js-test-influxdbFeed-":"js-test-influxdbFeed-162501551554008797","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162501551554001708","js-test-mySqlFeed-":"js-test-mySqlFeed-162501551554009128","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162501551554007077","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162501551554009182"},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162456614300408284","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162501551554000108","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/49afdaec-205b-4211-8020-56a7458063c2', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0', 'x-request-id', - 'fb26ee74-d492-4354-ae45-99e8253fdfb7', + 'b25da752-9922-4afc-9862-a12bdd1e005a', 'x-envoy-upstream-service-time', - '2233', + '1613', 'apim-request-id', - 'fb26ee74-d492-4354-ae45-99e8253fdfb7', + 'b25da752-9922-4afc-9862-a12bdd1e005a', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:24 GMT' + 'Wed, 30 Jun 2021 01:11:56 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/49afdaec-205b-4211-8020-56a7458063c2') - .reply(200, {"dataFeedId":"49afdaec-205b-4211-8020-56a7458063c2","dataFeedName":"js-test-httpRequestFeed-162456614300408284","metrics":[{"metricId":"f0d89260-9d15-438f-865c-877a65558832","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"05627ee3-091c-4d8c-8263-819e6d689193","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-24T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-24T20:22:24Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') + .reply(200, {"dataFeedId":"f46f05e8-727e-4d5b-b06c-c32568a3b7c0","dataFeedName":"js-test-httpRequestFeed-162501551554000108","metrics":[{"metricId":"9c8b2b1e-e0d8-43f1-97d6-a31a2f1447b2","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"63b175eb-f19d-4d08-9488-95caba4b1d67","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-30T01:11:56Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', '1233', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - 'b8689547-dcd2-4a12-8cfd-7ebf3cf2e8d5', + '4ee58bc0-6688-41e0-ba63-fb564b4a3bf0', 'x-envoy-upstream-service-time', - '500', + '525', 'apim-request-id', - 'b8689547-dcd2-4a12-8cfd-7ebf3cf2e8d5', + '4ee58bc0-6688-41e0-ba63-fb564b4a3bf0', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:25 GMT' + 'Wed, 30 Jun 2021 01:11:57 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index ce36671aa4ea..333f052e1bcc 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -5,41 +5,41 @@ module.exports.hash = "3b26ef694bf46025b536723153ef1756"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/49afdaec-205b-4211-8020-56a7458063c2') + .delete('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '24dfcbc6-ba4c-45b4-9f19-98c141b9c83a', + '7b25fb33-933a-483d-ae16-0f0559ac9b0a', 'x-envoy-upstream-service-time', - '6082', + '6024', 'apim-request-id', - '24dfcbc6-ba4c-45b4-9f19-98c141b9c83a', + '7b25fb33-933a-483d-ae16-0f0559ac9b0a', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:31 GMT' + 'Wed, 30 Jun 2021 01:12:03 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/49afdaec-205b-4211-8020-56a7458063c2') + .get('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - 'b53ca28c-fbaf-4a8c-b738-d26533679f90', + '09e4fefd-c131-4c40-97c3-261d187b6d5e', 'x-envoy-upstream-service-time', - '192', + '278', 'apim-request-id', - 'b53ca28c-fbaf-4a8c-b738-d26533679f90', + '09e4fefd-c131-4c40-97c3-261d187b6d5e', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Thu, 24 Jun 2021 20:22:31 GMT' + 'Wed, 30 Jun 2021 01:12:03 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts index 44963d785108..5a8b3914083c 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts @@ -28,828 +28,778 @@ import { matrix } from "./util/matrix"; matrix([[true, false]] as const, async (useAad) => { describe(`[${useAad ? "AAD" : "API Key"}]`, () => { - describe("MetricsAdvisorAdministrationClient datafeed", () => { - let client: MetricsAdvisorAdministrationClient; - let recorder: Recorder; - let feedName: string; - let appInsightsFeedName: string; - let sqlServerFeedName: string; - let cosmosFeedName: string; - let dataExplorerFeedName: string; - let azureTableFeedName: string; - let eventHubsFeedName: string; - let influxDbFeedName: string; - let mongoDbFeedName: string; - let mySqlFeedName: string; - let postgreSqlFeedName: string; - let datalakeGenFeedName: string; - let logAnalyticsFeedName: string; - - beforeEach(function(this: Context) { - ({ recorder, client } = createRecordedAdminClient(this, makeCredential(useAad))); - if (recorder && !feedName) { - feedName = recorder.getUniqueName("js-test-datafeed-"); - } - if (recorder && !appInsightsFeedName) { - appInsightsFeedName = recorder.getUniqueName("js-test-appInsightsFeed-"); - } - if (recorder && !sqlServerFeedName) { - sqlServerFeedName = recorder.getUniqueName("js-test-sqlServerFeed-"); - } - if (recorder && !cosmosFeedName) { - cosmosFeedName = recorder.getUniqueName("js-test-cosmosFeed-"); - } - if (recorder && !dataExplorerFeedName) { - dataExplorerFeedName = recorder.getUniqueName("js-test-dataExplorerFeed-"); - } - if (recorder && !azureTableFeedName) { - azureTableFeedName = recorder.getUniqueName("js-test-tableFeed-"); - } - if (recorder && !eventHubsFeedName) { - eventHubsFeedName = recorder.getUniqueName("js-test-httpRequestFeed-"); - } - if (recorder && !logAnalyticsFeedName) { - logAnalyticsFeedName = recorder.getUniqueName("js-test-logAnalyticsFeed-"); - } - if (recorder && !influxDbFeedName) { - influxDbFeedName = recorder.getUniqueName("js-test-influxdbFeed-"); - } - if (recorder && !mongoDbFeedName) { - mongoDbFeedName = recorder.getUniqueName("js-test-mongoDbFeed-"); - } - if (recorder && !mySqlFeedName) { - mySqlFeedName = recorder.getUniqueName("js-test-mySqlFeed-"); - } - if (recorder && !postgreSqlFeedName) { - postgreSqlFeedName = recorder.getUniqueName("js-test-postgreSqlFeed-"); - } - if (recorder && !datalakeGenFeedName) { - datalakeGenFeedName = recorder.getUniqueName("js-test-dataLakeGenFeed-"); - } - }); - - afterEach(async function() { - if (recorder) { - await recorder.stop(); - } - }); - - let createdAzureBlobDataFeedId: string; - let createdAppFeedId: string; - let createdSqlServerFeedId: string; - let createdCosmosFeedId: string; - let createdAzureDataExplorerFeedId: string; - let createdAzureTableFeedId: string; - let createdInfluxFeedId: string; - let createdMongoDbFeedId: string; - let createdMySqlFeedId: string; - let createdPostGreSqlId: string; - let createdDataLakeGenId: string; - let createdEventhubsId: string; - let createdLogAnalyticsId: string; - - describe("DataFeed", async () => { - const metric: DataFeedMetric[] = [ - { - name: "cost", - displayName: "cost", - description: "" - }, - { - name: "revenue", - displayName: "revenue", - description: "" + describe + .only("MetricsAdvisorAdministrationClient datafeed", () => { + let client: MetricsAdvisorAdministrationClient; + let recorder: Recorder; + let feedName: string; + let appInsightsFeedName: string; + let sqlServerFeedName: string; + let cosmosFeedName: string; + let dataExplorerFeedName: string; + let azureTableFeedName: string; + let eventHubsFeedName: string; + let influxDbFeedName: string; + let mongoDbFeedName: string; + let mySqlFeedName: string; + let postgreSqlFeedName: string; + let datalakeGenFeedName: string; + let logAnalyticsFeedName: string; + + beforeEach(function(this: Context) { + ({ recorder, client } = createRecordedAdminClient(this, makeCredential(useAad))); + if (recorder && !feedName) { + feedName = recorder.getUniqueName("js-test-datafeed-"); } - ]; - const dimension: DataFeedDimension[] = [ - { name: "category", displayName: "category" }, - { name: "city", displayName: "city" } - ]; - const dataFeedSchema: DataFeedSchema = { - metrics: metric, - dimensions: dimension - }; - const dataFeedIngestion: DataFeedIngestionSettings = { - ingestionStartTime: new Date(Date.UTC(2020, 7, 21)), - ingestionStartOffsetInSeconds: 0, - dataSourceRequestConcurrency: -1, - ingestionRetryDelayInSeconds: -1, - stopRetryAfterInSeconds: -1 - }; - const granularity: DataFeedGranularity = { - granularityType: "Daily" - }; - const rollupSettings: DataFeedRollupSettings = { - rollupType: "AutoRollup", - rollupMethod: "Sum", - rollupIdentificationValue: "__CUSTOM_SUM__" - }; - const options = { - description: "Data feed description", - rollupSettings: rollupSettings, - missingDataPointFillSettings: { - fillType: "CustomValue", - customFillValue: 555 - }, - accessMode: "Private" - }; - - it("creates an Azure Blob datafeed", async () => { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource: DataFeedSource = { - dataSourceType: "AzureBlob", - connectionString: testEnv.METRICS_ADVISOR_AZURE_BLOB_CONNECTION_STRING, - container: "adsample", - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - }; - const expectedSourceByService = ({ - dataSourceType: "AzureBlob", - connectionString: undefined, - container: "adsample", - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - } as unknown) as DataFeedSource; - const feed = { - name: feedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor; - const actual = await client.createDataFeed(feed); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureBlobDataFeedId = actual.id; - - assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); - assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); - assert.equal(actual.name, feedName); - // the service doesn't return sensitive data - assert.deepStrictEqual(actual.source, expectedSourceByService, "Source mismatch!"); - assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); - assert.equal( - actual.schema.metrics[0].name, - dataFeedSchema.metrics[0].name, - "Schema metric 1 name mismatch!" - ); - assert.equal( - actual.schema.metrics[1].name, - dataFeedSchema.metrics[1].name, - "Schema metric 2 name mismatch!" - ); - assert.strictEqual(actual.schema.timestampColumn, "", "Schema timestampColumn mismatch!"); - assert.equal( - actual.schema.dimensions![0].displayName, - dataFeedSchema.dimensions![0].displayName, - "Schema dimension 1 display name mismatch!" - ); - assert.deepStrictEqual( - actual.ingestionSettings, - dataFeedIngestion, - "Ingesting settings mismatch!" - ); - assert.equal( - actual.metricIds[dataFeedSchema.metrics[0].name], - actual.schema.metrics[0].id - ); - - assert.equal(actual.description, options.description, "options.description mismatch"); - assert.equal( - actual.accessMode, - options.accessMode as DataFeedAccessMode, - "options.accessMode mismatch" - ); - assert.ok( - actual.missingDataPointFillSettings, - "Expecting valid options.missingDataPointFillSettings" - ); - assert.equal( - actual.missingDataPointFillSettings!.fillType, - options.missingDataPointFillSettings!.fillType, - "options.missingDataPointFillSettings.fillType mismatch" - ); - assert.ok( - actual.missingDataPointFillSettings!.fillType, - "Expecting valid options.missingDataPointFillSettings.fillType" - ); - if (actual.missingDataPointFillSettings!.fillType! === "CustomValue") { - // not sure why TS didn't narrow down the union type for us...so casting to any - assert.equal( - (actual.missingDataPointFillSettings! as any).customFillValue, - (options.missingDataPointFillSettings! as any).customFillValue, - "options.missingDataPointFillSettings.customFillValue mismatch" - ); + if (recorder && !appInsightsFeedName) { + appInsightsFeedName = recorder.getUniqueName("js-test-appInsightsFeed-"); } - assert.ok(actual.rollupSettings, "Expecting valid options.rollupSettings"); - assert.equal( - actual.rollupSettings!.rollupType, - options.rollupSettings!.rollupType, - "options.missingDataPointFillSettings.rollupType mismatch" - ); - assert.ok( - actual.rollupSettings!.rollupType, - "Expecting valid options.missingDataPointFillSettings.fillType" - ); - if (actual.rollupSettings!.rollupType! === "AutoRollup") { - // not sure why TS didn't narrow down the union type for us...so casting to any - assert.equal( - (actual.rollupSettings! as any).rollupIdentificationValue, - (options.rollupSettings! as any).rollupIdentificationValue, - "options.missingDataPointFillSettings.fillType mismatch" - ); + if (recorder && !sqlServerFeedName) { + sqlServerFeedName = recorder.getUniqueName("js-test-sqlServerFeed-"); + } + if (recorder && !cosmosFeedName) { + cosmosFeedName = recorder.getUniqueName("js-test-cosmosFeed-"); + } + if (recorder && !dataExplorerFeedName) { + dataExplorerFeedName = recorder.getUniqueName("js-test-dataExplorerFeed-"); + } + if (recorder && !azureTableFeedName) { + azureTableFeedName = recorder.getUniqueName("js-test-tableFeed-"); + } + if (recorder && !eventHubsFeedName) { + eventHubsFeedName = recorder.getUniqueName("js-test-httpRequestFeed-"); + } + if (recorder && !logAnalyticsFeedName) { + logAnalyticsFeedName = recorder.getUniqueName("js-test-logAnalyticsFeed-"); + } + if (recorder && !influxDbFeedName) { + influxDbFeedName = recorder.getUniqueName("js-test-influxdbFeed-"); + } + if (recorder && !mongoDbFeedName) { + mongoDbFeedName = recorder.getUniqueName("js-test-mongoDbFeed-"); + } + if (recorder && !mySqlFeedName) { + mySqlFeedName = recorder.getUniqueName("js-test-mySqlFeed-"); + } + if (recorder && !postgreSqlFeedName) { + postgreSqlFeedName = recorder.getUniqueName("js-test-postgreSqlFeed-"); + } + if (recorder && !datalakeGenFeedName) { + datalakeGenFeedName = recorder.getUniqueName("js-test-dataLakeGenFeed-"); } }); - it("retrieves an Azure Blob datafeed", async function(this: Context) { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource = ({ - dataSourceType: "AzureBlob", - container: "adsample", - connectionString: undefined, - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - } as unknown) as AzureBlobDataFeedSource; - - if (!createdAzureBlobDataFeedId) { - this.skip(); + afterEach(async function() { + if (recorder) { + await recorder.stop(); } - - const actual = await client.getDataFeed(createdAzureBlobDataFeedId); - assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); - assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); - assert.equal(actual.name, feedName); - assert.deepStrictEqual(actual.source, expectedSource, "Source mismatch!"); - assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); - assert.equal( - actual.schema.metrics[0].name, - dataFeedSchema.metrics[0].name, - "Schema metric 1 name mismatch!" - ); - assert.equal( - actual.schema.metrics[1].name, - dataFeedSchema.metrics[1].name, - "Schema metric 2 name mismatch!" - ); - assert.strictEqual(actual.schema.timestampColumn, "", "Schema timestampColumn mismatch!"); - assert.equal( - actual.schema.dimensions![0].displayName, - dataFeedSchema.dimensions![0].displayName, - "Schema dimension 1 display name mismatch!" - ); }); - it("updates an Azure Blob datafeed", async function(this: Context) { - if (!createdAzureBlobDataFeedId) { - this.skip(); - } - const expectedSourceParameter: DataFeedSource = { - dataSourceType: "AzureBlob", - connectionString: "Updated Azure Blob connection string", - container: "Updated Azure Blob container", - blobTemplate: "Updated Azure Blob template", - authenticationType: "ManagedIdentity" + let createdAzureBlobDataFeedId: string; + let createdAppFeedId: string; + let createdSqlServerFeedId: string; + let createdCosmosFeedId: string; + let createdAzureDataExplorerFeedId: string; + let createdAzureTableFeedId: string; + let createdInfluxFeedId: string; + let createdMongoDbFeedId: string; + let createdMySqlFeedId: string; + let createdPostGreSqlId: string; + let createdDataLakeGenId: string; + let createdEventhubsId: string; + let createdLogAnalyticsId: string; + + describe("DataFeed", async () => { + const metric: DataFeedMetric[] = [ + { + name: "cost", + displayName: "cost", + description: "" + }, + { + name: "revenue", + displayName: "revenue", + description: "" + } + ]; + const dimension: DataFeedDimension[] = [ + { name: "category", displayName: "category" }, + { name: "city", displayName: "city" } + ]; + const dataFeedSchema: DataFeedSchema = { + metrics: metric, + dimensions: dimension }; - const expectedServerParameter = { - dataSourceType: "AzureBlob", - connectionString: undefined, - container: "Updated Azure Blob container", - blobTemplate: "Updated Azure Blob template", - authenticationType: "ManagedIdentity" + const dataFeedIngestion: DataFeedIngestionSettings = { + ingestionStartTime: new Date(Date.UTC(2020, 7, 21)), + ingestionStartOffsetInSeconds: 0, + dataSourceRequestConcurrency: -1, + ingestionRetryDelayInSeconds: -1, + stopRetryAfterInSeconds: -1 }; - const expectedIngestionSettings = { - ingestionStartTime: new Date(Date.UTC(2020, 7, 1)), - ingestionStartOffsetInSeconds: 2, - dataSourceRequestConcurrency: 3, - ingestionRetryDelayInSeconds: 4, - stopRetryAfterInSeconds: 5 + const granularity: DataFeedGranularity = { + granularityType: "Daily" }; - const patch: DataFeedPatch = { - source: { - ...expectedSourceParameter - }, - name: recorder.getUniqueName("Updated-Azure-Blob-data-feed-"), - schema: { - timestampColumn: "UpdatedTimestampeColumn" - }, - ingestionSettings: expectedIngestionSettings, - description: "Updated Azure Blob description", - rollupSettings: { - rollupType: "AlreadyRollup", - rollupIdentificationValue: "__Existing__" - }, + const rollupSettings: DataFeedRollupSettings = { + rollupType: "AutoRollup", + rollupMethod: "Sum", + rollupIdentificationValue: "__CUSTOM_SUM__" + }; + const options = { + description: "Data feed description", + rollupSettings: rollupSettings, missingDataPointFillSettings: { - fillType: "PreviousValue" + fillType: "CustomValue", + customFillValue: 555 }, - accessMode: "Public", - viewerEmails: ["viewer1@example.com"], - actionLinkTemplate: "Updated Azure Blob action link template" + accessMode: "Private" }; - const updated = await client.updateDataFeed(createdAzureBlobDataFeedId, patch); - assert.ok(updated.id, "Expecting valid data feed"); - assert.equal(updated.source.dataSourceType, "AzureBlob"); - assert.deepStrictEqual( - updated.source, - (expectedServerParameter as unknown) as AzureBlobDataFeedSource - ); - assert.equal( - updated.source.authenticationType, - expectedSourceParameter.authenticationType - ); - assert.deepStrictEqual(updated.ingestionSettings, expectedIngestionSettings); - assert.equal(updated.description, "Updated Azure Blob description"); - assert.ok(updated.rollupSettings, "Expecting valid updated.options.rollupSettings"); - assert.equal(updated.rollupSettings!.rollupType, "AlreadyRollup"); - assert.equal((updated.rollupSettings! as any).rollupIdentificationValue, "__Existing__"); - assert.equal(updated.missingDataPointFillSettings?.fillType, "PreviousValue"); - assert.equal(updated.accessMode, "Public"); - assert.deepStrictEqual(updated.viewerEmails, ["viewer1@example.com"]); - assert.equal(updated.actionLinkTemplate, "Updated Azure Blob action link template"); - }); - it("creates an Azure Application Insights feed", async () => { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource: DataFeedSource = { - dataSourceType: "AzureApplicationInsights", - azureCloud: "Azure", - authenticationType: "Basic", - applicationId: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID, - apiKey: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_API_KEY, - query: - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" - }; - const actual = await client.createDataFeed({ - name: appInsightsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdAppFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureApplicationInsights"); - if (actual.source.dataSourceType === "AzureApplicationInsights") { - assert.equal(actual.source.azureCloud, "Azure"); + it.skip("creates an Azure Blob datafeed", async () => { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource: DataFeedSource = { + dataSourceType: "AzureBlob", + connectionString: testEnv.METRICS_ADVISOR_AZURE_BLOB_CONNECTION_STRING, + container: "adsample", + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + }; + const expectedSourceByService = ({ + dataSourceType: "AzureBlob", + connectionString: undefined, + container: "adsample", + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + } as unknown) as DataFeedSource; + const feed = { + name: feedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor; + const actual = await client.createDataFeed(feed); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureBlobDataFeedId = actual.id; + + assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); + assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); + assert.equal(actual.name, feedName); + // the service doesn't return sensitive data + assert.deepStrictEqual(actual.source, expectedSourceByService, "Source mismatch!"); + assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); assert.equal( - actual.source.applicationId, - testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID + actual.schema.metrics[0].name, + dataFeedSchema.metrics[0].name, + "Schema metric 1 name mismatch!" ); - assert.equal(actual.source.apiKey, undefined); assert.equal( - actual.source.query, - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + actual.schema.metrics[1].name, + dataFeedSchema.metrics[1].name, + "Schema metric 2 name mismatch!" + ); + assert.strictEqual( + actual.schema.timestampColumn, + "", + "Schema timestampColumn mismatch!" ); - } - }); - - it("creates an Azure SQL Server Feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "SqlServer", - connectionString: testEnv.METRICS_ADVISOR_AZURE_SQL_SERVER_CONNECTION_STRING, - query: "select * from adsample2 where Timestamp = @StartTime", - authenticationType: "Basic" - }; - const feed = { - name: sqlServerFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor; - const actual = await client.createDataFeed(feed); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdSqlServerFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "SqlServer"); - if (actual.source.dataSourceType === "SqlServer") { - assert.equal((actual.source as any).connectionString, undefined); assert.equal( - actual.source.query, - "select * from adsample2 where Timestamp = @StartTime" + actual.schema.dimensions![0].displayName, + dataFeedSchema.dimensions![0].displayName, + "Schema dimension 1 display name mismatch!" + ); + assert.deepStrictEqual( + actual.ingestionSettings, + dataFeedIngestion, + "Ingesting settings mismatch!" + ); + assert.equal( + actual.metricIds[dataFeedSchema.metrics[0].name], + actual.schema.metrics[0].id ); - } - }); - it("lists datafeed", async function() { - const iterator = client.listDataFeeds({ - filter: { - dataFeedName: "js-test-" + assert.equal(actual.description, options.description, "options.description mismatch"); + assert.equal( + actual.accessMode, + options.accessMode as DataFeedAccessMode, + "options.accessMode mismatch" + ); + assert.ok( + actual.missingDataPointFillSettings, + "Expecting valid options.missingDataPointFillSettings" + ); + assert.equal( + actual.missingDataPointFillSettings!.fillType, + options.missingDataPointFillSettings!.fillType, + "options.missingDataPointFillSettings.fillType mismatch" + ); + assert.ok( + actual.missingDataPointFillSettings!.fillType, + "Expecting valid options.missingDataPointFillSettings.fillType" + ); + if (actual.missingDataPointFillSettings!.fillType! === "CustomValue") { + // not sure why TS didn't narrow down the union type for us...so casting to any + assert.equal( + (actual.missingDataPointFillSettings! as any).customFillValue, + (options.missingDataPointFillSettings! as any).customFillValue, + "options.missingDataPointFillSettings.customFillValue mismatch" + ); + } + assert.ok(actual.rollupSettings, "Expecting valid options.rollupSettings"); + assert.equal( + actual.rollupSettings!.rollupType, + options.rollupSettings!.rollupType, + "options.missingDataPointFillSettings.rollupType mismatch" + ); + assert.ok( + actual.rollupSettings!.rollupType, + "Expecting valid options.missingDataPointFillSettings.fillType" + ); + if (actual.rollupSettings!.rollupType! === "AutoRollup") { + // not sure why TS didn't narrow down the union type for us...so casting to any + assert.equal( + (actual.rollupSettings! as any).rollupIdentificationValue, + (options.rollupSettings! as any).rollupIdentificationValue, + "options.missingDataPointFillSettings.fillType mismatch" + ); } }); - let result = await iterator.next(); - assert.ok(result.value.status, "Expecting first data feed"); - result = await iterator.next(); - assert.ok(result.value.status, "Expecting second data feed"); - }); - - it("lists datafeed by pages", async function() { - const iterator = client - .listDataFeeds({ - filter: { - dataFeedName: "js-test-" - } - }) - .byPage({ maxPageSize: 1 }); - let result = await iterator.next(); - assert.equal(result.value.length, 1, "Expecting one entry in first page"); - result = await iterator.next(); - assert.equal(result.value.length, 1, "Expecting one entry in second page"); - }); - - it("deletes an Azure Blob datafeed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureBlobDataFeedId); - }); - it("deletes an Azure Application Insights feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAppFeedId); - }); + it.skip("retrieves an Azure Blob datafeed", async function(this: Context) { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource = ({ + dataSourceType: "AzureBlob", + container: "adsample", + connectionString: undefined, + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + } as unknown) as AzureBlobDataFeedSource; - it("deletes an Azure SQL Server feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdSqlServerFeedId); - }); + if (!createdAzureBlobDataFeedId) { + this.skip(); + } - it("creates an Azure Cosmos DB Feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureCosmosDB", - connectionString: "Server=server.example.net;Encrypt=True;", - sqlQuery: "let starttime=datetime(@StartTime); let endtime=starttime", - database: "sample", - collectionId: "sample", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: cosmosFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdCosmosFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureCosmosDB"); - if (actual.source.dataSourceType === "AzureCosmosDB") { - assert.equal(actual.source.connectionString, undefined); + const actual = await client.getDataFeed(createdAzureBlobDataFeedId); + assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); + assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); + assert.equal(actual.name, feedName); + assert.deepStrictEqual(actual.source, expectedSource, "Source mismatch!"); + assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); assert.equal( - actual.source.sqlQuery, - "let starttime=datetime(@StartTime); let endtime=starttime" + actual.schema.metrics[0].name, + dataFeedSchema.metrics[0].name, + "Schema metric 1 name mismatch!" ); - assert.equal(actual.source.database, "sample"); - assert.equal(actual.source.collectionId, "sample"); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); - - it("deletes an Azure Cosmos DB", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdCosmosFeedId); - }); + assert.equal( + actual.schema.metrics[1].name, + dataFeedSchema.metrics[1].name, + "Schema metric 2 name mismatch!" + ); + assert.strictEqual( + actual.schema.timestampColumn, + "", + "Schema timestampColumn mismatch!" + ); + assert.equal( + actual.schema.dimensions![0].displayName, + dataFeedSchema.dimensions![0].displayName, + "Schema dimension 1 display name mismatch!" + ); + }); - it("creates an Azure Data Explorer feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureDataExplorer", - connectionString: "Server=server.example.net;Encrypt=True;", - query: "let starttime=datetime(@StartTime); let endtime=starttime", - authenticationType: "ManagedIdentity" - }; - const actual = await client.createDataFeed({ - name: dataExplorerFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureDataExplorerFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureDataExplorer"); - if (actual.source.dataSourceType === "AzureDataExplorer") { - assert.equal(actual.source.connectionString, undefined); + it.skip("updates an Azure Blob datafeed", async function(this: Context) { + if (!createdAzureBlobDataFeedId) { + this.skip(); + } + const expectedSourceParameter: DataFeedSource = { + dataSourceType: "AzureBlob", + connectionString: "Updated Azure Blob connection string", + container: "Updated Azure Blob container", + blobTemplate: "Updated Azure Blob template", + authenticationType: "ManagedIdentity" + }; + const expectedServerParameter = { + dataSourceType: "AzureBlob", + connectionString: undefined, + container: "Updated Azure Blob container", + blobTemplate: "Updated Azure Blob template", + authenticationType: "ManagedIdentity" + }; + const expectedIngestionSettings = { + ingestionStartTime: new Date(Date.UTC(2020, 7, 1)), + ingestionStartOffsetInSeconds: 2, + dataSourceRequestConcurrency: 3, + ingestionRetryDelayInSeconds: 4, + stopRetryAfterInSeconds: 5 + }; + const patch: DataFeedPatch = { + source: { + ...expectedSourceParameter + }, + name: recorder.getUniqueName("Updated-Azure-Blob-data-feed-"), + schema: { + timestampColumn: "UpdatedTimestampeColumn" + }, + ingestionSettings: expectedIngestionSettings, + description: "Updated Azure Blob description", + rollupSettings: { + rollupType: "AlreadyRollup", + rollupIdentificationValue: "__Existing__" + }, + missingDataPointFillSettings: { + fillType: "PreviousValue" + }, + accessMode: "Public", + viewerEmails: ["viewer1@example.com"], + actionLinkTemplate: "Updated Azure Blob action link template" + }; + const updated = await client.updateDataFeed(createdAzureBlobDataFeedId, patch); + assert.ok(updated.id, "Expecting valid data feed"); + assert.equal(updated.source.dataSourceType, "AzureBlob"); + assert.deepStrictEqual( + updated.source, + (expectedServerParameter as unknown) as AzureBlobDataFeedSource + ); assert.equal( - actual.source.query, - "let starttime=datetime(@StartTime); let endtime=starttime" + updated.source.authenticationType, + expectedSourceParameter.authenticationType ); - assert.equal(actual.source.authenticationType, "ManagedIdentity"); - } - }); + assert.deepStrictEqual(updated.ingestionSettings, expectedIngestionSettings); + assert.equal(updated.description, "Updated Azure Blob description"); + assert.ok(updated.rollupSettings, "Expecting valid updated.options.rollupSettings"); + assert.equal(updated.rollupSettings!.rollupType, "AlreadyRollup"); + assert.equal( + (updated.rollupSettings! as any).rollupIdentificationValue, + "__Existing__" + ); + assert.equal(updated.missingDataPointFillSettings?.fillType, "PreviousValue"); + assert.equal(updated.accessMode, "Public"); + assert.deepStrictEqual(updated.viewerEmails, ["viewer1@example.com"]); + assert.equal(updated.actionLinkTemplate, "Updated Azure Blob action link template"); + }); - it("deletes an Azure Data Explorer feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureDataExplorerFeedId); - }); + it.skip("creates an Azure Application Insights feed", async () => { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource: DataFeedSource = { + dataSourceType: "AzureApplicationInsights", + azureCloud: "Azure", + authenticationType: "Basic", + applicationId: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID, + apiKey: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_API_KEY, + query: + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + }; + const actual = await client.createDataFeed({ + name: appInsightsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); - it("creates an Azure Table feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureTable", - connectionString: "https://table.example.net", - table: "table-name", - query: "partition-key eq @start-time", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: azureTableFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureTableFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureTable"); - if (actual.source.dataSourceType === "AzureTable") { - assert.equal(actual.source.connectionString, undefined); - assert.equal(actual.source.table, "table-name"); - assert.equal(actual.source.query, "partition-key eq @start-time"); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); + assert.ok(actual.id, "Expecting valid data feed id"); + createdAppFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureApplicationInsights"); + if (actual.source.dataSourceType === "AzureApplicationInsights") { + assert.equal(actual.source.azureCloud, "Azure"); + assert.equal( + actual.source.applicationId, + testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID + ); + assert.equal(actual.source.apiKey, undefined); + assert.equal( + actual.source.query, + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + ); + } + }); - it("deletes an Azure Table feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureTableFeedId); - }); + it.skip("creates an Azure SQL Server Feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "SqlServer", + connectionString: testEnv.METRICS_ADVISOR_AZURE_SQL_SERVER_CONNECTION_STRING, + query: "select * from adsample2 where Timestamp = @StartTime", + authenticationType: "Basic" + }; + const feed = { + name: sqlServerFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor; + const actual = await client.createDataFeed(feed); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdSqlServerFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "SqlServer"); + if (actual.source.dataSourceType === "SqlServer") { + assert.equal((actual.source as any).connectionString, undefined); + assert.equal( + actual.source.query, + "select * from adsample2 where Timestamp = @StartTime" + ); + } + }); - it("creates InfluxDB data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "InfluxDB", - connectionString: "https://connect-to-influxdb", - database: "data-feed-database", - userName: "user", - password: "pwd1", - query: "partition-key eq @start-time", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: influxDbFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdInfluxFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "InfluxDB"); - if (actual.source.dataSourceType === "InfluxDB") { - assert.equal(actual.source.connectionString, "https://connect-to-influxdb"); - assert.equal(actual.source.database, "data-feed-database"); - assert.equal(actual.source.userName, "user"); - assert.equal(actual.source.password, undefined); - assert.equal(actual.source.query, "partition-key eq @start-time"); - } - }); + it.skip("lists datafeed", async function() { + const iterator = client.listDataFeeds({ + filter: { + dataFeedName: "js-test-" + } + }); + let result = await iterator.next(); + assert.ok(result.value.status, "Expecting first data feed"); + result = await iterator.next(); + assert.ok(result.value.status, "Expecting second data feed"); + }); - it("deletes InfluxDB data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdInfluxFeedId); - }); + it.skip("lists datafeed by pages", async function() { + const iterator = client + .listDataFeeds({ + filter: { + dataFeedName: "js-test-" + } + }) + .byPage({ maxPageSize: 1 }); + let result = await iterator.next(); + assert.equal(result.value.length, 1, "Expecting one entry in first page"); + result = await iterator.next(); + assert.equal(result.value.length, 1, "Expecting one entry in second page"); + }); - it("creates MongoDB data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "MongoDB", - connectionString: "https://connect-to-mongodb", - database: "data-feed-mongodb", - command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: mongoDbFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdMongoDbFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "MongoDB"); - if (actual.source.dataSourceType === "MongoDB") { - assert.equal(actual.source.connectionString, undefined); - assert.equal(actual.source.database, "data-feed-mongodb"); - assert.equal( - actual.source.command, - "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); + it.skip("deletes an Azure Blob datafeed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureBlobDataFeedId); + }); - it("deletes MongoDB data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdMongoDbFeedId); - }); + it.skip("deletes an Azure Application Insights feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAppFeedId); + }); - it("creates MySQL data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "MySql", - connectionString: "https://connect-to-mysql", - query: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: mySqlFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdMySqlFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "MySql"); - if (actual.source.dataSourceType === "MySql") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.query, - "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); + it.skip("deletes an Azure SQL Server feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdSqlServerFeedId); + }); - it("deletes MySQL data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdMySqlFeedId); - }); + it.skip("creates an Azure Cosmos DB Feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureCosmosDB", + connectionString: "Server=server.example.net;Encrypt=True;", + sqlQuery: "let starttime=datetime(@StartTime); let endtime=starttime", + database: "sample", + collectionId: "sample", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: cosmosFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); - it("creates Datalake Gen 2 data feed", async () => { - const expectedSource: AzureDataLakeStorageGen2DataFeedSource = { - dataSourceType: "AzureDataLakeStorageGen2", - directoryTemplate: "directory-template", - fileSystemName: "file-system-name", - fileTemplate: "file-template", - accountKey: "account-key", - accountName: "account-name", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: datalakeGenFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdDataLakeGenId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureDataLakeStorageGen2"); - if (actual.source.dataSourceType === "AzureDataLakeStorageGen2") { - assert.equal(actual.source.accountName, expectedSource.accountName); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - assert.equal(actual.source.fileSystemName, expectedSource.fileSystemName); - assert.equal(actual.source.fileTemplate, expectedSource.fileTemplate); - assert.equal(actual.source.directoryTemplate, expectedSource.directoryTemplate); - } - }); + assert.ok(actual.id, "Expecting valid data feed id"); + createdCosmosFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureCosmosDB"); + if (actual.source.dataSourceType === "AzureCosmosDB") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.sqlQuery, + "let starttime=datetime(@StartTime); let endtime=starttime" + ); + assert.equal(actual.source.database, "sample"); + assert.equal(actual.source.collectionId, "sample"); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it("deletes Datalake Gen 2 data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdDataLakeGenId); - }); + it.skip("deletes an Azure Cosmos DB", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdCosmosFeedId); + }); - it.skip("creates Eventhubs data feed", async () => { - const expectedSource: AzureEventHubsDataFeedSource = { - dataSourceType: "AzureEventHubs", - authenticationType: "Basic", - connectionString: testEnv.METRICS_EVENTHUB_CONNECTION_STRING, - consumerGroup: testEnv.METRICS_EVENTHUB_CONSUMER_GROUP - }; - const actual = await client.createDataFeed({ - name: eventHubsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdEventhubsId = actual.id; - assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); - if (actual.source.dataSourceType === "AzureEventHubs") { - assert.equal(actual.source.consumerGroup, expectedSource.consumerGroup); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - assert.equal(actual.source.connectionString, undefined); - } - }); + it.skip("creates an Azure Data Explorer feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureDataExplorer", + connectionString: "Server=server.example.net;Encrypt=True;", + query: "let starttime=datetime(@StartTime); let endtime=starttime", + authenticationType: "ManagedIdentity" + }; + const actual = await client.createDataFeed({ + name: dataExplorerFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); - it.skip("deletes Eventhubs data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdEventhubsId); - }); + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureDataExplorerFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureDataExplorer"); + if (actual.source.dataSourceType === "AzureDataExplorer") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "let starttime=datetime(@StartTime); let endtime=starttime" + ); + assert.equal(actual.source.authenticationType, "ManagedIdentity"); + } + }); - it("creates Log Analytics data feed", async () => { - const expectedSource: AzureLogAnalyticsDataFeedSource = { - dataSourceType: "AzureLogAnalytics", - authenticationType: "Basic", - clientId: "client-id", - clientSecret: "client-secret", - tenantId: "tenant-id", - workspaceId: "workspace-id", - query: "query" - }; - const actual = await client.createDataFeed({ - name: logAnalyticsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdLogAnalyticsId = actual.id; - assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); - if (actual.source.dataSourceType === "AzureLogAnalytics") { - assert.equal(actual.source.query, expectedSource.query); - assert.equal(actual.source.workspaceId, expectedSource.workspaceId); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - if (actual.source.authenticationType === "Basic") { - assert.equal(actual.source.tenantId, expectedSource.tenantId); - assert.equal(actual.source.clientId, expectedSource.clientId); - assert.equal(actual.source.clientSecret, undefined); + it.skip("deletes an Azure Data Explorer feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureDataExplorerFeedId); + }); + + it.skip("creates an Azure Table feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureTable", + connectionString: "https://table.example.net", + table: "table-name", + query: "partition-key eq @start-time", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: azureTableFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureTableFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureTable"); + if (actual.source.dataSourceType === "AzureTable") { + assert.equal(actual.source.connectionString, undefined); + assert.equal(actual.source.table, "table-name"); + assert.equal(actual.source.query, "partition-key eq @start-time"); + assert.equal(actual.source.authenticationType, "Basic"); } - } - }); + }); - it("deletes Log Analytics data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdLogAnalyticsId); - }); + it.skip("deletes an Azure Table feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureTableFeedId); + }); - it("creates PostgreSQL data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "PostgreSql", - connectionString: "https://connect-to-postgresql", - query: "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: postgreSqlFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdPostGreSqlId = actual.id; - assert.equal(actual.source.dataSourceType, "PostgreSql"); - if (actual.source.dataSourceType === "PostgreSql") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.query, - "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); + it.skip("creates InfluxDB data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "InfluxDB", + connectionString: "https://connect-to-influxdb", + database: "data-feed-database", + userName: "user", + password: "pwd1", + query: "partition-key eq @start-time", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: influxDbFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdInfluxFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "InfluxDB"); + if (actual.source.dataSourceType === "InfluxDB") { + assert.equal(actual.source.connectionString, "https://connect-to-influxdb"); + assert.equal(actual.source.database, "data-feed-database"); + assert.equal(actual.source.userName, "user"); + assert.equal(actual.source.password, undefined); + assert.equal(actual.source.query, "partition-key eq @start-time"); + } + }); - it("updates data feed to have a different data source type", async function() { - const patch: DataFeedPatch = { - source: { + it.skip("deletes InfluxDB data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdInfluxFeedId); + }); + + it.skip("creates MongoDB data feed", async () => { + const expectedSource: DataFeedSource = { dataSourceType: "MongoDB", - connectionString: "https://connect-to-mongodb-patch", - database: "data-feed-mongodb-patch", + connectionString: "https://connect-to-mongodb", + database: "data-feed-mongodb", command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: mongoDbFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdMongoDbFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "MongoDB"); + if (actual.source.dataSourceType === "MongoDB") { + assert.equal(actual.source.connectionString, undefined); + assert.equal(actual.source.database, "data-feed-mongodb"); + assert.equal( + actual.source.command, + "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); } - }; - const patchServer = { - source: { - dataSourceType: "MongoDB", - connectionString: undefined, - database: "data-feed-mongodb-patch", - command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + }); + + it.skip("deletes MongoDB data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdMongoDbFeedId); + }); + + it.skip("creates MySQL data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "MySql", + connectionString: "https://connect-to-mysql", + query: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: mySqlFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdMySqlFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "MySql"); + if (actual.source.dataSourceType === "MySql") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); + + it.skip("deletes MySQL data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdMySqlFeedId); + }); + + it.skip("creates Datalake Gen 2 data feed", async () => { + const expectedSource: AzureDataLakeStorageGen2DataFeedSource = { + dataSourceType: "AzureDataLakeStorageGen2", + directoryTemplate: "directory-template", + fileSystemName: "file-system-name", + fileTemplate: "file-template", + accountKey: "account-key", + accountName: "account-name", authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: datalakeGenFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdDataLakeGenId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureDataLakeStorageGen2"); + if (actual.source.dataSourceType === "AzureDataLakeStorageGen2") { + assert.equal(actual.source.accountName, expectedSource.accountName); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + assert.equal(actual.source.fileSystemName, expectedSource.fileSystemName); + assert.equal(actual.source.fileTemplate, expectedSource.fileTemplate); + assert.equal(actual.source.directoryTemplate, expectedSource.directoryTemplate); } - }; - const updated = await client.updateDataFeed(createdPostGreSqlId, patch); - assert.ok(updated.id, "Expecting valid data feed"); - assert.equal(updated.source.dataSourceType, "MongoDB"); - - assert.deepStrictEqual( - updated.source, - (patchServer.source as unknown) as MongoDbDataFeedSource - ); - }); + }); - it("deletes PostgreSQL data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdPostGreSqlId); - }); + it.skip("deletes Datalake Gen 2 data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdDataLakeGenId); + }); - it("creates Unknown data feed", async () => { - const expectedSource: UnknownDataFeedSource = { - dataSourceType: "Unknown", - dataSourceParameter: "", - authenticationType: "Basic" - }; - try { - await client.createDataFeed({ + it("creates Eventhubs data feed", async () => { + const expectedSource: AzureEventHubsDataFeedSource = { + dataSourceType: "AzureEventHubs", + authenticationType: "Basic", + connectionString: testEnv.METRICS_EVENTHUB_CONNECTION_STRING, + consumerGroup: testEnv.METRICS_EVENTHUB_CONSUMER_GROUP + }; + const actual = await client.createDataFeed({ + name: eventHubsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdEventhubsId = actual.id; + assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); + if (actual.source.dataSourceType === "AzureEventHubs") { + assert.equal(actual.source.consumerGroup, expectedSource.consumerGroup); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + assert.equal(actual.source.connectionString, undefined); + } + }); + + it("deletes Eventhubs data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdEventhubsId); + }); + + it.skip("creates Log Analytics data feed", async () => { + const expectedSource: AzureLogAnalyticsDataFeedSource = { + dataSourceType: "AzureLogAnalytics", + authenticationType: "Basic", + clientId: "client-id", + clientSecret: "client-secret", + tenantId: "tenant-id", + workspaceId: "workspace-id", + query: "query" + }; + const actual = await client.createDataFeed({ + name: logAnalyticsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdLogAnalyticsId = actual.id; + assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); + if (actual.source.dataSourceType === "AzureLogAnalytics") { + assert.equal(actual.source.query, expectedSource.query); + assert.equal(actual.source.workspaceId, expectedSource.workspaceId); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + if (actual.source.authenticationType === "Basic") { + assert.equal(actual.source.tenantId, expectedSource.tenantId); + assert.equal(actual.source.clientId, expectedSource.clientId); + assert.equal(actual.source.clientSecret, undefined); + } + } + }); + + it.skip("deletes Log Analytics data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdLogAnalyticsId); + }); + + it.skip("creates PostgreSQL data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "PostgreSql", + connectionString: "https://connect-to-postgresql", + query: "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ name: postgreSqlFeedName, source: expectedSource, granularity, @@ -857,33 +807,96 @@ matrix([[true, false]] as const, async (useAad) => { ingestionSettings: dataFeedIngestion, ...options } as DataFeedDescriptor); - assert.fail("Test should throw error"); - } catch (error) { - assert.equal( - (error as any).message, - "Cannot create a data feed with the Unknown source type." - ); - } - }); - it("updates data feed to have an unknown data source type", async function() { - const patch: DataFeedPatch = { - source: { - dataSourceType: "Unknown" + assert.ok(actual.id, "Expecting valid data feed id"); + createdPostGreSqlId = actual.id; + assert.equal(actual.source.dataSourceType, "PostgreSql"); + if (actual.source.dataSourceType === "PostgreSql") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); } - }; - try { - await client.updateDataFeed(createdPostGreSqlId, patch); - assert.fail("Test should throw error"); - } catch (error) { - assert.equal( - (error as any).message, - "Cannot update a data feed to have the Unknown source type." + }); + + it.skip("updates data feed to have a different data source type", async function() { + const patch: DataFeedPatch = { + source: { + dataSourceType: "MongoDB", + connectionString: "https://connect-to-mongodb-patch", + database: "data-feed-mongodb-patch", + command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + } + }; + const patchServer = { + source: { + dataSourceType: "MongoDB", + connectionString: undefined, + database: "data-feed-mongodb-patch", + command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + } + }; + const updated = await client.updateDataFeed(createdPostGreSqlId, patch); + assert.ok(updated.id, "Expecting valid data feed"); + assert.equal(updated.source.dataSourceType, "MongoDB"); + + assert.deepStrictEqual( + updated.source, + (patchServer.source as unknown) as MongoDbDataFeedSource ); - } + }); + + it.skip("deletes PostgreSQL data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdPostGreSqlId); + }); + + it.skip("creates Unknown data feed", async () => { + const expectedSource: UnknownDataFeedSource = { + dataSourceType: "Unknown", + dataSourceParameter: "", + authenticationType: "Basic" + }; + try { + await client.createDataFeed({ + name: postgreSqlFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + assert.fail("Test should throw error"); + } catch (error) { + assert.equal( + (error as any).message, + "Cannot create a data feed with the Unknown source type." + ); + } + }); + + it.skip("updates data feed to have an unknown data source type", async function() { + const patch: DataFeedPatch = { + source: { + dataSourceType: "Unknown" + } + }; + try { + await client.updateDataFeed(createdPostGreSqlId, patch); + assert.fail("Test should throw error"); + } catch (error) { + assert.equal( + (error as any).message, + "Cannot update a data feed to have the Unknown source type." + ); + } + }); }); - }); - }).timeout(60000); + }) + .timeout(60000); }); }); From 8d7f15ff99a02665867b897c9c363eab5f2307a2 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 11:39:42 -0700 Subject: [PATCH 05/11] formatting --- .../test/public/datafeed.spec.ts | 1587 ++++++++--------- 1 file changed, 787 insertions(+), 800 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts index 5a8b3914083c..beb3f68a4139 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts @@ -28,778 +28,828 @@ import { matrix } from "./util/matrix"; matrix([[true, false]] as const, async (useAad) => { describe(`[${useAad ? "AAD" : "API Key"}]`, () => { - describe - .only("MetricsAdvisorAdministrationClient datafeed", () => { - let client: MetricsAdvisorAdministrationClient; - let recorder: Recorder; - let feedName: string; - let appInsightsFeedName: string; - let sqlServerFeedName: string; - let cosmosFeedName: string; - let dataExplorerFeedName: string; - let azureTableFeedName: string; - let eventHubsFeedName: string; - let influxDbFeedName: string; - let mongoDbFeedName: string; - let mySqlFeedName: string; - let postgreSqlFeedName: string; - let datalakeGenFeedName: string; - let logAnalyticsFeedName: string; - - beforeEach(function(this: Context) { - ({ recorder, client } = createRecordedAdminClient(this, makeCredential(useAad))); - if (recorder && !feedName) { - feedName = recorder.getUniqueName("js-test-datafeed-"); + describe("MetricsAdvisorAdministrationClient datafeed", () => { + let client: MetricsAdvisorAdministrationClient; + let recorder: Recorder; + let feedName: string; + let appInsightsFeedName: string; + let sqlServerFeedName: string; + let cosmosFeedName: string; + let dataExplorerFeedName: string; + let azureTableFeedName: string; + let eventHubsFeedName: string; + let influxDbFeedName: string; + let mongoDbFeedName: string; + let mySqlFeedName: string; + let postgreSqlFeedName: string; + let datalakeGenFeedName: string; + let logAnalyticsFeedName: string; + + beforeEach(function(this: Context) { + ({ recorder, client } = createRecordedAdminClient(this, makeCredential(useAad))); + if (recorder && !feedName) { + feedName = recorder.getUniqueName("js-test-datafeed-"); + } + if (recorder && !appInsightsFeedName) { + appInsightsFeedName = recorder.getUniqueName("js-test-appInsightsFeed-"); + } + if (recorder && !sqlServerFeedName) { + sqlServerFeedName = recorder.getUniqueName("js-test-sqlServerFeed-"); + } + if (recorder && !cosmosFeedName) { + cosmosFeedName = recorder.getUniqueName("js-test-cosmosFeed-"); + } + if (recorder && !dataExplorerFeedName) { + dataExplorerFeedName = recorder.getUniqueName("js-test-dataExplorerFeed-"); + } + if (recorder && !azureTableFeedName) { + azureTableFeedName = recorder.getUniqueName("js-test-tableFeed-"); + } + if (recorder && !eventHubsFeedName) { + eventHubsFeedName = recorder.getUniqueName("js-test-httpRequestFeed-"); + } + if (recorder && !logAnalyticsFeedName) { + logAnalyticsFeedName = recorder.getUniqueName("js-test-logAnalyticsFeed-"); + } + if (recorder && !influxDbFeedName) { + influxDbFeedName = recorder.getUniqueName("js-test-influxdbFeed-"); + } + if (recorder && !mongoDbFeedName) { + mongoDbFeedName = recorder.getUniqueName("js-test-mongoDbFeed-"); + } + if (recorder && !mySqlFeedName) { + mySqlFeedName = recorder.getUniqueName("js-test-mySqlFeed-"); + } + if (recorder && !postgreSqlFeedName) { + postgreSqlFeedName = recorder.getUniqueName("js-test-postgreSqlFeed-"); + } + if (recorder && !datalakeGenFeedName) { + datalakeGenFeedName = recorder.getUniqueName("js-test-dataLakeGenFeed-"); + } + }); + + afterEach(async function() { + if (recorder) { + await recorder.stop(); + } + }); + + let createdAzureBlobDataFeedId: string; + let createdAppFeedId: string; + let createdSqlServerFeedId: string; + let createdCosmosFeedId: string; + let createdAzureDataExplorerFeedId: string; + let createdAzureTableFeedId: string; + let createdInfluxFeedId: string; + let createdMongoDbFeedId: string; + let createdMySqlFeedId: string; + let createdPostGreSqlId: string; + let createdDataLakeGenId: string; + let createdEventhubsId: string; + let createdLogAnalyticsId: string; + + describe("DataFeed", async () => { + const metric: DataFeedMetric[] = [ + { + name: "cost", + displayName: "cost", + description: "" + }, + { + name: "revenue", + displayName: "revenue", + description: "" } - if (recorder && !appInsightsFeedName) { - appInsightsFeedName = recorder.getUniqueName("js-test-appInsightsFeed-"); - } - if (recorder && !sqlServerFeedName) { - sqlServerFeedName = recorder.getUniqueName("js-test-sqlServerFeed-"); - } - if (recorder && !cosmosFeedName) { - cosmosFeedName = recorder.getUniqueName("js-test-cosmosFeed-"); - } - if (recorder && !dataExplorerFeedName) { - dataExplorerFeedName = recorder.getUniqueName("js-test-dataExplorerFeed-"); - } - if (recorder && !azureTableFeedName) { - azureTableFeedName = recorder.getUniqueName("js-test-tableFeed-"); - } - if (recorder && !eventHubsFeedName) { - eventHubsFeedName = recorder.getUniqueName("js-test-httpRequestFeed-"); - } - if (recorder && !logAnalyticsFeedName) { - logAnalyticsFeedName = recorder.getUniqueName("js-test-logAnalyticsFeed-"); - } - if (recorder && !influxDbFeedName) { - influxDbFeedName = recorder.getUniqueName("js-test-influxdbFeed-"); - } - if (recorder && !mongoDbFeedName) { - mongoDbFeedName = recorder.getUniqueName("js-test-mongoDbFeed-"); - } - if (recorder && !mySqlFeedName) { - mySqlFeedName = recorder.getUniqueName("js-test-mySqlFeed-"); - } - if (recorder && !postgreSqlFeedName) { - postgreSqlFeedName = recorder.getUniqueName("js-test-postgreSqlFeed-"); + ]; + const dimension: DataFeedDimension[] = [ + { name: "category", displayName: "category" }, + { name: "city", displayName: "city" } + ]; + const dataFeedSchema: DataFeedSchema = { + metrics: metric, + dimensions: dimension + }; + const dataFeedIngestion: DataFeedIngestionSettings = { + ingestionStartTime: new Date(Date.UTC(2020, 7, 21)), + ingestionStartOffsetInSeconds: 0, + dataSourceRequestConcurrency: -1, + ingestionRetryDelayInSeconds: -1, + stopRetryAfterInSeconds: -1 + }; + const granularity: DataFeedGranularity = { + granularityType: "Daily" + }; + const rollupSettings: DataFeedRollupSettings = { + rollupType: "AutoRollup", + rollupMethod: "Sum", + rollupIdentificationValue: "__CUSTOM_SUM__" + }; + const options = { + description: "Data feed description", + rollupSettings: rollupSettings, + missingDataPointFillSettings: { + fillType: "CustomValue", + customFillValue: 555 + }, + accessMode: "Private" + }; + + it("creates an Azure Blob datafeed", async () => { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource: DataFeedSource = { + dataSourceType: "AzureBlob", + connectionString: testEnv.METRICS_ADVISOR_AZURE_BLOB_CONNECTION_STRING, + container: "adsample", + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + }; + const expectedSourceByService = ({ + dataSourceType: "AzureBlob", + connectionString: undefined, + container: "adsample", + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + } as unknown) as DataFeedSource; + const feed = { + name: feedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor; + const actual = await client.createDataFeed(feed); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureBlobDataFeedId = actual.id; + + assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); + assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); + assert.equal(actual.name, feedName); + // the service doesn't return sensitive data + assert.deepStrictEqual(actual.source, expectedSourceByService, "Source mismatch!"); + assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); + assert.equal( + actual.schema.metrics[0].name, + dataFeedSchema.metrics[0].name, + "Schema metric 1 name mismatch!" + ); + assert.equal( + actual.schema.metrics[1].name, + dataFeedSchema.metrics[1].name, + "Schema metric 2 name mismatch!" + ); + assert.strictEqual(actual.schema.timestampColumn, "", "Schema timestampColumn mismatch!"); + assert.equal( + actual.schema.dimensions![0].displayName, + dataFeedSchema.dimensions![0].displayName, + "Schema dimension 1 display name mismatch!" + ); + assert.deepStrictEqual( + actual.ingestionSettings, + dataFeedIngestion, + "Ingesting settings mismatch!" + ); + assert.equal( + actual.metricIds[dataFeedSchema.metrics[0].name], + actual.schema.metrics[0].id + ); + + assert.equal(actual.description, options.description, "options.description mismatch"); + assert.equal( + actual.accessMode, + options.accessMode as DataFeedAccessMode, + "options.accessMode mismatch" + ); + assert.ok( + actual.missingDataPointFillSettings, + "Expecting valid options.missingDataPointFillSettings" + ); + assert.equal( + actual.missingDataPointFillSettings!.fillType, + options.missingDataPointFillSettings!.fillType, + "options.missingDataPointFillSettings.fillType mismatch" + ); + assert.ok( + actual.missingDataPointFillSettings!.fillType, + "Expecting valid options.missingDataPointFillSettings.fillType" + ); + if (actual.missingDataPointFillSettings!.fillType! === "CustomValue") { + // not sure why TS didn't narrow down the union type for us...so casting to any + assert.equal( + (actual.missingDataPointFillSettings! as any).customFillValue, + (options.missingDataPointFillSettings! as any).customFillValue, + "options.missingDataPointFillSettings.customFillValue mismatch" + ); } - if (recorder && !datalakeGenFeedName) { - datalakeGenFeedName = recorder.getUniqueName("js-test-dataLakeGenFeed-"); + assert.ok(actual.rollupSettings, "Expecting valid options.rollupSettings"); + assert.equal( + actual.rollupSettings!.rollupType, + options.rollupSettings!.rollupType, + "options.missingDataPointFillSettings.rollupType mismatch" + ); + assert.ok( + actual.rollupSettings!.rollupType, + "Expecting valid options.missingDataPointFillSettings.fillType" + ); + if (actual.rollupSettings!.rollupType! === "AutoRollup") { + // not sure why TS didn't narrow down the union type for us...so casting to any + assert.equal( + (actual.rollupSettings! as any).rollupIdentificationValue, + (options.rollupSettings! as any).rollupIdentificationValue, + "options.missingDataPointFillSettings.fillType mismatch" + ); } }); - afterEach(async function() { - if (recorder) { - await recorder.stop(); + it("retrieves an Azure Blob datafeed", async function(this: Context) { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource = ({ + dataSourceType: "AzureBlob", + container: "adsample", + connectionString: undefined, + blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, + authenticationType: "Basic" + } as unknown) as AzureBlobDataFeedSource; + + if (!createdAzureBlobDataFeedId) { + this.skip(); } + + const actual = await client.getDataFeed(createdAzureBlobDataFeedId); + assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); + assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); + assert.equal(actual.name, feedName); + assert.deepStrictEqual(actual.source, expectedSource, "Source mismatch!"); + assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); + assert.equal( + actual.schema.metrics[0].name, + dataFeedSchema.metrics[0].name, + "Schema metric 1 name mismatch!" + ); + assert.equal( + actual.schema.metrics[1].name, + dataFeedSchema.metrics[1].name, + "Schema metric 2 name mismatch!" + ); + assert.strictEqual(actual.schema.timestampColumn, "", "Schema timestampColumn mismatch!"); + assert.equal( + actual.schema.dimensions![0].displayName, + dataFeedSchema.dimensions![0].displayName, + "Schema dimension 1 display name mismatch!" + ); }); - let createdAzureBlobDataFeedId: string; - let createdAppFeedId: string; - let createdSqlServerFeedId: string; - let createdCosmosFeedId: string; - let createdAzureDataExplorerFeedId: string; - let createdAzureTableFeedId: string; - let createdInfluxFeedId: string; - let createdMongoDbFeedId: string; - let createdMySqlFeedId: string; - let createdPostGreSqlId: string; - let createdDataLakeGenId: string; - let createdEventhubsId: string; - let createdLogAnalyticsId: string; - - describe("DataFeed", async () => { - const metric: DataFeedMetric[] = [ - { - name: "cost", - displayName: "cost", - description: "" - }, - { - name: "revenue", - displayName: "revenue", - description: "" - } - ]; - const dimension: DataFeedDimension[] = [ - { name: "category", displayName: "category" }, - { name: "city", displayName: "city" } - ]; - const dataFeedSchema: DataFeedSchema = { - metrics: metric, - dimensions: dimension - }; - const dataFeedIngestion: DataFeedIngestionSettings = { - ingestionStartTime: new Date(Date.UTC(2020, 7, 21)), - ingestionStartOffsetInSeconds: 0, - dataSourceRequestConcurrency: -1, - ingestionRetryDelayInSeconds: -1, - stopRetryAfterInSeconds: -1 + it("updates an Azure Blob datafeed", async function(this: Context) { + if (!createdAzureBlobDataFeedId) { + this.skip(); + } + const expectedSourceParameter: DataFeedSource = { + dataSourceType: "AzureBlob", + connectionString: "Updated Azure Blob connection string", + container: "Updated Azure Blob container", + blobTemplate: "Updated Azure Blob template", + authenticationType: "ManagedIdentity" }; - const granularity: DataFeedGranularity = { - granularityType: "Daily" + const expectedServerParameter = { + dataSourceType: "AzureBlob", + connectionString: undefined, + container: "Updated Azure Blob container", + blobTemplate: "Updated Azure Blob template", + authenticationType: "ManagedIdentity" }; - const rollupSettings: DataFeedRollupSettings = { - rollupType: "AutoRollup", - rollupMethod: "Sum", - rollupIdentificationValue: "__CUSTOM_SUM__" + const expectedIngestionSettings = { + ingestionStartTime: new Date(Date.UTC(2020, 7, 1)), + ingestionStartOffsetInSeconds: 2, + dataSourceRequestConcurrency: 3, + ingestionRetryDelayInSeconds: 4, + stopRetryAfterInSeconds: 5 }; - const options = { - description: "Data feed description", - rollupSettings: rollupSettings, + const patch: DataFeedPatch = { + source: { + ...expectedSourceParameter + }, + name: recorder.getUniqueName("Updated-Azure-Blob-data-feed-"), + schema: { + timestampColumn: "UpdatedTimestampeColumn" + }, + ingestionSettings: expectedIngestionSettings, + description: "Updated Azure Blob description", + rollupSettings: { + rollupType: "AlreadyRollup", + rollupIdentificationValue: "__Existing__" + }, missingDataPointFillSettings: { - fillType: "CustomValue", - customFillValue: 555 + fillType: "PreviousValue" }, - accessMode: "Private" + accessMode: "Public", + viewerEmails: ["viewer1@example.com"], + actionLinkTemplate: "Updated Azure Blob action link template" }; + const updated = await client.updateDataFeed(createdAzureBlobDataFeedId, patch); + assert.ok(updated.id, "Expecting valid data feed"); + assert.equal(updated.source.dataSourceType, "AzureBlob"); + assert.deepStrictEqual( + updated.source, + (expectedServerParameter as unknown) as AzureBlobDataFeedSource + ); + assert.equal( + updated.source.authenticationType, + expectedSourceParameter.authenticationType + ); + assert.deepStrictEqual(updated.ingestionSettings, expectedIngestionSettings); + assert.equal(updated.description, "Updated Azure Blob description"); + assert.ok(updated.rollupSettings, "Expecting valid updated.options.rollupSettings"); + assert.equal(updated.rollupSettings!.rollupType, "AlreadyRollup"); + assert.equal((updated.rollupSettings! as any).rollupIdentificationValue, "__Existing__"); + assert.equal(updated.missingDataPointFillSettings?.fillType, "PreviousValue"); + assert.equal(updated.accessMode, "Public"); + assert.deepStrictEqual(updated.viewerEmails, ["viewer1@example.com"]); + assert.equal(updated.actionLinkTemplate, "Updated Azure Blob action link template"); + }); - it.skip("creates an Azure Blob datafeed", async () => { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource: DataFeedSource = { - dataSourceType: "AzureBlob", - connectionString: testEnv.METRICS_ADVISOR_AZURE_BLOB_CONNECTION_STRING, - container: "adsample", - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - }; - const expectedSourceByService = ({ - dataSourceType: "AzureBlob", - connectionString: undefined, - container: "adsample", - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - } as unknown) as DataFeedSource; - const feed = { - name: feedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor; - const actual = await client.createDataFeed(feed); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureBlobDataFeedId = actual.id; - - assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); - assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); - assert.equal(actual.name, feedName); - // the service doesn't return sensitive data - assert.deepStrictEqual(actual.source, expectedSourceByService, "Source mismatch!"); - assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); - assert.equal( - actual.schema.metrics[0].name, - dataFeedSchema.metrics[0].name, - "Schema metric 1 name mismatch!" - ); - assert.equal( - actual.schema.metrics[1].name, - dataFeedSchema.metrics[1].name, - "Schema metric 2 name mismatch!" - ); - assert.strictEqual( - actual.schema.timestampColumn, - "", - "Schema timestampColumn mismatch!" - ); + it("creates an Azure Application Insights feed", async () => { + // accessing environment variables here so they are already replaced by test env ones + const expectedSource: DataFeedSource = { + dataSourceType: "AzureApplicationInsights", + azureCloud: "Azure", + authenticationType: "Basic", + applicationId: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID, + apiKey: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_API_KEY, + query: + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" + }; + const actual = await client.createDataFeed({ + name: appInsightsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAppFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureApplicationInsights"); + if (actual.source.dataSourceType === "AzureApplicationInsights") { + assert.equal(actual.source.azureCloud, "Azure"); assert.equal( - actual.schema.dimensions![0].displayName, - dataFeedSchema.dimensions![0].displayName, - "Schema dimension 1 display name mismatch!" - ); - assert.deepStrictEqual( - actual.ingestionSettings, - dataFeedIngestion, - "Ingesting settings mismatch!" + actual.source.applicationId, + testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID ); + assert.equal(actual.source.apiKey, undefined); assert.equal( - actual.metricIds[dataFeedSchema.metrics[0].name], - actual.schema.metrics[0].id + actual.source.query, + "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" ); + } + }); - assert.equal(actual.description, options.description, "options.description mismatch"); - assert.equal( - actual.accessMode, - options.accessMode as DataFeedAccessMode, - "options.accessMode mismatch" - ); - assert.ok( - actual.missingDataPointFillSettings, - "Expecting valid options.missingDataPointFillSettings" - ); - assert.equal( - actual.missingDataPointFillSettings!.fillType, - options.missingDataPointFillSettings!.fillType, - "options.missingDataPointFillSettings.fillType mismatch" - ); - assert.ok( - actual.missingDataPointFillSettings!.fillType, - "Expecting valid options.missingDataPointFillSettings.fillType" - ); - if (actual.missingDataPointFillSettings!.fillType! === "CustomValue") { - // not sure why TS didn't narrow down the union type for us...so casting to any - assert.equal( - (actual.missingDataPointFillSettings! as any).customFillValue, - (options.missingDataPointFillSettings! as any).customFillValue, - "options.missingDataPointFillSettings.customFillValue mismatch" - ); - } - assert.ok(actual.rollupSettings, "Expecting valid options.rollupSettings"); + it("creates an Azure SQL Server Feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "SqlServer", + connectionString: testEnv.METRICS_ADVISOR_AZURE_SQL_SERVER_CONNECTION_STRING, + query: "select * from adsample2 where Timestamp = @StartTime", + authenticationType: "Basic" + }; + const feed = { + name: sqlServerFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor; + const actual = await client.createDataFeed(feed); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdSqlServerFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "SqlServer"); + if (actual.source.dataSourceType === "SqlServer") { + assert.equal((actual.source as any).connectionString, undefined); assert.equal( - actual.rollupSettings!.rollupType, - options.rollupSettings!.rollupType, - "options.missingDataPointFillSettings.rollupType mismatch" - ); - assert.ok( - actual.rollupSettings!.rollupType, - "Expecting valid options.missingDataPointFillSettings.fillType" + actual.source.query, + "select * from adsample2 where Timestamp = @StartTime" ); - if (actual.rollupSettings!.rollupType! === "AutoRollup") { - // not sure why TS didn't narrow down the union type for us...so casting to any - assert.equal( - (actual.rollupSettings! as any).rollupIdentificationValue, - (options.rollupSettings! as any).rollupIdentificationValue, - "options.missingDataPointFillSettings.fillType mismatch" - ); + } + }); + + it("lists datafeed", async function() { + const iterator = client.listDataFeeds({ + filter: { + dataFeedName: "js-test-" } }); + let result = await iterator.next(); + assert.ok(result.value.status, "Expecting first data feed"); + result = await iterator.next(); + assert.ok(result.value.status, "Expecting second data feed"); + }); - it.skip("retrieves an Azure Blob datafeed", async function(this: Context) { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource = ({ - dataSourceType: "AzureBlob", - container: "adsample", - connectionString: undefined, - blobTemplate: testEnv.METRICS_ADVISOR_AZURE_BLOB_TEMPLATE, - authenticationType: "Basic" - } as unknown) as AzureBlobDataFeedSource; + it("lists datafeed by pages", async function() { + const iterator = client + .listDataFeeds({ + filter: { + dataFeedName: "js-test-" + } + }) + .byPage({ maxPageSize: 1 }); + let result = await iterator.next(); + assert.equal(result.value.length, 1, "Expecting one entry in first page"); + result = await iterator.next(); + assert.equal(result.value.length, 1, "Expecting one entry in second page"); + }); - if (!createdAzureBlobDataFeedId) { - this.skip(); - } + it("deletes an Azure Blob datafeed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureBlobDataFeedId); + }); - const actual = await client.getDataFeed(createdAzureBlobDataFeedId); - assert.equal(actual.schema.metrics?.length, 2, "Expecting two metrics"); - assert.equal(actual.schema.dimensions?.length, 2, "Expecting two dimensions"); - assert.equal(actual.name, feedName); - assert.deepStrictEqual(actual.source, expectedSource, "Source mismatch!"); - assert.deepStrictEqual(actual.granularity, granularity, "Granularity mismatch!"); - assert.equal( - actual.schema.metrics[0].name, - dataFeedSchema.metrics[0].name, - "Schema metric 1 name mismatch!" - ); - assert.equal( - actual.schema.metrics[1].name, - dataFeedSchema.metrics[1].name, - "Schema metric 2 name mismatch!" - ); - assert.strictEqual( - actual.schema.timestampColumn, - "", - "Schema timestampColumn mismatch!" - ); - assert.equal( - actual.schema.dimensions![0].displayName, - dataFeedSchema.dimensions![0].displayName, - "Schema dimension 1 display name mismatch!" - ); - }); + it("deletes an Azure Application Insights feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAppFeedId); + }); - it.skip("updates an Azure Blob datafeed", async function(this: Context) { - if (!createdAzureBlobDataFeedId) { - this.skip(); - } - const expectedSourceParameter: DataFeedSource = { - dataSourceType: "AzureBlob", - connectionString: "Updated Azure Blob connection string", - container: "Updated Azure Blob container", - blobTemplate: "Updated Azure Blob template", - authenticationType: "ManagedIdentity" - }; - const expectedServerParameter = { - dataSourceType: "AzureBlob", - connectionString: undefined, - container: "Updated Azure Blob container", - blobTemplate: "Updated Azure Blob template", - authenticationType: "ManagedIdentity" - }; - const expectedIngestionSettings = { - ingestionStartTime: new Date(Date.UTC(2020, 7, 1)), - ingestionStartOffsetInSeconds: 2, - dataSourceRequestConcurrency: 3, - ingestionRetryDelayInSeconds: 4, - stopRetryAfterInSeconds: 5 - }; - const patch: DataFeedPatch = { - source: { - ...expectedSourceParameter - }, - name: recorder.getUniqueName("Updated-Azure-Blob-data-feed-"), - schema: { - timestampColumn: "UpdatedTimestampeColumn" - }, - ingestionSettings: expectedIngestionSettings, - description: "Updated Azure Blob description", - rollupSettings: { - rollupType: "AlreadyRollup", - rollupIdentificationValue: "__Existing__" - }, - missingDataPointFillSettings: { - fillType: "PreviousValue" - }, - accessMode: "Public", - viewerEmails: ["viewer1@example.com"], - actionLinkTemplate: "Updated Azure Blob action link template" - }; - const updated = await client.updateDataFeed(createdAzureBlobDataFeedId, patch); - assert.ok(updated.id, "Expecting valid data feed"); - assert.equal(updated.source.dataSourceType, "AzureBlob"); - assert.deepStrictEqual( - updated.source, - (expectedServerParameter as unknown) as AzureBlobDataFeedSource - ); - assert.equal( - updated.source.authenticationType, - expectedSourceParameter.authenticationType - ); - assert.deepStrictEqual(updated.ingestionSettings, expectedIngestionSettings); - assert.equal(updated.description, "Updated Azure Blob description"); - assert.ok(updated.rollupSettings, "Expecting valid updated.options.rollupSettings"); - assert.equal(updated.rollupSettings!.rollupType, "AlreadyRollup"); + it("deletes an Azure SQL Server feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdSqlServerFeedId); + }); + + it("creates an Azure Cosmos DB Feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureCosmosDB", + connectionString: "Server=server.example.net;Encrypt=True;", + sqlQuery: "let starttime=datetime(@StartTime); let endtime=starttime", + database: "sample", + collectionId: "sample", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: cosmosFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdCosmosFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureCosmosDB"); + if (actual.source.dataSourceType === "AzureCosmosDB") { + assert.equal(actual.source.connectionString, undefined); assert.equal( - (updated.rollupSettings! as any).rollupIdentificationValue, - "__Existing__" + actual.source.sqlQuery, + "let starttime=datetime(@StartTime); let endtime=starttime" ); - assert.equal(updated.missingDataPointFillSettings?.fillType, "PreviousValue"); - assert.equal(updated.accessMode, "Public"); - assert.deepStrictEqual(updated.viewerEmails, ["viewer1@example.com"]); - assert.equal(updated.actionLinkTemplate, "Updated Azure Blob action link template"); - }); + assert.equal(actual.source.database, "sample"); + assert.equal(actual.source.collectionId, "sample"); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it.skip("creates an Azure Application Insights feed", async () => { - // accessing environment variables here so they are already replaced by test env ones - const expectedSource: DataFeedSource = { - dataSourceType: "AzureApplicationInsights", - azureCloud: "Azure", - authenticationType: "Basic", - applicationId: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID, - apiKey: testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_API_KEY, - query: - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" - }; - const actual = await client.createDataFeed({ - name: appInsightsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); + it("deletes an Azure Cosmos DB", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdCosmosFeedId); + }); - assert.ok(actual.id, "Expecting valid data feed id"); - createdAppFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureApplicationInsights"); - if (actual.source.dataSourceType === "AzureApplicationInsights") { - assert.equal(actual.source.azureCloud, "Azure"); - assert.equal( - actual.source.applicationId, - testEnv.METRICS_ADVISOR_AZURE_APPINSIGHTS_APPLICATION_ID - ); - assert.equal(actual.source.apiKey, undefined); - assert.equal( - actual.source.query, - "let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode" - ); - } - }); + it("creates an Azure Data Explorer feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureDataExplorer", + connectionString: "Server=server.example.net;Encrypt=True;", + query: "let starttime=datetime(@StartTime); let endtime=starttime", + authenticationType: "ManagedIdentity" + }; + const actual = await client.createDataFeed({ + name: dataExplorerFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureDataExplorerFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureDataExplorer"); + if (actual.source.dataSourceType === "AzureDataExplorer") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "let starttime=datetime(@StartTime); let endtime=starttime" + ); + assert.equal(actual.source.authenticationType, "ManagedIdentity"); + } + }); - it.skip("creates an Azure SQL Server Feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "SqlServer", - connectionString: testEnv.METRICS_ADVISOR_AZURE_SQL_SERVER_CONNECTION_STRING, - query: "select * from adsample2 where Timestamp = @StartTime", - authenticationType: "Basic" - }; - const feed = { - name: sqlServerFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor; - const actual = await client.createDataFeed(feed); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdSqlServerFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "SqlServer"); - if (actual.source.dataSourceType === "SqlServer") { - assert.equal((actual.source as any).connectionString, undefined); - assert.equal( - actual.source.query, - "select * from adsample2 where Timestamp = @StartTime" - ); - } - }); + it("deletes an Azure Data Explorer feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureDataExplorerFeedId); + }); - it.skip("lists datafeed", async function() { - const iterator = client.listDataFeeds({ - filter: { - dataFeedName: "js-test-" - } - }); - let result = await iterator.next(); - assert.ok(result.value.status, "Expecting first data feed"); - result = await iterator.next(); - assert.ok(result.value.status, "Expecting second data feed"); - }); + it("creates an Azure Table feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "AzureTable", + connectionString: "https://table.example.net", + table: "table-name", + query: "partition-key eq @start-time", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: azureTableFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdAzureTableFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureTable"); + if (actual.source.dataSourceType === "AzureTable") { + assert.equal(actual.source.connectionString, undefined); + assert.equal(actual.source.table, "table-name"); + assert.equal(actual.source.query, "partition-key eq @start-time"); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it.skip("lists datafeed by pages", async function() { - const iterator = client - .listDataFeeds({ - filter: { - dataFeedName: "js-test-" - } - }) - .byPage({ maxPageSize: 1 }); - let result = await iterator.next(); - assert.equal(result.value.length, 1, "Expecting one entry in first page"); - result = await iterator.next(); - assert.equal(result.value.length, 1, "Expecting one entry in second page"); - }); + it("deletes an Azure Table feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdAzureTableFeedId); + }); - it.skip("deletes an Azure Blob datafeed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureBlobDataFeedId); - }); + it("creates InfluxDB data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "InfluxDB", + connectionString: "https://connect-to-influxdb", + database: "data-feed-database", + userName: "user", + password: "pwd1", + query: "partition-key eq @start-time", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: influxDbFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdInfluxFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "InfluxDB"); + if (actual.source.dataSourceType === "InfluxDB") { + assert.equal(actual.source.connectionString, "https://connect-to-influxdb"); + assert.equal(actual.source.database, "data-feed-database"); + assert.equal(actual.source.userName, "user"); + assert.equal(actual.source.password, undefined); + assert.equal(actual.source.query, "partition-key eq @start-time"); + } + }); - it.skip("deletes an Azure Application Insights feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAppFeedId); - }); + it("deletes InfluxDB data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdInfluxFeedId); + }); - it.skip("deletes an Azure SQL Server feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdSqlServerFeedId); - }); + it("creates MongoDB data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "MongoDB", + connectionString: "https://connect-to-mongodb", + database: "data-feed-mongodb", + command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: mongoDbFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdMongoDbFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "MongoDB"); + if (actual.source.dataSourceType === "MongoDB") { + assert.equal(actual.source.connectionString, undefined); + assert.equal(actual.source.database, "data-feed-mongodb"); + assert.equal( + actual.source.command, + "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it.skip("creates an Azure Cosmos DB Feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureCosmosDB", - connectionString: "Server=server.example.net;Encrypt=True;", - sqlQuery: "let starttime=datetime(@StartTime); let endtime=starttime", - database: "sample", - collectionId: "sample", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: cosmosFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); + it("deletes MongoDB data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdMongoDbFeedId); + }); - assert.ok(actual.id, "Expecting valid data feed id"); - createdCosmosFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureCosmosDB"); - if (actual.source.dataSourceType === "AzureCosmosDB") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.sqlQuery, - "let starttime=datetime(@StartTime); let endtime=starttime" - ); - assert.equal(actual.source.database, "sample"); - assert.equal(actual.source.collectionId, "sample"); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); + it("creates MySQL data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "MySql", + connectionString: "https://connect-to-mysql", + query: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: mySqlFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdMySqlFeedId = actual.id; + assert.equal(actual.source.dataSourceType, "MySql"); + if (actual.source.dataSourceType === "MySql") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it.skip("deletes an Azure Cosmos DB", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdCosmosFeedId); - }); + it("deletes MySQL data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdMySqlFeedId); + }); - it.skip("creates an Azure Data Explorer feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureDataExplorer", - connectionString: "Server=server.example.net;Encrypt=True;", - query: "let starttime=datetime(@StartTime); let endtime=starttime", - authenticationType: "ManagedIdentity" - }; - const actual = await client.createDataFeed({ - name: dataExplorerFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); + it("creates Datalake Gen 2 data feed", async () => { + const expectedSource: AzureDataLakeStorageGen2DataFeedSource = { + dataSourceType: "AzureDataLakeStorageGen2", + directoryTemplate: "directory-template", + fileSystemName: "file-system-name", + fileTemplate: "file-template", + accountKey: "account-key", + accountName: "account-name", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: datalakeGenFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdDataLakeGenId = actual.id; + assert.equal(actual.source.dataSourceType, "AzureDataLakeStorageGen2"); + if (actual.source.dataSourceType === "AzureDataLakeStorageGen2") { + assert.equal(actual.source.accountName, expectedSource.accountName); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + assert.equal(actual.source.fileSystemName, expectedSource.fileSystemName); + assert.equal(actual.source.fileTemplate, expectedSource.fileTemplate); + assert.equal(actual.source.directoryTemplate, expectedSource.directoryTemplate); + } + }); - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureDataExplorerFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureDataExplorer"); - if (actual.source.dataSourceType === "AzureDataExplorer") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.query, - "let starttime=datetime(@StartTime); let endtime=starttime" - ); - assert.equal(actual.source.authenticationType, "ManagedIdentity"); - } - }); + it("deletes Datalake Gen 2 data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdDataLakeGenId); + }); - it.skip("deletes an Azure Data Explorer feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureDataExplorerFeedId); - }); + it("creates Eventhubs data feed", async () => { + const expectedSource: AzureEventHubsDataFeedSource = { + dataSourceType: "AzureEventHubs", + authenticationType: "Basic", + connectionString: testEnv.METRICS_EVENTHUB_CONNECTION_STRING, + consumerGroup: testEnv.METRICS_EVENTHUB_CONSUMER_GROUP + }; + const actual = await client.createDataFeed({ + name: eventHubsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdEventhubsId = actual.id; + assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); + if (actual.source.dataSourceType === "AzureEventHubs") { + assert.equal(actual.source.consumerGroup, expectedSource.consumerGroup); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + assert.equal(actual.source.connectionString, undefined); + } + }); - it.skip("creates an Azure Table feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "AzureTable", - connectionString: "https://table.example.net", - table: "table-name", - query: "partition-key eq @start-time", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: azureTableFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); + it("deletes Eventhubs data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdEventhubsId); + }); - assert.ok(actual.id, "Expecting valid data feed id"); - createdAzureTableFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureTable"); - if (actual.source.dataSourceType === "AzureTable") { - assert.equal(actual.source.connectionString, undefined); - assert.equal(actual.source.table, "table-name"); - assert.equal(actual.source.query, "partition-key eq @start-time"); - assert.equal(actual.source.authenticationType, "Basic"); + it("creates Log Analytics data feed", async () => { + const expectedSource: AzureLogAnalyticsDataFeedSource = { + dataSourceType: "AzureLogAnalytics", + authenticationType: "Basic", + clientId: "client-id", + clientSecret: "client-secret", + tenantId: "tenant-id", + workspaceId: "workspace-id", + query: "query" + }; + const actual = await client.createDataFeed({ + name: logAnalyticsFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdLogAnalyticsId = actual.id; + assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); + if (actual.source.dataSourceType === "AzureLogAnalytics") { + assert.equal(actual.source.query, expectedSource.query); + assert.equal(actual.source.workspaceId, expectedSource.workspaceId); + assert.equal(actual.source.authenticationType, expectedSource.authenticationType); + if (actual.source.authenticationType === "Basic") { + assert.equal(actual.source.tenantId, expectedSource.tenantId); + assert.equal(actual.source.clientId, expectedSource.clientId); + assert.equal(actual.source.clientSecret, undefined); } - }); - - it.skip("deletes an Azure Table feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdAzureTableFeedId); - }); - - it.skip("creates InfluxDB data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "InfluxDB", - connectionString: "https://connect-to-influxdb", - database: "data-feed-database", - userName: "user", - password: "pwd1", - query: "partition-key eq @start-time", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: influxDbFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); + } + }); - assert.ok(actual.id, "Expecting valid data feed id"); - createdInfluxFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "InfluxDB"); - if (actual.source.dataSourceType === "InfluxDB") { - assert.equal(actual.source.connectionString, "https://connect-to-influxdb"); - assert.equal(actual.source.database, "data-feed-database"); - assert.equal(actual.source.userName, "user"); - assert.equal(actual.source.password, undefined); - assert.equal(actual.source.query, "partition-key eq @start-time"); - } - }); + it("deletes Log Analytics data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdLogAnalyticsId); + }); - it.skip("deletes InfluxDB data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdInfluxFeedId); - }); + it("creates PostgreSQL data feed", async () => { + const expectedSource: DataFeedSource = { + dataSourceType: "PostgreSql", + connectionString: "https://connect-to-postgresql", + query: "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }", + authenticationType: "Basic" + }; + const actual = await client.createDataFeed({ + name: postgreSqlFeedName, + source: expectedSource, + granularity, + schema: dataFeedSchema, + ingestionSettings: dataFeedIngestion, + ...options + } as DataFeedDescriptor); + + assert.ok(actual.id, "Expecting valid data feed id"); + createdPostGreSqlId = actual.id; + assert.equal(actual.source.dataSourceType, "PostgreSql"); + if (actual.source.dataSourceType === "PostgreSql") { + assert.equal(actual.source.connectionString, undefined); + assert.equal( + actual.source.query, + "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }" + ); + assert.equal(actual.source.authenticationType, "Basic"); + } + }); - it.skip("creates MongoDB data feed", async () => { - const expectedSource: DataFeedSource = { + it("updates data feed to have a different data source type", async function() { + const patch: DataFeedPatch = { + source: { dataSourceType: "MongoDB", - connectionString: "https://connect-to-mongodb", - database: "data-feed-mongodb", + connectionString: "https://connect-to-mongodb-patch", + database: "data-feed-mongodb-patch", command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: mongoDbFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdMongoDbFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "MongoDB"); - if (actual.source.dataSourceType === "MongoDB") { - assert.equal(actual.source.connectionString, undefined); - assert.equal(actual.source.database, "data-feed-mongodb"); - assert.equal( - actual.source.command, - "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); - - it.skip("deletes MongoDB data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdMongoDbFeedId); - }); - - it.skip("creates MySQL data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "MySql", - connectionString: "https://connect-to-mysql", - query: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: mySqlFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdMySqlFeedId = actual.id; - assert.equal(actual.source.dataSourceType, "MySql"); - if (actual.source.dataSourceType === "MySql") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.query, - "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); } - }); - - it.skip("deletes MySQL data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdMySqlFeedId); - }); - - it.skip("creates Datalake Gen 2 data feed", async () => { - const expectedSource: AzureDataLakeStorageGen2DataFeedSource = { - dataSourceType: "AzureDataLakeStorageGen2", - directoryTemplate: "directory-template", - fileSystemName: "file-system-name", - fileTemplate: "file-template", - accountKey: "account-key", - accountName: "account-name", + }; + const patchServer = { + source: { + dataSourceType: "MongoDB", + connectionString: undefined, + database: "data-feed-mongodb-patch", + command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ - name: datalakeGenFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdDataLakeGenId = actual.id; - assert.equal(actual.source.dataSourceType, "AzureDataLakeStorageGen2"); - if (actual.source.dataSourceType === "AzureDataLakeStorageGen2") { - assert.equal(actual.source.accountName, expectedSource.accountName); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - assert.equal(actual.source.fileSystemName, expectedSource.fileSystemName); - assert.equal(actual.source.fileTemplate, expectedSource.fileTemplate); - assert.equal(actual.source.directoryTemplate, expectedSource.directoryTemplate); - } - }); - - it.skip("deletes Datalake Gen 2 data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdDataLakeGenId); - }); - - it("creates Eventhubs data feed", async () => { - const expectedSource: AzureEventHubsDataFeedSource = { - dataSourceType: "AzureEventHubs", - authenticationType: "Basic", - connectionString: testEnv.METRICS_EVENTHUB_CONNECTION_STRING, - consumerGroup: testEnv.METRICS_EVENTHUB_CONSUMER_GROUP - }; - const actual = await client.createDataFeed({ - name: eventHubsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdEventhubsId = actual.id; - assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); - if (actual.source.dataSourceType === "AzureEventHubs") { - assert.equal(actual.source.consumerGroup, expectedSource.consumerGroup); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - assert.equal(actual.source.connectionString, undefined); - } - }); - - it("deletes Eventhubs data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdEventhubsId); - }); - - it.skip("creates Log Analytics data feed", async () => { - const expectedSource: AzureLogAnalyticsDataFeedSource = { - dataSourceType: "AzureLogAnalytics", - authenticationType: "Basic", - clientId: "client-id", - clientSecret: "client-secret", - tenantId: "tenant-id", - workspaceId: "workspace-id", - query: "query" - }; - const actual = await client.createDataFeed({ - name: logAnalyticsFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdLogAnalyticsId = actual.id; - assert.equal(actual.source.dataSourceType, expectedSource.dataSourceType); - if (actual.source.dataSourceType === "AzureLogAnalytics") { - assert.equal(actual.source.query, expectedSource.query); - assert.equal(actual.source.workspaceId, expectedSource.workspaceId); - assert.equal(actual.source.authenticationType, expectedSource.authenticationType); - if (actual.source.authenticationType === "Basic") { - assert.equal(actual.source.tenantId, expectedSource.tenantId); - assert.equal(actual.source.clientId, expectedSource.clientId); - assert.equal(actual.source.clientSecret, undefined); - } } - }); + }; + const updated = await client.updateDataFeed(createdPostGreSqlId, patch); + assert.ok(updated.id, "Expecting valid data feed"); + assert.equal(updated.source.dataSourceType, "MongoDB"); + + assert.deepStrictEqual( + updated.source, + (patchServer.source as unknown) as MongoDbDataFeedSource + ); + }); - it.skip("deletes Log Analytics data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdLogAnalyticsId); - }); + it("deletes PostgreSQL data feed", async function(this: Context) { + await verifyDataFeedDeletion(this, client, createdPostGreSqlId); + }); - it.skip("creates PostgreSQL data feed", async () => { - const expectedSource: DataFeedSource = { - dataSourceType: "PostgreSql", - connectionString: "https://connect-to-postgresql", - query: "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - }; - const actual = await client.createDataFeed({ + it("creates Unknown data feed", async () => { + const expectedSource: UnknownDataFeedSource = { + dataSourceType: "Unknown", + dataSourceParameter: "", + authenticationType: "Basic" + }; + try { + await client.createDataFeed({ name: postgreSqlFeedName, source: expectedSource, granularity, @@ -807,96 +857,33 @@ matrix([[true, false]] as const, async (useAad) => { ingestionSettings: dataFeedIngestion, ...options } as DataFeedDescriptor); - - assert.ok(actual.id, "Expecting valid data feed id"); - createdPostGreSqlId = actual.id; - assert.equal(actual.source.dataSourceType, "PostgreSql"); - if (actual.source.dataSourceType === "PostgreSql") { - assert.equal(actual.source.connectionString, undefined); - assert.equal( - actual.source.query, - "{ find: postgresql,filter: { Time: @StartTime },batch: 200 }" - ); - assert.equal(actual.source.authenticationType, "Basic"); - } - }); - - it.skip("updates data feed to have a different data source type", async function() { - const patch: DataFeedPatch = { - source: { - dataSourceType: "MongoDB", - connectionString: "https://connect-to-mongodb-patch", - database: "data-feed-mongodb-patch", - command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - } - }; - const patchServer = { - source: { - dataSourceType: "MongoDB", - connectionString: undefined, - database: "data-feed-mongodb-patch", - command: "{ find: mongodb,filter: { Time: @StartTime },batch: 200 }", - authenticationType: "Basic" - } - }; - const updated = await client.updateDataFeed(createdPostGreSqlId, patch); - assert.ok(updated.id, "Expecting valid data feed"); - assert.equal(updated.source.dataSourceType, "MongoDB"); - - assert.deepStrictEqual( - updated.source, - (patchServer.source as unknown) as MongoDbDataFeedSource + assert.fail("Test should throw error"); + } catch (error) { + assert.equal( + (error as any).message, + "Cannot create a data feed with the Unknown source type." ); - }); - - it.skip("deletes PostgreSQL data feed", async function(this: Context) { - await verifyDataFeedDeletion(this, client, createdPostGreSqlId); - }); - - it.skip("creates Unknown data feed", async () => { - const expectedSource: UnknownDataFeedSource = { - dataSourceType: "Unknown", - dataSourceParameter: "", - authenticationType: "Basic" - }; - try { - await client.createDataFeed({ - name: postgreSqlFeedName, - source: expectedSource, - granularity, - schema: dataFeedSchema, - ingestionSettings: dataFeedIngestion, - ...options - } as DataFeedDescriptor); - assert.fail("Test should throw error"); - } catch (error) { - assert.equal( - (error as any).message, - "Cannot create a data feed with the Unknown source type." - ); - } - }); + } + }); - it.skip("updates data feed to have an unknown data source type", async function() { - const patch: DataFeedPatch = { - source: { - dataSourceType: "Unknown" - } - }; - try { - await client.updateDataFeed(createdPostGreSqlId, patch); - assert.fail("Test should throw error"); - } catch (error) { - assert.equal( - (error as any).message, - "Cannot update a data feed to have the Unknown source type." - ); + it("updates data feed to have an unknown data source type", async function() { + const patch: DataFeedPatch = { + source: { + dataSourceType: "Unknown" } - }); + }; + try { + await client.updateDataFeed(createdPostGreSqlId, patch); + assert.fail("Test should throw error"); + } catch (error) { + assert.equal( + (error as any).message, + "Cannot update a data feed to have the Unknown source type." + ); + } }); - }) - .timeout(60000); + }); + }).timeout(60000); }); }); From 51cb9d4b3a00993a1691b569719a79379e6eae90 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 14:08:40 -0700 Subject: [PATCH 06/11] update recordings and changelog --- .../ai-metrics-advisor/CHANGELOG.md | 18 +++++++++++++++++- ...eates_an_azure_application_insights_feed.js | 4 ++-- ...eates_an_azure_application_insights_feed.js | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md index 0d7df83f7fc2..c12012f8b95e 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md @@ -1,7 +1,23 @@ # Release History -## 1.0.0 (Unreleased) +## 1.0.0 (2021-07-06) +### Breaking Changes + +- `listIncidents()` overloads split into `listInclidentsForAlert()` and `listIncidentsForDetectionConfiguration()` +- `listAnomalies()` overloads split into `listAnomaliesForAlert()` and `listAnomaliesForDetectionConfiguration()` +- Removed support for granularity type `PerSecond` +- Returning the objects as part of update method response +- Made the parameters containing sensitive data in datasource credential and data feed source types as optional +- Rename "createFeedback" to "addFeedback" +- `seriesToFilter` parameter renamed to `seriesKey` in methods `getmetricenrichedseriesdata` and `getmetricseriesdata` and ordering updated +- Rename type `DetectionConditionsOperator` to `DetectionConditionOperator` +- Rename property `splitAlertByDimension` to `dimensionsToSplitAlert` in `AnomalyAlertConfiguration` +- Rename `datasource` to `DataSource` +- Renamed `DatasourceCredential` to `DataSourceCredentialEntity`, `SqlServerConnectionStringDataSourceCredential` to `DataSourceSqlConnectionString`, + `DataLakeGen2SharedKeyDataSourceCredential` to `DataSourceDataLakeGen2SharedKey`, + `ServicePrincipalDataSourceCredential` to `DataSourceServicePrincipal`, + `ServicePrincipalInKeyVaultDataSourceCredential` to `DataSourceServicePrincipalInKeyVault` ## 1.0.0-beta.4 (2021-06-07) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js index 87aad51080e4..b82f12895786 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js @@ -38,7 +38,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureApplicationInsights","dataFeedName":"js-test-appInsightsFeed-162267887276101760","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"azureCloud":"Azure","applicationId":"appInsights_application","apiKey":"appInsights_app_key","query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureApplicationInsights","dataFeedName":"js-test-appInsightsFeed-162267887276101760","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"azureCloud":"Azure","applicationId":"appInsights_application","apiKey":"appInsights_app_key","query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode"}}) .reply(201, "", [ 'Content-Length', '0', @@ -60,7 +60,7 @@ nock('https://endpoint:443', {"encodedQueryParams":true}) nock('https://endpoint:443', {"encodedQueryParams":true}) .get('/metricsadvisor/v1.0/dataFeeds/5917f2d4-ac54-452c-8db2-bde8be040499') - .reply(200, {"dataFeedId":"5917f2d4-ac54-452c-8db2-bde8be040499","dataFeedName":"js-test-appInsightsFeed-162267887276101760","metrics":[{"metricId":"68178aa0-13d7-452b-a2fd-d7753fad12df","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"506ee426-defd-4a24-837d-da21e6f0feb3","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00Z","dataSourceType":"AzureApplicationInsights","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-03T00:08:01Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode","azureCloud":"Azure","applicationId":"appInsights_application"},"authenticationType":"Basic"}, [ + .reply(200, {"dataFeedId":"5917f2d4-ac54-452c-8db2-bde8be040499","dataFeedName":"js-test-appInsightsFeed-162267887276101760","metrics":[{"metricId":"68178aa0-13d7-452b-a2fd-d7753fad12df","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"506ee426-defd-4a24-837d-da21e6f0feb3","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00Z","dataSourceType":"AzureApplicationInsights","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-03T00:08:01Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode","azureCloud":"Azure","applicationId":"appInsights_application"},"authenticationType":"Basic"}, [ 'Content-Length', '1661', 'Content-Type', diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js index 9f462834e77a..245299ee1fb1 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.js @@ -5,7 +5,7 @@ module.exports.hash = "993030f77f9ce497bd2e0e07500b3f4f"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureApplicationInsights","dataFeedName":"js-test-appInsightsFeed-162267904090105484","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"azureCloud":"Azure","applicationId":"appInsights_application","apiKey":"appInsights_app_key","query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureApplicationInsights","dataFeedName":"js-test-appInsightsFeed-162267904090105484","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"azureCloud":"Azure","applicationId":"appInsights_application","apiKey":"appInsights_app_key","query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode"}}) .reply(201, "", [ 'Content-Length', '0', @@ -27,7 +27,7 @@ nock('https://endpoint:443', {"encodedQueryParams":true}) nock('https://endpoint:443', {"encodedQueryParams":true}) .get('/metricsadvisor/v1.0/dataFeeds/dc7ef668-0f8c-43fb-a398-f7cb22e4c391') - .reply(200, {"dataFeedId":"dc7ef668-0f8c-43fb-a398-f7cb22e4c391","dataFeedName":"js-test-appInsightsFeed-162267904090105484","metrics":[{"metricId":"13bd9294-ab5c-4a96-ac8a-73e991bbc16f","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"ff61d52e-e522-4cc3-903c-5d8d47c00fc2","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00Z","dataSourceType":"AzureApplicationInsights","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-03T00:10:49Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode","azureCloud":"Azure","applicationId":"appInsights_application"},"authenticationType":"Basic"}, [ + .reply(200, {"dataFeedId":"dc7ef668-0f8c-43fb-a398-f7cb22e4c391","dataFeedName":"js-test-appInsightsFeed-162267904090105484","metrics":[{"metricId":"13bd9294-ab5c-4a96-ac8a-73e991bbc16f","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"ff61d52e-e522-4cc3-903c-5d8d47c00fc2","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00Z","dataSourceType":"AzureApplicationInsights","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-03T00:10:49Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"query":"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode","azureCloud":"Azure","applicationId":"appInsights_application"},"authenticationType":"Basic"}, [ 'Content-Length', '1631', 'Content-Type', From f2a54ab7c824aae81e7bc79774d3c2cb113bbb53 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 14:14:51 -0700 Subject: [PATCH 07/11] updated changelog --- sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md index c12012f8b95e..5c18b09bf85f 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md @@ -8,12 +8,11 @@ - `listAnomalies()` overloads split into `listAnomaliesForAlert()` and `listAnomaliesForDetectionConfiguration()` - Removed support for granularity type `PerSecond` - Returning the objects as part of update method response -- Made the parameters containing sensitive data in datasource credential and data feed source types as optional -- Rename "createFeedback" to "addFeedback" +- Renamed "createFeedback" to "addFeedback" - `seriesToFilter` parameter renamed to `seriesKey` in methods `getmetricenrichedseriesdata` and `getmetricseriesdata` and ordering updated -- Rename type `DetectionConditionsOperator` to `DetectionConditionOperator` -- Rename property `splitAlertByDimension` to `dimensionsToSplitAlert` in `AnomalyAlertConfiguration` -- Rename `datasource` to `DataSource` +- Renamed type `DetectionConditionsOperator` to `DetectionConditionOperator` +- Renamed property `splitAlertByDimension` to `dimensionsToSplitAlert` in `AnomalyAlertConfiguration` +- Renamed `datasource` to `DataSource` - Renamed `DatasourceCredential` to `DataSourceCredentialEntity`, `SqlServerConnectionStringDataSourceCredential` to `DataSourceSqlConnectionString`, `DataLakeGen2SharedKeyDataSourceCredential` to `DataSourceDataLakeGen2SharedKey`, `ServicePrincipalDataSourceCredential` to `DataSourceServicePrincipal`, From 9a55d51b0aa0bd0d256a11ab475931885257b2ec Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 14:30:39 -0700 Subject: [PATCH 08/11] recordings eventhub --- .../recording_creates_eventhubs_data_feed.js | 32 +++++++++---------- .../recording_deletes_eventhubs_data_feed.js | 28 ++++++++-------- .../recording_creates_eventhubs_data_feed.js | 26 +++++++-------- .../recording_deletes_eventhubs_data_feed.js | 20 ++++++------ 4 files changed, 53 insertions(+), 53 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index 5693cdadeb55..c88723a0acc4 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,7 +2,7 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162501549374303385","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162501549374407055","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162501549374409372","js-test-cosmosFeed-":"js-test-cosmosFeed-162501549374404583","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162501549374402830","js-test-tableFeed-":"js-test-tableFeed-162501549374403013","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162501549374403874","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162501549374401328","js-test-influxdbFeed-":"js-test-influxdbFeed-162501549374405767","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162501549374400492","js-test-mySqlFeed-":"js-test-mySqlFeed-162501549374400512","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162501549374405259","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162501549374404453"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508838933800060","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508838933908238","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508838933903707","js-test-cosmosFeed-":"js-test-cosmosFeed-162508838933908815","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508838933908042","js-test-tableFeed-":"js-test-tableFeed-162508838933902172","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162508838933908981","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508838933908089","js-test-influxdbFeed-":"js-test-influxdbFeed-162508838933907561","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508838933905214","js-test-mySqlFeed-":"js-test-mySqlFeed-162508838933906304","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508838933904856","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508838933903815"},"newDate":{}} nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F") @@ -22,59 +22,59 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '6b9f087b-20b0-4ee8-94bc-bb82a26afd00', + '58d66bda-883d-47ec-9017-50fb908e0a00', 'x-ms-ests-server', '2.1.11829.9 - WUS2 ProdSlices', 'Set-Cookie', - 'fpc=AmwyupDbd-tMrRR11faNSarGLH8mAQAAAMa7bdgOAAAA; expires=Fri, 30-Jul-2021 01:11:34 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Al9eBBCAAEpMvjijgnepfunGLH8mAQAAAIXYbtgOAAAA; expires=Fri, 30-Jul-2021 21:26:30 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 30 Jun 2021 01:11:34 GMT', + 'Wed, 30 Jun 2021 21:26:29 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162501549374403874","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162508838933908981","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555', 'x-request-id', - '6b6026e1-388f-4ea2-9b45-422623e55dce', + 'd98712d7-3ea5-481d-83ad-865f91231269', 'x-envoy-upstream-service-time', - '7082', + '7046', 'apim-request-id', - '6b6026e1-388f-4ea2-9b45-422623e55dce', + 'd98712d7-3ea5-481d-83ad-865f91231269', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:42 GMT' + 'Wed, 30 Jun 2021 21:26:37 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') - .reply(200, {"dataFeedId":"c10dc263-1583-45f7-826c-84fcb87261db","dataFeedName":"js-test-httpRequestFeed-162501549374403874","metrics":[{"metricId":"cc2d8af3-00d5-4099-a845-8b0061d4190a","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"dda000dc-2f75-422d-9a93-3064d0fcdac9","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-30T01:11:42Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') + .reply(200, {"dataFeedId":"f1002588-ce6b-4c63-ae1f-8bbb6410d555","dataFeedName":"js-test-httpRequestFeed-162508838933908981","metrics":[{"metricId":"69f836a5-71a0-4754-af2a-0ded4b02a105","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"be80e07b-92b5-4ebc-a635-cc37298ef4bf","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-30T21:26:37Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', '1263', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '96fce0e9-d1a3-451f-80dc-9ee81042275e', + '90d3d83c-6d3a-4375-8591-fb665caad37a', 'x-envoy-upstream-service-time', - '400', + '5293', 'apim-request-id', - '96fce0e9-d1a3-451f-80dc-9ee81042275e', + '90d3d83c-6d3a-4375-8591-fb665caad37a', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:43 GMT' + 'Wed, 30 Jun 2021 21:26:42 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index 11a25eb3138c..93213919a3d0 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -22,57 +22,57 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'a0a245b3-b5a2-4f30-a34b-ea9d1e841a01', + '8fe8fb0d-d1a1-431d-a7c5-a9193d747701', 'x-ms-ests-server', - '2.1.11829.9 - NCUS ProdSlices', + '2.1.11829.9 - SCUS ProdSlices', 'Set-Cookie', - 'fpc=AmwyupDbd-tMrRR11faNSarGLH8mAgAAAMa7bdgOAAAA; expires=Fri, 30-Jul-2021 01:11:43 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=Al9eBBCAAEpMvjijgnepfunGLH8mAgAAAIXYbtgOAAAA; expires=Fri, 30-Jul-2021 21:26:43 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 30 Jun 2021 01:11:42 GMT', + 'Wed, 30 Jun 2021 21:26:42 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') + .delete('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '59206ee8-119b-4f1e-b0dc-f3076de8d00b', + '01f104ec-9b6a-4226-bd3b-6fa2f7bb3bcf', 'x-envoy-upstream-service-time', - '5913', + '5964', 'apim-request-id', - '59206ee8-119b-4f1e-b0dc-f3076de8d00b', + '01f104ec-9b6a-4226-bd3b-6fa2f7bb3bcf', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:49 GMT' + 'Wed, 30 Jun 2021 21:26:48 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/c10dc263-1583-45f7-826c-84fcb87261db') + .get('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '18d7d916-a070-4217-9da1-50535db163ba', + '39aec969-f61b-4e5e-ad96-05f18d790150', 'x-envoy-upstream-service-time', - '5188', + '5120', 'apim-request-id', - '18d7d916-a070-4217-9da1-50535db163ba', + '39aec969-f61b-4e5e-ad96-05f18d790150', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:54 GMT' + 'Wed, 30 Jun 2021 21:26:54 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index 22ff2dd49df4..32b37106eedc 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,46 +2,46 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162501551554005490","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162501551554000546","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162501551554009942","js-test-cosmosFeed-":"js-test-cosmosFeed-162501551554005145","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162501551554001135","js-test-tableFeed-":"js-test-tableFeed-162501551554004299","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162501551554000108","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162501551554008257","js-test-influxdbFeed-":"js-test-influxdbFeed-162501551554008797","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162501551554001708","js-test-mySqlFeed-":"js-test-mySqlFeed-162501551554009128","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162501551554007077","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162501551554009182"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508841461600525","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508841461602735","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508841461605759","js-test-cosmosFeed-":"js-test-cosmosFeed-162508841461708559","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508841461700596","js-test-tableFeed-":"js-test-tableFeed-162508841461703680","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162508841461705326","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508841461700827","js-test-influxdbFeed-":"js-test-influxdbFeed-162508841461706455","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508841461700802","js-test-mySqlFeed-":"js-test-mySqlFeed-162508841461701315","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508841461703784","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508841461709005"},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162501551554000108","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162508841461705326","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf', 'x-request-id', - 'b25da752-9922-4afc-9862-a12bdd1e005a', + '72d3763e-83b0-48a5-830e-758e73d99c24', 'x-envoy-upstream-service-time', - '1613', + '1580', 'apim-request-id', - 'b25da752-9922-4afc-9862-a12bdd1e005a', + '72d3763e-83b0-48a5-830e-758e73d99c24', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:56 GMT' + 'Wed, 30 Jun 2021 21:26:56 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') - .reply(200, {"dataFeedId":"f46f05e8-727e-4d5b-b06c-c32568a3b7c0","dataFeedName":"js-test-httpRequestFeed-162501551554000108","metrics":[{"metricId":"9c8b2b1e-e0d8-43f1-97d6-a31a2f1447b2","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"63b175eb-f19d-4d08-9488-95caba4b1d67","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-30T01:11:56Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') + .reply(200, {"dataFeedId":"97101930-32aa-4bd2-a63c-2ad543c51fcf","dataFeedName":"js-test-httpRequestFeed-162508841461705326","metrics":[{"metricId":"062f9570-c3b9-4bf0-95fb-a0865c34f7fb","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"70129bc5-6dc9-439d-ae4c-bafd38a26507","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-30T21:26:55Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', '1233', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '4ee58bc0-6688-41e0-ba63-fb564b4a3bf0', + '9f89015a-01ea-4201-9a83-323abba43801', 'x-envoy-upstream-service-time', - '525', + '415', 'apim-request-id', - '4ee58bc0-6688-41e0-ba63-fb564b4a3bf0', + '9f89015a-01ea-4201-9a83-323abba43801', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:11:57 GMT' + 'Wed, 30 Jun 2021 21:26:56 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index 333f052e1bcc..7c2f981357d5 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -5,41 +5,41 @@ module.exports.hash = "3b26ef694bf46025b536723153ef1756"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') + .delete('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '7b25fb33-933a-483d-ae16-0f0559ac9b0a', + '6abf7e03-b69f-40ae-9d27-659700f43ea3', 'x-envoy-upstream-service-time', - '6024', + '948', 'apim-request-id', - '7b25fb33-933a-483d-ae16-0f0559ac9b0a', + '6abf7e03-b69f-40ae-9d27-659700f43ea3', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:12:03 GMT' + 'Wed, 30 Jun 2021 21:26:57 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/f46f05e8-727e-4d5b-b06c-c32568a3b7c0') + .get('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '09e4fefd-c131-4c40-97c3-261d187b6d5e', + 'd6f573bb-58d3-4a43-8148-0e32a2d15ff0', 'x-envoy-upstream-service-time', - '278', + '5229', 'apim-request-id', - '09e4fefd-c131-4c40-97c3-261d187b6d5e', + 'd6f573bb-58d3-4a43-8148-0e32a2d15ff0', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 01:12:03 GMT' + 'Wed, 30 Jun 2021 21:27:02 GMT' ]); From d38b3b59028e0588b7c03af3483e506f83d5dd08 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 16:17:45 -0700 Subject: [PATCH 09/11] add recording for eventhub --- ...recording_creates_eventhubs_data_feed.json | 58 +++++++++---------- ...recording_deletes_eventhubs_data_feed.json | 26 ++++----- ...recording_creates_eventhubs_data_feed.json | 52 ++++++++--------- ...recording_deletes_eventhubs_data_feed.json | 20 +++---- .../recording_creates_eventhubs_data_feed.js | 34 +++++------ .../recording_deletes_eventhubs_data_feed.js | 26 ++++----- .../recording_creates_eventhubs_data_feed.js | 28 ++++----- .../recording_deletes_eventhubs_data_feed.js | 20 +++---- .../test/public/datafeed.spec.ts | 2 +- 9 files changed, 133 insertions(+), 133 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json index 4dceee477748..66590515ae04 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json @@ -11,7 +11,7 @@ "cache-control": "no-store, no-cache", "content-length": "1331", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:18:39 GMT", + "date": "Wed, 30 Jun 2021 21:44:55 GMT", "expires": "-1", "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", @@ -20,62 +20,62 @@ "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", "strict-transport-security": "max-age=31536000; includeSubDomains", "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11829.9 - SCUS ProdSlices", - "x-ms-request-id": "3f8c4ad6-0330-42f6-a047-a3eb51d04401" + "x-ms-ests-server": "2.1.11829.9 - WUS2 ProdSlices", + "x-ms-request-id": "60255122-4f99-4912-bd79-4b91f9e43d01" } }, { "method": "POST", "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", "query": {}, - "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-httpRequestFeed-162501231972906997\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", + "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-eventhubRequestFeed-162508949499809982\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", "status": 201, "response": "", "responseHeaders": { - "apim-request-id": "a09a58e2-911c-4a13-8596-c5e0548b0d14", + "apim-request-id": "063b51da-5d3a-4f7a-a63e-c8fc18be3e62", "content-length": "0", - "date": "Wed, 30 Jun 2021 00:18:47 GMT", - "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "date": "Wed, 30 Jun 2021 21:44:56 GMT", + "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/b167d5e0-1b15-4952-bbb8-2f8aa5e69ef2", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "7225", - "x-request-id": "a09a58e2-911c-4a13-8596-c5e0548b0d14" + "x-envoy-upstream-service-time": "1264", + "x-request-id": "063b51da-5d3a-4f7a-a63e-c8fc18be3e62" } }, { "method": "GET", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/b167d5e0-1b15-4952-bbb8-2f8aa5e69ef2", "query": {}, "requestBody": null, "status": 200, - "response": "{\"dataFeedId\":\"a362818a-af39-45eb-af98-6b529b5f8150\",\"dataFeedName\":\"js-test-httpRequestFeed-162501231972906997\",\"metrics\":[{\"metricId\":\"f4df58ce-d0ab-45c4-ae17-ad77953d0c4f\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"4c7e3776-2ecf-4980-a808-018c7fdd4489\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"azure_client_id\"],\"viewers\":[],\"creator\":\"azure_client_id\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T00:18:47Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", + "response": "{\"dataFeedId\":\"b167d5e0-1b15-4952-bbb8-2f8aa5e69ef2\",\"dataFeedName\":\"js-test-eventhubRequestFeed-162508949499809982\",\"metrics\":[{\"metricId\":\"19d8122c-1886-48fd-95d8-655c7f596155\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"f913ce35-3dff-45f2-aef0-41f8ce93867d\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"azure_client_id\"],\"viewers\":[],\"creator\":\"azure_client_id\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T21:44:57Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", "responseHeaders": { - "apim-request-id": "e3a71b66-3e8d-40d9-b8dc-68b9ba132bf3", - "content-length": "1263", + "apim-request-id": "fdbfa39e-ebae-4bfb-8560-80a09c3066da", + "content-length": "1267", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:18:53 GMT", + "date": "Wed, 30 Jun 2021 21:44:57 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "5386", - "x-request-id": "e3a71b66-3e8d-40d9-b8dc-68b9ba132bf3" + "x-envoy-upstream-service-time": "176", + "x-request-id": "fdbfa39e-ebae-4bfb-8560-80a09c3066da" } } ], "uniqueTestInfo": { "uniqueName": { - "js-test-datafeed-": "js-test-datafeed-162501231972905455", - "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162501231972908093", - "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162501231972907287", - "js-test-cosmosFeed-": "js-test-cosmosFeed-162501231972908784", - "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162501231972906258", - "js-test-tableFeed-": "js-test-tableFeed-162501231972908470", - "js-test-httpRequestFeed-": "js-test-httpRequestFeed-162501231972906997", - "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162501231972908386", - "js-test-influxdbFeed-": "js-test-influxdbFeed-162501231972901554", - "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162501231972905000", - "js-test-mySqlFeed-": "js-test-mySqlFeed-162501231972904087", - "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162501231972901759", - "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162501231972904681" + "js-test-datafeed-": "js-test-datafeed-162508949499700426", + "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162508949499800260", + "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162508949499800892", + "js-test-cosmosFeed-": "js-test-cosmosFeed-162508949499806585", + "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162508949499802809", + "js-test-tableFeed-": "js-test-tableFeed-162508949499809725", + "js-test-eventhubRequestFeed-": "js-test-eventhubRequestFeed-162508949499809982", + "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162508949499807483", + "js-test-influxdbFeed-": "js-test-influxdbFeed-162508949499807803", + "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162508949499808697", + "js-test-mySqlFeed-": "js-test-mySqlFeed-162508949499804701", + "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162508949499802524", + "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162508949499806920" }, "newDate": {} }, diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json index d9d6ad167d76..fcb17ca66bd1 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json @@ -11,7 +11,7 @@ "cache-control": "no-store, no-cache", "content-length": "1331", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:18:53 GMT", + "date": "Wed, 30 Jun 2021 21:44:58 GMT", "expires": "-1", "nel": "{\"report_to\":\"network-errors\",\"max_age\":86400,\"success_fraction\":0.001,\"failure_fraction\":1.0}", "p3p": "CP=\"DSP CUR OTPi IND OTRi ONL FIN\"", @@ -20,43 +20,43 @@ "report-to": "{\"group\":\"network-errors\",\"max_age\":86400,\"endpoints\":[{\"url\":\"https://identity.nel.measure.office.net/api/report?catId=GW+estsfd+wst\"}]}", "strict-transport-security": "max-age=31536000; includeSubDomains", "x-content-type-options": "nosniff", - "x-ms-ests-server": "2.1.11829.9 - EUS ProdSlices", - "x-ms-request-id": "d73b252a-2785-40ab-b01c-235295dd4601" + "x-ms-ests-server": "2.1.11829.9 - WUS2 ProdSlices", + "x-ms-request-id": "4a83a03e-4900-416c-999e-94be5aab5201" } }, { "method": "DELETE", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/b167d5e0-1b15-4952-bbb8-2f8aa5e69ef2", "query": {}, "requestBody": null, "status": 204, "response": "", "responseHeaders": { - "apim-request-id": "42ce3ffc-7532-4956-8a1d-5b03fb06e124", + "apim-request-id": "fdb55b1b-b66b-430a-8e3b-4dffdce4afcf", "content-length": "0", - "date": "Wed, 30 Jun 2021 00:18:59 GMT", + "date": "Wed, 30 Jun 2021 21:44:59 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "5964", - "x-request-id": "42ce3ffc-7532-4956-8a1d-5b03fb06e124" + "x-envoy-upstream-service-time": "748", + "x-request-id": "fdb55b1b-b66b-430a-8e3b-4dffdce4afcf" } }, { "method": "GET", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/a362818a-af39-45eb-af98-6b529b5f8150", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/b167d5e0-1b15-4952-bbb8-2f8aa5e69ef2", "query": {}, "requestBody": null, "status": 404, "response": "{\"code\":\"404 NOT_FOUND\",\"message\":\"datafeedId is invalid.\"}", "responseHeaders": { - "apim-request-id": "77f374e1-0c61-4f87-915c-522305ee23b3", + "apim-request-id": "781d08d3-7706-4494-ac58-c3b5b53651f6", "content-length": "59", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:19:05 GMT", + "date": "Wed, 30 Jun 2021 21:45:03 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "5139", - "x-request-id": "77f374e1-0c61-4f87-915c-522305ee23b3" + "x-envoy-upstream-service-time": "5119", + "x-request-id": "781d08d3-7706-4494-ac58-c3b5b53651f6" } } ], diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json index fb69c439dca0..59875db8ea50 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.json @@ -4,54 +4,54 @@ "method": "POST", "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", "query": {}, - "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-httpRequestFeed-162501234543306266\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", + "requestBody": "{\"dataSourceType\":\"AzureEventHubs\",\"dataFeedName\":\"js-test-eventhubRequestFeed-162508950430007892\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"connectionString\":\"eventhub-connection-string\",\"consumerGroup\":\"consumer-group\"}}", "status": 201, "response": "", "responseHeaders": { - "apim-request-id": "5679a89e-ad78-49fb-ab6a-c87ce4612640", + "apim-request-id": "d2e2aad2-d11a-43cb-b1a6-1a544545f054", "content-length": "0", - "date": "Wed, 30 Jun 2021 00:19:12 GMT", - "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "date": "Wed, 30 Jun 2021 21:45:05 GMT", + "location": "https://endpoint/metricsadvisor/v1.0/dataFeeds/97c1eacb-e724-41e1-a6d8-a447ffbf8835", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "7294", - "x-request-id": "5679a89e-ad78-49fb-ab6a-c87ce4612640" + "x-envoy-upstream-service-time": "1508", + "x-request-id": "d2e2aad2-d11a-43cb-b1a6-1a544545f054" } }, { "method": "GET", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/97c1eacb-e724-41e1-a6d8-a447ffbf8835", "query": {}, "requestBody": null, "status": 200, - "response": "{\"dataFeedId\":\"d014ae47-7dc7-4089-a2e6-6d0f5eb95000\",\"dataFeedName\":\"js-test-httpRequestFeed-162501234543306266\",\"metrics\":[{\"metricId\":\"54b3d024-6860-407c-aa35-f7dff05dddcc\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"1b60509a-9e6a-466f-bcbf-b5a52c208732\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"kaghiya@microsoft.com\"],\"viewers\":[],\"creator\":\"kaghiya@microsoft.com\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T00:19:12Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", + "response": "{\"dataFeedId\":\"97c1eacb-e724-41e1-a6d8-a447ffbf8835\",\"dataFeedName\":\"js-test-eventhubRequestFeed-162508950430007892\",\"metrics\":[{\"metricId\":\"90b50fc1-cb81-4f51-9c60-0f01e0e56e5f\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"0aff76ce-6598-4090-a93b-f87650d591c4\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2021-06-30T00:00:00Z\",\"dataSourceType\":\"AzureEventHubs\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"kaghiya@microsoft.com\"],\"viewers\":[],\"creator\":\"kaghiya@microsoft.com\",\"status\":\"Active\",\"createdTime\":\"2021-06-30T21:45:05Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"consumerGroup\":\"consumer-group\"},\"authenticationType\":\"Basic\"}", "responseHeaders": { - "apim-request-id": "6f0e52d2-6723-4d00-8d1e-3084bc3da5af", - "content-length": "1233", + "apim-request-id": "89030ded-d44f-4466-b6b0-2d495a2183b7", + "content-length": "1237", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:19:17 GMT", + "date": "Wed, 30 Jun 2021 21:45:05 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "5473", - "x-request-id": "6f0e52d2-6723-4d00-8d1e-3084bc3da5af" + "x-envoy-upstream-service-time": "358", + "x-request-id": "89030ded-d44f-4466-b6b0-2d495a2183b7" } } ], "uniqueTestInfo": { "uniqueName": { - "js-test-datafeed-": "js-test-datafeed-162501234543306421", - "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162501234543300868", - "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162501234543301861", - "js-test-cosmosFeed-": "js-test-cosmosFeed-162501234543300197", - "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162501234543305973", - "js-test-tableFeed-": "js-test-tableFeed-162501234543305847", - "js-test-httpRequestFeed-": "js-test-httpRequestFeed-162501234543306266", - "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162501234543307504", - "js-test-influxdbFeed-": "js-test-influxdbFeed-162501234543300179", - "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162501234543304941", - "js-test-mySqlFeed-": "js-test-mySqlFeed-162501234543307091", - "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162501234543303230", - "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162501234543308809" + "js-test-datafeed-": "js-test-datafeed-162508950430007966", + "js-test-appInsightsFeed-": "js-test-appInsightsFeed-162508950430006484", + "js-test-sqlServerFeed-": "js-test-sqlServerFeed-162508950430005393", + "js-test-cosmosFeed-": "js-test-cosmosFeed-162508950430006582", + "js-test-dataExplorerFeed-": "js-test-dataExplorerFeed-162508950430004921", + "js-test-tableFeed-": "js-test-tableFeed-162508950430009058", + "js-test-eventhubRequestFeed-": "js-test-eventhubRequestFeed-162508950430007892", + "js-test-logAnalyticsFeed-": "js-test-logAnalyticsFeed-162508950430008409", + "js-test-influxdbFeed-": "js-test-influxdbFeed-162508950430000980", + "js-test-mongoDbFeed-": "js-test-mongoDbFeed-162508950430007816", + "js-test-mySqlFeed-": "js-test-mySqlFeed-162508950430005917", + "js-test-postgreSqlFeed-": "js-test-postgreSqlFeed-162508950430007309", + "js-test-dataLakeGenFeed-": "js-test-dataLakeGenFeed-162508950430008097" }, "newDate": {} }, diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json index 182f8703232f..9e6180634319 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.json @@ -2,37 +2,37 @@ "recordings": [ { "method": "DELETE", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/97c1eacb-e724-41e1-a6d8-a447ffbf8835", "query": {}, "requestBody": null, "status": 204, "response": "", "responseHeaders": { - "apim-request-id": "6a7476c1-6874-4450-9dbd-d319c98c7565", + "apim-request-id": "0fa3a5c4-2ac3-48ec-b1a1-eb9e8314f96e", "content-length": "0", - "date": "Wed, 30 Jun 2021 00:19:18 GMT", + "date": "Wed, 30 Jun 2021 21:45:11 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "962", - "x-request-id": "6a7476c1-6874-4450-9dbd-d319c98c7565" + "x-envoy-upstream-service-time": "6308", + "x-request-id": "0fa3a5c4-2ac3-48ec-b1a1-eb9e8314f96e" } }, { "method": "GET", - "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/d014ae47-7dc7-4089-a2e6-6d0f5eb95000", + "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds/97c1eacb-e724-41e1-a6d8-a447ffbf8835", "query": {}, "requestBody": null, "status": 404, "response": "{\"code\":\"404 NOT_FOUND\",\"message\":\"datafeedId is invalid.\"}", "responseHeaders": { - "apim-request-id": "466d7228-789b-4d13-8a53-084d9c2bb618", + "apim-request-id": "69853dd4-b3b8-4fdf-b378-6e95feb19d39", "content-length": "59", "content-type": "application/json; charset=utf-8", - "date": "Wed, 30 Jun 2021 00:19:23 GMT", + "date": "Wed, 30 Jun 2021 21:45:17 GMT", "strict-transport-security": "max-age=31536000; includeSubDomains; preload", "x-content-type-options": "nosniff", - "x-envoy-upstream-service-time": "5212", - "x-request-id": "466d7228-789b-4d13-8a53-084d9c2bb618" + "x-envoy-upstream-service-time": "5236", + "x-request-id": "69853dd4-b3b8-4fdf-b378-6e95feb19d39" } } ], diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index c88723a0acc4..5cb510650e0a 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,7 +2,7 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508838933800060","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508838933908238","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508838933903707","js-test-cosmosFeed-":"js-test-cosmosFeed-162508838933908815","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508838933908042","js-test-tableFeed-":"js-test-tableFeed-162508838933902172","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162508838933908981","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508838933908089","js-test-influxdbFeed-":"js-test-influxdbFeed-162508838933907561","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508838933905214","js-test-mySqlFeed-":"js-test-mySqlFeed-162508838933906304","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508838933904856","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508838933903815"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508945389805775","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508945389806976","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508945389809283","js-test-cosmosFeed-":"js-test-cosmosFeed-162508945389809964","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508945389807094","js-test-tableFeed-":"js-test-tableFeed-162508945389801971","js-test-eventhubRequestFeed-":"js-test-eventhubRequestFeed-162508945389801568","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508945389801183","js-test-influxdbFeed-":"js-test-influxdbFeed-162508945389805084","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508945389802321","js-test-mySqlFeed-":"js-test-mySqlFeed-162508945389801631","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508945389801565","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508945389806343"},"newDate":{}} nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) .post('/azure_tenant_id/oauth2/v2.0/token', "response_type=token&grant_type=client_credentials&client_id=azure_client_id&client_secret=azure_client_secret&scope=https%3A%2F%2Fsanitized%2F") @@ -22,59 +22,59 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '58d66bda-883d-47ec-9017-50fb908e0a00', + '35a4e11e-7b49-477f-aac7-54dcf59e5101', 'x-ms-ests-server', '2.1.11829.9 - WUS2 ProdSlices', 'Set-Cookie', - 'fpc=Al9eBBCAAEpMvjijgnepfunGLH8mAQAAAIXYbtgOAAAA; expires=Fri, 30-Jul-2021 21:26:30 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AuPC8Nzi4XdHkDTt8UivHEvGLH8mAQAAAK7cbtgOAAAA; expires=Fri, 30-Jul-2021 21:44:14 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 30 Jun 2021 21:26:29 GMT', + 'Wed, 30 Jun 2021 21:44:14 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162508838933908981","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-eventhubRequestFeed-162508945389801568","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/8bd9f7eb-802b-48f9-9723-8ce1115f1d60', 'x-request-id', - 'd98712d7-3ea5-481d-83ad-865f91231269', + '823bc3a2-6a02-44e1-8591-ede18f061887', 'x-envoy-upstream-service-time', - '7046', + '1993', 'apim-request-id', - 'd98712d7-3ea5-481d-83ad-865f91231269', + '823bc3a2-6a02-44e1-8591-ede18f061887', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:37 GMT' + 'Wed, 30 Jun 2021 21:44:16 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') - .reply(200, {"dataFeedId":"f1002588-ce6b-4c63-ae1f-8bbb6410d555","dataFeedName":"js-test-httpRequestFeed-162508838933908981","metrics":[{"metricId":"69f836a5-71a0-4754-af2a-0ded4b02a105","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"be80e07b-92b5-4ebc-a635-cc37298ef4bf","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-30T21:26:37Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/8bd9f7eb-802b-48f9-9723-8ce1115f1d60') + .reply(200, {"dataFeedId":"8bd9f7eb-802b-48f9-9723-8ce1115f1d60","dataFeedName":"js-test-eventhubRequestFeed-162508945389801568","metrics":[{"metricId":"a6961297-3dfe-4f26-967e-25372e154106","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"b9aff9bc-fc7e-472e-abbc-6ff6c21d26dc","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["azure_client_id"],"viewers":[],"creator":"azure_client_id","status":"Active","createdTime":"2021-06-30T21:44:16Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', - '1263', + '1267', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '90d3d83c-6d3a-4375-8591-fb665caad37a', + '8f07fd80-c779-4770-a713-754902c8ecc6', 'x-envoy-upstream-service-time', - '5293', + '352', 'apim-request-id', - '90d3d83c-6d3a-4375-8591-fb665caad37a', + '8f07fd80-c779-4770-a713-754902c8ecc6', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:42 GMT' + 'Wed, 30 Jun 2021 21:44:17 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index 93213919a3d0..762e2f21da7c 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -22,57 +22,57 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '8fe8fb0d-d1a1-431d-a7c5-a9193d747701', + '9c2f8136-7704-4abd-bd21-45a0a5e17401', 'x-ms-ests-server', '2.1.11829.9 - SCUS ProdSlices', 'Set-Cookie', - 'fpc=Al9eBBCAAEpMvjijgnepfunGLH8mAgAAAIXYbtgOAAAA; expires=Fri, 30-Jul-2021 21:26:43 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=AuPC8Nzi4XdHkDTt8UivHEvGLH8mAgAAAK7cbtgOAAAA; expires=Fri, 30-Jul-2021 21:44:17 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 30 Jun 2021 21:26:42 GMT', + 'Wed, 30 Jun 2021 21:44:17 GMT', 'Content-Length', '1331' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') + .delete('/metricsadvisor/v1.0/dataFeeds/8bd9f7eb-802b-48f9-9723-8ce1115f1d60') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '01f104ec-9b6a-4226-bd3b-6fa2f7bb3bcf', + '5510923d-5471-4626-809e-5ab037d9beb0', 'x-envoy-upstream-service-time', - '5964', + '5956', 'apim-request-id', - '01f104ec-9b6a-4226-bd3b-6fa2f7bb3bcf', + '5510923d-5471-4626-809e-5ab037d9beb0', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:48 GMT' + 'Wed, 30 Jun 2021 21:44:22 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/f1002588-ce6b-4c63-ae1f-8bbb6410d555') + .get('/metricsadvisor/v1.0/dataFeeds/8bd9f7eb-802b-48f9-9723-8ce1115f1d60') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '39aec969-f61b-4e5e-ad96-05f18d790150', + '9431997e-7ebe-4312-b114-26d39fabe489', 'x-envoy-upstream-service-time', - '5120', + '5246', 'apim-request-id', - '39aec969-f61b-4e5e-ad96-05f18d790150', + '9431997e-7ebe-4312-b114-26d39fabe489', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:54 GMT' + 'Wed, 30 Jun 2021 21:44:28 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js index 32b37106eedc..e3d8a4d7b1f0 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_eventhubs_data_feed.js @@ -2,46 +2,46 @@ let nock = require('nock'); module.exports.hash = "b305b062177574b168150bc47bb53ffe"; -module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508841461600525","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508841461602735","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508841461605759","js-test-cosmosFeed-":"js-test-cosmosFeed-162508841461708559","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508841461700596","js-test-tableFeed-":"js-test-tableFeed-162508841461703680","js-test-httpRequestFeed-":"js-test-httpRequestFeed-162508841461705326","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508841461700827","js-test-influxdbFeed-":"js-test-influxdbFeed-162508841461706455","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508841461700802","js-test-mySqlFeed-":"js-test-mySqlFeed-162508841461701315","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508841461703784","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508841461709005"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"js-test-datafeed-":"js-test-datafeed-162508946944502353","js-test-appInsightsFeed-":"js-test-appInsightsFeed-162508946944504837","js-test-sqlServerFeed-":"js-test-sqlServerFeed-162508946944506617","js-test-cosmosFeed-":"js-test-cosmosFeed-162508946944505568","js-test-dataExplorerFeed-":"js-test-dataExplorerFeed-162508946944505953","js-test-tableFeed-":"js-test-tableFeed-162508946944505637","js-test-eventhubRequestFeed-":"js-test-eventhubRequestFeed-162508946944506472","js-test-logAnalyticsFeed-":"js-test-logAnalyticsFeed-162508946944503585","js-test-influxdbFeed-":"js-test-influxdbFeed-162508946944501773","js-test-mongoDbFeed-":"js-test-mongoDbFeed-162508946944503448","js-test-mySqlFeed-":"js-test-mySqlFeed-162508946944509246","js-test-postgreSqlFeed-":"js-test-postgreSqlFeed-162508946944503668","js-test-dataLakeGenFeed-":"js-test-dataLakeGenFeed-162508946944504276"},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-httpRequestFeed-162508841461705326","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) + .post('/metricsadvisor/v1.0/dataFeeds', {"dataSourceType":"AzureEventHubs","dataFeedName":"js-test-eventhubRequestFeed-162508946944506472","dataFeedDescription":"Data feed description","granularityName":"Daily","metrics":[{"metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2020-08-21T00:00:00.000Z","startOffsetInSeconds":0,"maxConcurrency":-1,"minRetryIntervalInSeconds":-1,"stopRetryAfterInSeconds":-1,"needRollup":"NeedRollup","rollUpMethod":"Sum","allUpIdentification":"__CUSTOM_SUM__","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"viewMode":"Private","authenticationType":"Basic","dataSourceParameter":{"connectionString":"eventhub-connection-string","consumerGroup":"consumer-group"}}) .reply(201, "", [ 'Content-Length', '0', 'Location', - 'https://endpoint/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf', + 'https://endpoint/metricsadvisor/v1.0/dataFeeds/38c952af-7a0c-403e-bdb0-f7576cf22575', 'x-request-id', - '72d3763e-83b0-48a5-830e-758e73d99c24', + 'c01157c3-78d4-47c3-b5f0-a8e788908a42', 'x-envoy-upstream-service-time', - '1580', + '1568', 'apim-request-id', - '72d3763e-83b0-48a5-830e-758e73d99c24', + 'c01157c3-78d4-47c3-b5f0-a8e788908a42', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:56 GMT' + 'Wed, 30 Jun 2021 21:44:30 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') - .reply(200, {"dataFeedId":"97101930-32aa-4bd2-a63c-2ad543c51fcf","dataFeedName":"js-test-httpRequestFeed-162508841461705326","metrics":[{"metricId":"062f9570-c3b9-4bf0-95fb-a0865c34f7fb","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"70129bc5-6dc9-439d-ae4c-bafd38a26507","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-30T21:26:55Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ + .get('/metricsadvisor/v1.0/dataFeeds/38c952af-7a0c-403e-bdb0-f7576cf22575') + .reply(200, {"dataFeedId":"38c952af-7a0c-403e-bdb0-f7576cf22575","dataFeedName":"js-test-eventhubRequestFeed-162508946944506472","metrics":[{"metricId":"b02b1eee-dbfa-4b51-93c1-632f05b50173","metricName":"cost","metricDisplayName":"cost","metricDescription":""},{"metricId":"c7e79d6b-505c-4f15-83b5-c5b8654270c2","metricName":"revenue","metricDisplayName":"revenue","metricDescription":""}],"dimension":[{"dimensionName":"category","dimensionDisplayName":"category"},{"dimensionName":"city","dimensionDisplayName":"city"}],"dataStartFrom":"2021-06-30T00:00:00Z","dataSourceType":"AzureEventHubs","timestampColumn":"","startOffsetInSeconds":0,"maxQueryPerMinute":30,"granularityName":"Daily","allUpIdentification":"__CUSTOM_SUM__","needRollup":"NeedRollup","fillMissingPointType":"CustomValue","fillMissingPointValue":555,"rollUpMethod":"Sum","dataFeedDescription":"Data feed description","stopRetryAfterInSeconds":-1,"minRetryIntervalInSeconds":-1,"maxConcurrency":-1,"viewMode":"Private","admins":["kaghiya@microsoft.com"],"viewers":[],"creator":"kaghiya@microsoft.com","status":"Active","createdTime":"2021-06-30T21:44:30Z","isAdmin":true,"actionLinkTemplate":"","dataSourceParameter":{"consumerGroup":"consumer-group"},"authenticationType":"Basic"}, [ 'Content-Length', - '1233', + '1237', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - '9f89015a-01ea-4201-9a83-323abba43801', + 'cac70470-15ff-402f-8940-aa8d720d67b2', 'x-envoy-upstream-service-time', - '415', + '436', 'apim-request-id', - '9f89015a-01ea-4201-9a83-323abba43801', + 'cac70470-15ff-402f-8940-aa8d720d67b2', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:56 GMT' + 'Wed, 30 Jun 2021 21:44:30 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js index 7c2f981357d5..c27d94b25bba 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/node/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_deletes_eventhubs_data_feed.js @@ -5,41 +5,41 @@ module.exports.hash = "3b26ef694bf46025b536723153ef1756"; module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://endpoint:443', {"encodedQueryParams":true}) - .delete('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') + .delete('/metricsadvisor/v1.0/dataFeeds/38c952af-7a0c-403e-bdb0-f7576cf22575') .reply(204, "", [ 'Content-Length', '0', 'x-request-id', - '6abf7e03-b69f-40ae-9d27-659700f43ea3', + 'ce716c25-0f62-4dca-afb1-2f5467ad5890', 'x-envoy-upstream-service-time', - '948', + '5927', 'apim-request-id', - '6abf7e03-b69f-40ae-9d27-659700f43ea3', + 'ce716c25-0f62-4dca-afb1-2f5467ad5890', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:26:57 GMT' + 'Wed, 30 Jun 2021 21:44:36 GMT' ]); nock('https://endpoint:443', {"encodedQueryParams":true}) - .get('/metricsadvisor/v1.0/dataFeeds/97101930-32aa-4bd2-a63c-2ad543c51fcf') + .get('/metricsadvisor/v1.0/dataFeeds/38c952af-7a0c-403e-bdb0-f7576cf22575') .reply(404, {"code":"404 NOT_FOUND","message":"datafeedId is invalid."}, [ 'Content-Length', '59', 'Content-Type', 'application/json; charset=utf-8', 'x-request-id', - 'd6f573bb-58d3-4a43-8148-0e32a2d15ff0', + '58bd34ce-1b51-45d7-a923-e727ec3cb2d0', 'x-envoy-upstream-service-time', - '5229', + '5263', 'apim-request-id', - 'd6f573bb-58d3-4a43-8148-0e32a2d15ff0', + '58bd34ce-1b51-45d7-a923-e727ec3cb2d0', 'Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload', 'x-content-type-options', 'nosniff', 'Date', - 'Wed, 30 Jun 2021 21:27:02 GMT' + 'Wed, 30 Jun 2021 21:44:42 GMT' ]); diff --git a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts index beb3f68a4139..8b9056a823a6 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts +++ b/sdk/metricsadvisor/ai-metrics-advisor/test/public/datafeed.spec.ts @@ -66,7 +66,7 @@ matrix([[true, false]] as const, async (useAad) => { azureTableFeedName = recorder.getUniqueName("js-test-tableFeed-"); } if (recorder && !eventHubsFeedName) { - eventHubsFeedName = recorder.getUniqueName("js-test-httpRequestFeed-"); + eventHubsFeedName = recorder.getUniqueName("js-test-eventhubRequestFeed-"); } if (recorder && !logAnalyticsFeedName) { logAnalyticsFeedName = recorder.getUniqueName("js-test-logAnalyticsFeed-"); From 5e43c492310096109603a05603322733eb624a96 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 30 Jun 2021 16:54:43 -0700 Subject: [PATCH 10/11] fix browser recordings app insights --- .../recording_creates_an_azure_application_insights_feed.json | 4 ++-- .../recording_creates_an_azure_application_insights_feed.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json index 919e42bf5d46..37e5c0b61c72 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/aad_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json @@ -28,7 +28,7 @@ "method": "POST", "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", "query": {}, - "requestBody": "{\"dataSourceType\":\"AzureApplicationInsights\",\"dataFeedName\":\"js-test-appInsightsFeed-162267907697005921\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\",\"apiKey\":\"appInsights_app_key\",\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\"}}", + "requestBody": "{\"dataSourceType\":\"AzureApplicationInsights\",\"dataFeedName\":\"js-test-appInsightsFeed-162267907697005921\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\",\"apiKey\":\"appInsights_app_key\",\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\"}}", "status": 201, "response": "", "responseHeaders": { @@ -48,7 +48,7 @@ "query": {}, "requestBody": null, "status": 200, - "response": "{\"dataFeedId\":\"ebbc5641-a17d-474c-b9c9-15cb3e5472f8\",\"dataFeedName\":\"js-test-appInsightsFeed-162267907697005921\",\"metrics\":[{\"metricId\":\"0df083b5-c4ce-49cd-8a34-2e22ee937cc7\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"2815862d-9dad-41e0-9061-37ecdb57699f\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00Z\",\"dataSourceType\":\"AzureApplicationInsights\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"azure_client_id\"],\"viewers\":[],\"creator\":\"azure_client_id\",\"status\":\"Active\",\"createdTime\":\"2021-06-03T00:11:20Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\",\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\"},\"authenticationType\":\"Basic\"}", + "response": "{\"dataFeedId\":\"ebbc5641-a17d-474c-b9c9-15cb3e5472f8\",\"dataFeedName\":\"js-test-appInsightsFeed-162267907697005921\",\"metrics\":[{\"metricId\":\"0df083b5-c4ce-49cd-8a34-2e22ee937cc7\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"2815862d-9dad-41e0-9061-37ecdb57699f\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00Z\",\"dataSourceType\":\"AzureApplicationInsights\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"azure_client_id\"],\"viewers\":[],\"creator\":\"azure_client_id\",\"status\":\"Active\",\"createdTime\":\"2021-06-03T00:11:20Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\",\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\"},\"authenticationType\":\"Basic\"}", "responseHeaders": { "apim-request-id": "44d8bcde-4800-4e76-8f0c-fcd2292cbd76", "content-length": "1661", diff --git a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json index 8ebf547ccc3e..f40bb18d9da0 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json +++ b/sdk/metricsadvisor/ai-metrics-advisor/recordings/browsers/api_key_metricsadvisoradministrationclient_datafeed_datafeed/recording_creates_an_azure_application_insights_feed.json @@ -4,7 +4,7 @@ "method": "POST", "url": "https://endpoint/metricsadvisor/v1.0/dataFeeds", "query": {}, - "requestBody": "{\"dataSourceType\":\"AzureApplicationInsights\",\"dataFeedName\":\"js-test-appInsightsFeed-162267917625905917\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\",\"apiKey\":\"appInsights_app_key\",\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\"}}", + "requestBody": "{\"dataSourceType\":\"AzureApplicationInsights\",\"dataFeedName\":\"js-test-appInsightsFeed-162267917625905917\",\"dataFeedDescription\":\"Data feed description\",\"granularityName\":\"Daily\",\"metrics\":[{\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00.000Z\",\"startOffsetInSeconds\":0,\"maxConcurrency\":-1,\"minRetryIntervalInSeconds\":-1,\"stopRetryAfterInSeconds\":-1,\"needRollup\":\"NeedRollup\",\"rollUpMethod\":\"Sum\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555,\"viewMode\":\"Private\",\"authenticationType\":\"Basic\",\"dataSourceParameter\":{\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\",\"apiKey\":\"appInsights_app_key\",\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\"}}", "status": 201, "response": "", "responseHeaders": { @@ -24,7 +24,7 @@ "query": {}, "requestBody": null, "status": 200, - "response": "{\"dataFeedId\":\"9f4c6061-4fb0-4c5f-a148-a657d1d99fc1\",\"dataFeedName\":\"js-test-appInsightsFeed-162267917625905917\",\"metrics\":[{\"metricId\":\"989966a0-0249-4cd6-bc74-cc428a7364cc\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"3b46577e-316c-4708-92c2-beb61992e047\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00Z\",\"dataSourceType\":\"AzureApplicationInsights\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"kaghiya@microsoft.com\"],\"viewers\":[],\"creator\":\"kaghiya@microsoft.com\",\"status\":\"Active\",\"createdTime\":\"2021-06-03T00:13:09Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\",\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\"},\"authenticationType\":\"Basic\"}", + "response": "{\"dataFeedId\":\"9f4c6061-4fb0-4c5f-a148-a657d1d99fc1\",\"dataFeedName\":\"js-test-appInsightsFeed-162267917625905917\",\"metrics\":[{\"metricId\":\"989966a0-0249-4cd6-bc74-cc428a7364cc\",\"metricName\":\"cost\",\"metricDisplayName\":\"cost\",\"metricDescription\":\"\"},{\"metricId\":\"3b46577e-316c-4708-92c2-beb61992e047\",\"metricName\":\"revenue\",\"metricDisplayName\":\"revenue\",\"metricDescription\":\"\"}],\"dimension\":[{\"dimensionName\":\"category\",\"dimensionDisplayName\":\"category\"},{\"dimensionName\":\"city\",\"dimensionDisplayName\":\"city\"}],\"dataStartFrom\":\"2020-08-21T00:00:00Z\",\"dataSourceType\":\"AzureApplicationInsights\",\"timestampColumn\":\"\",\"startOffsetInSeconds\":0,\"maxQueryPerMinute\":30.0,\"granularityName\":\"Daily\",\"allUpIdentification\":\"__CUSTOM_SUM__\",\"needRollup\":\"NeedRollup\",\"fillMissingPointType\":\"CustomValue\",\"fillMissingPointValue\":555.0,\"rollUpMethod\":\"Sum\",\"dataFeedDescription\":\"Data feed description\",\"stopRetryAfterInSeconds\":-1,\"minRetryIntervalInSeconds\":-1,\"maxConcurrency\":-1,\"viewMode\":\"Private\",\"admins\":[\"kaghiya@microsoft.com\"],\"viewers\":[],\"creator\":\"kaghiya@microsoft.com\",\"status\":\"Active\",\"createdTime\":\"2021-06-03T00:13:09Z\",\"isAdmin\":true,\"actionLinkTemplate\":\"\",\"dataSourceParameter\":{\"query\":\"let gran=60m; let starttime=datetime(@StartTime); let endtime=starttime + gran; requests | where timestamp >= starttime and timestamp < endtime | summarize request_count = count(), duration_avg_ms = avg(duration), duration_95th_ms = percentile(duration, 95), duration_max_ms = max(duration) by resultCode\",\"azureCloud\":\"Azure\",\"applicationId\":\"appInsights_application\"},\"authenticationType\":\"Basic\"}", "responseHeaders": { "apim-request-id": "654366bf-d667-44ea-906f-14993bac727f", "content-length": "1631", From 2a10a915e45b45ff7af0b16d270c9687e72d09b1 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Thu, 1 Jul 2021 00:46:13 -0700 Subject: [PATCH 11/11] tweaks to changelog --- sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md index 5c18b09bf85f..49723e0daaa8 100644 --- a/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md +++ b/sdk/metricsadvisor/ai-metrics-advisor/CHANGELOG.md @@ -2,12 +2,13 @@ ## 1.0.0 (2021-07-06) +The Metrics Advisor library is now in GA with this release. + ### Breaking Changes - `listIncidents()` overloads split into `listInclidentsForAlert()` and `listIncidentsForDetectionConfiguration()` - `listAnomalies()` overloads split into `listAnomaliesForAlert()` and `listAnomaliesForDetectionConfiguration()` - Removed support for granularity type `PerSecond` -- Returning the objects as part of update method response - Renamed "createFeedback" to "addFeedback" - `seriesToFilter` parameter renamed to `seriesKey` in methods `getmetricenrichedseriesdata` and `getmetricseriesdata` and ordering updated - Renamed type `DetectionConditionsOperator` to `DetectionConditionOperator` @@ -18,6 +19,10 @@ `ServicePrincipalDataSourceCredential` to `DataSourceServicePrincipal`, `ServicePrincipalInKeyVaultDataSourceCredential` to `DataSourceServicePrincipalInKeyVault` +### Other Changes + +- Update methods now return the updated object + ## 1.0.0-beta.4 (2021-06-07) ### New Features