-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Breadth Coverage] Support StorageSync in Azure CLI cmdlets #1389
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storage-sync-service
to support both name and id?
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.
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.
it should support both of them. #Resolved
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.
"SampleStorageSyncService" | ||
""" | ||
|
||
helps['storagesync registered-server wait'] = """ |
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.
pair with no-wait? #WontFix
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.
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) |
@@ -73,3 +73,5 @@ | |||
/src/connectedmachine/ @farehar | |||
|
|||
/src/ip-group/ @haroldrandom | |||
|
|||
/src/storagesync/ @jsntcy |
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.
Shall we use storage-sync as the extension name?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is guideline on command naming. But we can discuss it for sure.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix of the subcommand name seems redundant. just use storagesync service create
? #Resolved
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/storagesync/README.md
Outdated
|
||
##### Delete a given storage sync service. | ||
``` | ||
az storagesync storage-sync-service delete \ |
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.
should it be az storage-sync service
? #Resolved
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
az storage-sync group create
?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use MyResourceGroup
. Align with other examples.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about adding id_part=name
? #Resolved
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.
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it suitable to support id of storage sync service as well? #Resolved
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we get this tenant id by storage_account_resource_id
? #WontFix
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the meaning of number? should it be type=int
? #Resolved
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.
'--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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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\list
az storagesync sync-group create\delete\show\list
az storagesync cloud-endpoint create\delete\show\list
az storagesync server-endpoint create\delete\show\list
az storagesync registered-server delete\show\list
Notes
az storagesync registered-server create
andaz 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 checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?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.json
automatically.The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify
src/index.json
.