当前位置: 首页>>代码示例>>Python>>正文


Python resource.get_plural_display_name函数代码示例

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


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

示例1: __init__

    def __init__(self, resource, *args, **kwargs):

        self.default_limit = 50

        super(RuleListCommand, self).__init__(resource, 'list',
                                              'Get the list of the %s most recent %s.' %
                                              (self.default_limit,
                                               resource.get_plural_display_name().lower()),
                                              *args, **kwargs)

        self.resource_name = resource.get_plural_display_name().lower()
        self.group = self.parser.add_argument_group()
        self.parser.add_argument('-n', '--last', type=int, dest='last',
                                 default=self.default_limit,
                                 help=('List N most recent %s. Use -n -1 to fetch the full result \
                                       set.' % self.resource_name))
        self.parser.add_argument('--iftt', action='store_true',
                                 help='Show trigger and action in display list.')
        self.parser.add_argument('-p', '--pack', type=str,
                                 help=('Only return resources belonging to the'
                                       ' provided pack'))
        self.group.add_argument('-c', '--action',
                                help='Action reference to filter the list.')
        self.group.add_argument('-g', '--trigger',
                                help='Trigger type reference to filter the list.')
        self.enabled_filter_group = self.parser.add_mutually_exclusive_group()
        self.enabled_filter_group.add_argument('--enabled', action='store_true',
                                               help='Show rules that are enabled.')
        self.enabled_filter_group.add_argument('--disabled', action='store_true',
                                               help='Show rules that are disabled.')
开发者ID:StackStorm,项目名称:st2,代码行数:30,代码来源:rule.py

示例2: __init__

    def __init__(self, resource, *args, **kwargs):
        super(RuleEnforcementListCommand, self).__init__(
            resource,
            "list",
            "Get the list of the 50 most recent %s." % resource.get_plural_display_name().lower(),
            *args,
            **kwargs
        )

        self.group = self.parser.add_argument_group()
        self.parser.add_argument(
            "-n",
            "--last",
            type=int,
            dest="last",
            default=50,
            help=("List N most recent %s; " "list all if 0." % resource.get_plural_display_name().lower()),
        )

        # Filter options
        self.group.add_argument("--trigger-instance", help="Trigger instance id to filter the list.")

        self.group.add_argument("--execution", help="Execution id to filter the list.")
        self.group.add_argument("--rule", help="Rule ref to filter the list.")

        self.parser.add_argument(
            "-tg",
            "--timestamp-gt",
            type=str,
            dest="timestamp_gt",
            default=None,
            help=(
                "Only return enforcements with enforced_at "
                "greater than the one provided. "
                "Use time in the format 2000-01-01T12:00:00.000Z"
            ),
        )
        self.parser.add_argument(
            "-tl",
            "--timestamp-lt",
            type=str,
            dest="timestamp_lt",
            default=None,
            help=(
                "Only return enforcements with enforced_at "
                "lower than the one provided. "
                "Use time in the format 2000-01-01T12:00:00.000Z"
            ),
        )
        # Display options
        self.parser.add_argument(
            "-a",
            "--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:jsjeannotte,项目名称:st2,代码行数:60,代码来源:rule_enforcement.py

示例3: __init__

    def __init__(self, resource, *args, **kwargs):
        super(TriggerInstanceListCommand, self).__init__(
            resource, 'list', 'Get the list of the 50 most recent %s.' %
            resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.group = self.parser.add_argument_group()
        self.parser.add_argument('-n', '--last', type=int, dest='last',
                                 default=50,
                                 help=('List N most recent %s; '
                                       'list all if 0.' %
                                       resource.get_plural_display_name().lower()))

        # Filter options
        self.group.add_argument('--trigger', help='Trigger reference to filter the list.')

        self.parser.add_argument('-tg', '--timestamp-gt', type=str, dest='timestamp_gt',
                                 default=None,
                                 help=('Only return trigger instances with occurrence_time '
                                       'greater than the one provided. '
                                       'Use time in the format 2000-01-01T12:00:00.000Z'))
        self.parser.add_argument('-tl', '--timestamp-lt', type=str, dest='timestamp_lt',
                                 default=None,
                                 help=('Only return trigger instances with timestamp '
                                       'lower than the one provided. '
                                       'Use time in the format 2000-01-01T12:00:00.000Z'))
        # Display options
        self.parser.add_argument('-a', '--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:jtopjian,项目名称:st2,代码行数:35,代码来源:triggerinstance.py

示例4: __init__

    def __init__(self, resource, *args, **kwargs):
        super(TraceListCommand, self).__init__(
            resource, 'list', 'Get the list of the 50 most recent %s.' %
            resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.group = self.parser.add_mutually_exclusive_group()
        self.parser.add_argument('-n', '--last', type=int, dest='last',
                                 default=50,
                                 help=('List N most recent %s; '
                                       'list all if 0.' %
                                       resource.get_plural_display_name().lower()))

        # Filter options
        self.group.add_argument('-c', '--trace-tag', help='Trace-tag to filter the list.')
        self.group.add_argument('-e', '--execution', help='Execution to filter the list.')
        self.group.add_argument('-r', '--rule', help='Rule to filter the list.')
        self.group.add_argument('-g', '--trigger-instance',
                                help='TriggerInstance to filter the list.')
        # Display options
        self.parser.add_argument('-a', '--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:automotola,项目名称:st2,代码行数:28,代码来源:trace.py

示例5: __init__

    def __init__(self, resource, *args, **kwargs):
        help_text = ('Load a list of %s from file.' %
                     resource.get_plural_display_name().lower())
        super(KeyValuePairLoadCommand, self).__init__(resource, 'load',
            help_text, *args, **kwargs)

        self.parser.add_argument(
            'file', help=('JSON file containing the %s to create.'
                          % resource.get_plural_display_name().lower()))
开发者ID:automotola,项目名称:st2,代码行数:9,代码来源:keyvalue.py

示例6: __init__

    def __init__(self, resource, *args, **kwargs):
        super(PackInstallCommand, self).__init__(resource, 'install',
            'Install new %s.' % resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.parser.add_argument('packs',
                                 nargs='+',
                                 metavar='pack',
                                 help='Name of the %s to install.' %
                                 resource.get_plural_display_name().lower())
开发者ID:LindsayHill,项目名称:st2,代码行数:10,代码来源:pack.py

示例7: __init__

    def __init__(self, resource, *args, **kwargs):
        super(PackRemoveCommand, self).__init__(
            resource, "remove", "Remove %s." % resource.get_plural_display_name().lower(), *args, **kwargs
        )

        self.parser.add_argument(
            "packs",
            nargs="+",
            metavar="pack",
            help="Name of the %s to remove." % resource.get_plural_display_name().lower(),
        )
开发者ID:Plexxi,项目名称:st2,代码行数:11,代码来源:pack.py

示例8: __init__

    def __init__(self, resource, *args, **kwargs):
        help_text = ('Load a list of %s from file.' %
                     resource.get_plural_display_name().lower())
        super(KeyValuePairLoadCommand, self).__init__(resource, 'load',
                                                      help_text, *args, **kwargs)

        self.parser.add_argument('-c', '--convert', action='store_true',
                                 help=('Convert non-string types (hash, array, boolean,'
                                       ' int, float) to a JSON string before loading it'
                                       ' into the datastore.'))
        self.parser.add_argument(
            'file', help=('JSON/YAML file containing the %s(s) to load'
                          % resource.get_plural_display_name().lower()))
开发者ID:lyandut,项目名称:st2,代码行数:13,代码来源:keyvalue.py

示例9: __init__

    def __init__(self, resource, *args, **kwargs):
        super(PackInstallCommand, self).__init__(resource, 'install',
            'Install new %s.' % resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.parser.add_argument('packs',
                                 nargs='+',
                                 metavar='pack',
                                 help='Name of the %s to install.' %
                                 resource.get_plural_display_name().lower())
        self.parser.add_argument('--force',
                                 action='store_true',
                                 default=False,
                                 help='Force pack installation.')
开发者ID:Pulsant,项目名称:st2,代码行数:14,代码来源:pack.py

示例10: __init__

    def __init__(self, resource, *args, **kwargs):
        super(ActionExecutionListCommand, self).__init__(
            resource, 'list', 'Get the list of the 50 most recent %s.' %
            resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.group = self.parser.add_argument_group()
        self.parser.add_argument('-n', '--last', type=int, dest='last',
                                 default=50,
                                 help=('List N most recent %s.' %
                                       resource.get_plural_display_name().lower()))
        self.parser.add_argument('-s', '--sort', type=str, dest='sort_order',
                                 default='descending',
                                 help=('Sort %s by start timestamp, '
                                       'asc|ascending (earliest first) '
                                       'or desc|descending (latest first)' %
                                       resource.get_plural_display_name().lower()))

        # Filter options
        self.group.add_argument('--action', help='Action reference to filter the list.')
        self.group.add_argument('--status', help=('Only return executions with the provided status.'
                                                  ' Possible values are \'%s\', \'%s\', \'%s\','
                                                  '\'%s\' or \'%s\''
                                                  '.' % POSSIBLE_ACTION_STATUS_VALUES))
        self.group.add_argument('--trigger_instance',
                                help='Trigger instance id to filter the list.')
        self.parser.add_argument('-tg', '--timestamp-gt', type=str, dest='timestamp_gt',
                                 default=None,
                                 help=('Only return executions with timestamp '
                                       'greater than the one provided. '
                                       'Use time in the format "2000-01-01T12:00:00.000Z".'))
        self.parser.add_argument('-tl', '--timestamp-lt', type=str, dest='timestamp_lt',
                                 default=None,
                                 help=('Only return executions with timestamp '
                                       'lower than the one provided. '
                                       'Use time in the format "2000-01-01T12:00:00.000Z".'))
        self.parser.add_argument('-l', '--showall', action='store_true',
                                 help='')

        # Display options
        self.parser.add_argument('-a', '--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:LindsayHill,项目名称:st2,代码行数:48,代码来源:action.py

示例11: __init__

    def __init__(self, resource, *args, **kwargs):
        super(TimerListCommand, self).__init__(resource, *args, **kwargs)

        self.parser.add_argument('-ty', '--timer-type', type=str, dest='timer_type',
                                 help=("List %s type, example: 'core.st2.IntervalTimer', \
                                       'core.st2.DateTimer', 'core.st2.CronTimer'." %
                                       resource.get_plural_display_name().lower()), required=False)
开发者ID:StackStorm,项目名称:st2,代码行数:7,代码来源:timer.py

示例12: __init__

    def __init__(self, resource, *args, **kwargs):
        super(PackInstallCommand, self).__init__(resource, 'install', 'Install new %s.'
                                                 % resource.get_plural_display_name().lower(),
                                                 *args, **kwargs)

        self.parser.add_argument('packs',
                                 nargs='+',
                                 metavar='pack',
                                 help='Name of the %s in Exchange, or a git repo URL.' %
                                 resource.get_plural_display_name().lower())
        self.parser.add_argument('--python3',
                                 action='store_true',
                                 default=False,
                                 help='Use Python 3 binary for pack virtual environment.')
        self.parser.add_argument('--force',
                                 action='store_true',
                                 default=False,
                                 help='Force pack installation.')
开发者ID:lyandut,项目名称:st2,代码行数:18,代码来源:pack.py

示例13: __init__

    def __init__(self, resource, *args, **kwargs):
        super(ActionExecutionCancelCommand, self).__init__(
            resource, 'cancel', 'Cancel an %s.' %
            resource.get_plural_display_name().lower(),
            *args, **kwargs)

        self.parser.add_argument('id',
                                 help=('ID of the %s.' %
                                       resource.get_display_name().lower()))
开发者ID:azamsheriff,项目名称:st2,代码行数:9,代码来源:action.py

示例14: __init__

    def __init__(self, resource, *args, **kwargs):

        self.default_limit = 50

        super(RuleEnforcementListCommand, self).__init__(
            resource, 'list', 'Get the list of the %s most recent %s.' %
            (self.default_limit, resource.get_plural_display_name().lower()),
            *args, **kwargs)
        self.resource_name = resource.get_plural_display_name().lower()
        self.group = self.parser.add_argument_group()
        self.parser.add_argument('-n', '--last', type=int, dest='last',
                                 default=self.default_limit,
                                 help=('List N most recent %s. Use -n -1 to fetch the full result \
                                       set.' % self.resource_name))

        # Filter options
        self.group.add_argument('--trigger-instance',
                                help='Trigger instance id to filter the list.')

        self.group.add_argument('--execution',
                                help='Execution id to filter the list.')
        self.group.add_argument('--rule',
                                help='Rule ref to filter the list.')

        self.parser.add_argument('-tg', '--timestamp-gt', type=str, dest='timestamp_gt',
                                 default=None,
                                 help=('Only return enforcements with enforced_at '
                                       'greater than the one provided. '
                                       'Use time in the format 2000-01-01T12:00:00.000Z'))
        self.parser.add_argument('-tl', '--timestamp-lt', type=str, dest='timestamp_lt',
                                 default=None,
                                 help=('Only return enforcements with enforced_at '
                                       'lower than the one provided. '
                                       'Use time in the format 2000-01-01T12:00:00.000Z'))
        # Display options
        self.parser.add_argument('-a', '--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:StackStorm,项目名称:st2,代码行数:43,代码来源:rule_enforcement.py

示例15: __init__

    def __init__(self, resource, *args, **kwargs):
        super(TimerListCommand, self).__init__(resource, *args, **kwargs)

        self.parser.add_argument(
            "-ty",
            "--timer-type",
            type=str,
            dest="timer_type",
            help=("List N most recent %s." % resource.get_plural_display_name().lower()),
            required=False,
        )
开发者ID:Pulsant,项目名称:st2,代码行数:11,代码来源:timer.py


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