DAS cache client option parser
Definition at line 108 of file das_client.py.
◆ __init__()
def das_client.DASOptionParser.__init__ |
( |
|
self | ) |
|
Definition at line 112 of file das_client.py.
113 usage =
"Usage: %prog [options]\n"
114 usage +=
"For more help please visit https://cmsweb.cern.ch/das/faq"
115 self.parser = OptionParser(usage=usage)
116 self.parser.add_option(
"-v",
"--verbose", action=
"store",
117 type=
"int", default=0, dest=
"verbose",
118 help=
"verbose output")
119 self.parser.add_option(
"--query", action=
"store", type=
"string",
120 default=
False, dest=
"query",
121 help=
"specify query for your request")
122 msg =
"host name of DAS cache server, default is https://cmsweb.cern.ch"
123 self.parser.add_option(
"--host", action=
"store", type=
"string",
124 default=
'https://cmsweb.cern.ch', dest=
"host", help=msg)
125 msg =
"start index for returned result set, aka pagination,"
126 msg +=
" use w/ limit (default is 0)"
127 self.parser.add_option(
"--idx", action=
"store", type=
"int",
128 default=0, dest=
"idx", help=msg)
129 msg =
"number of returned results (default is 10),"
130 msg +=
" use --limit=0 to show all results"
131 self.parser.add_option(
"--limit", action=
"store", type=
"int",
132 default=10, dest=
"limit", help=msg)
133 msg =
'specify return data format (json or plain), default plain.'
134 self.parser.add_option(
"--format", action=
"store", type=
"string",
135 default=
"plain", dest=
"format", help=msg)
136 msg =
'query waiting threshold in sec, default is 5 minutes'
137 self.parser.add_option(
"--threshold", action=
"store", type=
"int",
138 default=300, dest=
"threshold", help=msg)
139 msg =
'specify private key file name, default $X509_USER_PROXY'
140 self.parser.add_option(
"--key", action=
"store", type=
"string",
141 default=
x509(), dest=
"ckey", help=msg)
142 msg =
'specify private certificate file name, default $X509_USER_PROXY'
143 self.parser.add_option(
"--cert", action=
"store", type=
"string",
144 default=
x509(), dest=
"cert", help=msg)
145 msg =
'specify CA path, default $X509_CERT_DIR'
146 self.parser.add_option(
"--capath", action=
"store", type=
"string",
147 default=os.environ.get(
"X509_CERT_DIR",
""),
148 dest=
"capath", help=msg)
149 msg =
'specify number of retries upon busy DAS server message'
150 self.parser.add_option(
"--retry", action=
"store", type=
"string",
151 default=0, dest=
"retry", help=msg)
152 msg =
'show DAS headers in JSON format'
153 msg +=
' (obsolete, keep for backward compatibility)'
154 self.parser.add_option(
"--das-headers", action=
"store_true",
155 default=
False, dest=
"das_headers", help=msg)
156 msg =
'specify power base for size_format, default is 10 (can be 2)'
157 self.parser.add_option(
"--base", action=
"store", type=
"int",
158 default=0, dest=
"base", help=msg)
160 msg =
'a file which contains a cached json dictionary for query -> files mapping'
161 self.parser.add_option(
"--cache", action=
"store", type=
"string",
162 default=
None, dest=
"cache", help=msg)
164 msg =
'a query cache value'
165 self.parser.add_option(
"--query-cache", action=
"store", type=
"int",
166 default=0, dest=
"qcache", help=msg)
167 msg =
'List DAS key/attributes, use "all" or specific DAS key value, e.g. site'
168 self.parser.add_option(
"--list-attributes", action=
"store", type=
"string",
169 default=
"", dest=
"keys_attrs", help=msg)
◆ get_opt()
def das_client.DASOptionParser.get_opt |
( |
|
self | ) |
|
◆ parser
das_client.DASOptionParser.parser |