Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{AppService} Add custom location sdk #18362

Merged
merged 1 commit into from
Jun 10, 2021
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
4 changes: 3 additions & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
MGMT_IOTHUB = ('azure.mgmt.iothub', 'IotHubClient')
MGMT_ARO = ('azure.mgmt.redhatopenshift', 'AzureRedHatOpenShiftClient')
MGMT_DATABOXEDGE = ('azure.mgmt.databoxedge', 'DataBoxEdgeManagementClient')
MGMT_CUSTOMLOCATION = ('azure.mgmt.extendedlocation', 'CustomLocations')
# the "None" below will stay till a command module fills in the type so "get_mgmt_service_client"
# can be provided with "ResourceType.XXX" to initialize the client object. This usually happens
# when related commands start to support Multi-API
Expand Down Expand Up @@ -210,7 +211,8 @@ def default_api_version(self):
ResourceType.MGMT_APPSERVICE: '2020-09-01',
ResourceType.MGMT_IOTHUB: '2021-03-31',
ResourceType.MGMT_ARO: '2020-04-30',
ResourceType.MGMT_DATABOXEDGE: '2019-08-01'
ResourceType.MGMT_DATABOXEDGE: '2019-08-01',
ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to support other profiles, e.g. 2020-09-01-hybrid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only need to use the latest, our use case is doing a GET call to ExtendedLocation to make sure the resource exists, before using it in AppService

},
'2020-09-01-hybrid': {
ResourceType.MGMT_STORAGE: '2019-06-01',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def providers_client_factory(cli_ctx):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES).providers


def customlocation_client_factory(cli_ctx, api_version=None, **_):
from azure.cli.core.profiles import ResourceType
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_CUSTOMLOCATION, api_version=api_version)


def cf_plans(cli_ctx, _):
return web_client_factory(cli_ctx).app_service_plans

Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ azure-mgmt-devtestlabs==4.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-eventgrid==9.0.0
azure-mgmt-eventhub==4.1.0
azure-mgmt-extendedlocation==1.0.0b2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this package for app service extended location? For storage, compute and network, we support extended location in their own package like azure-mgmt-storage, azure-mgmt-compute and azure-mgmt-network. I am curious about app service design.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to be able to use these management operations so I can verify the ExtendedLocation resource before using it in App Service: https://docs.microsoft.com/en-us/python/api/azure-mgmt-extendedlocation/azure.mgmt.extendedlocation.v2021_03_15_preview.operations.customlocationsoperations?view=azure-python-preview
We have the ExtendedLocation model defined in App Service, but don't have these management operations - does storage/compute/network verify the ExtendedLocation resources before using it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't.

azure-mgmt-hdinsight==7.0.0
azure-mgmt-imagebuilder==0.4.0
azure-mgmt-iotcentral==4.1.0
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ azure-mgmt-devtestlabs==4.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-eventgrid==9.0.0
azure-mgmt-eventhub==4.1.0
azure-mgmt-extendedlocation==1.0.0b2
azure-mgmt-hdinsight==7.0.0
azure-mgmt-imagebuilder==0.4.0
azure-mgmt-iotcentral==4.1.0
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ azure-mgmt-devtestlabs==4.0.0
azure-mgmt-dns==8.0.0
azure-mgmt-eventgrid==9.0.0
azure-mgmt-eventhub==4.1.0
azure-mgmt-extendedlocation==1.0.0b2
azure-mgmt-hdinsight==7.0.0
azure-mgmt-imagebuilder==0.4.0
azure-mgmt-iotcentral==4.1.0
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
'azure-mgmt-dns~=8.0.0',
'azure-mgmt-eventgrid==9.0.0',
'azure-mgmt-eventhub~=4.1.0',
'azure-mgmt-extendedlocation~=1.0.0b2',
'azure-mgmt-hdinsight~=7.0.0',
'azure-mgmt-imagebuilder~=0.4.0',
'azure-mgmt-iotcentral~=4.1.0',
Expand Down