Georestore command for MySQL and PostgreSQL CLI. (#118)

* Add georestore.

* Resolving comments.

* Resolve comments.

* Test update.

* Fix CI.

* Update index.json.

* Fix CI.
This commit is contained in:
Rohit Joy 2018-03-30 20:33:18 -07:00 коммит произвёл GitHub
Родитель fcee48b0b0
Коммит cf0d7b6c03
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
115 изменённых файлов: 3515 добавлений и 6726 удалений

Просмотреть файл

@ -415,9 +415,9 @@
],
"rdbms": [
{
"filename": "rdbms-0.0.4-py2.py3-none-any.whl",
"sha256Digest": "6e0f6d39c98c3a39c9664ed54576b2e0f1cd23b412b137f19815a276e7510350",
"downloadUrl": "https://prodrdbmsclipackages.blob.core.windows.net/cliextensions/rdbms-0.0.4-py2.py3-none-any.whl",
"filename": "rdbms-0.0.5-py2.py3-none-any.whl",
"sha256Digest": "2b587493a8e10738bb6f3f82cf9e26ebf32a509c162f7093b4cb8e99aff5072f",
"downloadUrl": "https://prodrdbmsclipackages.blob.core.windows.net/cliextensions/rdbms-0.0.5-py2.py3-none-any.whl",
"metadata": {
"classifiers": [
"Development Status :: 4 - Beta",
@ -453,8 +453,8 @@
"license": "MIT",
"metadata_version": "2.0",
"name": "rdbms",
"summary": "An Azure CLI Extension to manage Azure MySQL and Azure PostgreSQL resources",
"version": "0.0.4"
"summary": "An Azure CLI Extension providing support for Azure MySQL and Azure PostgreSQL.",
"version": "0.0.5"
}
}
],

Просмотреть файл

@ -9,16 +9,7 @@ from knack.help_files import helps
def add_helps(command_group, server_type):
helps['{}'.format(command_group)] = """
type: group
short-summary: Manage Azure Database for {} servers.
""".format(server_type)
helps['{} server'.format(command_group)] = """
type: group
short-summary: Manage {} servers.
""".format(server_type)
helps['{} server create'.format(command_group)] = """
type: command
short-summary: Create a server.
examples:
- name: Create a {0} server with only required paramaters in North Europe.
@ -31,153 +22,17 @@ def add_helps(command_group, server_type):
--sku-name B_Gen4_2 --ssl-enforcement Disabled \\
--storage-size 51200 --tags "key=value" --version {{server-version}}
""".format(server_type, command_group)
helps['{} server restore'.format(command_group)] = """
helps['{} server georestore'.format(command_group)] = """
type: command
short-summary: Restore a server from backup.
short-summary: Georestore a server from backup.
examples:
- name: Restore 'testsvr' as 'testsvrnew'.
text: az {0} server restore -g testgroup -n testsvrnew --source-server testsvr --restore-point-in-time "2017-06-15T13:10:00Z"
- name: Restore 'testsvr2' to 'testsvrnew', where 'testsvrnew' is in a different resource group than the backup.
- name: Georestore 'testsvr' as 'testsvrnew' where 'testsvrnew' is in same resource group as 'testsvr'.
text: az {0} server georestore -g testgroup -n testsvrnew --source-server testsvr -l westus2
- name: Georestore 'testsvr2' to 'testsvrnew', where 'testsvrnew' is in the different resource group as the original server.
text: |
az {0} server restore -g testgroup -n testsvrnew \\
-s "/subscriptions/${{SubID}}/resourceGroups/${{ResourceGroup}}/providers/Microsoft.DBfor{1}/servers/testsvr2" \\
--restore-point-in-time "2017-06-15T13:10:00Z"
az {0} server georestore -g testgroup -n testsvrnew \\
-s "/subscriptions/${{SubID}}/resourceGroups/${{ResourceGroup}}/providers/Microsoft.DBfor{1}/servers/testsvr2" -l westus2 --sku-name GP_Gen5_2
""".format(command_group, server_type)
helps['{} server update'.format(command_group)] = """
type: command
short-summary: Update a server.
examples:
- name: Update a server's vcore to 2.
text: az {0} server update -g testgroup -n testsvrnew --vcore 2
- name: Update a server's tags.
text: az {0} server update -g testgroup -n testsvrnew --tags "k1=v1" "k2=v2"
""".format(command_group)
helps['{} server delete'.format(command_group)] = """
type: command
short-summary: Delete a server.
"""
helps['{} server show'.format(command_group)] = """
type: command
short-summary: Get the details of a server.
"""
helps['{} server list'.format(command_group)] = """
type: command
short-summary: List available servers.
examples:
- name: List all {0} servers in a subscription.
text: az {1} server list
- name: List all {0} servers in a resource group.
text: az {1} server list -g testgroup
""".format(server_type, command_group)
helps['{} server firewall-rule'.format(command_group)] = """
type: group
short-summary: Manage firewall rules for a server.
"""
helps['{} server firewall-rule create'.format(command_group)] = """
type: command
short-summary: Create a new firewall rule for a server.
examples:
- name: Create a firewall rule allowing all connections from all IP addresses.
text: az {} server firewall-rule create -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.0 --end-ip-address 255.255.255.255
""".format(command_group)
helps['{} server firewall-rule update'.format(command_group)] = """
type: command
short-summary: Update a firewall rule.
examples:
- name: Update a firewall rule's start IP address.
text: az {0} server firewall-rule update -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.1
- name: Update a firewall rule's start and end IP address.
text: az {0} server firewall-rule update -g testgroup -s testsvr -n allowall --start-ip-address 0.0.0.1 --end-ip-address 255.255.255.254
""".format(command_group)
helps['{} server firewall-rule delete'.format(command_group)] = """
type: command
short-summary: Delete a firewall rule.
"""
helps['{} server firewall-rule show'.format(command_group)] = """
type: command
short-summary: Get the details of a firewall rule.
"""
helps['{} server firewall-rule list'.format(command_group)] = """
type: command
short-summary: List all firewall rules for a server.
"""
helps['{} server configuration'.format(command_group)] = """
type: group
short-summary: Manage configuration values for a server.
"""
helps['{} server configuration set'.format(command_group)] = """
type: command
short-summary: Update the configuration of a server.
examples:
- name: Set a new configuration value.
text: az {0} server configuration set -g testgroup -s testsvr -n {{config_name}} --value {{config_value}}
- name: Set a configuration value to its default.
text: az {0} server configuration set -g testgroup -s testsvr -n {{config_name}}
""".format(command_group)
helps['{} server configuration show'.format(command_group)] = """
type: command
short-summary: Get the configuration for a server."
"""
helps['{} server configuration list'.format(command_group)] = """
type: command
short-summary: List the configuration values for a server.
"""
helps['{} server-logs'.format(command_group)] = """
type: group
short-summary: Manage server logs.
"""
helps['{} server-logs list'.format(command_group)] = """
type: command
short-summary: List log files for a server.
examples:
- name: List log files for 'testsvr' modified in the last 72 hours (default value).
text: az {0} server-logs list -g testgroup -s testsvr
- name: List log files for 'testsvr' modified in the last 10 hours.
text: az {0} server-logs list -g testgroup -s testsvr --file-last-written 10
- name: List log files for 'testsvr' less than 30Kb in size.
text: az {0} server-logs list -g testgroup -s testsvr --max-file-size 30
""".format(command_group)
helps['{} server-logs download'.format(command_group)] = """
type: command
short-summary: Download log files.
examples:
- name: Download log files f1 and f2 to the current directory from the server 'testsvr'.
text: az {} server-logs download -g testgroup -s testsvr -n f1.log f2.log
""".format(command_group)
helps['{} db'.format(command_group)] = """
type: group
short-summary: Manage {0} databases on a server.
""".format(server_type)
helps['{} db create'.format(command_group)] = """
type: command
short-summary: Create a {0} database.
examples:
- name: Create database 'testdb' in the server 'testsvr' with the default parameters.
text: az {1} db create -g testgroup -s testsvr -n testdb
- name: Create database 'testdb' in server 'testsvr' with a given character set and collation rules.
text: az {1} db create -g testgroup -s testsvr -n testdb --charset {{valid_charset}} --collation {{valid_collation}}
""".format(server_type, command_group)
helps['{} db delete'.format(command_group)] = """
type: command
short-summary: Delete a database.
examples:
- name: Delete database 'testdb' in the server 'testsvr'.
text: az {0} db delete -g testgroup -s testsvr -n testdb
""".format(command_group)
helps['{} db show'.format(command_group)] = """
type: command
short-summary: Show the details of a database.
examples:
- name: Show database 'testdb' in the server 'testsvr'.
text: az {0} db show -g testgroup -s testsvr -n testdb
""".format(command_group)
helps['{} db list'.format(command_group)] = """
type: command
short-summary: List the databases for a server.
examples:
- name: List databases in the server 'testsvr'.
text: az {0} db list -g testgroup -s testsvr
""".format(command_group)
add_helps("mysql", "MySQL")

Просмотреть файл

@ -6,8 +6,6 @@
# pylint: disable=line-too-long
from azure.cli.core.commands.parameters import get_resource_name_completion_list, tags_type, get_location_type, get_enum_type # pylint: disable=line-too-long
from azext_rdbms import mysql, postgresql
from azext_rdbms.validators import configuration_value_validator
def load_arguments(self, _): # pylint: disable=too-many-statements
@ -17,39 +15,32 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
'postgres': get_resource_name_completion_list('Microsoft.DBForPostgreSQL/servers')
}
def _complex_params(command_group, engine):
def _complex_params(command_group):
with self.argument_context('{} server create'.format(command_group)) as c:
c.expand('sku', engine.models.Sku)
c.ignore('size', 'family', 'capacity', 'tier')
c.expand('storage_profile', engine.models.storage_profile.StorageProfile)
c.expand('properties', engine.models.ServerPropertiesForDefaultCreate)
c.argument('sku_name', options_list=['--sku-name'], required=True, help='The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.')
c.argument('backup_retention', type=int, options_list=['--backup-retention'], help='The number of days a backup is retained.')
c.argument('geo_redundant_backup', options_list=['--geo-redundant-backup'], help='Enable Geo-redundant or not for server backup.')
c.argument('storage_size', options_list=['--storage-size'], type=int, help='The max storage size of the server. Unit is megabytes.')
c.argument('administrator_login', required=True, arg_group='Authentication')
c.argument('administrator_login_password', arg_group='Authentication')
c.expand('parameters', engine.models.ServerForCreate)
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False)
c.argument('version', help='Server version')
with self.argument_context('{} server restore'. format(command_group)) as c:
c.ignore('sku', 'storage_profile')
c.expand('properties', engine.models.ServerPropertiesForRestore)
c.ignore('version', 'ssl_enforcement', 'storage_mb')
c.expand('parameters', engine.models.ServerForCreate)
c.ignore('tags', 'location')
c.argument('source_server_id', options_list=['--source-server', '-s'], help='The name or ID of the source server to restore from.')
c.argument('restore_point_in_time', help='The point in time to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+08:00')
with self.argument_context('{} server configuration set'.format(command_group)) as c:
c.argument('value', help='Value of the configuration. If not provided, configuration value will be set to default.', validator=configuration_value_validator)
c.ignore('source')
with self.argument_context('{} server georestore'. format(command_group)) as c:
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=True)
c.argument('sku_name', options_list=['--sku-name'], required=False, help='The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.')
c.argument('source_server', options_list=['--source-server', '-s'], required=True, help='The name or ID of the source server to restore from.')
c.argument('backup_retention', options_list=['--backup-retention'], type=int, help='The max days of retention, unit is days.')
c.argument('geo_redundant_backup', options_list=['--geo-redundant-backup'], help='Enable Geo-redundant or not for server backup.')
with self.argument_context('{} server wait'.format(command_group)) as c:
c.ignore('created', 'deleted', 'updated')
_complex_params('mysql', mysql)
_complex_params('postgres', postgresql)
_complex_params('mysql')
_complex_params('postgres')
for scope in ['mysql', 'postgres']:
with self.argument_context(scope) as c:
@ -62,34 +53,11 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
c.argument('server_name', options_list=['--name', '-n'], id_part='name', help='Name of the server.')
c.argument('administrator_login', options_list=['--admin-user', '-u'])
c.argument('administrator_login_password', options_list=['--admin-password', '-p'], required=False, help='The password of the administrator login.')
c.argument('administrator_login_password', options_list=['--admin-password', '-p'], help='The password of the administrator login.')
c.argument('ssl_enforcement', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--ssl-enforcement'], help='Enable ssl enforcement or not when connect to server.')
c.argument('tier', arg_type=get_enum_type(['Basic', 'GeneralPurpose', 'MemoryOptimized']), required=False, options_list=['--performance-tier'], help='The performance tier of the server.')
c.argument('capacity', options_list=['--vcore'], type=int, required=False, help='Number of vcore.')
c.argument('family', options_list=['--family'], arg_type=get_enum_type(['Gen4', 'Gen5']), required=False, help='Hardware generation.')
c.argument('storage_mb', options_list=['--storage-size'], type=int, help='The max storage size of the server, unit is MB.')
c.argument('backup_retention_days', options_list=['--backup-retention'], type=int, help='The max days of retention, unit is days.')
c.argument('tier', arg_type=get_enum_type(['Basic', 'GeneralPurpose', 'MemoryOptimized']), options_list=['--performance-tier'], help='The performance tier of the server.')
c.argument('capacity', options_list=['--vcore'], type=int, help='Number of vcore.')
c.argument('family', options_list=['--family'], arg_type=get_enum_type(['Gen4', 'Gen5']), help='Hardware generation.')
c.argument('storage_mb', options_list=['--storage-size'], type=int, help='The max storage size of the server. Unit is megabytes.')
c.argument('backup_retention_days', options_list=['--backup-retention'], type=int, help='The number of days a backup is retained.')
c.argument('tags', tags_type)
for scope in ['mysql server-logs', 'postgres server-logs']:
with self.argument_context(scope) as c:
c.argument('file_name', options_list=['--name', '-n'], nargs='+', help='Space separated list of log filenames on the server to download.')
c.argument('max_file_size', type=int, help='The file size limitation to filter files.')
c.argument('file_last_written', type=int, help='Integer in hours to indicate file last modify time, default value is 72.')
c.argument('filename_contains', help='The pattern that file name should match.')
for scope in ['mysql db', 'postgres db']:
with self.argument_context(scope) as c:
c.argument('database_name', options_list=['--name', '-n'])
for scope in ['mysql server firewall-rule', 'postgres server firewall-rule']:
with self.argument_context(scope) as c:
c.argument('server_name', options_list=['--server-name', '-s'])
c.argument('firewall_rule_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the firewall rule.')
c.argument('start_ip_address', options_list=['--start-ip-address'], help='The start IP address of the firewall rule. Must be IPv4 format. Use value \'0.0.0.0\' to represent all Azure-internal IP addresses.')
c.argument('end_ip_address', options_list=['--end-ip-address'], help='The end IP address of the firewall rule. Must be IPv4 format. Use value \'0.0.0.0\' to represent all Azure-internal IP addresses.')
for scope in ['mysql server configuration', 'postgres server configuration']:
with self.argument_context(scope) as c:
c.argument('server_name', options_list=['--server-name', '-s'])
c.argument('configuration_name', id_part='child_name_1', options_list=['--name', '-n'])

Просмотреть файл

@ -1,3 +1,4 @@
{
"azext.minCliCoreVersion": "2.0.24"
"azext.minCliCoreVersion": "2.0.24",
"azext.isPreview": true
}

Просмотреть файл

@ -7,22 +7,12 @@ from azure.cli.core.commands import CliCommandType
from azext_rdbms._client_factory import (
cf_mysql_servers,
cf_mysql_db,
cf_mysql_firewall_rules,
cf_mysql_config,
cf_mysql_log,
cf_postgres_servers,
cf_postgres_db,
cf_postgres_firewall_rules,
cf_postgres_config,
cf_postgres_log)
cf_postgres_servers)
# pylint: disable=too-many-locals, too-many-statements, line-too-long
def load_command_table(self, _):
rdbms_custom = CliCommandType(operations_tmpl='azext_rdbms.custom#{}')
mysql_servers_sdk = CliCommandType(
operations_tmpl='azext_rdbms.mysql.operations.servers_operations#ServersOperations.{}',
client_arg_name='self',
@ -35,124 +25,10 @@ def load_command_table(self, _):
client_factory=cf_postgres_servers
)
mysql_firewall_rule_sdk = CliCommandType(
operations_tmpl='azext_rdbms.mysql.operations.firewall_rules_operations#FirewallRulesOperations.{}',
client_arg_name='self',
client_factory=cf_mysql_firewall_rules
)
postgres_firewall_rule_sdk = CliCommandType(
operations_tmpl='azext_rdbms.postgresql.operations.firewall_rules_operations#FirewallRulesOperations.{}',
client_arg_name='self',
client_factory=cf_postgres_firewall_rules
)
mysql_config_sdk = CliCommandType(
operations_tmpl='azext_rdbms.mysql.operations.configurations_operations#ConfigurationsOperations.{}',
client_arg_name='self',
client_factory=cf_mysql_config
)
postgres_config_sdk = CliCommandType(
operations_tmpl='azext_rdbms.postgresql.operations.configurations_operations#ConfigurationsOperations.{}',
client_arg_name='self',
client_factory=cf_postgres_config
)
mysql_log_sdk = CliCommandType(
operations_tmpl='azext_rdbms.mysql.operations.log_files_operations#LogFilesOperations.{}',
client_arg_name='self',
client_factory=cf_mysql_log
)
postgres_log_sdk = CliCommandType(
operations_tmpl='azext_rdbms.postgresql.operations.log_files_operations#LogFilesOperations.{}',
client_arg_name='self',
client_factory=cf_postgres_log
)
mysql_db_sdk = CliCommandType(
operations_tmpl='azext_rdbms.mysql.operations.databases_operations#DatabasesOperations.{}',
client_arg_name='self',
client_factory=cf_mysql_db
)
postgres_db_sdk = CliCommandType(
operations_tmpl='azext_rdbms.postgresql.operations.databases_operations#DatabasesOperations.{}',
client_arg_name='self',
client_factory=cf_postgres_db
)
with self.command_group('mysql server', mysql_servers_sdk, client_factory=cf_mysql_servers) as g:
g.command('create', 'create')
g.custom_command('restore', '_server_restore', no_wait_param='no_wait')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.custom_command('list', '_server_list_custom_func')
g.generic_update_command('update',
getter_name='_server_update_get', getter_type=rdbms_custom,
setter_name='_server_update_set', setter_type=rdbms_custom, setter_arg_name='parameters',
custom_func_name='_server_update_custom_func')
g.generic_wait_command('wait', getter_name='_server_mysql_get', getter_type=rdbms_custom)
g.custom_command('create', '_server_create')
g.custom_command('georestore', '_server_georestore', supports_no_wait=True)
with self.command_group('postgres server', postgres_servers_sdk, client_factory=cf_postgres_servers) as g:
g.command('create', 'create')
g.custom_command('restore', '_server_restore', no_wait_param='no_wait')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.custom_command('list', '_server_list_custom_func')
g.generic_update_command('update',
getter_name='_server_update_get', getter_type=rdbms_custom,
setter_name='_server_update_set', setter_type=rdbms_custom, setter_arg_name='parameters',
custom_func_name='_server_update_custom_func')
g.generic_wait_command('wait', getter_name='_server_postgresql_get', getter_type=rdbms_custom)
with self.command_group('mysql server firewall-rule', mysql_firewall_rule_sdk) as g:
g.command('create', 'create_or_update')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.command('list', 'list_by_server')
g.generic_update_command('update',
getter_name='_firewall_rule_custom_getter', getter_type=rdbms_custom,
setter_name='_firewall_rule_custom_setter', setter_type=rdbms_custom, setter_arg_name='parameters',
custom_func_name='_firewall_rule_update_custom_func')
with self.command_group('postgres server firewall-rule', postgres_firewall_rule_sdk) as g:
g.command('create', 'create_or_update')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.command('list', 'list_by_server')
g.generic_update_command('update',
getter_name='_firewall_rule_custom_getter', getter_type=rdbms_custom,
setter_name='_firewall_rule_custom_setter', setter_type=rdbms_custom, setter_arg_name='parameters',
custom_func_name='_firewall_rule_update_custom_func')
with self.command_group('mysql server configuration', mysql_config_sdk) as g:
g.command('set', 'create_or_update')
g.command('show', 'get')
g.command('list', 'list_by_server')
with self.command_group('postgres server configuration', postgres_config_sdk) as g:
g.command('set', 'create_or_update')
g.command('show', 'get')
g.command('list', 'list_by_server')
with self.command_group('mysql server-logs', mysql_log_sdk, client_factory=cf_mysql_log) as g:
g.custom_command('list', '_list_log_files_with_filter')
g.custom_command('download', '_download_log_files')
with self.command_group('postgres server-logs', postgres_log_sdk, client_factory=cf_postgres_log) as g:
g.custom_command('list', '_list_log_files_with_filter')
g.custom_command('download', '_download_log_files')
with self.command_group('mysql db', mysql_db_sdk) as g:
g.command('create', 'create_or_update')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.command('list', 'list_by_server')
with self.command_group('postgres db', postgres_db_sdk) as g:
g.command('create', 'create_or_update')
g.command('delete', 'delete', confirmation=True)
g.command('show', 'get')
g.command('list', 'list_by_server')
g.custom_command('create', '_server_create')
g.custom_command('georestore', '_server_georestore', supports_no_wait=True)

Просмотреть файл

@ -6,22 +6,83 @@
# pylint: disable=unused-argument
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli.core.util import sdk_no_wait
from msrestazure.tools import resource_id, is_valid_resource_id, parse_resource_id # pylint: disable=import-error
from azext_rdbms.mysql.operations.servers_operations import ServersOperations
from ._client_factory import get_mysql_management_client, get_postgresql_management_client
SKU_TIER_MAP = {'Basic': 'b', 'GeneralPurpose': 'gp', 'MemoryOptimized': 'mo'}
# Need to replace source server name with source server id, so customer server restore function
def _server_create(cmd, client, resource_group_name, server_name, sku_name,
location=None, administrator_login=None, administrator_login_password=None, backup_retention=None,
geo_redundant_backup=None, ssl_enforcement=None, storage_size=None, tags=None, version=None):
provider = 'Microsoft.DBForMySQL' if isinstance(client, ServersOperations) else 'Microsoft.DBforPostgreSQL'
parameters = None
if provider == 'Microsoft.DBForMySQL':
from azure.mgmt.rdbms import mysql
parameters = mysql.models.ServerForCreate(
sku=mysql.models.Sku(name=sku_name),
properties=mysql.models.ServerPropertiesForDefaultCreate(
administrator_login=administrator_login,
administrator_login_password=administrator_login_password,
version=version,
ssl_enforcement=ssl_enforcement,
storage_profile=mysql.models.StorageProfile(
backup_retention_days=backup_retention,
geo_redundant_backup=geo_redundant_backup,
storage_mb=storage_size)),
location=location,
tags=tags)
elif provider == 'Microsoft.DBforPostgreSQL':
from azure.mgmt.rdbms import postgresql
parameters = postgresql.models.ServerForCreate(
sku=postgresql.models.Sku(name=sku_name),
properties=postgresql.models.ServerPropertiesForDefaultCreate(
administrator_login=administrator_login,
administrator_login_password=administrator_login_password,
version=version,
ssl_enforcement=ssl_enforcement,
storage_profile=postgresql.models.StorageProfile(
backup_retention_days=backup_retention,
geo_redundant_backup=geo_redundant_backup,
storage_mb=storage_size)),
location=location,
tags=tags)
return client.create(resource_group_name, server_name, parameters)
# need to replace source server name with source server id, so customer server georestore function
# The parameter list should be the same as that in factory to use the ParametersContext
# arguments and validators
def _server_restore(cmd, client, resource_group_name, server_name, parameters, no_wait=False, **kwargs):
source_server = kwargs['source_server_id']
# auguments and validators
def _server_georestore(cmd, client, resource_group_name, server_name, sku_name, location, source_server,
backup_retention=None, geo_redundant_backup=None, no_wait=False, **kwargs):
provider = 'Microsoft.DBForMySQL' if isinstance(client, ServersOperations) else 'Microsoft.DBforPostgreSQL'
parameters = None
if provider == 'Microsoft.DBForMySQL':
from azext_rdbms import mysql
parameters = mysql.models.ServerForCreate(
sku=mysql.models.Sku(name=sku_name),
properties=mysql.models.ServerPropertiesForGeoRestore(
storage_profile=mysql.models.StorageProfile(
backup_retention_days=backup_retention,
geo_redundant_backup=geo_redundant_backup
)),
location=location)
elif provider == 'Microsoft.DBforPostgreSQL':
from azext_rdbms import postgresql
parameters = postgresql.models.ServerForCreate(
sku=postgresql.models.Sku(name=sku_name),
properties=postgresql.models.ServerPropertiesForGeoRestore(
storage_profile=postgresql.models.StorageProfile(
backup_retention_days=backup_retention,
geo_redundant_backup=geo_redundant_backup
)),
location=location)
if not is_valid_resource_id(source_server):
if len(source_server.split('/')) == 1:
provider = 'Microsoft.DBForMySQL' if isinstance(client, ServersOperations) else 'Microsoft.DBforPostgreSQL'
source_server = resource_id(subscription=get_subscription_id(cmd.cli_ctx),
resource_group=resource_group_name,
namespace=provider,
@ -32,142 +93,12 @@ def _server_restore(cmd, client, resource_group_name, server_name, parameters, n
parameters.properties.source_server_id = source_server
# Here is a workaround that we don't support cross-region restore currently,
# so the location must be set as the same as source server (not the resource group)
id_parts = parse_resource_id(source_server)
source_server_id_parts = parse_resource_id(source_server)
try:
source_server_object = client.get(id_parts['resource_group'], id_parts['name'])
parameters.location = source_server_object.location
source_server_object = client.get(source_server_id_parts['resource_group'], source_server_id_parts['name'])
if parameters.sku.name is None:
parameters.sku.name = source_server_object.sku.name
except Exception as e:
raise ValueError('Unable to get source server: {}.'.format(str(e)))
return client.create(resource_group_name, server_name, parameters, raw=no_wait)
def _server_update_custom_func(instance,
capacity=None,
storage_mb=None,
backup_retention_days=None,
administrator_login_password=None,
ssl_enforcement=None,
tags=None):
from azext_rdbms.mysql.models import StorageProfile # pylint: disable=unused-variable
from importlib import import_module
server_module_path = instance.__module__
module = import_module(server_module_path.replace('server', 'server_update_parameters'))
ServerUpdateParameters = getattr(module, 'ServerUpdateParameters')
if capacity is not None:
instance.sku.name = _get_sku_name(instance.sku.tier, instance.sku.family, capacity)
instance.sku.capacity = capacity
else:
instance.sku = None
if storage_mb is not None:
instance.storage_profile.storage_mb = storage_mb
if backup_retention_days is not None:
instance.storage_profile.backup_retention_days = backup_retention_days
params = ServerUpdateParameters(sku=instance.sku,
storage_profile=instance.storage_profile,
administrator_login_password=administrator_login_password,
version=None,
ssl_enforcement=ssl_enforcement,
tags=tags)
return params
def _server_mysql_get(cmd, resource_group_name, server_name):
client = get_mysql_management_client(cmd.cli_ctx)
return client.servers.get(resource_group_name, server_name)
def _server_postgresql_get(cmd, resource_group_name, server_name):
client = get_postgresql_management_client(cmd.cli_ctx)
return client.servers.get(resource_group_name, server_name)
def _server_update_get(client, resource_group_name, server_name):
return client.get(resource_group_name, server_name)
def _server_update_set(client, resource_group_name, server_name, parameters):
return client.update(resource_group_name, server_name, parameters)
def _get_sku_name(tier, family, capacity):
return '{}_{}_{}'.format(SKU_TIER_MAP[tier], family, str(capacity))
def _firewall_rule_custom_getter(client, resource_group_name, server_name, firewall_rule_name):
return client.get(resource_group_name, server_name, firewall_rule_name)
def _firewall_rule_custom_setter(client, resource_group_name, server_name, firewall_rule_name, parameters):
return client.create_or_update(
resource_group_name,
server_name,
firewall_rule_name,
parameters.start_ip_address,
parameters.end_ip_address)
def _firewall_rule_update_custom_func(instance, start_ip_address=None, end_ip_address=None):
if start_ip_address is not None:
instance.start_ip_address = start_ip_address
if end_ip_address is not None:
instance.end_ip_address = end_ip_address
return instance
# Custom functions for server logs
def _download_log_files(
client,
resource_group_name,
server_name,
file_name):
from six.moves.urllib.request import urlretrieve # pylint: disable=import-error
# list all files
files = client.list_by_server(resource_group_name, server_name)
for f in files:
if f.name in file_name:
urlretrieve(f.url, f.name)
def _list_log_files_with_filter(client, resource_group_name, server_name, filename_contains=None,
file_last_written=None, max_file_size=None):
import re
from datetime import datetime, timedelta
from dateutil.tz import tzutc # pylint: disable=import-error
# list all files
all_files = client.list_by_server(resource_group_name, server_name)
files = []
if file_last_written is None:
file_last_written = 72
time_line = datetime.utcnow().replace(tzinfo=tzutc()) - timedelta(hours=file_last_written)
for f in all_files:
if f.last_modified_time < time_line:
continue
if filename_contains is not None and re.search(filename_contains, f.name) is None:
continue
if max_file_size is not None and f.size_in_kb > max_file_size:
continue
del f.created_time
files.append(f)
return files
# Custom functions for list servers
def _server_list_custom_func(client, resource_group_name=None):
if resource_group_name:
return client.list_by_resource_group(resource_group_name)
return client.list()
return sdk_no_wait(no_wait, client.create, resource_group_name, server_name, parameters)

Просмотреть файл

@ -9,27 +9,52 @@
# regenerated.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
from .tracked_resource import TrackedResource
from .storage_profile import StorageProfile
from .server_properties_for_create import ServerPropertiesForCreate
from .server_properties_for_default_create import ServerPropertiesForDefaultCreate
from .server_properties_for_restore import ServerPropertiesForRestore
from .sku import Sku
from .server import Server
from .server_for_create import ServerForCreate
from .server_update_parameters import ServerUpdateParameters
from .firewall_rule import FirewallRule
from .database import Database
from .configuration import Configuration
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .log_file import LogFile
from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives
from .performance_tier_properties import PerformanceTierProperties
from .name_availability_request import NameAvailabilityRequest
from .name_availability import NameAvailability
try:
from .proxy_resource_py3 import ProxyResource
from .tracked_resource_py3 import TrackedResource
from .storage_profile_py3 import StorageProfile
from .server_properties_for_create_py3 import ServerPropertiesForCreate
from .server_properties_for_default_create_py3 import ServerPropertiesForDefaultCreate
from .server_properties_for_restore_py3 import ServerPropertiesForRestore
from .server_properties_for_geo_restore_py3 import ServerPropertiesForGeoRestore
from .sku_py3 import Sku
from .server_py3 import Server
from .server_for_create_py3 import ServerForCreate
from .server_update_parameters_py3 import ServerUpdateParameters
from .firewall_rule_py3 import FirewallRule
from .database_py3 import Database
from .configuration_py3 import Configuration
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .operation_list_result_py3 import OperationListResult
from .log_file_py3 import LogFile
from .performance_tier_service_level_objectives_py3 import PerformanceTierServiceLevelObjectives
from .performance_tier_properties_py3 import PerformanceTierProperties
from .name_availability_request_py3 import NameAvailabilityRequest
from .name_availability_py3 import NameAvailability
except (SyntaxError, ImportError):
from .proxy_resource import ProxyResource
from .tracked_resource import TrackedResource
from .storage_profile import StorageProfile
from .server_properties_for_create import ServerPropertiesForCreate
from .server_properties_for_default_create import ServerPropertiesForDefaultCreate
from .server_properties_for_restore import ServerPropertiesForRestore
from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore
from .sku import Sku
from .server import Server
from .server_for_create import ServerForCreate
from .server_update_parameters import ServerUpdateParameters
from .firewall_rule import FirewallRule
from .database import Database
from .configuration import Configuration
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .log_file import LogFile
from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives
from .performance_tier_properties import PerformanceTierProperties
from .name_availability_request import NameAvailabilityRequest
from .name_availability import NameAvailability
from .server_paged import ServerPaged
from .firewall_rule_paged import FirewallRulePaged
from .database_paged import DatabasePaged
@ -52,6 +77,7 @@ __all__ = [
'ServerPropertiesForCreate',
'ServerPropertiesForDefaultCreate',
'ServerPropertiesForRestore',
'ServerPropertiesForGeoRestore',
'Sku',
'Server',
'ServerForCreate',

Просмотреть файл

@ -60,11 +60,11 @@ class Configuration(ProxyResource):
'source': {'key': 'properties.source', 'type': 'str'},
}
def __init__(self, value=None, source=None):
super(Configuration, self).__init__()
self.value = value
def __init__(self, **kwargs):
super(Configuration, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.description = None
self.default_value = None
self.data_type = None
self.allowed_values = None
self.source = source
self.source = kwargs.get('source', None)

Просмотреть файл

@ -0,0 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class Configuration(ProxyResource):
"""Represents a Configuration.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param value: Value of the configuration.
:type value: str
:ivar description: Description of the configuration.
:vartype description: str
:ivar default_value: Default value of the configuration.
:vartype default_value: str
:ivar data_type: Data type of the configuration.
:vartype data_type: str
:ivar allowed_values: Allowed values of the configuration.
:vartype allowed_values: str
:param source: Source of the configuration.
:type source: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'readonly': True},
'default_value': {'readonly': True},
'data_type': {'readonly': True},
'allowed_values': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'default_value': {'key': 'properties.defaultValue', 'type': 'str'},
'data_type': {'key': 'properties.dataType', 'type': 'str'},
'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'},
'source': {'key': 'properties.source', 'type': 'str'},
}
def __init__(self, *, value: str=None, source: str=None, **kwargs) -> None:
super(Configuration, self).__init__(, **kwargs)
self.value = value
self.description = None
self.default_value = None
self.data_type = None
self.allowed_values = None
self.source = source

Просмотреть файл

@ -44,7 +44,7 @@ class Database(ProxyResource):
'collation': {'key': 'properties.collation', 'type': 'str'},
}
def __init__(self, charset=None, collation=None):
super(Database, self).__init__()
self.charset = charset
self.collation = collation
def __init__(self, **kwargs):
super(Database, self).__init__(**kwargs)
self.charset = kwargs.get('charset', None)
self.collation = kwargs.get('collation', None)

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class Database(ProxyResource):
"""Represents a Database.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param charset: The charset of the database.
:type charset: str
:param collation: The collation of the database.
:type collation: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'charset': {'key': 'properties.charset', 'type': 'str'},
'collation': {'key': 'properties.collation', 'type': 'str'},
}
def __init__(self, *, charset: str=None, collation: str=None, **kwargs) -> None:
super(Database, self).__init__(, **kwargs)
self.charset = charset
self.collation = collation

Просмотреть файл

@ -18,17 +18,19 @@ class FirewallRule(ProxyResource):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param start_ip_address: The start IP address of the server firewall rule.
Must be IPv4 format.
:param start_ip_address: Required. The start IP address of the server
firewall rule. Must be IPv4 format.
:type start_ip_address: str
:param end_ip_address: The end IP address of the server firewall rule.
Must be IPv4 format.
:param end_ip_address: Required. The end IP address of the server firewall
rule. Must be IPv4 format.
:type end_ip_address: str
"""
@ -48,7 +50,7 @@ class FirewallRule(ProxyResource):
'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'},
}
def __init__(self, start_ip_address, end_ip_address):
super(FirewallRule, self).__init__()
self.start_ip_address = start_ip_address
self.end_ip_address = end_ip_address
def __init__(self, **kwargs):
super(FirewallRule, self).__init__(**kwargs)
self.start_ip_address = kwargs.get('start_ip_address', None)
self.end_ip_address = kwargs.get('end_ip_address', None)

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class FirewallRule(ProxyResource):
"""Represents a server firewall rule.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param start_ip_address: Required. The start IP address of the server
firewall rule. Must be IPv4 format.
:type start_ip_address: str
:param end_ip_address: Required. The end IP address of the server firewall
rule. Must be IPv4 format.
:type end_ip_address: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'start_ip_address': {'required': True, 'pattern': r'^(([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])$'},
'end_ip_address': {'required': True, 'pattern': r'^(([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])$'},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'},
'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'},
}
def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs) -> None:
super(FirewallRule, self).__init__(, **kwargs)
self.start_ip_address = start_ip_address
self.end_ip_address = end_ip_address

Просмотреть файл

@ -55,10 +55,10 @@ class LogFile(ProxyResource):
'url': {'key': 'properties.url', 'type': 'str'},
}
def __init__(self, size_in_kb=None, log_file_type=None, url=None):
super(LogFile, self).__init__()
self.size_in_kb = size_in_kb
def __init__(self, **kwargs):
super(LogFile, self).__init__(**kwargs)
self.size_in_kb = kwargs.get('size_in_kb', None)
self.created_time = None
self.last_modified_time = None
self.log_file_type = log_file_type
self.url = url
self.log_file_type = kwargs.get('log_file_type', None)
self.url = kwargs.get('url', None)

Просмотреть файл

@ -0,0 +1,64 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class LogFile(ProxyResource):
"""Represents a log file.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param size_in_kb: Size of the log file.
:type size_in_kb: long
:ivar created_time: Creation timestamp of the log file.
:vartype created_time: datetime
:ivar last_modified_time: Last modified timestamp of the log file.
:vartype last_modified_time: datetime
:param log_file_type: Type of the log file.
:type log_file_type: str
:param url: The url to download the log file from.
:type url: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'created_time': {'readonly': True},
'last_modified_time': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'},
'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'},
'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'},
'log_file_type': {'key': 'properties.type', 'type': 'str'},
'url': {'key': 'properties.url', 'type': 'str'},
}
def __init__(self, *, size_in_kb: int=None, log_file_type: str=None, url: str=None, **kwargs) -> None:
super(LogFile, self).__init__(, **kwargs)
self.size_in_kb = size_in_kb
self.created_time = None
self.last_modified_time = None
self.log_file_type = log_file_type
self.url = url

Просмотреть файл

@ -12,39 +12,39 @@
from enum import Enum
class ServerVersion(Enum):
class ServerVersion(str, Enum):
five_full_stop_six = "5.6"
five_full_stop_seven = "5.7"
class SslEnforcementEnum(Enum):
class SslEnforcementEnum(str, Enum):
enabled = "Enabled"
disabled = "Disabled"
class ServerState(Enum):
class ServerState(str, Enum):
ready = "Ready"
dropping = "Dropping"
disabled = "Disabled"
class GeoRedundantBackup(Enum):
class GeoRedundantBackup(str, Enum):
enabled = "Enabled"
disabled = "Disabled"
class SkuTier(Enum):
class SkuTier(str, Enum):
basic = "Basic"
general_purpose = "GeneralPurpose"
memory_optimized = "MemoryOptimized"
class OperationOrigin(Enum):
class OperationOrigin(str, Enum):
not_specified = "NotSpecified"
user = "user"

Просмотреть файл

@ -29,8 +29,8 @@ class NameAvailability(Model):
'reason': {'key': 'reason', 'type': 'str'},
}
def __init__(self, message=None, name_available=None, reason=None):
super(NameAvailability, self).__init__()
self.message = message
self.name_available = name_available
self.reason = reason
def __init__(self, **kwargs):
super(NameAvailability, self).__init__(**kwargs)
self.message = kwargs.get('message', None)
self.name_available = kwargs.get('name_available', None)
self.reason = kwargs.get('reason', None)

Просмотреть файл

@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NameAvailability(Model):
"""Represents a resource name availability.
:param message: Error Message.
:type message: str
:param name_available: Indicates whether the resource name is available.
:type name_available: bool
:param reason: Reason for name being unavailable.
:type reason: str
"""
_attribute_map = {
'message': {'key': 'message', 'type': 'str'},
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
}
def __init__(self, *, message: str=None, name_available: bool=None, reason: str=None, **kwargs) -> None:
super(NameAvailability, self).__init__(**kwargs)
self.message = message
self.name_available = name_available
self.reason = reason

Просмотреть файл

@ -15,7 +15,9 @@ from msrest.serialization import Model
class NameAvailabilityRequest(Model):
"""Request from client to check resource name availability.
:param name: Resource name to verify.
All required parameters must be populated in order to send to Azure.
:param name: Required. Resource name to verify.
:type name: str
:param type: Resource type used for verification.
:type type: str
@ -30,7 +32,7 @@ class NameAvailabilityRequest(Model):
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, name, type=None):
super(NameAvailabilityRequest, self).__init__()
self.name = name
self.type = type
def __init__(self, **kwargs):
super(NameAvailabilityRequest, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', None)

Просмотреть файл

@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NameAvailabilityRequest(Model):
"""Request from client to check resource name availability.
All required parameters must be populated in order to send to Azure.
:param name: Required. Resource name to verify.
:type name: str
:param type: Resource type used for verification.
:type type: str
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, *, name: str, type: str=None, **kwargs) -> None:
super(NameAvailabilityRequest, self).__init__(**kwargs)
self.name = name
self.type = type

Просмотреть файл

@ -45,8 +45,8 @@ class Operation(Model):
'properties': {'key': 'properties', 'type': '{object}'},
}
def __init__(self):
super(Operation, self).__init__()
def __init__(self, **kwargs):
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = None
self.origin = None

Просмотреть файл

@ -42,8 +42,8 @@ class OperationDisplay(Model):
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self):
super(OperationDisplay, self).__init__()
def __init__(self, **kwargs):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OperationDisplay(Model):
"""Display metadata associated with the operation.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar provider: Operation resource provider name.
:vartype provider: str
:ivar resource: Resource on which the operation is performed.
:vartype resource: str
:ivar operation: Localized friendly name for the operation.
:vartype operation: str
:ivar description: Operation description.
:vartype description: str
"""
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
'description': {'readonly': True},
}
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(OperationDisplay, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
self.description = None

Просмотреть файл

@ -23,6 +23,6 @@ class OperationListResult(Model):
'value': {'key': 'value', 'type': '[Operation]'},
}
def __init__(self, value=None):
super(OperationListResult, self).__init__()
self.value = value
def __init__(self, **kwargs):
super(OperationListResult, self).__init__(**kwargs)
self.value = kwargs.get('value', None)

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OperationListResult(Model):
"""A list of resource provider operations.
:param value: The list of resource provider operations.
:type value: list[~azure.mgmt.rdbms.mysql.models.Operation]
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[Operation]'},
}
def __init__(self, *, value=None, **kwargs) -> None:
super(OperationListResult, self).__init__(**kwargs)
self.value = value

Просмотреть файл

@ -0,0 +1,53 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Operation(Model):
"""REST API operation definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The name of the operation being performed on this particular
object.
:vartype name: str
:ivar display: The localized display information for this particular
operation or action.
:vartype display: ~azure.mgmt.rdbms.mysql.models.OperationDisplay
:ivar origin: The intended executor of the operation. Possible values
include: 'NotSpecified', 'user', 'system'
:vartype origin: str or ~azure.mgmt.rdbms.mysql.models.OperationOrigin
:ivar properties: Additional descriptions for the operation.
:vartype properties: dict[str, object]
"""
_validation = {
'name': {'readonly': True},
'display': {'readonly': True},
'origin': {'readonly': True},
'properties': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
'origin': {'key': 'origin', 'type': 'str'},
'properties': {'key': 'properties', 'type': '{object}'},
}
def __init__(self, **kwargs) -> None:
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = None
self.origin = None
self.properties = None

Просмотреть файл

@ -28,7 +28,7 @@ class PerformanceTierProperties(Model):
'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'},
}
def __init__(self, id=None, service_level_objectives=None):
super(PerformanceTierProperties, self).__init__()
self.id = id
self.service_level_objectives = service_level_objectives
def __init__(self, **kwargs):
super(PerformanceTierProperties, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.service_level_objectives = kwargs.get('service_level_objectives', None)

Просмотреть файл

@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class PerformanceTierProperties(Model):
"""Performance tier properties.
:param id: ID of the performance tier.
:type id: str
:param service_level_objectives: Service level objectives associated with
the performance tier
:type service_level_objectives:
list[~azure.mgmt.rdbms.mysql.models.PerformanceTierServiceLevelObjectives]
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'},
}
def __init__(self, *, id: str=None, service_level_objectives=None, **kwargs) -> None:
super(PerformanceTierProperties, self).__init__(**kwargs)
self.id = id
self.service_level_objectives = service_level_objectives

Просмотреть файл

@ -47,13 +47,13 @@ class PerformanceTierServiceLevelObjectives(Model):
'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'},
}
def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None):
super(PerformanceTierServiceLevelObjectives, self).__init__()
self.id = id
self.edition = edition
self.v_core = v_core
self.hardware_generation = hardware_generation
self.max_backup_retention_days = max_backup_retention_days
self.min_backup_retention_days = min_backup_retention_days
self.max_storage_mb = max_storage_mb
self.min_storage_mb = min_storage_mb
def __init__(self, **kwargs):
super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.edition = kwargs.get('edition', None)
self.v_core = kwargs.get('v_core', None)
self.hardware_generation = kwargs.get('hardware_generation', None)
self.max_backup_retention_days = kwargs.get('max_backup_retention_days', None)
self.min_backup_retention_days = kwargs.get('min_backup_retention_days', None)
self.max_storage_mb = kwargs.get('max_storage_mb', None)
self.min_storage_mb = kwargs.get('min_storage_mb', None)

Просмотреть файл

@ -0,0 +1,59 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class PerformanceTierServiceLevelObjectives(Model):
"""Service level objectives for performance tier.
:param id: ID for the service level objective.
:type id: str
:param edition: Edition of the performance tier.
:type edition: str
:param v_core: vCore associated with the service level objective
:type v_core: int
:param hardware_generation: Hardware generation associated with the
service level objective
:type hardware_generation: str
:param max_backup_retention_days: Maximum Backup retention in days for the
performance tier edition
:type max_backup_retention_days: int
:param min_backup_retention_days: Minimum Backup retention in days for the
performance tier edition
:type min_backup_retention_days: int
:param max_storage_mb: Max storage allowed for a server.
:type max_storage_mb: int
:param min_storage_mb: Max storage allowed for a server.
:type min_storage_mb: int
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'edition': {'key': 'edition', 'type': 'str'},
'v_core': {'key': 'vCore', 'type': 'int'},
'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'},
'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'},
'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'},
'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'},
'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'},
}
def __init__(self, *, id: str=None, edition: str=None, v_core: int=None, hardware_generation: str=None, max_backup_retention_days: int=None, min_backup_retention_days: int=None, max_storage_mb: int=None, min_storage_mb: int=None, **kwargs) -> None:
super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs)
self.id = id
self.edition = edition
self.v_core = v_core
self.hardware_generation = hardware_generation
self.max_backup_retention_days = max_backup_retention_days
self.min_backup_retention_days = min_backup_retention_days
self.max_storage_mb = max_storage_mb
self.min_storage_mb = min_storage_mb

Просмотреть файл

@ -38,8 +38,8 @@ class ProxyResource(Model):
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self):
super(ProxyResource, self).__init__()
def __init__(self, **kwargs):
super(ProxyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None

Просмотреть файл

@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ProxyResource(Model):
"""Resource properties.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(ProxyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None

Просмотреть файл

@ -18,13 +18,15 @@ class Server(TrackedResource):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: The location the resource resides in.
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
@ -77,13 +79,13 @@ class Server(TrackedResource):
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
}
def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None):
super(Server, self).__init__(location=location, tags=tags)
self.sku = sku
self.administrator_login = administrator_login
self.version = version
self.ssl_enforcement = ssl_enforcement
self.user_visible_state = user_visible_state
self.fully_qualified_domain_name = fully_qualified_domain_name
self.earliest_restore_date = earliest_restore_date
self.storage_profile = storage_profile
def __init__(self, **kwargs):
super(Server, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.administrator_login = kwargs.get('administrator_login', None)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.user_visible_state = kwargs.get('user_visible_state', None)
self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None)
self.earliest_restore_date = kwargs.get('earliest_restore_date', None)
self.storage_profile = kwargs.get('storage_profile', None)

Просмотреть файл

@ -15,11 +15,13 @@ from msrest.serialization import Model
class ServerForCreate(Model):
"""Represents a server to be created.
All required parameters must be populated in order to send to Azure.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.mysql.models.Sku
:param properties: Properties of the server.
:param properties: Required. Properties of the server.
:type properties: ~azure.mgmt.rdbms.mysql.models.ServerPropertiesForCreate
:param location: The location the resource resides in.
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
@ -37,9 +39,9 @@ class ServerForCreate(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, properties, location, sku=None, tags=None):
super(ServerForCreate, self).__init__()
self.sku = sku
self.properties = properties
self.location = location
self.tags = tags
def __init__(self, **kwargs):
super(ServerForCreate, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.properties = kwargs.get('properties', None)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,47 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerForCreate(Model):
"""Represents a server to be created.
All required parameters must be populated in order to send to Azure.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.mysql.models.Sku
:param properties: Required. Properties of the server.
:type properties: ~azure.mgmt.rdbms.mysql.models.ServerPropertiesForCreate
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
_validation = {
'properties': {'required': True},
'location': {'required': True},
}
_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, properties, location: str, sku=None, tags=None, **kwargs) -> None:
super(ServerForCreate, self).__init__(**kwargs)
self.sku = sku
self.properties = properties
self.location = location
self.tags = tags

Просмотреть файл

@ -17,7 +17,9 @@ class ServerPropertiesForCreate(Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ServerPropertiesForDefaultCreate,
ServerPropertiesForRestore
ServerPropertiesForRestore, ServerPropertiesForGeoRestore
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
@ -27,7 +29,7 @@ class ServerPropertiesForCreate(Model):
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
"""
@ -43,12 +45,12 @@ class ServerPropertiesForCreate(Model):
}
_subtype_map = {
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'}
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'}
}
def __init__(self, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForCreate, self).__init__()
self.version = version
self.ssl_enforcement = ssl_enforcement
self.storage_profile = storage_profile
def __init__(self, **kwargs):
super(ServerPropertiesForCreate, self).__init__(**kwargs)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.storage_profile = kwargs.get('storage_profile', None)
self.create_mode = None

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerPropertiesForCreate(Model):
"""The properties used to create a new server.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ServerPropertiesForDefaultCreate,
ServerPropertiesForRestore, ServerPropertiesForGeoRestore
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
"""
_validation = {
'create_mode': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
}
_subtype_map = {
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'}
}
def __init__(self, *, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForCreate, self).__init__(**kwargs)
self.version = version
self.ssl_enforcement = ssl_enforcement
self.storage_profile = storage_profile
self.create_mode = None

Просмотреть файл

@ -15,6 +15,8 @@ from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
"""The properties used to create a new server.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
@ -23,14 +25,14 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param administrator_login: The administrator's login name of a server.
Can only be specified when the server is being created (and is required
for creation).
:param administrator_login: Required. The administrator's login name of a
server. Can only be specified when the server is being created (and is
required for creation).
:type administrator_login: str
:param administrator_login_password: The password of the administrator
login.
:param administrator_login_password: Required. The password of the
administrator login.
:type administrator_login_password: str
"""
@ -49,8 +51,8 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'},
}
def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile)
self.administrator_login = administrator_login
self.administrator_login_password = administrator_login_password
def __init__(self, **kwargs):
super(ServerPropertiesForDefaultCreate, self).__init__(**kwargs)
self.administrator_login = kwargs.get('administrator_login', None)
self.administrator_login_password = kwargs.get('administrator_login_password', None)
self.create_mode = 'Default'

Просмотреть файл

@ -0,0 +1,58 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
"""The properties used to create a new server.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param administrator_login: Required. The administrator's login name of a
server. Can only be specified when the server is being created (and is
required for creation).
:type administrator_login: str
:param administrator_login_password: Required. The password of the
administrator login.
:type administrator_login_password: str
"""
_validation = {
'create_mode': {'required': True},
'administrator_login': {'required': True},
'administrator_login_password': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'administrator_login': {'key': 'administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'},
}
def __init__(self, *, administrator_login: str, administrator_login_password: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.administrator_login = administrator_login
self.administrator_login_password = administrator_login_password
self.create_mode = 'Default'

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForGeoRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring to a different
region from a geo replicated backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
}
def __init__(self, **kwargs):
super(ServerPropertiesForGeoRestore, self).__init__(**kwargs)
self.source_server_id = kwargs.get('source_server_id', None)
self.create_mode = 'GeoRestore'

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForGeoRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring to a different
region from a geo replicated backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
}
def __init__(self, *, source_server_id: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.source_server_id = source_server_id
self.create_mode = 'GeoRestore'

Просмотреть файл

@ -13,7 +13,9 @@ from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForRestore(ServerPropertiesForCreate):
"""The properties to a new server by restoring from a backup.
"""The properties used to create a new server by restoring from a backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
@ -23,12 +25,12 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate):
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: The source server id to restore from.
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
:param restore_point_in_time: Restore point creation time (ISO8601
format), specifying the time to restore from.
:param restore_point_in_time: Required. Restore point creation time
(ISO8601 format), specifying the time to restore from.
:type restore_point_in_time: datetime
"""
@ -47,8 +49,8 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate):
'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'},
}
def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile)
self.source_server_id = source_server_id
self.restore_point_in_time = restore_point_in_time
def __init__(self, **kwargs):
super(ServerPropertiesForRestore, self).__init__(**kwargs)
self.source_server_id = kwargs.get('source_server_id', None)
self.restore_point_in_time = kwargs.get('restore_point_in_time', None)
self.create_mode = 'PointInTimeRestore'

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring from a backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
:param restore_point_in_time: Required. Restore point creation time
(ISO8601 format), specifying the time to restore from.
:type restore_point_in_time: datetime
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
'restore_point_in_time': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'},
}
def __init__(self, *, source_server_id: str, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.source_server_id = source_server_id
self.restore_point_in_time = restore_point_in_time
self.create_mode = 'PointInTimeRestore'

Просмотреть файл

@ -0,0 +1,91 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .tracked_resource import TrackedResource
class Server(TrackedResource):
"""Represents a server.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.mysql.models.Sku
:param administrator_login: The administrator's login name of a server.
Can only be specified when the server is being created (and is required
for creation).
:type administrator_login: str
:param version: Server version. Possible values include: '5.6', '5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param user_visible_state: A state of a server that is visible to user.
Possible values include: 'Ready', 'Dropping', 'Disabled'
:type user_visible_state: str or
~azure.mgmt.rdbms.mysql.models.ServerState
:param fully_qualified_domain_name: The fully qualified domain name of a
server.
:type fully_qualified_domain_name: str
:param earliest_restore_date: Earliest restore point creation time
(ISO8601 format)
:type earliest_restore_date: datetime
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'},
'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'},
'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'},
'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
}
def __init__(self, *, location: str, tags=None, sku=None, administrator_login: str=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name: str=None, earliest_restore_date=None, storage_profile=None, **kwargs) -> None:
super(Server, self).__init__(location=location, tags=tags, **kwargs)
self.sku = sku
self.administrator_login = administrator_login
self.version = version
self.ssl_enforcement = ssl_enforcement
self.user_visible_state = user_visible_state
self.fully_qualified_domain_name = fully_qualified_domain_name
self.earliest_restore_date = earliest_restore_date
self.storage_profile = storage_profile

Просмотреть файл

@ -42,11 +42,11 @@ class ServerUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None):
super(ServerUpdateParameters, self).__init__()
self.sku = sku
self.storage_profile = storage_profile
self.administrator_login_password = administrator_login_password
self.version = version
self.ssl_enforcement = ssl_enforcement
self.tags = tags
def __init__(self, **kwargs):
super(ServerUpdateParameters, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.storage_profile = kwargs.get('storage_profile', None)
self.administrator_login_password = kwargs.get('administrator_login_password', None)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerUpdateParameters(Model):
"""Parameters allowd to update for a server.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.mysql.models.Sku
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mysql.models.StorageProfile
:param administrator_login_password: The password of the administrator
login.
:type administrator_login_password: str
:param version: The version of a server. Possible values include: '5.6',
'5.7'
:type version: str or ~azure.mgmt.rdbms.mysql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.mysql.models.SslEnforcementEnum
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, sku=None, storage_profile=None, administrator_login_password: str=None, version=None, ssl_enforcement=None, tags=None, **kwargs) -> None:
super(ServerUpdateParameters, self).__init__(**kwargs)
self.sku = sku
self.storage_profile = storage_profile
self.administrator_login_password = administrator_login_password
self.version = version
self.ssl_enforcement = ssl_enforcement
self.tags = tags

Просмотреть файл

@ -42,10 +42,10 @@ class Sku(Model):
'family': {'key': 'family', 'type': 'str'},
}
def __init__(self, name=None, tier=None, capacity=None, size=None, family=None):
super(Sku, self).__init__()
self.name = name
self.tier = tier
self.capacity = capacity
self.size = size
self.family = family
def __init__(self, **kwargs):
super(Sku, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.tier = kwargs.get('tier', None)
self.capacity = kwargs.get('capacity', None)
self.size = kwargs.get('size', None)
self.family = kwargs.get('family', None)

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Sku(Model):
"""Billing information related properties of a server.
:param name: The name of the sku, typically, tier + family + cores, e.g.
B_Gen4_1, GP_Gen5_8.
:type name: str
:param tier: The tier of the particular SKU, e.g. Basic. Possible values
include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'
:type tier: str or ~azure.mgmt.rdbms.mysql.models.SkuTier
:param capacity: The scale up/out capacity, representing server's compute
units.
:type capacity: int
:param size: The size code, to be interpreted by resource as appropriate.
:type size: str
:param family: The family of hardware.
:type family: str
"""
_validation = {
'capacity': {'minimum': 0},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'capacity': {'key': 'capacity', 'type': 'int'},
'size': {'key': 'size', 'type': 'str'},
'family': {'key': 'family', 'type': 'str'},
}
def __init__(self, *, name: str=None, tier=None, capacity: int=None, size: str=None, family: str=None, **kwargs) -> None:
super(Sku, self).__init__(**kwargs)
self.name = name
self.tier = tier
self.capacity = capacity
self.size = size
self.family = family

Просмотреть файл

@ -31,8 +31,8 @@ class StorageProfile(Model):
'storage_mb': {'key': 'storageMB', 'type': 'int'},
}
def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None):
super(StorageProfile, self).__init__()
self.backup_retention_days = backup_retention_days
self.geo_redundant_backup = geo_redundant_backup
self.storage_mb = storage_mb
def __init__(self, **kwargs):
super(StorageProfile, self).__init__(**kwargs)
self.backup_retention_days = kwargs.get('backup_retention_days', None)
self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None)
self.storage_mb = kwargs.get('storage_mb', None)

Просмотреть файл

@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class StorageProfile(Model):
"""Storage Profile properties of a server.
:param backup_retention_days: Backup retention days for the server.
:type backup_retention_days: int
:param geo_redundant_backup: Enable Geo-redundant or not for server
backup. Possible values include: 'Enabled', 'Disabled'
:type geo_redundant_backup: str or
~azure.mgmt.rdbms.mysql.models.GeoRedundantBackup
:param storage_mb: Max storage allowed for a server.
:type storage_mb: int
"""
_attribute_map = {
'backup_retention_days': {'key': 'backupRetentionDays', 'type': 'int'},
'geo_redundant_backup': {'key': 'geoRedundantBackup', 'type': 'str'},
'storage_mb': {'key': 'storageMB', 'type': 'int'},
}
def __init__(self, *, backup_retention_days: int=None, geo_redundant_backup=None, storage_mb: int=None, **kwargs) -> None:
super(StorageProfile, self).__init__(**kwargs)
self.backup_retention_days = backup_retention_days
self.geo_redundant_backup = geo_redundant_backup
self.storage_mb = storage_mb

Просмотреть файл

