Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2580 from Azure/restapi_auto_2765
Browse files Browse the repository at this point in the history
[AutoPR postgresql/resource-manager/mysql/resource-manager] Add GeoRestore to MySQL and PostgreSQL
  • Loading branch information
Dan Schulte authored Mar 28, 2018
2 parents f7703f7 + e722efb commit 8dcf0a2
Show file tree
Hide file tree
Showing 37 changed files with 912 additions and 396 deletions.
4 changes: 4 additions & 0 deletions codegen_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@
"postgresql": {
"resource-manager": {
"packageName": "azure-arm-postgresql",
"packageVersion": "3.0.0-preview",
"generateLicenseTxt": true,
"generatePackageJson": true,
"generateReadmeMd": false,
"dir": "postgresqlManagement",
"source": "postgresql/resource-manager/readme.md"
}
Expand Down
15 changes: 14 additions & 1 deletion lib/services/mysqlManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface ServerPropertiesForDefaultCreate extends ServerPropertiesForCre
* @class
* Initializes a new instance of the ServerPropertiesForRestore class.
* @constructor
* The properties to a new server by restoring from a backup.
* 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
Expand All @@ -122,6 +122,19 @@ export interface ServerPropertiesForRestore extends ServerPropertiesForCreate {
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.
*/
export interface ServerPropertiesForGeoRestore extends ServerPropertiesForCreate {
sourceServerId: string;
}

/**
* @class
* Initializes a new instance of the Sku class.
Expand Down
4 changes: 3 additions & 1 deletion lib/services/mysqlManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ exports.StorageProfile = require('./storageProfile');
exports.ServerPropertiesForCreate = require('./serverPropertiesForCreate');
exports.ServerPropertiesForDefaultCreate = require('./serverPropertiesForDefaultCreate');
exports.ServerPropertiesForRestore = require('./serverPropertiesForRestore');
exports.ServerPropertiesForGeoRestore = require('./serverPropertiesForGeoRestore');
exports.Sku = require('./sku');
exports.Server = require('./server');
exports.ServerForCreate = require('./serverForCreate');
Expand All @@ -48,5 +49,6 @@ exports.PerformanceTierListResult = require('./performanceTierListResult');
exports.discriminators = {
'ServerPropertiesForCreate' : exports.ServerPropertiesForCreate,
'ServerPropertiesForCreate.Default' : exports.ServerPropertiesForDefaultCreate,
'ServerPropertiesForCreate.PointInTimeRestore' : exports.ServerPropertiesForRestore
'ServerPropertiesForCreate.PointInTimeRestore' : exports.ServerPropertiesForRestore,
'ServerPropertiesForCreate.GeoRestore' : exports.ServerPropertiesForGeoRestore
};
Original file line number Diff line number Diff line change
@@ -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 used to create a new server by restoring to a different
* region from a geo replicated backup.
*
* @extends models['ServerPropertiesForCreate']
*/
class ServerPropertiesForGeoRestore extends models['ServerPropertiesForCreate'] {
/**
* Create a ServerPropertiesForGeoRestore.
* @member {string} sourceServerId The source server id to restore from.
*/
constructor() {
super();
}

/**
* Defines the metadata of ServerPropertiesForGeoRestore
*
* @returns {object} metadata of ServerPropertiesForGeoRestore
*
*/
mapper() {
return {
required: false,
serializedName: 'GeoRestore',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: 'createMode',
clientName: 'createMode'
},
uberParent: 'ServerPropertiesForCreate',
className: 'ServerPropertiesForGeoRestore',
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 = ServerPropertiesForGeoRestore;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const models = require('./index');

/**
* The properties to a new server by restoring from a backup.
* The properties used to create a new server by restoring from a backup.
*
* @extends models['ServerPropertiesForCreate']
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/services/postgresqlManagement/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Microsoft
Copyright (c) 2018 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
Loading

0 comments on commit 8dcf0a2

Please sign in to comment.