[Breadth Coverage] Support StorageSync in Azure CLI cmdlets#1389
[Breadth Coverage] Support StorageSync in Azure CLI cmdlets#1389jsntcy merged 10 commits intoAzure:masterfrom
Conversation
|
If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR: |
|
add to S167 |
|
just curious, is |
src/storagesync/README.md
Outdated
| az storagesync cloud-endpoint create \ | ||
| --resource-group rg \ | ||
| --name cloud-endpoint-name \ | ||
| --storage-sync-service-name storage-sync-service-name \ |
There was a problem hiding this comment.
storage-sync-service to support both name and id?
There was a problem hiding this comment.
There was a problem hiding this comment.
it should support both of them. #Resolved
There was a problem hiding this comment.
| "SampleStorageSyncService" | ||
| """ | ||
|
|
||
| helps['storagesync registered-server wait'] = """ |
There was a problem hiding this comment.
Yes, because we define 'delete' as supporting 'no-wait', we need a 'wait' command to query the 'delete' status.
In reply to: 392648677 [](ancestors = 392648677)
Thanks for the review. After confirm with PM. az storagesync registered-server create and az storagesync registered-server reset-certificate are operations mixing cloud and local COM operations. Azure CLI will not support these two commands because of technical limitation. User need use Azure PowerShell or Azure File Share Agent instead for these two commands. |
|
This command mixes cloud call and local COM calls which internally call Win32 API, while local COM calls are not easy to implement in Python (PowerShell is using .Net), I forward a email to you about the context. In reply to: 599177453 [](ancestors = 599177453) |
|
|
||
| /src/ip-group/ @haroldrandom | ||
|
|
||
| /src/storagesync/ @jsntcy |
There was a problem hiding this comment.
Shall we use storage-sync as the extension name?
There was a problem hiding this comment.
Not sure which one should be as both patterns exist in CLI, and we can have a discussion.
In reply to: 392828794 [](ancestors = 392828794)
There was a problem hiding this comment.
There is guideline on command naming. But we can discuss it for sure.
There was a problem hiding this comment.
az [ group ] [ subgroup ] [ command ] {parameters}
Multi-word subgroups should be hyphenated (e.g. foo-resource instead of fooresource)
- It seems storagesync is group, but not subgroup.
- Also discuss within our team, they agree I can keep it without hyphen.
So I'll keep it without hyphen.
In reply to: 392864381 [](ancestors = 392864381)
| validator=parse_server_id) | ||
| server_id_type = CLIArgumentType(help='GUID identifying the on-premises server.') | ||
|
|
||
| with self.argument_context('storagesync storage-sync-service create') as c: |
There was a problem hiding this comment.
The prefix of the subcommand name seems redundant. just use storagesync service create? #Resolved
There was a problem hiding this comment.
After internal discussion, we decide to use 'storagesync create'
In reply to: 392831198 [](ancestors = 392831198)
|
|
||
| def list_storagesync_storage_sync_service(client, | ||
| resource_group_name=None): | ||
| if resource_group_name is not None: |
There was a problem hiding this comment.
Use if resource_group_name: in order to use the workaround -g= to temparorily disable appending default resource group as we discussed. #Resolved
There was a problem hiding this comment.
src/storagesync/README.md
Outdated
|
|
||
| ##### Delete a given storage sync service. | ||
| ``` | ||
| az storagesync storage-sync-service delete \ |
There was a problem hiding this comment.
should it be az storage-sync service? #Resolved
There was a problem hiding this comment.
will be az storagesync delete after internal discussion
In reply to: 392865778 [](ancestors = 392865778)
|
|
||
| ##### Create a new sync group. | ||
| ``` | ||
| az storagesync sync-group create \ |
There was a problem hiding this comment.
az storage-sync group create ?
There was a problem hiding this comment.
use az storagesync sync-group create after discussion
In reply to: 392865940 [](ancestors = 392865940)
src/storagesync/README.md
Outdated
| az storagesync cloud-endpoint create \ | ||
| --resource-group rg \ | ||
| --name cloud-endpoint-name \ | ||
| --storage-sync-service-name storage-sync-service-name \ |
There was a problem hiding this comment.
it should support both of them. #Resolved
| examples: | ||
| - name: Create a new storage sync service "SampleStorageSyncService" in resource group 'SampleResourceGroup'. | ||
| text: |- | ||
| az storagesync storage-sync-service create --resource-group "SampleResourceGroup" \\ |
There was a problem hiding this comment.
better to use MyResourceGroup. Align with other examples.
There was a problem hiding this comment.
It's generated by codegen, and it should be from swagger samples, in the future, we should just use the rg from swagger without manual update.
In reply to: 392867347 [](ancestors = 392867347)
|
|
||
| with self.argument_context('storagesync storage-sync-service delete') as c: | ||
| c.argument('resource_group_name', resource_group_name_type) | ||
| c.argument('storage_sync_service_name', storage_sync_service_name_type, options_list=['--name', '-n']) |
There was a problem hiding this comment.
how about adding id_part=name? #Resolved
There was a problem hiding this comment.
|
|
||
| with self.argument_context('storagesync sync-group create') as c: | ||
| c.argument('resource_group_name', resource_group_name_type) | ||
| c.argument('storage_sync_service_name', storage_sync_service_name_type) |
There was a problem hiding this comment.
is it suitable to support id of storage sync service as well? #Resolved
There was a problem hiding this comment.
| c.argument('cloud_endpoint_name', cloud_endpoint_name_type, options_list=['--name', '-n']) | ||
| c.argument('storage_account_resource_id', storage_account_type) | ||
| c.argument('azure_file_share_name', azure_file_share_name_type) | ||
| c.argument('storage_account_tenant_id', storage_account_tenant_id_type) |
There was a problem hiding this comment.
can we get this tenant id by storage_account_resource_id? #WontFix
There was a problem hiding this comment.
| c.argument('server_resource_id', server_resource_id_type) | ||
| c.argument('server_local_path', help='The local path of the registered server.') | ||
| c.argument('cloud_tiering', arg_type=get_enum_type(['on', 'off']), help='Cloud Tiering.') | ||
| c.argument('volume_free_space_percent', |
There was a problem hiding this comment.
The following four parameters are too long. It's also a little bit confused to me. Is it able to add more help messages and examples? #Resolved
There was a problem hiding this comment.
I'll add more help for them and add use these parameters in example
In reply to: 392869872 [](ancestors = 392869872)
| body['server_resource_id'] = server_resource_id # str | ||
| body['server_local_path'] = server_local_path # str | ||
| body['cloud_tiering'] = cloud_tiering # str | ||
| body['volume_free_space_percent'] = volume_free_space_percent # number |
There was a problem hiding this comment.
what's the meaning of number? should it be type=int? #Resolved
There was a problem hiding this comment.
| '--name {server_endpoint_name} ' | ||
| '--server-id {server_id} ' | ||
| '--server-local-path "c:\\users\\syncfolder"', | ||
| checks=[JMESPathCheck('provisioningState', 'Succeeded'), |
There was a problem hiding this comment.
this command can accept four arguments. Could we add more tests? Looks like this should be an important command. #WontFix
There was a problem hiding this comment.
0aa238f to
b44d532
Compare
What does this PR do?
What's the key use case?
Which commands will be supported?
az storagesync storage-sync-service create\delete\show\listaz storagesync sync-group create\delete\show\listaz storagesync cloud-endpoint create\delete\show\listaz storagesync server-endpoint create\delete\show\listaz storagesync registered-server delete\show\listNotes
az storagesync registered-server createandaz storagesync registered-server reset-certificateare operations mixing cloud and local COM operations. Azure CLI will not support these two commands because of technical limitation. User need use Azure PowerShell or Azure File Share Agent instead for these two commands.This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update
src/index.jsonautomatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json.