Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/azure-cli/azure/cli/command_modules/postgresql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
az postgres flexible-server create --location testlocation --resource-group testgroup \\
--name testserver --admin-user testusername --admin-password testpassword \\
--sku-name Standard_D2s_v3 --tier GeneralPurpose --public-access 153.24.26.117 --storage-size 128 \\
--tags "key=value" --version 18 --zonal-resiliency Enabled --zone 1 \\
--tags "key=value" --version 19 --zonal-resiliency Enabled --zone 1 \\
--standby-zone 3
- name: >
Create server with high availability feature enabled that allows primary and standby in the same zone when multi-zone capacity is unavailable.
Expand Down Expand Up @@ -944,10 +944,10 @@
type: command
short-summary: Upgrade the major version of a flexible server.
examples:
- name: Upgrade server 'testserver' to PostgreSQL major version 18.
text: az postgres flexible-server upgrade -g testgroup -n testserver -v 18
- name: Upgrade server 'testserver' to PostgreSQL major version 19.
text: az postgres flexible-server upgrade -g testgroup -n testserver -v 19
- name: Run pre-upgrade validation for server targeting a later PostgreSQL major version without performing the upgrade.
text: az postgres flexible-server upgrade -g testgroup -n testserver -v 18 --validate-only
text: az postgres flexible-server upgrade -g testgroup -n testserver -v 19 --validate-only
"""

helps['postgres flexible-server identity'] = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def _flexible_server_params(command_group):

version_arg_type = CLIArgumentType(
options_list=['--version'],
help='Server major version.'
help='Server major version. Supported values are: 11, 12, 13, 14, 15, 16, 17, 18, 19.'
Comment thread
nasc17 marked this conversation as resolved.
)

iops_v2_arg_type = CLIArgumentType(
Expand Down Expand Up @@ -265,7 +265,7 @@ def _flexible_server_params(command_group):

pg_version_upgrade_arg_type = CLIArgumentType(
options_list=['--version', '-v'],
help='Server major version.'
help='Server major version. Supported values are: 12, 13, 14, 15, 16, 17, 18, 19.'
)

pg_version_upgrade_validate_arg_type = CLIArgumentType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def flexible_server_create(cmd, client,
server_name = server_name.lower()
high_availability_mode = "Disabled"

list_location_capability_info = get_postgres_location_capability_info(cmd, location)

if (sku_name is None) or (version is None) or \
(zonal_resiliency is not None and zonal_resiliency.lower() != 'disabled'):
list_location_capability_info = get_postgres_location_capability_info(cmd, location)

# set sku_name from capability API
if sku_name is None:
tiers = [item.lower() for item in get_postgres_tiers(list_location_capability_info['sku_info'])]
Expand All @@ -118,8 +118,8 @@ def flexible_server_create(cmd, client,
high_availability_mode = 'SameZone' if single_az and allow_same_zone else 'ZoneRedundant'

pg_arguments_validator(db_context,
list_location_capability_info=list_location_capability_info,
server_name=server_name,
location=location,
tier=tier, sku_name=sku_name,
storage_gb=storage_gb,
auto_grow=auto_grow,
Expand Down Expand Up @@ -456,14 +456,21 @@ def flexible_server_update_custom_func(cmd, client, instance,

# validator
location = ''.join(instance.location.lower().split())
server_id_parts = parse_resource_id(instance.id)
resource_group_name = server_id_parts['resource_group']
server_name = server_id_parts['name']
list_location_capability_info = get_postgres_server_capability_info(
cmd,
resource_group=resource_group_name,
server_name=server_name)
db_context = DbContext(
cmd=cmd, azure_sdk=postgresql_flexibleservers, cf_firewall=cf_postgres_flexible_firewall_rules,
cf_db=cf_postgres_flexible_db, cf_availability=cf_postgres_check_resource_availability,
cf_private_dns_zone_suffix=cf_postgres_flexible_private_dns_zone_suffix_operations,
logging_name='PostgreSQL', command_group='postgres', server_client=client, location=location)

pg_arguments_validator(db_context,
location=location,
list_location_capability_info=list_location_capability_info,
tier=tier,
sku_name=sku_name,
storage_gb=storage_gb,
Expand All @@ -487,10 +494,6 @@ def flexible_server_update_custom_func(cmd, client, instance,
module = import_module(server_module_path)
ServerForPatch = getattr(module, 'ServerForPatch')

server_id_parts = parse_resource_id(instance.id)
resource_group_name = server_id_parts['resource_group']
server_name = server_id_parts['name']

if public_access:
instance.network.public_network_access = public_access

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ def flexible_replica_create(cmd, client, resource_group_name, source_server, nam
sku_name = source_server_object.sku.name
if storage_gb is None and source_server_object is not None:
storage_gb = source_server_object.storage.storage_size_gb
validate_postgres_replica(cmd, tier, location, source_server_object,
sku_name, storage_gb, performance_tier, list_location_capability_info)
validate_postgres_replica(
tier, source_server_object, sku_name, storage_gb,
list_location_capability_info, performance_tier)

if not zone:
zone = _get_pg_replica_zone(list_location_capability_info['zones'],
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading