Skip to content

Commit

Permalink
Enabling security group commands (#573)
Browse files Browse the repository at this point in the history
This reverts commit d7197f2.
  • Loading branch information
ishitam8 authored May 2, 2019
1 parent 056684d commit 1f2626e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 11 deletions.
39 changes: 39 additions & 0 deletions azure-devops/azext_devops/dev/team/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,45 @@ def load_team_help():
short-summary: Manage service endpoints/service connections
"""

helps['devops security'] = """
type: group
short-summary: Manage security related operations
"""

helps['devops security group'] = """
type: group
short-summary: Manage security groups
"""

helps['devops security group create'] = """
type: command
short-summary: Create a new Azure DevOps group.
long-summary:
examples:
- name: Create an Azure DevOps Group with name and description
text: |
az devops security group create --name 'Some group name' --description
'Something to describe this group'
- name: Add an existing AAD group to an Azure DevOps group
text: |
Get object ID of an existing AAD group
az ad group show -g {Group Name}
az devops security group create --origin-id {Object ID} --groups 'vssgp.someDescriptorForGroup'
- name: Add an existing AAD group to an Azure DevOps group with AAD group Email ID
text: |
az devops security group create --email-id {Email ID of AAD group}
--groups 'vssgp.someDescriptorForGroup'
- name: Create a new Azure DevOps group and add it to existing Azure DevOps groups.
text: |
az devops security group create --name 'Some group name'
--groups 'vssgp.someDescriptorForGroupOne,vssgp.someDescriptorForGroupTwo'
"""

helps['devops security group membership'] = """
type: group
short-summary: Manage memberships for security groups
"""

helps['devops team'] = """
type: group
short-summary: Manage teams
Expand Down
26 changes: 15 additions & 11 deletions azure-devops/azext_devops/dev/team/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from ._format import (transform_project_table_output,
transform_projects_table_output,
transform_service_endpoints_table_output,
transform_groups_table_output,
transform_group_table_output,
transform_memberships_table_output,
transform_membership_table_output,
transform_team_table_output,
transform_teams_table_output,
transform_team_members_table_output,
Expand Down Expand Up @@ -127,17 +131,17 @@ def load_team_commands(self, _):
g.command('disable', 'disable_extension', table_transformer=transform_extension_table_output)
g.command('search', 'search_extensions', table_transformer=transform_extension_search_results_table_output)

# with self.command_group('devops security group', command_type=security_groupOps) as g:
# g.command('list', 'list_groups', table_transformer=transform_groups_table_output)
# g.command('show', 'get_group', table_transformer=transform_group_table_output)
# g.command('update', 'update_group', table_transformer=transform_group_table_output)
# g.command('create', 'create_group', table_transformer=transform_group_table_output)
# g.command('delete', 'delete_group', confirmation='Are you sure you want to delete this group?')

# with self.command_group('devops security group membership', command_type=security_groupOps) as g:
# g.command('list', 'list_memberships', table_transformer=transform_memberships_table_output)
# g.command('add', 'add_membership', table_transformer=transform_membership_table_output)
# g.command('remove', 'remove_membership', confirmation='Are you sure you want to delete this relationship?')
with self.command_group('devops security group', command_type=security_groupOps) as g:
g.command('list', 'list_groups', table_transformer=transform_groups_table_output)
g.command('show', 'get_group', table_transformer=transform_group_table_output)
g.command('update', 'update_group', table_transformer=transform_group_table_output)
g.command('create', 'create_group', table_transformer=transform_group_table_output)
g.command('delete', 'delete_group', confirmation='Are you sure you want to delete this group?')

with self.command_group('devops security group membership', command_type=security_groupOps) as g:
g.command('list', 'list_memberships', table_transformer=transform_memberships_table_output)
g.command('add', 'add_membership', table_transformer=transform_membership_table_output)
g.command('remove', 'remove_membership', confirmation='Are you sure you want to delete this relationship?')

with self.command_group('devops wiki', command_type=wikiOps) as g:
g.command('create', 'create_wiki', table_transformer=transform_wiki_table_output)
Expand Down

0 comments on commit 1f2626e

Please sign in to comment.