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

Method __init__

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

Source from the content-addressed store, hash-verified

1415 }
1416
1417 def __init__(self, resource, *args, **kwargs):
1418
1419 self.default_limit = 50
1420
1421 super(ActionExecutionListCommand, self).__init__(
1422 resource,
1423 "list",
1424 "Get the list of the %s most recent %s."
1425 % (self.default_limit, resource.get_plural_display_name().lower()),
1426 *args,
1427 **kwargs,
1428 )
1429
1430 self.resource_name = resource.get_plural_display_name().lower()
1431 self.group = self.parser.add_argument_group()
1432 self.parser.add_argument(
1433 "-n",
1434 "--last",
1435 type=int,
1436 dest="last",
1437 default=self.default_limit,
1438 help=(
1439 "List N most recent %s. Use -n -1 to fetch the full result \
1440 set."
1441 % self.resource_name
1442 ),
1443 )
1444 self.parser.add_argument(
1445 "-s",
1446 "--sort",
1447 type=str,
1448 dest="sort_order",
1449 default="descending",
1450 help=(
1451 "Sort %s by start timestamp, "
1452 "asc|ascending (earliest first) "
1453 "or desc|descending (latest first)" % self.resource_name
1454 ),
1455 )
1456
1457 # Filter options
1458 self.group.add_argument("--action", help="Action reference to filter the list.")
1459 self.group.add_argument(
1460 "--status",
1461 help=(
1462 "Only return executions with the provided \
1463 status. Possible values are '%s', '%s', \
1464 '%s', '%s', '%s', '%s' or '%s'"
1465 "." % POSSIBLE_ACTION_STATUS_VALUES
1466 ),
1467 )
1468 self.group.add_argument(
1469 "--user", help="Only return executions created by the provided user."
1470 )
1471 self.group.add_argument(
1472 "--trigger_instance", help="Trigger instance id to filter the list."
1473 )
1474 self.parser.add_argument(

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected