This repository was archived by the owner on Oct 29, 2023. It is now read-only.
File tree 1 file changed +10
-4
lines changed
samples/api-client/manager 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 33
33
34
34
import argparse
35
35
import io
36
+ import os
36
37
import sys
37
38
import time
38
39
@@ -344,16 +345,21 @@ def parse_command_line_args():
344
345
formatter_class = argparse .RawDescriptionHelpFormatter )
345
346
346
347
# Required arguments
347
- parser .add_argument (
348
- '--project_id' , required = True , help = 'GCP cloud project name.' )
349
348
parser .add_argument (
350
349
'--pubsub_topic' ,
351
350
required = True ,
352
351
help = ('Google Cloud Pub/Sub topic. '
353
352
'Format is projects/project_id/topics/topic-id' ))
354
- parser .add_argument ('--api_key' , required = True , help = 'Your API key.' )
355
353
356
354
# Optional arguments
355
+ parser .add_argument (
356
+ '--api_key' ,
357
+ default = os .environ .get ("API_KEY" ),
358
+ help = 'Your API key.' )
359
+ parser .add_argument (
360
+ '--project_id' ,
361
+ default = os .environ .get ("GOOGLE_CLOUD_PROJECT" ),
362
+ help = 'GCP cloud project name.' )
357
363
parser .add_argument (
358
364
'--ec_public_key_file' ,
359
365
default = None ,
@@ -366,7 +372,7 @@ def parse_command_line_args():
366
372
'--cloud_region' , default = 'us-central1' , help = 'GCP cloud region' )
367
373
parser .add_argument (
368
374
'--service_account_json' ,
369
- default = 'service_account.json' ,
375
+ default = os . environ . get ( "GOOGLE_APPLICATION_CREDENTIALS" ) ,
370
376
help = 'Path to service account json file.' )
371
377
parser .add_argument (
372
378
'--registry_id' ,
You can’t perform that action at this time.
0 commit comments