-
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 Databox in Azure CLI cmdlets #1344
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 S166. |
a299798
to
17bd65b
Compare
'characters in length and use any alphanumeric and underscore only') | ||
|
||
with self.argument_context('databox job create') as c: | ||
c.argument('job_name', job_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.
We usually use --name
instead of --job-name
, --vault-name
or --account-name
for the object itself. #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.
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.
LGTM in general except for three_id
arguments.
src/databox/azext_databox/_params.py
Outdated
c.argument('location', arg_type=get_location_type(self.cli_ctx), default=None, | ||
validator=get_default_location_from_resource_group) | ||
c.argument('tags', tags_type) | ||
c.argument('sku_name', arg_type=get_enum_type(['DataBox', 'DataBoxDisk', 'DataBoxHeavy']), |
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 be sku
#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/databox/azext_databox/_params.py
Outdated
c.argument('postal_code', help='Postal code.') | ||
c.argument('company_name', help='Name of the company.') | ||
c.extra('storage_account_id', help='The destination storage account resource id.', arg_group='Storage Account') | ||
c.extra('staging_storage_account_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.
it should be storage_account_name
or storage_account
#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/databox/azext_databox/_params.py
Outdated
c.argument('country', help='Name of the Country. Ex: US') | ||
c.argument('postal_code', help='Postal code.') | ||
c.argument('company_name', help='Name of the company.') | ||
c.extra('storage_account_id', help='The destination storage account resource id.', arg_group='Storage Account') |
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.
same here. Meanwhile, what's the difference between the storage account id and the staging storage account id? #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/databox/azext_databox/_params.py
Outdated
c.extra('staging_storage_account_id', | ||
help='The destination storage account id that can be used to copy the vhd for staging.', | ||
arg_group='Managed Disk') | ||
c.extra('resource_group_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.
what's this used for? #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.
Create new resource group if you intend to create managed disks from on-premises VHDs. You can use an existing resource group only if the resource group was created previously when creating a Data Box order for managed disk by Data Box service.
In reply to: 388071552 [](ancestors = 388071552)
street_address3=None, | ||
state_or_province=None, | ||
company_name=None): | ||
job_resource = get_databox_job(client, resource_group_name, job_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's already a patch method. Why do we need to get it again? #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.
It seems the patch method in SDK is not correct. When just pass one property that need to be updated to SDK, it said some other properties cannot be None.
In reply to: 388072098 [](ancestors = 388072098)
return cf_databox(cli_ctx).jobs | ||
|
||
|
||
def cf_service(cli_ctx, *_): |
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.
do we need this client factory? #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.
'--job-name {job_name} ' | ||
'--contact-name "Public SDK Test 1" ' | ||
'--email-list testing1@microsoft.com ', | ||
checks=[]) |
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 add some checks here? just like the show 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.
the updated parameters are not returned from command and I checked the update result by the following 'show' command
In reply to: 388072600 [](ancestors = 388072600)
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 quite strange. Is it a long running operation? It should return something. #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, it returns something, but the response doesn't include updated properties. "Show" command below should cover the update logic.
In reply to: 390126507 [](ancestors = 390126507)
src/databox/README.rst
Outdated
========================================== | ||
|
||
This package is for the 'databox' extension. | ||
i.e. 'az databox' |
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.
Please add more details on how to use this extension. You can refer to storage-preview. #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/databox/azext_databox/_params.py
Outdated
job_name_type = CLIArgumentType( | ||
help='The name of the job resource within the specified resource group. job names must be between 3 and 24 ' | ||
'characters in length and use any alphanumeric and underscore only') |
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.
add options_list=['--name', '-n']
? #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/databox/azext_databox/_params.py
Outdated
c.argument('contact_name', help='Contact name of the person.') | ||
c.argument('phone', help='Phone number of the contact person.') | ||
c.argument('mobile', help='Mobile number of the contact person.') | ||
c.argument('email_list', help='Space-separated list of Email addresses to be notified about job progress.', nargs='+') | ||
c.argument('street_address1', help='Street Address line 1.') | ||
c.argument('street_address2', help='Street Address line 2.') | ||
c.argument('street_address3', help='Street Address line 3.') | ||
c.argument('city', help='Name of the City.') | ||
c.argument('state_or_province', help='Name of the State or Province.') | ||
c.argument('country', help='Name of the Country. Ex: US') | ||
c.argument('postal_code', help='Postal code.') | ||
c.argument('company_name', help='Name of the company.') |
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.
You can add arg_group for these deilvery information so it's more organized in help message. #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.
c0914d1
to
63ab9f4
Compare
63ab9f4
to
5b65682
Compare
* Support Databox in Azure CLI cmdlets
What does this PR do?
What's the key use case?
In the case of an offline transfer, the flow for Databox customers is:
Which commands will be supported?
az databox job create
az databox job update
az databox job show
az databox job cancel
az databox job delete
az databox job list
az databox job list-credentials
Notes
az databox job list-credentials
is a special command. Usually only a physical databox device is received, then the credentials for the device can be retrieved by this command. As discussed with service team, I just tested this command manually in service team's test subscription with fixed resource group and databox job and will not include it in automation test.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: