Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3883 from Azure/restapi_auto_applicationinsights/…
Browse files Browse the repository at this point in the history
…data-plane

[AutoPR] applicationinsights/data-plane
  • Loading branch information
Dan Schulte authored Oct 23, 2018
2 parents 2617524 + edd5ca6 commit d0ee9f6
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 81 deletions.
42 changes: 21 additions & 21 deletions lib/services/applicationinsights-query/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
98 changes: 49 additions & 49 deletions lib/services/applicationinsights-query/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
---
uid: azure-applicationinsights-query
summary: *content

---
# Microsoft Azure SDK for Node.js - ApplicationInsightsDataClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features


## How to Install

```bash
npm install azure-applicationinsights-query
```

## How to use

### Authentication, client creation and get metrics as an example.

```javascript
const msRest = require("ms-rest");
const ApplicationInsightsDataClient = require("azure-applicationinsights-query");
const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
const client = new ApplicationInsightsDataClient(creds, subscriptionId);
const appId = "testappId";
const metricId = "requests/count";
const timespan = "testtimespan";
const interval = "P1Y2M3DT4H5M6S";
const aggregation = ["min"];
const segment = ["applicationBuild"];
const top = 1;
const orderby = "testorderby";
const filter = "testfilter";
client.metrics.get(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
---
uid: azure-applicationinsights-query
summary: *content

---
# Microsoft Azure SDK for Node.js - ApplicationInsightsDataClient
This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

## Features


## How to Install

```bash
npm install azure-applicationinsights-query
```

## How to use

### Authentication, client creation and get metrics as an example.

```javascript
const msRest = require("ms-rest");
const ApplicationInsightsDataClient = require("azure-applicationinsights-query");
const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
const client = new ApplicationInsightsDataClient(creds, subscriptionId);
const appId = "testappId";
const metricId = "requests/count";
const timespan = "testtimespan";
const interval = "P1Y2M3DT4H5M6S";
const aggregation = ["min"];
const segment = ["applicationBuild"];
const top = 1;
const orderby = "testorderby";
const filter = "testfilter";
client.metrics.get(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});

## Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ export interface Column {
export interface Table {
name: string;
columns: Column[];
rows: string[][];
rows: any[][];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ class MetricsPostBodySchemaParameters {
required: false,
serializedName: 'MetricsAggregationElementType',
type: {
name: 'Enum',
allowedValues: [ 'min', 'max', 'avg', 'sum', 'count', 'unique' ]
name: 'String'
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/applicationinsights-query/lib/models/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class Table {
name: 'Sequence',
element: {
required: false,
serializedName: 'StringElementType',
serializedName: 'ObjectElementType',
type: {
name: 'String'
name: 'Object'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ function _get(appId, metricId, options, callback) {
}
if (Array.isArray(aggregation)) {
for (let i = 0; i < aggregation.length; i++) {
if (aggregation[i]) {
let allowedValues = [ 'min', 'max', 'avg', 'sum', 'count', 'unique' ];
if (!allowedValues.some( function(item) { return item === aggregation[i]; })) {
throw new Error(aggregation[i] + ' is not a valid value. The valid values are: ' + allowedValues);
}
if (aggregation[i] !== null && aggregation[i] !== undefined && typeof aggregation[i].valueOf() !== 'string') {
throw new Error('aggregation[i] must be of type string.');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/services/applicationinsights-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "azure-applicationinsights-query",
"author": "Microsoft Corporation",
"description": "ApplicationInsightsDataClient Library with typescript type definitions for node",
"version": "1.0.0-preview",
"version": "1.0.1-preview",
"dependencies": {
"ms-rest": "^2.3.3"
},
Expand Down

0 comments on commit d0ee9f6

Please sign in to comment.