Hello community, here is the log from the commit of package azure-cli-rdbms for openSUSE:Factory checked in at 2018-10-15 10:47:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-rdbms (Old) and /work/SRC/openSUSE:Factory/.azure-cli-rdbms.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-rdbms" Mon Oct 15 10:47:08 2018 rev:4 rq:641214 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-rdbms/azure-cli-rdbms.changes 2018-05-13 16:03:00.594830542 +0200 +++ /work/SRC/openSUSE:Factory/.azure-cli-rdbms.new/azure-cli-rdbms.changes 2018-10-15 10:47:11.247149969 +0200 @@ -1,0 +2,10 @@ +Mon Sep 17 13:43:44 UTC 2018 - John Paul Adrian Glaubitz <[email protected]> + +- New upstream release + + Version 0.3.1 + + For detailed information about changes see the + HISTORY.txt file provided with this package +- Update Requires from setup.py +- Update %description from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-rdbms-0.2.1.tar.gz New: ---- azure-cli-rdbms-0.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-rdbms.spec ++++++ --- /var/tmp/diff_new_pack.ejgXUw/_old 2018-10-15 10:47:11.927149243 +0200 +++ /var/tmp/diff_new_pack.ejgXUw/_new 2018-10-15 10:47:11.931149239 +0200 @@ -12,12 +12,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: azure-cli-rdbms -Version: 0.2.1 +Version: 0.3.1 Release: 0 Summary: Microsoft Azure CLI 'MySQL and PostgreSQL' Command Module License: MIT @@ -34,7 +34,7 @@ Requires: azure-cli-command-modules-nspkg Requires: azure-cli-core Requires: azure-cli-nspkg -Requires: python3-azure-mgmt-rdbms >= 1.1.0 +Requires: python3-azure-mgmt-rdbms >= 1.2.0 Requires: python3-azure-nspkg Requires: python3-six Conflicts: azure-cli < 2.0.0 @@ -43,6 +43,8 @@ %description Microsoft Azure CLI 'MySQL and PostgreSQL' Command Module +This package is for the 'rdbms' module. +i.e. 'az mysql' and 'az postgres' This package is for the RDBMS module. i.e. 'az mysql' ++++++ azure-cli-rdbms-0.2.1.tar.gz -> azure-cli-rdbms-0.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/HISTORY.rst new/azure-cli-rdbms-0.3.1/HISTORY.rst --- old/azure-cli-rdbms-0.2.1/HISTORY.rst 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/HISTORY.rst 2018-08-23 01:07:57.000000000 +0200 @@ -3,6 +3,30 @@ Release History =============== +0.3.1 ++++++ +* Minor fixes + +0.3.0 ++++++ +* BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + +0.2.5 ++++++ +* Added 'postgres/myql server vnet-rule' commands. + +0.2.4 ++++++ +* Minor fix allowing elastic server update using skuname. + +0.2.3 ++++++ +* Minor fixes. + +0.2.2 ++++++ +* Minor help fix. + 0.2.1 +++++ * Introduce georestore command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/PKG-INFO new/azure-cli-rdbms-0.3.1/PKG-INFO --- old/azure-cli-rdbms-0.2.1/PKG-INFO 2018-04-06 19:33:48.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/PKG-INFO 2018-08-23 01:09:49.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: azure-cli-rdbms -Version: 0.2.1 +Version: 0.3.1 Summary: Microsoft Azure Command-Line Tools MySQL and PostgreSQL Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT -Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'MySQL and PostgreSQL' Command Module ========================================================= This package is for the 'rdbms' module. @@ -19,6 +18,30 @@ Release History =============== + 0.3.1 + +++++ + * Minor fixes + + 0.3.0 + +++++ + * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + + 0.2.5 + +++++ + * Added 'postgres/myql server vnet-rule' commands. + + 0.2.4 + +++++ + * Minor fix allowing elastic server update using skuname. + + 0.2.3 + +++++ + * Minor fixes. + + 0.2.2 + +++++ + * Minor help fix. + 0.2.1 +++++ * Introduce georestore command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/__init__.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/__init__.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/__init__.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/__init__.py 2018-08-23 01:07:57.000000000 +0200 @@ -23,8 +23,8 @@ argument_context_cls=RdbmsArgumentContext, suppress_extension=ModExtensionSuppress( __name__, - 'rdbms', - '0.0.5', + 'rdbms-vnet', + '10.0.1', reason='These commands are now in the CLI.', recommend_remove=True)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_client_factory.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_client_factory.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_client_factory.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_client_factory.py 2018-08-23 01:07:57.000000000 +0200 @@ -110,3 +110,11 @@ def cf_postgres_db(cli_ctx, _): return get_postgresql_management_client(cli_ctx).databases + + +def cf_mysql_virtual_network_rules_operations(cli_ctx, _): + return get_mysql_management_client(cli_ctx).virtual_network_rules + + +def cf_postgres_virtual_network_rules_operations(cli_ctx, _): + return get_postgresql_management_client(cli_ctx).virtual_network_rules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_help.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_help.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_help.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_help.py 2018-08-23 01:07:57.000000000 +0200 @@ -1,3 +1,4 @@ +# 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. @@ -59,11 +60,15 @@ 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 sku. + text: az {0} server update -g testgroup -n testsvrnew --sku-name GP_Gen4_4 - 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 wait'.format(command_group)] = """ + type: command + short-summary: Wait for server to satisfy certain conditions. + """ helps['{} server delete'.format(command_group)] = """ type: command short-summary: Delete a server. @@ -113,6 +118,23 @@ type: command short-summary: List all firewall rules for a server. """ + helps['{} server vnet-rule'.format(command_group)] = """ + type: group + short-summary: Manage a server's virtual network rules. + """ + helps['{} server vnet-rule update'.format(command_group)] = """ + type: command + short-summary: Update a virtual network rule. + """ + helps['{} server vnet-rule create'.format(command_group)] = """ + type: command + short-summary: Create a virtual network rule to allows access to a {} server. + examples: + - name: Create a virtual network rule by providing the subnet id. + text: az {} server vnet-rule create -g testgroup -s testsvr -n vnetRuleName --subnet /subscriptions/{{SubID}}/resourceGroups/{{ResourceGroup}}/providers/Microsoft.Network/virtualNetworks/vnetName/subnets/subnetName + - name: Create a vnet rule by providing the vnet and subnet name. The subnet id is created by taking the resource group name and subscription id of the server. + text: az {} server vnet-rule create -g testgroup -s testsvr -n vnetRuleName --subnet subnetName --vnet-name vnetName + """.format(server_type, command_group, command_group) helps['{} server configuration'.format(command_group)] = """ type: group short-summary: Manage configuration values for a server. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_params.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_params.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/_params.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/_params.py 2018-08-23 01:07:57.000000000 +0200 @@ -5,8 +5,12 @@ # 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 azure.cli.command_modules.rdbms.validators import configuration_value_validator +from azure.cli.core.commands.parameters import ( + get_resource_name_completion_list, + tags_type, get_location_type, + get_enum_type, + get_three_state_flag) +from azure.cli.command_modules.rdbms.validators import configuration_value_validator, validate_subnet def load_arguments(self, _): # pylint: disable=too-many-statements @@ -30,6 +34,10 @@ c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False) c.argument('version', help='Server version') + with self.argument_context('{} server update'.format(command_group)) as c: + c.ignore('family', 'capacity', 'tier') + c.argument('sku_name', options_list=['--sku-name'], help='The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.') + with self.argument_context('{} server restore'. format(command_group)) as c: c.argument('source_server', 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') @@ -58,7 +66,7 @@ for scope in ['mysql server', 'postgres server']: with self.argument_context(scope) as c: - c.ignore('size', 'family', 'capacity', 'tier') + c.ignore('family', 'capacity', 'tier') 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']) @@ -89,6 +97,17 @@ 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 vnet-rule', 'postgres server vnet-rule']: + with self.argument_context(scope) as c: + c.argument('server_name', options_list=['--server-name', '-s']) + c.argument('virtual_network_rule_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the vnet rule.') + c.argument('virtual_network_subnet_id', options_list=['--subnet'], help='Name or ID of the subnet that allows access to an Azure Postgres Server. If subnet name is provided, --vnet-name must be provided.') + c.argument('ignore_missing_vnet_service_endpoint', options_list=['--ignore-missing-endpoint', '-i'], help='Create vnet rule before virtual network has vnet service endpoint enabled', arg_type=get_three_state_flag()) + + for scope in ['postgres server vnet-rule create', 'postgres server vnet-rule update', 'mysql server vnet-rule create', 'mysql server vnet-rule update']: + with self.argument_context(scope) as c: + c.extra('vnet_name', options_list=['--vnet-name'], help='The virtual network name', validator=validate_subnet) + 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']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/commands.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/commands.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/commands.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/commands.py 2018-08-23 01:07:57.000000000 +0200 @@ -9,11 +9,13 @@ cf_mysql_servers, cf_mysql_db, cf_mysql_firewall_rules, + cf_mysql_virtual_network_rules_operations, cf_mysql_config, cf_mysql_log, cf_postgres_servers, cf_postgres_db, cf_postgres_firewall_rules, + cf_postgres_virtual_network_rules_operations, cf_postgres_config, cf_postgres_log) @@ -43,6 +45,16 @@ client_factory=cf_postgres_firewall_rules ) + mysql_vnet_sdk = CliCommandType( + operations_tmpl='azure.mgmt.rdbms.mysql.operations.virtual_network_rules_operations#VirtualNetworkRulesOperations.{}', + client_factory=cf_mysql_virtual_network_rules_operations + ) + + postgres_vnet_sdk = CliCommandType( + operations_tmpl='azure.mgmt.rdbms.postgresql.operations.virtual_network_rules_operations#VirtualNetworkRulesOperations.{}', + client_factory=cf_postgres_virtual_network_rules_operations + ) + mysql_config_sdk = CliCommandType( operations_tmpl='azure.mgmt.rdbms.mysql.operations.configurations_operations#ConfigurationsOperations.{}', client_factory=cf_mysql_config @@ -78,31 +90,31 @@ g.custom_command('restore', '_server_restore', supports_no_wait=True) g.custom_command('georestore', '_server_georestore', supports_no_wait=True) g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_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_wait_command('wait', '_server_mysql_get') with self.command_group('postgres server', postgres_servers_sdk, client_factory=cf_postgres_servers) as g: g.custom_command('create', '_server_create') g.custom_command('restore', '_server_restore', supports_no_wait=True) g.custom_command('georestore', '_server_georestore', supports_no_wait=True) g.command('delete', 'delete', confirmation=True) - g.command('show', 'get') + g.show_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) + g.custom_wait_command('wait', '_server_postgresql_get') 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.show_command('show', 'get') g.command('list', 'list_by_server') g.generic_update_command('update', getter_name='_firewall_rule_custom_getter', getter_type=rdbms_custom, @@ -112,21 +124,35 @@ 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.show_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 vnet-rule', mysql_vnet_sdk) as g: + g.command('create', 'create_or_update') + g.command('delete', 'delete') + g.show_command('show', 'get') + g.command('list', 'list_by_server') + g.generic_update_command('update') + + with self.command_group('postgres server vnet-rule', postgres_vnet_sdk) as g: + g.command('create', 'create_or_update') + g.command('delete', 'delete') + g.show_command('show', 'get') + g.command('list', 'list_by_server') + g.generic_update_command('update') + with self.command_group('mysql server configuration', mysql_config_sdk) as g: g.command('set', 'create_or_update') - g.command('show', 'get') + g.show_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.show_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: @@ -140,11 +166,11 @@ 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.show_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.show_command('show', 'get') g.command('list', 'list_by_server') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/custom.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/custom.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/custom.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/custom.py 2018-08-23 01:07:57.000000000 +0200 @@ -16,7 +16,7 @@ def _server_create(cmd, client, resource_group_name, server_name, sku_name, no_wait=False, 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): + geo_redundant_backup=None, ssl_enforcement=None, storage_mb=None, tags=None, version=None): provider = 'Microsoft.DBForMySQL' if isinstance(client, ServersOperations) else 'Microsoft.DBforPostgreSQL' parameters = None if provider == 'Microsoft.DBForMySQL': @@ -31,7 +31,7 @@ storage_profile=mysql.models.StorageProfile( backup_retention_days=backup_retention, geo_redundant_backup=geo_redundant_backup, - storage_mb=storage_size)), + storage_mb=storage_mb)), location=location, tags=tags) elif provider == 'Microsoft.DBforPostgreSQL': @@ -46,7 +46,7 @@ storage_profile=postgresql.models.StorageProfile( backup_retention_days=backup_retention, geo_redundant_backup=geo_redundant_backup, - storage_mb=storage_size)), + storage_mb=storage_mb)), location=location, tags=tags) @@ -59,15 +59,6 @@ def _server_restore(cmd, client, resource_group_name, server_name, source_server, restore_point_in_time, no_wait=False): 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( - properties=mysql.models.ServerPropertiesForRestore()) - elif provider == 'Microsoft.DBforPostgreSQL': - from azure.mgmt.rdbms import postgresql - parameters = postgresql.models.ServerForCreate( - properties=postgresql.models.ServerPropertiesForRestore()) - if not is_valid_resource_id(source_server): if len(source_server.split('/')) == 1: source_server = resource_id( @@ -79,6 +70,21 @@ else: raise ValueError('The provided source-server {} is invalid.'.format(source_server)) + if provider == 'Microsoft.DBForMySQL': + from azure.mgmt.rdbms import mysql + parameters = mysql.models.ServerForCreate( + properties=mysql.models.ServerPropertiesForRestore( + source_server_id=source_server, + restore_point_in_time=restore_point_in_time), + location=None) + elif provider == 'Microsoft.DBforPostgreSQL': + from azure.mgmt.rdbms import postgresql + parameters = postgresql.models.ServerForCreate( + properties=postgresql.models.ServerPropertiesForRestore( + source_server_id=source_server, + restore_point_in_time=restore_point_in_time), + location=None) + parameters.properties.source_server_id = source_server parameters.properties.restore_point_in_time = restore_point_in_time @@ -101,6 +107,17 @@ backup_retention=None, geo_redundant_backup=None, no_wait=False, **kwargs): provider = 'Microsoft.DBForMySQL' if isinstance(client, ServersOperations) else 'Microsoft.DBforPostgreSQL' parameters = None + + if not is_valid_resource_id(source_server): + if len(source_server.split('/')) == 1: + source_server = resource_id(subscription=get_subscription_id(cmd.cli_ctx), + resource_group=resource_group_name, + namespace=provider, + type='servers', + name=source_server) + else: + raise ValueError('The provided source-server {} is invalid.'.format(source_server)) + if provider == 'Microsoft.DBForMySQL': from azure.mgmt.rdbms import mysql parameters = mysql.models.ServerForCreate( @@ -108,8 +125,8 @@ properties=mysql.models.ServerPropertiesForGeoRestore( storage_profile=mysql.models.StorageProfile( backup_retention_days=backup_retention, - geo_redundant_backup=geo_redundant_backup - )), + geo_redundant_backup=geo_redundant_backup), + source_server_id=source_server), location=location) elif provider == 'Microsoft.DBforPostgreSQL': from azure.mgmt.rdbms import postgresql @@ -118,20 +135,10 @@ properties=postgresql.models.ServerPropertiesForGeoRestore( storage_profile=postgresql.models.StorageProfile( backup_retention_days=backup_retention, - geo_redundant_backup=geo_redundant_backup - )), + geo_redundant_backup=geo_redundant_backup), + source_server_id=source_server), location=location) - if not is_valid_resource_id(source_server): - if len(source_server.split('/')) == 1: - source_server = resource_id(subscription=get_subscription_id(cmd.cli_ctx), - resource_group=resource_group_name, - namespace=provider, - type='servers', - name=source_server) - else: - raise ValueError('The provided source-server {} is invalid.'.format(source_server)) - parameters.properties.source_server_id = source_server source_server_id_parts = parse_resource_id(source_server) @@ -146,7 +153,7 @@ def _server_update_custom_func(instance, - capacity=None, + sku_name=None, storage_mb=None, backup_retention_days=None, administrator_login_password=None, @@ -158,16 +165,18 @@ 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 + if sku_name: + instance.sku.name = sku_name + instance.sku.capacity = None + instance.sku.family = None + instance.sku.tier = None else: instance.sku = None - if storage_mb is not None: + if storage_mb: instance.storage_profile.storage_mb = storage_mb - if backup_retention_days is not None: + if backup_retention_days: instance.storage_profile.backup_retention_days = backup_retention_days params = ServerUpdateParameters(sku=instance.sku, @@ -223,6 +232,18 @@ return instance +def _custom_vnet_update_get(client, resource_group_name, server_name, virtual_network_rule_name): + return client.get(resource_group_name, server_name, virtual_network_rule_name) + + +def _custom_vnet_update_set(client, resource_group_name, server_name, virtual_network_rule_name, + virtual_network_subnet_id, + ignore_missing_vnet_service_endpoint=None): + return client.create_or_update(resource_group_name, server_name, + virtual_network_rule_name, virtual_network_subnet_id, + ignore_missing_vnet_service_endpoint) + + # Custom functions for server logs def _download_log_files( client, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/validators.py new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/validators.py --- old/azure-cli-rdbms-0.2.1/azure/cli/command_modules/rdbms/validators.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure/cli/command_modules/rdbms/validators.py 2018-08-23 01:07:57.000000000 +0200 @@ -39,3 +39,28 @@ ns.administrator_login_password = prompt_pass(msg='Admin Password: ') except NoTTYException: raise CLIError('Please specify password in non-interactive mode.') + + +# Validates if a subnet id or name have been given by the user. If subnet id is given, vnet-name should not be provided. +def validate_subnet(cmd, namespace): + from msrestazure.tools import resource_id, is_valid_resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + + subnet = namespace.virtual_network_subnet_id + subnet_is_id = is_valid_resource_id(subnet) + vnet = namespace.vnet_name + + if (subnet_is_id and not vnet) or (not subnet and not vnet): + pass + elif subnet and not subnet_is_id and vnet: + namespace.virtual_network_subnet_id = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Network', + type='virtualNetworks', + name=vnet, + child_type_1='subnets', + child_name_1=subnet) + else: + raise CLIError('incorrect usage: [--subnet ID | --subnet NAME --vnet-name NAME]') + delattr(namespace, 'vnet_name') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure_cli_rdbms.egg-info/PKG-INFO new/azure-cli-rdbms-0.3.1/azure_cli_rdbms.egg-info/PKG-INFO --- old/azure-cli-rdbms-0.2.1/azure_cli_rdbms.egg-info/PKG-INFO 2018-04-06 19:33:48.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure_cli_rdbms.egg-info/PKG-INFO 2018-08-23 01:09:49.000000000 +0200 @@ -1,12 +1,11 @@ Metadata-Version: 1.1 Name: azure-cli-rdbms -Version: 0.2.1 +Version: 0.3.1 Summary: Microsoft Azure Command-Line Tools MySQL and PostgreSQL Command Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation Author-email: [email protected] License: MIT -Description-Content-Type: UNKNOWN Description: Microsoft Azure CLI 'MySQL and PostgreSQL' Command Module ========================================================= This package is for the 'rdbms' module. @@ -19,6 +18,30 @@ Release History =============== + 0.3.1 + +++++ + * Minor fixes + + 0.3.0 + +++++ + * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. + + 0.2.5 + +++++ + * Added 'postgres/myql server vnet-rule' commands. + + 0.2.4 + +++++ + * Minor fix allowing elastic server update using skuname. + + 0.2.3 + +++++ + * Minor fixes. + + 0.2.2 + +++++ + * Minor help fix. + 0.2.1 +++++ * Introduce georestore command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/azure_cli_rdbms.egg-info/requires.txt new/azure-cli-rdbms-0.3.1/azure_cli_rdbms.egg-info/requires.txt --- old/azure-cli-rdbms-0.2.1/azure_cli_rdbms.egg-info/requires.txt 2018-04-06 19:33:48.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/azure_cli_rdbms.egg-info/requires.txt 2018-08-23 01:09:49.000000000 +0200 @@ -1,3 +1,3 @@ azure-cli-core -azure-mgmt-rdbms==1.1.0 +azure-mgmt-rdbms==1.2.0 six diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-rdbms-0.2.1/setup.py new/azure-cli-rdbms-0.3.1/setup.py --- old/azure-cli-rdbms-0.2.1/setup.py 2018-04-06 19:33:13.000000000 +0200 +++ new/azure-cli-rdbms-0.3.1/setup.py 2018-08-23 01:07:57.000000000 +0200 @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.1" +VERSION = "0.3.1" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', @@ -29,7 +29,7 @@ DEPENDENCIES = [ 'azure-cli-core', - 'azure-mgmt-rdbms==1.1.0', + 'azure-mgmt-rdbms==1.2.0', 'six' ]
