Skip to content
Closed
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
42 changes: 21 additions & 21 deletions packages/@azure/arm-operationalinsights/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) 2019 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.
166 changes: 83 additions & 83 deletions packages/@azure/arm-operationalinsights/README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
# Azure OperationalInsightsManagementClient SDK for JavaScript
This package contains an isomorphic SDK for OperationalInsightsManagementClient.

## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript

## How to Install
```
npm install @azure/arm-operationalinsights
```


## How to use

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

```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { OperationalInsightsManagementClient, OperationalInsightsManagementModels, OperationalInsightsManagementMappers } from "@azure/arm-operationalinsights";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new OperationalInsightsManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const workspaceName = "testworkspaceName";
const linkedServiceName = "testlinkedServiceName";
client.linkedServices.get(resourceGroupName, workspaceName, linkedServiceName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```

### browser - Authentication, client creation and get linkedServices as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.

- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-operationalinsights sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-operationalinsights/dist/arm-operationalinsights.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmOperationalinsights.OperationalInsightsManagementClient(res.creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const workspaceName = "testworkspaceName";
const linkedServiceName = "testlinkedServiceName";
client.linkedServices.get(resourceGroupName, workspaceName, linkedServiceName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.error(err);
});
});
</script>
</head>
<body>
</body>
</html>
```

# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
# Azure OperationalInsightsManagementClient SDK for JavaScript
This package contains an isomorphic SDK for OperationalInsightsManagementClient.
## Currently supported environments
- Node.js version 6.x.x or higher
- Browser JavaScript
## How to Install
```
npm install @azure/arm-operationalinsights
```
## How to use
### nodejs - Authentication, client creation and get linkedServices as an example written in TypeScript.
```ts
import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";
import * as msRestNodeAuth from "ms-rest-nodeauth";
import { OperationalInsightsManagementClient, OperationalInsightsManagementModels, OperationalInsightsManagementMappers } from "@azure/arm-operationalinsights";
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new OperationalInsightsManagementClient(creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const workspaceName = "testworkspaceName";
const linkedServiceName = "testlinkedServiceName";
client.linkedServices.get(resourceGroupName, workspaceName, linkedServiceName).then((result) => {
console.log("The result is:");
console.log(result);
});
}).catch((err) => {
console.error(err);
});
```
### browser - Authentication, client creation and get linkedServices as an example written in JavaScript.
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
- index.html
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/arm-operationalinsights sample</title>
<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
<script src="node_modules/@azure/arm-operationalinsights/dist/arm-operationalinsights.js"></script>
<script>
const subscriptionId = "<Subscription_Id>";
const authManager = new msAuth.AuthManager({
clientId: "<client id for your Azure AD app>",
tenant: "<optional tenant for your organization>"
});
authManager.finalizeLogin().then((res) => {
if (!res.isLoggedIn) {
// may cause redirects
authManager.login();
}
const client = new Azure.ArmOperationalinsights.OperationalInsightsManagementClient(res.creds, subscriptionId);
const resourceGroupName = "testresourceGroupName";
const workspaceName = "testworkspaceName";
const linkedServiceName = "testlinkedServiceName";
client.linkedServices.get(resourceGroupName, workspaceName, linkedServiceName).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log("An error occurred:");
console.error(err);
});
});
</script>
</head>
<body>
</body>
</html>
```
# Related projects
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
73 changes: 13 additions & 60 deletions packages/@azure/arm-operationalinsights/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export interface WorkspaceListUsagesResult extends Array<UsageMetric> {
/**
* @interface
* An interface representing the WorkspaceListManagementGroupsResult.
* The list workspace managmement groups operation response.
* The list workspace management groups operation response.
*
* @extends Array<ManagementGroup>
*/
Expand Down Expand Up @@ -488,80 +488,33 @@ export interface OperationListResult extends Array<Operation> {

/**
* Defines values for DataSourceKind.
* Possible values include: 'AzureActivityLog', 'ChangeTrackingPath',
* 'ChangeTrackingDefaultPath', 'ChangeTrackingDefaultRegistry',
* 'ChangeTrackingCustomRegistry', 'CustomLog', 'CustomLogCollection',
* 'GenericDataSource', 'IISLogs', 'LinuxPerformanceObject',
* 'LinuxPerformanceCollection', 'LinuxSyslog', 'LinuxSyslogCollection',
* 'WindowsEvent', 'WindowsPerformanceCounter'
* There could be more values for this enum apart from the ones defined here.If
* you want to set a value that is not from the known values then you can do
* the following:
* let param: DataSourceKind =
* <DataSourceKind>"someUnknownValueThatWillStillBeValid";
* Possible values include: 'AzureActivityLog', 'ChangeTrackingPath', 'ChangeTrackingDefaultPath',
* 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', 'CustomLog',
* 'CustomLogCollection', 'GenericDataSource', 'IISLogs', 'LinuxPerformanceObject',
* 'LinuxPerformanceCollection', 'LinuxSyslog', 'LinuxSyslogCollection', 'WindowsEvent',
* 'WindowsPerformanceCounter'
* @readonly
* @enum {string}
*/
export enum DataSourceKind {
AzureActivityLog = 'AzureActivityLog',
ChangeTrackingPath = 'ChangeTrackingPath',
ChangeTrackingDefaultPath = 'ChangeTrackingDefaultPath',
ChangeTrackingDefaultRegistry = 'ChangeTrackingDefaultRegistry',
ChangeTrackingCustomRegistry = 'ChangeTrackingCustomRegistry',
CustomLog = 'CustomLog',
CustomLogCollection = 'CustomLogCollection',
GenericDataSource = 'GenericDataSource',
IISLogs = 'IISLogs',
LinuxPerformanceObject = 'LinuxPerformanceObject',
LinuxPerformanceCollection = 'LinuxPerformanceCollection',
LinuxSyslog = 'LinuxSyslog',
LinuxSyslogCollection = 'LinuxSyslogCollection',
WindowsEvent = 'WindowsEvent',
WindowsPerformanceCounter = 'WindowsPerformanceCounter',
}
export type DataSourceKind = 'AzureActivityLog' | 'ChangeTrackingPath' | 'ChangeTrackingDefaultPath' | 'ChangeTrackingDefaultRegistry' | 'ChangeTrackingCustomRegistry' | 'CustomLog' | 'CustomLogCollection' | 'GenericDataSource' | 'IISLogs' | 'LinuxPerformanceObject' | 'LinuxPerformanceCollection' | 'LinuxSyslog' | 'LinuxSyslogCollection' | 'WindowsEvent' | 'WindowsPerformanceCounter';

/**
* Defines values for SkuNameEnum.
* Possible values include: 'Free', 'Standard', 'Premium', 'Unlimited',
* 'PerNode', 'PerGB2018', 'Standalone'
* There could be more values for this enum apart from the ones defined here.If
* you want to set a value that is not from the known values then you can do
* the following:
* let param: SkuNameEnum =
* <SkuNameEnum>"someUnknownValueThatWillStillBeValid";
* Possible values include: 'Free', 'Standard', 'Premium', 'Unlimited', 'PerNode', 'PerGB2018',
* 'Standalone'
* @readonly
* @enum {string}
*/
export enum SkuNameEnum {
Free = 'Free',
Standard = 'Standard',
Premium = 'Premium',
Unlimited = 'Unlimited',
PerNode = 'PerNode',
PerGB2018 = 'PerGB2018',
Standalone = 'Standalone',
}
export type SkuNameEnum = 'Free' | 'Standard' | 'Premium' | 'Unlimited' | 'PerNode' | 'PerGB2018' | 'Standalone';

/**
* Defines values for EntityStatus.
* Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled',
* 'Deleting', 'ProvisioningAccount'
* There could be more values for this enum apart from the ones defined here.If
* you want to set a value that is not from the known values then you can do
* the following:
* let param: EntityStatus =
* <EntityStatus>"someUnknownValueThatWillStillBeValid";
* Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting',
* 'ProvisioningAccount'
* @readonly
* @enum {string}
*/
export enum EntityStatus {
Creating = 'Creating',
Succeeded = 'Succeeded',
Failed = 'Failed',
Canceled = 'Canceled',
Deleting = 'Deleting',
ProvisioningAccount = 'ProvisioningAccount',
}
export type EntityStatus = 'Creating' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleting' | 'ProvisioningAccount';

/**
* Contains response data for the createOrUpdate operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,12 @@ import * as msRest from "ms-rest-js";
import * as msRestAzure from "ms-rest-azure-js";

const packageName = "@azure/arm-operationalinsights";
const packageVersion = "1.0.0-preview";
const packageVersion = "0.1.0";

export class OperationalInsightsManagementClientContext extends msRestAzure.AzureServiceClient {

credentials: msRest.ServiceClientCredentials;

subscriptionId: string;

apiVersion: string;

acceptLanguage: string;

longRunningOperationRetryTimeout: number;
apiVersion?: string;

/**
* Initializes a new instance of the OperationalInsightsManagementClient class.
Expand All @@ -45,6 +38,11 @@ export class OperationalInsightsManagementClientContext extends msRestAzure.Azur
if (!options) {
options = {};
}
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2015-11-01-preview';
Expand All @@ -55,7 +53,6 @@ export class OperationalInsightsManagementClientContext extends msRestAzure.Azur
this.credentials = credentials;
this.subscriptionId = subscriptionId;

this.addUserAgentInfo(`${packageName}/${packageVersion}`);
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class DataSources {
* @param callback The callback
*/
createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.DataSource>): void;
createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.DataSource>): Promise<Models.DataSourcesCreateOrUpdateResponse> {
createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DataSource>, callback?: msRest.ServiceCallback<Models.DataSource>): Promise<Models.DataSourcesCreateOrUpdateResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
Expand Down Expand Up @@ -90,7 +90,7 @@ export class DataSources {
* @param callback The callback
*/
deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
Expand Down Expand Up @@ -126,7 +126,7 @@ export class DataSources {
* @param callback The callback
*/
get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.DataSource>): void;
get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.DataSource>): Promise<Models.DataSourcesGetResponse> {
get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DataSource>, callback?: msRest.ServiceCallback<Models.DataSource>): Promise<Models.DataSourcesGetResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
Expand Down Expand Up @@ -162,7 +162,7 @@ export class DataSources {
* @param callback The callback
*/
listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options: Models.DataSourcesListByWorkspaceOptionalParams, callback: msRest.ServiceCallback<Models.DataSourceListResult>): void;
listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options?: Models.DataSourcesListByWorkspaceOptionalParams, callback?: msRest.ServiceCallback<Models.DataSourceListResult>): Promise<Models.DataSourcesListByWorkspaceResponse> {
listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options?: Models.DataSourcesListByWorkspaceOptionalParams | msRest.ServiceCallback<Models.DataSourceListResult>, callback?: msRest.ServiceCallback<Models.DataSourceListResult>): Promise<Models.DataSourcesListByWorkspaceResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
Expand Down Expand Up @@ -192,7 +192,7 @@ export class DataSources {
* @param callback The callback
*/
listByWorkspaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.DataSourceListResult>): void;
listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.DataSourceListResult>): Promise<Models.DataSourcesListByWorkspaceNextResponse> {
listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.DataSourceListResult>, callback?: msRest.ServiceCallback<Models.DataSourceListResult>): Promise<Models.DataSourcesListByWorkspaceNextResponse> {
return this.client.sendOperationRequest(
{
nextPageLink,
Expand Down
Loading