-
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.
[Ops] Add command to get OpenAPI definition from the server.
- Loading branch information
Showing
2 changed files
with
21 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,17 @@ | ||
import click | ||
from yawac.apis.paths.docs_openapi import DocsOpenapi | ||
from yawac.paths.simple_greetings.get import GetGreetings | ||
|
||
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 OpenAPI definition.", cls=BaseCommand) | ||
@click.pass_context | ||
def openapi(ctx, endpoint, profile, verify_ssl, ca_file, debug): | ||
with build_client(**ctx.obj.get("CLIENT_CONFIG")) as api_client: | ||
response = DocsOpenapi(api_client).get() | ||
print_response(response) |