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

Add docs for az lock update. #2702

Merged
merged 1 commit into from
Apr 5, 2017
Merged

Add docs for az lock update. #2702

merged 1 commit into from
Apr 5, 2017

Conversation

brendandburns
Copy link
Member

Part of #2694

@brendandburns
Copy link
Member Author

@tjprescott

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

Also, there's an unresolved Pylint issue.

@@ -79,3 +79,4 @@

register_cli_argument('lock', 'name', options_list=('--name', '-n'))
register_cli_argument('lock create', 'level', options_list=('--lock-type', '-t'), required=True, **enum_choice_list(LockLevel))
register_cli_argument('lock update', 'level', options_list=('--lock-type', '-t'), required=True, **enum_choice_list(LockLevel))
Copy link
Member

Choose a reason for hiding this comment

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

These two lines should be consolidated:

register_cli_argument('lock', 'level', options_list=('--lock-type', '-t'), **enum_choice_list(LockLevel)) 

Essentially, you scope it to "lock" and remove the "requiredness". The CLI will determine this automatically by examining the respective method signatures.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

:param name: The name of the lock
:type name: str
:param resource_group_name: The name of the resource group, either the lock is on this group, or a
resource in this group.
Copy link
Member

Choose a reason for hiding this comment

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

It sounds like resource_group_name should be required and not have a default value of None. This is another issue pointed out in #2694. It does not seem like you could identify any lock with just the name (unless they are globally unique).

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, you can have subscription level locks (which must be unique for a subscription)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I didn't realize that. Does it pretty much prevent you from deleting anything?

:param resource_group_name: The name of the resource group, either the lock is on this group, or a
resource in this group.
:type resource_group_name str
:param notes: Notes about this lock [optional]
Copy link
Member

Choose a reason for hiding this comment

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

You don't need [optional] here as it is an optional parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed.

level=None, notes=None, lock_id=None, lock_type=None):
def update_lock(name, resource_group_name=None, level=None, notes=None):
'''
:param name: The name of the lock
Copy link
Member

Choose a reason for hiding this comment

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

Please move this docstring help into the _help.py files. The reason is because the live doc's Edit button points directly to that file, making it easy for someone to edit the help in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@brendandburns
Copy link
Member Author

Comments addressed, please re-check.
Thanks!

@@ -10,6 +10,15 @@
type: group
short-summary: Manage Azure locks.
"""
helps['lock update'] = """
Copy link
Member

@tjprescott tjprescott Apr 3, 2017

Choose a reason for hiding this comment

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

This should be in the YAML format like the rest of the entries in the file. I'm actually kind of surprised it doesn't throw an error. The long description piece would be a good place to note that locks can apply to a subscription/resource group/resource.

Copy link
Member

Choose a reason for hiding this comment

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

Follow-up: it does throw an error. That's your CI error.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed. (as an end-user, I found the syntax/errors are semi-inscrutable fwiw)

@codecov-io
Copy link

codecov-io commented Apr 5, 2017

Codecov Report

Merging #2702 into master will increase coverage by <.01%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2702      +/-   ##
==========================================
+ Coverage   62.87%   62.87%   +<.01%     
==========================================
  Files         480      480              
  Lines       25807    25808       +1     
  Branches     3905     3905              
==========================================
+ Hits        16226    16227       +1     
  Misses       8572     8572              
  Partials     1009     1009
Impacted Files Coverage Δ
...urce/azure/cli/command_modules/resource/_params.py 100% <100%> (ø) ⬆️
...source/azure/cli/command_modules/resource/_help.py 100% <100%> (ø) ⬆️
...ource/azure/cli/command_modules/resource/custom.py 51.14% <33.33%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa855de...09aca4b. Read the comment docs.

examples:
- name: Update a lock with new notes
text: >
az lock update --name lockName --resource-group-name group --notes newNotesHere
Copy link
Member

Choose a reason for hiding this comment

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

Resource group name is globally aliased as --resource-group. Is this a typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, fixed.

@brendandburns
Copy link
Member Author

Rebased and comments addressed.

Please take another look.

@tjprescott tjprescott merged commit 95f33ff into Azure:master Apr 5, 2017
johanste pushed a commit to johanste/azure-cli that referenced this pull request Apr 7, 2017
tjprescott pushed a commit that referenced this pull request Apr 11, 2017
* Enable delay-load of descriptions for commands (speed up az)

* Update find indexing commands to accept callables for description.

* Command load time in progress

* - Moved previously dead command filter from parser to application configuration.
- Removed unused configuration object/argv on application create.

* Remove unused argument (pylint)

* Remove dummy parameter

* Fix for python 2.7

* Fix yet incorrect passage of parameters

* Fix up additional pylint complaints

* Update tests

* Update tests

* Fix up more tests

* Fix up more core tests

* Enable delay-load of descriptions for commands (speed up az)

* Update find indexing commands to accept callables for description.

* [Network] Remove nulls from VPN connection show/list output (#2748)

* Fix #1615.

* Code review feedback.

* Update test docs for running individual test and all tests in mod (#2763)

* Update test docs for running individual test and all tests in mod

* Made feedback changes

* Make argument parameters match up. (#2717)

Make lock command parameter aliases match up with resource commands.

* [DevTestLabs] Adding scenario test to create simple Linux + Windows VM in lab (#2767)

* WIP create linux + Windows vm in lab

* Adding recording

* Add some more error checking/handling. (#2768)

Add more validation to resolve "lock level" for lock commands.

* Fix doc references to azure.cli.commands (#2740)

* Fix doc references to azure.cli.commands

This module has moved to azure.cli.core.commands

* Fix PyLint

* Add clearer guidelines on modifying changelog (#2739)

* Add clearer guidelines on modifying changelog

* A few smaller changes

* another small format change

* Code review changes

* [DevTestLabs] Exposing commands to manage secrets in the lab (#2691)

* ACS Update: nulling out the windows profile so that there isn't a validation fail… (#2764)

* nulling out the windows profile so that there isn't a valdiation failure for missing password

ACS doesn't return a password on GET. az acs scale command does a GET
then PUT, but since ACS doesn't return the password the verification is
failing before the PUT is sent to ACS.

There is a bug in ACS this exposes. So this shouldn't be merged until
after the ACS rollout finishes. Should be about start of next week.

* updating history

* updating version in history

* removing white space added by editor

* [Compute] Fix issues with VMSS and VM availability set update. (#2773)

* Fix issues with VMSS and VM availability set update.

* Update help. Fix #2762.

* Error out if you try to list resources for a group that doesn't exist. (#2769)

* Minor text fixes (#2776)

* Add docs for az lock update. (#2702)

* [DevTestLab] Explicitly enable usage of saved secrets while lab vm creation (#2686)

* Explicitly enable usage of saved secrets for vm creation

* Better error message with not overriding competing paramters

* Adding export-artifacts commands on formula (#2707)

* core: apply configured defaults on optional arg (#2770)

* Core:apply configured defaults on optional argument

* add a test

* add tests

* update history doc

* address review feedback

* [Network] Support active-active VNet gateways (#2751)

* Start active-active test scenario.

* Add active-active parameter.

* Active-active scenario test 1 (cross premise)

* Add second active-active scenario (vnet-to-vnet)

* Refine active-active gateway configuration.

* Pylint...

* Code review feedback

* Packaged release notes and changes for 0.2.4 (#2735)

* Modify HISTORY.md

* Update Dockerfile

* Update debian also

* Add pip dependencies also

* Command load time in progress

* - Moved previously dead command filter from parser to application configuration.
- Removed unused configuration object/argv on application create.

* Remove unused argument (pylint)

* Remove dummy parameter

* Fix for python 2.7

* Fix yet incorrect passage of parameters

* Fix up additional pylint complaints

* Update tests

* Update tests

* Fix up more tests

* Fix up more core tests

* Improve load time of custom.py for profile, find and configure (speeds up raw az command)

* Pylint + flake8 fixes

* Fix new vm tests that failed due to perf refactoring

* Update redis tests that was broken due to perf refactoring

* Delay-load msrest for command executions that don't need it

* Fix flake8 issues

* Fixing/improving detection of pageable class

* flake8 fixes

* Fix broken merge from upstream/master

* Fix broken merge (again)

* flake8 fixes

* Fix up even more merge errors from last upstream merge

* Flake8 fixes (wrong number of newlines)

* Fix delay load of storage assembly for az

* Update history to reference improved performance
@mozehgir mozehgir added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group cla-not-required Resource Manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants