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