• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python extensions.PulpCliSection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp.client.extensions.extensions.PulpCliSection的典型用法代码示例。如果您正苦于以下问题:Python PulpCliSection类的具体用法?Python PulpCliSection怎么用?Python PulpCliSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PulpCliSection类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'server', _('display info about the server'))
        self.context = context

        self.add_command(PulpCliCommand('types', 'lists content types installed on the server', self.types))
        self.add_command(PulpCliCommand('importers', 'lists importers installed on the server', self.importers))
        self.add_command(PulpCliCommand('distributors', 'lists distributors installed on the server', self.distributors))
开发者ID:CUXIDUMDUM,项目名称:pulp,代码行数:7,代码来源:server_info.py


示例2: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'permission', 'permission lifecycle (list, grant, revoke, etc.) commands')

        self.context = context
        self.prompt = context.prompt # for easier access

        # List Command
        list_command = PulpCliCommand('list', 'lists permissions for a particular resource', self.list)
        list_command.add_option(PulpCliOption('--resource', 'uniquely identifies a resource', required=True))
        self.add_command(list_command)
        
        # Grant Command
        grant_command = PulpCliCommand('grant', 'grants resource permissions to given user or given role', self.grant)
        grant_command.add_option(PulpCliOption('--resource', 'resource REST API path whose permissions are being manipulated', required=True))
        grant_command.add_option(PulpCliOption('--login', 'login of the user to which access to given resource is being granted', required=False))
        grant_command.add_option(PulpCliOption('--role-id', 'id of the role to which access to given resource is being granted', required=False))
        grant_command.add_option(PulpCliOption('-o', 'type of permissions being granted, valid permissions: create, read, update, delete, execute', required=True, allow_multiple=True))
        self.add_command(grant_command)
        
        # Revoke Command
        revoke_command = PulpCliCommand('revoke', 'revokes resource permissions from given user or given role', self.revoke)
        revoke_command.add_option(PulpCliOption('--resource', 'resource REST API path whose permissions are being manipulated', required=True))
        revoke_command.add_option(PulpCliOption('--login', 'login of the user from which access to given resource is being revoked', required=False))
        revoke_command.add_option(PulpCliOption('--role-id', 'id of the role from which access to given resource is being revoked', required=False))
        revoke_command.add_option(PulpCliOption('-o', 'type of permissions being revoked, valid permissions: create, read, update, delete, execute', required=True, allow_multiple=True))
        self.add_command(revoke_command)
开发者ID:ehelms,项目名称:pulp,代码行数:26,代码来源:pulp_cli.py


示例3: __init__

    def __init__(self, context, name, description):
        PulpCliSection.__init__(self, name, description)

        strategy = RepoSyncSchedulingStrategy(context)

        repo_id_option = PulpCliOption('--%s' % REPO_ID_ARG, _('identifies the repository'), required=True)

        list_command = ListScheduleCommand(context, strategy, 'list', _('list scheduled sync operations'))
        list_command.add_option(repo_id_option)

        create_command = CreateScheduleCommand(context, strategy, 'create', _('adds a new scheduled sync operation'))
        create_command.add_option(repo_id_option)

        delete_command = DeleteScheduleCommand(context, strategy, 'delete', _('delete a sync schedule'))
        delete_command.add_option(repo_id_option)

        update_command = UpdateScheduleCommand(context, strategy, 'update', _('updates an existing schedule'))
        update_command.add_option(repo_id_option)

        next_run_command = NextRunCommand(context, strategy, 'next', _('displays the next scheduled sync run for a repository'))
        next_run_command.add_option(repo_id_option)

        self.add_command(list_command)
        self.add_command(create_command)
        self.add_command(delete_command)
        self.add_command(update_command)
        self.add_command(next_run_command)
开发者ID:ehelms,项目名称:pulp,代码行数:27,代码来源:sync_schedule.py


示例4: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'role', 'manage user roles')

        self.context = context
        self.prompt = context.prompt # for easier access

        # Common Options
        id_option = PulpCliOption('--role-id', 'uniquely identifies the role; only alphanumeric, -, and _ allowed', required=True, validate_func=validators.id_validator)

        # Create command
        create_command = PulpCliCommand('create', 'creates a role', self.create)
        create_command.add_option(id_option)
        create_command.add_option(PulpCliOption('--display-name', 'user-friendly name for the role', required=False))
        create_command.add_option(PulpCliOption('--description', 'user-friendly text describing the role', required=False))
        self.add_command(create_command)

        # Update command
        update_command = PulpCliCommand('update', 'updates a role', self.update)
        update_command.add_option(PulpCliOption('--role-id', 'identifies the role to be updated', required=True))
        update_command.add_option(PulpCliOption('--display-name', 'user-friendly name for the role', required=False))
        update_command.add_option(PulpCliOption('--description', 'user-friendly text describing the role', required=False))
        self.add_command(update_command)

        # Delete Command
        delete_command = PulpCliCommand('delete', 'deletes a role', self.delete)
        delete_command.add_option(PulpCliOption('--role-id', 'identifies the role to be deleted', required=True))
        self.add_command(delete_command)

        # List Command
        list_command = PulpCliCommand('list', 'lists summary of roles on the Pulp server', self.list)
        list_command.add_option(PulpCliFlag('--details', 'if specified, all the role information is displayed'))
        list_command.add_option(PulpCliOption('--fields', 'comma-separated list of role fields; if specified, only the given fields will displayed', required=False))
        self.add_command(list_command)
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:33,代码来源:auth.py


示例5: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'user', 'user lifecycle (list, create, update, etc.) commands')

        self.context = context
        self.prompt = context.prompt # for easier access

        # Common Options
        login_option = PulpCliOption('--login', 'uniquely identifies the user; only alphanumeric, -, and _ allowed', required=True)
        name_option = PulpCliOption('--name', 'user-readable full name of the user', required=False)

        # Create command
        create_command = PulpCliCommand('create', 'creates a user', self.create)
        create_command.add_option(login_option)
        create_command.add_option(PulpCliOption('--password', 'password for the new user, if you do not want to be prompted for one', required=False))
        create_command.add_option(name_option)
        self.add_command(create_command)

        # Update Command
        update_command = PulpCliCommand('update', 'changes metadata of an existing user', self.update)
        update_command.add_option(PulpCliOption('--login', 'identifies the user to be updated', required=True))
        update_command.add_option(name_option)
        self.add_command(update_command)

        # Delete Command
        delete_command = PulpCliCommand('delete', 'deletes a user', self.delete)
        delete_command.add_option(PulpCliOption('--login', 'identifies the user to be deleted', required=True))
        self.add_command(delete_command)

        # List Command
        list_command = PulpCliCommand('list', 'lists summary of users registered to the Pulp server', self.list)
        list_command.add_option(PulpCliFlag('--details', 'if specified, all the user information is displayed'))
        list_command.add_option(PulpCliOption('--fields', 'comma-separated list of user fields; if specified, only the given fields will displayed', required=False))
        self.add_command(list_command)
开发者ID:stpierre,项目名称:pulp,代码行数:33,代码来源:pulp_cli.py


示例6: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'group', _('consumer group commands'))

        self.context = context
        self.prompt = context.prompt # for easier access

        self.add_subsection(ConsumerGroupMemberSection(context))

        # Common Options
        id_option = PulpCliOption('--consumer-group-id', _('uniquely identifies the consumer group; only alphanumeric, -, and _ allowed'),
                                  required=True, validate_func=validators.id_validator)
        name_option = PulpCliOption('--display-name', _('user-readable display name for the consumer group'), required=False)
        description_option = PulpCliOption('--description', _('user-readable description for the consumer group'), required=False)

        note_desc =  'adds/updates/deletes notes to programmatically identify the resource; '
        note_desc += 'key-value pairs must be separated by an equal sign (e.g. key=value); multiple notes can '
        note_desc += 'be changed by specifying this option multiple times; notes are deleted by '
        note_desc += 'specifying "" as the value'
        note_option = PulpCliOption('--note', _(note_desc), required=False, allow_multiple=True)

        # Create Command
        create_command = PulpCliCommand('create', _('creates a new consumer group'), self.create)
        create_command.add_option(id_option)
        create_command.add_option(name_option)
        create_command.add_option(description_option)
        create_command.add_option(note_option)
        self.add_command(create_command)

        # Update Command
        update_command = PulpCliCommand('update', _('changes metadata on an existing consumer group'), self.update)
        update_command.add_option(id_option)
        update_command.add_option(name_option)
        update_command.add_option(description_option)
        update_command.add_option(note_option)
        self.add_command(update_command)

        # Delete Command
        delete_command = PulpCliCommand('delete', _('deletes a consumer group'), self.delete)
        delete_command.add_option(id_option)
        self.add_command(delete_command)

        # List Command
        list_command = PulpCliCommand('list', _('lists summary of consumer groups registered to the Pulp server'), self.list)
        list_command.add_option(PulpCliFlag('--details', _('if specified, all the consumer group information is displayed')))
        list_command.add_option(PulpCliOption('--fields', _('comma-separated list of consumer group fields; if specified, only the given fields will displayed'), required=False))
        self.add_command(list_command)

        # Search Command
        self.add_command(CriteriaCommand(self.search, include_search=True))

        # Bind Command
        bind_command = PulpCliCommand('bind',
            _('binds each consumer in a consumer group to a repository '
              'distributor for consuming published content'),
            self.bind)
        bind_command.add_option(id_option)
        bind_command.add_option(PulpCliOption('--repo-id', 'repository id', required=True))
        bind_command.add_option(PulpCliOption('--distributor-id', 'distributor id', required=True))
        self.add_command(bind_command)
开发者ID:domcleal,项目名称:pulp,代码行数:59,代码来源:pulp_cli.py


示例7: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, "user", "user lifecycle (list, create, update, etc.) commands")

        self.context = context
        self.prompt = context.prompt  # for easier access

        # Common Options
        login_option = PulpCliOption(
            "--login", "uniquely identifies the user; only alphanumeric, -, and _ allowed", required=True
        )
        name_option = PulpCliOption("--name", "user-readable full name of the user", required=False)

        # Create command
        create_command = PulpCliCommand("create", "creates a user", self.create)
        create_command.add_option(login_option)
        create_command.add_option(
            PulpCliOption(
                "--password", "password for the new user, if you do not want to be prompted for one", required=False
            )
        )
        create_command.add_option(name_option)
        self.add_command(create_command)

        # Update Command
        update_command = PulpCliCommand("update", "changes metadata of an existing user", self.update)
        update_command.add_option(PulpCliOption("--login", "identifies the user to be updated", required=True))
        update_command.add_option(name_option)
        update_command.add_option(
            PulpCliOption(
                "--password",
                "new password for the user, use -p if you want to be prompted for the password",
                required=False,
            )
        )
        update_command.add_option(
            PulpCliFlag("-p", "if specified, you will be prompted to enter new password for the user")
        )
        self.add_command(update_command)

        # Delete Command
        delete_command = PulpCliCommand("delete", "deletes a user", self.delete)
        delete_command.add_option(PulpCliOption("--login", "identifies the user to be deleted", required=True))
        self.add_command(delete_command)

        # List Command
        list_command = PulpCliCommand("list", "lists summary of users registered to the Pulp server", self.list)
        list_command.add_option(PulpCliFlag("--details", "if specified, all the user information is displayed"))
        list_command.add_option(
            PulpCliOption(
                "--fields",
                "comma-separated list of user fields; if specified, only the given fields will displayed",
                required=False,
            )
        )
        self.add_command(list_command)

        # Search Command
        self.add_command(CriteriaCommand(self.search, include_search=True))
开发者ID:ryanschneider,项目名称:pulp,代码行数:58,代码来源:pulp_cli.py


示例8: __init__

 def __init__(self, context):
     """
     :type  context: pulp.client.extensions.core.ClientContext
     """
     PulpCliSection.__init__(self, 'bindings', _('search consumer bindings'))
     self.context = context
     # search
     self.add_command(Search(context))
     # unconfirmed actions
     self.add_command(SearchUnconfirmed(context))
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:10,代码来源:binding.py


示例9: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'user', 'manage users')

        self.context = context
        self.prompt = context.prompt  # for easier access

        # Common Options
        login_option = PulpCliOption('--login', 'uniquely identifies the user; '
                                                'only alphanumeric, -, ., and _ allowed',
                                     required=True,
                                     validate_func=validators.id_validator_allow_dots)
        name_option = PulpCliOption('--name', 'user-readable full name of the user',
                                    required=False)

        # Create command
        create_command = PulpCliCommand('create', 'creates a user', self.create)
        create_command.add_option(login_option)
        create_command.add_option(PulpCliOption('--password', 'password for the new user, '
                                                'if you do not want to be prompted for one',
                                                required=False))
        create_command.add_option(name_option)
        self.add_command(create_command)

        # Update Command
        update_command = PulpCliCommand('update', 'changes metadata of an existing user',
                                        self.update)
        update_command.add_option(PulpCliOption('--login', 'identifies the user to be updated',
                                                required=True))
        update_command.add_option(name_option)
        update_command.add_option(PulpCliOption('--password', 'new password for the user, use -p '
                                                'if you want to be prompted for the password',
                                                required=False))
        update_command.add_option(PulpCliFlag('-p', 'if specified, you will be prompted to enter '
                                              'new password for the user'))
        self.add_command(update_command)

        # Delete Command
        delete_command = PulpCliCommand('delete', 'deletes a user', self.delete)
        delete_command.add_option(PulpCliOption('--login', 'identifies the user to be deleted',
                                                required=True))
        self.add_command(delete_command)

        # List Command
        list_command = PulpCliCommand('list', 'lists summary of users registered to the Pulp '
                                      'server', self.list)
        list_command.add_option(PulpCliFlag('--details', 'if specified, all the user information '
                                            'is displayed'))
        list_command.add_option(PulpCliOption('--fields', 'comma-separated list of user fields; '
                                                          'Example: "login,name". If specified, '
                                                          'only the given fields will be '
                                                          'displayed.', required=False))
        self.add_command(list_command)

        # Search Command
        self.add_command(CriteriaCommand(self.search, include_search=True))
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:55,代码来源:auth.py


示例10: __init__

    def __init__(self, context):
        PulpCliSection.__init__(self, 'group', _('repository group commands'))

        self.context = context
        self.prompt = context.prompt # for easier access

        self.add_subsection(RepoGroupMemberSection(context))

        self.add_command(group_commands.CreateRepositoryGroupCommand(context))
        self.add_command(group_commands.UpdateRepositoryGroupCommand(context))
        self.add_command(group_commands.DeleteRepositoryGroupCommand(context))
        self.add_command(group_commands.ListRepositoryGroupsCommand(context))
        self.add_command(group_commands.SearchRepositoryGroupsCommand(context))
开发者ID:bartwo,项目名称:pulp,代码行数:13,代码来源:pulp_cli.py


示例11: __init__

    def __init__(self, context, name, description):
        PulpCliSection.__init__(self, name, description)
        self.context = context

        # Store the command instances as instance variables so the subclasses
        # can manipulate them if necessary

        self.list_command = self.create_command('list', _('lists tasks queued or running in the server'), self.list)

        self.cancel_command = self.create_command('cancel', _('cancel one or more tasks'), self.cancel)
        self.cancel_command.create_option('--task-id', _('identifies the task to cancel'), required=True)

        self.details_command = self.create_command('details', _('displays more detailed information about a specific task'), self.details)
        self.details_command.create_option('--task-id', _('identifies the task'), required=True)
开发者ID:ehelms,项目名称:pulp,代码行数:14,代码来源:pulp_cli.py


示例12: __init__

 def __init__(self, context):
     PulpCliSection.__init__(
         self,
         'package',
         _('package installation management'))
     for Command in (Install, Update, Uninstall):
         command = Command(context)
         command.create_option(
             '--consumer-id',
             _('identifies the consumer'),
             required=True)
         command.create_flag(
             '--no-commit',
             _('transaction not committed'))
         command.create_flag(
             '--reboot',
             _('reboot after successful transaction'))
         self.add_command(command)
开发者ID:ehelms,项目名称:pulp,代码行数:18,代码来源:package.py


示例13: __init__

    def __init__(self, context, name, description):
        PulpCliSection.__init__(self, name, description)
        self.context = context

        # Store the command instances as instance variables so the subclasses
        # can manipulate them if necessary

        self.list_command = self.create_command(
            "list", _("lists tasks queued (waiting) or running on the server"), self.list
        )

        self.cancel_command = self.create_command("cancel", _("cancel one or more tasks"), self.cancel)
        self.cancel_command.create_option("--task-id", _("identifies the task to cancel"), required=True)

        self.details_command = self.create_command(
            "details", _("displays more detailed information about a specific task"), self.details
        )
        self.details_command.create_option("--task-id", _("identifies the task"), required=True)
开发者ID:HackLinux,项目名称:pulp,代码行数:18,代码来源:tasks.py


示例14: __init__

 def __init__(self, context):
     PulpCliSection.__init__(self, 'content', _('content unit installation management'))
     for Command in (InstallContent, UpdateContent, UninstallContent):
         command = Command(context)
         command.create_option(
             '--consumer-id',
             _('identifies the consumer'),
             required=True)
         command.create_option(
             '--type',
             _('content unit type ID'),
             required=True)
         command.create_option(
             '--name',
             _('content unit key (name)'),
             required=True,
             allow_multiple=True,
             aliases=['-n'])
         command.create_flag(
             '--no-commit',
             _('transaction not committed'))
         self.add_command(command)
开发者ID:jlsherrill,项目名称:pulp,代码行数:22,代码来源:pulp_cli.py



注:本文中的pulp.client.extensions.extensions.PulpCliSection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python bundle.Bundle类代码示例发布时间:2022-05-25
下一篇:
Python extensions.PulpCliOptionGroup类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap