-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Compute] Extended location for Compute RP #17522
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
Changes from 6 commits
0fbf4bb
22c264f
713217b
24c7997
be9720e
aede815
db45b0d
af2fd8d
e0a6917
4dd11ea
61920ec
b839ccc
755350f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,3 +119,11 @@ def _dest_to_option(dest): | |
| forbidden_string = ', '.join(_dest_to_option(x) for x in included_forbidden) | ||
| error = '{}\n\tnot applicable: {}'.format(error, forbidden_string) | ||
| raise CLIError(error) | ||
|
|
||
|
|
||
| def validate_edge_zone(cmd, namespace): # pylint: disable=unused-argument | ||
| if namespace.edge_zone: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. The definition is a string. In practice, service surely does not allow all strings. |
||
| namespace.edge_zone = { | ||
| 'name': namespace.edge_zone, | ||
| 'type': 'EdgeZone' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why a fixed type here? Service only supports the type now?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ | |
| from azure.cli.command_modules.monitor.actions import get_period_type | ||
|
|
||
|
|
||
| # pylint: disable=too-many-statements, too-many-branches, too-many-locals | ||
| # pylint: disable=too-many-statements, too-many-branches, too-many-locals, too-many-lines | ||
| def load_arguments(self, _): | ||
| # Model imports | ||
| StorageAccountTypes = self.get_models('StorageAccountTypes') | ||
|
|
@@ -96,6 +96,11 @@ def load_arguments(self, _): | |
| help='Specify the scale-in policy (space delimited) that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in.' | ||
| ) | ||
|
|
||
| edge_zone_type = CLIArgumentType( | ||
| help='Name of edge zone extended location.', | ||
| min_api='2020-12-01' | ||
| ) | ||
|
|
||
| # region MixedScopes | ||
| for scope in ['vm', 'disk', 'snapshot', 'image', 'sig']: | ||
| with self.argument_context(scope) as c: | ||
|
|
@@ -148,6 +153,7 @@ def load_arguments(self, _): | |
| c.argument('gallery_image_reference_lun', type=int, help='If the disk is created from an image\'s data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null') | ||
| c.argument('logical_sector_size', type=int, help='Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default.') | ||
| c.argument('tier', help='Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.') | ||
| c.argument('edge_zone', edge_zone_type) | ||
| # endregion | ||
|
|
||
| # region Snapshots | ||
|
|
@@ -157,6 +163,7 @@ def load_arguments(self, _): | |
| c.argument('sku', arg_type=snapshot_sku) | ||
| c.argument('incremental', arg_type=get_three_state_flag(), min_api='2019-03-01', | ||
| help='Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed') | ||
| c.ignore('edge_zone') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need to ignore the variable here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python SDK is not released. |
||
| # endregion | ||
|
|
||
| # region Images | ||
|
|
@@ -178,6 +185,7 @@ def load_arguments(self, _): | |
| help="Storage caching type for the image's data disk.") | ||
| c.argument('hyper_v_generation', arg_type=hyper_v_gen_sku, min_api="2019-03-01", help='The hypervisor generation of the Virtual Machine created from the image.') | ||
| c.ignore('source_virtual_machine', 'os_blob_uri', 'os_disk', 'os_snapshot', 'data_blob_uris', 'data_disks', 'data_snapshots') | ||
| c.argument('edge_zone', edge_zone_type, ) | ||
| # endregion | ||
|
|
||
| # region Image Templates | ||
|
|
@@ -703,6 +711,7 @@ def load_arguments(self, _): | |
| c.argument('secrets', multi_ids_type, help='One or many Key Vault secrets as JSON strings or files via `@{path}` containing `[{ "sourceVault": { "id": "value" }, "vaultCertificates": [{ "certificateUrl": "value", "certificateStore": "cert store name (only on windows)"}] }]`', type=file_type, completer=FilesCompleter()) | ||
| c.argument('assign_identity', nargs='*', arg_group='Managed Service Identity', help="accept system or user assigned identities separated by spaces. Use '[system]' to refer system assigned identity, or a resource id to refer user assigned identity. Check out help for more examples") | ||
| c.ignore('aux_subscriptions') | ||
| c.argument('edge_zone', edge_zone_type) | ||
|
|
||
| with self.argument_context(scope, arg_group='Authentication') as c: | ||
| c.argument('generate_ssh_keys', action='store_true', help='Generate SSH public and private key files if missing. The keys will be stored in the ~/.ssh directory') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to add such global validation here because it is easy to pass edge zone information in your command code as shown in
azure-cli/src/azure-cli/azure/cli/command_modules/storage/operations/account.py
Line 160 in 50f06e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I removed it from core.