From a4a720fd6cb25657edbfa42ba2a03dd695df9a61 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 26 Apr 2019 18:18:04 +0000 Subject: [PATCH] Generated from 871acbdc8437d0f121b78b6e2edde6c72bf7965f Revert "Adds suppression to readme" This reverts commit 350be00bc14201092a2203d868ed623a7e6e0c3a. --- .../arm-operationalinsights/LICENSE.txt | 21 + .../arm-operationalinsights/README.md | 102 ++ .../lib/models/dataSourcesMappers.ts | 21 + .../lib/models/index.ts | 876 ++++++++++++++++++ .../lib/models/linkedServicesMappers.ts | 21 + .../lib/models/mappers.ts | 615 ++++++++++++ .../lib/models/operationsMappers.ts | 17 + .../lib/models/parameters.ts | 155 ++++ .../lib/models/workspacesMappers.ts | 28 + .../operationalInsightsManagementClient.ts | 49 + ...rationalInsightsManagementClientContext.ts | 63 ++ .../lib/operations/dataSources.ts | 341 +++++++ .../lib/operations/index.ts | 14 + .../lib/operations/linkedServices.ts | 295 ++++++ .../lib/operations/operations.ts | 123 +++ .../lib/operations/workspaces.ts | 739 +++++++++++++++ .../arm-operationalinsights/package.json | 56 ++ .../arm-operationalinsights/rollup.config.js | 37 + .../arm-operationalinsights/tsconfig.json | 19 + 19 files changed, 3592 insertions(+) create mode 100644 sdk/operationalinsights/arm-operationalinsights/LICENSE.txt create mode 100644 sdk/operationalinsights/arm-operationalinsights/README.md create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/dataSourcesMappers.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/index.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/linkedServicesMappers.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/mappers.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/operationsMappers.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/parameters.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/models/workspacesMappers.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClient.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClientContext.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operations/dataSources.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operations/index.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operations/linkedServices.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operations/operations.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/lib/operations/workspaces.ts create mode 100644 sdk/operationalinsights/arm-operationalinsights/package.json create mode 100644 sdk/operationalinsights/arm-operationalinsights/rollup.config.js create mode 100644 sdk/operationalinsights/arm-operationalinsights/tsconfig.json diff --git a/sdk/operationalinsights/arm-operationalinsights/LICENSE.txt b/sdk/operationalinsights/arm-operationalinsights/LICENSE.txt new file mode 100644 index 000000000000..b73b4a1293c3 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/LICENSE.txt @@ -0,0 +1,21 @@ +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. diff --git a/sdk/operationalinsights/arm-operationalinsights/README.md b/sdk/operationalinsights/arm-operationalinsights/README.md new file mode 100644 index 000000000000..14368b86f3f8 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/README.md @@ -0,0 +1,102 @@ +## 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 + +```bash +npm install @azure/arm-operationalinsights +``` + +### How to use + +#### nodejs - Authentication, client creation and get linkedServices as an example written in TypeScript. + +##### Install @azure/ms-rest-nodeauth + +```bash +npm install @azure/ms-rest-nodeauth +``` + +##### Sample code + +```typescript +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as msRestNodeAuth from "@azure/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. + +##### Install @azure/ms-rest-browserauth + +```bash +npm install @azure/ms-rest-browserauth +``` + +##### Sample code + +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-operationalinsights sample + + + + + + + + +``` + +## Related projects + +- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/dataSourcesMappers.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/dataSourcesMappers.ts new file mode 100644 index 000000000000..aee58af1b707 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/dataSourcesMappers.ts @@ -0,0 +1,21 @@ +/* + * 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. + */ + +export { + DataSource, + BaseResource, + CloudError, + DataSourceListResult, + LinkedService, + Workspace, + Sku, + Resource +} from "../models/mappers"; + diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/index.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/index.ts new file mode 100644 index 000000000000..351b85010cd6 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/index.ts @@ -0,0 +1,876 @@ +/* + * 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 { BaseResource, CloudError, AzureServiceClientOptions } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export { BaseResource, CloudError }; + + +/** + * @interface + * An interface representing OperationDisplay. + * Display metadata associated with the operation. + * + */ +export interface OperationDisplay { + /** + * @member {string} [provider] Service provider: Microsoft + * OperationsManagement. + */ + provider?: string; + /** + * @member {string} [resource] Resource on which the operation is performed + * etc. + */ + resource?: string; + /** + * @member {string} [operation] Type of operation: get, read, delete, etc. + */ + operation?: string; +} + +/** + * @interface + * An interface representing Operation. + * Supported operation of OperationalInsights resource provider. + * + */ +export interface Operation { + /** + * @member {string} [name] Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * @member {OperationDisplay} [display] Display metadata associated with the + * operation. + */ + display?: OperationDisplay; +} + +/** + * @interface + * An interface representing LinkedService. + * The top level Linked service resource container. + * + * @extends BaseResource + */ +export interface LinkedService extends BaseResource { + /** + * @member {string} resourceId The resource id of the resource that will be + * linked to the workspace. + */ + resourceId: string; +} + +/** + * @interface + * An interface representing DataSource. + * Datasources under OMS Workspace. + * + * @extends BaseResource + */ +export interface DataSource extends BaseResource { + /** + * @member {any} properties The data source properties in raw json format, + * each kind of data source have it's own schema. + */ + properties: any; + /** + * @member {string} [eTag] The ETag of the data source. + */ + eTag?: string; + /** + * @member {DataSourceKind} kind Possible values include: 'AzureActivityLog', + * 'ChangeTrackingPath', 'ChangeTrackingDefaultPath', + * 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', + * 'CustomLog', 'CustomLogCollection', 'GenericDataSource', 'IISLogs', + * 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'LinuxSyslog', + * 'LinuxSyslogCollection', 'WindowsEvent', 'WindowsPerformanceCounter' + */ + kind: DataSourceKind; +} + +/** + * @interface + * An interface representing DataSourceFilter. + * DataSource filter. Right now, only filter by kind is supported. + * + */ +export interface DataSourceFilter { + /** + * @member {DataSourceKind} [kind] Possible values include: + * 'AzureActivityLog', 'ChangeTrackingPath', 'ChangeTrackingDefaultPath', + * 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', + * 'CustomLog', 'CustomLogCollection', 'GenericDataSource', 'IISLogs', + * 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'LinuxSyslog', + * 'LinuxSyslogCollection', 'WindowsEvent', 'WindowsPerformanceCounter' + */ + kind?: DataSourceKind; +} + +/** + * @interface + * An interface representing IntelligencePack. + * Intelligence Pack containing a string name and boolean indicating if it's + * enabled. + * + */ +export interface IntelligencePack { + /** + * @member {string} [name] The name of the intelligence pack. + */ + name?: string; + /** + * @member {boolean} [enabled] The enabled boolean for the intelligence pack. + */ + enabled?: boolean; + /** + * @member {string} [displayName] The display name of the intelligence pack. + */ + displayName?: string; +} + +/** + * @interface + * An interface representing SharedKeys. + * The shared keys for a workspace. + * + */ +export interface SharedKeys { + /** + * @member {string} [primarySharedKey] The primary shared key of a workspace. + */ + primarySharedKey?: string; + /** + * @member {string} [secondarySharedKey] The secondary shared key of a + * workspace. + */ + secondarySharedKey?: string; +} + +/** + * @interface + * An interface representing MetricName. + * The name of a metric. + * + */ +export interface MetricName { + /** + * @member {string} [value] The system name of the metric. + */ + value?: string; + /** + * @member {string} [localizedValue] The localized name of the metric. + */ + localizedValue?: string; +} + +/** + * @interface + * An interface representing UsageMetric. + * A metric describing the usage of a resource. + * + */ +export interface UsageMetric { + /** + * @member {MetricName} [name] The name of the metric. + */ + name?: MetricName; + /** + * @member {string} [unit] The units used for the metric. + */ + unit?: string; + /** + * @member {number} [currentValue] The current value of the metric. + */ + currentValue?: number; + /** + * @member {number} [limit] The quota limit for the metric. + */ + limit?: number; + /** + * @member {Date} [nextResetTime] The time that the metric's value will + * reset. + */ + nextResetTime?: Date; + /** + * @member {string} [quotaPeriod] The quota period that determines the length + * of time between value resets. + */ + quotaPeriod?: string; +} + +/** + * @interface + * An interface representing ManagementGroup. + * A management group that is connected to a workspace + * + */ +export interface ManagementGroup { + /** + * @member {number} [serverCount] The number of servers connected to the + * management group. + */ + serverCount?: number; + /** + * @member {boolean} [isGateway] Gets or sets a value indicating whether the + * management group is a gateway. + */ + isGateway?: boolean; + /** + * @member {string} [name] The name of the management group. + */ + name?: string; + /** + * @member {string} [id] The unique ID of the management group. + */ + id?: string; + /** + * @member {Date} [created] The datetime that the management group was + * created. + */ + created?: Date; + /** + * @member {Date} [dataReceived] The last datetime that the management group + * received data. + */ + dataReceived?: Date; + /** + * @member {string} [version] The version of System Center that is managing + * the management group. + */ + version?: string; + /** + * @member {string} [sku] The SKU of System Center that is managing the + * management group. + */ + sku?: string; +} + +/** + * @interface + * An interface representing Sku. + * The SKU (tier) of a workspace. + * + */ +export interface Sku { + /** + * @member {SkuNameEnum} name The name of the SKU. Possible values include: + * 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone' + */ + name: SkuNameEnum; +} + +/** + * @interface + * An interface representing Workspace. + * The top level Workspace resource container. + * + * @extends BaseResource + */ +export interface Workspace extends BaseResource { + /** + * @member {EntityStatus} [provisioningState] The provisioning state of the + * workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', + * 'Canceled', 'Deleting', 'ProvisioningAccount' + */ + provisioningState?: EntityStatus; + /** + * @member {string} [source] The source of the workspace. Source defines + * where the workspace was created. 'Azure' implies it was created in Azure. + * 'External' implies it was created via the Operational Insights Portal. + * This value is set on the service side and read-only on the client side. + */ + source?: string; + /** + * @member {string} [customerId] The ID associated with the workspace. + * Setting this value at creation time allows the workspace being created to + * be linked to an existing workspace. + */ + customerId?: string; + /** + * @member {string} [portalUrl] The URL of the Operational Insights portal + * for this workspace. This value is set on the service side and read-only + * on the client side. + */ + portalUrl?: string; + /** + * @member {Sku} [sku] The SKU of the workspace. + */ + sku?: Sku; + /** + * @member {number} [retentionInDays] The workspace data retention in days. + * -1 means Unlimited retention for the Unlimited Sku. 730 days is the + * maximum allowed for all other Skus. + */ + retentionInDays?: number; + /** + * @member {string} [eTag] The ETag of the workspace. + */ + eTag?: string; +} + +/** + * @interface + * An interface representing Resource. + * The resource definition. + * + * @extends BaseResource + */ +export interface Resource extends BaseResource { + /** + * @member {string} [id] Resource Id + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {string} [location] Resource location + */ + location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing ProxyResource. + * Common properties of proxy resource. + * + */ +export interface ProxyResource { + /** + * @member {string} [id] Resource ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] Resource name. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing DataSourcesListByWorkspaceOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface DataSourcesListByWorkspaceOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {string} [skiptoken] Starting point of the collection of data + * source instances. + */ + skiptoken?: string; +} + +/** + * @interface + * An interface representing OperationalInsightsManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface OperationalInsightsManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the LinkedServiceListResult. + * The list linked service operation response. + * + * @extends Array + */ +export interface LinkedServiceListResult extends Array { +} + +/** + * @interface + * An interface representing the DataSourceListResult. + * The list data source by workspace operation response. + * + * @extends Array + */ +export interface DataSourceListResult extends Array { + /** + * @member {string} [nextLink] The link (url) to the next page of + * datasources. + */ + nextLink?: string; +} + +/** + * @interface + * An interface representing the WorkspaceListUsagesResult. + * The list workspace usages operation response. + * + * @extends Array + */ +export interface WorkspaceListUsagesResult extends Array { +} + +/** + * @interface + * An interface representing the WorkspaceListManagementGroupsResult. + * The list workspace management groups operation response. + * + * @extends Array + */ +export interface WorkspaceListManagementGroupsResult extends Array { +} + +/** + * @interface + * An interface representing the WorkspaceListResult. + * The list workspaces operation response. + * + * @extends Array + */ +export interface WorkspaceListResult extends Array { +} + +/** + * @interface + * An interface representing the OperationListResult. + * Result of the request to list solution operations. + * + * @extends Array + */ +export interface OperationListResult extends Array { + /** + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + +/** + * Defines values for DataSourceKind. + * Possible values include: 'AzureActivityLog', 'ChangeTrackingPath', 'ChangeTrackingDefaultPath', + * 'ChangeTrackingDefaultRegistry', 'ChangeTrackingCustomRegistry', 'CustomLog', + * 'CustomLogCollection', 'GenericDataSource', 'IISLogs', 'LinuxPerformanceObject', + * 'LinuxPerformanceCollection', 'LinuxSyslog', 'LinuxSyslogCollection', 'WindowsEvent', + * 'WindowsPerformanceCounter' + * @readonly + * @enum {string} + */ +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', 'PerNode', 'PerGB2018', 'Standalone' + * @readonly + * @enum {string} + */ +export type SkuNameEnum = 'Free' | 'Standard' | 'Premium' | 'PerNode' | 'PerGB2018' | 'Standalone'; + +/** + * Defines values for EntityStatus. + * Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + * 'ProvisioningAccount' + * @readonly + * @enum {string} + */ +export type EntityStatus = 'Creating' | 'Succeeded' | 'Failed' | 'Canceled' | 'Deleting' | 'ProvisioningAccount'; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type LinkedServicesCreateOrUpdateResponse = LinkedService & { + /** + * 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: LinkedService; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type LinkedServicesGetResponse = LinkedService & { + /** + * 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: LinkedService; + }; +}; + +/** + * Contains response data for the listByWorkspace operation. + */ +export type LinkedServicesListByWorkspaceResponse = LinkedServiceListResult & { + /** + * 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: LinkedServiceListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type DataSourcesCreateOrUpdateResponse = DataSource & { + /** + * 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: DataSource; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type DataSourcesGetResponse = DataSource & { + /** + * 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: DataSource; + }; +}; + +/** + * Contains response data for the listByWorkspace operation. + */ +export type DataSourcesListByWorkspaceResponse = DataSourceListResult & { + /** + * 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: DataSourceListResult; + }; +}; + +/** + * Contains response data for the listByWorkspaceNext operation. + */ +export type DataSourcesListByWorkspaceNextResponse = DataSourceListResult & { + /** + * 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: DataSourceListResult; + }; +}; + +/** + * Contains response data for the listIntelligencePacks operation. + */ +export type WorkspacesListIntelligencePacksResponse = Array & { + /** + * 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: IntelligencePack[]; + }; +}; + +/** + * Contains response data for the getSharedKeys operation. + */ +export type WorkspacesGetSharedKeysResponse = SharedKeys & { + /** + * 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: SharedKeys; + }; +}; + +/** + * Contains response data for the listUsages operation. + */ +export type WorkspacesListUsagesResponse = WorkspaceListUsagesResult & { + /** + * 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: WorkspaceListUsagesResult; + }; +}; + +/** + * Contains response data for the listManagementGroups operation. + */ +export type WorkspacesListManagementGroupsResponse = WorkspaceListManagementGroupsResult & { + /** + * 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: WorkspaceListManagementGroupsResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type WorkspacesListByResourceGroupResponse = WorkspaceListResult & { + /** + * 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: WorkspaceListResult; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type WorkspacesListResponse = WorkspaceListResult & { + /** + * 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: WorkspaceListResult; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type WorkspacesCreateOrUpdateResponse = Workspace & { + /** + * 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: Workspace; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type WorkspacesGetResponse = Workspace & { + /** + * 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: Workspace; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type WorkspacesUpdateResponse = Workspace & { + /** + * 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: Workspace; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type WorkspacesBeginCreateOrUpdateResponse = Workspace & { + /** + * 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: Workspace; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type OperationsListNextResponse = OperationListResult & { + /** + * 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: OperationListResult; + }; +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/linkedServicesMappers.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/linkedServicesMappers.ts new file mode 100644 index 000000000000..3dc8e75684e0 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/linkedServicesMappers.ts @@ -0,0 +1,21 @@ +/* + * 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. + */ + +export { + LinkedService, + BaseResource, + CloudError, + LinkedServiceListResult, + DataSource, + Workspace, + Sku, + Resource +} from "../models/mappers"; + diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/mappers.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/mappers.ts new file mode 100644 index 000000000000..8ecc014974bd --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/mappers.ts @@ -0,0 +1,615 @@ +/* + * 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 { CloudErrorMapper, BaseResourceMapper } from "@azure/ms-rest-azure-js"; +import * as msRest from "@azure/ms-rest-js"; + +export const CloudError = CloudErrorMapper; +export const BaseResource = BaseResourceMapper; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + serializedName: "operation", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const LinkedService: msRest.CompositeMapper = { + serializedName: "LinkedService", + type: { + name: "Composite", + className: "LinkedService", + modelProperties: { + resourceId: { + required: true, + serializedName: "properties.resourceId", + type: { + name: "String" + } + } + } + } +}; + +export const DataSource: msRest.CompositeMapper = { + serializedName: "DataSource", + type: { + name: "Composite", + className: "DataSource", + modelProperties: { + properties: { + required: true, + serializedName: "properties", + type: { + name: "Object" + } + }, + eTag: { + serializedName: "eTag", + type: { + name: "String" + } + }, + kind: { + required: true, + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const DataSourceFilter: msRest.CompositeMapper = { + serializedName: "DataSourceFilter", + type: { + name: "Composite", + className: "DataSourceFilter", + modelProperties: { + kind: { + serializedName: "kind", + type: { + name: "String" + } + } + } + } +}; + +export const IntelligencePack: msRest.CompositeMapper = { + serializedName: "IntelligencePack", + type: { + name: "Composite", + className: "IntelligencePack", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + displayName: { + serializedName: "displayName", + type: { + name: "String" + } + } + } + } +}; + +export const SharedKeys: msRest.CompositeMapper = { + serializedName: "SharedKeys", + type: { + name: "Composite", + className: "SharedKeys", + modelProperties: { + primarySharedKey: { + serializedName: "primarySharedKey", + type: { + name: "String" + } + }, + secondarySharedKey: { + serializedName: "secondarySharedKey", + type: { + name: "String" + } + } + } + } +}; + +export const MetricName: msRest.CompositeMapper = { + serializedName: "MetricName", + type: { + name: "Composite", + className: "MetricName", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + localizedValue: { + serializedName: "localizedValue", + type: { + name: "String" + } + } + } + } +}; + +export const UsageMetric: msRest.CompositeMapper = { + serializedName: "UsageMetric", + type: { + name: "Composite", + className: "UsageMetric", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "Composite", + className: "MetricName" + } + }, + unit: { + serializedName: "unit", + type: { + name: "String" + } + }, + currentValue: { + serializedName: "currentValue", + type: { + name: "Number" + } + }, + limit: { + serializedName: "limit", + type: { + name: "Number" + } + }, + nextResetTime: { + serializedName: "nextResetTime", + type: { + name: "DateTime" + } + }, + quotaPeriod: { + serializedName: "quotaPeriod", + type: { + name: "String" + } + } + } + } +}; + +export const ManagementGroup: msRest.CompositeMapper = { + serializedName: "ManagementGroup", + type: { + name: "Composite", + className: "ManagementGroup", + modelProperties: { + serverCount: { + serializedName: "properties.serverCount", + type: { + name: "Number" + } + }, + isGateway: { + serializedName: "properties.isGateway", + type: { + name: "Boolean" + } + }, + name: { + serializedName: "properties.name", + type: { + name: "String" + } + }, + id: { + serializedName: "properties.id", + type: { + name: "String" + } + }, + created: { + serializedName: "properties.created", + type: { + name: "DateTime" + } + }, + dataReceived: { + serializedName: "properties.dataReceived", + type: { + name: "DateTime" + } + }, + version: { + serializedName: "properties.version", + type: { + name: "String" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "String" + } + } + } + } +}; + +export const Sku: msRest.CompositeMapper = { + serializedName: "Sku", + type: { + name: "Composite", + className: "Sku", + modelProperties: { + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const Workspace: msRest.CompositeMapper = { + serializedName: "Workspace", + type: { + name: "Composite", + className: "Workspace", + modelProperties: { + provisioningState: { + serializedName: "properties.provisioningState", + type: { + name: "String" + } + }, + source: { + serializedName: "properties.source", + type: { + name: "String" + } + }, + customerId: { + serializedName: "properties.customerId", + type: { + name: "String" + } + }, + portalUrl: { + serializedName: "properties.portalUrl", + type: { + name: "String" + } + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "Sku" + } + }, + retentionInDays: { + serializedName: "properties.retentionInDays", + constraints: { + InclusiveMaximum: 730, + InclusiveMinimum: -1 + }, + type: { + name: "Number" + } + }, + eTag: { + serializedName: "eTag", + type: { + name: "String" + } + } + } + } +}; + +export const Resource: msRest.CompositeMapper = { + serializedName: "Resource", + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const ProxyResource: msRest.CompositeMapper = { + serializedName: "ProxyResource", + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const LinkedServiceListResult: msRest.CompositeMapper = { + serializedName: "LinkedServiceListResult", + type: { + name: "Composite", + className: "LinkedServiceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "LinkedService" + } + } + } + } + } + } +}; + +export const DataSourceListResult: msRest.CompositeMapper = { + serializedName: "DataSourceListResult", + type: { + name: "Composite", + className: "DataSourceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "DataSource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + +export const WorkspaceListUsagesResult: msRest.CompositeMapper = { + serializedName: "WorkspaceListUsagesResult", + type: { + name: "Composite", + className: "WorkspaceListUsagesResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "UsageMetric" + } + } + } + } + } + } +}; + +export const WorkspaceListManagementGroupsResult: msRest.CompositeMapper = { + serializedName: "WorkspaceListManagementGroupsResult", + type: { + name: "Composite", + className: "WorkspaceListManagementGroupsResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagementGroup" + } + } + } + } + } + } +}; + +export const WorkspaceListResult: msRest.CompositeMapper = { + serializedName: "WorkspaceListResult", + type: { + name: "Composite", + className: "WorkspaceListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workspace" + } + } + } + } + } + } +}; + +export const OperationListResult: msRest.CompositeMapper = { + serializedName: "OperationListResult", + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/operationsMappers.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..2edcc577920e --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/operationsMappers.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export { + OperationListResult, + Operation, + OperationDisplay, + CloudError +} from "../models/mappers"; + diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/parameters.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/parameters.ts new file mode 100644 index 000000000000..b0f08de703a7 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/parameters.ts @@ -0,0 +1,155 @@ +/* + * 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"; + +export const acceptLanguage: msRest.OperationParameter = { + parameterPath: "acceptLanguage", + mapper: { + serializedName: "accept-language", + defaultValue: 'en-US', + type: { + name: "String" + } + } +}; +export const apiVersion: msRest.OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + required: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; +export const dataSourceName: msRest.OperationURLParameter = { + parameterPath: "dataSourceName", + mapper: { + required: true, + serializedName: "dataSourceName", + type: { + name: "String" + } + } +}; +export const filter: msRest.OperationQueryParameter = { + parameterPath: "filter", + mapper: { + required: true, + serializedName: "$filter", + type: { + name: "String" + } + } +}; +export const intelligencePackName: msRest.OperationURLParameter = { + parameterPath: "intelligencePackName", + mapper: { + required: true, + serializedName: "intelligencePackName", + type: { + name: "String" + } + } +}; +export const linkedServiceName: msRest.OperationURLParameter = { + parameterPath: "linkedServiceName", + mapper: { + required: true, + serializedName: "linkedServiceName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName0: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + constraints: { + MaxLength: 90, + MinLength: 1, + Pattern: /^[-\w\._\(\)]+$/ + }, + type: { + name: "String" + } + } +}; +export const resourceGroupName1: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const skiptoken: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "skiptoken" + ], + mapper: { + serializedName: "$skiptoken", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; +export const workspaceName0: msRest.OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + required: true, + serializedName: "workspaceName", + type: { + name: "String" + } + } +}; +export const workspaceName1: msRest.OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + required: true, + serializedName: "workspaceName", + constraints: { + MaxLength: 63, + MinLength: 4, + Pattern: /^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$/ + }, + type: { + name: "String" + } + } +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/models/workspacesMappers.ts b/sdk/operationalinsights/arm-operationalinsights/lib/models/workspacesMappers.ts new file mode 100644 index 000000000000..1d18205a1490 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/models/workspacesMappers.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +export { + CloudError, + IntelligencePack, + SharedKeys, + WorkspaceListUsagesResult, + UsageMetric, + MetricName, + WorkspaceListManagementGroupsResult, + ManagementGroup, + WorkspaceListResult, + Workspace, + BaseResource, + Sku, + LinkedService, + DataSource, + Resource +} from "../models/mappers"; + diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClient.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClient.ts new file mode 100644 index 000000000000..b06840df7055 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClient.ts @@ -0,0 +1,49 @@ +/* + * 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/mappers"; +import * as operations from "./operations"; +import { OperationalInsightsManagementClientContext } from "./operationalInsightsManagementClientContext"; + + +class OperationalInsightsManagementClient extends OperationalInsightsManagementClientContext { + // Operation groups + linkedServices: operations.LinkedServices; + dataSources: operations.DataSources; + workspaces: operations.Workspaces; + operations: operations.Operations; + + /** + * Initializes a new instance of the OperationalInsightsManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.OperationalInsightsManagementClientOptions) { + super(credentials, subscriptionId, options); + this.linkedServices = new operations.LinkedServices(this); + this.dataSources = new operations.DataSources(this); + this.workspaces = new operations.Workspaces(this); + this.operations = new operations.Operations(this); + } +} + +// Operation Specifications + +export { + OperationalInsightsManagementClient, + OperationalInsightsManagementClientContext, + Models as OperationalInsightsManagementModels, + Mappers as OperationalInsightsManagementMappers +}; +export * from "./operations"; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClientContext.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClientContext.ts new file mode 100644 index 000000000000..600ca4f4919b --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operationalInsightsManagementClientContext.ts @@ -0,0 +1,63 @@ +/* + * 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 Models from "./models"; +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; + +const packageName = "@azure/arm-operationalinsights"; +const packageVersion = "1.2.0"; + +export class OperationalInsightsManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the OperationalInsightsManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Gets subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param [options] The parameter options + */ + constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.OperationalInsightsManagementClientOptions) { + if (credentials == undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId == undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.apiVersion = '2015-11-01-preview'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; + this.requestContentType = "application/json; charset=utf-8"; + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + } +} diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operations/dataSources.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operations/dataSources.ts new file mode 100644 index 000000000000..2ec14ba4b4c3 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operations/dataSources.ts @@ -0,0 +1,341 @@ +/* + * 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/dataSourcesMappers"; +import * as Parameters from "../models/parameters"; +import { OperationalInsightsManagementClientContext } from "../operationalInsightsManagementClientContext"; + +/** Class representing a DataSources. */ +export class DataSources { + private readonly client: OperationalInsightsManagementClientContext; + + /** + * Create a DataSources. + * @param {OperationalInsightsManagementClientContext} client Reference to the service client. + */ + constructor(client: OperationalInsightsManagementClientContext) { + this.client = client; + } + + /** + * Create or update a data source. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the datasource + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the datasource + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the datasource + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, workspaceName: string, dataSourceName: string, parameters: Models.DataSource, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + dataSourceName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes a data source instance. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + dataSourceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets a datasource instance. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, dataSourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the datasource. + * @param dataSourceName Name of the datasource + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, workspaceName: string, dataSourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + dataSourceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The workspace that contains the data sources. + * @param filter The filter to apply on the operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options?: Models.DataSourcesListByWorkspaceOptionalParams): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The workspace that contains the data sources. + * @param filter The filter to apply on the operation. + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The workspace that contains the data sources. + * @param filter The filter to apply on the operation. + * @param options The optional parameters + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options: Models.DataSourcesListByWorkspaceOptionalParams, callback: msRest.ServiceCallback): void; + listByWorkspace(resourceGroupName: string, workspaceName: string, filter: string, options?: Models.DataSourcesListByWorkspaceOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + filter, + options + }, + listByWorkspaceOperationSpec, + callback) as Promise; + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByWorkspaceNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listByWorkspaceNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByWorkspaceNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByWorkspaceNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.dataSourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.DataSource, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.DataSource + }, + 201: { + bodyMapper: Mappers.DataSource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.dataSourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.dataSourceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataSource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByWorkspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.filter, + Parameters.skiptoken, + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataSourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByWorkspaceNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.DataSourceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operations/index.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operations/index.ts new file mode 100644 index 000000000000..bcfdc7b26a31 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operations/index.ts @@ -0,0 +1,14 @@ +/* + * 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. + */ + +export * from "./linkedServices"; +export * from "./dataSources"; +export * from "./workspaces"; +export * from "./operations"; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operations/linkedServices.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operations/linkedServices.ts new file mode 100644 index 000000000000..4aba88b32c2d --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operations/linkedServices.ts @@ -0,0 +1,295 @@ +/* + * 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/linkedServicesMappers"; +import * as Parameters from "../models/parameters"; +import { OperationalInsightsManagementClientContext } from "../operationalInsightsManagementClientContext"; + +/** Class representing a LinkedServices. */ +export class LinkedServices { + private readonly client: OperationalInsightsManagementClientContext; + + /** + * Create a LinkedServices. + * @param {OperationalInsightsManagementClientContext} client Reference to the service client. + */ + constructor(client: OperationalInsightsManagementClientContext) { + this.client = client; + } + + /** + * Create or update a linked service. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the linkedServices + * resource + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: Models.LinkedService, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the linkedServices + * resource + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: Models.LinkedService, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that will contain the linkedServices + * resource + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @param options The optional parameters + * @param callback The callback + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: Models.LinkedService, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createOrUpdate(resourceGroupName: string, workspaceName: string, linkedServiceName: string, parameters: Models.LinkedService, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + linkedServiceName, + parameters, + options + }, + createOrUpdateOperationSpec, + callback) as Promise; + } + + /** + * Deletes a linked service instance. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, linkedServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + linkedServiceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets a linked service instance. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, linkedServiceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linkedServices + * resource + * @param linkedServiceName Name of the linked service. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, workspaceName: string, linkedServiceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + linkedServiceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Gets the linked services instances in a workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linked services. + * @param [options] The optional parameters + * @returns Promise + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linked services. + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace that contains the linked services. + * @param options The optional parameters + * @param callback The callback + */ + listByWorkspace(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByWorkspace(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + listByWorkspaceOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const createOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.linkedServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.LinkedService, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.LinkedService + }, + 201: { + bodyMapper: Mappers.LinkedService + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.linkedServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.linkedServiceName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedService + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByWorkspaceOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.LinkedServiceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operations/operations.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operations/operations.ts new file mode 100644 index 000000000000..9bc82e4038c0 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operations/operations.ts @@ -0,0 +1,123 @@ +/* + * 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/operationsMappers"; +import * as Parameters from "../models/parameters"; +import { OperationalInsightsManagementClientContext } from "../operationalInsightsManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: OperationalInsightsManagementClientContext; + + /** + * Create a Operations. + * @param {OperationalInsightsManagementClientContext} client Reference to the service client. + */ + constructor(client: OperationalInsightsManagementClientContext) { + this.client = client; + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.OperationalInsights/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/lib/operations/workspaces.ts b/sdk/operationalinsights/arm-operationalinsights/lib/operations/workspaces.ts new file mode 100644 index 000000000000..e06fc4746ca9 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/lib/operations/workspaces.ts @@ -0,0 +1,739 @@ +/* + * 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 msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/workspacesMappers"; +import * as Parameters from "../models/parameters"; +import { OperationalInsightsManagementClientContext } from "../operationalInsightsManagementClientContext"; + +/** Class representing a Workspaces. */ +export class Workspaces { + private readonly client: OperationalInsightsManagementClientContext; + + /** + * Create a Workspaces. + * @param {OperationalInsightsManagementClientContext} client Reference to the service client. + */ + constructor(client: OperationalInsightsManagementClientContext) { + this.client = client; + } + + /** + * Disables an intelligence pack for a given workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @param [options] The optional parameters + * @returns Promise + */ + disableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @param callback The callback + */ + disableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @param options The optional parameters + * @param callback The callback + */ + disableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + disableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + intelligencePackName, + options + }, + disableIntelligencePackOperationSpec, + callback); + } + + /** + * Enables an intelligence pack for a given workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @param [options] The optional parameters + * @returns Promise + */ + enableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @param callback The callback + */ + enableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @param options The optional parameters + * @param callback The callback + */ + enableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + enableIntelligencePack(resourceGroupName: string, workspaceName: string, intelligencePackName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + intelligencePackName, + options + }, + enableIntelligencePackOperationSpec, + callback); + } + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given + * workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param [options] The optional parameters + * @returns Promise + */ + listIntelligencePacks(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param callback The callback + */ + listIntelligencePacks(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param options The optional parameters + * @param callback The callback + */ + listIntelligencePacks(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listIntelligencePacks(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + listIntelligencePacksOperationSpec, + callback) as Promise; + } + + /** + * Gets the shared keys for a workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param [options] The optional parameters + * @returns Promise + */ + getSharedKeys(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param callback The callback + */ + getSharedKeys(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName Name of the Log Analytics Workspace. + * @param options The optional parameters + * @param callback The callback + */ + getSharedKeys(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + getSharedKeys(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + getSharedKeysOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of usage metrics for a workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + listUsages(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + listUsages(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + listUsages(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listUsages(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + listUsagesOperationSpec, + callback) as Promise; + } + + /** + * Gets a list of management groups connected to a workspace. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param [options] The optional parameters + * @returns Promise + */ + listManagementGroups(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param callback The callback + */ + listManagementGroups(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param options The optional parameters + * @param callback The callback + */ + listManagementGroups(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listManagementGroups(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + listManagementGroupsOperationSpec, + callback) as Promise; + } + + /** + * Gets workspaces in a resource group. + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param options The optional parameters + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + options + }, + listByResourceGroupOperationSpec, + callback) as Promise; + } + + /** + * Gets the workspaces in a subscription. + * @param [options] The optional parameters + * @returns Promise + */ + list(options?: msRest.RequestOptionsBase): Promise; + /** + * @param callback The callback + */ + list(callback: msRest.ServiceCallback): void; + /** + * @param options The optional parameters + * @param callback The callback + */ + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Create or update a workspace. + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,workspaceName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes a workspace instance. + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param options The optional parameters + * @param callback The callback + */ + deleteMethod(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + deleteMethod(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + deleteMethodOperationSpec, + callback); + } + + /** + * Gets a workspace instance. + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName Name of the Log Analytics Workspace. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, workspaceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, workspaceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Updates a workspace. + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @param callback The callback + */ + update(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + workspaceName, + parameters, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * Create or update a workspace. + * @param resourceGroupName The resource group name of the workspace. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, workspaceName: string, parameters: Models.Workspace, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + workspaceName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const disableIntelligencePackOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.intelligencePackName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const enableIntelligencePackOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.intelligencePackName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listIntelligencePacksOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IntelligencePack" + } + } + } + } + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getSharedKeysOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.SharedKeys + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listUsagesOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WorkspaceListUsagesResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listManagementGroupsOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WorkspaceListManagementGroupsResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces", + urlParameters: [ + Parameters.resourceGroupName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WorkspaceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.WorkspaceListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const deleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", + urlParameters: [ + Parameters.resourceGroupName1, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", + urlParameters: [ + Parameters.resourceGroupName1, + Parameters.workspaceName0, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", + urlParameters: [ + Parameters.resourceGroupName1, + Parameters.workspaceName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Workspace, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", + urlParameters: [ + Parameters.resourceGroupName1, + Parameters.workspaceName1, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.Workspace, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.Workspace + }, + 201: { + bodyMapper: Mappers.Workspace + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/operationalinsights/arm-operationalinsights/package.json b/sdk/operationalinsights/arm-operationalinsights/package.json new file mode 100644 index 000000000000..600f1f4b83ae --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/package.json @@ -0,0 +1,56 @@ +{ + "name": "@azure/arm-operationalinsights", + "author": "Microsoft Corporation", + "description": "OperationalInsightsManagementClient Library with typescript type definitions for node.js and browser.", + "version": "1.2.0", + "dependencies": { + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", + "tslib": "^1.9.3" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/arm-operationalinsights.js", + "module": "./esm/operationalInsightsManagementClient.js", + "types": "./esm/operationalInsightsManagementClient.d.ts", + "devDependencies": { + "typescript": "^3.1.1", + "rollup": "^0.66.2", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", + "uglify-js": "^3.4.9" + }, + "homepage": "https://github.com/azure/azure-sdk-for-js", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "esm/**/*.js", + "esm/**/*.js.map", + "esm/**/*.d.ts", + "esm/**/*.d.ts.map", + "lib/**/*.ts", + "rollup.config.js", + "tsconfig.json" + ], + "scripts": { + "build": "tsc && rollup -c rollup.config.js && npm run minify", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-operationalinsights.js.map'\" -o ./dist/arm-operationalinsights.min.js ./dist/arm-operationalinsights.js", + "prepack": "npm install && npm run build" + }, + "sideEffects": false +} diff --git a/sdk/operationalinsights/arm-operationalinsights/rollup.config.js b/sdk/operationalinsights/arm-operationalinsights/rollup.config.js new file mode 100644 index 000000000000..2f15fafd3a48 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/rollup.config.js @@ -0,0 +1,37 @@ +import rollup from "rollup"; +import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + +/** + * @type {rollup.RollupFileOptions} + */ +const config = { + input: "./esm/operationalInsightsManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], + output: { + file: "./dist/arm-operationalinsights.js", + format: "umd", + name: "Azure.ArmOperationalinsights", + sourcemap: true, + globals: { + "@azure/ms-rest-js": "msRest", + "@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. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */` + }, + plugins: [ + nodeResolve({ module: true }), + sourcemaps() + ] +}; + +export default config; diff --git a/sdk/operationalinsights/arm-operationalinsights/tsconfig.json b/sdk/operationalinsights/arm-operationalinsights/tsconfig.json new file mode 100644 index 000000000000..51ea90961ce5 --- /dev/null +++ b/sdk/operationalinsights/arm-operationalinsights/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es5", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": ["es6"], + "declaration": true, + "outDir": "./esm", + "importHelpers": true + }, + "include": ["./lib/**/*.ts"], + "exclude": ["node_modules"] +}