Skip to content

Commit

Permalink
Add output-json parameter to publish command for use by downstream pr…
Browse files Browse the repository at this point in the history
…ocesses.
  • Loading branch information
dbernstein committed Oct 20, 2023
1 parent 07eecb7 commit 7f70e6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import logging

import boto3
Expand Down Expand Up @@ -121,11 +122,13 @@ def import_template(
help="The namespace you wish to target (e.g. tpp-prod, tpp-dev, tpp-staging).",
)
@click.option("--group-name", required=True, help="Name of the Quicksight User Group")
@click.option("--output-json", required=True, help="The file path to which operation output should be written as json")
def publish_dashboard(
aws_account_id: str,
template_id: str,
target_namespace: str,
group_name: str,
output_json: str,
):
"""
Create/Update a dashboard from a template
Expand All @@ -144,5 +147,9 @@ def publish_dashboard(
).execute()
log.info(result)

with open(output_json, "w") as output:
output.write(json.dumps(result))
logging.info(f"Output written to {output_json}")


cli.add_command(publish_dashboard)

0 comments on commit 7f70e6a

Please sign in to comment.