Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
585069b
Update azure-mgmt-resource package to 9.0.0.
Grayer123 Apr 23, 2020
43341dd
Add tags related cmdlet support: list, create, update and delete; and…
Grayer123 Apr 23, 2020
00b9235
{Docs} Remove stale reference in README to closed issue about extensi…
dkmiller Apr 27, 2020
ab16df0
Merge remote-tracking branch 'upstream/release'
azclibot Apr 28, 2020
03436bc
Merge remote-tracking branch 'upstream/release'
azclibot Apr 30, 2020
2ad6a9f
Merge remote-tracking branch 'upstream/master' into feature/tags
Grayer123 May 7, 2020
c4fe399
Update deployment related cmdlets as sdk signature changed and record…
Grayer123 May 8, 2020
95e6fa3
Re-record partial resource tests.
Grayer123 May 8, 2020
cc72282
Check in partial recording for resources.
Grayer123 May 9, 2020
dfac282
Merge dev to feature/tags branch.
Grayer123 May 11, 2020
7b109c5
Address some pr suggestions.
Grayer123 May 11, 2020
7d98b1f
Merge remote-tracking branch 'upstream/release'
azclibot May 19, 2020
06f6ec5
Merge remote-tracking branch 'upstream/release'
azclibot Jun 2, 2020
13af9cd
Merge remote-tracking branch 'upstream/dev' into feature/tags.
Grayer123 Jun 10, 2020
b6d7f43
Update the mgmt-resource package to 10.0.0.
Grayer123 Jun 11, 2020
2a8a62c
Re-record tags related test cases to resolve the url-encoding issue.
Grayer123 Jun 11, 2020
ec9e4d5
Fix a tag issue.
Grayer123 Jun 12, 2020
22ec7b0
Check in all recording tests.
Grayer123 Jun 12, 2020
03b7010
Merge remote-tracking branch 'upstream/master' into feature/tags
Grayer123 Jun 12, 2020
979c00e
Merge remote-tracking branch 'upstream/dev' into feature/tags
Grayer123 Jun 12, 2020
70d092f
Add help guide and examples for newly added tags cmdlets.
Grayer123 Jun 12, 2020
d29a6fd
Removed tag patch operation check logic in cli.
Grayer123 Jun 12, 2020
49d1c4e
Re-record the failed net-app test.
Grayer123 Jun 15, 2020
bbc0eb2
Removed unnecessary reference Enum.
Grayer123 Jun 15, 2020
b5371d6
Fix linter issue.
Grayer123 Jun 15, 2020
856381f
Fix style issue.
Grayer123 Jun 15, 2020
2b8189a
Fix space issue.
Grayer123 Jun 15, 2020
d3f6906
Record batchai failed test cases.
Grayer123 Jun 15, 2020
b19f9c6
Batchai test case record.
Grayer123 Jun 16, 2020
344aae6
Record older profile for resource.
Grayer123 Jun 16, 2020
2f74464
Merge remote-tracking branch 'upstream/dev' into feature/tags
Grayer123 Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def default_api_version(self):
ResourceType.MGMT_RESOURCE_LINKS: '2016-09-01',
ResourceType.MGMT_RESOURCE_LOCKS: '2016-09-01',
ResourceType.MGMT_RESOURCE_POLICY: '2019-09-01',
ResourceType.MGMT_RESOURCE_RESOURCES: '2019-07-01',
ResourceType.MGMT_RESOURCE_RESOURCES: '2019-10-01',
ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2019-06-01',
ResourceType.MGMT_RESOURCE_DEPLOYMENTSCRIPTS: '2019-10-01-preview',
ResourceType.MGMT_NETWORK_DNS: '2018-05-01',
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

NODE_STARTUP_TIME = 10 * 60 # Compute node should start in 10 mins after cluster creation.
CLUSTER_RESIZE_TIME = 20 * 60 # Cluster should resize in 20 mins after job submitted/completed.
LOCATION_FOR_SCENARIO_TESTS = 'northeurope'
LOCATION_FOR_SCENARIO_TESTS = 'eastus'
PASSWORD = str(uuid.uuid4())


Expand Down

Large diffs are not rendered by default.

92 changes: 89 additions & 3 deletions src/azure-cli/azure/cli/command_modules/resource/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@

helps['tag'] = """
type: group
short-summary: Manage resource tags.
short-summary: Tags Management on a resource.
"""

helps['tag add-value'] = """
Expand All @@ -1972,18 +1972,104 @@

helps['tag create'] = """
type: command
short-summary: Create a tag in the subscription.
short-summary: Create tags on a specific resource.
long-summary: >
The az tag create cmdlet with an id creates or updates the entire set of tags on a resource, resource group or subscription.
This operation allows adding or replacing the entire set of tags on the specified resource, resource group or subscription.
The specified entity can have a maximum of 50 tags.
parameters:
- name: --name -n
short-summary: The name of the tag to create.
- name: --subscription
short-summary: Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
- name: --resource-id
short-summary: The resource identifier for the entity being tagged. A resource, a resource group or a subscription may be tagged.
- name: --tags
short-summary: The tags to be applied on the resource.
examples:
- name: Create a tag in the subscription.
text: >
az tag create --name MyTag
- name: Creates or updates the entire set of tags on a subscription.
text: >
az tag create --resource-id /subscriptions/{subId} --tags Dept=Finance Status=Normal
- name: Creates or updates the entire set of tags on a resource group.
text: >
az tag create --resource-id /subscriptions/{sub-id}/resourcegroups/{rg} --tags Dept=Finance Status=Normal
- name: Creates or updates the entire set of tags on a resource.
text: >
az tag create --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.Compute/virtualMachines/{vmName} --tags Dept=Finance Status=Normal
"""

helps['tag delete'] = """
type: command
short-summary: Delete a tag in the subscription.
short-summary: Delete tags on a specific resource.
long-summary:
The az tag delete cmdlet with an id deletes the entire set of tags on a resource, resource group or subscription.
parameters:
- name: --name -n
short-summary: The name of the tag to be deleted.
- name: --resource-id
short-summary: The resource identifier for the entity being tagged. A resource, a resource group or a subscription may be tagged.
examples:
- name: Delete a tag from the subscription.
text: >
az tag delete --name MyTag
- name: Deletes the entire set of tags on a subscription.
text: >
az tag delete --resource-id /subscriptions/{sub-id}
- name: Deletes the entire set of tags on a resource group.
text: >
az tag delete --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}
- name: Deletes the entire set of tags on a resource.
text: >
az tag delete --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.Compute/virtualMachines/{vmName}
"""

helps['tag list'] = """
type: command
short-summary: Lists the entire set of tags on a specific resource.
long-summary: The az tag list cmdlet with an id lists the entire set of tags on a resource, resource group or subscription.
parameters:
- name: --resource-id
short-summary: The resource identifier for the entity being tagged. A resource, a resource group or a subscription may be tagged.
examples:
- name: Lists the entire set of tags on a subscription.
text: >
az tag list --resource-id /subscriptions/{sub-id}
- name: Lists the entire set of tags on a resource group.
text: >
az tag list --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}
- name: Lists the entire set of tags on a resource.
text: >
az tag list --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.Compute/virtualMachines/{vmName}
"""

helps['tag update'] = """
type: command
short-summary: Selectively updates the set of tags on a specific resource.
long-summary: >
The az tag update cmdlet with an id selectively updates the set of tags on a resource, resource group or subscription.
This operation allows replacing, merging or selectively deleting tags on the specified resource, resource group or subscription.
The specified entity can have a maximum of 50 tags at the end of the operation.
The 'replace' option replaces the entire set of existing tags with a new set.
The 'merge' option allows adding tags with new names and updating the values of tags with existing names.
The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
parameters:
- name: --resource-id
short-summary: The resource identifier for the entity being tagged. A resource, a resource group or a subscription may be tagged.
- name: --operation
short-summary: The update operation. Options are Merge, Replace and Delete.
- name: --tags
short-summary: The tags to be updated on the resource.
examples:
- name: Selectively updates the set of tags on a subscription with "merge" Operation.
text: >
az tag update --resource-id /subscriptions/{sub-id} --operation merge --tags key1=value1 key3=value3
- name: Selectively updates the set of tags on a resource group with "replace" Operation.
text: >
az tag update --resource-id /subscriptions/{sub-id}/resourcegroups/{rg} --operation replace --tags key1=value1 key3=value3
- name: Selectively updates the set of tags on a resource with "delete" Operation.
text: >
az tag update --resource-id /subscriptions/{sub-id}/resourcegroups/{rg}/providers/Microsoft.Compute/virtualMachines/{vmName} --operation delete --tags key1=value1
"""
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/resource/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ def load_arguments(self, _):
with self.argument_context('tag') as c:
c.argument('tag_name', options_list=['--name', '-n'])
c.argument('tag_value', options_list='--value')
c.argument('resource_id', options_list='--resource-id',
help='The resource identifier for the tagged entity. A resource, a resource group or a subscription may be tagged.')
c.argument('tags', tags_type)
c.argument('operation', options_list='--operation',
help='The update operation: options include Merge, Replace and Delete.')

with self.argument_context('lock') as c:
c.argument('lock_name', options_list=['--name', '-n'], validator=validate_lock_parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ def load_command_table(self, _):
g.custom_command('unregister', 'unregister_feature')

# Tag commands
with self.command_group('tag', resource_tag_sdk) as g:
g.command('list', 'list')
g.command('create', 'create_or_update')
g.command('delete', 'delete')
with self.command_group('tag', resource_tag_sdk, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) as g:
g.custom_command('list', 'get_tag_at_scope')
g.custom_command('create', 'create_or_update_tag_at_scope')
g.custom_command('delete', 'delete_tag_at_scope')
g.custom_command('update', 'update_tag_at_scope', min_api='2019-10-01')
g.command('add-value', 'create_or_update_value')
g.command('remove-value', 'delete_value')

Expand Down
Loading