-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import click | ||
import yawac | ||
from yawac.apis.tags.get_outcome_api import GetOutcomeApi | ||
from yawa_ops.commands.base_command import BaseCommand | ||
from yawa_ops.utils import logutils | ||
from yawa_ops.utils.api import build_client, print_response | ||
|
||
log = logutils.get_logger(__name__) | ||
|
||
|
||
@click.command(help="Get Greetings.", cls=BaseCommand) | ||
@click.pass_context | ||
@click.option( | ||
"--outcome", | ||
required=True, | ||
help="Outcome.", | ||
) | ||
def get_outcome(ctx, endpoint, profile, verify_ssl, ca_file, debug, outcome): | ||
with build_client(**ctx.obj.get("CLIENT_CONFIG")) as api_client: | ||
try: | ||
response = GetOutcomeApi(api_client).get_outcome( | ||
query_params={ | ||
"outcome": outcome, | ||
} | ||
) | ||
print_response(response) | ||
except yawac.ApiException as e: | ||
log.error("Request failed:\n%s" % e) |