MCPcopy Create free account
hub / github.com/StackStorm/st2 / __init__

Method __init__

st2client/st2client/commands/resource.py:443–470  ·  view source on GitHub ↗
(self, resource, *args, **kwargs)

Source from the content-addressed store, hash-verified

441 help_string = None
442
443 def __init__(self, resource, *args, **kwargs):
444 super(ResourceGetCommand, self).__init__(
445 resource,
446 "get",
447 self.help_string
448 or "Get individual %s." % resource.get_display_name().lower(),
449 *args,
450 **kwargs,
451 )
452
453 argument = self.pk_argument_name
454 metavar = self._get_metavar_for_argument(argument=self.pk_argument_name)
455 help = self._get_help_for_argument(
456 resource=resource, argument=self.pk_argument_name
457 )
458
459 self.parser.add_argument(argument, metavar=metavar, nargs="+", help=help)
460 self.parser.add_argument(
461 "-a",
462 "--attr",
463 nargs="+",
464 default=self.display_attributes,
465 help=(
466 "List of attributes to include in the "
467 'output. "all" or unspecified will '
468 "return all attributes."
469 ),
470 )
471
472 @add_auth_token_to_kwargs_from_cli
473 def run(self, args, **kwargs):

Callers

nothing calls this directly

Calls 4

get_display_nameMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected