diff --git a/lib/services/hanaonazureManagement/LICENSE.txt b/lib/services/hanaonazureManagement/LICENSE.txt index a70e8cf660..8f3d856145 100644 --- a/lib/services/hanaonazureManagement/LICENSE.txt +++ b/lib/services/hanaonazureManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2019 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/hanaonazureManagement/README.md b/lib/services/hanaonazureManagement/README.md index dfb6b5d6e3..62e6e9c140 100644 --- a/lib/services/hanaonazureManagement/README.md +++ b/lib/services/hanaonazureManagement/README.md @@ -1,40 +1,41 @@ ---- -uid: azure-arm-hanaonazure -summary: *content - ---- -# Microsoft Azure SDK for Node.js - HanaManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-hanaonazure -``` - -## How to use - -### Authentication, client creation and list operations as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const HanaManagementClient = require("azure-arm-hanaonazure"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new HanaManagementClient(creds, subscriptionId); - return client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-hanaonazure +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - HanaManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-arm-hanaonazure +``` + +### How to use + +#### Authentication, client creation and list operations as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const HanaManagementClient = require("azure-arm-hanaonazure"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new HanaManagementClient(creds, subscriptionId); + return client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/hanaonazureManagement/lib/models/disk.js b/lib/services/hanaonazureManagement/lib/models/disk.js index 1daecd369d..7bf460d2a8 100644 --- a/lib/services/hanaonazureManagement/lib/models/disk.js +++ b/lib/services/hanaonazureManagement/lib/models/disk.js @@ -17,12 +17,12 @@ class Disk { /** * Create a Disk. - * @member {string} [name] The disk name. - * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. - * @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. + * @property {string} [name] The disk name. + * @property {number} [diskSizeGB] Specifies the size of an empty data disk + * in gigabytes. + * @property {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. */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/display.js b/lib/services/hanaonazureManagement/lib/models/display.js index d3a9199553..f5d1dbaa82 100644 --- a/lib/services/hanaonazureManagement/lib/models/display.js +++ b/lib/services/hanaonazureManagement/lib/models/display.js @@ -17,24 +17,24 @@ class Display { /** * Create a Display. - * @member {string} [provider] The localized friendly form of the resource + * @property {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. - * @member {string} [resource] The localized friendly form of the resource + * @property {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. - * @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. - * @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. - * @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' + * @property {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. + * @property {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. + * @property {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' */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/errorResponse.js b/lib/services/hanaonazureManagement/lib/models/errorResponse.js index f952d62061..fc85ac1b8b 100644 --- a/lib/services/hanaonazureManagement/lib/models/errorResponse.js +++ b/lib/services/hanaonazureManagement/lib/models/errorResponse.js @@ -17,8 +17,8 @@ class ErrorResponse { /** * Create a ErrorResponse. - * @member {string} [code] Error code - * @member {string} [message] Error message indicating why the operation + * @property {string} [code] Error code + * @property {string} [message] Error message indicating why the operation * failed. */ constructor() { diff --git a/lib/services/hanaonazureManagement/lib/models/hanaInstance.js b/lib/services/hanaonazureManagement/lib/models/hanaInstance.js index 7d5448da95..36357104ba 100644 --- a/lib/services/hanaonazureManagement/lib/models/hanaInstance.js +++ b/lib/services/hanaonazureManagement/lib/models/hanaInstance.js @@ -20,39 +20,42 @@ const models = require('./index'); class HanaInstance extends models['Resource'] { /** * Create a HanaInstance. - * @member {object} [hardwareProfile] Specifies the hardware settings for the - * HANA instance. - * @member {string} [hardwareProfile.hardwareType] Name of the hardware type - * (vendor and/or their product name). Possible values include: 'Cisco_UCS', - * 'HPE' - * @member {string} [hardwareProfile.hanaInstanceSize] Specifies the HANA + * @property {object} [hardwareProfile] Specifies the hardware settings for + * the HANA instance. + * @property {string} [hardwareProfile.hardwareType] Name of the hardware + * type (vendor and/or their product name). Possible values include: + * 'Cisco_UCS', 'HPE' + * @property {string} [hardwareProfile.hanaInstanceSize] Specifies the HANA * instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', - * 'S192', 'S192m', 'S192xm', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', - * 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' - * @member {object} [storageProfile] Specifies the storage settings for the + * 'S192', 'S192m', 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', + * 'S576m', 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' + * @property {object} [storageProfile] Specifies the storage settings for the * HANA instance disks. - * @member {string} [storageProfile.nfsIpAddress] IP Address to connect to + * @property {string} [storageProfile.nfsIpAddress] IP Address to connect to * storage. - * @member {array} [storageProfile.osDisks] Specifies information about the + * @property {array} [storageProfile.osDisks] Specifies information about the * operating system disk used by the hana instance. - * @member {object} [osProfile] Specifies the operating system settings for + * @property {object} [osProfile] Specifies the operating system settings for * the HANA instance. - * @member {string} [osProfile.computerName] Specifies the host OS name of + * @property {string} [osProfile.computerName] Specifies the host OS name of * the HANA instance. - * @member {string} [osProfile.osType] This property allows you to specify + * @property {string} [osProfile.osType] This property allows you to specify * the type of the OS. - * @member {string} [osProfile.version] Specifies version of operating + * @property {string} [osProfile.version] Specifies version of operating * system. - * @member {object} [networkProfile] Specifies the network settings for the + * @property {object} [networkProfile] Specifies the network settings for the * HANA instance. - * @member {array} [networkProfile.networkInterfaces] Specifies the network + * @property {array} [networkProfile.networkInterfaces] Specifies the network * interfaces for the HANA instance. - * @member {string} [networkProfile.circuitId] Specifies the circuit id for + * @property {string} [networkProfile.circuitId] Specifies the circuit id for * connecting to express route. - * @member {string} [hanaInstanceId] Specifies the HANA instance unique ID. - * @member {string} [powerState] Resource power state. Possible values + * @property {string} [hanaInstanceId] Specifies the HANA instance unique ID. + * @property {string} [powerState] Resource power state. Possible values * include: 'starting', 'started', 'stopping', 'stopped', 'restarting', * 'unknown' + * @property {string} [proximityPlacementGroup] Resource proximity placement + * group + * @property {string} [hwRevision] Hardware revision of a HANA instance */ constructor() { super(); @@ -166,6 +169,22 @@ class HanaInstance extends models['Resource'] { type: { name: 'String' } + }, + proximityPlacementGroup: { + required: false, + readOnly: true, + serializedName: 'properties.proximityPlacementGroup', + type: { + name: 'String' + } + }, + hwRevision: { + required: false, + readOnly: true, + serializedName: 'properties.hwRevision', + type: { + name: 'String' + } } } } diff --git a/lib/services/hanaonazureManagement/lib/models/hanaInstancesListResult.js b/lib/services/hanaonazureManagement/lib/models/hanaInstancesListResult.js index 09e8c9887f..3cbbc72a12 100644 --- a/lib/services/hanaonazureManagement/lib/models/hanaInstancesListResult.js +++ b/lib/services/hanaonazureManagement/lib/models/hanaInstancesListResult.js @@ -16,7 +16,8 @@ class HanaInstancesListResult extends Array { /** * Create a HanaInstancesListResult. - * @member {string} [nextLink] The URL to get the next set of HANA instances. + * @property {string} [nextLink] The URL to get the next set of HANA + * instances. */ constructor() { super(); diff --git a/lib/services/hanaonazureManagement/lib/models/hardwareProfile.js b/lib/services/hanaonazureManagement/lib/models/hardwareProfile.js index 691a31ed73..04317b3481 100644 --- a/lib/services/hanaonazureManagement/lib/models/hardwareProfile.js +++ b/lib/services/hanaonazureManagement/lib/models/hardwareProfile.js @@ -17,12 +17,12 @@ class HardwareProfile { /** * Create a HardwareProfile. - * @member {string} [hardwareType] Name of the hardware type (vendor and/or + * @property {string} [hardwareType] Name of the hardware type (vendor and/or * their product name). Possible values include: 'Cisco_UCS', 'HPE' - * @member {string} [hanaInstanceSize] Specifies the HANA instance SKU. + * @property {string} [hanaInstanceSize] Specifies the HANA instance SKU. * Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', - * 'S192xm', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', - * 'S768m', 'S768xm', 'S960m' + * 'S192xm', 'S96', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', + * 'S768', 'S768m', 'S768xm', 'S960m' */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/index.d.ts b/lib/services/hanaonazureManagement/lib/models/index.d.ts index 3f54e7bd58..e2d1a2af9f 100644 --- a/lib/services/hanaonazureManagement/lib/models/index.d.ts +++ b/lib/services/hanaonazureManagement/lib/models/index.d.ts @@ -1,288 +1,262 @@ /* * 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. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * The resource model definition. - * - * @member {string} [id] Resource ID - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Resource location - * @member {object} [tags] Resource tags */ export interface Resource extends BaseResource { + /** + * Resource ID + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; + /** + * Resource location + */ readonly location?: string; + /** + * Resource tags + */ readonly tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the HardwareProfile class. - * @constructor * Specifies the hardware settings for the HANA instance. - * - * @member {string} [hardwareType] Name of the hardware type (vendor and/or - * their product name). Possible values include: 'Cisco_UCS', 'HPE' - * @member {string} [hanaInstanceSize] Specifies the HANA instance SKU. - * Possible values include: 'S72m', 'S144m', 'S72', 'S144', 'S192', 'S192m', - * 'S192xm', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', 'S576xm', 'S768', - * 'S768m', 'S768xm', 'S960m' */ export interface HardwareProfile { + /** + * Name of the hardware type (vendor and/or their product name). Possible values include: + * 'Cisco_UCS', 'HPE' + */ readonly hardwareType?: string; + /** + * 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' + */ readonly hanaInstanceSize?: string; } /** - * @class - * Initializes a new instance of the Disk class. - * @constructor * Specifies the disk information fo the HANA instance - * - * @member {string} [name] The disk name. - * @member {number} [diskSizeGB] Specifies the size of an empty data disk in - * gigabytes. - * @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. */ export interface Disk { + /** + * The disk name. + */ name?: string; + /** + * Specifies the size of an empty data disk in gigabytes. + */ diskSizeGB?: number; + /** + * 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. + */ readonly lun?: number; } /** - * @class - * Initializes a new instance of the StorageProfile class. - * @constructor * Specifies the storage settings for the HANA instance disks. - * - * @member {string} [nfsIpAddress] IP Address to connect to storage. - * @member {array} [osDisks] Specifies information about the operating system - * disk used by the hana instance. */ export interface StorageProfile { + /** + * IP Address to connect to storage. + */ readonly nfsIpAddress?: string; + /** + * Specifies information about the operating system disk used by the hana instance. + */ osDisks?: Disk[]; } /** - * @class - * Initializes a new instance of the OSProfile class. - * @constructor * Specifies the operating system settings for the HANA instance. - * - * @member {string} [computerName] Specifies the host OS name of the HANA - * instance. - * @member {string} [osType] This property allows you to specify the type of - * the OS. - * @member {string} [version] Specifies version of operating system. */ export interface OSProfile { + /** + * Specifies the host OS name of the HANA instance. + */ readonly computerName?: string; + /** + * This property allows you to specify the type of the OS. + */ readonly osType?: string; + /** + * Specifies version of operating system. + */ readonly version?: string; } /** - * @class - * Initializes a new instance of the IpAddress class. - * @constructor - * Specifies the IP address of the network interaface. - * - * @member {string} [ipAddress] Specifies the IP address of the network - * interface. + * Specifies the IP address of the network interface. */ export interface IpAddress { + /** + * Specifies the IP address of the network interface. + */ readonly ipAddress?: string; } /** - * @class - * Initializes a new instance of the NetworkProfile class. - * @constructor * Specifies the network settings for the HANA instance disks. - * - * @member {array} [networkInterfaces] Specifies the network interfaces for the - * HANA instance. - * @member {string} [circuitId] Specifies the circuit id for connecting to - * express route. */ export interface NetworkProfile { + /** + * Specifies the network interfaces for the HANA instance. + */ networkInterfaces?: IpAddress[]; + /** + * Specifies the circuit id for connecting to express route. + */ readonly circuitId?: string; } /** - * @class - * Initializes a new instance of the HanaInstance class. - * @constructor * HANA instance info on Azure (ARM properties and HANA properties) - * - * @member {object} [hardwareProfile] Specifies the hardware settings for the - * HANA instance. - * @member {string} [hardwareProfile.hardwareType] Name of the hardware type - * (vendor and/or their product name). Possible values include: 'Cisco_UCS', - * 'HPE' - * @member {string} [hardwareProfile.hanaInstanceSize] Specifies the HANA - * instance SKU. Possible values include: 'S72m', 'S144m', 'S72', 'S144', - * 'S192', 'S192m', 'S192xm', 'S384', 'S384m', 'S384xm', 'S384xxm', 'S576m', - * 'S576xm', 'S768', 'S768m', 'S768xm', 'S960m' - * @member {object} [storageProfile] Specifies the storage settings for the - * HANA instance disks. - * @member {string} [storageProfile.nfsIpAddress] IP Address to connect to - * storage. - * @member {array} [storageProfile.osDisks] Specifies information about the - * operating system disk used by the hana instance. - * @member {object} [osProfile] Specifies the operating system settings for the - * HANA instance. - * @member {string} [osProfile.computerName] Specifies the host OS name of the - * HANA instance. - * @member {string} [osProfile.osType] This property allows you to specify the - * type of the OS. - * @member {string} [osProfile.version] Specifies version of operating system. - * @member {object} [networkProfile] Specifies the network settings for the - * HANA instance. - * @member {array} [networkProfile.networkInterfaces] Specifies the network - * interfaces for the HANA instance. - * @member {string} [networkProfile.circuitId] Specifies the circuit id for - * connecting to express route. - * @member {string} [hanaInstanceId] Specifies the HANA instance unique ID. - * @member {string} [powerState] Resource power state. Possible values include: - * 'starting', 'started', 'stopping', 'stopped', 'restarting', 'unknown' */ export interface HanaInstance extends Resource { + /** + * Specifies the hardware settings for the HANA instance. + */ hardwareProfile?: HardwareProfile; + /** + * Specifies the storage settings for the HANA instance disks. + */ storageProfile?: StorageProfile; + /** + * Specifies the operating system settings for the HANA instance. + */ osProfile?: OSProfile; + /** + * Specifies the network settings for the HANA instance. + */ networkProfile?: NetworkProfile; + /** + * Specifies the HANA instance unique ID. + */ readonly hanaInstanceId?: string; + /** + * Resource power state. Possible values include: 'starting', 'started', 'stopping', 'stopped', + * 'restarting', 'unknown' + */ readonly powerState?: string; + /** + * Resource proximity placement group + */ + readonly proximityPlacementGroup?: string; + /** + * Hardware revision of a HANA instance + */ + readonly hwRevision?: string; } /** - * @class - * Initializes a new instance of the Display class. - * @constructor * Detailed HANA operation information - * - * @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. - * @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. - * @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. - * @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. - * @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' */ export interface Display { + /** + * 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. + */ readonly provider?: string; + /** + * 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. + */ readonly resource?: string; + /** + * 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. + */ readonly operation?: string; + /** + * 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. + */ readonly description?: string; + /** + * 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' + */ readonly origin?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * HANA operation information - * - * @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. - * @member {object} [display] Displayed HANA operation information - * @member {string} [display.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. - * @member {string} [display.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. - * @member {string} [display.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. - * @member {string} [display.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. - * @member {string} [display.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' */ export interface Operation { + /** + * 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. + */ readonly name?: string; + /** + * Displayed HANA operation information + */ display?: Display; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor * Describes the format of Error response. - * - * @member {string} [code] Error code - * @member {string} [message] Error message indicating why the operation - * failed. */ export interface ErrorResponse { + /** + * Error code + */ code?: string; + /** + * Error message indicating why the operation failed. + */ message?: string; } +/** + * Tags field of the HANA instance. + */ +export interface Tags { + /** + * Tags field of the HANA instance. + */ + tags?: { [propertyName: string]: string }; +} /** - * @class - * Initializes a new instance of the OperationList class. - * @constructor * List of HANA operations - * */ export interface OperationList extends Array { } /** - * @class - * Initializes a new instance of the HanaInstancesListResult class. - * @constructor * The response from the List HANA Instances operation. - * - * @member {string} [nextLink] The URL to get the next set of HANA instances. */ export interface HanaInstancesListResult extends Array { + /** + * The URL to get the next set of HANA instances. + */ nextLink?: string; } diff --git a/lib/services/hanaonazureManagement/lib/models/index.js b/lib/services/hanaonazureManagement/lib/models/index.js index ab9a86588a..f14f378eeb 100644 --- a/lib/services/hanaonazureManagement/lib/models/index.js +++ b/lib/services/hanaonazureManagement/lib/models/index.js @@ -29,5 +29,6 @@ exports.HanaInstance = require('./hanaInstance'); exports.Display = require('./display'); exports.Operation = require('./operation'); exports.ErrorResponse = require('./errorResponse'); +exports.Tags = require('./tags'); exports.OperationList = require('./operationList'); exports.HanaInstancesListResult = require('./hanaInstancesListResult'); diff --git a/lib/services/hanaonazureManagement/lib/models/ipAddress.js b/lib/services/hanaonazureManagement/lib/models/ipAddress.js index 145b851857..e84081cea0 100644 --- a/lib/services/hanaonazureManagement/lib/models/ipAddress.js +++ b/lib/services/hanaonazureManagement/lib/models/ipAddress.js @@ -11,13 +11,13 @@ 'use strict'; /** - * Specifies the IP address of the network interaface. + * Specifies the IP address of the network interface. * */ class IpAddress { /** * Create a IpAddress. - * @member {string} [ipAddress] Specifies the IP address of the network + * @property {string} [ipAddress] Specifies the IP address of the network * interface. */ constructor() { diff --git a/lib/services/hanaonazureManagement/lib/models/networkProfile.js b/lib/services/hanaonazureManagement/lib/models/networkProfile.js index 53097bc995..468c61e99a 100644 --- a/lib/services/hanaonazureManagement/lib/models/networkProfile.js +++ b/lib/services/hanaonazureManagement/lib/models/networkProfile.js @@ -17,9 +17,9 @@ class NetworkProfile { /** * Create a NetworkProfile. - * @member {array} [networkInterfaces] Specifies the network interfaces for + * @property {array} [networkInterfaces] Specifies the network interfaces for * the HANA instance. - * @member {string} [circuitId] Specifies the circuit id for connecting to + * @property {string} [circuitId] Specifies the circuit id for connecting to * express route. */ constructor() { diff --git a/lib/services/hanaonazureManagement/lib/models/oSProfile.js b/lib/services/hanaonazureManagement/lib/models/oSProfile.js index d71f8bbaa3..766968face 100644 --- a/lib/services/hanaonazureManagement/lib/models/oSProfile.js +++ b/lib/services/hanaonazureManagement/lib/models/oSProfile.js @@ -17,11 +17,11 @@ class OSProfile { /** * Create a OSProfile. - * @member {string} [computerName] Specifies the host OS name of the HANA + * @property {string} [computerName] Specifies the host OS name of the HANA * instance. - * @member {string} [osType] This property allows you to specify the type of - * the OS. - * @member {string} [version] Specifies version of operating system. + * @property {string} [osType] This property allows you to specify the type + * of the OS. + * @property {string} [version] Specifies version of operating system. */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/operation.js b/lib/services/hanaonazureManagement/lib/models/operation.js index a830cccae2..00da1a365a 100644 --- a/lib/services/hanaonazureManagement/lib/models/operation.js +++ b/lib/services/hanaonazureManagement/lib/models/operation.js @@ -17,28 +17,29 @@ class Operation { /** * Create a 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. - * @member {object} [display] Displayed HANA operation information - * @member {string} [display.provider] The localized friendly form of the + * @property {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. + * @property {object} [display] Displayed HANA operation information + * @property {string} [display.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. - * @member {string} [display.resource] The localized friendly form of the + * @property {string} [display.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. - * @member {string} [display.operation] The localized friendly name for the + * @property {string} [display.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. - * @member {string} [display.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. - * @member {string} [display.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' + * @property {string} [display.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. + * @property {string} [display.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' */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/resource.js b/lib/services/hanaonazureManagement/lib/models/resource.js index 60896113b8..1e97a2ea0e 100644 --- a/lib/services/hanaonazureManagement/lib/models/resource.js +++ b/lib/services/hanaonazureManagement/lib/models/resource.js @@ -20,11 +20,11 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource ID - * @member {string} [name] Resource name - * @member {string} [type] Resource type - * @member {string} [location] Resource location - * @member {object} [tags] Resource tags + * @property {string} [id] Resource ID + * @property {string} [name] Resource name + * @property {string} [type] Resource type + * @property {string} [location] Resource location + * @property {object} [tags] Resource tags */ constructor() { super(); diff --git a/lib/services/hanaonazureManagement/lib/models/storageProfile.js b/lib/services/hanaonazureManagement/lib/models/storageProfile.js index 5ed26d2071..4645120933 100644 --- a/lib/services/hanaonazureManagement/lib/models/storageProfile.js +++ b/lib/services/hanaonazureManagement/lib/models/storageProfile.js @@ -17,9 +17,9 @@ class StorageProfile { /** * Create a StorageProfile. - * @member {string} [nfsIpAddress] IP Address to connect to storage. - * @member {array} [osDisks] Specifies information about the operating system - * disk used by the hana instance. + * @property {string} [nfsIpAddress] IP Address to connect to storage. + * @property {array} [osDisks] Specifies information about the operating + * system disk used by the hana instance. */ constructor() { } diff --git a/lib/services/hanaonazureManagement/lib/models/tags.js b/lib/services/hanaonazureManagement/lib/models/tags.js new file mode 100644 index 0000000000..61b004c633 --- /dev/null +++ b/lib/services/hanaonazureManagement/lib/models/tags.js @@ -0,0 +1,59 @@ +/* + * 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. + */ + +'use strict'; + +/** + * Tags field of the HANA instance. + * + */ +class Tags { + /** + * Create a Tags. + * @property {object} [tags] Tags field of the HANA instance. + */ + constructor() { + } + + /** + * Defines the metadata of Tags + * + * @returns {object} metadata of Tags + * + */ + mapper() { + return { + required: false, + serializedName: 'Tags', + type: { + name: 'Composite', + className: 'Tags', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = Tags; diff --git a/lib/services/hanaonazureManagement/lib/operations/hanaInstances.js b/lib/services/hanaonazureManagement/lib/operations/hanaInstances.js index fa95d78ec3..0322b42db3 100644 --- a/lib/services/hanaonazureManagement/lib/operations/hanaInstances.js +++ b/lib/services/hanaonazureManagement/lib/operations/hanaInstances.js @@ -447,6 +447,178 @@ function _get(resourceGroupName, hanaInstanceName, options, callback) { }); } +/** + * @summary Patches the Tags field of a SAP HANA instance. + * + * Patches the Tags field of a SAP HANA instance for the specified + * subscription, resource group, and instance name. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} tagsParameter Request body that only contains the new Tags + * field + * + * @param {object} [tagsParameter.tags] Tags field of the HANA instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HanaInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, hanaInstanceName, tagsParameter, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (hanaInstanceName === null || hanaInstanceName === undefined || typeof hanaInstanceName.valueOf() !== 'string') { + throw new Error('hanaInstanceName cannot be null or undefined and it must be of type string.'); + } + if (tagsParameter === null || tagsParameter === undefined) { + throw new Error('tagsParameter cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{hanaInstanceName}', encodeURIComponent(hanaInstanceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (tagsParameter !== null && tagsParameter !== undefined) { + let requestModelMapper = new client.models['Tags']().mapper(); + requestModel = client.serialize(requestModelMapper, tagsParameter, 'tagsParameter'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(tagsParameter, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['HanaInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + /** * The operation to restart a SAP HANA instance. * @@ -478,6 +650,68 @@ function _restart(resourceGroupName, hanaInstanceName, options, callback) { callback = options; options = null; } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestart(resourceGroupName, hanaInstanceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * The operation to restart a SAP HANA instance. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestart(resourceGroupName, hanaInstanceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } if (!callback) { throw new Error('callback cannot be null.'); } @@ -541,7 +775,7 @@ function _restart(resourceGroupName, hanaInstanceName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -851,7 +1085,9 @@ class HanaInstances { this._list = _list; this._listByResourceGroup = _listByResourceGroup; this._get = _get; + this._update = _update; this._restart = _restart; + this._beginRestart = _beginRestart; this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; } @@ -1126,6 +1362,108 @@ class HanaInstances { } } + /** + * @summary Patches the Tags field of a SAP HANA instance. + * + * Patches the Tags field of a SAP HANA instance for the specified + * subscription, resource group, and instance name. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} tagsParameter Request body that only contains the new Tags + * field + * + * @param {object} [tagsParameter.tags] Tags field of the HANA instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, hanaInstanceName, tagsParameter, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, hanaInstanceName, tagsParameter, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Patches the Tags field of a SAP HANA instance. + * + * Patches the Tags field of a SAP HANA instance for the specified + * subscription, resource group, and instance name. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} tagsParameter Request body that only contains the new Tags + * field + * + * @param {object} [tagsParameter.tags] Tags field of the HANA instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HanaInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HanaInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, hanaInstanceName, tagsParameter, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, hanaInstanceName, tagsParameter, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, hanaInstanceName, tagsParameter, options, optionalCallback); + } + } + /** * The operation to restart a SAP HANA instance. * @@ -1211,6 +1549,91 @@ class HanaInstances { } } + /** + * The operation to restart a SAP HANA instance. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRestartWithHttpOperationResponse(resourceGroupName, hanaInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, hanaInstanceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * The operation to restart a SAP HANA instance. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestart(resourceGroupName, hanaInstanceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, hanaInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestart(resourceGroupName, hanaInstanceName, options, optionalCallback); + } + } + /** * @summary Gets a list of SAP HANA instances in the specified subscription. * diff --git a/lib/services/hanaonazureManagement/lib/operations/index.d.ts b/lib/services/hanaonazureManagement/lib/operations/index.d.ts index 50c928acf5..016eead722 100644 --- a/lib/services/hanaonazureManagement/lib/operations/index.d.ts +++ b/lib/services/hanaonazureManagement/lib/operations/index.d.ts @@ -270,6 +270,81 @@ export interface HanaInstances { get(resourceGroupName: string, hanaInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Patches the Tags field of a SAP HANA instance. + * + * Patches the Tags field of a SAP HANA instance for the specified + * subscription, resource group, and instance name. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} tagsParameter Request body that only contains the new Tags + * field + * + * @param {object} [tagsParameter.tags] Tags field of the HANA instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, hanaInstanceName: string, tagsParameter: models.Tags, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Patches the Tags field of a SAP HANA instance. + * + * Patches the Tags field of a SAP HANA instance for the specified + * subscription, resource group, and instance name. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} tagsParameter Request body that only contains the new Tags + * field + * + * @param {object} [tagsParameter.tags] Tags field of the HANA instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HanaInstance} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HanaInstance} [result] - The deserialized result object if an error did not occur. + * See {@link HanaInstance} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: models.Tags, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: models.Tags, callback: ServiceCallback): void; + update(resourceGroupName: string, hanaInstanceName: string, tagsParameter: models.Tags, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * The operation to restart a SAP HANA instance. * @@ -328,6 +403,64 @@ export interface HanaInstances { restart(resourceGroupName: string, hanaInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * The operation to restart a SAP HANA instance. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRestartWithHttpOperationResponse(resourceGroupName: string, hanaInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * The operation to restart a SAP HANA instance. + * + * @param {string} resourceGroupName Name of the resource group. + * + * @param {string} hanaInstanceName Name of the SAP HANA on Azure instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestart(resourceGroupName: string, hanaInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, hanaInstanceName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, hanaInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets a list of SAP HANA instances in the specified subscription. * diff --git a/lib/services/hanaonazureManagement/package.json b/lib/services/hanaonazureManagement/package.json index ce47dfd375..587a5402c2 100644 --- a/lib/services/hanaonazureManagement/package.json +++ b/lib/services/hanaonazureManagement/package.json @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}