Skip to content

Commit 11568f4

Browse files
[Network] az network private-endpoint-connection: Add provider Microsoft.Maps/accounts (#32421)
Co-authored-by: map-blasterson <[email protected]>
1 parent 2170a41 commit 11568f4

File tree

13 files changed

+4177
-1760
lines changed

13 files changed

+4177
-1760
lines changed

src/azure-cli/azure/cli/command_modules/maps/_client_factory.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ def cf_accounts(cli_ctx, *_):
1616

1717
def cf_map(cli_ctx, *_):
1818
return cf_maps(cli_ctx).maps
19-
20-
21-
def cf_creator(cli_ctx, *_):
22-
return cf_maps(cli_ctx).creators

src/azure-cli/azure/cli/command_modules/maps/_help.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -171,59 +171,3 @@
171171
text: |-
172172
az maps map list-operation
173173
"""
174-
175-
helps['maps creator'] = """
176-
type: group
177-
short-summary: Manage creator with maps
178-
"""
179-
180-
helps['maps creator list'] = """
181-
type: command
182-
short-summary: "Get all Creator instances for an Azure Maps Account."
183-
examples:
184-
- name: List Creator Resources By Account
185-
text: |-
186-
az maps creator list --account-name "myMapsAccount" --resource-group "myResourceGroup"
187-
"""
188-
189-
helps['maps creator show'] = """
190-
type: command
191-
short-summary: "Get a Maps Creator resource."
192-
examples:
193-
- name: Get Creator Resource
194-
text: |-
195-
az maps creator show --account-name "myMapsAccount" --creator-name "myCreator" --resource-group \
196-
"myResourceGroup"
197-
"""
198-
199-
helps['maps creator create'] = """
200-
type: command
201-
short-summary: "Create a Maps Creator resource. Creator resource will manage Azure resources required to populate \
202-
a custom set of mapping data. It requires an account to exist before it can be created."
203-
examples:
204-
- name: Create Creator Resource
205-
text: |-
206-
az maps creator create --location "eastus2" --storage-units 5 --tags test="true" --account-name \
207-
"myMapsAccount" --creator-name "myCreator" --resource-group "myResourceGroup"
208-
"""
209-
210-
helps['maps creator update'] = """
211-
type: command
212-
short-summary: "Updates the Maps Creator resource. Only a subset of the parameters may be updated after creation, \
213-
such as Tags."
214-
examples:
215-
- name: Update Creator Resource
216-
text: |-
217-
az maps creator update --storage-units 10 --tags specialTag="true" --account-name "myMapsAccount" \
218-
--creator-name "myCreator" --resource-group "myResourceGroup"
219-
"""
220-
221-
helps['maps creator delete'] = """
222-
type: command
223-
short-summary: "Delete a Maps Creator resource."
224-
examples:
225-
- name: Delete Creator Resource
226-
text: |-
227-
az maps creator delete --account-name "myMapsAccount" --creator-name "myCreator" --resource-group \
228-
"myResourceGroup"
229-
"""

src/azure-cli/azure/cli/command_modules/maps/_params.py

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def load_arguments(self, _):
4646
with self.argument_context('maps account create') as c:
4747
c.argument('kind', options_list=['--kind'], arg_type=get_enum_type(['Gen1', 'Gen2']),
4848
help='Get or Set Kind property.')
49+
c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx),
50+
required=False, validator=get_default_location_from_resource_group)
4951
c.argument('disable_local_auth', options_list=['--disable-local-auth'], arg_type=get_three_state_flag(),
5052
help='Allows toggle functionality on Azure '
5153
'Policy to disable Azure Maps local authentication support. This will disable Shared Keys '
@@ -96,37 +98,3 @@ def load_arguments(self, _):
9698
options_list=['--key'],
9799
arg_type=get_enum_type(KeyType),
98100
help='Whether the operation refers to the primary or secondary key')
99-
100-
with self.argument_context('maps creator') as c:
101-
c.argument('tags', arg_type=tags_type)
102-
103-
with self.argument_context('maps creator create') as c:
104-
c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the '
105-
'Maps Creator instance.')
106-
c.argument('location', options_list=['--location', '-l'], arg_type=get_location_type(self.cli_ctx),
107-
required=False, validator=get_default_location_from_resource_group)
108-
c.argument('storage_units', options_list=['--storage-units'], type=int,
109-
help='The storage units to be allocated. Integer values from 1 to 100, inclusive.')
110-
111-
with self.argument_context('maps creator update') as c:
112-
c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the '
113-
'Maps Creator instance.', id_part='child_name_1')
114-
c.argument('storage_units', options_list=['--storage-units'], type=int,
115-
help='The storage units to be allocated. Integer values from 1 to 100, inclusive.')
116-
117-
with self.argument_context('maps creator delete') as c:
118-
c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the '
119-
'Maps Creator instance.', id_part='child_name_1')
120-
121-
with self.argument_context('maps creator show') as c:
122-
c.argument('creator_name', options_list=['--creator-name'], type=str, help='The name of the '
123-
'Maps Creator instance.', id_part='child_name_1')
124-
125-
with self.argument_context('maps creator list') as c:
126-
c.argument('resource_group_name',
127-
arg_type=resource_group_name_type,
128-
id_part=None,
129-
help='Resource group name')
130-
c.argument('account_name',
131-
id_part=None,
132-
arg_type=maps_name_type)

src/azure-cli/azure/cli/command_modules/maps/commands.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55

66
from azure.cli.core.commands import CliCommandType
7-
from azure.cli.command_modules.maps._client_factory import cf_accounts, cf_map, cf_creator
7+
from azure.cli.command_modules.maps._client_factory import cf_accounts, cf_map
88

99

1010
def load_command_table(self, _):
@@ -29,13 +29,3 @@ def load_command_table(self, _):
2929

3030
with self.command_group('maps map', maps_map, client_factory=cf_map) as g:
3131
g.custom_command('list-operation', 'maps_map_list_operation')
32-
33-
maps_creator = CliCommandType(
34-
operations_tmpl='azure.mgmt.maps.operations._creators_operations#CreatorsOperations.{}',
35-
client_factory=cf_creator)
36-
with self.command_group('maps creator', maps_creator, client_factory=cf_creator) as g:
37-
g.custom_command('list', 'maps_creator_list')
38-
g.custom_show_command('show', 'maps_creator_show')
39-
g.custom_command('create', 'maps_creator_create')
40-
g.custom_command('update', 'maps_creator_update')
41-
g.custom_command('delete', 'maps_creator_delete', confirmation=True)

src/azure-cli/azure/cli/command_modules/maps/custom.py

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from knack.prompting import prompt_y_n
88
from knack.util import CLIError
99

10-
ACCOUNT_LOCATION = 'global'
11-
1210
logger = get_logger(__name__)
1311

1412

@@ -18,6 +16,7 @@ def maps_account_create(client,
1816
name,
1917
tags=None,
2018
kind=None,
19+
location=None,
2120
disable_local_auth=None,
2221
linked_resources=None,
2322
type_=None,
@@ -44,15 +43,13 @@ def maps_account_create(client,
4443
option = prompt_y_n(hint)
4544
if not option:
4645
raise CLIError(client_denied_terms)
47-
if kind is None:
48-
kind = "Gen1"
4946
if disable_local_auth is None:
5047
disable_local_auth = False
5148
maps_account = {}
5249
if tags is not None:
5350
maps_account['tags'] = tags
54-
maps_account['location'] = ACCOUNT_LOCATION
55-
maps_account['kind'] = "Gen1" if kind is None else kind
51+
maps_account['kind'] = kind or 'Gen2'
52+
maps_account['location'] = location or 'eastus'
5653
maps_account['properties'] = {}
5754
maps_account['properties']['disable_local_auth'] = False if disable_local_auth is None else disable_local_auth
5855
if linked_resources is not None:
@@ -143,64 +140,3 @@ def maps_account_regenerate_key(client,
143140

144141
def maps_map_list_operation(client):
145142
return client.list_operations()
146-
147-
148-
def maps_creator_list(client,
149-
resource_group_name,
150-
account_name):
151-
return client.list_by_account(resource_group_name=resource_group_name,
152-
account_name=account_name)
153-
154-
155-
def maps_creator_show(client,
156-
resource_group_name,
157-
account_name,
158-
creator_name):
159-
return client.get(resource_group_name=resource_group_name,
160-
account_name=account_name,
161-
creator_name=creator_name)
162-
163-
164-
def maps_creator_create(client,
165-
resource_group_name,
166-
account_name,
167-
creator_name,
168-
location,
169-
storage_units,
170-
tags=None):
171-
creator_resource = {}
172-
if tags is not None:
173-
creator_resource['tags'] = tags
174-
creator_resource['location'] = location
175-
creator_resource['properties'] = {}
176-
creator_resource['properties']['storage_units'] = storage_units
177-
return client.create_or_update(resource_group_name=resource_group_name,
178-
account_name=account_name,
179-
creator_name=creator_name,
180-
creator_resource=creator_resource)
181-
182-
183-
def maps_creator_update(client,
184-
resource_group_name,
185-
account_name,
186-
creator_name,
187-
tags=None,
188-
storage_units=None):
189-
creator_update_parameters = {}
190-
if tags is not None:
191-
creator_update_parameters['tags'] = tags
192-
if storage_units is not None:
193-
creator_update_parameters['storage_units'] = storage_units
194-
return client.update(resource_group_name=resource_group_name,
195-
account_name=account_name,
196-
creator_name=creator_name,
197-
creator_update_parameters=creator_update_parameters)
198-
199-
200-
def maps_creator_delete(client,
201-
resource_group_name,
202-
account_name,
203-
creator_name):
204-
return client.delete(resource_group_name=resource_group_name,
205-
account_name=account_name,
206-
creator_name=creator_name)

0 commit comments

Comments
 (0)