示例#1
0
 def get_parser(self, prog_name):
     parser = super(CreateDomain, self).get_parser(prog_name)
     parser.add_argument(
         'name',
         metavar='<domain-name>',
         help=_('New domain name'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('New domain description'),
     )
     enable_group = parser.add_mutually_exclusive_group()
     enable_group.add_argument(
         '--enable',
         action='store_true',
         help=_('Enable domain (default)'),
     )
     enable_group.add_argument(
         '--disable',
         action='store_true',
         help=_('Disable domain'),
     )
     parser.add_argument(
         '--or-show',
         action='store_true',
         help=_('Return existing domain'),
     )
     common.add_resource_option_to_parser(parser)
     return parser
示例#2
0
 def get_parser(self, prog_name):
     parser = super(SetDomain, self).get_parser(prog_name)
     parser.add_argument(
         'domain',
         metavar='<domain>',
         help=_('Domain to modify (name or ID)'),
     )
     parser.add_argument(
         '--name',
         metavar='<name>',
         help=_('New domain name'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('New domain description'),
     )
     enable_group = parser.add_mutually_exclusive_group()
     enable_group.add_argument(
         '--enable',
         action='store_true',
         help=_('Enable domain'),
     )
     enable_group.add_argument(
         '--disable',
         action='store_true',
         help=_('Disable domain'),
     )
     common.add_resource_option_to_parser(parser)
     return parser
示例#3
0
 def get_parser(self, prog_name):
     parser = super(CreateProject, self).get_parser(prog_name)
     parser.add_argument(
         'name',
         metavar='<project-name>',
         help=_('New project name'),
     )
     parser.add_argument(
         '--domain',
         metavar='<domain>',
         help=_('Domain owning the project (name or ID)'),
     )
     parser.add_argument(
         '--parent',
         metavar='<project>',
         help=_('Parent of the project (name or ID)'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('Project description'),
     )
     enable_group = parser.add_mutually_exclusive_group()
     enable_group.add_argument(
         '--enable',
         action='store_true',
         help=_('Enable project'),
     )
     enable_group.add_argument(
         '--disable',
         action='store_true',
         help=_('Disable project'),
     )
     parser.add_argument(
         '--property',
         metavar='<key=value>',
         action=parseractions.KeyValueAction,
         help=_('Add a property to <name> '
                '(repeat option to set multiple properties)'),
     )
     parser.add_argument(
         '--or-show',
         action='store_true',
         help=_('Return existing project'),
     )
     common.add_resource_option_to_parser(parser)
     tag.add_tag_option_to_parser_for_create(parser, _('project'))
     return parser
示例#4
0
 def get_parser(self, prog_name):
     parser = super(SetProject, self).get_parser(prog_name)
     parser.add_argument(
         'project',
         metavar='<project>',
         help=_('Project to modify (name or ID)'),
     )
     parser.add_argument(
         '--name',
         metavar='<name>',
         help=_('Set project name'),
     )
     parser.add_argument(
         '--domain',
         metavar='<domain>',
         help=_('Domain owning <project> (name or ID)'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('Set project description'),
     )
     enable_group = parser.add_mutually_exclusive_group()
     enable_group.add_argument(
         '--enable',
         action='store_true',
         help=_('Enable project'),
     )
     enable_group.add_argument(
         '--disable',
         action='store_true',
         help=_('Disable project'),
     )
     parser.add_argument(
         '--property',
         metavar='<key=value>',
         action=parseractions.KeyValueAction,
         help=_('Set a property on <project> '
                '(repeat option to set multiple properties)'),
     )
     common.add_resource_option_to_parser(parser)
     tag.add_tag_option_to_parser_for_set(parser, _('project'))
     return parser
示例#5
0
 def get_parser(self, prog_name):
     parser = super(SetRole, self).get_parser(prog_name)
     parser.add_argument(
         'role',
         metavar='<role>',
         help=_('Role to modify (name or ID)'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('Add description about the role'),
     )
     parser.add_argument(
         '--domain',
         metavar='<domain>',
         help=_('Domain the role belongs to (name or ID)'),
     )
     parser.add_argument(
         '--name',
         metavar='<name>',
         help=_('Set role name'),
     )
     common.add_resource_option_to_parser(parser)
     return parser
示例#6
0
 def get_parser(self, prog_name):
     parser = super(CreateRole, self).get_parser(prog_name)
     parser.add_argument(
         'name',
         metavar='<role-name>',
         help=_('New role name'),
     )
     parser.add_argument(
         '--description',
         metavar='<description>',
         help=_('Add description about the role'),
     )
     parser.add_argument(
         '--domain',
         metavar='<domain>',
         help=_('Domain the role belongs to (name or ID)'),
     )
     parser.add_argument(
         '--or-show',
         action='store_true',
         help=_('Return existing role'),
     )
     common.add_resource_option_to_parser(parser)
     return parser