From 1f53fd4517f9603aa2ac505454c48397ae1ed1bb Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 14 Mar 2019 00:29:51 +0000 Subject: [PATCH] Generated from a4e5a751ff8ec0b018853fc509d01d2785c9bdf4 Merge branch 'master' into dev --- lib/services/postgresqlManagement/LICENSE.txt | 2 +- .../lib/models/configuration.js | 12 +- .../lib/models/database.js | 4 +- .../lib/models/firewallRule.js | 8 +- .../lib/models/index.d.ts | 652 +++++++++--------- .../postgresqlManagement/lib/models/index.js | 4 +- .../lib/models/logFile.js | 11 +- .../lib/models/nameAvailability.js | 6 +- .../lib/models/nameAvailabilityRequest.js | 4 +- .../lib/models/operation.js | 22 +- .../lib/models/operationDisplay.js | 9 +- .../lib/models/operationListResult.js | 4 +- .../lib/models/performanceTierProperties.js | 6 +- .../performanceTierServiceLevelObjectives.js | 23 +- .../lib/models/proxyResource.js | 6 +- .../postgresqlManagement/lib/models/server.js | 74 +- .../lib/models/serverForCreate.js | 41 +- .../lib/models/serverPropertiesForCreate.js | 21 +- .../serverPropertiesForDefaultCreate.js | 4 +- .../models/serverPropertiesForGeoRestore.js | 2 +- .../lib/models/serverPropertiesForReplica.js | 93 +++ .../lib/models/serverPropertiesForRestore.js | 4 +- .../lib/models/serverSecurityAlertPolicy.js | 20 +- .../lib/models/serverUpdateParameters.js | 37 +- .../postgresqlManagement/lib/models/sku.js | 10 +- .../lib/models/storageProfile.js | 6 +- .../lib/models/trackedResource.js | 4 +- .../lib/models/virtualNetworkRule.js | 10 +- .../models/virtualNetworkRuleListResult.js | 2 +- .../lib/operations/index.d.ts | 196 ++++++ .../lib/operations/index.js | 1 + .../lib/operations/replicas.js | 267 +++++++ .../lib/operations/servers.js | 374 ++++++++++ .../lib/postgreSQLManagementClient.d.ts | 1 + .../lib/postgreSQLManagementClient.js | 1 + .../postgresqlManagement/package.json | 4 +- 36 files changed, 1441 insertions(+), 504 deletions(-) create mode 100644 lib/services/postgresqlManagement/lib/models/serverPropertiesForReplica.js create mode 100644 lib/services/postgresqlManagement/lib/operations/replicas.js diff --git a/lib/services/postgresqlManagement/LICENSE.txt b/lib/services/postgresqlManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/postgresqlManagement/LICENSE.txt +++ b/lib/services/postgresqlManagement/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/lib/services/postgresqlManagement/lib/models/configuration.js b/lib/services/postgresqlManagement/lib/models/configuration.js index 3cad3a004a..d4b7a06de1 100755 --- a/lib/services/postgresqlManagement/lib/models/configuration.js +++ b/lib/services/postgresqlManagement/lib/models/configuration.js @@ -20,12 +20,12 @@ const models = require('./index'); class Configuration extends models['ProxyResource'] { /** * Create a Configuration. - * @member {string} [value] Value of the configuration. - * @member {string} [description] Description of the configuration. - * @member {string} [defaultValue] Default value of the configuration. - * @member {string} [dataType] Data type of the configuration. - * @member {string} [allowedValues] Allowed values of the configuration. - * @member {string} [source] Source of the configuration. + * @property {string} [value] Value of the configuration. + * @property {string} [description] Description of the configuration. + * @property {string} [defaultValue] Default value of the configuration. + * @property {string} [dataType] Data type of the configuration. + * @property {string} [allowedValues] Allowed values of the configuration. + * @property {string} [source] Source of the configuration. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/models/database.js b/lib/services/postgresqlManagement/lib/models/database.js index bab9adc656..16a4662fc7 100755 --- a/lib/services/postgresqlManagement/lib/models/database.js +++ b/lib/services/postgresqlManagement/lib/models/database.js @@ -20,8 +20,8 @@ const models = require('./index'); class Database extends models['ProxyResource'] { /** * Create a Database. - * @member {string} [charset] The charset of the database. - * @member {string} [collation] The collation of the database. + * @property {string} [charset] The charset of the database. + * @property {string} [collation] The collation of the database. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/models/firewallRule.js b/lib/services/postgresqlManagement/lib/models/firewallRule.js index 9b02e606e2..ded74c846e 100755 --- a/lib/services/postgresqlManagement/lib/models/firewallRule.js +++ b/lib/services/postgresqlManagement/lib/models/firewallRule.js @@ -20,9 +20,9 @@ const models = require('./index'); class FirewallRule extends models['ProxyResource'] { /** * Create a FirewallRule. - * @member {string} startIpAddress The start IP address of the server + * @property {string} startIpAddress The start IP address of the server * firewall rule. Must be IPv4 format. - * @member {string} endIpAddress The end IP address of the server firewall + * @property {string} endIpAddress The end IP address of the server firewall * rule. Must be IPv4 format. */ constructor() { @@ -71,7 +71,7 @@ class FirewallRule extends models['ProxyResource'] { required: true, serializedName: 'properties.startIpAddress', constraints: { - Pattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' + Pattern: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/ }, type: { name: 'String' @@ -81,7 +81,7 @@ class FirewallRule extends models['ProxyResource'] { required: true, serializedName: 'properties.endIpAddress', constraints: { - Pattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$' + Pattern: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/ }, type: { name: 'String' diff --git a/lib/services/postgresqlManagement/lib/models/index.d.ts b/lib/services/postgresqlManagement/lib/models/index.d.ts index 85610602ca..9fa1b06b7a 100755 --- a/lib/services/postgresqlManagement/lib/models/index.d.ts +++ b/lib/services/postgresqlManagement/lib/models/index.d.ts @@ -1,619 +1,597 @@ /* * 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 ProxyResource class. - * @constructor * Resource properties. - * - * @member {string} [id] Resource ID - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. */ export interface ProxyResource extends BaseResource { + /** + * Resource ID + */ readonly id?: string; + /** + * Resource name. + */ readonly name?: string; + /** + * Resource type. + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the TrackedResource class. - * @constructor * Resource properties including location and tags for track resources. - * - * @member {string} location The location the resource resides in. - * @member {object} [tags] Application-specific metadata in the form of - * key-value pairs. */ export interface TrackedResource extends ProxyResource { + /** + * The location the resource resides in. + */ location: string; + /** + * Application-specific metadata in the form of key-value pairs. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the StorageProfile class. - * @constructor * Storage Profile properties of a server - * - * @member {number} [backupRetentionDays] Backup retention days for the server. - * @member {string} [geoRedundantBackup] Enable Geo-redundant or not for server - * backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageMB] Max storage allowed for a server. */ export interface StorageProfile { + /** + * Backup retention days for the server. + */ backupRetentionDays?: number; + /** + * Enable Geo-redundant or not for server backup. Possible values include: 'Enabled', 'Disabled' + */ geoRedundantBackup?: string; + /** + * Max storage allowed for a server. + */ storageMB?: number; } /** - * @class - * Initializes a new instance of the ServerPropertiesForCreate class. - * @constructor * The properties used to create a new server. - * - * @member {string} [version] Server version. Possible values include: '9.5', - * '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when connect - * to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention days - * for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant or - * not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a - * server. - * @member {string} createMode Polymorphic Discriminator */ export interface ServerPropertiesForCreate { + /** + * Server version. Possible values include: '9.5', '9.6', '10', '10.0', '10.2' + */ version?: string; + /** + * Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', + * 'Disabled' + */ sslEnforcement?: string; + /** + * Storage profile of a server. + */ storageProfile?: StorageProfile; + /** + * Polymorphic Discriminator + */ createMode: string; } /** - * @class - * Initializes a new instance of the ServerPropertiesForDefaultCreate class. - * @constructor * The properties used to create a new server. - * - * @member {string} administratorLogin The administrator's login name of a - * server. Can only be specified when the server is being created (and is - * required for creation). - * @member {string} administratorLoginPassword The password of the - * administrator login. */ export interface ServerPropertiesForDefaultCreate extends ServerPropertiesForCreate { + /** + * The administrator's login name of a server. Can only be specified when the server is being + * created (and is required for creation). + */ administratorLogin: string; + /** + * The password of the administrator login. + */ administratorLoginPassword: string; } /** - * @class - * Initializes a new instance of the ServerPropertiesForRestore class. - * @constructor * The properties used to create a new server by restoring from a backup. - * - * @member {string} sourceServerId The source server id to restore from. - * @member {date} restorePointInTime Restore point creation time (ISO8601 - * format), specifying the time to restore from. */ export interface ServerPropertiesForRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ sourceServerId: string; + /** + * Restore point creation time (ISO8601 format), specifying the time to restore from. + */ restorePointInTime: Date; } /** - * @class - * Initializes a new instance of the ServerPropertiesForGeoRestore class. - * @constructor - * The properties used to create a new server by restoring to a different - * region from a geo replicated backup. - * - * @member {string} sourceServerId The source server id to restore from. + * The properties used to create a new server by restoring to a different region from a geo + * replicated backup. */ export interface ServerPropertiesForGeoRestore extends ServerPropertiesForCreate { + /** + * The source server id to restore from. + */ + sourceServerId: string; +} + +/** + * The properties to create a new replica. + */ +export interface ServerPropertiesForReplica extends ServerPropertiesForCreate { + /** + * The master server id to create replica from. + */ sourceServerId: string; } /** - * @class - * Initializes a new instance of the Sku class. - * @constructor * Billing information related properties of a server. - * - * @member {string} [name] The name of the sku, typically, tier + family + - * cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [tier] The tier of the particular SKU, e.g. Basic. Possible - * values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [capacity] The scale up/out capacity, representing server's - * compute units. - * @member {string} [size] The size code, to be interpreted by resource as - * appropriate. - * @member {string} [family] The family of hardware. */ export interface Sku { + /** + * The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8. + */ name?: string; + /** + * The tier of the particular SKU, e.g. Basic. Possible values include: 'Basic', + * 'GeneralPurpose', 'MemoryOptimized' + */ tier?: string; + /** + * The scale up/out capacity, representing server's compute units. + */ capacity?: number; + /** + * The size code, to be interpreted by resource as appropriate. + */ size?: string; + /** + * The family of hardware. + */ family?: string; } /** - * @class - * Initializes a new instance of the Server class. - * @constructor * Represents a server. - * - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family + - * cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. - * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing - * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource as - * appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {string} [administratorLogin] The administrator's login name of a - * server. Can only be specified when the server is being created (and is - * required for creation). - * @member {string} [version] Server version. Possible values include: '9.5', - * '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when connect - * to server. Possible values include: 'Enabled', 'Disabled' - * @member {string} [userVisibleState] A state of a server that is visible to - * user. Possible values include: 'Ready', 'Dropping', 'Disabled' - * @member {string} [fullyQualifiedDomainName] The fully qualified domain name - * of a server. - * @member {date} [earliestRestoreDate] Earliest restore point creation time - * (ISO8601 format) - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention days - * for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant or - * not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a - * server. */ export interface Server extends TrackedResource { + /** + * The SKU (pricing tier) of the server. + */ sku?: Sku; + /** + * The administrator's login name of a server. Can only be specified when the server is being + * created (and is required for creation). + */ administratorLogin?: string; + /** + * Server version. Possible values include: '9.5', '9.6', '10', '10.0', '10.2' + */ version?: string; + /** + * Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', + * 'Disabled' + */ sslEnforcement?: string; + /** + * A state of a server that is visible to user. Possible values include: 'Ready', 'Dropping', + * 'Disabled' + */ userVisibleState?: string; + /** + * The fully qualified domain name of a server. + */ fullyQualifiedDomainName?: string; + /** + * Earliest restore point creation time (ISO8601 format) + */ earliestRestoreDate?: Date; + /** + * Storage profile of a server. + */ storageProfile?: StorageProfile; + /** + * The replication role of the server. + */ + replicationRole?: string; + /** + * The master server id of a replica server. + */ + masterServerId?: string; + /** + * The maximum number of replicas that a master server can have. + */ + replicaCapacity?: number; } /** - * @class - * Initializes a new instance of the ServerForCreate class. - * @constructor * Represents a server to be created. - * - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family + - * cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. - * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing - * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource as - * appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {object} properties Properties of the server. - * @member {string} [properties.version] Server version. Possible values - * include: '9.5', '9.6', '10', '10.0', '10.2' - * @member {string} [properties.sslEnforcement] Enable ssl enforcement or not - * when connect to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [properties.storageProfile] Storage profile of a server. - * @member {number} [properties.storageProfile.backupRetentionDays] Backup - * retention days for the server. - * @member {string} [properties.storageProfile.geoRedundantBackup] Enable - * Geo-redundant or not for server backup. Possible values include: 'Enabled', - * 'Disabled' - * @member {number} [properties.storageProfile.storageMB] Max storage allowed - * for a server. - * @member {string} [properties.createMode] Polymorphic Discriminator - * @member {string} location The location the resource resides in. - * @member {object} [tags] Application-specific metadata in the form of - * key-value pairs. */ export interface ServerForCreate { + /** + * The SKU (pricing tier) of the server. + */ sku?: Sku; + /** + * Properties of the server. + */ properties: ServerPropertiesForCreate; + /** + * The location the resource resides in. + */ location: string; + /** + * Application-specific metadata in the form of key-value pairs. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the ServerUpdateParameters class. - * @constructor - * Parameters allowd to update for a server. - * - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family + - * cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. - * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing - * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource as - * appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention days - * for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant or - * not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a - * server. - * @member {string} [administratorLoginPassword] The password of the - * administrator login. - * @member {string} [version] The version of a server. Possible values include: - * '9.5', '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when connect - * to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [tags] Application-specific metadata in the form of - * key-value pairs. + * Parameters allowed to update for a server. */ export interface ServerUpdateParameters { + /** + * The SKU (pricing tier) of the server. + */ sku?: Sku; + /** + * Storage profile of a server. + */ storageProfile?: StorageProfile; + /** + * The password of the administrator login. + */ administratorLoginPassword?: string; + /** + * The version of a server. Possible values include: '9.5', '9.6', '10', '10.0', '10.2' + */ version?: string; + /** + * Enable ssl enforcement or not when connect to server. Possible values include: 'Enabled', + * 'Disabled' + */ sslEnforcement?: string; + /** + * Application-specific metadata in the form of key-value pairs. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the FirewallRule class. - * @constructor * Represents a server firewall rule. - * - * @member {string} startIpAddress The start IP address of the server firewall - * rule. Must be IPv4 format. - * @member {string} endIpAddress The end IP address of the server firewall - * rule. Must be IPv4 format. */ export interface FirewallRule extends ProxyResource { + /** + * The start IP address of the server firewall rule. Must be IPv4 format. + */ startIpAddress: string; + /** + * The end IP address of the server firewall rule. Must be IPv4 format. + */ endIpAddress: string; } /** - * @class - * Initializes a new instance of the VirtualNetworkRule class. - * @constructor * A virtual network rule. - * - * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual - * network subnet. - * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. - * @member {string} [state] Virtual Network Rule State. Possible values - * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' */ export interface VirtualNetworkRule extends ProxyResource { + /** + * The ARM resource id of the virtual network subnet. + */ virtualNetworkSubnetId: string; + /** + * Create firewall rule before the virtual network has vnet service endpoint enabled. + */ ignoreMissingVnetServiceEndpoint?: boolean; + /** + * Virtual Network Rule State. Possible values include: 'Initializing', 'InProgress', 'Ready', + * 'Deleting', 'Unknown' + */ readonly state?: string; } /** - * @class - * Initializes a new instance of the Database class. - * @constructor * Represents a Database. - * - * @member {string} [charset] The charset of the database. - * @member {string} [collation] The collation of the database. */ export interface Database extends ProxyResource { + /** + * The charset of the database. + */ charset?: string; + /** + * The collation of the database. + */ collation?: string; } /** - * @class - * Initializes a new instance of the Configuration class. - * @constructor * Represents a Configuration. - * - * @member {string} [value] Value of the configuration. - * @member {string} [description] Description of the configuration. - * @member {string} [defaultValue] Default value of the configuration. - * @member {string} [dataType] Data type of the configuration. - * @member {string} [allowedValues] Allowed values of the configuration. - * @member {string} [source] Source of the configuration. */ export interface Configuration extends ProxyResource { + /** + * Value of the configuration. + */ value?: string; + /** + * Description of the configuration. + */ readonly description?: string; + /** + * Default value of the configuration. + */ readonly defaultValue?: string; + /** + * Data type of the configuration. + */ readonly dataType?: string; + /** + * Allowed values of the configuration. + */ readonly allowedValues?: string; + /** + * Source of the configuration. + */ source?: string; } /** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * Display metadata associated with the operation. - * - * @member {string} [provider] Operation resource provider name. - * @member {string} [resource] Resource on which the operation is performed. - * @member {string} [operation] Localized friendly name for the operation. - * @member {string} [description] Operation description. */ export interface OperationDisplay { + /** + * Operation resource provider name. + */ readonly provider?: string; + /** + * Resource on which the operation is performed. + */ readonly resource?: string; + /** + * Localized friendly name for the operation. + */ readonly operation?: string; + /** + * Operation description. + */ readonly description?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * REST API operation definition. - * - * @member {string} [name] The name of the operation being performed on this - * particular object. - * @member {object} [display] The localized display information for this - * particular operation or action. - * @member {string} [display.provider] Operation resource provider name. - * @member {string} [display.resource] Resource on which the operation is - * performed. - * @member {string} [display.operation] Localized friendly name for the - * operation. - * @member {string} [display.description] Operation description. - * @member {string} [origin] The intended executor of the operation. Possible - * values include: 'NotSpecified', 'user', 'system' - * @member {object} [properties] Additional descriptions for the operation. */ export interface Operation { + /** + * The name of the operation being performed on this particular object. + */ readonly name?: string; + /** + * The localized display information for this particular operation or action. + */ readonly display?: OperationDisplay; + /** + * The intended executor of the operation. Possible values include: 'NotSpecified', 'user', + * 'system' + */ readonly origin?: string; + /** + * Additional descriptions for the operation. + */ readonly properties?: { [propertyName: string]: any }; } /** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor * A list of resource provider operations. - * - * @member {array} [value] The list of resource provider operations. */ export interface OperationListResult { + /** + * The list of resource provider operations. + */ value?: Operation[]; } /** - * @class - * Initializes a new instance of the LogFile class. - * @constructor * Represents a log file. - * - * @member {number} [sizeInKB] Size of the log file. - * @member {date} [createdTime] Creation timestamp of the log file. - * @member {date} [lastModifiedTime] Last modified timestamp of the log file. - * @member {string} [logFileType] Type of the log file. - * @member {string} [url] The url to download the log file from. */ export interface LogFile extends ProxyResource { + /** + * Size of the log file. + */ sizeInKB?: number; + /** + * Creation timestamp of the log file. + */ readonly createdTime?: Date; + /** + * Last modified timestamp of the log file. + */ readonly lastModifiedTime?: Date; + /** + * Type of the log file. + */ logFileType?: string; + /** + * The url to download the log file from. + */ url?: string; } /** - * @class - * Initializes a new instance of the PerformanceTierServiceLevelObjectives class. - * @constructor * Service level objectives for performance tier. - * - * @member {string} [id] ID for the service level objective. - * @member {string} [edition] Edition of the performance tier. - * @member {number} [vCore] vCore associated with the service level objective - * @member {string} [hardwareGeneration] Hardware generation associated with - * the service level objective - * @member {number} [maxBackupRetentionDays] Maximum Backup retention in days - * for the performance tier edition - * @member {number} [minBackupRetentionDays] Minimum Backup retention in days - * for the performance tier edition - * @member {number} [maxStorageMB] Max storage allowed for a server. - * @member {number} [minStorageMB] Max storage allowed for a server. */ export interface PerformanceTierServiceLevelObjectives { + /** + * ID for the service level objective. + */ id?: string; + /** + * Edition of the performance tier. + */ edition?: string; + /** + * vCore associated with the service level objective + */ vCore?: number; + /** + * Hardware generation associated with the service level objective + */ hardwareGeneration?: string; + /** + * Maximum Backup retention in days for the performance tier edition + */ maxBackupRetentionDays?: number; + /** + * Minimum Backup retention in days for the performance tier edition + */ minBackupRetentionDays?: number; + /** + * Max storage allowed for a server. + */ maxStorageMB?: number; + /** + * Max storage allowed for a server. + */ minStorageMB?: number; } /** - * @class - * Initializes a new instance of the PerformanceTierProperties class. - * @constructor * Performance tier properties - * - * @member {string} [id] ID of the performance tier. - * @member {array} [serviceLevelObjectives] Service level objectives associated - * with the performance tier */ export interface PerformanceTierProperties { + /** + * ID of the performance tier. + */ id?: string; + /** + * Service level objectives associated with the performance tier + */ serviceLevelObjectives?: PerformanceTierServiceLevelObjectives[]; } /** - * @class - * Initializes a new instance of the NameAvailabilityRequest class. - * @constructor * Request from client to check resource name availability. - * - * @member {string} name Resource name to verify. - * @member {string} [type] Resource type used for verification. */ export interface NameAvailabilityRequest { + /** + * Resource name to verify. + */ name: string; + /** + * Resource type used for verification. + */ type?: string; } /** - * @class - * Initializes a new instance of the NameAvailability class. - * @constructor * Represents a resource name availability. - * - * @member {string} [message] Error Message. - * @member {boolean} [nameAvailable] Indicates whether the resource name is - * available. - * @member {string} [reason] Reason for name being unavailable. */ export interface NameAvailability { + /** + * Error Message. + */ message?: string; + /** + * Indicates whether the resource name is available. + */ nameAvailable?: boolean; + /** + * Reason for name being unavailable. + */ reason?: string; } /** - * @class - * Initializes a new instance of the ServerSecurityAlertPolicy class. - * @constructor * A server security alert policy. - * - * @member {string} state Specifies the state of the policy, whether it is - * enabled or disabled. Possible values include: 'Enabled', 'Disabled' - * @member {array} [disabledAlerts] Specifies an array of alerts that are - * disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - * Access_Anomaly - * @member {array} [emailAddresses] Specifies an array of e-mail addresses to - * which the alert is sent. - * @member {boolean} [emailAccountAdmins] Specifies that the alert is sent to - * the account administrators. - * @member {string} [storageEndpoint] Specifies the blob storage endpoint (e.g. - * https://MyAccount.blob.core.windows.net). This blob storage will hold all - * Threat Detection audit logs. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the Threat Detection audit storage account. - * @member {number} [retentionDays] Specifies the number of days to keep in the - * Threat Detection audit logs. */ export interface ServerSecurityAlertPolicy extends ProxyResource { + /** + * Specifies the state of the policy, whether it is enabled or disabled. Possible values include: + * 'Enabled', 'Disabled' + */ state: string; + /** + * Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly + */ disabledAlerts?: string[]; + /** + * Specifies an array of e-mail addresses to which the alert is sent. + */ emailAddresses?: string[]; + /** + * Specifies that the alert is sent to the account administrators. + */ emailAccountAdmins?: boolean; + /** + * Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob + * storage will hold all Threat Detection audit logs. + */ storageEndpoint?: string; + /** + * Specifies the identifier key of the Threat Detection audit storage account. + */ storageAccountAccessKey?: string; + /** + * Specifies the number of days to keep in the Threat Detection audit logs. + */ retentionDays?: number; } - /** - * @class - * Initializes a new instance of the ServerListResult class. - * @constructor * A list of servers. - * */ export interface ServerListResult extends Array { } /** - * @class - * Initializes a new instance of the FirewallRuleListResult class. - * @constructor * A list of firewall rules. - * */ export interface FirewallRuleListResult extends Array { } /** - * @class - * Initializes a new instance of the VirtualNetworkRuleListResult class. - * @constructor * A list of virtual network rules. - * - * @member {string} [nextLink] Link to retrieve next page of results. */ export interface VirtualNetworkRuleListResult extends Array { + /** + * Link to retrieve next page of results. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the DatabaseListResult class. - * @constructor * A List of databases. - * */ export interface DatabaseListResult extends Array { } /** - * @class - * Initializes a new instance of the ConfigurationListResult class. - * @constructor * A list of server configurations. - * */ export interface ConfigurationListResult extends Array { } /** - * @class - * Initializes a new instance of the LogFileListResult class. - * @constructor * A list of log files. - * */ export interface LogFileListResult extends Array { } /** - * @class - * Initializes a new instance of the PerformanceTierListResult class. - * @constructor * A list of performance tiers. - * */ export interface PerformanceTierListResult extends Array { } diff --git a/lib/services/postgresqlManagement/lib/models/index.js b/lib/services/postgresqlManagement/lib/models/index.js index bde5b92b6c..d9d86b3131 100755 --- a/lib/services/postgresqlManagement/lib/models/index.js +++ b/lib/services/postgresqlManagement/lib/models/index.js @@ -25,6 +25,7 @@ exports.ServerPropertiesForCreate = require('./serverPropertiesForCreate'); exports.ServerPropertiesForDefaultCreate = require('./serverPropertiesForDefaultCreate'); exports.ServerPropertiesForRestore = require('./serverPropertiesForRestore'); exports.ServerPropertiesForGeoRestore = require('./serverPropertiesForGeoRestore'); +exports.ServerPropertiesForReplica = require('./serverPropertiesForReplica'); exports.Sku = require('./sku'); exports.Server = require('./server'); exports.ServerForCreate = require('./serverForCreate'); @@ -53,5 +54,6 @@ exports.discriminators = { 'ServerPropertiesForCreate' : exports.ServerPropertiesForCreate, 'ServerPropertiesForCreate.Default' : exports.ServerPropertiesForDefaultCreate, 'ServerPropertiesForCreate.PointInTimeRestore' : exports.ServerPropertiesForRestore, - 'ServerPropertiesForCreate.GeoRestore' : exports.ServerPropertiesForGeoRestore + 'ServerPropertiesForCreate.GeoRestore' : exports.ServerPropertiesForGeoRestore, + 'ServerPropertiesForCreate.Replica' : exports.ServerPropertiesForReplica }; diff --git a/lib/services/postgresqlManagement/lib/models/logFile.js b/lib/services/postgresqlManagement/lib/models/logFile.js index 18fa915e88..6fdaca7d44 100755 --- a/lib/services/postgresqlManagement/lib/models/logFile.js +++ b/lib/services/postgresqlManagement/lib/models/logFile.js @@ -20,11 +20,12 @@ const models = require('./index'); class LogFile extends models['ProxyResource'] { /** * Create a LogFile. - * @member {number} [sizeInKB] Size of the log file. - * @member {date} [createdTime] Creation timestamp of the log file. - * @member {date} [lastModifiedTime] Last modified timestamp of the log file. - * @member {string} [logFileType] Type of the log file. - * @member {string} [url] The url to download the log file from. + * @property {number} [sizeInKB] Size of the log file. + * @property {date} [createdTime] Creation timestamp of the log file. + * @property {date} [lastModifiedTime] Last modified timestamp of the log + * file. + * @property {string} [logFileType] Type of the log file. + * @property {string} [url] The url to download the log file from. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/models/nameAvailability.js b/lib/services/postgresqlManagement/lib/models/nameAvailability.js index 8a470f1501..4c8c8b9cc2 100644 --- a/lib/services/postgresqlManagement/lib/models/nameAvailability.js +++ b/lib/services/postgresqlManagement/lib/models/nameAvailability.js @@ -17,10 +17,10 @@ class NameAvailability { /** * Create a NameAvailability. - * @member {string} [message] Error Message. - * @member {boolean} [nameAvailable] Indicates whether the resource name is + * @property {string} [message] Error Message. + * @property {boolean} [nameAvailable] Indicates whether the resource name is * available. - * @member {string} [reason] Reason for name being unavailable. + * @property {string} [reason] Reason for name being unavailable. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/nameAvailabilityRequest.js b/lib/services/postgresqlManagement/lib/models/nameAvailabilityRequest.js index 0384b36691..ad02a90a7a 100644 --- a/lib/services/postgresqlManagement/lib/models/nameAvailabilityRequest.js +++ b/lib/services/postgresqlManagement/lib/models/nameAvailabilityRequest.js @@ -17,8 +17,8 @@ class NameAvailabilityRequest { /** * Create a NameAvailabilityRequest. - * @member {string} name Resource name to verify. - * @member {string} [type] Resource type used for verification. + * @property {string} name Resource name to verify. + * @property {string} [type] Resource type used for verification. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/operation.js b/lib/services/postgresqlManagement/lib/models/operation.js index cda82f7f37..9ec40e4b1c 100755 --- a/lib/services/postgresqlManagement/lib/models/operation.js +++ b/lib/services/postgresqlManagement/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * REST API operation definition. * @@ -19,19 +17,19 @@ const models = require('./index'); class Operation { /** * Create a Operation. - * @member {string} [name] The name of the operation being performed on this - * particular object. - * @member {object} [display] The localized display information for this + * @property {string} [name] The name of the operation being performed on + * this particular object. + * @property {object} [display] The localized display information for this * particular operation or action. - * @member {string} [display.provider] Operation resource provider name. - * @member {string} [display.resource] Resource on which the operation is + * @property {string} [display.provider] Operation resource provider name. + * @property {string} [display.resource] Resource on which the operation is * performed. - * @member {string} [display.operation] Localized friendly name for the + * @property {string} [display.operation] Localized friendly name for the * operation. - * @member {string} [display.description] Operation description. - * @member {string} [origin] The intended executor of the operation. Possible - * values include: 'NotSpecified', 'user', 'system' - * @member {object} [properties] Additional descriptions for the operation. + * @property {string} [display.description] Operation description. + * @property {string} [origin] The intended executor of the operation. + * Possible values include: 'NotSpecified', 'user', 'system' + * @property {object} [properties] Additional descriptions for the operation. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/operationDisplay.js b/lib/services/postgresqlManagement/lib/models/operationDisplay.js index 074b940db7..bae39ab37c 100755 --- a/lib/services/postgresqlManagement/lib/models/operationDisplay.js +++ b/lib/services/postgresqlManagement/lib/models/operationDisplay.js @@ -17,10 +17,11 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] Operation resource provider name. - * @member {string} [resource] Resource on which the operation is performed. - * @member {string} [operation] Localized friendly name for the operation. - * @member {string} [description] Operation description. + * @property {string} [provider] Operation resource provider name. + * @property {string} [resource] Resource on which the operation is + * performed. + * @property {string} [operation] Localized friendly name for the operation. + * @property {string} [description] Operation description. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/operationListResult.js b/lib/services/postgresqlManagement/lib/models/operationListResult.js index f890bd1f3e..32d2ab1400 100755 --- a/lib/services/postgresqlManagement/lib/models/operationListResult.js +++ b/lib/services/postgresqlManagement/lib/models/operationListResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A list of resource provider operations. * @@ -19,7 +17,7 @@ const models = require('./index'); class OperationListResult { /** * Create a OperationListResult. - * @member {array} [value] The list of resource provider operations. + * @property {array} [value] The list of resource provider operations. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/performanceTierProperties.js b/lib/services/postgresqlManagement/lib/models/performanceTierProperties.js index edd69a1229..e534ce715b 100644 --- a/lib/services/postgresqlManagement/lib/models/performanceTierProperties.js +++ b/lib/services/postgresqlManagement/lib/models/performanceTierProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Performance tier properties * @@ -19,8 +17,8 @@ const models = require('./index'); class PerformanceTierProperties { /** * Create a PerformanceTierProperties. - * @member {string} [id] ID of the performance tier. - * @member {array} [serviceLevelObjectives] Service level objectives + * @property {string} [id] ID of the performance tier. + * @property {array} [serviceLevelObjectives] Service level objectives * associated with the performance tier */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/performanceTierServiceLevelObjectives.js b/lib/services/postgresqlManagement/lib/models/performanceTierServiceLevelObjectives.js index 13493d1388..1537d9530e 100644 --- a/lib/services/postgresqlManagement/lib/models/performanceTierServiceLevelObjectives.js +++ b/lib/services/postgresqlManagement/lib/models/performanceTierServiceLevelObjectives.js @@ -17,17 +17,18 @@ class PerformanceTierServiceLevelObjectives { /** * Create a PerformanceTierServiceLevelObjectives. - * @member {string} [id] ID for the service level objective. - * @member {string} [edition] Edition of the performance tier. - * @member {number} [vCore] vCore associated with the service level objective - * @member {string} [hardwareGeneration] Hardware generation associated with - * the service level objective - * @member {number} [maxBackupRetentionDays] Maximum Backup retention in days - * for the performance tier edition - * @member {number} [minBackupRetentionDays] Minimum Backup retention in days - * for the performance tier edition - * @member {number} [maxStorageMB] Max storage allowed for a server. - * @member {number} [minStorageMB] Max storage allowed for a server. + * @property {string} [id] ID for the service level objective. + * @property {string} [edition] Edition of the performance tier. + * @property {number} [vCore] vCore associated with the service level + * objective + * @property {string} [hardwareGeneration] Hardware generation associated + * with the service level objective + * @property {number} [maxBackupRetentionDays] Maximum Backup retention in + * days for the performance tier edition + * @property {number} [minBackupRetentionDays] Minimum Backup retention in + * days for the performance tier edition + * @property {number} [maxStorageMB] Max storage allowed for a server. + * @property {number} [minStorageMB] Max storage allowed for a server. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/proxyResource.js b/lib/services/postgresqlManagement/lib/models/proxyResource.js index febc75adc2..74d2004e68 100755 --- a/lib/services/postgresqlManagement/lib/models/proxyResource.js +++ b/lib/services/postgresqlManagement/lib/models/proxyResource.js @@ -20,9 +20,9 @@ const models = require('./index'); class ProxyResource extends models['BaseResource'] { /** * Create a ProxyResource. - * @member {string} [id] Resource ID - * @member {string} [name] Resource name. - * @member {string} [type] Resource type. + * @property {string} [id] Resource ID + * @property {string} [name] Resource name. + * @property {string} [type] Resource type. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/models/server.js b/lib/services/postgresqlManagement/lib/models/server.js index 2ee787ed55..980c01abcf 100755 --- a/lib/services/postgresqlManagement/lib/models/server.js +++ b/lib/services/postgresqlManagement/lib/models/server.js @@ -20,36 +20,42 @@ const models = require('./index'); class Server extends models['TrackedResource'] { /** * Create a Server. - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family - * + cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. + * @property {object} [sku] The SKU (pricing tier) of the server. + * @property {string} [sku.name] The name of the sku, typically, tier + + * family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * @property {string} [sku.tier] The tier of the particular SKU, e.g. Basic. * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing + * @property {number} [sku.capacity] The scale up/out capacity, representing * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource + * @property {string} [sku.size] The size code, to be interpreted by resource * as appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {string} [administratorLogin] The administrator's login name of a - * server. Can only be specified when the server is being created (and is + * @property {string} [sku.family] The family of hardware. + * @property {string} [administratorLogin] The administrator's login name of + * a server. Can only be specified when the server is being created (and is * required for creation). - * @member {string} [version] Server version. Possible values include: '9.5', - * '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when + * @property {string} [version] Server version. Possible values include: + * '9.5', '9.6', '10', '10.0', '10.2' + * @property {string} [sslEnforcement] Enable ssl enforcement or not when * connect to server. Possible values include: 'Enabled', 'Disabled' - * @member {string} [userVisibleState] A state of a server that is visible to - * user. Possible values include: 'Ready', 'Dropping', 'Disabled' - * @member {string} [fullyQualifiedDomainName] The fully qualified domain + * @property {string} [userVisibleState] A state of a server that is visible + * to user. Possible values include: 'Ready', 'Dropping', 'Disabled' + * @property {string} [fullyQualifiedDomainName] The fully qualified domain * name of a server. - * @member {date} [earliestRestoreDate] Earliest restore point creation time - * (ISO8601 format) - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention + * @property {date} [earliestRestoreDate] Earliest restore point creation + * time (ISO8601 format) + * @property {object} [storageProfile] Storage profile of a server. + * @property {number} [storageProfile.backupRetentionDays] Backup retention * days for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant - * or not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a + * @property {string} [storageProfile.geoRedundantBackup] Enable + * Geo-redundant or not for server backup. Possible values include: + * 'Enabled', 'Disabled' + * @property {number} [storageProfile.storageMB] Max storage allowed for a * server. + * @property {string} [replicationRole] The replication role of the server. + * @property {string} [masterServerId] The master server id of a replica + * server. + * @property {number} [replicaCapacity] The maximum number of replicas that a + * master server can have. */ constructor() { super(); @@ -172,6 +178,30 @@ class Server extends models['TrackedResource'] { name: 'Composite', className: 'StorageProfile' } + }, + replicationRole: { + required: false, + serializedName: 'properties.replicationRole', + type: { + name: 'String' + } + }, + masterServerId: { + required: false, + serializedName: 'properties.masterServerId', + type: { + name: 'String' + } + }, + replicaCapacity: { + required: false, + serializedName: 'properties.replicaCapacity', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/postgresqlManagement/lib/models/serverForCreate.js b/lib/services/postgresqlManagement/lib/models/serverForCreate.js index ec9d147fb6..2a208f27c0 100755 --- a/lib/services/postgresqlManagement/lib/models/serverForCreate.js +++ b/lib/services/postgresqlManagement/lib/models/serverForCreate.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents a server to be created. * @@ -19,32 +17,33 @@ const models = require('./index'); class ServerForCreate { /** * Create a ServerForCreate. - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family - * + cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. + * @property {object} [sku] The SKU (pricing tier) of the server. + * @property {string} [sku.name] The name of the sku, typically, tier + + * family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * @property {string} [sku.tier] The tier of the particular SKU, e.g. Basic. * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing + * @property {number} [sku.capacity] The scale up/out capacity, representing * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource + * @property {string} [sku.size] The size code, to be interpreted by resource * as appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {object} properties Properties of the server. - * @member {string} [properties.version] Server version. Possible values + * @property {string} [sku.family] The family of hardware. + * @property {object} properties Properties of the server. + * @property {string} [properties.version] Server version. Possible values * include: '9.5', '9.6', '10', '10.0', '10.2' - * @member {string} [properties.sslEnforcement] Enable ssl enforcement or not - * when connect to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [properties.storageProfile] Storage profile of a server. - * @member {number} [properties.storageProfile.backupRetentionDays] Backup + * @property {string} [properties.sslEnforcement] Enable ssl enforcement or + * not when connect to server. Possible values include: 'Enabled', 'Disabled' + * @property {object} [properties.storageProfile] Storage profile of a + * server. + * @property {number} [properties.storageProfile.backupRetentionDays] Backup * retention days for the server. - * @member {string} [properties.storageProfile.geoRedundantBackup] Enable + * @property {string} [properties.storageProfile.geoRedundantBackup] Enable * Geo-redundant or not for server backup. Possible values include: * 'Enabled', 'Disabled' - * @member {number} [properties.storageProfile.storageMB] Max storage allowed - * for a server. - * @member {string} [properties.createMode] Polymorphic Discriminator - * @member {string} location The location the resource resides in. - * @member {object} [tags] Application-specific metadata in the form of + * @property {number} [properties.storageProfile.storageMB] Max storage + * allowed for a server. + * @property {string} [properties.createMode] Polymorphic Discriminator + * @property {string} location The location the resource resides in. + * @property {object} [tags] Application-specific metadata in the form of * key-value pairs. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/serverPropertiesForCreate.js b/lib/services/postgresqlManagement/lib/models/serverPropertiesForCreate.js index c5b5ff326c..0dc0e3de3f 100755 --- a/lib/services/postgresqlManagement/lib/models/serverPropertiesForCreate.js +++ b/lib/services/postgresqlManagement/lib/models/serverPropertiesForCreate.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties used to create a new server. * @@ -19,18 +17,19 @@ const models = require('./index'); class ServerPropertiesForCreate { /** * Create a ServerPropertiesForCreate. - * @member {string} [version] Server version. Possible values include: '9.5', - * '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when + * @property {string} [version] Server version. Possible values include: + * '9.5', '9.6', '10', '10.0', '10.2' + * @property {string} [sslEnforcement] Enable ssl enforcement or not when * connect to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention + * @property {object} [storageProfile] Storage profile of a server. + * @property {number} [storageProfile.backupRetentionDays] Backup retention * days for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant - * or not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a + * @property {string} [storageProfile.geoRedundantBackup] Enable + * Geo-redundant or not for server backup. Possible values include: + * 'Enabled', 'Disabled' + * @property {number} [storageProfile.storageMB] Max storage allowed for a * server. - * @member {string} createMode Polymorphic Discriminator + * @property {string} createMode Polymorphic Discriminator */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/serverPropertiesForDefaultCreate.js b/lib/services/postgresqlManagement/lib/models/serverPropertiesForDefaultCreate.js index 55ae2939e6..636897ed75 100755 --- a/lib/services/postgresqlManagement/lib/models/serverPropertiesForDefaultCreate.js +++ b/lib/services/postgresqlManagement/lib/models/serverPropertiesForDefaultCreate.js @@ -20,10 +20,10 @@ const models = require('./index'); class ServerPropertiesForDefaultCreate extends models['ServerPropertiesForCreate'] { /** * Create a ServerPropertiesForDefaultCreate. - * @member {string} administratorLogin The administrator's login name of a + * @property {string} administratorLogin The administrator's login name of a * server. Can only be specified when the server is being created (and is * required for creation). - * @member {string} administratorLoginPassword The password of the + * @property {string} administratorLoginPassword The password of the * administrator login. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/serverPropertiesForGeoRestore.js b/lib/services/postgresqlManagement/lib/models/serverPropertiesForGeoRestore.js index f4b909b096..55bf1b26a5 100644 --- a/lib/services/postgresqlManagement/lib/models/serverPropertiesForGeoRestore.js +++ b/lib/services/postgresqlManagement/lib/models/serverPropertiesForGeoRestore.js @@ -21,7 +21,7 @@ const models = require('./index'); class ServerPropertiesForGeoRestore extends models['ServerPropertiesForCreate'] { /** * Create a ServerPropertiesForGeoRestore. - * @member {string} sourceServerId The source server id to restore from. + * @property {string} sourceServerId The source server id to restore from. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/models/serverPropertiesForReplica.js b/lib/services/postgresqlManagement/lib/models/serverPropertiesForReplica.js new file mode 100644 index 0000000000..b41b570f94 --- /dev/null +++ b/lib/services/postgresqlManagement/lib/models/serverPropertiesForReplica.js @@ -0,0 +1,93 @@ +/* + * 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'; + +const models = require('./index'); + +/** + * The properties to create a new replica. + * + * @extends models['ServerPropertiesForCreate'] + */ +class ServerPropertiesForReplica extends models['ServerPropertiesForCreate'] { + /** + * Create a ServerPropertiesForReplica. + * @property {string} sourceServerId The master server id to create replica + * from. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerPropertiesForReplica + * + * @returns {object} metadata of ServerPropertiesForReplica + * + */ + mapper() { + return { + required: false, + serializedName: 'Replica', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'createMode', + clientName: 'createMode' + }, + uberParent: 'ServerPropertiesForCreate', + className: 'ServerPropertiesForReplica', + modelProperties: { + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + }, + sslEnforcement: { + required: false, + serializedName: 'sslEnforcement', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + storageProfile: { + required: false, + serializedName: 'storageProfile', + type: { + name: 'Composite', + className: 'StorageProfile' + } + }, + createMode: { + required: true, + serializedName: 'createMode', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sourceServerId: { + required: true, + serializedName: 'sourceServerId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerPropertiesForReplica; diff --git a/lib/services/postgresqlManagement/lib/models/serverPropertiesForRestore.js b/lib/services/postgresqlManagement/lib/models/serverPropertiesForRestore.js index ab3576dc01..def51b0a2c 100755 --- a/lib/services/postgresqlManagement/lib/models/serverPropertiesForRestore.js +++ b/lib/services/postgresqlManagement/lib/models/serverPropertiesForRestore.js @@ -20,8 +20,8 @@ const models = require('./index'); class ServerPropertiesForRestore extends models['ServerPropertiesForCreate'] { /** * Create a ServerPropertiesForRestore. - * @member {string} sourceServerId The source server id to restore from. - * @member {date} restorePointInTime Restore point creation time (ISO8601 + * @property {string} sourceServerId The source server id to restore from. + * @property {date} restorePointInTime Restore point creation time (ISO8601 * format), specifying the time to restore from. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/serverSecurityAlertPolicy.js b/lib/services/postgresqlManagement/lib/models/serverSecurityAlertPolicy.js index bbe37cd620..6786f81742 100644 --- a/lib/services/postgresqlManagement/lib/models/serverSecurityAlertPolicy.js +++ b/lib/services/postgresqlManagement/lib/models/serverSecurityAlertPolicy.js @@ -20,21 +20,21 @@ const models = require('./index'); class ServerSecurityAlertPolicy extends models['ProxyResource'] { /** * Create a ServerSecurityAlertPolicy. - * @member {string} state Specifies the state of the policy, whether it is + * @property {string} state Specifies the state of the policy, whether it is * enabled or disabled. Possible values include: 'Enabled', 'Disabled' - * @member {array} [disabledAlerts] Specifies an array of alerts that are + * @property {array} [disabledAlerts] Specifies an array of alerts that are * disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, * Access_Anomaly - * @member {array} [emailAddresses] Specifies an array of e-mail addresses to - * which the alert is sent. - * @member {boolean} [emailAccountAdmins] Specifies that the alert is sent to - * the account administrators. - * @member {string} [storageEndpoint] Specifies the blob storage endpoint + * @property {array} [emailAddresses] Specifies an array of e-mail addresses + * to which the alert is sent. + * @property {boolean} [emailAccountAdmins] Specifies that the alert is sent + * to the account administrators. + * @property {string} [storageEndpoint] Specifies the blob storage endpoint * (e.g. https://MyAccount.blob.core.windows.net). This blob storage will * hold all Threat Detection audit logs. - * @member {string} [storageAccountAccessKey] Specifies the identifier key of - * the Threat Detection audit storage account. - * @member {number} [retentionDays] Specifies the number of days to keep in + * @property {string} [storageAccountAccessKey] Specifies the identifier key + * of the Threat Detection audit storage account. + * @property {number} [retentionDays] Specifies the number of days to keep in * the Threat Detection audit logs. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/serverUpdateParameters.js b/lib/services/postgresqlManagement/lib/models/serverUpdateParameters.js index 0f387bdac3..33e9c2cb17 100755 --- a/lib/services/postgresqlManagement/lib/models/serverUpdateParameters.js +++ b/lib/services/postgresqlManagement/lib/models/serverUpdateParameters.js @@ -10,39 +10,38 @@ 'use strict'; -const models = require('./index'); - /** - * Parameters allowd to update for a server. + * Parameters allowed to update for a server. * */ class ServerUpdateParameters { /** * Create a ServerUpdateParameters. - * @member {object} [sku] The SKU (pricing tier) of the server. - * @member {string} [sku.name] The name of the sku, typically, tier + family - * + cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic. + * @property {object} [sku] The SKU (pricing tier) of the server. + * @property {string} [sku.name] The name of the sku, typically, tier + + * family + cores, e.g. B_Gen4_1, GP_Gen5_8. + * @property {string} [sku.tier] The tier of the particular SKU, e.g. Basic. * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [sku.capacity] The scale up/out capacity, representing + * @property {number} [sku.capacity] The scale up/out capacity, representing * server's compute units. - * @member {string} [sku.size] The size code, to be interpreted by resource + * @property {string} [sku.size] The size code, to be interpreted by resource * as appropriate. - * @member {string} [sku.family] The family of hardware. - * @member {object} [storageProfile] Storage profile of a server. - * @member {number} [storageProfile.backupRetentionDays] Backup retention + * @property {string} [sku.family] The family of hardware. + * @property {object} [storageProfile] Storage profile of a server. + * @property {number} [storageProfile.backupRetentionDays] Backup retention * days for the server. - * @member {string} [storageProfile.geoRedundantBackup] Enable Geo-redundant - * or not for server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageProfile.storageMB] Max storage allowed for a + * @property {string} [storageProfile.geoRedundantBackup] Enable + * Geo-redundant or not for server backup. Possible values include: + * 'Enabled', 'Disabled' + * @property {number} [storageProfile.storageMB] Max storage allowed for a * server. - * @member {string} [administratorLoginPassword] The password of the + * @property {string} [administratorLoginPassword] The password of the * administrator login. - * @member {string} [version] The version of a server. Possible values + * @property {string} [version] The version of a server. Possible values * include: '9.5', '9.6', '10', '10.0', '10.2' - * @member {string} [sslEnforcement] Enable ssl enforcement or not when + * @property {string} [sslEnforcement] Enable ssl enforcement or not when * connect to server. Possible values include: 'Enabled', 'Disabled' - * @member {object} [tags] Application-specific metadata in the form of + * @property {object} [tags] Application-specific metadata in the form of * key-value pairs. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/sku.js b/lib/services/postgresqlManagement/lib/models/sku.js index 8bfd1c8ece..d9a641094d 100755 --- a/lib/services/postgresqlManagement/lib/models/sku.js +++ b/lib/services/postgresqlManagement/lib/models/sku.js @@ -17,15 +17,15 @@ class Sku { /** * Create a Sku. - * @member {string} [name] The name of the sku, typically, tier + family + + * @property {string} [name] The name of the sku, typically, tier + family + * cores, e.g. B_Gen4_1, GP_Gen5_8. - * @member {string} [tier] The tier of the particular SKU, e.g. Basic. + * @property {string} [tier] The tier of the particular SKU, e.g. Basic. * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized' - * @member {number} [capacity] The scale up/out capacity, representing + * @property {number} [capacity] The scale up/out capacity, representing * server's compute units. - * @member {string} [size] The size code, to be interpreted by resource as + * @property {string} [size] The size code, to be interpreted by resource as * appropriate. - * @member {string} [family] The family of hardware. + * @property {string} [family] The family of hardware. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/storageProfile.js b/lib/services/postgresqlManagement/lib/models/storageProfile.js index 196082d938..bf3fd729b3 100644 --- a/lib/services/postgresqlManagement/lib/models/storageProfile.js +++ b/lib/services/postgresqlManagement/lib/models/storageProfile.js @@ -17,11 +17,11 @@ class StorageProfile { /** * Create a StorageProfile. - * @member {number} [backupRetentionDays] Backup retention days for the + * @property {number} [backupRetentionDays] Backup retention days for the * server. - * @member {string} [geoRedundantBackup] Enable Geo-redundant or not for + * @property {string} [geoRedundantBackup] Enable Geo-redundant or not for * server backup. Possible values include: 'Enabled', 'Disabled' - * @member {number} [storageMB] Max storage allowed for a server. + * @property {number} [storageMB] Max storage allowed for a server. */ constructor() { } diff --git a/lib/services/postgresqlManagement/lib/models/trackedResource.js b/lib/services/postgresqlManagement/lib/models/trackedResource.js index 4868a7154a..324b2b5446 100755 --- a/lib/services/postgresqlManagement/lib/models/trackedResource.js +++ b/lib/services/postgresqlManagement/lib/models/trackedResource.js @@ -20,8 +20,8 @@ const models = require('./index'); class TrackedResource extends models['ProxyResource'] { /** * Create a TrackedResource. - * @member {string} location The location the resource resides in. - * @member {object} [tags] Application-specific metadata in the form of + * @property {string} location The location the resource resides in. + * @property {object} [tags] Application-specific metadata in the form of * key-value pairs. */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/virtualNetworkRule.js b/lib/services/postgresqlManagement/lib/models/virtualNetworkRule.js index c0f9a60278..80787c6b89 100644 --- a/lib/services/postgresqlManagement/lib/models/virtualNetworkRule.js +++ b/lib/services/postgresqlManagement/lib/models/virtualNetworkRule.js @@ -20,11 +20,11 @@ const models = require('./index'); class VirtualNetworkRule extends models['ProxyResource'] { /** * Create a VirtualNetworkRule. - * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual - * network subnet. - * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. - * @member {string} [state] Virtual Network Rule State. Possible values + * @property {string} virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * @property {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall + * rule before the virtual network has vnet service endpoint enabled. + * @property {string} [state] Virtual Network Rule State. Possible values * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' */ constructor() { diff --git a/lib/services/postgresqlManagement/lib/models/virtualNetworkRuleListResult.js b/lib/services/postgresqlManagement/lib/models/virtualNetworkRuleListResult.js index c80a275efd..48f0bd1d48 100644 --- a/lib/services/postgresqlManagement/lib/models/virtualNetworkRuleListResult.js +++ b/lib/services/postgresqlManagement/lib/models/virtualNetworkRuleListResult.js @@ -16,7 +16,7 @@ class VirtualNetworkRuleListResult extends Array { /** * Create a VirtualNetworkRuleListResult. - * @member {string} [nextLink] Link to retrieve next page of results. + * @property {string} [nextLink] Link to retrieve next page of results. */ constructor() { super(); diff --git a/lib/services/postgresqlManagement/lib/operations/index.d.ts b/lib/services/postgresqlManagement/lib/operations/index.d.ts index f13081d417..83b61d3b7e 100755 --- a/lib/services/postgresqlManagement/lib/operations/index.d.ts +++ b/lib/services/postgresqlManagement/lib/operations/index.d.ts @@ -564,6 +564,68 @@ export interface Servers { list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + restart(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Creates a new server, or will overwrite an existing server. * @@ -932,6 +994,140 @@ export interface Servers { beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestart(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + beginRestart(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Replicas + * __NOTE__: An instance of this class is automatically created for an + * instance of the PostgreSQLManagementClient. + */ +export interface Replicas { + + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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 {ServerListResult} - 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. + * + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} 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. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/postgresqlManagement/lib/operations/index.js b/lib/services/postgresqlManagement/lib/operations/index.js index 21ca13c36c..92ef405ca4 100755 --- a/lib/services/postgresqlManagement/lib/operations/index.js +++ b/lib/services/postgresqlManagement/lib/operations/index.js @@ -15,6 +15,7 @@ 'use strict'; exports.Servers = require('./servers'); +exports.Replicas = require('./replicas'); exports.FirewallRules = require('./firewallRules'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); exports.Databases = require('./databases'); diff --git a/lib/services/postgresqlManagement/lib/operations/replicas.js b/lib/services/postgresqlManagement/lib/operations/replicas.js new file mode 100644 index 0000000000..31cb334892 --- /dev/null +++ b/lib/services/postgresqlManagement/lib/operations/replicas.js @@ -0,0 +1,267 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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 ServerListResult} 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 _listByServer(resourceGroupName, serverName, 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 (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + 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.DBforPostgreSQL/servers/{serverName}/Replicas'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + 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 = 'GET'; + 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]; + } + } + } + httpRequest.body = null; + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ServerListResult']().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); + }); +} + +/** Class representing a Replicas. */ +class Replicas { + /** + * Create a Replicas. + * @param {PostgreSQLManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByServer = _listByServer; + } + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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 {ServerListResult} - 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 ServerListResult} 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. + */ + listByServer(resourceGroupName, serverName, 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._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + +} + +module.exports = Replicas; diff --git a/lib/services/postgresqlManagement/lib/operations/servers.js b/lib/services/postgresqlManagement/lib/operations/servers.js index dc7a5df3a8..ae3237574e 100755 --- a/lib/services/postgresqlManagement/lib/operations/servers.js +++ b/lib/services/postgresqlManagement/lib/operations/servers.js @@ -751,6 +751,71 @@ function _list(options, callback) { }); } + +/** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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 _restart(resourceGroupName, serverName, 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.'); + } + + // Send request + this.beginRestart(resourceGroupName, serverName, 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); + }); + }); +} + /** * Creates a new server, or will overwrite an existing server. * @@ -1316,6 +1381,135 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { }); } +/** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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, serverName, 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 (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + 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.DBforPostgreSQL/servers/{serverName}/restart'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + 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 = 'POST'; + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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; + + return callback(null, result, httpRequest, response); + }); +} + /** Class representing a Servers. */ class Servers { /** @@ -1330,9 +1524,11 @@ class Servers { this._get = _get; this._listByResourceGroup = _listByResourceGroup; this._list = _list; + this._restart = _restart; this._beginCreate = _beginCreate; this._beginUpdate = _beginUpdate; this._beginDeleteMethod = _beginDeleteMethod; + this._beginRestart = _beginRestart; } /** @@ -2040,6 +2236,95 @@ class Servers { } } + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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. + */ + restart(resourceGroupName, serverName, 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._restart(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, serverName, options, optionalCallback); + } + } + /** * Creates a new server, or will overwrite an existing server. * @@ -2491,6 +2776,95 @@ class Servers { } } + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestart(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Restarts a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @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, serverName, 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, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestart(resourceGroupName, serverName, options, optionalCallback); + } + } + } module.exports = Servers; diff --git a/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.d.ts b/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.d.ts index 1dff1ca59a..281e0a1052 100755 --- a/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.d.ts +++ b/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.d.ts @@ -57,6 +57,7 @@ export default class PostgreSQLManagementClient extends AzureServiceClient { // Operation groups servers: operations.Servers; + replicas: operations.Replicas; firewallRules: operations.FirewallRules; virtualNetworkRules: operations.VirtualNetworkRules; databases: operations.Databases; diff --git a/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.js b/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.js index c39ba8b36f..fb10fdb76f 100755 --- a/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.js +++ b/lib/services/postgresqlManagement/lib/postgreSQLManagementClient.js @@ -73,6 +73,7 @@ class PostgreSQLManagementClient extends ServiceClient { this.generateClientRequestId = options.generateClientRequestId; } this.servers = new operations.Servers(this); + this.replicas = new operations.Replicas(this); this.firewallRules = new operations.FirewallRules(this); this.virtualNetworkRules = new operations.VirtualNetworkRules(this); this.databases = new operations.Databases(this); diff --git a/lib/services/postgresqlManagement/package.json b/lib/services/postgresqlManagement/package.json index b72200e8eb..47fd8a6267 100644 --- a/lib/services/postgresqlManagement/package.json +++ b/lib/services/postgresqlManagement/package.json @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/postgreSQLManagementClient.js", "types": "./lib/postgreSQLManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/postgresqlManagement", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/postgresqlManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}