def Args(parser): updated = parser.add_argument_group( 'The following flags determine the fields need to be updated. ' 'You can update a role by specifying the following flags, or ' 'you can update a role from a Yaml file by specifying the file flag.' ) updated.add_argument('--title', help='The title of the role you want to update.') updated.add_argument( '--description', help='The description of the role you want to update.') updated.add_argument('--stage', help='The state of the role you want to update.') updated.add_argument( '--permissions', help='The permissions of the role you want to set. ' 'Use commas to separate them.') updated.add_argument( '--add-permissions', help='The permissions you want to add to the role. ' 'Use commas to separate them.') updated.add_argument( '--remove-permissions', help='The permissions you want to remove from the ' 'role. Use commas to separate them.') parser.add_argument( '--file', help='The Yaml file you want to use to update a role. ' 'Can not be specified with other flags except role-id.') flags.GetOrgFlag('update').AddToParser(parser) flags.GetCustomRoleFlag('update').AddToParser(parser)
def Args(parser): parser.add_argument('--show-deleted', action='store_true', help='Show deleted roles by specifying this flag.') flags.GetOrgFlag('list').AddToParser(parser) base.ASYNC_FLAG.RemoveFromParser(parser) base.PAGE_SIZE_FLAG.RemoveFromParser(parser) base.URI_FLAG.RemoveFromParser(parser)
def Args(parser): parser.add_argument( '--title', help='The title of the role you want to create.') parser.add_argument( '--description', help='The description of the role you want to create.') parser.add_argument( '--stage', help='The state of the role you want to create.') parser.add_argument( '--permissions', help='The permissions of the role you want to create. ' 'Use commas to separate them.') parser.add_argument( '--file', help='The Yaml file you want to use to create a role. ' 'Can not be specified with other flags except role-id.') flags.GetOrgFlag('create').AddToParser(parser) flags.GetCustomRoleFlag('create').AddToParser(parser)
def Args(parser): roles_group = parser.add_group(mutex=True) settings_flags_group = roles_group.add_group('Roles Settings') settings_flags_group.add_argument( '--title', help='The title of the role you want to create.') settings_flags_group.add_argument( '--description', help='The description of the role you want to create.') settings_flags_group.add_argument( '--stage', help='The state of the role you want to create.') settings_flags_group.add_argument( '--permissions', help='The permissions of the role you want to create. ' 'Use commas to separate them.') roles_group.add_argument( '--file', help='The JSON or YAML file with the IAM Role to create. See ' 'https://cloud.google.com/iam/reference/rest/v1/projects.roles.') flags.GetOrgFlag('create').AddToParser(parser) flags.GetCustomRoleFlag('create').AddToParser(parser)
def Args(parser): flags.GetOrgFlag('undelete').AddToParser(parser) flags.GetCustomRoleFlag('undelete').AddToParser(parser)
def Args(parser): flags.GetOrgFlag('describe').AddToParser(parser) flags.GetRoleFlag('describe').AddToParser(parser)