MCPcopy Index your code
hub / github.com/StackStorm/st2 / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

358
359class ApiKeyCreateCommand(resource.ResourceCommand):
360 def __init__(self, resource, *args, **kwargs):
361 super(ApiKeyCreateCommand, self).__init__(
362 resource,
363 "create",
364 "Create a new %s." % resource.get_display_name().lower(),
365 *args,
366 **kwargs,
367 )
368
369 self.parser.add_argument(
370 "-u",
371 "--user",
372 type=str,
373 help="User for which to create API Keys.",
374 default="",
375 )
376 self.parser.add_argument(
377 "-m",
378 "--metadata",
379 type=json.loads,
380 help="Optional metadata to associate with the API Keys.",
381 default={},
382 )
383 self.parser.add_argument(
384 "-k",
385 "--only-key",
386 action="store_true",
387 dest="only_key",
388 default=False,
389 help="Only print API Key to the console on creation.",
390 )
391
392 @resource.add_auth_token_to_kwargs_from_cli
393 def run(self, args, **kwargs):

Callers

nothing calls this directly

Calls 2

get_display_nameMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected