diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_client_factory.py b/src/azure-cli/azure/cli/command_modules/rdbms/_client_factory.py index 1d12f2cc742..25ac36e0b02 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_client_factory.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_client_factory.py @@ -351,6 +351,10 @@ def cf_postgres_check_resource_availability(cli_ctx, _): return get_postgresql_flexible_management_client(cli_ctx).check_name_availability +def cf_postgres_flexible_db(cli_ctx, _): + return get_postgresql_flexible_management_client(cli_ctx).databases + + def resource_client_factory(cli_ctx, **_): return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py b/src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py index cfddabb74ec..9da68d90142 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py @@ -4,13 +4,14 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=unused-argument, line-too-long - +import datetime as dt +from datetime import datetime import random from knack.log import get_logger from azure.core.paging import ItemPaged - from azure.cli.core.commands import LongRunningOperation, _is_poller from azure.cli.core.util import CLIError +from azure.cli.core.azclierror import ValidationError from azure.mgmt.resource.resources.models import ResourceGroup from ._client_factory import resource_client_factory, cf_mysql_flexible_location_capabilities, cf_postgres_flexible_location_capabilities from .flexible_server_custom_common import firewall_rule_create_func @@ -78,7 +79,6 @@ def generate_password(administrator_login_password): def create_firewall_rule(db_context, cmd, resource_group_name, server_name, start_ip, end_ip): - from datetime import datetime # allow access to azure ip addresses cf_firewall, logging_name = db_context.cf_firewall, db_context.logging_name # NOQA pylint: disable=unused-variable now = datetime.now() @@ -294,5 +294,14 @@ def _map_maintenance_window(day_of_week): def get_current_time(): - import datetime - return datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc, microsecond=0).isoformat() + return datetime.utcnow().replace(tzinfo=dt.timezone.utc, microsecond=0).isoformat() + + +def change_str_to_datetime(date_str): + for fmt in ("%Y-%m-%dT%H:%M:%S+00:00", "%Y-%m-%dT%H:%M:%S.%f+00:00"): + try: + return datetime.strptime(date_str, fmt) + except ValueError: + pass + + raise ValidationError("The format of restore time should be %Y-%m-%dT%H:%M:%S+00:00") diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_help.py b/src/azure-cli/azure/cli/command_modules/rdbms/_help.py index 7d50b64ded8..2fde7b08977 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_help.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_help.py @@ -906,7 +906,7 @@ az postgres server create -l northeurope -g testgroup -n testsvr -u username -p password \\ --sku-name B_Gen5_1 --ssl-enforcement Enabled --minimal-tls-version TLS1_0 --public-network-access Disabled \\ --backup-retention 10 --geo-redundant-backup Enabled --storage-size 51200 \\ - --tags "key=value" --version 11.0 + --tags "key=value" --version 11 """ helps['postgres server delete'] = """ diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_mysql.py b/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_mysql.py index 93c119ace16..0203e822820 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_mysql.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_mysql.py @@ -25,14 +25,33 @@ - name: Create a MySQL flexible server with default params ( resource group, location, servername, username, password ) with public access without any firewall rules. text: | az mysql flexible-server create --public-access none + - name: Create a MySQL flexible server with public access and add client IP address to have access to the server + text: | + az mysql flexible-server create --public-access + - name: Create a MySQL flexible server with public access and add the range of IP address to have access to this server + text: | + az mysql flexible-server create --public-access + - name: Create a MySQL flexible server with public access and allow applications from Azure IP addresses to connect to your flexible server + text: | + az mysql flexible-server create --public-access 0.0.0.0 - name: Create a MySQL flexible server with specified SKU and storage, using defaults from local context. text: | az mysql flexible-server create --name testServer --admin-password password + - name: Create a MySQL flexible server using already existing virtual network and subnet. If provided virtual network and subnet does not exists then virtual network and subnet with default address prefix will be created. + text: | + az mysql flexible-server create --vnet myVnet --subnet mySubnet + - name: Create a MySQL flexible server using already existing virtual network, subnet, and using the subnet ID. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforMySQL/flexibleServers, if not already delegated. + text: | + az mysql flexible-server create --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} + - name: Create a MySQL flexible server using new virtual network, subnet with non-default address prefix. + text: | + az mysql flexible-server create --vnet myVnet --address-prefixes 10.0.0.0/24 --subnet mySubnet --subnet-prefixes 10.0.0.0/24 - name: Create a MySQL flexible server with parameters set. text: | - az mysql flexible-server create --location northeurope --resource-group testGroup --name testServer --admin-user username \\ - --admin-password password --sku-name Standard_B1ms --tier GeneralPurpose --public-access 0.0.0.0 \\ - --storage-size 32 --tags "key=value" --version 5.7 + az mysql flexible-server create --location northeurope --resource-group testGroup \\ + --name testServer --admin-user username --admin-password password \\ + --sku-name Standard-B1ms --tier Burstable --public-access 0.0.0.0 --storage-size 32 \\ + --tags "key=value" --version 5.7 """ helps['mysql flexible-server db'] = """ @@ -47,7 +66,7 @@ - name: Create database 'testDatabase' in the flexible server 'testServer' with the default parameters. text: az mysql flexible-server db create --resource-group testGroup --server-name testServer --database-name testDatabase - name: Create database 'testDatabase' in the flexible server 'testServer' with a given character set and collation rules. - text: az mysql flexible-server db create --resource-group testGroup --server-name testServer --database-name testDatabase// + text: az mysql flexible-server db create --resource-group testGroup --server-name testServer --database-name testDatabase \\ --charset validCharset --collation validCollation """ @@ -132,10 +151,10 @@ short-summary: Update a firewall rule. examples: - name: Update a firewall rule's start IP address. - text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testServer + text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testServer \\ --rule-name allowiprange --start-ip-address 107.46.14.1 - name: Update a firewall rule's start and end IP address. - text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testServer + text: az mysql flexible-server firewall-rule update --resource-group testGroup --name testServer \\ --rule-name allowiprange --start-ip-address 107.46.14.2 --end-ip-address 107.46.14.218 """ @@ -233,8 +252,8 @@ - name: Restore 'testServer2' to 'testServerNew', where 'testServerNew' is in a different resource group from 'testServer2'. text: | az mysql flexible-server restore --resource-group testGroup --name testServerNew \\ - --source-server "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testServer2" \\ - --restore-time "2017-06-15T13:10:00Z" + --source-server "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforMySQL/servers/testServer2" \\ + --restore-time "2017-06-15T13:10:00Z" """ helps['mysql flexible-server show'] = """ diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py b/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py index 3393d890f4f..9eb16692d88 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py @@ -29,15 +29,33 @@ - name: Create a PostgreSQL flexible server with default params ( resource group, location, servername, username, password ) with public access without any firewall rules. text: | az postgres flexible-server create --public-access none - + - name: Create a PostgreSQL flexible server with public access and add client IP address to have access to the server + text: | + az postgres flexible-server create --public-access + - name: Create a PostgreSQL flexible server with public access and add the range of IP address to have access to this server + text: | + az postgres flexible-server create --public-access + - name: Create a PostgreSQL flexible server with public access and allow applications from Azure IP addresses to connect to your flexible server + text: | + az postgres flexible-server create --public-access 0.0.0.0 - name: Create a PostgreSQL flexible server with specified SKU and storage, using defaults from local context. text: | az postgres flexible-server create --name testServer --admin-password password + - name: Create a PostgreSQL flexible server using already existing virtual network and subnet. If provided virtual network and subnet does not exists then virtual network and subnet with default address prefix will be created. + text: | + az postgres flexible-server create --vnet myVnet --subnet mySubnet + - name: Create a PostgreSQL flexible server using already existing virtual network, subnet, and using the subnet ID. The provided subnet should not have any other resource deployed in it and this subnet will be delegated to Microsoft.DBforMySQL/flexibleServers, if not already delegated. + text: | + az postgres flexible-server create --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNetName}/subnets/{SubnetName} + - name: Create a PostgreSQL flexible server using new virtual network, subnet with non-default address prefix. + text: | + az postgres flexible-server create --vnet myVnet --address-prefixes 10.0.0.0/24 --subnet mySubnet --subnet-prefixes 10.0.0.0/24 - name: Create a PostgreSQL flexible server with parameters set. text: | - az postgres flexible-server create --location northeurope --resource-group testGroup --name testServer --admin-user username \\ - --admin-password password --sku-name Standard_D4s_v3 --tier GeneralPurpose --public-access 0.0.0.0 \\ - --storage-size 512 --tags "key=value" --version 12 + az postgres flexible-server create --location northeurope --resource-group testGroup \\ + --name testServer --admin-user username --admin-password password \\ + --sku-name Standard_D4s_v3 --tier GeneralPurpose --public-access 0.0.0.0 \\ + --storage-size 512 --tags "key=value" --version 12 """ helps['postgres flexible-server delete'] = """ @@ -50,6 +68,46 @@ text: az postgres flexible-server delete --resource-group testGroup --name testServer --yes """ +helps['postgres flexible-server db'] = """ +type: group +short-summary: Manage PostgreSQL databases on a flexible server. +""" + +helps['postgres flexible-server db create'] = """ +type: command +short-summary: Create a PostgreSQL database on a flexible server. +examples: + - name: Create database 'testDatabase' in the flexible server 'testServer' with the default parameters. + text: az postgres flexible-server db create --resource-group testGroup --server-name testServer --database-name testDatabase + - name: Create database 'testDatabase' in the flexible server 'testServer' with a given character set and collation rules. + text: az postgres flexible-server db create --resource-group testGroup --server-name testServer --database-name testDatabase \\ + --charset validCharset --collation validCollation +""" + +helps['postgres flexible-server db delete'] = """ +type: command +short-summary: Delete a database on a flexible server. +examples: + - name: Delete database 'testDatabase' in the flexible server 'testServer'. + text: az postgres flexible-server db delete --resource-group testGroup --server-name testServer --database-name testDatabase +""" + +helps['postgres flexible-server db list'] = """ +type: command +short-summary: List the databases for a flexible server. +examples: + - name: List databases in the flexible server 'testServer'. + text: az postgres flexible-server db list --resource-group testGroup --server-name testServer +""" + +helps['postgres flexible-server db show'] = """ +type: command +short-summary: Show the details of a database. +examples: + - name: Show database 'testDatabase' in the server 'testServer'. + text: az postgres flexible-server db show --resource-group testGroup --server-name testServer --database-name testDatabase +""" + helps['postgres flexible-server firewall-rule'] = """ type: group short-summary: Manage firewall rules for a server. @@ -167,8 +225,8 @@ - name: Restore 'testServer2' to 'testServerNew', where 'testServerNew' is in a different resource group from 'testServer2'. text: | az postgres flexible-server restore --resource-group testGroup --name testServerNew \\ - --source-server "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforPostgreSQL/servers/testServer2" \\ - --restore-time "2017-06-15T13:10:00Z" + --source-server "/subscriptions/${SubID}/resourceGroups/${ResourceGroup}/providers/Microsoft.DBforPostgreSQL/servers/testServer2" \\ + --restore-time "2017-06-15T13:10:00Z" """ helps['postgres flexible-server show'] = """ diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_params.py b/src/azure-cli/azure/cli/command_modules/rdbms/_params.py index 04b8af2d2b3..d712b040715 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_params.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_params.py @@ -296,7 +296,7 @@ def _flexible_server_params(command_group): arg_group='Authentication') c.argument('tags', tags_type) c.argument('public_access', options_list=['--public-access'], - help='Determines the public access. Enter single or range of IP addresses to be included in the allowed list of IPs. IP address ranges must be dash-separated and not contain any spaces. Specifying 0.0.0.0 allows public access from any resources deployed within Azure to access your server. Specifying no IP address sets the server in public access mode but does not create a firewall rule. ', + help='Determines the public access. Enter single or range of IP addresses to be included in the allowed list of IPs. IP address ranges must be dash-separated and not contain any spaces. Specifying 0.0.0.0 allows public access from any resources deployed within Azure to access your server. Setting it to "None" sets the server in public access mode but does not create a firewall rule. ', validator=public_access_validator) c.argument('high_availability', default="Disabled", options_list=['--high-availability'], help='Enable or disable high availability feature. Default value is Disabled.') c.argument('assign_identity', options_list=['--assign-identity'], @@ -421,23 +421,25 @@ def _flexible_server_params(command_group): 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. ') # db - if command_group == "mysql": - with self.argument_context('{} flexible-server db'.format(command_group)) as c: - c.argument('server_name', options_list=['--server-name', '-s'], help='Name of the server.') - c.argument('database_name', id_part='child_name_1', arg_type=database_name_arg_type, options_list=['--database-name', '-d'], help='The name of the database.') - - with self.argument_context('{} flexible-server db create'.format(command_group)) as c: - c.argument('charset', options_list=['--charset'], help='The charset of the database') - c.argument('collation', options_list=['--collation'], help='The collation of the database') - c.argument('database_name', arg_type=database_name_setter_arg_type, options_list=['--database-name', '-d'], help='The name of the database.') - - with self.argument_context('{} flexible-server db list'.format(command_group)) as c: - c.argument('server_name', id_part=None, options_list=['--server-name', '-s'], arg_type=server_name_arg_type) - c.argument('database_name', id_part=None, arg_type=database_name_setter_arg_type, options_list=['--database-name', '-d'], help='The name of the database.') - - with self.argument_context('{} flexible-server db delete'.format(command_group)) as c: - c.argument('database_name', arg_type=database_name_getter_arg_type, options_list=['--database-name', '-d'], help='The name of the database.') - c.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.') + for scope in ['create', 'delete', 'list', 'show']: + argument_context_string = '{} flexible-server db {}'.format(command_group, scope) + with self.argument_context(argument_context_string) as c: + c.argument('resource_group_name', arg_type=resource_group_name_type) + c.argument('server_name', id_part='name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type) + c.argument('database_name', id_part='child_name_1', arg_type=database_name_arg_type, options_list=['--database-name', '-d'], help='The name of a database.') + + with self.argument_context('{} flexible-server db list'.format(command_group)) as c: + c.argument('server_name', id_part=None, options_list=['--server-name', '-s'], arg_type=server_name_arg_type) + c.argument('database_name', id_part=None, arg_type=database_name_arg_type, options_list=['--database-name', '-d'], help='The name of the database.') + + with self.argument_context('{} flexible-server db create'.format(command_group)) as c: + c.argument('database_name', id_part='child_name_1', arg_type=database_name_setter_arg_type, options_list=['--database-name', '-d'], help='The name of a database.') + c.argument('charset', help='The charset of the database. The default value is UTF8') + c.argument('collation', help='The collation of the database.') + + with self.argument_context('{} flexible-server db delete'.format(command_group)) as c: + c.argument('database_name', id_part='child_name_1', arg_type=database_name_getter_arg_type, options_list=['--database-name', '-d'], help='The name of a database.') + c.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.') with self.argument_context('{} flexible-server show-connection-string'.format(command_group)) as c: c.argument('server_name', options_list=['--server-name', '-s'], arg_type=server_name_arg_type, help='Name of the server.') diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/commands.py index 4052edf655f..881a4283258 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/commands.py @@ -251,7 +251,7 @@ def load_command_table(self, _): g.custom_wait_command('wait', '_server_mariadb_get') g.command('restart', 'begin_restart') g.command('start', 'begin_start') - g.command('stop', 'begin_stop') + g.custom_command('stop', '_server_stop') with self.command_group('mysql server', mysql_servers_sdk, client_factory=cf_mysql_servers) as g: g.custom_command('create', '_server_create') @@ -267,7 +267,7 @@ def load_command_table(self, _): g.custom_wait_command('wait', '_server_mysql_get') g.command('restart', 'begin_restart') g.command('start', 'begin_start') - g.command('stop', 'begin_stop') + g.custom_command('stop', '_server_stop') g.custom_command('upgrade', '_server_mysql_upgrade') with self.command_group('postgres server', postgres_servers_sdk, client_factory=cf_postgres_servers) as g: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/custom.py b/src/azure-cli/azure/cli/command_modules/rdbms/custom.py index 8d63ffbe46f..3e6e497b45f 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/custom.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/custom.py @@ -438,6 +438,12 @@ def _server_mysql_get(cmd, resource_group_name, server_name): return client.servers.get(resource_group_name, server_name) +def _server_stop(cmd, client, resource_group_name, server_name): + logger.warning("Server will be automatically started after 7 days " + "if you do not perform a manual start operation") + return client.begin_stop(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) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_commands.py index ce092da2afd..e755dac9245 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_commands.py @@ -15,6 +15,7 @@ cf_postgres_flexible_servers, cf_postgres_flexible_firewall_rules, cf_postgres_flexible_config, + cf_postgres_flexible_db, cf_postgres_flexible_location_capabilities) from ._transformers import ( @@ -74,6 +75,11 @@ def load_flexibleserver_command_table(self, _): client_factory=cf_postgres_flexible_config ) + postgres_flexible_db_sdk = CliCommandType( + operations_tmpl='azure.mgmt.rdbms.postgresql_flexibleservers.operations#DatabasesOperations.{}', + client_factory=cf_postgres_flexible_db + ) + postgres_flexible_location_capabilities_sdk = CliCommandType( operations_tmpl='azure.mgmt.rdbms..postgresql_flexibleservers.operations#LocationBasedCapabilitiesOperations.{}', client_factory=cf_postgres_flexible_location_capabilities @@ -95,7 +101,7 @@ def load_flexibleserver_command_table(self, _): g.custom_command('create', 'flexible_server_create', table_transformer=table_transform_output) g.custom_command('restore', 'flexible_server_restore', supports_no_wait=True) g.command('start', 'begin_start') - g.command('stop', 'begin_stop') + g.custom_command('stop', 'flexible_server_stop', custom_command_type=flexible_server_custom_common) g.custom_command('delete', 'server_delete_func') g.show_command('show', 'get') g.custom_command('list', 'server_list_custom_func', custom_command_type=flexible_server_custom_common, table_transformer=table_transform_output_list_servers) @@ -137,6 +143,15 @@ def load_flexibleserver_command_table(self, _): g.custom_command('list-skus', 'flexible_list_skus', table_transformer=table_transform_output_list_skus) g.custom_command('show-connection-string', 'flexible_server_connection_string') + with self.command_group('postgres flexible-server db', postgres_flexible_db_sdk, + custom_command_type=flexible_server_custom_common, + client_factory=cf_postgres_flexible_db, + is_preview=True) as g: + g.custom_command('create', 'database_create_func', custom_command_type=flexible_servers_custom_postgres) + g.custom_command('delete', 'database_delete_func') + g.show_command('show', 'get') + g.command('list', 'list_by_server') + # MySQL commands with self.command_group('mysql flexible-server', mysql_flexible_servers_sdk, custom_command_type=flexible_servers_custom_mysql, @@ -145,7 +160,7 @@ def load_flexibleserver_command_table(self, _): g.custom_command('create', 'flexible_server_create', table_transformer=table_transform_output) g.custom_command('restore', 'flexible_server_restore', supports_no_wait=True) g.command('start', 'begin_start') - g.command('stop', 'begin_stop') + g.custom_command('stop', 'flexible_server_stop', custom_command_type=flexible_server_custom_common) g.custom_command('delete', 'server_delete_func') g.show_command('show', 'get') g.custom_command('list', 'server_list_custom_func', custom_command_type=flexible_server_custom_common, table_transformer=table_transform_output_list_servers) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py index e77f4681705..2f3d9b876c7 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py @@ -16,6 +16,12 @@ def flexible_server_update_get(client, resource_group_name, server_name): return client.get(resource_group_name, server_name) +def flexible_server_stop(cmd, client, resource_group_name=None, server_name=None): + logger.warning("Server will be automatically started after 7 days " + "if you do not perform a manual start operation") + return client.begin_stop(resource_group_name, server_name) + + def flexible_server_update_set(client, resource_group_name, server_name, parameters): return client.begin_update(resource_group_name, server_name, parameters) diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py index 18af734a5cf..b2b886fe410 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_mysql.py @@ -10,6 +10,7 @@ from msrestazure.tools import resource_id, is_valid_resource_id, parse_resource_id # pylint: disable=import-error from knack.log import get_logger from azure.core.exceptions import ResourceNotFoundError +from azure.cli.core.azclierror import RequiredArgumentMissingError from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.util import CLIError, sdk_no_wait from azure.cli.core.local_context import ALL @@ -566,24 +567,30 @@ def _create_database(db_context, cmd, resource_group_name, server_name, database database_client.get(resource_group_name, server_name, database_name) except ResourceNotFoundError: logger.warning('Creating %s database \'%s\'...', logging_name, database_name) - parameters = mysql_flexibleservers.models.Database( - name=database_name, - charset='utf8' - ) + parameters = { + 'name': database_name, + 'charset': 'utf8', + 'collation': 'utf8_general_ci' + } resolve_poller( database_client.begin_create_or_update(resource_group_name, server_name, database_name, parameters), cmd.cli_ctx, '{} Database Create/Update'.format(logging_name)) def database_create_func(client, resource_group_name=None, server_name=None, database_name=None, charset=None, collation=None): - if charset is None: - charset = 'utf8' - parameters = mysql_flexibleservers.models.Database( - name=database_name, - charset=charset, - collation=collation - ) + if charset is None and collation is None: + charset = 'utf8' + collation = 'utf8_general_ci' + logger.warning("Creating database with utf8 charset and utf8_general_ci collation") + elif charset or collation: + raise RequiredArgumentMissingError("charset and collation have to be input together.") + + parameters = { + 'name': database_name, + 'charset': charset, + 'collation': collation + } return client.begin_create_or_update( resource_group_name, diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py index f6b2c9bcba0..4838f55276f 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py @@ -5,24 +5,26 @@ # pylint: disable=unused-argument, line-too-long import datetime as dt -from datetime import datetime from msrestazure.azure_exceptions import CloudError from msrestazure.tools import resource_id, is_valid_resource_id, parse_resource_id # pylint: disable=import-error from knack.log import get_logger from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.local_context import ALL from azure.cli.core.util import CLIError, sdk_no_wait +from azure.core.exceptions import ResourceNotFoundError +from azure.cli.core.azclierror import RequiredArgumentMissingError from azure.mgmt.rdbms import postgresql_flexibleservers -from ._client_factory import cf_postgres_flexible_firewall_rules, get_postgresql_flexible_management_client +from ._client_factory import cf_postgres_flexible_firewall_rules, get_postgresql_flexible_management_client, cf_postgres_flexible_db from .flexible_server_custom_common import user_confirmation from ._flexible_server_util import generate_missing_parameters, resolve_poller, create_firewall_rule, \ parse_public_access_input, generate_password, parse_maintenance_window, get_postgres_list_skus_info, \ - DEFAULT_LOCATION_PG + DEFAULT_LOCATION_PG, change_str_to_datetime from .flexible_server_virtual_network import create_vnet, prepare_vnet from .validators import pg_arguments_validator logger = get_logger(__name__) +DEFAULT_DB_NAME = 'flexibleserverdb' DELEGATION_SERVICE_NAME = "Microsoft.DBforPostgreSQL/flexibleServers" @@ -35,7 +37,7 @@ def flexible_server_create(cmd, client, sku_name=None, tier=None, storage_mb=None, administrator_login=None, administrator_login_password=None, version=None, - tags=None, public_access=None, + tags=None, public_access=None, database_name=None, assign_identity=False, subnet_arm_resource_id=None, high_availability=None, zone=None, vnet_resource_id=None, vnet_address_prefix=None, subnet_address_prefix=None): @@ -47,7 +49,7 @@ def flexible_server_create(cmd, client, storage_mb *= 1024 db_context = DbContext( - azure_sdk=postgresql_flexibleservers, cf_firewall=cf_postgres_flexible_firewall_rules, + azure_sdk=postgresql_flexibleservers, cf_firewall=cf_postgres_flexible_firewall_rules, cf_db=cf_postgres_flexible_db, logging_name='PostgreSQL', command_group='postgres', server_client=client) # Raise error when user passes values for both parameters @@ -104,6 +106,11 @@ def flexible_server_create(cmd, client, start_ip, end_ip = parse_public_access_input(public_access) firewall_id = create_firewall_rule(db_context, cmd, resource_group_name, server_name, start_ip, end_ip) + # Create mysql database if it does not exist + if database_name is None: + database_name = DEFAULT_DB_NAME + _create_database(db_context, cmd, resource_group_name, server_name, database_name) + user = server_result.administrator_login server_id = server_result.id loc = server_result.location @@ -111,8 +118,8 @@ def flexible_server_create(cmd, client, sku = server_result.sku.name host = server_result.fully_qualified_domain_name - logger.warning('Make a note of your password. If you forget, you would have to \ - reset your password with \'az postgres flexible-server update -n %s -g %s -p \'.', + logger.warning('Make a note of your password. If you forget, you would have to' + 'reset your password with "az postgres flexible-server update -n %s -g %s -p ".', server_name, resource_group_name) _update_local_contexts(cmd, server_name, resource_group_name, location, user) @@ -125,8 +132,7 @@ def flexible_server_create(cmd, client, def flexible_server_restore(cmd, client, resource_group_name, server_name, - source_server, restore_point_in_time=None, - location=None, zone=None, no_wait=False): + source_server, restore_point_in_time=None, location=None, zone=None, no_wait=False): provider = 'Microsoft.DBforPostgreSQL' if not is_valid_resource_id(source_server): @@ -142,10 +148,7 @@ def flexible_server_restore(cmd, client, else: source_server_id = source_server - try: - restore_point_in_time = datetime.strptime(restore_point_in_time, "%Y-%m-%dT%H:%M:%S.%f+00:00") - except ValueError: - restore_point_in_time = datetime.strptime(restore_point_in_time, "%Y-%m-%dT%H:%M:%S+00:00") + restore_point_in_time = change_str_to_datetime(restore_point_in_time) restore_point_in_time = restore_point_in_time.replace(tzinfo=dt.timezone.utc) parameters = postgresql_flexibleservers.models.Server( @@ -153,6 +156,8 @@ def flexible_server_restore(cmd, client, source_server_name=source_server, # this should be the source server name, not id create_mode="PointInTimeRestore", availability_zone=zone, + source_resource_group_name=resource_group_name, + source_subscription_id=get_subscription_id(cmd.cli_ctx), location=location) # Retrieve location from same location as source server @@ -161,11 +166,7 @@ def flexible_server_restore(cmd, client, source_server_object = client.get(id_parts['resource_group'], id_parts['name']) parameters.location = source_server_object.location except Exception as e: - raise ValueError('Unable to get source server: {}.'.format(str(e))) - - if source_server_object.id.split('/')[4] != resource_group_name: - raise CLIError("Check if the source server exists in the same resource group you entered. \ - The source server and the restored server should be in the same resource group. ") + raise ResourceNotFoundError(e) return sdk_no_wait(no_wait, client.begin_create, resource_group_name, server_name, parameters) @@ -336,6 +337,46 @@ def _create_server(db_context, cmd, resource_group_name, server_name, location, '{} Server Create'.format(logging_name)) +def _create_database(db_context, cmd, resource_group_name, server_name, database_name): + # check for existing database, create if not + cf_db, logging_name = db_context.cf_db, db_context.logging_name + database_client = cf_db(cmd.cli_ctx, None) + try: + database_client.get(resource_group_name, server_name, database_name) + except ResourceNotFoundError: + logger.warning('Creating %s database \'%s\'...', logging_name, database_name) + parameters = { + 'name': database_name, + 'charset': 'utf8', + 'collation': 'en_US.utf8' + } + resolve_poller( + database_client.begin_create(resource_group_name, server_name, database_name, parameters), cmd.cli_ctx, + '{} Database Create/Update'.format(logging_name)) + + +def database_create_func(client, resource_group_name=None, server_name=None, database_name=None, charset=None, collation=None): + + if charset is None and collation is None: + charset = 'utf8' + collation = 'en_US.utf8' + logger.warning("Creating database with utf8 charset and en_US.utf8 collation") + elif charset or collation: + raise RequiredArgumentMissingError("charset and collation have to be input together.") + + parameters = { + 'name': database_name, + 'charset': charset, + 'collation': collation + } + + return client.begin_create( + resource_group_name, + server_name, + database_name, + parameters) + + def flexible_server_connection_string( server_name='{server}', database_name='{database}', administrator_login='{login}', administrator_login_password='{password}'): @@ -431,10 +472,11 @@ def _update_local_contexts(cmd, server_name, resource_group_name, location, user # pylint: disable=too-many-instance-attributes, too-few-public-methods, useless-object-inheritance class DbContext(object): - def __init__(self, azure_sdk=None, logging_name=None, cf_firewall=None, + def __init__(self, azure_sdk=None, logging_name=None, cf_firewall=None, cf_db=None, command_group=None, server_client=None): self.azure_sdk = azure_sdk self.cf_firewall = cf_firewall self.logging_name = logging_name + self.cf_db = cf_db self.command_group = command_group self.server_client = server_client diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_different_version.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_different_version.yaml index ec2c9eef613..932543eda37 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_different_version.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_different_version.yaml @@ -433,4 +433,148 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-6000005/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-6000005/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-6000005/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_non_default_tiers_select_zone.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_non_default_tiers_select_zone.yaml index 0e411caf4f4..56df04062bc 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_non_default_tiers_select_zone.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_create_non_default_tiers_select_zone.yaml @@ -478,6 +478,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -528,6 +672,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-4000003/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -1009,4 +1297,148 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-5000004/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-5000004/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-5000004/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_database_mgmt.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_database_mgmt.yaml new file mode 100644 index 00000000000..2da3d873475 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_database_mgmt.yaml @@ -0,0 +1,334 @@ +interactions: +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -g -s -d + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T18:48:13.823Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/cb1d35b0-50e7-4f84-8d8c-89b7419e81e7?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:13 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/cb1d35b0-50e7-4f84-8d8c-89b7419e81e7?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db create + Connection: + - keep-alive + ParameterSetName: + - -g -s -d + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/cb1d35b0-50e7-4f84-8d8c-89b7419e81e7?api-version=2020-11-05-preview + response: + body: + string: '{"name":"cb1d35b0-50e7-4f84-8d8c-89b7419e81e7","status":"Succeeded","startTime":"2021-03-10T18:48:13.823Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db create + Connection: + - keep-alive + ParameterSetName: + - -g -s -d + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest","name":"flexibleserverdbtest","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '388' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db show + Connection: + - keep-alive + ParameterSetName: + - -g -s -d + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest","name":"flexibleserverdbtest","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '388' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db list + Connection: + - keep-alive + ParameterSetName: + - -g -s + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases?api-version=2020-11-05-preview + response: + body: + string: '{"value":[{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/azure_maintenance","name":"azure_maintenance","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"},{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/postgres","name":"postgres","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"},{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/azure_sys","name":"azure_sys","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"},{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"},{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest","name":"flexibleserverdbtest","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1896' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -s -d --yes + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdbtest?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"DropServerDatabaseManagementOperation","startTime":"2021-03-10T18:48:27.333Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/36af96ee-c341-477a-a6be-08ea55033221?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '92' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:26 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/36af96ee-c341-477a-a6be-08ea55033221?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server db delete + Connection: + - keep-alive + ParameterSetName: + - -g -s -d --yes + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/36af96ee-c341-477a-a6be-08ea55033221?api-version=2020-11-05-preview + response: + body: + string: '{"name":"36af96ee-c341-477a-a6be-08ea55033221","status":"Succeeded","startTime":"2021-03-10T18:48:27.333Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_high_availability_create.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_high_availability_create.yaml index 4ec37002f4b..1cab1612b03 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_high_availability_create.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_high_availability_create.yaml @@ -621,4 +621,148 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_local_context.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_local_context.yaml index a7f06a42b92..bcf672b17cc 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_local_context.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_local_context.yaml @@ -446,6 +446,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_prepare.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_prepare.yaml index 897cf2cc071..e7cb9520272 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_prepare.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_prepare.yaml @@ -18,7 +18,7 @@ interactions: - --location --name User-Agent: - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 (MSI) accept-language: - en-US method: PUT @@ -30,11 +30,11 @@ interactions: cache-control: - no-cache content-length: - - '316' + - '280' content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:45:41 GMT + - Wed, 10 Mar 2021 23:30:05 GMT expires: - '-1' pragma: @@ -62,10 +62,7 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 - accept-language: - - en-US + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBForPostgreSql/locations/eastus2euap/capabilities?api-version=2020-02-14-preview response: @@ -79,7 +76,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:45:42 GMT + - Wed, 10 Mar 2021 23:30:06 GMT expires: - '-1' pragma: @@ -112,7 +109,7 @@ interactions: - -l -g -n --public-access User-Agent: - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 (MSI) accept-language: - en-US method: HEAD @@ -126,7 +123,7 @@ interactions: content-length: - '0' date: - - Thu, 25 Feb 2021 00:45:41 GMT + - Wed, 10 Mar 2021 23:30:07 GMT expires: - '-1' pragma: @@ -140,8 +137,8 @@ interactions: message: No Content - request: body: '{"location": "eastus2euap", "sku": {"name": "Standard_D2s_v3", "tier": - "GeneralPurpose"}, "properties": {"administratorLogin": "machoSnail8", "administratorLoginPassword": - "axWAvLFymTfAhxsTKIvCbA", "version": "12", "storageProfile": {"backupRetentionDays": + "GeneralPurpose"}, "properties": {"administratorLogin": "prizeWasp7", "administratorLoginPassword": + "UR6wumeNg2MS56qiWQRqFw", "version": "12", "storageProfile": {"backupRetentionDays": 7, "storageMB": 131072}, "haEnabled": "Disabled", "createMode": "Default"}}' headers: Accept: @@ -153,24 +150,21 @@ interactions: Connection: - keep-alive Content-Length: - - '332' + - '331' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 - accept-language: - - en-US + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002?api-version=2020-02-14-preview response: body: - string: '{"operation":"UpsertServerManagementOperationV2","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"operation":"UpsertServerManagementOperationV2","startTime":"2021-03-10T23:30:10.967Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview cache-control: - no-cache content-length: @@ -178,11 +172,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:45:45 GMT + - Wed, 10 Mar 2021 23:30:10 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview pragma: - no-cache server: @@ -200,7 +194,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -210,13 +204,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -225,7 +218,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:46:45 GMT + - Wed, 10 Mar 2021 23:31:11 GMT expires: - '-1' pragma: @@ -247,7 +240,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -257,13 +250,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -272,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:47:46 GMT + - Wed, 10 Mar 2021 23:34:16 GMT expires: - '-1' pragma: @@ -294,7 +286,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -304,13 +296,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -319,7 +310,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:48:46 GMT + - Wed, 10 Mar 2021 23:35:16 GMT expires: - '-1' pragma: @@ -341,7 +332,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -351,13 +342,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -366,7 +356,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:49:46 GMT + - Wed, 10 Mar 2021 23:36:16 GMT expires: - '-1' pragma: @@ -388,7 +378,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -398,13 +388,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -413,7 +402,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:50:47 GMT + - Wed, 10 Mar 2021 23:37:17 GMT expires: - '-1' pragma: @@ -435,7 +424,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -445,13 +434,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -460,7 +448,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:51:46 GMT + - Wed, 10 Mar 2021 23:38:18 GMT expires: - '-1' pragma: @@ -482,7 +470,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -492,13 +480,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"InProgress","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"InProgress","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -507,7 +494,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:52:47 GMT + - Wed, 10 Mar 2021 23:39:18 GMT expires: - '-1' pragma: @@ -529,7 +516,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -539,13 +526,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/ec2ff761-79e4-423c-8fe9-54641154dfdc?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b1a28baa-5349-4de4-91d8-0f7fd9135e24?api-version=2020-02-14-preview response: body: - string: '{"name":"ec2ff761-79e4-423c-8fe9-54641154dfdc","status":"Succeeded","startTime":"2021-02-25T00:45:45.417Z"}' + string: '{"name":"b1a28baa-5349-4de4-91d8-0f7fd9135e24","status":"Succeeded","startTime":"2021-03-10T23:30:10.967Z"}' headers: cache-control: - no-cache @@ -554,7 +540,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:53:47 GMT + - Wed, 10 Mar 2021 23:40:18 GMT expires: - '-1' pragma: @@ -576,7 +562,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -586,23 +572,210 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002?api-version=2020-02-14-preview response: body: - string: '{"sku":{"name":"Standard_D2s_v3","tier":"GeneralPurpose","capacity":2},"properties":{"fullyQualifiedDomainName":"azuredbclitest-000002.postgres.database.azure.com","version":"12","standbyCount":0,"haEnabled":"Disabled","administratorLogin":"machoSnail8","publicNetworkAccess":"Enabled","logBackupStorageSku":"Standard_ZRS","haState":"NotEnabled","state":"Ready","availabilityZone":"1","storageProfile":{"storageMB":131072,"backupRetentionDays":7},"earliestRestoreDate":"2021-02-25T00:53:48.5358183+00:00","byokEnforcement":"Disabled","maintenanceWindow":{"customWindow":"Disabled","dayOfWeek":0,"startHour":0,"startMinute":0}},"location":"East + string: '{"sku":{"name":"Standard_D2s_v3","tier":"GeneralPurpose","capacity":2},"properties":{"fullyQualifiedDomainName":"azuredbclitest-000002.postgres.database.azure.com","version":"12","minorVersion":"5","standbyCount":0,"haEnabled":"Disabled","administratorLogin":"prizeWasp7","publicNetworkAccess":"Enabled","logBackupStorageSku":"Standard_LRS","haState":"NotEnabled","state":"Ready","availabilityZone":"2","storageProfile":{"storageMB":131072,"backupRetentionDays":7},"earliestRestoreDate":"2021-03-10T23:40:19.0833577+00:00","byokEnforcement":"Disabled","geoRedundantBackup":"Disabled","maintenanceWindow":{"customWindow":"Disabled","dayOfWeek":0,"startHour":0,"startMinute":0}},"location":"East US 2 EUAP","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002","name":"azuredbclitest-000002","type":"Microsoft.DBforPostgreSQL/flexibleServers"}' headers: cache-control: - no-cache content-length: - - '1066' + - '1032' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The requested resource + of type ''Microsoft.DBforPostgreSQL/flexibleServers/databases'' with name + ''flexibleserverdb'' was not found."}}' + headers: + cache-control: + - no-cache + content-length: + - '178' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' content-type: - application/json; charset=utf-8 date: - - Thu, 25 Feb 2021 00:53:48 GMT + - Wed, 10 Mar 2021 23:40:30 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_validator.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_validator.yaml index 2c60b132a26..59b61902ab4 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_validator.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_mgmt_validator.yaml @@ -634,6 +634,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000005/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000005/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000005/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_delete.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_delete.yaml index 1c591ecfa2a..071e0322ed9 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_delete.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_delete.yaml @@ -16,7 +16,7 @@ interactions: - --name --yes --no-wait User-Agent: - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 (MSI) accept-language: - en-US method: DELETE @@ -30,11 +30,11 @@ interactions: content-length: - '0' date: - - Thu, 25 Feb 2021 00:17:24 GMT + - Wed, 10 Mar 2021 18:48:39 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcwMjI0Q0FOQVJZOjJEUE9TVEdSRVNGTEVYSUJMRVNFUlZFUnw1OEZENkI0MENGN0Y1Rjk1LUVBU1RVUzJFVUFQIiwiam9iTG9jYXRpb24iOiJlYXN0dXMyZXVhcCJ9?api-version=2020-10-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTElURVNUOjJFUkcwMzEwMDA6MkRQUk9YWVJFU09VUkNFTUdNVFNDRU5BUi1FQVNUVVMyRVVBUCIsImpvYkxvY2F0aW9uIjoiZWFzdHVzMmV1YXAifQ?api-version=2020-10-01 pragma: - no-cache strict-transport-security: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_prepare.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_prepare.yaml index 1d5a17006f0..6d098e1b5e0 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_prepare.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_proxy_resource_mgmt_prepare.yaml @@ -18,7 +18,7 @@ interactions: - --location --name User-Agent: - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 (MSI) accept-language: - en-US method: PUT @@ -30,11 +30,11 @@ interactions: cache-control: - no-cache content-length: - - '328' + - '282' content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:23:27 GMT + - Wed, 10 Mar 2021 18:38:51 GMT expires: - '-1' pragma: @@ -62,10 +62,7 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 - accept-language: - - en-US + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBForPostgreSql/locations/eastus2euap/capabilities?api-version=2020-02-14-preview response: @@ -79,7 +76,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:23:27 GMT + - Wed, 10 Mar 2021 18:38:51 GMT expires: - '-1' pragma: @@ -112,7 +109,7 @@ interactions: - -l -g -n --public-access User-Agent: - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-resource/12.0.0 Azure-SDK-For-Python AZURECLI/2.20.0 (MSI) accept-language: - en-US method: HEAD @@ -126,7 +123,7 @@ interactions: content-length: - '0' date: - - Wed, 24 Feb 2021 22:23:27 GMT + - Wed, 10 Mar 2021 18:38:52 GMT expires: - '-1' pragma: @@ -140,8 +137,8 @@ interactions: message: No Content - request: body: '{"location": "eastus2euap", "sku": {"name": "Standard_D2s_v3", "tier": - "GeneralPurpose"}, "properties": {"administratorLogin": "lovingWalrus6", "administratorLoginPassword": - "NGWqhfC4MyhA7aYiZ4rGHg", "version": "12", "storageProfile": {"backupRetentionDays": + "GeneralPurpose"}, "properties": {"administratorLogin": "lastPie9", "administratorLoginPassword": + "ftHbcR3kXj9Wu1R_NMBIDw", "version": "12", "storageProfile": {"backupRetentionDays": 7, "storageMB": 131072}, "haEnabled": "Disabled", "createMode": "Default"}}' headers: Accept: @@ -153,24 +150,21 @@ interactions: Connection: - keep-alive Content-Length: - - '334' + - '329' Content-Type: - - application/json; charset=utf-8 + - application/json ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 - accept-language: - - en-US + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002?api-version=2020-02-14-preview response: body: - string: '{"operation":"UpsertServerManagementOperationV2","startTime":"2021-02-24T22:23:30.343Z"}' + string: '{"operation":"UpsertServerManagementOperationV2","startTime":"2021-03-10T18:38:56.383Z"}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview cache-control: - no-cache content-length: @@ -178,11 +172,11 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:23:29 GMT + - Wed, 10 Mar 2021 18:38:55 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview pragma: - no-cache server: @@ -200,7 +194,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -210,13 +204,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview response: body: - string: '{"name":"49bb8f4d-57fd-4fca-a609-dbef340ba0de","status":"InProgress","startTime":"2021-02-24T22:23:30.343Z"}' + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' headers: cache-control: - no-cache @@ -225,7 +218,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:24:30 GMT + - Wed, 10 Mar 2021 18:39:56 GMT expires: - '-1' pragma: @@ -247,7 +240,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -257,13 +250,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview response: body: - string: '{"name":"49bb8f4d-57fd-4fca-a609-dbef340ba0de","status":"InProgress","startTime":"2021-02-24T22:23:30.343Z"}' + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' headers: cache-control: - no-cache @@ -272,7 +264,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:25:30 GMT + - Wed, 10 Mar 2021 18:40:57 GMT expires: - '-1' pragma: @@ -294,7 +286,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -304,13 +296,12 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview response: body: - string: '{"name":"49bb8f4d-57fd-4fca-a609-dbef340ba0de","status":"InProgress","startTime":"2021-02-24T22:23:30.343Z"}' + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' headers: cache-control: - no-cache @@ -319,7 +310,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:26:31 GMT + - Wed, 10 Mar 2021 18:41:57 GMT expires: - '-1' pragma: @@ -341,7 +332,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -351,13 +342,242 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview + response: + body: + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:42:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview + response: + body: + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:43:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview + response: + body: + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:44:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview + response: + body: + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:45:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview + response: + body: + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"InProgress","startTime":"2021-03-10T18:38:56.383Z"}' + headers: + cache-control: + - no-cache + content-length: + - '108' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:46:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/49bb8f4d-57fd-4fca-a609-dbef340ba0de?api-version=2020-02-14-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/b82565e6-0c07-4476-af37-627057a74731?api-version=2020-02-14-preview response: body: - string: '{"name":"49bb8f4d-57fd-4fca-a609-dbef340ba0de","status":"Succeeded","startTime":"2021-02-24T22:23:30.343Z"}' + string: '{"name":"b82565e6-0c07-4476-af37-627057a74731","status":"Succeeded","startTime":"2021-03-10T18:38:56.383Z"}' headers: cache-control: - no-cache @@ -366,7 +586,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:27:31 GMT + - Wed, 10 Mar 2021 18:47:59 GMT expires: - '-1' pragma: @@ -388,7 +608,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -398,23 +618,210 @@ interactions: ParameterSetName: - -l -g -n --public-access User-Agent: - - python/3.7.7 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.1 + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002?api-version=2020-02-14-preview response: body: - string: '{"sku":{"name":"Standard_D2s_v3","tier":"GeneralPurpose","capacity":2},"properties":{"fullyQualifiedDomainName":"azuredbclitest-000002.postgres.database.azure.com","version":"12","standbyCount":0,"haEnabled":"Disabled","administratorLogin":"lovingWalrus6","publicNetworkAccess":"Enabled","logBackupStorageSku":"Standard_ZRS","haState":"NotEnabled","state":"Ready","availabilityZone":"3","storageProfile":{"storageMB":131072,"backupRetentionDays":7},"earliestRestoreDate":"2021-02-24T22:27:32.2432+00:00","byokEnforcement":"Disabled","maintenanceWindow":{"customWindow":"Disabled","dayOfWeek":0,"startHour":0,"startMinute":0}},"location":"East + string: '{"sku":{"name":"Standard_D2s_v3","tier":"GeneralPurpose","capacity":2},"properties":{"fullyQualifiedDomainName":"azuredbclitest-000002.postgres.database.azure.com","version":"12","minorVersion":"5","standbyCount":0,"haEnabled":"Disabled","administratorLogin":"lastPie9","publicNetworkAccess":"Enabled","logBackupStorageSku":"Standard_LRS","haState":"NotEnabled","state":"Ready","availabilityZone":"1","storageProfile":{"storageMB":131072,"backupRetentionDays":7},"earliestRestoreDate":"2021-03-10T18:48:00.1766549+00:00","byokEnforcement":"Disabled","geoRedundantBackup":"Disabled","maintenanceWindow":{"customWindow":"Disabled","dayOfWeek":0,"startHour":0,"startMinute":0}},"location":"East US 2 EUAP","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002","name":"azuredbclitest-000002","type":"Microsoft.DBforPostgreSQL/flexibleServers"}' headers: cache-control: - no-cache content-length: - - '1074' + - '1031' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:47:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The requested resource + of type ''Microsoft.DBforPostgreSQL/flexibleServers/databases'' with name + ''flexibleserverdb'' was not found."}}' + headers: + cache-control: + - no-cache + content-length: + - '178' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T18:48:01.573Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/0e795d5e-9f5d-44cf-81d9-64b01b23af64?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/0e795d5e-9f5d-44cf-81d9-64b01b23af64?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/0e795d5e-9f5d-44cf-81d9-64b01b23af64?api-version=2020-11-05-preview + response: + body: + string: '{"name":"0e795d5e-9f5d-44cf-81d9-64b01b23af64","status":"Succeeded","startTime":"2021-03-10T18:48:01.573Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 18:48:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '380' content-type: - application/json; charset=utf-8 date: - - Wed, 24 Feb 2021 22:27:31 GMT + - Wed, 10 Mar 2021 18:48:11 GMT expires: - '-1' pragma: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_ha_server_create.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_ha_server_create.yaml index b7476e4ddb5..25f8c14c879 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_ha_server_create.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_ha_server_create.yaml @@ -965,5 +965,148 @@ interactions: status: code: 200 message: OK - +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-2000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-2000003/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-2000003/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg.yaml index b924edb81e5..ef25133f2c6 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnet_id_in_different_rg.yaml @@ -1006,6 +1006,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver7postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver7postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver7postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -2178,6 +2322,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver8postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver8postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000002/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver8postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnetid.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnetid.yaml index ccaf9e2471f..eb8d5aa33cd 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnetid.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_subnetid.yaml @@ -875,6 +875,294 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver10postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -2395,22 +2683,310 @@ interactions: code: 200 message: OK - request: - body: null + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - postgres flexible-server show + - postgres flexible-server create Connection: - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json ParameterSetName: - - -g -n + - -l -g -n --public-access User-Agent: - - python/3.7.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 - azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.0 - accept-language: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.3 (Windows-10-10.0.19041-SP0) msrest/0.6.18 msrest_azure/0.6.3 + azure-mgmt-rdbms/2020-02-14-privatepreview Azure-SDK-For-Python AZURECLI/2.19.0 + accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres?api-version=2020-02-14-preview @@ -2827,6 +3403,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -2877,6 +3597,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver2postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname.yaml index 2f7405b8ffe..1991f2fea2e 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vname_and_subnetname.yaml @@ -877,6 +877,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver5postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver5postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver5postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -1914,6 +2058,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver6postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver6postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver6postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vnet.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vnet.yaml index c167f066c9c..430572a95b6 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vnet.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_mgmt_supplied_vnet.yaml @@ -1013,6 +1013,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver3postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver3postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver3postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -2097,6 +2241,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -2147,6 +2435,150 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/testvnetserver4postgres/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_server_create.yaml b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_server_create.yaml index c1624b08021..c1f7978ce28 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_server_create.yaml +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/recordings/test_postgres_flexible_server_vnet_server_create.yaml @@ -837,4 +837,148 @@ interactions: status: code: 200 message: OK +- request: + body: '{"properties": {"charset": "utf8", "collation": "en_US.utf8"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"operation":"UpsertServerDatabaseManagementOperation","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + cache-control: + - no-cache + content-length: + - '94' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:20 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/operationResults/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DBforPostgreSQL/locations/eastus2euap/azureAsyncOperation/2c5e9219-dd73-47a9-bd39-d78991692f6b?api-version=2020-11-05-preview + response: + body: + string: '{"name":"2c5e9219-dd73-47a9-bd39-d78991692f6b","status":"Succeeded","startTime":"2021-03-10T23:40:20.653Z"}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - postgres flexible-server create + Connection: + - keep-alive + ParameterSetName: + - -l -g -n --public-access + User-Agent: + - AZURECLI/2.20.0 (MSI) azsdk-python-mgmt-rdbms/unknown Python/3.7.7 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBForPostgreSql/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb?api-version=2020-11-05-preview + response: + body: + string: '{"properties":{"charset":"UTF8","collation":"en_US.utf8"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.DBforPostgreSQL/flexibleServers/azuredbclitest-000002/databases/flexibleserverdb","name":"flexibleserverdb","type":"Microsoft.DBforPostgreSQL/flexibleServers/databases"}' + headers: + cache-control: + - no-cache + content-length: + - '379' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Mar 2021 23:40:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py index e7ff858d417..a0824974941 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands.py @@ -530,7 +530,7 @@ def _test_database_mgmt(self, database_engine, resource_group, server): database_name = 'flexibleserverdbtest' - self.cmd('{} flexible-server db create -g {} -s {} -d {} --collation utf8'.format(database_engine, resource_group, server, database_name), + self.cmd('{} flexible-server db create -g {} -s {} -d {}'.format(database_engine, resource_group, server, database_name), checks=[JMESPathCheck('name', database_name)]) self.cmd('{} flexible-server db show -g {} -s {} -d {}'.format(database_engine, resource_group, server, database_name), diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres.py b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres.py index 0036e53c40c..4b5848f127e 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_rdbms_flexible_commands_postgres.py @@ -333,8 +333,14 @@ def test_postgres_flexible_server_firewall_rule_mgmt(self): def test_postgres_flexible_server_parameter_mgmt(self): self._test_parameter_mgmt('postgres', self.resource_group, self.server) + @AllowLargeResponse() @pytest.mark.order(4) @pytest.mark.depends(on=['PostgresFlexibleServerProxyResourceMgmtScenarioTest::test_postgres_flexible_server_parameter_mgmt']) + def test_postgres_flexible_server_database_mgmt(self): + self._test_database_mgmt('postgres', self.resource_group, self.server) + + @pytest.mark.order(5) + @pytest.mark.depends(on=['PostgresFlexibleServerProxyResourceMgmtScenarioTest::test_postgres_flexible_server_database_mgmt']) def test_postgres_flexible_server_proxy_resource_mgmt_delete(self): self._test_flexible_server_proxy_resource_mgmt_delete(self.resource_group)