Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Gets API key, project ID, and service account JSON from environment […
Browse files Browse the repository at this point in the history
  • Loading branch information
gguuss authored and Jon Wayne Parrott committed Aug 9, 2017
1 parent 367ebbd commit 1f703f1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions samples/api-client/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import argparse
import io
import os
import sys
import time

Expand Down Expand Up @@ -344,16 +345,21 @@ def parse_command_line_args():
formatter_class=argparse.RawDescriptionHelpFormatter)

# Required arguments
parser.add_argument(
'--project_id', required=True, help='GCP cloud project name.')
parser.add_argument(
'--pubsub_topic',
required=True,
help=('Google Cloud Pub/Sub topic. '
'Format is projects/project_id/topics/topic-id'))
parser.add_argument('--api_key', required=True, help='Your API key.')

# Optional arguments
parser.add_argument(
'--api_key',
default=os.environ.get("API_KEY"),
help='Your API key.')
parser.add_argument(
'--project_id',
default=os.environ.get("GOOGLE_CLOUD_PROJECT"),
help='GCP cloud project name.')
parser.add_argument(
'--ec_public_key_file',
default=None,
Expand All @@ -366,7 +372,7 @@ def parse_command_line_args():
'--cloud_region', default='us-central1', help='GCP cloud region')
parser.add_argument(
'--service_account_json',
default='service_account.json',
default=os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"),
help='Path to service account json file.')
parser.add_argument(
'--registry_id',
Expand Down

0 comments on commit 1f703f1

Please sign in to comment.