Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/operationalinsights/loganalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/loganalytics

### How to use

#### nodejs - Authentication, client creation and metadata get as an example written in TypeScript.
#### nodejs - Authentication, client creation and get metadata as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -35,7 +35,7 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new LogAnalyticsClient(creds, subscriptionId);
const workspaceId = "testworkspaceId";
client.get.metadata(workspaceId).then((result) => {
client.metadata.get(workspaceId).then((result) => {
console.log("The result is:");
console.log(result);
});
Expand All @@ -44,7 +44,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and metadata get as an example written in JavaScript.
#### browser - Authentication, client creation and get metadata as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

Expand Down Expand Up @@ -78,7 +78,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
}
const client = new Azure.Loganalytics.LogAnalyticsClient(res.creds, subscriptionId);
const workspaceId = "testworkspaceId";
client.get.metadata(workspaceId).then((result) => {
client.metadata.get(workspaceId).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { LogAnalyticsClientContext } from "./logAnalyticsClientContext";
class LogAnalyticsClient extends LogAnalyticsClientContext {
// Operation groups
query: operations.Query;
get: operations.Get;
post: operations.Post;
metadata: operations.Metadata;

/**
* Initializes a new instance of the LogAnalyticsClient class.
Expand All @@ -28,8 +27,7 @@ class LogAnalyticsClient extends LogAnalyticsClientContext {
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.LogAnalyticsClientOptions) {
super(credentials, options);
this.query = new operations.Query(this);
this.get = new operations.Get(this);
this.post = new operations.Post(this);
this.metadata = new operations.Metadata(this);
}
}

Expand Down
8 changes: 4 additions & 4 deletions sdk/operationalinsights/loganalytics/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ export type QueryExecuteResponse = QueryResults & {
};

/**
* Contains response data for the metadata operation.
* Contains response data for the get operation.
*/
export type GetMetadataResponse = MetadataResults & {
export type MetadataGetResponse = MetadataResults & {
/**
* The underlying HTTP response.
*/
Expand All @@ -813,9 +813,9 @@ export type GetMetadataResponse = MetadataResults & {
};

/**
* Contains response data for the metadata operation.
* Contains response data for the post operation.
*/
export type PostMetadataResponse = MetadataResults & {
export type MetadataPostResponse = MetadataResults & {
/**
* The underlying HTTP response.
*/
Expand Down
35 changes: 0 additions & 35 deletions sdk/operationalinsights/loganalytics/src/models/postMappers.ts

This file was deleted.

80 changes: 0 additions & 80 deletions sdk/operationalinsights/loganalytics/src/operations/get.ts

This file was deleted.

3 changes: 1 addition & 2 deletions sdk/operationalinsights/loganalytics/src/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
*/

export * from "./query";
export * from "./get";
export * from "./post";
export * from "./metadata";
130 changes: 130 additions & 0 deletions sdk/operationalinsights/loganalytics/src/operations/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* 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<Models.MetadataGetResponse>
*/
get(workspaceId: string, options?: msRest.RequestOptionsBase): Promise<Models.MetadataGetResponse>;
/**
* @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<Models.MetadataResults>): 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<Models.MetadataResults>): void;
get(workspaceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.MetadataResults>, callback?: msRest.ServiceCallback<Models.MetadataResults>): Promise<Models.MetadataGetResponse> {
return this.client.sendOperationRequest(
{
workspaceId,
options
},
getOperationSpec,
callback) as Promise<Models.MetadataGetResponse>;
}

/**
* 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<Models.MetadataPostResponse>
*/
post(workspaceId: string, options?: msRest.RequestOptionsBase): Promise<Models.MetadataPostResponse>;
/**
* @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<Models.MetadataResults>): 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<Models.MetadataResults>): void;
post(workspaceId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.MetadataResults>, callback?: msRest.ServiceCallback<Models.MetadataResults>): Promise<Models.MetadataPostResponse> {
return this.client.sendOperationRequest(
{
workspaceId,
options
},
postOperationSpec,
callback) as Promise<Models.MetadataPostResponse>;
}
}

// 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
};
Loading