Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core v2 monitor query #16606

Merged
merged 15 commits into from
Jul 31, 2021
Merged
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
6 changes: 4 additions & 2 deletions sdk/monitor/monitor-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"test:node": "npm run build:test && npm run integration-test:node",
"test": "npm run build:test && npm run integration-test",
"unit-test:browser": "echo 'karma start --single-run' temporarily disabled",
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/internal/unit/**/*.spec.ts\"",
"unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"",
deyaaeldeen marked this conversation as resolved.
Show resolved Hide resolved
"unit-test": "npm run build:test && npm run unit-test:node && npm run unit-test:browser"
},
"files": [
Expand Down Expand Up @@ -99,14 +99,16 @@
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/core-auth": "^1.3.0",
"@azure/core-http": "^2.0.0",
sarangan12 marked this conversation as resolved.
Show resolved Hide resolved
"@azure/core-tracing": "1.0.0-preview.13",
"@azure/core-client": "^1.0.0",
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/logger": "^1.0.0",
"tslib": "^2.2.0"
},
"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/abort-controller": "^1.0.0",
"@azure/identity": "^1.1.0",
"@azure/monitor-opentelemetry-exporter": "1.0.0-beta.4",
"@azure/test-utils-recorder": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sdk/monitor/monitor-query/review/monitor-query.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

```ts

import { OperationOptions } from '@azure/core-http';
import { PipelineOptions } from '@azure/core-http';
import { OperationOptions } from '@azure/core-client';
import { PipelineOptions } from '@azure/core-rest-pipeline';
import { TokenCredential } from '@azure/core-auth';

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreHttp from "@azure/core-http";
import * as coreClient from "@azure/core-client";
import { AzureLogAnalyticsOptionalParams } from "./models";

const packageName = "monitor-log-query";
const packageVersion = "1.0.0-beta.4";

/** @internal */
export class AzureLogAnalyticsContext extends coreHttp.ServiceClient {
export class AzureLogAnalyticsContext extends coreClient.ServiceClient {
$host: string;

/**
Expand All @@ -25,21 +22,25 @@ export class AzureLogAnalyticsContext extends coreHttp.ServiceClient {
if (!options) {
options = {};
}

const defaultUserAgent = `azsdk-js-${packageName.replace(
"@azure/",
""
)}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`;

super(undefined, {
const defaults: AzureLogAnalyticsOptionalParams = {
requestContentType: "application/json; charset=utf-8"
};

const packageDetails = `azsdk-js-monitor-log-query/1.0.0-beta.4`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;

const optionsWithDefaults = {
...defaults,
...options,
userAgent: options.userAgent
? `${options.userAgent} ${defaultUserAgent}`
: `${defaultUserAgent}`
});

this.requestContentType = "application/json; charset=utf-8";
this.baseUri = options.endpoint || "https://api.loganalytics.io/v1";
userAgentOptions: {
userAgentPrefix
},
baseUri: options.endpoint || "https://api.loganalytics.io/v1"
};
super(optionsWithDefaults);

// Assigning values to Constant parameters
this.$host = options.$host || "https://api.loganalytics.io/v1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import * as coreHttp from "@azure/core-http";
import * as coreClient from "@azure/core-client";

/** Contains the tables, columns & rows resulting from a query. */
export interface QueryResults {
Expand Down Expand Up @@ -512,89 +512,47 @@ export enum KnownMetadataColumnDataType {
export type MetadataColumnDataType = string;

/** Optional parameters. */
export interface QueryGetOptionalParams extends coreHttp.OperationOptions {
export interface QueryGetOptionalParams extends coreClient.OperationOptions {
/** 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;
}

/** Contains response data for the get operation. */
export type QueryGetResponse = QueryResults & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: QueryResults;
};
};
export type QueryGetResponse = QueryResults;

/** Optional parameters. */
export interface QueryExecuteOptionalParams extends coreHttp.OperationOptions {
export interface QueryExecuteOptionalParams
extends coreClient.OperationOptions {
/** Optional. The prefer header to set server timeout, query statistics and visualization information. */
prefer?: string;
}

/** Contains response data for the execute operation. */
export type QueryExecuteResponse = QueryResults & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: QueryResults;
};
};
export type QueryExecuteResponse = QueryResults;

/** Optional parameters. */
export interface QueryBatchOptionalParams extends coreHttp.OperationOptions {}
export interface QueryBatchOptionalParams extends coreClient.OperationOptions {}

/** Contains response data for the batch operation. */
export type QueryBatchResponse = BatchResponse & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: BatchResponse;
};
};
export type QueryBatchResponse = BatchResponse;

/** Optional parameters. */
export interface MetadataGetOptionalParams extends coreHttp.OperationOptions {}
export interface MetadataGetOptionalParams
extends coreClient.OperationOptions {}

/** Contains response data for the get operation. */
export type MetadataGetResponse = MetadataResults & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: MetadataResults;
};
};
export type MetadataGetResponse = MetadataResults;

/** Optional parameters. */
export interface MetadataPostOptionalParams extends coreHttp.OperationOptions {}
export interface MetadataPostOptionalParams
extends coreClient.OperationOptions {}

/** Contains response data for the post operation. */
export type MetadataPostResponse = MetadataResults & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: MetadataResults;
};
};
export type MetadataPostResponse = MetadataResults;

/** Optional parameters. */
export interface AzureLogAnalyticsOptionalParams
extends coreHttp.ServiceClientOptions {
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Overrides client endpoint. */
Expand Down
Loading