本文整理汇总了Python中st2client.commands.resource.get_display_name函数的典型用法代码示例。如果您正苦于以下问题:Python get_display_name函数的具体用法?Python get_display_name怎么用?Python get_display_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_display_name函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, resource, *args, **kwargs):
super(PackShowCommand, self).__init__(resource, 'show',
'Get information about a %s from the index.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('pack',
help='Name of the %s to show.' %
resource.get_display_name().lower())
开发者ID:LindsayHill,项目名称:st2,代码行数:8,代码来源:pack.py
示例2: __init__
def __init__(self, resource, *args, **kwargs):
super(PackConfigCommand, self).__init__(
resource,
"config",
"Configure a %s based on config schema." % resource.get_display_name().lower(),
*args,
**kwargs
)
self.parser.add_argument("name", help="Name of the %s(s) to configure." % resource.get_display_name().lower())
开发者ID:Plexxi,项目名称:st2,代码行数:10,代码来源:pack.py
示例3: __init__
def __init__(self, resource, *args, **kwargs):
super(ActionExecutionGetCommand, self).__init__(
resource, 'get',
'Get individual %s.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('id',
help=('ID of the %s.' %
resource.get_display_name().lower()))
self._add_common_options()
开发者ID:azamsheriff,项目名称:st2,代码行数:11,代码来源:action.py
示例4: __init__
def __init__(self, resource, *args, **kwargs):
super(ActionAliasExecuteCommand, self).__init__(
resource, 'execute',
('Execute the command text by finding a matching %s.' %
resource.get_display_name().lower()), *args, **kwargs)
self.parser.add_argument('command_text',
metavar='command',
help=('Execute the command text by finding a matching %s.' %
resource.get_display_name().lower()))
self.parser.add_argument('-u', '--user', type=str, default=None,
help='User under which to run the action (admins only).')
开发者ID:StackStorm,项目名称:st2,代码行数:12,代码来源:action_alias.py
示例5: __init__
def __init__(self, resource, *args, **kwargs):
super(ApiKeyLoadCommand, self).__init__(
resource, 'load', 'Load %s from a file.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('file',
help=('JSON/YAML file containing the %s(s) to load.'
% resource.get_display_name().lower()),
default='')
self.parser.add_argument('-w', '--width', nargs='+', type=int,
default=None,
help=('Set the width of columns in output.'))
开发者ID:Bala96,项目名称:st2,代码行数:13,代码来源:auth.py
示例6: __init__
def __init__(self, resource, *args, **kwargs):
super(ActionExecutionGetCommand, self).__init__(
resource, 'get',
'Get individual %s.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('id',
help=('ID of the %s.' %
resource.get_display_name().lower()))
self.parser.add_argument('-a', '--attr', nargs='+',
default=self.display_attributes,
help=('List of attributes to include in the '
'output. "all" or unspecified will '
'return all attributes.'))
开发者ID:bjoernbessert,项目名称:st2,代码行数:14,代码来源:action.py
示例7: __init__
def __init__(self, resource, *args, **kwargs):
super(KeyValuePairSetCommand, self).__init__(
resource, 'set',
'Set an existing %s.' % resource.get_display_name().lower(),
*args, **kwargs
)
# --encrypt and --encrypted options are mutually exclusive.
# --encrypt implies provided value is plain text and should be encrypted whereas
# --encrypted implies value is already encrypted and should be treated as-is.
encryption_group = self.parser.add_mutually_exclusive_group()
encryption_group.add_argument('-e', '--encrypt', dest='secret',
action='store_true',
help='Encrypt value before saving.')
encryption_group.add_argument('--encrypted', dest='encrypted',
action='store_true',
help=('Value provided is already encrypted with the '
'instance crypto key and should be stored as-is.'))
self.parser.add_argument('name',
metavar='name',
help='Name of the key value pair.')
self.parser.add_argument('value', help='Value paired with the key.')
self.parser.add_argument('-l', '--ttl', dest='ttl', type=int, default=None,
help='TTL (in seconds) for this value.')
self.parser.add_argument('-s', '--scope', dest='scope', default=DEFAULT_CUD_SCOPE,
help='Specify the scope under which you want ' +
'to place the item.')
self.parser.add_argument('-u', '--user', dest='user', default=None,
help='User for user scoped items (admin only).')
开发者ID:StackStorm,项目名称:st2,代码行数:30,代码来源:keyvalue.py
示例8: __init__
def __init__(self, resource, *args, **kwargs):
super(ActionAliasExecuteCommand, self).__init__(
resource, 'execute',
('Execute the command text by finding a matching %s.' %
resource.get_display_name().lower()),
*args, **kwargs)
self.parser.add_argument('command_text',
metavar='command',
help=help)
self.parser.add_argument('-h', '--help',
action='store_true', dest='help',
help='Print usage for the given action.')
self.parser.add_argument('--trace-tag', '--trace_tag',
help='A trace tag string to track execution later.',
dest='trace_tag', required=False)
self.parser.add_argument('--trace-id',
help='Existing trace id for this execution.',
dest='trace_id', required=False)
self.parser.add_argument('-a', '--async',
action='store_true', dest='async',
help='Do not wait for action to finish.')
self.parser.add_argument('-u', '--user', type=str, default=None,
help='User under which to run the action (admins only).')
self.parser.add_argument('--attr', nargs='+',
default=self.display_attributes,
help=('List of attributes to include in the '
'output. "all" will return all '
'attributes.'))
self.parser.add_argument('-w', '--width', nargs='+', type=int,
default=None,
help=('Set the width of columns in output.'))
开发者ID:peak6,项目名称:st2,代码行数:33,代码来源:action_alias.py
示例9: __init__
def __init__(self, resource, *args, **kwargs):
super(KeyValuePairCreateCommand, self).__init__(resource, 'create',
'Create a new %s.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('name', help='Key name.')
self.parser.add_argument('value', help='Value paired with the key.')
开发者ID:bjoernbessert,项目名称:st2,代码行数:7,代码来源:datastore.py
示例10: __init__
def __init__(self, resource, *args, **kwargs):
super(KeyValuePairSetCommand, self).__init__(resource, 'set',
'Set an existing %s.' % resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('name',
metavar='name',
help='Name of the key value pair.')
self.parser.add_argument('value', help='Value paired with the key.')
开发者ID:BlazeMediaGroup,项目名称:st2,代码行数:9,代码来源:datastore.py
示例11: __init__
def __init__(self, resource, *args, **kwargs):
super(PackSearchCommand, self).__init__(resource, 'search',
'Search the index for a %s with any attribute \
matching the query.'
% resource.get_display_name().lower(),
*args, **kwargs)
self.parser.add_argument('query',
help='Search query.')
开发者ID:lyandut,项目名称:st2,代码行数:9,代码来源:pack.py
示例12: __init__
def __init__(self, resource, *args, **kwargs):
super(KeyValuePairSetCommand, self).__init__(
resource, 'set',
'Set an existing %s.' % resource.get_display_name().lower(),
*args, **kwargs
)
self.parser.add_argument('name',
metavar='name',
help='Name of the key value pair.')
self.parser.add_argument('value', help='Value paired with the key.')
self.parser.add_argument('-l', '--ttl', dest='ttl', type=int, default=None,
help='TTL (in seconds) for this value.')
开发者ID:automotola,项目名称:st2,代码行数:13,代码来源:keyvalue.py
示例13: __init__
def __init__(self, resource, *args, **kwargs):
super(InquiryRespondCommand, self).__init__(
resource, 'respond',
'Respond to an %s.' % resource.get_display_name().lower(),
*args, **kwargs
)
self.parser.add_argument('id',
metavar='id',
help='Inquiry ID')
self.parser.add_argument('-r', '--response', type=str, dest='response',
default=None,
help=('Entire response payload as JSON string '
'(bypass interactive mode)'))
开发者ID:StackStorm,项目名称:st2,代码行数:14,代码来源:inquiry.py
示例14: __init__
def __init__(self, resource, *args, **kwargs):
super(KeyValuePairSetCommand, self).__init__(
resource, 'set',
'Set an existing %s.' % resource.get_display_name().lower(),
*args, **kwargs
)
self.parser.add_argument('name',
metavar='name',
help='Name of the key value pair.')
self.parser.add_argument('value', help='Value paired with the key.')
self.parser.add_argument('-l', '--ttl', dest='ttl', type=int, default=None,
help='TTL (in seconds) for this value.')
self.parser.add_argument('-e', '--encrypt', dest='secret',
action='store_true',
help='Encrypt value before saving.')
self.parser.add_argument('-s', '--scope', dest='scope', default=DEFAULT_SCOPE,
help='Specify the scope under which you want ' +
'to place the item.')
self.parser.add_argument('-u', '--user', dest='user', default=None,
help='User for user scoped items (admin only).')
开发者ID:lyandut,项目名称:st2,代码行数:21,代码来源:keyvalue.py
注:本文中的st2client.commands.resource.get_display_name函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论