@ -18,13 +18,15 @@ class TrackedResource(ProxyResource):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: The location the resource resides in.
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
@ -45,7 +47,7 @@ class TrackedResource(ProxyResource):
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, location, tags=None):
super(TrackedResource, self).__init__()
self.location = location
self.tags = tags
def __init__(self, **kwargs):
super(TrackedResource, self).__init__(**kwargs)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,53 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class TrackedResource(ProxyResource):
"""Resource properties including location and tags for track resources.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, location: str, tags=None, **kwargs) -> None:
super(TrackedResource, self).__init__(, **kwargs)
self.location = location
self.tags = tags

Просмотреть файл

@ -12,8 +12,8 @@
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
@ -93,7 +93,7 @@ class ConfigurationsOperations(object):
return deserialized
def create_or_update(
self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, configuration_name, value=None, source=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Updates a configuration of a server.
:param resource_group_name: The name of the resource group that
@ -109,13 +109,16 @@ class ConfigurationsOperations(object):
:param source: Source of the configuration.
:type source: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns
Configuration or ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns Configuration or
ClientRawResponse<Configuration> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Configuration]
or ~msrest.pipeline.ClientRawResponse
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mysql.models.Configuration]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_or_update_initial(
@ -128,30 +131,8 @@ class ConfigurationsOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = self._deserialize('Configuration', response)
if raw:
@ -160,12 +141,13 @@ class ConfigurationsOperations(object):
return deserialized
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}'}
def get(

Просмотреть файл

@ -12,8 +12,8 @@
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
@ -95,7 +95,7 @@ class DatabasesOperations(object):
return deserialized
def create_or_update(
self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, database_name, charset=None, collation=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates a new database or updates an existing database.
:param resource_group_name: The name of the resource group that
@ -111,13 +111,16 @@ class DatabasesOperations(object):
:param collation: The collation of the database.
:type collation: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns Database or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns Database or
ClientRawResponse<Database> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Database]
or ~msrest.pipeline.ClientRawResponse
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mysql.models.Database]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_or_update_initial(
@ -130,30 +133,8 @@ class DatabasesOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 201, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = self._deserialize('Database', response)
if raw:
@ -162,12 +143,13 @@ class DatabasesOperations(object):
return deserialized
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}'}
@ -211,7 +193,7 @@ class DatabasesOperations(object):
return client_raw_response
def delete(
self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a database.
:param resource_group_name: The name of the resource group that
@ -223,12 +205,14 @@ class DatabasesOperations(object):
:param database_name: The name of the database.
:type database_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns None or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrest.pipeline.ClientRawResponse
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._delete_initial(
@ -239,40 +223,19 @@ class DatabasesOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 202, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}'}
def get(

Просмотреть файл

@ -12,8 +12,8 @@
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
@ -95,7 +95,7 @@ class FirewallRulesOperations(object):
return deserialized
def create_or_update(
self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates a new firewall rule or updates an existing firewall rule.
:param resource_group_name: The name of the resource group that
@ -113,13 +113,16 @@ class FirewallRulesOperations(object):
Must be IPv4 format.
:type end_ip_address: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns FirewallRule
or ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns FirewallRule or
ClientRawResponse<FirewallRule> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.FirewallRule]
or ~msrest.pipeline.ClientRawResponse
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mysql.models.FirewallRule]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_or_update_initial(
@ -132,30 +135,8 @@ class FirewallRulesOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 201, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = self._deserialize('FirewallRule', response)
if raw:
@ -164,12 +145,13 @@ class FirewallRulesOperations(object):
return deserialized
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}'}
@ -213,7 +195,7 @@ class FirewallRulesOperations(object):
return client_raw_response
def delete(
self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a server firewall rule.
:param resource_group_name: The name of the resource group that
@ -225,12 +207,14 @@ class FirewallRulesOperations(object):
:param firewall_rule_name: The name of the server firewall rule.
:type firewall_rule_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns None or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrest.pipeline.ClientRawResponse
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._delete_initial(
@ -241,40 +225,19 @@ class FirewallRulesOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 202, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}'}
def get(

Просмотреть файл

@ -12,8 +12,8 @@
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
@ -92,7 +92,7 @@ class ServersOperations(object):
return deserialized
def create(
self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config):
"""Creates a new server or updates an existing server. The update action
will overwrite the existing server.
@ -106,13 +106,16 @@ class ServersOperations(object):
server.
:type parameters: ~azure.mgmt.rdbms.mysql.models.ServerForCreate
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns Server or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns Server or
ClientRawResponse<Server> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server]
or ~msrest.pipeline.ClientRawResponse
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mysql.models.Server]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._create_initial(
@ -123,30 +126,8 @@ class ServersOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 201, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = self._deserialize('Server', response)
if raw:
@ -155,12 +136,13 @@ class ServersOperations(object):
return deserialized
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}'}
@ -214,7 +196,7 @@ class ServersOperations(object):
return deserialized
def update(
self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config):
"""Updates an existing server. The request body can contain one to many of
the properties present in the normal server definition.
@ -228,13 +210,16 @@ class ServersOperations(object):
:type parameters:
~azure.mgmt.rdbms.mysql.models.ServerUpdateParameters
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns Server or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns Server or
ClientRawResponse<Server> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.rdbms.mysql.models.Server]
or ~msrest.pipeline.ClientRawResponse
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.rdbms.mysql.models.Server]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._update_initial(
@ -245,30 +230,8 @@ class ServersOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
deserialized = self._deserialize('Server', response)
if raw:
@ -277,12 +240,13 @@ class ServersOperations(object):
return deserialized
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}'}
@ -325,7 +289,7 @@ class ServersOperations(object):
return client_raw_response
def delete(
self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, server_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a server.
:param resource_group_name: The name of the resource group that
@ -335,12 +299,14 @@ class ServersOperations(object):
:param server_name: The name of the server.
:type server_name: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:return: An instance of AzureOperationPoller that returns None or
ClientRawResponse if raw=true
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrest.pipeline.ClientRawResponse
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._delete_initial(
@ -350,40 +316,19 @@ class ServersOperations(object):
raw=True,
**operation_config
)
if raw:
return raw_result
# Construct and send request
def long_running_send():
return raw_result.response
def get_long_running_status(status_link, headers=None):
request = self._client.get(status_link)
if headers:
request.headers.update(headers)
header_parameters = {}
header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id']
return self._client.send(
request, header_parameters, stream=False, **operation_config)
def get_long_running_output(response):
if response.status_code not in [200, 202, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
long_running_operation_timeout = operation_config.get(
lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
return AzureOperationPoller(
long_running_send, get_long_running_output,
get_long_running_status, long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}'}
def get(

Просмотреть файл

@ -9,4 +9,4 @@
# regenerated.
# --------------------------------------------------------------------------
VERSION = "0.1.0"
VERSION = "2017-12-01"

Просмотреть файл

@ -9,27 +9,52 @@
# regenerated.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
from .tracked_resource import TrackedResource
from .storage_profile import StorageProfile
from .server_properties_for_create import ServerPropertiesForCreate
from .server_properties_for_default_create import ServerPropertiesForDefaultCreate
from .server_properties_for_restore import ServerPropertiesForRestore
from .sku import Sku
from .server import Server
from .server_for_create import ServerForCreate
from .server_update_parameters import ServerUpdateParameters
from .firewall_rule import FirewallRule
from .database import Database
from .configuration import Configuration
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .log_file import LogFile
from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives
from .performance_tier_properties import PerformanceTierProperties
from .name_availability_request import NameAvailabilityRequest
from .name_availability import NameAvailability
try:
from .proxy_resource_py3 import ProxyResource
from .tracked_resource_py3 import TrackedResource
from .storage_profile_py3 import StorageProfile
from .server_properties_for_create_py3 import ServerPropertiesForCreate
from .server_properties_for_default_create_py3 import ServerPropertiesForDefaultCreate
from .server_properties_for_restore_py3 import ServerPropertiesForRestore
from .server_properties_for_geo_restore_py3 import ServerPropertiesForGeoRestore
from .sku_py3 import Sku
from .server_py3 import Server
from .server_for_create_py3 import ServerForCreate
from .server_update_parameters_py3 import ServerUpdateParameters
from .firewall_rule_py3 import FirewallRule
from .database_py3 import Database
from .configuration_py3 import Configuration
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .operation_list_result_py3 import OperationListResult
from .log_file_py3 import LogFile
from .performance_tier_service_level_objectives_py3 import PerformanceTierServiceLevelObjectives
from .performance_tier_properties_py3 import PerformanceTierProperties
from .name_availability_request_py3 import NameAvailabilityRequest
from .name_availability_py3 import NameAvailability
except (SyntaxError, ImportError):
from .proxy_resource import ProxyResource
from .tracked_resource import TrackedResource
from .storage_profile import StorageProfile
from .server_properties_for_create import ServerPropertiesForCreate
from .server_properties_for_default_create import ServerPropertiesForDefaultCreate
from .server_properties_for_restore import ServerPropertiesForRestore
from .server_properties_for_geo_restore import ServerPropertiesForGeoRestore
from .sku import Sku
from .server import Server
from .server_for_create import ServerForCreate
from .server_update_parameters import ServerUpdateParameters
from .firewall_rule import FirewallRule
from .database import Database
from .configuration import Configuration
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_list_result import OperationListResult
from .log_file import LogFile
from .performance_tier_service_level_objectives import PerformanceTierServiceLevelObjectives
from .performance_tier_properties import PerformanceTierProperties
from .name_availability_request import NameAvailabilityRequest
from .name_availability import NameAvailability
from .server_paged import ServerPaged
from .firewall_rule_paged import FirewallRulePaged
from .database_paged import DatabasePaged
@ -52,6 +77,7 @@ __all__ = [
'ServerPropertiesForCreate',
'ServerPropertiesForDefaultCreate',
'ServerPropertiesForRestore',
'ServerPropertiesForGeoRestore',
'Sku',
'Server',
'ServerForCreate',

Просмотреть файл

@ -60,11 +60,11 @@ class Configuration(ProxyResource):
'source': {'key': 'properties.source', 'type': 'str'},
}
def __init__(self, value=None, source=None):
super(Configuration, self).__init__()
self.value = value
def __init__(self, **kwargs):
super(Configuration, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.description = None
self.default_value = None
self.data_type = None
self.allowed_values = None
self.source = source
self.source = kwargs.get('source', None)

Просмотреть файл

@ -0,0 +1,70 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class Configuration(ProxyResource):
"""Represents a Configuration.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param value: Value of the configuration.
:type value: str
:ivar description: Description of the configuration.
:vartype description: str
:ivar default_value: Default value of the configuration.
:vartype default_value: str
:ivar data_type: Data type of the configuration.
:vartype data_type: str
:ivar allowed_values: Allowed values of the configuration.
:vartype allowed_values: str
:param source: Source of the configuration.
:type source: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'readonly': True},
'default_value': {'readonly': True},
'data_type': {'readonly': True},
'allowed_values': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'default_value': {'key': 'properties.defaultValue', 'type': 'str'},
'data_type': {'key': 'properties.dataType', 'type': 'str'},
'allowed_values': {'key': 'properties.allowedValues', 'type': 'str'},
'source': {'key': 'properties.source', 'type': 'str'},
}
def __init__(self, *, value: str=None, source: str=None, **kwargs) -> None:
super(Configuration, self).__init__(, **kwargs)
self.value = value
self.description = None
self.default_value = None
self.data_type = None
self.allowed_values = None
self.source = source

Просмотреть файл

@ -44,7 +44,7 @@ class Database(ProxyResource):
'collation': {'key': 'properties.collation', 'type': 'str'},
}
def __init__(self, charset=None, collation=None):
super(Database, self).__init__()
self.charset = charset
self.collation = collation
def __init__(self, **kwargs):
super(Database, self).__init__(**kwargs)
self.charset = kwargs.get('charset', None)
self.collation = kwargs.get('collation', None)

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class Database(ProxyResource):
"""Represents a Database.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param charset: The charset of the database.
:type charset: str
:param collation: The collation of the database.
:type collation: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'charset': {'key': 'properties.charset', 'type': 'str'},
'collation': {'key': 'properties.collation', 'type': 'str'},
}
def __init__(self, *, charset: str=None, collation: str=None, **kwargs) -> None:
super(Database, self).__init__(, **kwargs)
self.charset = charset
self.collation = collation

Просмотреть файл

@ -18,17 +18,19 @@ class FirewallRule(ProxyResource):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param start_ip_address: The start IP address of the server firewall rule.
Must be IPv4 format.
:param start_ip_address: Required. The start IP address of the server
firewall rule. Must be IPv4 format.
:type start_ip_address: str
:param end_ip_address: The end IP address of the server firewall rule.
Must be IPv4 format.
:param end_ip_address: Required. The end IP address of the server firewall
rule. Must be IPv4 format.
:type end_ip_address: str
"""
@ -48,7 +50,7 @@ class FirewallRule(ProxyResource):
'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'},
}
def __init__(self, start_ip_address, end_ip_address):
super(FirewallRule, self).__init__()
self.start_ip_address = start_ip_address
self.end_ip_address = end_ip_address
def __init__(self, **kwargs):
super(FirewallRule, self).__init__(**kwargs)
self.start_ip_address = kwargs.get('start_ip_address', None)
self.end_ip_address = kwargs.get('end_ip_address', None)

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class FirewallRule(ProxyResource):
"""Represents a server firewall rule.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param start_ip_address: Required. The start IP address of the server
firewall rule. Must be IPv4 format.
:type start_ip_address: str
:param end_ip_address: Required. The end IP address of the server firewall
rule. Must be IPv4 format.
:type end_ip_address: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'start_ip_address': {'required': True, 'pattern': r'^(([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])$'},
'end_ip_address': {'required': True, 'pattern': r'^(([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])$'},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'},
'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'},
}
def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs) -> None:
super(FirewallRule, self).__init__(, **kwargs)
self.start_ip_address = start_ip_address
self.end_ip_address = end_ip_address

Просмотреть файл

@ -55,10 +55,10 @@ class LogFile(ProxyResource):
'url': {'key': 'properties.url', 'type': 'str'},
}
def __init__(self, size_in_kb=None, log_file_type=None, url=None):
super(LogFile, self).__init__()
self.size_in_kb = size_in_kb
def __init__(self, **kwargs):
super(LogFile, self).__init__(**kwargs)
self.size_in_kb = kwargs.get('size_in_kb', None)
self.created_time = None
self.last_modified_time = None
self.log_file_type = log_file_type
self.url = url
self.log_file_type = kwargs.get('log_file_type', None)
self.url = kwargs.get('url', None)

Просмотреть файл

@ -0,0 +1,64 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .proxy_resource import ProxyResource
class LogFile(ProxyResource):
"""Represents a log file.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param size_in_kb: Size of the log file.
:type size_in_kb: long
:ivar created_time: Creation timestamp of the log file.
:vartype created_time: datetime
:ivar last_modified_time: Last modified timestamp of the log file.
:vartype last_modified_time: datetime
:param log_file_type: Type of the log file.
:type log_file_type: str
:param url: The url to download the log file from.
:type url: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'created_time': {'readonly': True},
'last_modified_time': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'size_in_kb': {'key': 'properties.sizeInKB', 'type': 'long'},
'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'},
'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'},
'log_file_type': {'key': 'properties.type', 'type': 'str'},
'url': {'key': 'properties.url', 'type': 'str'},
}
def __init__(self, *, size_in_kb: int=None, log_file_type: str=None, url: str=None, **kwargs) -> None:
super(LogFile, self).__init__(, **kwargs)
self.size_in_kb = size_in_kb
self.created_time = None
self.last_modified_time = None
self.log_file_type = log_file_type
self.url = url

Просмотреть файл

@ -29,8 +29,8 @@ class NameAvailability(Model):
'reason': {'key': 'reason', 'type': 'str'},
}
def __init__(self, message=None, name_available=None, reason=None):
super(NameAvailability, self).__init__()
self.message = message
self.name_available = name_available
self.reason = reason
def __init__(self, **kwargs):
super(NameAvailability, self).__init__(**kwargs)
self.message = kwargs.get('message', None)
self.name_available = kwargs.get('name_available', None)
self.reason = kwargs.get('reason', None)

Просмотреть файл

@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NameAvailability(Model):
"""Represents a resource name availability.
:param message: Error Message.
:type message: str
:param name_available: Indicates whether the resource name is available.
:type name_available: bool
:param reason: Reason for name being unavailable.
:type reason: str
"""
_attribute_map = {
'message': {'key': 'message', 'type': 'str'},
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
}
def __init__(self, *, message: str=None, name_available: bool=None, reason: str=None, **kwargs) -> None:
super(NameAvailability, self).__init__(**kwargs)
self.message = message
self.name_available = name_available
self.reason = reason

Просмотреть файл

@ -15,7 +15,9 @@ from msrest.serialization import Model
class NameAvailabilityRequest(Model):
"""Request from client to check resource name availability.
:param name: Resource name to verify.
All required parameters must be populated in order to send to Azure.
:param name: Required. Resource name to verify.
:type name: str
:param type: Resource type used for verification.
:type type: str
@ -30,7 +32,7 @@ class NameAvailabilityRequest(Model):
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, name, type=None):
super(NameAvailabilityRequest, self).__init__()
self.name = name
self.type = type
def __init__(self, **kwargs):
super(NameAvailabilityRequest, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', None)

Просмотреть файл

@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class NameAvailabilityRequest(Model):
"""Request from client to check resource name availability.
All required parameters must be populated in order to send to Azure.
:param name: Required. Resource name to verify.
:type name: str
:param type: Resource type used for verification.
:type type: str
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, *, name: str, type: str=None, **kwargs) -> None:
super(NameAvailabilityRequest, self).__init__(**kwargs)
self.name = name
self.type = type

Просмотреть файл

@ -46,8 +46,8 @@ class Operation(Model):
'properties': {'key': 'properties', 'type': '{object}'},
}
def __init__(self):
super(Operation, self).__init__()
def __init__(self, **kwargs):
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = None
self.origin = None

Просмотреть файл

@ -42,8 +42,8 @@ class OperationDisplay(Model):
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self):
super(OperationDisplay, self).__init__()
def __init__(self, **kwargs):
super(OperationDisplay, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None

Просмотреть файл

@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OperationDisplay(Model):
"""Display metadata associated with the operation.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar provider: Operation resource provider name.
:vartype provider: str
:ivar resource: Resource on which the operation is performed.
:vartype resource: str
:ivar operation: Localized friendly name for the operation.
:vartype operation: str
:ivar description: Operation description.
:vartype description: str
"""
_validation = {
'provider': {'readonly': True},
'resource': {'readonly': True},
'operation': {'readonly': True},
'description': {'readonly': True},
}
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(OperationDisplay, self).__init__(**kwargs)
self.provider = None
self.resource = None
self.operation = None
self.description = None

Просмотреть файл

@ -23,6 +23,6 @@ class OperationListResult(Model):
'value': {'key': 'value', 'type': '[Operation]'},
}
def __init__(self, value=None):
super(OperationListResult, self).__init__()
self.value = value
def __init__(self, **kwargs):
super(OperationListResult, self).__init__(**kwargs)
self.value = kwargs.get('value', None)

Просмотреть файл

@ -0,0 +1,28 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class OperationListResult(Model):
"""A list of resource provider operations.
:param value: The list of resource provider operations.
:type value: list[~azure.mgmt.rdbms.postgresql.models.Operation]
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[Operation]'},
}
def __init__(self, *, value=None, **kwargs) -> None:
super(OperationListResult, self).__init__(**kwargs)
self.value = value

Просмотреть файл

@ -0,0 +1,54 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Operation(Model):
"""REST API operation definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: The name of the operation being performed on this particular
object.
:vartype name: str
:ivar display: The localized display information for this particular
operation or action.
:vartype display: ~azure.mgmt.rdbms.postgresql.models.OperationDisplay
:ivar origin: The intended executor of the operation. Possible values
include: 'NotSpecified', 'user', 'system'
:vartype origin: str or
~azure.mgmt.rdbms.postgresql.models.OperationOrigin
:ivar properties: Additional descriptions for the operation.
:vartype properties: dict[str, object]
"""
_validation = {
'name': {'readonly': True},
'display': {'readonly': True},
'origin': {'readonly': True},
'properties': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
'origin': {'key': 'origin', 'type': 'str'},
'properties': {'key': 'properties', 'type': '{object}'},
}
def __init__(self, **kwargs) -> None:
super(Operation, self).__init__(**kwargs)
self.name = None
self.display = None
self.origin = None
self.properties = None

Просмотреть файл

@ -28,7 +28,7 @@ class PerformanceTierProperties(Model):
'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'},
}
def __init__(self, id=None, service_level_objectives=None):
super(PerformanceTierProperties, self).__init__()
self.id = id
self.service_level_objectives = service_level_objectives
def __init__(self, **kwargs):
super(PerformanceTierProperties, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.service_level_objectives = kwargs.get('service_level_objectives', None)

Просмотреть файл

@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class PerformanceTierProperties(Model):
"""Performance tier properties.
:param id: ID of the performance tier.
:type id: str
:param service_level_objectives: Service level objectives associated with
the performance tier
:type service_level_objectives:
list[~azure.mgmt.rdbms.postgresql.models.PerformanceTierServiceLevelObjectives]
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'service_level_objectives': {'key': 'serviceLevelObjectives', 'type': '[PerformanceTierServiceLevelObjectives]'},
}
def __init__(self, *, id: str=None, service_level_objectives=None, **kwargs) -> None:
super(PerformanceTierProperties, self).__init__(**kwargs)
self.id = id
self.service_level_objectives = service_level_objectives

Просмотреть файл

@ -47,13 +47,13 @@ class PerformanceTierServiceLevelObjectives(Model):
'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'},
}
def __init__(self, id=None, edition=None, v_core=None, hardware_generation=None, max_backup_retention_days=None, min_backup_retention_days=None, max_storage_mb=None, min_storage_mb=None):
super(PerformanceTierServiceLevelObjectives, self).__init__()
self.id = id
self.edition = edition
self.v_core = v_core
self.hardware_generation = hardware_generation
self.max_backup_retention_days = max_backup_retention_days
self.min_backup_retention_days = min_backup_retention_days
self.max_storage_mb = max_storage_mb
self.min_storage_mb = min_storage_mb
def __init__(self, **kwargs):
super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.edition = kwargs.get('edition', None)
self.v_core = kwargs.get('v_core', None)
self.hardware_generation = kwargs.get('hardware_generation', None)
self.max_backup_retention_days = kwargs.get('max_backup_retention_days', None)
self.min_backup_retention_days = kwargs.get('min_backup_retention_days', None)
self.max_storage_mb = kwargs.get('max_storage_mb', None)
self.min_storage_mb = kwargs.get('min_storage_mb', None)

Просмотреть файл

@ -0,0 +1,59 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class PerformanceTierServiceLevelObjectives(Model):
"""Service level objectives for performance tier.
:param id: ID for the service level objective.
:type id: str
:param edition: Edition of the performance tier.
:type edition: str
:param v_core: vCore associated with the service level objective
:type v_core: int
:param hardware_generation: Hardware generation associated with the
service level objective
:type hardware_generation: str
:param max_backup_retention_days: Maximum Backup retention in days for the
performance tier edition
:type max_backup_retention_days: int
:param min_backup_retention_days: Minimum Backup retention in days for the
performance tier edition
:type min_backup_retention_days: int
:param max_storage_mb: Max storage allowed for a server.
:type max_storage_mb: int
:param min_storage_mb: Max storage allowed for a server.
:type min_storage_mb: int
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'edition': {'key': 'edition', 'type': 'str'},
'v_core': {'key': 'vCore', 'type': 'int'},
'hardware_generation': {'key': 'hardwareGeneration', 'type': 'str'},
'max_backup_retention_days': {'key': 'maxBackupRetentionDays', 'type': 'int'},
'min_backup_retention_days': {'key': 'minBackupRetentionDays', 'type': 'int'},
'max_storage_mb': {'key': 'maxStorageMB', 'type': 'int'},
'min_storage_mb': {'key': 'minStorageMB', 'type': 'int'},
}
def __init__(self, *, id: str=None, edition: str=None, v_core: int=None, hardware_generation: str=None, max_backup_retention_days: int=None, min_backup_retention_days: int=None, max_storage_mb: int=None, min_storage_mb: int=None, **kwargs) -> None:
super(PerformanceTierServiceLevelObjectives, self).__init__(**kwargs)
self.id = id
self.edition = edition
self.v_core = v_core
self.hardware_generation = hardware_generation
self.max_backup_retention_days = max_backup_retention_days
self.min_backup_retention_days = min_backup_retention_days
self.max_storage_mb = max_storage_mb
self.min_storage_mb = min_storage_mb

Просмотреть файл

@ -12,39 +12,39 @@
from enum import Enum
class ServerVersion(Enum):
class ServerVersion(str, Enum):
nine_full_stop_five = "9.5"
nine_full_stop_six = "9.6"
class SslEnforcementEnum(Enum):
class SslEnforcementEnum(str, Enum):
enabled = "Enabled"
disabled = "Disabled"
class ServerState(Enum):
class ServerState(str, Enum):
ready = "Ready"
dropping = "Dropping"
disabled = "Disabled"
class GeoRedundantBackup(Enum):
class GeoRedundantBackup(str, Enum):
enabled = "Enabled"
disabled = "Disabled"
class SkuTier(Enum):
class SkuTier(str, Enum):
basic = "Basic"
general_purpose = "GeneralPurpose"
memory_optimized = "MemoryOptimized"
class OperationOrigin(Enum):
class OperationOrigin(str, Enum):
not_specified = "NotSpecified"
user = "user"

Просмотреть файл

@ -38,8 +38,8 @@ class ProxyResource(Model):
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self):
super(ProxyResource, self).__init__()
def __init__(self, **kwargs):
super(ProxyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None

Просмотреть файл

@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ProxyResource(Model):
"""Resource properties.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(ProxyResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None

Просмотреть файл

@ -18,13 +18,15 @@ class Server(TrackedResource):
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: The location the resource resides in.
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
@ -77,13 +79,13 @@ class Server(TrackedResource):
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
}
def __init__(self, location, tags=None, sku=None, administrator_login=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name=None, earliest_restore_date=None, storage_profile=None):
super(Server, self).__init__(location=location, tags=tags)
self.sku = sku
self.administrator_login = administrator_login
self.version = version
self.ssl_enforcement = ssl_enforcement
self.user_visible_state = user_visible_state
self.fully_qualified_domain_name = fully_qualified_domain_name
self.earliest_restore_date = earliest_restore_date
self.storage_profile = storage_profile
def __init__(self, **kwargs):
super(Server, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.administrator_login = kwargs.get('administrator_login', None)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.user_visible_state = kwargs.get('user_visible_state', None)
self.fully_qualified_domain_name = kwargs.get('fully_qualified_domain_name', None)
self.earliest_restore_date = kwargs.get('earliest_restore_date', None)
self.storage_profile = kwargs.get('storage_profile', None)

Просмотреть файл

@ -15,12 +15,14 @@ from msrest.serialization import Model
class ServerForCreate(Model):
"""Represents a server to be created.
All required parameters must be populated in order to send to Azure.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql.models.Sku
:param properties: Properties of the server.
:param properties: Required. Properties of the server.
:type properties:
~azure.mgmt.rdbms.postgresql.models.ServerPropertiesForCreate
:param location: The location the resource resides in.
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
@ -38,9 +40,9 @@ class ServerForCreate(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, properties, location, sku=None, tags=None):
super(ServerForCreate, self).__init__()
self.sku = sku
self.properties = properties
self.location = location
self.tags = tags
def __init__(self, **kwargs):
super(ServerForCreate, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.properties = kwargs.get('properties', None)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerForCreate(Model):
"""Represents a server to be created.
All required parameters must be populated in order to send to Azure.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql.models.Sku
:param properties: Required. Properties of the server.
:type properties:
~azure.mgmt.rdbms.postgresql.models.ServerPropertiesForCreate
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
_validation = {
'properties': {'required': True},
'location': {'required': True},
}
_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'properties': {'key': 'properties', 'type': 'ServerPropertiesForCreate'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, properties, location: str, sku=None, tags=None, **kwargs) -> None:
super(ServerForCreate, self).__init__(**kwargs)
self.sku = sku
self.properties = properties
self.location = location
self.tags = tags

Просмотреть файл

@ -17,7 +17,9 @@ class ServerPropertiesForCreate(Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ServerPropertiesForDefaultCreate,
ServerPropertiesForRestore
ServerPropertiesForRestore, ServerPropertiesForGeoRestore
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
@ -27,7 +29,7 @@ class ServerPropertiesForCreate(Model):
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
"""
@ -43,12 +45,12 @@ class ServerPropertiesForCreate(Model):
}
_subtype_map = {
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore'}
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'}
}
def __init__(self, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForCreate, self).__init__()
self.version = version
self.ssl_enforcement = ssl_enforcement
self.storage_profile = storage_profile
def __init__(self, **kwargs):
super(ServerPropertiesForCreate, self).__init__(**kwargs)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.storage_profile = kwargs.get('storage_profile', None)
self.create_mode = None

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerPropertiesForCreate(Model):
"""The properties used to create a new server.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ServerPropertiesForDefaultCreate,
ServerPropertiesForRestore, ServerPropertiesForGeoRestore
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
"""
_validation = {
'create_mode': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
}
_subtype_map = {
'create_mode': {'Default': 'ServerPropertiesForDefaultCreate', 'PointInTimeRestore': 'ServerPropertiesForRestore', 'GeoRestore': 'ServerPropertiesForGeoRestore'}
}
def __init__(self, *, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForCreate, self).__init__(**kwargs)
self.version = version
self.ssl_enforcement = ssl_enforcement
self.storage_profile = storage_profile
self.create_mode = None

Просмотреть файл

@ -15,6 +15,8 @@ from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
"""The properties used to create a new server.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
@ -23,14 +25,14 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param administrator_login: The administrator's login name of a server.
Can only be specified when the server is being created (and is required
for creation).
:param administrator_login: Required. The administrator's login name of a
server. Can only be specified when the server is being created (and is
required for creation).
:type administrator_login: str
:param administrator_login_password: The password of the administrator
login.
:param administrator_login_password: Required. The password of the
administrator login.
:type administrator_login_password: str
"""
@ -49,8 +51,8 @@ class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'},
}
def __init__(self, administrator_login, administrator_login_password, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile)
self.administrator_login = administrator_login
self.administrator_login_password = administrator_login_password
def __init__(self, **kwargs):
super(ServerPropertiesForDefaultCreate, self).__init__(**kwargs)
self.administrator_login = kwargs.get('administrator_login', None)
self.administrator_login_password = kwargs.get('administrator_login_password', None)
self.create_mode = 'Default'

Просмотреть файл

@ -0,0 +1,58 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForDefaultCreate(ServerPropertiesForCreate):
"""The properties used to create a new server.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param administrator_login: Required. The administrator's login name of a
server. Can only be specified when the server is being created (and is
required for creation).
:type administrator_login: str
:param administrator_login_password: Required. The password of the
administrator login.
:type administrator_login_password: str
"""
_validation = {
'create_mode': {'required': True},
'administrator_login': {'required': True},
'administrator_login_password': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'administrator_login': {'key': 'administratorLogin', 'type': 'str'},
'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'},
}
def __init__(self, *, administrator_login: str, administrator_login_password: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForDefaultCreate, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.administrator_login = administrator_login
self.administrator_login_password = administrator_login_password
self.create_mode = 'Default'

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForGeoRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring to a different
region from a geo replicated backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
}
def __init__(self, **kwargs):
super(ServerPropertiesForGeoRestore, self).__init__(**kwargs)
self.source_server_id = kwargs.get('source_server_id', None)
self.create_mode = 'GeoRestore'

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForGeoRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring to a different
region from a geo replicated backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
}
def __init__(self, *, source_server_id: str, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForGeoRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.source_server_id = source_server_id
self.create_mode = 'GeoRestore'

Просмотреть файл

@ -13,7 +13,9 @@ from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForRestore(ServerPropertiesForCreate):
"""The properties to a new server by restoring from a backup.
"""The properties used to create a new server by restoring from a backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
@ -23,12 +25,12 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate):
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Constant filled by server.
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: The source server id to restore from.
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
:param restore_point_in_time: Restore point creation time (ISO8601
format), specifying the time to restore from.
:param restore_point_in_time: Required. Restore point creation time
(ISO8601 format), specifying the time to restore from.
:type restore_point_in_time: datetime
"""
@ -47,8 +49,8 @@ class ServerPropertiesForRestore(ServerPropertiesForCreate):
'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'},
}
def __init__(self, source_server_id, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None):
super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile)
self.source_server_id = source_server_id
self.restore_point_in_time = restore_point_in_time
def __init__(self, **kwargs):
super(ServerPropertiesForRestore, self).__init__(**kwargs)
self.source_server_id = kwargs.get('source_server_id', None)
self.restore_point_in_time = kwargs.get('restore_point_in_time', None)
self.create_mode = 'PointInTimeRestore'

Просмотреть файл

@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .server_properties_for_create import ServerPropertiesForCreate
class ServerPropertiesForRestore(ServerPropertiesForCreate):
"""The properties used to create a new server by restoring from a backup.
All required parameters must be populated in order to send to Azure.
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param create_mode: Required. Constant filled by server.
:type create_mode: str
:param source_server_id: Required. The source server id to restore from.
:type source_server_id: str
:param restore_point_in_time: Required. Restore point creation time
(ISO8601 format), specifying the time to restore from.
:type restore_point_in_time: datetime
"""
_validation = {
'create_mode': {'required': True},
'source_server_id': {'required': True},
'restore_point_in_time': {'required': True},
}
_attribute_map = {
'version': {'key': 'version', 'type': 'str'},
'ssl_enforcement': {'key': 'sslEnforcement', 'type': 'SslEnforcementEnum'},
'storage_profile': {'key': 'storageProfile', 'type': 'StorageProfile'},
'create_mode': {'key': 'createMode', 'type': 'str'},
'source_server_id': {'key': 'sourceServerId', 'type': 'str'},
'restore_point_in_time': {'key': 'restorePointInTime', 'type': 'iso-8601'},
}
def __init__(self, *, source_server_id: str, restore_point_in_time, version=None, ssl_enforcement=None, storage_profile=None, **kwargs) -> None:
super(ServerPropertiesForRestore, self).__init__(version=version, ssl_enforcement=ssl_enforcement, storage_profile=storage_profile, **kwargs)
self.source_server_id = source_server_id
self.restore_point_in_time = restore_point_in_time
self.create_mode = 'PointInTimeRestore'

Просмотреть файл

@ -0,0 +1,91 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from .tracked_resource import TrackedResource
class Server(TrackedResource):
"""Represents a server.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Required. The location the resource resides in.
:type location: str
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql.models.Sku
:param administrator_login: The administrator's login name of a server.
Can only be specified when the server is being created (and is required
for creation).
:type administrator_login: str
:param version: Server version. Possible values include: '9.5', '9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param user_visible_state: A state of a server that is visible to user.
Possible values include: 'Ready', 'Dropping', 'Disabled'
:type user_visible_state: str or
~azure.mgmt.rdbms.postgresql.models.ServerState
:param fully_qualified_domain_name: The fully qualified domain name of a
server.
:type fully_qualified_domain_name: str
:param earliest_restore_date: Earliest restore point creation time
(ISO8601 format)
:type earliest_restore_date: datetime
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'location': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'sku': {'key': 'sku', 'type': 'Sku'},
'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'},
'user_visible_state': {'key': 'properties.userVisibleState', 'type': 'str'},
'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'},
'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
}
def __init__(self, *, location: str, tags=None, sku=None, administrator_login: str=None, version=None, ssl_enforcement=None, user_visible_state=None, fully_qualified_domain_name: str=None, earliest_restore_date=None, storage_profile=None, **kwargs) -> None:
super(Server, self).__init__(location=location, tags=tags, **kwargs)
self.sku = sku
self.administrator_login = administrator_login
self.version = version
self.ssl_enforcement = ssl_enforcement
self.user_visible_state = user_visible_state
self.fully_qualified_domain_name = fully_qualified_domain_name
self.earliest_restore_date = earliest_restore_date
self.storage_profile = storage_profile

Просмотреть файл

@ -42,11 +42,11 @@ class ServerUpdateParameters(Model):
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, sku=None, storage_profile=None, administrator_login_password=None, version=None, ssl_enforcement=None, tags=None):
super(ServerUpdateParameters, self).__init__()
self.sku = sku
self.storage_profile = storage_profile
self.administrator_login_password = administrator_login_password
self.version = version
self.ssl_enforcement = ssl_enforcement
self.tags = tags
def __init__(self, **kwargs):
super(ServerUpdateParameters, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.storage_profile = kwargs.get('storage_profile', None)
self.administrator_login_password = kwargs.get('administrator_login_password', None)
self.version = kwargs.get('version', None)
self.ssl_enforcement = kwargs.get('ssl_enforcement', None)
self.tags = kwargs.get('tags', None)

Просмотреть файл

@ -0,0 +1,52 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class ServerUpdateParameters(Model):
"""Parameters allowd to update for a server.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.postgresql.models.Sku
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.postgresql.models.StorageProfile
:param administrator_login_password: The password of the administrator
login.
:type administrator_login_password: str
:param version: The version of a server. Possible values include: '9.5',
'9.6'
:type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion
:param ssl_enforcement: Enable ssl enforcement or not when connect to
server. Possible values include: 'Enabled', 'Disabled'
:type ssl_enforcement: str or
~azure.mgmt.rdbms.postgresql.models.SslEnforcementEnum
:param tags: Application-specific metadata in the form of key-value pairs.
:type tags: dict[str, str]
"""
_attribute_map = {
'sku': {'key': 'sku', 'type': 'Sku'},
'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'},
'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'},
'version': {'key': 'properties.version', 'type': 'str'},
'ssl_enforcement': {'key': 'properties.sslEnforcement', 'type': 'SslEnforcementEnum'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, sku=None, storage_profile=None, administrator_login_password: str=None, version=None, ssl_enforcement=None, tags=None, **kwargs) -> None:
super(ServerUpdateParameters, self).__init__(**kwargs)
self.sku = sku
self.storage_profile = storage_profile
self.administrator_login_password = administrator_login_password
self.version = version
self.ssl_enforcement = ssl_enforcement
self.tags = tags

Просмотреть файл

@ -42,10 +42,10 @@ class Sku(Model):
'family': {'key': 'family', 'type': 'str'},
}
def __init__(self, name=None, tier=None, capacity=None, size=None, family=None):
super(Sku, self).__init__()
self.name = name
self.tier = tier
self.capacity = capacity
self.size = size
self.family = family
def __init__(self, **kwargs):
super(Sku, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.tier = kwargs.get('tier', None)
self.capacity = kwargs.get('capacity', None)
self.size = kwargs.get('size', None)
self.family = kwargs.get('family', None)

Просмотреть файл

@ -0,0 +1,51 @@
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class Sku(Model):
"""Billing information related properties of a server.
:param name: The name of the sku, typically, tier + family + cores, e.g.
B_Gen4_1, GP_Gen5_8.
:type name: str
:param tier: The tier of the particular SKU, e.g. Basic. Possible values
include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'
:type tier: str or ~azure.mgmt.rdbms.postgresql.models.SkuTier
:param capacity: The scale up/out capacity, representing server's compute
units.
:type capacity: int
:param size: The size code, to be interpreted by resource as appropriate.
:type size: str
:param family: The family of hardware.
:type family: str
"""
_validation = {
'capacity': {'minimum': 0},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'capacity': {'key': 'capacity', 'type': 'int'},
'size': {'key': 'size', 'type': 'str'},
'family': {'key': 'family', 'type': 'str'},
}
def __init__(self, *, name: str=None, tier=None, capacity: int=None, size: str=None, family: str=None, **kwargs) -> None:
super(Sku, self).__init__(**kwargs)
self.name = name
self.tier = tier
self.capacity = capacity
self.size = size
self.family = family

Просмотреть файл

@ -31,8 +31,8 @@ class StorageProfile(Model):
'storage_mb': {'key': 'storageMB', 'type': 'int'},
}
def __init__(self, backup_retention_days=None, geo_redundant_backup=None, storage_mb=None):
super(StorageProfile, self).__init__()
self.backup_retention_days = backup_retention_days
self.geo_redundant_backup = geo_redundant_backup
self.storage_mb = storage_mb
def __init__(self, **kwargs):
super(StorageProfile, self).__init__(**kwargs)
self.backup_retention_days = kwargs.get('backup_retention_days', None)
self.geo_redundant_backup = kwargs.get('geo_redundant_backup', None)
self.storage_mb = kwargs.get('storage_mb', None)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше