1111 resource_group_name_type ,
1212 get_location_type ,
1313 tags_type ,
14+ get_three_state_flag ,
1415 get_enum_type )
1516from azure .cli .core .local_context import LocalContextAttribute , LocalContextAction
1617from .utils .validators import (
18+ validate_parameters ,
1719 validate_replica_count ,
1820 public_access_validator ,
1921 ip_address_validator )
@@ -51,7 +53,7 @@ def _horizondb_params():
5153
5254 version_arg_type = CLIArgumentType (
5355 options_list = ['--version' , '-v' ],
54- help = 'The version of the HorizonDb cluster .' )
56+ help = 'Specifies the PostgreSQL major version .' )
5557
5658 replica_count_arg_type = CLIArgumentType (
5759 options_list = ['--replica-count' , '-r' ],
@@ -71,7 +73,32 @@ def _horizondb_params():
7173
7274 parameter_group_arg_type = CLIArgumentType (
7375 options_list = ['--parameter-group' ],
74- help = 'The resource ID of the parameter group.' )
76+ help = 'The resource identifier of the parameter group.' )
77+
78+ parameter_group_name_arg_type = CLIArgumentType (
79+ metavar = 'NAME' ,
80+ options_list = ['--name' , '-n' ],
81+ id_part = 'name' ,
82+ help = 'Name of the parameter group.' )
83+
84+ parameters_arg_type = CLIArgumentType (
85+ options_list = ['--parameters' ],
86+ nargs = '+' ,
87+ required = True ,
88+ validator = validate_parameters ,
89+ help = "Space-separated list of parameters in 'name=value' format. "
90+ "At least one parameter is required; any parameters you do not "
91+ "specify inherit the PostgreSQL defaults for the parameter group." )
92+
93+ description_arg_type = CLIArgumentType (
94+ options_list = ['--description' ],
95+ help = 'Description of the parameter group.' )
96+
97+ apply_immediately_arg_type = CLIArgumentType (
98+ options_list = ['--apply-immediately' ],
99+ arg_type = get_three_state_flag (),
100+ help = 'Indicates whether the parameters should be applied immediately.' )
101+
75102 cluster_name_resource_arg_type = CLIArgumentType (
76103 metavar = 'NAME' ,
77104 options_list = ['--cluster-name' , '-c' ],
@@ -81,17 +108,21 @@ def _horizondb_params():
81108 name = 'cluster_name' ,
82109 actions = [LocalContextAction .SET , LocalContextAction .GET ],
83110 scopes = ['horizondb' ]))
111+
84112 private_endpoint_connection_name_arg_type = CLIArgumentType (
85113 options_list = ['--name' , '-n' ],
86114 help = 'The name of the private endpoint connection associated with the HorizonDB cluster. '
87115 'Required if --id is not specified.' )
116+
88117 private_endpoint_connection_id_arg_type = CLIArgumentType (
89118 options_list = ['--id' ],
90119 help = 'The resource ID of the private endpoint connection associated with the HorizonDB cluster. '
91120 'If specified --cluster-name/-c and --name/-n, this should be omitted.' )
121+
92122 private_endpoint_connection_description_arg_type = CLIArgumentType (
93123 options_list = ['--description' , '-d' ],
94124 help = 'Comments for the approval or rejection.' )
125+
95126 private_link_resource_group_name_arg_type = CLIArgumentType (
96127 options_list = ['--group-name' ],
97128 help = 'The private link resource group name. For HorizonDB this is the pool name, for example DefaultPool.' )
@@ -165,6 +196,21 @@ def _horizondb_params():
165196 with self .argument_context ('horizondb delete' ) as c :
166197 c .argument ('yes' , arg_type = yes_arg_type )
167198
199+ with self .argument_context ('horizondb parameter-group' ) as c :
200+ c .argument ('resource_group_name' , arg_type = resource_group_name_type )
201+ c .argument ('parameter_group_name' , arg_type = parameter_group_name_arg_type )
202+
203+ with self .argument_context ('horizondb parameter-group create' ) as c :
204+ c .argument ('location' , arg_type = get_location_type (self .cli_ctx ), required = False )
205+ c .argument ('tags' , tags_type )
206+ c .argument ('parameters' , arg_type = parameters_arg_type )
207+ c .argument ('description' , arg_type = description_arg_type )
208+ c .argument ('pg_version' , arg_type = version_arg_type , type = int )
209+ c .argument ('apply_immediately' , arg_type = apply_immediately_arg_type )
210+
211+ with self .argument_context ('horizondb parameter-group delete' ) as c :
212+ c .argument ('yes' , arg_type = yes_arg_type )
213+
168214 with self .argument_context ('horizondb firewall-rule' ) as c :
169215 c .argument ('resource_group_name' , arg_type = resource_group_name_type )
170216 c .argument ('cluster_name' , arg_type = firewall_cluster_name_arg_type )
0 commit comments