diff --git a/sdk/operationalinsights/loganalytics/LICENSE.txt b/sdk/operationalinsights/loganalytics/LICENSE.txt
index a70e8cf66038..2d3163745319 100644
--- a/sdk/operationalinsights/loganalytics/LICENSE.txt
+++ b/sdk/operationalinsights/loganalytics/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2018 Microsoft
+Copyright (c) 2021 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/sdk/operationalinsights/loganalytics/README.md b/sdk/operationalinsights/loganalytics/README.md
index 208df3c1547e..68a3b4deca6c 100644
--- a/sdk/operationalinsights/loganalytics/README.md
+++ b/sdk/operationalinsights/loganalytics/README.md
@@ -1,99 +1,97 @@
## An isomorphic javascript sdk for - LogAnalyticsClient
-This package contains an isomorphic SDK for LogAnalyticsClient.
+This package contains an isomorphic SDK (runs both in node.js and in browsers) for LogAnalyticsClient.
### Currently supported environments
-- Node.js version 6.x.x or higher
-- Browser JavaScript
+- [LTS versions of Node.js](https://nodejs.org/about/releases/)
+- Latest versions of Safari, Chrome, Edge and Firefox.
-### How to Install
+### Prerequisites
+You must have an [Azure subscription](https://azure.microsoft.com/free/).
+
+### How to install
+
+To use this SDK in your project, you will need to install two packages.
+- `@azure/loganalytics` that contains the client.
+- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
+
+Install both packages using the below command:
+```bash
+npm install --save @azure/loganalytics @azure/identity
```
-npm install @azure/loganalytics
-```
+> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
+If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
### How to use
-#### nodejs - Authentication, client creation and execute query as an example written in TypeScript.
+- If you are writing a client side browser application,
+ - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
+ - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
+- If you are writing a server side application,
+ - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
+ - Complete the set up steps required by the credential if any.
+ - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
-##### Install @azure/ms-rest-nodeauth
-
-```
-npm install @azure/ms-rest-nodeauth
-```
+In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
+Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
+#### nodejs - Authentication, client creation, and get metadata as an example written in JavaScript.
##### Sample code
-```ts
-import * as msRest from "@azure/ms-rest-js";
-import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
-import { LogAnalyticsClient, LogAnalyticsModels, LogAnalyticsMappers } from "@azure/loganalytics";
+```javascript
+const { DefaultAzureCredential } = require("@azure/identity");
+const { LogAnalyticsClient } = require("@azure/loganalytics");
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
-msRestNodeAuth.interactiveLogin().then((creds) => {
- const client = new LogAnalyticsClient(creds, subscriptionId);
- const workspaceId = "testworkspaceId";
- const body: LogAnalyticsModels.QueryBody = {
- query: "testquery",
- timespan: "testtimespan",
- workspaces: ["testworkspaces"]
- };
- client.query.execute(workspaceId, body).then((result) => {
- console.log("The result is:");
- console.log(result);
- });
+// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
+// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
+const creds = new DefaultAzureCredential();
+const client = new LogAnalyticsClient(creds, subscriptionId);
+const workspaceId = "testworkspaceId";
+client.metadata.get(workspaceId).then((result) => {
+ console.log("The result is:");
+ console.log(result);
}).catch((err) => {
+ console.log("An error occurred:");
console.error(err);
});
```
-#### browser - Authentication, client creation and execute query as an example written in JavaScript.
+#### browser - Authentication, client creation, and get metadata as an example written in JavaScript.
-##### Install @azure/ms-rest-browserauth
-
-```
-npm install @azure/ms-rest-browserauth
-```
+In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
+ - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
+ - Note down the client Id from the previous step and use it in the browser sample below.
##### Sample code
-See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
-
- index.html
+
```html
@azure/loganalytics sample
-
-
@@ -105,5 +103,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
-
-![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Foperationalinsights%2Floganalytics%2FREADME.png)
+![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/operationalinsights/loganalytics/README.png)
diff --git a/sdk/operationalinsights/loganalytics/package.json b/sdk/operationalinsights/loganalytics/package.json
index 835261ff989e..19a343c72bd7 100644
--- a/sdk/operationalinsights/loganalytics/package.json
+++ b/sdk/operationalinsights/loganalytics/package.json
@@ -4,8 +4,9 @@
"description": "LogAnalyticsClient Library with typescript type definitions for node.js and browser.",
"version": "0.2.0",
"dependencies": {
- "@azure/ms-rest-js": "^1.1.0",
- "tslib": "^1.9.3"
+ "@azure/ms-rest-js": "^2.2.0",
+ "@azure/core-auth": "^1.1.4",
+ "tslib": "^1.10.0"
},
"keywords": [
"node",
@@ -19,18 +20,19 @@
"module": "./esm/logAnalyticsClient.js",
"types": "./esm/logAnalyticsClient.d.ts",
"devDependencies": {
- "typescript": "^3.1.1",
- "rollup": "^0.66.2",
- "rollup-plugin-node-resolve": "^3.4.0",
- "uglify-js": "^3.4.9"
+ "typescript": "^3.6.0",
+ "rollup": "^1.18.0",
+ "rollup-plugin-node-resolve": "^5.2.0",
+ "rollup-plugin-sourcemaps": "^0.4.2",
+ "uglify-js": "^3.6.0"
},
- "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/operationalinsights/loganalytics",
+ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/operationalinsights/loganalytics",
"repository": {
"type": "git",
- "url": "https://github.com/azure/azure-sdk-for-js.git"
+ "url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
- "url": "https://github.com/azure/azure-sdk-for-js/issues"
+ "url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
@@ -42,6 +44,7 @@
"esm/**/*.d.ts",
"esm/**/*.d.ts.map",
"src/**/*.ts",
+ "README.md",
"rollup.config.js",
"tsconfig.json"
],
diff --git a/sdk/operationalinsights/loganalytics/rollup.config.js b/sdk/operationalinsights/loganalytics/rollup.config.js
index a25a9cc464b5..9773ebaf28db 100644
--- a/sdk/operationalinsights/loganalytics/rollup.config.js
+++ b/sdk/operationalinsights/loganalytics/rollup.config.js
@@ -1,10 +1,16 @@
+import rollup from "rollup";
import nodeResolve from "rollup-plugin-node-resolve";
+import sourcemaps from "rollup-plugin-sourcemaps";
+
/**
- * @type {import('rollup').RollupFileOptions}
+ * @type {rollup.RollupFileOptions}
*/
const config = {
- input: './esm/logAnalyticsClient.js',
- external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
+ input: "./esm/logAnalyticsClient.js",
+ external: [
+ "@azure/ms-rest-js",
+ "@azure/ms-rest-azure-js"
+ ],
output: {
file: "./dist/loganalytics.js",
format: "umd",
@@ -15,17 +21,17 @@ const config = {
"@azure/ms-rest-azure-js": "msRestAzure"
},
banner: `/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
- * Changes may cause incorrect behavior and will be lost if the code is
- * regenerated.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/`
},
plugins: [
- nodeResolve({ module: true })
+ nodeResolve({ mainFields: ['module', 'main'] }),
+ sourcemaps()
]
};
+
export default config;
diff --git a/sdk/operationalinsights/loganalytics/src/logAnalyticsClient.ts b/sdk/operationalinsights/loganalytics/src/logAnalyticsClient.ts
index da6795a42df5..ec2c3dd675e8 100644
--- a/sdk/operationalinsights/loganalytics/src/logAnalyticsClient.ts
+++ b/sdk/operationalinsights/loganalytics/src/logAnalyticsClient.ts
@@ -1,7 +1,6 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
@@ -17,15 +16,22 @@ import { LogAnalyticsClientContext } from "./logAnalyticsClientContext";
class LogAnalyticsClient extends LogAnalyticsClientContext {
// Operation groups
query: operations.Query;
+ metadata: operations.Metadata;
/**
* Initializes a new instance of the LogAnalyticsClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
+ * Credentials implementing the TokenCredential interface from the @azure/identity package are
+ * recommended. For more information about these credentials, see
+ * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
+ * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
+ * @azure/ms-rest-browserauth are also supported.
* @param [options] The parameter options
*/
- constructor(credentials: msRest.ServiceClientCredentials, options?: Models.LogAnalyticsClientOptions) {
+ constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.LogAnalyticsClientOptions) {
super(credentials, options);
this.query = new operations.Query(this);
+ this.metadata = new operations.Metadata(this);
}
}
diff --git a/sdk/operationalinsights/loganalytics/src/logAnalyticsClientContext.ts b/sdk/operationalinsights/loganalytics/src/logAnalyticsClientContext.ts
index ff55138f8c26..9198ce1a4ec7 100644
--- a/sdk/operationalinsights/loganalytics/src/logAnalyticsClientContext.ts
+++ b/sdk/operationalinsights/loganalytics/src/logAnalyticsClientContext.ts
@@ -1,7 +1,6 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
@@ -12,34 +11,39 @@ import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
const packageName = "@azure/loganalytics";
-const packageVersion = "0.1.0";
+const packageVersion = "0.2.0";
export class LogAnalyticsClientContext extends msRest.ServiceClient {
- credentials: msRest.ServiceClientCredentials;
+ credentials: msRest.ServiceClientCredentials | TokenCredential;
/**
* Initializes a new instance of the LogAnalyticsClientContext class.
* @param credentials Subscription credentials which uniquely identify client subscription.
+ * Credentials implementing the TokenCredential interface from the @azure/identity package are
+ * recommended. For more information about these credentials, see
+ * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
+ * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
+ * @azure/ms-rest-browserauth are also supported.
* @param [options] The parameter options
*/
- constructor(credentials: msRest.ServiceClientCredentials, options?: Models.LogAnalyticsClientOptions) {
- if (credentials === null || credentials === undefined) {
- throw new Error('\'credentials\' cannot be null.');
+ constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.LogAnalyticsClientOptions) {
+ if (credentials == undefined) {
+ throw new Error("'credentials' cannot be null.");
}
if (!options) {
options = {};
}
- if(!options.userAgent) {
+
+ if (!options.userAgent) {
const defaultUserAgent = msRest.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(credentials, options);
- this.baseUri = options.baseUri || this.baseUri || "https://api.loganalytics.io";
+ this.baseUri = options.baseUri || this.baseUri || "https://api.loganalytics.io/v1";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
-
}
}
diff --git a/sdk/operationalinsights/loganalytics/src/models/index.ts b/sdk/operationalinsights/loganalytics/src/models/index.ts
index 52da54ffbedb..89341f6403e6 100644
--- a/sdk/operationalinsights/loganalytics/src/models/index.ts
+++ b/sdk/operationalinsights/loganalytics/src/models/index.ts
@@ -1,191 +1,777 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
- * Changes may cause incorrect behavior and will be lost if the code is
- * regenerated.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { ServiceClientOptions } from "@azure/ms-rest-js";
import * as msRest from "@azure/ms-rest-js";
-
/**
- * @interface
- * An interface representing QueryBody.
* The Analytics query. Learn more about the [Analytics query
* syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/)
- *
*/
export interface QueryBody {
/**
- * @member {string} query The query to execute.
+ * The query to execute.
*/
query: string;
/**
- * @member {string} [timespan] Optional. The timespan over which to query
- * data. This is an ISO8601 time period value. This timespan is applied in
- * addition to any that are specified in the query expression.
+ * Optional. The timespan over which to query data. This is an ISO8601 time period value. This
+ * timespan is applied in addition to any that are specified in the query expression.
*/
timespan?: string;
/**
- * @member {string[]} [workspaces] A list of workspaces that are included in
- * the query.
+ * A list of workspaces that are included in the query.
*/
workspaces?: string[];
}
/**
- * @interface
- * An interface representing Column.
- * @summary A table column.
- *
* A column in a table.
- *
+ * @summary A table column.
*/
export interface Column {
/**
- * @member {string} [name] The name of this column.
+ * The name of this column.
*/
name?: string;
/**
- * @member {string} [type] The data type of this column.
+ * The data type of this column.
*/
type?: string;
}
/**
- * @interface
- * An interface representing Table.
- * @summary A query response table.
- *
* Contains the columns and rows for one table in a query response.
- *
+ * @summary A query response table.
*/
export interface Table {
/**
- * @member {string} name The name of the table.
+ * The name of the table.
*/
name: string;
/**
- * @member {Column[]} columns The list of columns in this table.
+ * The list of columns in this table.
*/
columns: Column[];
/**
- * @member {string[][]} rows The resulting rows from this query.
+ * The resulting rows from this query.
*/
rows: string[][];
}
/**
- * @interface
- * An interface representing QueryResults.
- * @summary A query response.
- *
* Contains the tables, columns & rows resulting from a query.
- *
+ * @summary A query response.
*/
export interface QueryResults {
/**
- * @member {Table[]} tables The list of tables, columns and rows.
+ * The list of tables, columns and rows.
*/
tables: Table[];
}
/**
- * @interface
+ * The related metadata items for the category
+ */
+export interface MetadataCategoryRelated {
+ /**
+ * The tables related to the category
+ */
+ tables?: string[];
+ /**
+ * The functions related to the category
+ */
+ functions?: string[];
+ /**
+ * The resource types related to the category
+ */
+ resourceTypes?: string[];
+ /**
+ * The saved queries related to the category
+ */
+ queries?: string[];
+ /**
+ * The Log Analytics solutions related to the category
+ */
+ solutions?: string[];
+}
+
+/**
+ * Categories are used to group other metadata entities.
+ * @summary A metadata category.
+ */
+export interface MetadataCategory {
+ /**
+ * The ID of the category
+ */
+ id: string;
+ /**
+ * The display name of the category
+ */
+ displayName: string;
+ /**
+ * The description of the category
+ */
+ description?: string;
+ /**
+ * The related metadata items for the category
+ */
+ related?: MetadataCategoryRelated;
+}
+
+/**
+ * The related metadata items for the resource-type
+ */
+export interface MetadataResourceTypeRelated {
+ /**
+ * The tables related to the resource-type
+ */
+ tables?: string[];
+ /**
+ * The functions related to the resource-type
+ */
+ functions?: string[];
+ /**
+ * The categories related to the resource-type
+ */
+ categories?: string[];
+ /**
+ * The queries related to the resource-type
+ */
+ queries?: string[];
+ /**
+ * The Log Analytics workspaces related to the resource-type
+ */
+ workspaces?: string[];
+ /**
+ * The Azure resources related to the resource-type
+ */
+ resources?: string[];
+}
+
+/**
+ * Metadata about types of Azure resources, containing relevant tables, functions, etc.
+ * @summary A type of resource in Azure.
+ */
+export interface MetadataResourceType {
+ /**
+ * The ID of the resource-type
+ */
+ id: string;
+ /**
+ * The type of the resource-type
+ */
+ type: string;
+ /**
+ * The display name of the resource-type
+ */
+ displayName?: string;
+ /**
+ * The description of the resource-type
+ */
+ description?: string;
+ /**
+ * The user-defined labels of the resource-type
+ */
+ labels?: string[];
+ /**
+ * The tags associated with the resource-type
+ */
+ tags?: any;
+ /**
+ * The properties of the resource-type
+ */
+ properties?: any;
+ /**
+ * The related metadata items for the resource-type
+ */
+ related?: MetadataResourceTypeRelated;
+}
+
+/**
+ * The related metadata items for the Log Analytics solution
+ */
+export interface MetadataSolutionRelated {
+ /**
+ * The tables related to the Log Analytics solution
+ */
+ tables: string[];
+ /**
+ * The functions related to the Log Analytics solution
+ */
+ functions?: string[];
+ /**
+ * The categories related to the Log Analytics solution
+ */
+ categories?: string[];
+ /**
+ * The saved queries related to the Log Analytics solution
+ */
+ queries?: string[];
+ /**
+ * The Workspaces referenced in the metadata request that are related to the Log Analytics
+ * solution
+ */
+ workspaces?: string[];
+}
+
+/**
+ * Solutions can group tables and functions that are associated with a certain Azure Log Analytics
+ * offering.
+ * @summary A Log Analytics solution.
+ */
+export interface MetadataSolution {
+ /**
+ * The ID of the Log Analytics solution
+ */
+ id: string;
+ /**
+ * The name of the Log Analytics solution
+ */
+ name: string;
+ /**
+ * The display name of the Log Analytics solution
+ */
+ displayName?: string;
+ /**
+ * The description of the Log Analytics solution
+ */
+ description?: string;
+ /**
+ * The tags that are associated with the Log Analytics solution
+ */
+ tags?: any;
+ /**
+ * The properties of the Log Analytics solution
+ */
+ properties?: any;
+ /**
+ * The related metadata items for the Log Analytics solution
+ */
+ related: MetadataSolutionRelated;
+}
+
+/**
+ * An interface representing MetadataTableColumnsItem.
+ */
+export interface MetadataTableColumnsItem {
+ /**
+ * The name of the column
+ */
+ name: string;
+ /**
+ * The description of the column
+ */
+ description?: string;
+ /**
+ * The data type of the column. Possible values include: 'bool', 'datetime', 'dynamic', 'int',
+ * 'long', 'real', 'string'
+ */
+ type: MetadataColumnDataType;
+ /**
+ * A flag indicating this column is a preferred facet
+ */
+ isPreferredFacet?: boolean;
+ /**
+ * an indication of the source of the column, used only when multiple workspaces have conflicting
+ * definition for the column
+ */
+ source?: any;
+}
+
+/**
+ * The related metadata items for the table
+ */
+export interface MetadataTableRelated {
+ /**
+ * The related categories for the table
+ */
+ categories?: string[];
+ /**
+ * The related Log Analytics solutions for the table
+ */
+ solutions?: string[];
+ /**
+ * The related resource types for the table
+ */
+ resourceTypes?: string[];
+ /**
+ * The related Log Analytics workspaces for the table
+ */
+ workspaces?: string[];
+ /**
+ * The related functions for the table
+ */
+ functions?: string[];
+ /**
+ * The related saved queries for the table
+ */
+ queries?: string[];
+}
+
+/**
+ * Tables are part of the workspace schema, and contain a list of columns and a reference to other
+ * relevant metadata items.
+ * @summary A data table that takes part in a workspace schema.
+ */
+export interface MetadataTable {
+ /**
+ * The ID of the table
+ */
+ id: string;
+ /**
+ * The name of the table
+ */
+ name: string;
+ /**
+ * The description of the table
+ */
+ description?: string;
+ /**
+ * The column associated with the timespan query parameter for the table
+ */
+ timespanColumn?: string;
+ /**
+ * The user defined labels of the table
+ */
+ labels?: string[];
+ /**
+ * The tags associated with the table
+ */
+ tags?: any;
+ /**
+ * The properties of the table
+ */
+ properties?: any;
+ /**
+ * The list of columns defined on the table
+ */
+ columns?: MetadataTableColumnsItem[];
+ /**
+ * The related metadata items for the table
+ */
+ related?: MetadataTableRelated;
+}
+
+/**
+ * The related metadata items for the function.
+ */
+export interface MetadataFunctionRelated {
+ /**
+ * The related tables for the function.
+ */
+ tables?: string[];
+ /**
+ * The related Log Analytics solutions for the function.
+ */
+ solutions?: string[];
+ /**
+ * The related resource types for the function.
+ */
+ resourceTypes?: string[];
+ /**
+ * The related categories for the function.
+ */
+ categories?: string[];
+ /**
+ * The related workspaces for the function.
+ */
+ workspaces?: string[];
+}
+
+/**
+ * Functions are stored Kusto queries that can be specified as part of queries by using their name.
+ * @summary A stored function.
+ */
+export interface MetadataFunction {
+ /**
+ * The ID of the function.
+ */
+ id: string;
+ /**
+ * The name of the function, to be used in queries.
+ */
+ name: string;
+ /**
+ * The parameters/arguments of the function, if any.
+ */
+ parameters?: string;
+ /**
+ * The display name of the function.
+ */
+ displayName?: string;
+ /**
+ * The description of the function.
+ */
+ description?: string;
+ /**
+ * The KQL body of the function.
+ */
+ body: string;
+ /**
+ * The tags associated with the function.
+ */
+ tags?: any;
+ /**
+ * The properties of the function.
+ */
+ properties?: any;
+ /**
+ * The related metadata items for the function.
+ */
+ related?: MetadataFunctionRelated;
+}
+
+/**
+ * The related metadata items for the query.
+ */
+export interface MetadataQueryRelated {
+ /**
+ * The related categories for the query.
+ */
+ categories?: string[];
+ /**
+ * The related Log Analytics solutions for the query.
+ */
+ solutions?: string[];
+ /**
+ * The related resource types for the query.
+ */
+ resourceTypes?: string[];
+ /**
+ * The related tables for the query.
+ */
+ tables?: string[];
+}
+
+/**
+ * Queries are stored pieces of KQL, along with a list of relevant metadata items.
+ * @summary A stored query.
+ */
+export interface MetadataQuery {
+ /**
+ * The ID of the query.
+ */
+ id: string;
+ /**
+ * The display name of the query.
+ */
+ displayName?: string;
+ /**
+ * The description of the query.
+ */
+ description?: string;
+ /**
+ * The KQL body of the query.
+ */
+ body: string;
+ /**
+ * The user defined labels associated with the query.
+ */
+ labels?: string[];
+ /**
+ * The tags associated with the query.
+ */
+ tags?: any;
+ /**
+ * The properties of the query.
+ */
+ properties?: any;
+ /**
+ * The related metadata items for the query.
+ */
+ related?: MetadataQueryRelated;
+}
+
+/**
+ * The related metadata items for the Application Insights app.
+ */
+export interface MetadataApplicationRelated {
+ /**
+ * The related tables for the Application Insights app.
+ */
+ tables?: string[];
+ /**
+ * The related functions for the Application Insights app.
+ */
+ functions?: string[];
+}
+
+/**
+ * Application Insights apps that were part of the metadata request and that the user has access
+ * to.
+ * @summary An Application Insights application.
+ */
+export interface MetadataApplication {
+ /**
+ * The ID of the Application Insights app.
+ */
+ id: string;
+ /**
+ * The ARM resource ID of the Application Insights app.
+ */
+ resourceId: string;
+ /**
+ * The name of the Application Insights app.
+ */
+ name: string;
+ /**
+ * The Azure region of the Application Insights app.
+ */
+ region: string;
+ /**
+ * The related metadata items for the Application Insights app.
+ */
+ related?: MetadataApplicationRelated;
+}
+
+/**
+ * The related metadata items for the Log Analytics workspace.
+ */
+export interface MetadataWorkspaceRelated {
+ /**
+ * The related tables for the Log Analytics workspace.
+ */
+ tables?: string[];
+ /**
+ * The related Log Analytics solutions for the Log Analytics workspace.
+ */
+ solutions?: string[];
+ /**
+ * The related resource types for the Log Analytics workspace.
+ */
+ resourceTypes?: string[];
+ /**
+ * The related functions for the Log Analytics workspace.
+ */
+ functions?: string[];
+ /**
+ * The related Azure resources for the Log Analytics workspace.
+ */
+ resources?: string[];
+}
+
+/**
+ * Log Analytics workspaces that were part of the metadata request and that the user has access to.
+ * @summary A Log Analytics workspace.
+ */
+export interface MetadataWorkspace {
+ /**
+ * The ID of the Log Analytics workspace.
+ */
+ id: string;
+ /**
+ * The ARM resource ID of the Log Analytics workspace.
+ */
+ resourceId: string;
+ /**
+ * The name of the Log Analytics workspace.
+ */
+ name: string;
+ /**
+ * The Azure region of the Log Analytics workspace.
+ */
+ region: string;
+ /**
+ * The related metadata items for the Log Analytics workspace.
+ */
+ related?: MetadataWorkspaceRelated;
+}
+
+/**
+ * An interface representing MetadataPermissionsWorkspacesItem.
+ */
+export interface MetadataPermissionsWorkspacesItem {
+ /**
+ * The resource ID on the permission indication.
+ */
+ resourceId: string;
+ /**
+ * The list of tables that were denied access for the resource ID.
+ */
+ denyTables?: string[];
+}
+
+/**
+ * An interface representing MetadataPermissionsResourcesItem.
+ */
+export interface MetadataPermissionsResourcesItem {
+ /**
+ * The resource ID on the permission indication.
+ */
+ resourceId: string;
+ /**
+ * The list of tables that were denied access for the resource ID.
+ */
+ denyTables?: string[];
+}
+
+/**
+ * An interface representing MetadataPermissionsApplicationsItem.
+ */
+export interface MetadataPermissionsApplicationsItem {
+ /**
+ * The resource ID on the permission indication.
+ */
+ resourceId: string;
+}
+
+/**
+ * Permission information for the metadata call, includes apps/workspaces/resource the user didn't
+ * have access to.
+ * @summary Permission information.
+ */
+export interface MetadataPermissions {
+ /**
+ * The permission indication for the workspaces on the metadata request.
+ */
+ workspaces: MetadataPermissionsWorkspacesItem[];
+ /**
+ * The permission indication for the Azure resources on the metadata request.
+ */
+ resources?: MetadataPermissionsResourcesItem[];
+ /**
+ * The permission indication for the Application Insights apps on the metadata request.
+ */
+ applications?: MetadataPermissionsApplicationsItem[];
+}
+
+/**
+ * The metadata response for the app, including available tables, etc.
+ * @summary A metadata response.
+ */
+export interface MetadataResults {
+ /**
+ * The list of categories that are referenced in this metadata response.
+ */
+ categories?: MetadataCategory[];
+ /**
+ * The list of resource types that are referenced in this metadata response.
+ */
+ resourceTypes?: MetadataResourceType[];
+ /**
+ * The list of Log Analytics solutions installed on the workspace.
+ */
+ solutions?: MetadataSolution[];
+ /**
+ * The list of tables and columns that comprise the schema of the workspace.
+ */
+ tables?: MetadataTable[];
+ /**
+ * The list of functions stored on the workspace, or introduced by solutions etc.
+ */
+ functions?: MetadataFunction[];
+ /**
+ * The list of saved queries stored on the workspace, or introduced by solutions, resource types,
+ * etc.
+ */
+ queries?: MetadataQuery[];
+ /**
+ * The list of Application Insights apps that were referenced in the metadata request.
+ */
+ applications?: MetadataApplication[];
+ /**
+ * The list of Log Analytics workspaces that were referenced in the metadata request.
+ */
+ workspaces?: MetadataWorkspace[];
+ /**
+ * The list of Azure resources that were referenced in the metadata request.
+ */
+ resources?: any[];
+ /**
+ * The list of permission rules that affected the metadata request.
+ */
+ permissions?: MetadataPermissions[];
+}
+
+/**
* An interface representing ErrorDetail.
* @summary Error details.
- *
*/
export interface ErrorDetail {
/**
- * @member {string} code The error's code.
+ * The error's code.
*/
code: string;
/**
- * @member {string} message A human readable error message.
+ * A human readable error message.
*/
message: string;
/**
- * @member {string} [target] Indicates which property in the request is
- * responsible for the error.
+ * Indicates which property in the request is responsible for the error.
*/
target?: string;
/**
- * @member {string} [value] Indicates which value in 'target' is responsible
- * for the error.
+ * Indicates which value in 'target' is responsible for the error.
*/
value?: string;
/**
- * @member {string[]} [resources] Indicates resources which were responsible
- * for the error.
+ * Indicates resources which were responsible for the error.
*/
resources?: string[];
/**
- * @member {any} [additionalProperties]
+ * Additional properties that can be provided on the error details object
*/
additionalProperties?: any;
}
/**
- * @interface
* An interface representing ErrorInfo.
* @summary The code and message for an error.
- *
*/
export interface ErrorInfo {
/**
- * @member {string} code A machine readable error code.
+ * A machine readable error code.
*/
code: string;
/**
- * @member {string} message A human readable error message.
+ * A human readable error message.
*/
message: string;
/**
- * @member {ErrorDetail[]} [details] error details.
+ * error details.
*/
details?: ErrorDetail[];
/**
- * @member {ErrorInfo} [innererror] Inner error details if they exist.
+ * Inner error details if they exist.
*/
innererror?: ErrorInfo;
/**
- * @member {any} [additionalProperties]
+ * Additional properties that can be provided on the error info object
*/
additionalProperties?: any;
}
/**
- * @interface
- * An interface representing ErrorResponse.
- * @summary Error details.
- *
* Contains details when the response code indicates an error.
- *
+ * @summary Error details.
*/
export interface ErrorResponse {
/**
- * @member {ErrorInfo} error The error details.
+ * The error details.
*/
error: ErrorInfo;
}
/**
- * @interface
* An interface representing LogAnalyticsClientOptions.
- * @extends ServiceClientOptions
*/
export interface LogAnalyticsClientOptions extends ServiceClientOptions {
- /**
- * @member {string} [baseUri]
- */
baseUri?: string;
}
+/**
+ * Defines values for MetadataColumnDataType.
+ * Possible values include: 'bool', 'datetime', 'dynamic', 'int', 'long', 'real', 'string'
+ * @readonly
+ * @enum {string}
+ */
+export type MetadataColumnDataType = 'bool' | 'datetime' | 'dynamic' | 'int' | 'long' | 'real' | 'string';
+
/**
* Contains response data for the execute operation.
*/
@@ -198,9 +784,50 @@ export type QueryExecuteResponse = QueryResults & {
* The response body as text (string format)
*/
bodyAsText: string;
+
/**
* The response body as parsed JSON or XML
*/
parsedBody: QueryResults;
};
};
+
+/**
+ * Contains response data for the get operation.
+ */
+export type MetadataGetResponse = MetadataResults & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: MetadataResults;
+ };
+};
+
+/**
+ * Contains response data for the post operation.
+ */
+export type MetadataPostResponse = MetadataResults & {
+ /**
+ * The underlying HTTP response.
+ */
+ _response: msRest.HttpResponse & {
+ /**
+ * The response body as text (string format)
+ */
+ bodyAsText: string;
+
+ /**
+ * The response body as parsed JSON or XML
+ */
+ parsedBody: MetadataResults;
+ };
+};
diff --git a/sdk/operationalinsights/loganalytics/src/models/mappers.ts b/sdk/operationalinsights/loganalytics/src/models/mappers.ts
index cd3f848e53c8..945045c85b80 100644
--- a/sdk/operationalinsights/loganalytics/src/models/mappers.ts
+++ b/sdk/operationalinsights/loganalytics/src/models/mappers.ts
@@ -1,11 +1,9 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
- * Changes may cause incorrect behavior and will be lost if the code is
- * regenerated.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
@@ -137,6 +135,1287 @@ export const QueryResults: msRest.CompositeMapper = {
}
};
+export const MetadataCategoryRelated: msRest.CompositeMapper = {
+ serializedName: "metadataCategory_related",
+ type: {
+ name: "Composite",
+ className: "MetadataCategoryRelated",
+ modelProperties: {
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ queries: {
+ serializedName: "queries",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataCategory: msRest.CompositeMapper = {
+ serializedName: "metadataCategory",
+ type: {
+ name: "Composite",
+ className: "MetadataCategory",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ displayName: {
+ required: true,
+ serializedName: "displayName",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataCategoryRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataResourceTypeRelated: msRest.CompositeMapper = {
+ serializedName: "metadataResourceType_related",
+ type: {
+ name: "Composite",
+ className: "MetadataResourceTypeRelated",
+ modelProperties: {
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ categories: {
+ serializedName: "categories",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ queries: {
+ serializedName: "queries",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ workspaces: {
+ serializedName: "workspaces",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resources: {
+ serializedName: "resources",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataResourceType: msRest.CompositeMapper = {
+ serializedName: "metadataResourceType",
+ type: {
+ name: "Composite",
+ className: "MetadataResourceType",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ type: {
+ required: true,
+ serializedName: "type",
+ type: {
+ name: "String"
+ }
+ },
+ displayName: {
+ serializedName: "displayName",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ labels: {
+ serializedName: "labels",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ tags: {
+ serializedName: "tags",
+ type: {
+ name: "Object"
+ }
+ },
+ properties: {
+ serializedName: "properties",
+ type: {
+ name: "Object"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataResourceTypeRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataSolutionRelated: msRest.CompositeMapper = {
+ serializedName: "metadataSolution_related",
+ type: {
+ name: "Composite",
+ className: "MetadataSolutionRelated",
+ modelProperties: {
+ tables: {
+ required: true,
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ categories: {
+ serializedName: "categories",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ queries: {
+ serializedName: "queries",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ workspaces: {
+ serializedName: "workspaces",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataSolution: msRest.CompositeMapper = {
+ serializedName: "metadataSolution",
+ type: {
+ name: "Composite",
+ className: "MetadataSolution",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ displayName: {
+ serializedName: "displayName",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ tags: {
+ serializedName: "tags",
+ type: {
+ name: "Object"
+ }
+ },
+ properties: {
+ serializedName: "properties",
+ type: {
+ name: "Object"
+ }
+ },
+ related: {
+ required: true,
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataSolutionRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataTableColumnsItem: msRest.CompositeMapper = {
+ serializedName: "metadataTable_columnsItem",
+ type: {
+ name: "Composite",
+ className: "MetadataTableColumnsItem",
+ modelProperties: {
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ type: {
+ required: true,
+ serializedName: "type",
+ type: {
+ name: "String"
+ }
+ },
+ isPreferredFacet: {
+ serializedName: "isPreferredFacet",
+ type: {
+ name: "Boolean"
+ }
+ },
+ source: {
+ serializedName: "source",
+ type: {
+ name: "Object"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataTableRelated: msRest.CompositeMapper = {
+ serializedName: "metadataTable_related",
+ type: {
+ name: "Composite",
+ className: "MetadataTableRelated",
+ modelProperties: {
+ categories: {
+ serializedName: "categories",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ workspaces: {
+ serializedName: "workspaces",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ queries: {
+ serializedName: "queries",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataTable: msRest.CompositeMapper = {
+ serializedName: "metadataTable",
+ type: {
+ name: "Composite",
+ className: "MetadataTable",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ timespanColumn: {
+ serializedName: "timespanColumn",
+ type: {
+ name: "String"
+ }
+ },
+ labels: {
+ serializedName: "labels",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ tags: {
+ serializedName: "tags",
+ type: {
+ name: "Object"
+ }
+ },
+ properties: {
+ serializedName: "properties",
+ type: {
+ name: "Object"
+ }
+ },
+ columns: {
+ serializedName: "columns",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataTableColumnsItem"
+ }
+ }
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataTableRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataFunctionRelated: msRest.CompositeMapper = {
+ serializedName: "metadataFunction_related",
+ type: {
+ name: "Composite",
+ className: "MetadataFunctionRelated",
+ modelProperties: {
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ categories: {
+ serializedName: "categories",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ workspaces: {
+ serializedName: "workspaces",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataFunction: msRest.CompositeMapper = {
+ serializedName: "metadataFunction",
+ type: {
+ name: "Composite",
+ className: "MetadataFunction",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ parameters: {
+ serializedName: "parameters",
+ type: {
+ name: "String"
+ }
+ },
+ displayName: {
+ serializedName: "displayName",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ body: {
+ required: true,
+ serializedName: "body",
+ type: {
+ name: "String"
+ }
+ },
+ tags: {
+ serializedName: "tags",
+ type: {
+ name: "Object"
+ }
+ },
+ properties: {
+ serializedName: "properties",
+ type: {
+ name: "Object"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataFunctionRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataQueryRelated: msRest.CompositeMapper = {
+ serializedName: "metadataQuery_related",
+ type: {
+ name: "Composite",
+ className: "MetadataQueryRelated",
+ modelProperties: {
+ categories: {
+ serializedName: "categories",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataQuery: msRest.CompositeMapper = {
+ serializedName: "metadataQuery",
+ type: {
+ name: "Composite",
+ className: "MetadataQuery",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ displayName: {
+ serializedName: "displayName",
+ type: {
+ name: "String"
+ }
+ },
+ description: {
+ serializedName: "description",
+ type: {
+ name: "String"
+ }
+ },
+ body: {
+ required: true,
+ serializedName: "body",
+ type: {
+ name: "String"
+ }
+ },
+ labels: {
+ serializedName: "labels",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ tags: {
+ serializedName: "tags",
+ type: {
+ name: "Object"
+ }
+ },
+ properties: {
+ serializedName: "properties",
+ type: {
+ name: "Object"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataQueryRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataApplicationRelated: msRest.CompositeMapper = {
+ serializedName: "metadataApplication_related",
+ type: {
+ name: "Composite",
+ className: "MetadataApplicationRelated",
+ modelProperties: {
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataApplication: msRest.CompositeMapper = {
+ serializedName: "metadataApplication",
+ type: {
+ name: "Composite",
+ className: "MetadataApplication",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ resourceId: {
+ required: true,
+ serializedName: "resourceId",
+ type: {
+ name: "String"
+ }
+ },
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ region: {
+ required: true,
+ serializedName: "region",
+ type: {
+ name: "String"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataApplicationRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataWorkspaceRelated: msRest.CompositeMapper = {
+ serializedName: "metadataWorkspace_related",
+ type: {
+ name: "Composite",
+ className: "MetadataWorkspaceRelated",
+ modelProperties: {
+ tables: {
+ serializedName: "tables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ },
+ resources: {
+ serializedName: "resources",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataWorkspace: msRest.CompositeMapper = {
+ serializedName: "metadataWorkspace",
+ type: {
+ name: "Composite",
+ className: "MetadataWorkspace",
+ modelProperties: {
+ id: {
+ required: true,
+ serializedName: "id",
+ type: {
+ name: "String"
+ }
+ },
+ resourceId: {
+ required: true,
+ serializedName: "resourceId",
+ type: {
+ name: "String"
+ }
+ },
+ name: {
+ required: true,
+ serializedName: "name",
+ type: {
+ name: "String"
+ }
+ },
+ region: {
+ required: true,
+ serializedName: "region",
+ type: {
+ name: "String"
+ }
+ },
+ related: {
+ serializedName: "related",
+ type: {
+ name: "Composite",
+ className: "MetadataWorkspaceRelated"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataPermissionsWorkspacesItem: msRest.CompositeMapper = {
+ serializedName: "metadataPermissions_workspacesItem",
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsWorkspacesItem",
+ modelProperties: {
+ resourceId: {
+ required: true,
+ serializedName: "resourceId",
+ type: {
+ name: "String"
+ }
+ },
+ denyTables: {
+ serializedName: "denyTables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataPermissionsResourcesItem: msRest.CompositeMapper = {
+ serializedName: "metadataPermissions_resourcesItem",
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsResourcesItem",
+ modelProperties: {
+ resourceId: {
+ required: true,
+ serializedName: "resourceId",
+ type: {
+ name: "String"
+ }
+ },
+ denyTables: {
+ serializedName: "denyTables",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataPermissionsApplicationsItem: msRest.CompositeMapper = {
+ serializedName: "metadataPermissions_applicationsItem",
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsApplicationsItem",
+ modelProperties: {
+ resourceId: {
+ required: true,
+ serializedName: "resourceId",
+ type: {
+ name: "String"
+ }
+ }
+ }
+ }
+};
+
+export const MetadataPermissions: msRest.CompositeMapper = {
+ serializedName: "metadataPermissions",
+ type: {
+ name: "Composite",
+ className: "MetadataPermissions",
+ modelProperties: {
+ workspaces: {
+ required: true,
+ serializedName: "workspaces",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsWorkspacesItem"
+ }
+ }
+ }
+ },
+ resources: {
+ serializedName: "resources",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsResourcesItem"
+ }
+ }
+ }
+ },
+ applications: {
+ serializedName: "applications",
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataPermissionsApplicationsItem"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
+export const MetadataResults: msRest.CompositeMapper = {
+ serializedName: "metadataResults",
+ type: {
+ name: "Composite",
+ className: "MetadataResults",
+ modelProperties: {
+ categories: {
+ serializedName: "categories",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataCategory"
+ }
+ }
+ }
+ },
+ resourceTypes: {
+ serializedName: "resourceTypes",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataResourceType"
+ }
+ }
+ }
+ },
+ solutions: {
+ serializedName: "solutions",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataSolution"
+ }
+ }
+ }
+ },
+ tables: {
+ serializedName: "tables",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataTable"
+ }
+ }
+ }
+ },
+ functions: {
+ serializedName: "functions",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataFunction"
+ }
+ }
+ }
+ },
+ queries: {
+ serializedName: "queries",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataQuery"
+ }
+ }
+ }
+ },
+ applications: {
+ serializedName: "applications",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataApplication"
+ }
+ }
+ }
+ },
+ workspaces: {
+ serializedName: "workspaces",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataWorkspace"
+ }
+ }
+ }
+ },
+ resources: {
+ serializedName: "resources",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Object"
+ }
+ }
+ }
+ },
+ permissions: {
+ serializedName: "permissions",
+ constraints: {
+ UniqueItems: true
+ },
+ type: {
+ name: "Sequence",
+ element: {
+ type: {
+ name: "Composite",
+ className: "MetadataPermissions"
+ }
+ }
+ }
+ }
+ }
+ }
+};
+
export const ErrorDetail: msRest.CompositeMapper = {
serializedName: "errorDetail",
type: {
diff --git a/sdk/operationalinsights/loganalytics/src/models/metadataMappers.ts b/sdk/operationalinsights/loganalytics/src/models/metadataMappers.ts
new file mode 100644
index 000000000000..6a72625f3bbd
--- /dev/null
+++ b/sdk/operationalinsights/loganalytics/src/models/metadataMappers.ts
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
+ */
+
+export {
+ ErrorDetail,
+ ErrorInfo,
+ ErrorResponse,
+ MetadataApplication,
+ MetadataApplicationRelated,
+ MetadataCategory,
+ MetadataCategoryRelated,
+ MetadataFunction,
+ MetadataFunctionRelated,
+ MetadataPermissions,
+ MetadataPermissionsApplicationsItem,
+ MetadataPermissionsResourcesItem,
+ MetadataPermissionsWorkspacesItem,
+ MetadataQuery,
+ MetadataQueryRelated,
+ MetadataResourceType,
+ MetadataResourceTypeRelated,
+ MetadataResults,
+ MetadataSolution,
+ MetadataSolutionRelated,
+ MetadataTable,
+ MetadataTableColumnsItem,
+ MetadataTableRelated,
+ MetadataWorkspace,
+ MetadataWorkspaceRelated
+} from "../models/mappers";
diff --git a/sdk/operationalinsights/loganalytics/src/models/parameters.ts b/sdk/operationalinsights/loganalytics/src/models/parameters.ts
index 4a414cdb76f6..60323f21ebf4 100644
--- a/sdk/operationalinsights/loganalytics/src/models/parameters.ts
+++ b/sdk/operationalinsights/loganalytics/src/models/parameters.ts
@@ -1,7 +1,6 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
diff --git a/sdk/operationalinsights/loganalytics/src/models/queryMappers.ts b/sdk/operationalinsights/loganalytics/src/models/queryMappers.ts
index 6add1a2ffa64..4a9fff657a0f 100644
--- a/sdk/operationalinsights/loganalytics/src/models/queryMappers.ts
+++ b/sdk/operationalinsights/loganalytics/src/models/queryMappers.ts
@@ -1,20 +1,17 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
- * Changes may cause incorrect behavior and will be lost if the code is
- * regenerated.
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export {
- QueryBody,
- QueryResults,
- Table,
Column,
- ErrorResponse,
+ ErrorDetail,
ErrorInfo,
- ErrorDetail
+ ErrorResponse,
+ QueryBody,
+ QueryResults,
+ Table
} from "../models/mappers";
-
diff --git a/sdk/operationalinsights/loganalytics/src/operations/index.ts b/sdk/operationalinsights/loganalytics/src/operations/index.ts
index 3c190e0c93b3..428395e6bdbb 100644
--- a/sdk/operationalinsights/loganalytics/src/operations/index.ts
+++ b/sdk/operationalinsights/loganalytics/src/operations/index.ts
@@ -1,7 +1,6 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
@@ -9,3 +8,4 @@
*/
export * from "./query";
+export * from "./metadata";
diff --git a/sdk/operationalinsights/loganalytics/src/operations/metadata.ts b/sdk/operationalinsights/loganalytics/src/operations/metadata.ts
new file mode 100644
index 000000000000..b991888b1d79
--- /dev/null
+++ b/sdk/operationalinsights/loganalytics/src/operations/metadata.ts
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * Changes may cause incorrect behavior and will be lost if the code is
+ * regenerated.
+ */
+
+import * as msRest from "@azure/ms-rest-js";
+import * as Models from "../models";
+import * as Mappers from "../models/metadataMappers";
+import * as Parameters from "../models/parameters";
+import { LogAnalyticsClientContext } from "../logAnalyticsClientContext";
+
+/** Class representing a Metadata. */
+export class Metadata {
+ private readonly client: LogAnalyticsClientContext;
+
+ /**
+ * Create a Metadata.
+ * @param {LogAnalyticsClientContext} client Reference to the service client.
+ */
+ constructor(client: LogAnalyticsClientContext) {
+ this.client = client;
+ }
+
+ /**
+ * Retrieve the metadata information for the workspace, including its schema, functions, workspace
+ * info, categories etc.
+ * @summary Gets metadata information
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param [options] The optional parameters
+ * @returns Promise
+ */
+ get(workspaceId: string, options?: msRest.RequestOptionsBase): Promise;
+ /**
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param callback The callback
+ */
+ get(workspaceId: string, callback: msRest.ServiceCallback): void;
+ /**
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param options The optional parameters
+ * @param callback The callback
+ */
+ get(workspaceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void;
+ get(workspaceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ workspaceId,
+ options
+ },
+ getOperationSpec,
+ callback) as Promise;
+ }
+
+ /**
+ * Retrieve the metadata information for the workspace, including its schema, functions, workspace
+ * info, categories etc.
+ * @summary Gets metadata information
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param [options] The optional parameters
+ * @returns Promise
+ */
+ post(workspaceId: string, options?: msRest.RequestOptionsBase): Promise;
+ /**
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param callback The callback
+ */
+ post(workspaceId: string, callback: msRest.ServiceCallback): void;
+ /**
+ * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the
+ * Azure portal.
+ * @param options The optional parameters
+ * @param callback The callback
+ */
+ post(workspaceId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void;
+ post(workspaceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise {
+ return this.client.sendOperationRequest(
+ {
+ workspaceId,
+ options
+ },
+ postOperationSpec,
+ callback) as Promise;
+ }
+}
+
+// Operation Specifications
+const serializer = new msRest.Serializer(Mappers);
+const getOperationSpec: msRest.OperationSpec = {
+ httpMethod: "GET",
+ path: "v1/workspaces/{workspaceId}/metadata",
+ urlParameters: [
+ Parameters.workspaceId
+ ],
+ responses: {
+ 200: {
+ bodyMapper: Mappers.MetadataResults
+ },
+ default: {
+ bodyMapper: Mappers.ErrorResponse
+ }
+ },
+ serializer
+};
+
+const postOperationSpec: msRest.OperationSpec = {
+ httpMethod: "POST",
+ path: "v1/workspaces/{workspaceId}/metadata",
+ urlParameters: [
+ Parameters.workspaceId
+ ],
+ responses: {
+ 200: {
+ bodyMapper: Mappers.MetadataResults
+ },
+ default: {
+ bodyMapper: Mappers.ErrorResponse
+ }
+ },
+ serializer
+};
diff --git a/sdk/operationalinsights/loganalytics/src/operations/query.ts b/sdk/operationalinsights/loganalytics/src/operations/query.ts
index 9fe30ac699db..3608a710e388 100644
--- a/sdk/operationalinsights/loganalytics/src/operations/query.ts
+++ b/sdk/operationalinsights/loganalytics/src/operations/query.ts
@@ -1,7 +1,6 @@
/*
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for
- * license information.
+ * Copyright (c) Microsoft Corporation.
+ * Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
diff --git a/sdk/operationalinsights/loganalytics/tsconfig.json b/sdk/operationalinsights/loganalytics/tsconfig.json
index 87bbf5b5fa49..422b584abd5e 100644
--- a/sdk/operationalinsights/loganalytics/tsconfig.json
+++ b/sdk/operationalinsights/loganalytics/tsconfig.json
@@ -9,7 +9,7 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
- "lib": ["es6"],
+ "lib": ["es6", "dom"],
"declaration": true,
"outDir": "./esm",
"importHelpers": true