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.AddParentFlags(parser, 'update') 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.AddParentFlags(parser, 'list', required=False) base.ASYNC_FLAG.RemoveFromParser(parser) base.PAGE_SIZE_FLAG.RemoveFromParser(parser) base.URI_FLAG.RemoveFromParser(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. ' 'This represents a role\'s lifecycle phase: `ALPHA`, `BETA`, `GA`, ' '`DEPRECATED`, `DISABLED`, `EAP`.') 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.AddParentFlags(parser, 'create') flags.GetCustomRoleFlag('create').AddToParser(parser)
def Args(parser): flags.AddParentFlags(parser, 'describe', required=False) flags.GetRoleFlag('describe').AddToParser(parser)
def Args(parser): flags.AddParentFlags(parser, 'undelete') flags.GetCustomRoleFlag('undelete').AddToParser(parser)