MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / init_args

Method init_args

web/pgacloud/providers/aws.py:45–118  ·  view source on GitHub ↗

Create the command line parser for this provider

(self, parsers)

Source from the content-addressed store, hash-verified

43 self._database_pass = os.environ['AWS_DATABASE_PASSWORD']
44
45 def init_args(self, parsers):
46 """ Create the command line parser for this provider """
47 self.parser = parsers.add_parser('aws',
48 help='Amazon RDS PostgreSQL',
49 epilog='Credentials are read from '
50 '~/.aws/config by default and '
51 'can be overridden in the '
52 'AWS_ACCESS_KEY_ID and '
53 'AWS_SECRET_ACCESS_KEY '
54 'environment variables. '
55 'The default region is read '
56 'from ~/.aws/config and will '
57 'fall back to us-east-1 if '
58 'not present.')
59 self.parser.add_argument('--region', default=self._default_region,
60 help='name of the AWS region (default: {})'
61 .format(self._default_region))
62
63 # Create the command sub-parser
64 parsers = self.parser.add_subparsers(help='RDS commands',
65 dest='command')
66
67 # Create the create instance command parser
68 parser_create_instance = parsers.add_parser('create-instance',
69 help='create a new '
70 'instance')
71 parser_create_instance.add_argument('--name', required=True,
72 help='name of the instance')
73 parser_create_instance.add_argument('--db-name', default='postgres',
74 help='name of the default '
75 'database '
76 '(default: postgres)')
77 parser_create_instance.add_argument('--db-password', required=False,
78 help='password for the database')
79 parser_create_instance.add_argument('--db-username',
80 default='postgres',
81 help='user name for the database '
82 '(default: postgres)')
83 parser_create_instance.add_argument('--db-port', type=int,
84 default=5432,
85 help='port of the database '
86 '(default: 5432)')
87 parser_create_instance.add_argument('--db-version',
88 default='13.3',
89 help='version of PostgreSQL '
90 'to deploy (default: 13.3)')
91 parser_create_instance.add_argument('--instance-type', required=True,
92 help='machine type for the '
93 'instance nodes, e.g. '
94 'db.m3.large')
95 parser_create_instance.add_argument('--storage-iops', type=int,
96 default=0,
97 help='storage IOPs to allocate '
98 '(default: 0)')
99 parser_create_instance.add_argument('--storage-size', type=int,
100 required=True,
101 help='storage size in GB')
102 parser_create_instance.add_argument('--storage-type', default='gp2',

Callers 1

get_argsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected