diff --git a/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt b/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt index a70e8cf66038..b73b4a1293c3 100644 --- a/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt +++ b/sdk/hanaonazure/arm-hanaonazure/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +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 diff --git a/sdk/hanaonazure/arm-hanaonazure/README.md b/sdk/hanaonazure/arm-hanaonazure/README.md index ed1fce02cd72..8af1dbb19535 100644 --- a/sdk/hanaonazure/arm-hanaonazure/README.md +++ b/sdk/hanaonazure/arm-hanaonazure/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for HanaManagementClient. ### How to Install -``` +```bash npm install @azure/arm-hanaonazure ``` @@ -19,13 +19,13 @@ npm install @azure/arm-hanaonazure ##### Install @azure/ms-rest-nodeauth -``` +```bash npm install @azure/ms-rest-nodeauth ``` ##### Sample code -```ts +```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"; @@ -47,7 +47,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` @@ -94,6 +94,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/hanaonazure/arm-hanaonazure/README.png) diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClient.ts b/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClient.ts new file mode 100644 index 000000000000..28c3c6a8d833 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClient.ts @@ -0,0 +1,45 @@ +/* + * 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 { HanaManagementClientContext } from "./hanaManagementClientContext"; + + +class HanaManagementClient extends HanaManagementClientContext { + // Operation groups + operations: operations.Operations; + hanaInstances: operations.HanaInstances; + + /** + * Initializes a new instance of the HanaManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Subscription ID 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.HanaManagementClientOptions) { + super(credentials, subscriptionId, options); + this.operations = new operations.Operations(this); + this.hanaInstances = new operations.HanaInstances(this); + } +} + +// Operation Specifications + +export { + HanaManagementClient, + HanaManagementClientContext, + Models as HanaManagementModels, + Mappers as HanaManagementMappers +}; +export * from "./operations"; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClientContext.ts b/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClientContext.ts new file mode 100644 index 000000000000..4744af7462fc --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/hanaManagementClientContext.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-hanaonazure"; +const packageVersion = "1.1.0"; + +export class HanaManagementClientContext extends msRestAzure.AzureServiceClient { + credentials: msRest.ServiceClientCredentials; + subscriptionId: string; + apiVersion?: string; + + /** + * Initializes a new instance of the HanaManagementClient class. + * @param credentials Credentials needed for the client to connect to Azure. + * @param subscriptionId Subscription ID 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.HanaManagementClientOptions) { + 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 = '2017-11-03-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/hanaonazure/arm-hanaonazure/lib/models/hanaInstancesMappers.ts b/sdk/hanaonazure/arm-hanaonazure/lib/models/hanaInstancesMappers.ts new file mode 100644 index 000000000000..29e4ecbbf883 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/models/hanaInstancesMappers.ts @@ -0,0 +1,27 @@ +/* + * 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 { + HanaInstancesListResult, + HanaInstance, + Resource, + BaseResource, + HardwareProfile, + StorageProfile, + Disk, + OSProfile, + NetworkProfile, + IpAddress, + ErrorResponse, + Tags, + CloudError, + MonitoringDetails +} from "../models/mappers"; + diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/models/index.ts b/sdk/hanaonazure/arm-hanaonazure/lib/models/index.ts new file mode 100644 index 000000000000..acb6288c5f7f --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/models/index.ts @@ -0,0 +1,602 @@ +/* + * 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 Resource. + * The resource model 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 + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly location?: string; + /** + * @member {{ [propertyName: string]: string }} [tags] Resource tags + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing HardwareProfile. + * Specifies the hardware settings for the HANA instance. + * + */ +export interface HardwareProfile { + /** + * @member {HanaHardwareTypeNamesEnum} [hardwareType] Name of the hardware + * type (vendor and/or their product name). Possible values include: + * 'Cisco_UCS', 'HPE' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hardwareType?: HanaHardwareTypeNamesEnum; + /** + * @member {HanaInstanceSizeNamesEnum} [hanaInstanceSize] Specifies the HANA + * instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', + * 'S192', 'S192m', 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', + * 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hanaInstanceSize?: HanaInstanceSizeNamesEnum; +} + +/** + * @interface + * An interface representing Disk. + * Specifies the disk information fo the HANA instance + * + */ +export interface Disk { + /** + * @member {string} [name] The disk name. + */ + name?: string; + /** + * @member {number} [diskSizeGB] Specifies the size of an empty data disk in + * gigabytes. + */ + diskSizeGB?: number; + /** + * @member {number} [lun] Specifies the logical unit number of the data disk. + * This value is used to identify data disks within the VM and therefore must + * be unique for each data disk attached to a VM. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly lun?: number; +} + +/** + * @interface + * An interface representing StorageProfile. + * Specifies the storage settings for the HANA instance disks. + * + */ +export interface StorageProfile { + /** + * @member {string} [nfsIpAddress] IP Address to connect to storage. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nfsIpAddress?: string; + /** + * @member {Disk[]} [osDisks] Specifies information about the operating + * system disk used by the hana instance. + */ + osDisks?: Disk[]; +} + +/** + * @interface + * An interface representing OSProfile. + * Specifies the operating system settings for the HANA instance. + * + */ +export interface OSProfile { + /** + * @member {string} [computerName] Specifies the host OS name of the HANA + * instance. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly computerName?: string; + /** + * @member {string} [osType] This property allows you to specify the type of + * the OS. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly osType?: string; + /** + * @member {string} [version] Specifies version of operating system. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly version?: string; +} + +/** + * @interface + * An interface representing IpAddress. + * Specifies the IP address of the network interface. + * + */ +export interface IpAddress { + /** + * @member {string} [ipAddress] Specifies the IP address of the network + * interface. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly ipAddress?: string; +} + +/** + * @interface + * An interface representing NetworkProfile. + * Specifies the network settings for the HANA instance disks. + * + */ +export interface NetworkProfile { + /** + * @member {IpAddress[]} [networkInterfaces] Specifies the network interfaces + * for the HANA instance. + */ + networkInterfaces?: IpAddress[]; + /** + * @member {string} [circuitId] Specifies the circuit id for connecting to + * express route. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly circuitId?: string; +} + +/** + * @interface + * An interface representing HanaInstance. + * HANA instance info on Azure (ARM properties and HANA properties) + * + * @extends Resource + */ +export interface HanaInstance extends Resource { + /** + * @member {HardwareProfile} [hardwareProfile] Specifies the hardware + * settings for the HANA instance. + */ + hardwareProfile?: HardwareProfile; + /** + * @member {StorageProfile} [storageProfile] Specifies the storage settings + * for the HANA instance disks. + */ + storageProfile?: StorageProfile; + /** + * @member {OSProfile} [osProfile] Specifies the operating system settings + * for the HANA instance. + */ + osProfile?: OSProfile; + /** + * @member {NetworkProfile} [networkProfile] Specifies the network settings + * for the HANA instance. + */ + networkProfile?: NetworkProfile; + /** + * @member {string} [hanaInstanceId] Specifies the HANA instance unique ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hanaInstanceId?: string; + /** + * @member {HanaInstancePowerStateEnum} [powerState] Resource power state. + * Possible values include: 'starting', 'started', 'stopping', 'stopped', + * 'restarting', 'unknown' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly powerState?: HanaInstancePowerStateEnum; + /** + * @member {string} [proximityPlacementGroup] Resource proximity placement + * group + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly proximityPlacementGroup?: string; + /** + * @member {string} [hwRevision] Hardware revision of a HANA instance + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly hwRevision?: string; +} + +/** + * @interface + * An interface representing Display. + * Detailed HANA operation information + * + */ +export interface Display { + /** + * @member {string} [provider] The localized friendly form of the resource + * provider name. This form is also expected to include the publisher/company + * responsible. Use Title Casing. Begin with "Microsoft" for 1st party + * services. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provider?: string; + /** + * @member {string} [resource] The localized friendly form of the resource + * type related to this action/operation. This form should match the public + * documentation for the resource provider. Use Title Casing. For examples, + * refer to the “name” section. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly resource?: string; + /** + * @member {string} [operation] The localized friendly name for the operation + * as shown to the user. This name should be concise (to fit in drop downs), + * but clear (self-documenting). Use Title Casing and include the + * entity/resource to which it applies. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly operation?: string; + /** + * @member {string} [description] The localized friendly description for the + * operation as shown to the user. This description should be thorough, yet + * concise. It will be used in tool-tips and detailed views. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly description?: string; + /** + * @member {string} [origin] The intended executor of the operation; governs + * the display of the operation in the RBAC UX and the audit logs UX. Default + * value is 'user,system' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly origin?: string; +} + +/** + * @interface + * An interface representing Operation. + * HANA operation information + * + */ +export interface Operation { + /** + * @member {string} [name] The name of the operation being performed on this + * particular object. This name should match the action name that appears in + * RBAC / the event service. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {Display} [display] Displayed HANA operation information + */ + display?: Display; +} + +/** + * @interface + * An interface representing ErrorResponse. + * Describes the format of Error response. + * + */ +export interface ErrorResponse { + /** + * @member {string} [code] Error code + */ + code?: string; + /** + * @member {string} [message] Error message indicating why the operation + * failed. + */ + message?: string; +} + +/** + * @interface + * An interface representing Tags. + * Tags field of the HANA instance. + * + */ +export interface Tags { + /** + * @member {{ [propertyName: string]: string }} [tags] Tags field of the HANA + * instance. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * @interface + * An interface representing MonitoringDetails. + * Details needed to monitor a Hana Instance + * + */ +export interface MonitoringDetails { + /** + * @member {string} [hanaVnet] ARM ID of an Azure Vnet with access to the + * HANA instance. + */ + hanaVnet?: string; + /** + * @member {string} [hanaHostname] Hostname of the HANA Instance blade. + */ + hanaHostname?: string; + /** + * @member {string} [hanaInstanceNum] A number between 00 and 99, stored as a + * string to maintain leading zero. + */ + hanaInstanceNum?: string; + /** + * @member {HanaDatabaseContainersEnum} [dbContainer] Either single or + * multiple depending on the use of MDC(Multiple Database Containers). + * Possible values include: 'single', 'multiple'. Default value: 'single' . + */ + dbContainer?: HanaDatabaseContainersEnum; + /** + * @member {string} [hanaDatabase] Name of the database itself. It only + * needs to be specified if using MDC + */ + hanaDatabase?: string; + /** + * @member {string} [hanaDbUsername] Username for the HANA database to login + * to for monitoring + */ + hanaDbUsername?: string; + /** + * @member {string} [hanaDbPassword] Password for the HANA database to login + * for monitoring + */ + hanaDbPassword?: string; +} + +/** + * @interface + * An interface representing HanaManagementClientOptions. + * @extends AzureServiceClientOptions + */ +export interface HanaManagementClientOptions extends AzureServiceClientOptions { + /** + * @member {string} [baseUri] + */ + baseUri?: string; +} + + +/** + * @interface + * An interface representing the OperationList. + * List of HANA operations + * + * @extends Array + */ +export interface OperationList extends Array { +} + +/** + * @interface + * An interface representing the HanaInstancesListResult. + * The response from the List HANA Instances operation. + * + * @extends Array + */ +export interface HanaInstancesListResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of HANA instances. + */ + nextLink?: string; +} + +/** + * Defines values for HanaHardwareTypeNamesEnum. + * Possible values include: 'Cisco_UCS', 'HPE' + * @readonly + * @enum {string} + */ +export type HanaHardwareTypeNamesEnum = 'Cisco_UCS' | 'HPE'; + +/** + * Defines values for HanaInstanceSizeNamesEnum. + * Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S192xm', 'S96', + * 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' + * @readonly + * @enum {string} + */ +export type HanaInstanceSizeNamesEnum = 'S72m' | 'S144m' | 'S72' | 'S144' | 'S192' | 'S192m' | 'S192xm' | 'S96' | 'S384' | 'S384m' | 'S384xm' | 'S384xxm' | 'S576m' | 'S576xm' | 'S768' | 'S768m' | 'S768xm' | 'S960m'; + +/** + * Defines values for HanaInstancePowerStateEnum. + * Possible values include: 'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown' + * @readonly + * @enum {string} + */ +export type HanaInstancePowerStateEnum = 'starting' | 'started' | 'stopping' | 'stopped' | 'restarting' | 'unknown'; + +/** + * Defines values for HanaDatabaseContainersEnum. + * Possible values include: 'single', 'multiple' + * @readonly + * @enum {string} + */ +export type HanaDatabaseContainersEnum = 'single' | 'multiple'; + +/** + * Contains response data for the list operation. + */ +export type OperationsListResponse = OperationList & { + /** + * 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: OperationList; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type HanaInstancesListResponse = HanaInstancesListResult & { + /** + * 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: HanaInstancesListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroup operation. + */ +export type HanaInstancesListByResourceGroupResponse = HanaInstancesListResult & { + /** + * 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: HanaInstancesListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type HanaInstancesGetResponse = HanaInstance & { + /** + * 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: HanaInstance; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type HanaInstancesUpdateResponse = HanaInstance & { + /** + * 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: HanaInstance; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type HanaInstancesListNextResponse = HanaInstancesListResult & { + /** + * 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: HanaInstancesListResult; + }; +}; + +/** + * Contains response data for the listByResourceGroupNext operation. + */ +export type HanaInstancesListByResourceGroupNextResponse = HanaInstancesListResult & { + /** + * 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: HanaInstancesListResult; + }; +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/models/mappers.ts b/sdk/hanaonazure/arm-hanaonazure/lib/models/mappers.ts new file mode 100644 index 000000000000..33e12d84d589 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/models/mappers.ts @@ -0,0 +1,506 @@ +/* + * 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 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: { + readOnly: true, + serializedName: "location", + type: { + name: "String" + } + }, + tags: { + readOnly: true, + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const HardwareProfile: msRest.CompositeMapper = { + serializedName: "HardwareProfile", + type: { + name: "Composite", + className: "HardwareProfile", + modelProperties: { + hardwareType: { + readOnly: true, + serializedName: "hardwareType", + type: { + name: "String" + } + }, + hanaInstanceSize: { + readOnly: true, + serializedName: "hanaInstanceSize", + type: { + name: "String" + } + } + } + } +}; + +export const Disk: msRest.CompositeMapper = { + serializedName: "Disk", + type: { + name: "Composite", + className: "Disk", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + diskSizeGB: { + serializedName: "diskSizeGB", + type: { + name: "Number" + } + }, + lun: { + readOnly: true, + serializedName: "lun", + type: { + name: "Number" + } + } + } + } +}; + +export const StorageProfile: msRest.CompositeMapper = { + serializedName: "StorageProfile", + type: { + name: "Composite", + className: "StorageProfile", + modelProperties: { + nfsIpAddress: { + readOnly: true, + serializedName: "nfsIpAddress", + type: { + name: "String" + } + }, + osDisks: { + serializedName: "osDisks", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Disk" + } + } + } + } + } + } +}; + +export const OSProfile: msRest.CompositeMapper = { + serializedName: "OSProfile", + type: { + name: "Composite", + className: "OSProfile", + modelProperties: { + computerName: { + readOnly: true, + serializedName: "computerName", + type: { + name: "String" + } + }, + osType: { + readOnly: true, + serializedName: "osType", + type: { + name: "String" + } + }, + version: { + readOnly: true, + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const IpAddress: msRest.CompositeMapper = { + serializedName: "IpAddress", + type: { + name: "Composite", + className: "IpAddress", + modelProperties: { + ipAddress: { + readOnly: true, + serializedName: "ipAddress", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkProfile: msRest.CompositeMapper = { + serializedName: "NetworkProfile", + type: { + name: "Composite", + className: "NetworkProfile", + modelProperties: { + networkInterfaces: { + serializedName: "networkInterfaces", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IpAddress" + } + } + } + }, + circuitId: { + readOnly: true, + serializedName: "circuitId", + type: { + name: "String" + } + } + } + } +}; + +export const HanaInstance: msRest.CompositeMapper = { + serializedName: "HanaInstance", + type: { + name: "Composite", + className: "HanaInstance", + modelProperties: { + ...Resource.type.modelProperties, + hardwareProfile: { + serializedName: "properties.hardwareProfile", + type: { + name: "Composite", + className: "HardwareProfile" + } + }, + storageProfile: { + serializedName: "properties.storageProfile", + type: { + name: "Composite", + className: "StorageProfile" + } + }, + osProfile: { + serializedName: "properties.osProfile", + type: { + name: "Composite", + className: "OSProfile" + } + }, + networkProfile: { + serializedName: "properties.networkProfile", + type: { + name: "Composite", + className: "NetworkProfile" + } + }, + hanaInstanceId: { + readOnly: true, + serializedName: "properties.hanaInstanceId", + type: { + name: "String" + } + }, + powerState: { + readOnly: true, + serializedName: "properties.powerState", + type: { + name: "String" + } + }, + proximityPlacementGroup: { + readOnly: true, + serializedName: "properties.proximityPlacementGroup", + type: { + name: "String" + } + }, + hwRevision: { + readOnly: true, + serializedName: "properties.hwRevision", + type: { + name: "String" + } + } + } + } +}; + +export const Display: msRest.CompositeMapper = { + serializedName: "Display", + type: { + name: "Composite", + className: "Display", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + }, + origin: { + readOnly: true, + serializedName: "origin", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "Display" + } + } + } + } +}; + +export const ErrorResponse: msRest.CompositeMapper = { + serializedName: "ErrorResponse", + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const Tags: msRest.CompositeMapper = { + serializedName: "Tags", + type: { + name: "Composite", + className: "Tags", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const MonitoringDetails: msRest.CompositeMapper = { + serializedName: "MonitoringDetails", + type: { + name: "Composite", + className: "MonitoringDetails", + modelProperties: { + hanaVnet: { + serializedName: "hanaVnet", + type: { + name: "String" + } + }, + hanaHostname: { + serializedName: "hanaHostname", + type: { + name: "String" + } + }, + hanaInstanceNum: { + serializedName: "hanaInstanceNum", + type: { + name: "String" + } + }, + dbContainer: { + serializedName: "dbContainer", + defaultValue: 'single', + type: { + name: "String" + } + }, + hanaDatabase: { + serializedName: "hanaDatabase", + type: { + name: "String" + } + }, + hanaDbUsername: { + serializedName: "hanaDbUsername", + type: { + name: "String" + } + }, + hanaDbPassword: { + serializedName: "hanaDbPassword", + type: { + name: "String" + } + } + } + } +}; + +export const OperationList: msRest.CompositeMapper = { + serializedName: "OperationList", + type: { + name: "Composite", + className: "OperationList", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation" + } + } + } + } + } + } +}; + +export const HanaInstancesListResult: msRest.CompositeMapper = { + serializedName: "HanaInstancesListResult", + type: { + name: "Composite", + className: "HanaInstancesListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "HanaInstance" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/models/operationsMappers.ts b/sdk/hanaonazure/arm-hanaonazure/lib/models/operationsMappers.ts new file mode 100644 index 000000000000..85f93b8e1cd2 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/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 { + OperationList, + Operation, + Display, + ErrorResponse +} from "../models/mappers"; + diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/models/parameters.ts b/sdk/hanaonazure/arm-hanaonazure/lib/models/parameters.ts new file mode 100644 index 000000000000..99b4f44ffa5f --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/models/parameters.ts @@ -0,0 +1,73 @@ +/* + * 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 hanaInstanceName: msRest.OperationURLParameter = { + parameterPath: "hanaInstanceName", + mapper: { + required: true, + serializedName: "hanaInstanceName", + type: { + name: "String" + } + } +}; +export const nextPageLink: msRest.OperationURLParameter = { + parameterPath: "nextPageLink", + mapper: { + required: true, + serializedName: "nextLink", + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const resourceGroupName: msRest.OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + required: true, + serializedName: "resourceGroupName", + type: { + name: "String" + } + } +}; +export const subscriptionId: msRest.OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + required: true, + serializedName: "subscriptionId", + type: { + name: "String" + } + } +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/operations/hanaInstances.ts b/sdk/hanaonazure/arm-hanaonazure/lib/operations/hanaInstances.ts new file mode 100644 index 000000000000..9ed0944caab6 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/operations/hanaInstances.ts @@ -0,0 +1,483 @@ +/* + * 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/hanaInstancesMappers"; +import * as Parameters from "../models/parameters"; +import { HanaManagementClientContext } from "../hanaManagementClientContext"; + +/** Class representing a HanaInstances. */ +export class HanaInstances { + private readonly client: HanaManagementClientContext; + + /** + * Create a HanaInstances. + * @param {HanaManagementClientContext} client Reference to the service client. + */ + constructor(client: HanaManagementClientContext) { + this.client = client; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various + * properties of each SAP HANA on Azure instance. + * @summary Gets a list of SAP HANA instances in the specified 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; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The + * operations returns various properties of each SAP HANA on Azure instance. + * @summary Gets a list of SAP HANA instances in the specified subscription and the resource group. + * @param resourceGroupName Name of the resource group. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group. + * @param callback The callback + */ + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group. + * @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 properties of a SAP HANA instance for the specified subscription, resource group, and + * instance name. + * @summary Gets properties of a SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param callback The callback + */ + get(resourceGroupName: string, hanaInstanceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, hanaInstanceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + hanaInstanceName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Patches the Tags field of a SAP HANA instance for the specified subscription, resource group, + * and instance name. + * @summary Patches the Tags field of a SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param tagsParameter Request body that only contains the new Tags field + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param tagsParameter Request body that only contains the new Tags field + * @param callback The callback + */ + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param tagsParameter Request body that only contains the new Tags field + * @param options The optional parameters + * @param callback The callback + */ + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: Models.Tags, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + hanaInstanceName, + tagsParameter, + options + }, + updateOperationSpec, + callback) as Promise; + } + + /** + * The operation to restart a SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param [options] The optional parameters + * @returns Promise + */ + restart(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginRestart(resourceGroupName,hanaInstanceName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * The operation to add a monitor to an SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param monitoringParameter Request body that only contains monitoring attributes + * @param [options] The optional parameters + * @returns Promise + */ + enableMonitoring(resourceGroupName: string, hanaInstanceName: string, monitoringParameter: Models.MonitoringDetails, options?: msRest.RequestOptionsBase): Promise { + return this.beginEnableMonitoring(resourceGroupName,hanaInstanceName,monitoringParameter,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * The operation to restart a SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param [options] The optional parameters + * @returns Promise + */ + beginRestart(resourceGroupName: string, hanaInstanceName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + hanaInstanceName, + options + }, + beginRestartOperationSpec, + options); + } + + /** + * The operation to add a monitor to an SAP HANA instance. + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @param monitoringParameter Request body that only contains monitoring attributes + * @param [options] The optional parameters + * @returns Promise + */ + beginEnableMonitoring(resourceGroupName: string, hanaInstanceName: string, monitoringParameter: Models.MonitoringDetails, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + hanaInstanceName, + monitoringParameter, + options + }, + beginEnableMonitoringOperationSpec, + options); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various + * properties of each SAP HANA on Azure instance. + * @summary Gets a list of SAP HANA instances in the specified subscription. + * @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; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The + * operations returns various properties of each SAP HANA on Azure instance. + * @summary Gets a list of SAP HANA instances in the specified subscription and the resource group. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listByResourceGroupNext(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 + */ + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listByResourceGroupNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HanaInstancesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HanaInstancesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hanaInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HanaInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const updateOperationSpec: msRest.OperationSpec = { + httpMethod: "PATCH", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hanaInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "tagsParameter", + mapper: { + ...Mappers.Tags, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.HanaInstance + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const beginRestartOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/restart", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hanaInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginEnableMonitoringOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}/monitoring", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.hanaInstanceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "monitoringParameter", + mapper: { + ...Mappers.MonitoringDetails, + required: true + } + }, + responses: { + 200: {}, + 202: {}, + 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.HanaInstancesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; + +const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.HanaInstancesListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/operations/index.ts b/sdk/hanaonazure/arm-hanaonazure/lib/operations/index.ts new file mode 100644 index 000000000000..abcb11a14b13 --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/operations/index.ts @@ -0,0 +1,12 @@ +/* + * 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 "./operations"; +export * from "./hanaInstances"; diff --git a/sdk/hanaonazure/arm-hanaonazure/lib/operations/operations.ts b/sdk/hanaonazure/arm-hanaonazure/lib/operations/operations.ts new file mode 100644 index 000000000000..6f9d3634099a --- /dev/null +++ b/sdk/hanaonazure/arm-hanaonazure/lib/operations/operations.ts @@ -0,0 +1,74 @@ +/* + * 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 { HanaManagementClientContext } from "../hanaManagementClientContext"; + +/** Class representing a Operations. */ +export class Operations { + private readonly client: HanaManagementClientContext; + + /** + * Create a Operations. + * @param {HanaManagementClientContext} client Reference to the service client. + */ + constructor(client: HanaManagementClientContext) { + this.client = client; + } + + /** + * Gets a list of SAP HANA management 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; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "providers/Microsoft.HanaOnAzure/operations", + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.OperationList + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + serializer +}; diff --git a/sdk/hanaonazure/arm-hanaonazure/package.json b/sdk/hanaonazure/arm-hanaonazure/package.json index 1d72182c81fb..1df29fc176ce 100644 --- a/sdk/hanaonazure/arm-hanaonazure/package.json +++ b/sdk/hanaonazure/arm-hanaonazure/package.json @@ -4,8 +4,8 @@ "description": "HanaManagementClient Library with typescript type definitions for node.js and browser.", "version": "1.1.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.1.0", - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-azure-js": "^1.2.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -23,9 +23,10 @@ "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/tree/master/sdk/hanaonazure/arm-hanaonazure", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -42,7 +43,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -51,6 +52,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/arm-hanaonazure.js.map'\" -o ./dist/arm-hanaonazure.min.js ./dist/arm-hanaonazure.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/sdk/hanaonazure/arm-hanaonazure/rollup.config.js b/sdk/hanaonazure/arm-hanaonazure/rollup.config.js index 5e55897df412..aaa5ec253909 100644 --- a/sdk/hanaonazure/arm-hanaonazure/rollup.config.js +++ b/sdk/hanaonazure/arm-hanaonazure/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/hanaManagementClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/hanaManagementClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-hanaonazure.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; diff --git a/sdk/hanaonazure/arm-hanaonazure/tsconfig.json b/sdk/hanaonazure/arm-hanaonazure/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/hanaonazure/arm-hanaonazure/tsconfig.json +++ b/sdk/hanaonazure/arm-hanaonazure/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }