本文整理汇总了Python中pulp.client.extensions.extensions.PulpCliCommand.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python PulpCliCommand.__init__方法的具体用法?Python PulpCliCommand.__init__怎么用?Python PulpCliCommand.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.client.extensions.extensions.PulpCliCommand
的用法示例。
在下文中一共展示了PulpCliCommand.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.history)
self.context = context
self.prompt = context.prompt
d = ('limits displayed history entries to the given type; supported types: '
'("consumer_registered", "consumer_unregistered", "repo_bound", "repo_unbound",'
'"content_unit_installed", "content_unit_uninstalled", "unit_profile_changed", '
'"added_to_group", "removed_from_group")')
self.add_option(PulpCliOption('--event-type', _(d), required=False))
self.add_option(PulpCliOption(
'--limit',
'limits displayed history entries to the given amount (must be greater than zero)',
required=False))
self.add_option(PulpCliOption(
'--sort',
'indicates the sort direction ("ascending" or "descending") based on the entry\'s '
'timestamp',
required=False))
self.add_option(PulpCliOption(
'--start-date',
'only return entries that occur on or after the given date in iso8601 format '
'(yyyy-mm-ddThh:mm:ssZ)',
required=False))
self.add_option(PulpCliOption(
'--end-date',
'only return entries that occur on or before the given date in iso8601 format '
'(yyyy-mm-ddThh:mm:ssZ)',
required=False))
示例2: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, strategy, name, description):
PulpCliCommand.__init__(self, name, description, self.delete)
self.context = context
self.strategy = strategy
d = 'identifies the schedule to delete'
self.create_option('--schedule-id', _(d), required=True)
示例3: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, method, name=None, description=None, filtering=True,
include_search=True, *args, **kwargs):
"""
:param name: name used to invoke the command
:type name: str
:param description: user-readable text describing the command
:type description: str
:param method: A method to call when this command is executed. See
okaara docs for more info
:type method: callable
:param filtering: if True, the command will add all filtering options
:type filtering: bool
:param include_search: if True, the command will add all non-filter
criteria options such as limit, seek, sort, etc.
:type include_search: bool
"""
name = name or kwargs.pop('name', None) or 'search'
description = description or kwargs.pop('description', None) or _SEARCH_DESCRIPTION
PulpCliCommand.__init__(self, name, description, method, **kwargs)
# Hang on to these so unit tests can verify the command is configuration
self.filtering = filtering
self.include_search = include_search
if filtering:
self.add_filtering()
if include_search:
self.add_display_criteria_options()
示例4: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, strategy, name=NAME_CREATE, description=DESC_CREATE):
PulpCliCommand.__init__(self, name, description, self.run)
self.context = context
self.strategy = strategy
self.add_option(OPT_SCHEDULE)
self.add_option(OPT_FAILURE_THRESHOLD)
示例5: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.unbind)
self.context = context
self.prompt = context.prompt
self.add_option(PulpCliOption('--repo-id', 'repository id', required=True))
self.add_option(PulpCliOption('--distributor-id', 'distributor id', required=True))
示例6: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, name, description, method, context, poll_frequency_in_seconds=None):
"""
:param name: command name
:type name: str
:param description: command description
:type description: str
:param method: method that will be fun when the command is invoked
:type method: function
:param context: client context
:type context: pulp.client.extensions.core.ClientContext
:param poll_frequency_in_seconds: time between polling calls to the server
:type poll_frequency_in_seconds: float
"""
PulpCliCommand.__init__(self, name, description, method)
self.context = context
self.prompt = context.prompt
self.poll_frequency_in_seconds = poll_frequency_in_seconds
if poll_frequency_in_seconds is None:
self.poll_frequency_in_seconds = float(self.context.config['output']['poll_frequency_in_seconds'])
self.add_flag(FLAG_BACKGROUND)
#list of tasks we already know about
self.known_tasks = set()
示例7: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.unbind)
self.context = context
self.prompt = context.prompt
self.add_option(PulpCliOption('--repo-id', 'repository id', required=True))
self.add_option(PulpCliFlag('--force', 'delete the binding immediately and discontinue '
'tracking consumer actions'))
示例8: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.create)
self.context = context
self.prompt = context.prompt
d = "identifies the repository the package category will be created in"
self.create_option("--repo-id", _(d), required=True)
d = "id of this package category"
self.create_option("--category-id", _(d), aliases=["-i"], required=True)
d = "name of this package category"
self.create_option("--name", _(d), aliases=["-n"], required=True)
d = "description of this package category"
self.create_option("--description", _(d), aliases=["-d"], required=True)
d = "display order for this package category"
self.create_option("--display-order", _(d), allow_multiple=False, required=False, default=0)
d = "package group ids to include in this package category"
self.create_option("--group", _(d), aliases=["-g"], allow_multiple=True, required=False)
d = "display extra information about the creation process"
self.create_flag("-v", _(d))
示例9: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context):
desc = 'updates an existing repository\'s configuration'
PulpCliCommand.__init__(self, 'update', desc, self.update)
self.context = context
add_repo_options(self, True)
示例10: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context):
d = _('login and download a session certificate')
PulpCliCommand.__init__(self, 'login', d, self.login)
self.context = context
self.create_option('--username', _('server account username'), aliases=['-u'], required=True)
self.create_option('--password', _('server account password'), aliases=['-p'], required=False)
示例11: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.unregister)
self.context = context
self.prompt = context.prompt
d = 'if specified, the local consumer identification certificate will be '\
'removed even if the server cannot be contacted'
self.create_flag('--force', _(d))
示例12: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context):
"""
:param context: The client context.
:type context: pulp.client.extensions.core.ClientContext
"""
PulpCliCommand.__init__(self, self.NAME, self.DESCRIPTION, self.status)
self.context = context
self.api = context.server.server_status
示例13: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.cancel)
self.context = context
d = 'removes the client-side tracking file for the upload regardless of ' \
'whether or not it was able to be deleted on the server; this should ' \
'only be used in the event that the server\'s knowledge of an upload ' \
'has been removed'
self.create_flag('--force', _(d))
示例14: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, name, description):
PulpCliCommand.__init__(self, name, description, self.run)
self.context = context
# Add options and groups
add_required_group(self)
add_erratum_group(self)
add_display_group(self, FIELDS_ERRATA)
add_pagination_group(self)
示例15: __init__
# 需要导入模块: from pulp.client.extensions.extensions import PulpCliCommand [as 别名]
# 或者: from pulp.client.extensions.extensions.PulpCliCommand import __init__ [as 别名]
def __init__(self, context, upload_manager, name="resume", description=DESC_RESUME, method=None):
if method is None:
method = self.run
PulpCliCommand.__init__(self, name, description, method)
self.context = context
self.prompt = context.prompt
self.upload_manager = upload_manager