rda-python-metrics 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rda-python-metrics might be problematic. Click here for more details.

Files changed (47) hide show
  1. rda_python_metrics/PgIPInfo.py +188 -0
  2. rda_python_metrics/PgView.py +782 -0
  3. rda_python_metrics/__init__.py +1 -0
  4. rda_python_metrics/fillawsusage.py +282 -0
  5. rda_python_metrics/fillawsusage.usg +17 -0
  6. rda_python_metrics/fillcodusage.py +247 -0
  7. rda_python_metrics/fillcodusage.usg +21 -0
  8. rda_python_metrics/fillcountry.py +79 -0
  9. rda_python_metrics/fillendtime.py +93 -0
  10. rda_python_metrics/fillglobususage.py +287 -0
  11. rda_python_metrics/fillglobususage.usg +17 -0
  12. rda_python_metrics/fillipinfo.py +185 -0
  13. rda_python_metrics/fillipinfo.usg +18 -0
  14. rda_python_metrics/filloneorder.py +155 -0
  15. rda_python_metrics/filloneorder.usg +41 -0
  16. rda_python_metrics/fillrdadb.py +151 -0
  17. rda_python_metrics/fillrdadb.usg +32 -0
  18. rda_python_metrics/filltdsusage.py +289 -0
  19. rda_python_metrics/filltdsusage.usg +17 -0
  20. rda_python_metrics/filluser.py +216 -0
  21. rda_python_metrics/filluser.usg +16 -0
  22. rda_python_metrics/logarch.py +359 -0
  23. rda_python_metrics/logarch.usg +27 -0
  24. rda_python_metrics/pgperson.py +72 -0
  25. rda_python_metrics/pgusername.py +50 -0
  26. rda_python_metrics/viewallusage.py +350 -0
  27. rda_python_metrics/viewallusage.usg +198 -0
  28. rda_python_metrics/viewcheckusage.py +289 -0
  29. rda_python_metrics/viewcheckusage.usg +185 -0
  30. rda_python_metrics/viewcodusage.py +314 -0
  31. rda_python_metrics/viewcodusage.usg +184 -0
  32. rda_python_metrics/viewordusage.py +340 -0
  33. rda_python_metrics/viewordusage.usg +224 -0
  34. rda_python_metrics/viewrqstusage.py +362 -0
  35. rda_python_metrics/viewrqstusage.usg +217 -0
  36. rda_python_metrics/viewtdsusage.py +323 -0
  37. rda_python_metrics/viewtdsusage.usg +191 -0
  38. rda_python_metrics/viewwebfile.py +294 -0
  39. rda_python_metrics/viewwebfile.usg +212 -0
  40. rda_python_metrics/viewwebusage.py +371 -0
  41. rda_python_metrics/viewwebusage.usg +211 -0
  42. rda_python_metrics-1.0.4.dist-info/METADATA +18 -0
  43. rda_python_metrics-1.0.4.dist-info/RECORD +47 -0
  44. rda_python_metrics-1.0.4.dist-info/WHEEL +5 -0
  45. rda_python_metrics-1.0.4.dist-info/entry_points.txt +22 -0
  46. rda_python_metrics-1.0.4.dist-info/licenses/LICENSE +21 -0
  47. rda_python_metrics-1.0.4.dist-info/top_level.txt +1 -0
@@ -0,0 +1,314 @@
1
+ #!/usr/bin/env python3
2
+ #
3
+ ###############################################################################
4
+ #
5
+ # Title : viewcodusage
6
+ # Author : Zaihua Ji, zji@ucar.edu
7
+ # Date : 03/15/2022
8
+ # 2025-03-28 transferred to package rda_python_metrics from
9
+ # https://github.com/NCAR/rda-database.git
10
+ # Purpose : python program to view custom OPeNDAP usage information
11
+ #
12
+ # Github : https://github.com/NCAR/rda-python-metrics.git
13
+ #
14
+ ###############################################################################
15
+ #
16
+ import os
17
+ import re
18
+ import sys
19
+ from rda_python_common import PgLOG
20
+ from rda_python_common import PgUtil
21
+ from rda_python_common import PgDBI
22
+ from . import PgView
23
+
24
+ VUSG = {
25
+ 'SNMS' : "ABCDEGHIJMNOPQRSTUVY", # cod available short field names in FLDS
26
+ 'OPTS' : 'AabcCdDeEghHiLmnoOqStTUwyz', # cod available options, used for params
27
+ 'NOPT' : 'abhwz', # stand alone option without inputs
28
+ 'ACND' : 'cdegiImoqSty', # available array condition options
29
+ 'RCND' : 'DET', # available range condition options
30
+ 'CNDS' : 'acdDeEgiImMnoqStTy', # condition options, ACND, RCND and 'a'
31
+ 'ECND' : 'my', # condition options need evaluating
32
+ 'SFLD' : 'DEGINOTU', # string fields, to be quoted in condition
33
+ 'UFLD' : 'NO', # string fields must be in upper case
34
+ 'LFLD' : 'EMPT' # string fields must be in lower case
35
+ }
36
+
37
+ # keys FLDS - short field names
38
+ # column 0 - column title showing in usage view
39
+ # column 1 - field name in format as shown in select clauses
40
+ # column 2 - field name shown in where condition query string
41
+ # column 3 - table name that the field belongs to
42
+ # column 4 - output field length, the longer one of data size and comlun title, determine
43
+ # dynamiccody if it is 0. Negative values indicate right justification
44
+ # column 5 - precision for floating point value if positive and show total value if not zero
45
+ # column 6 - field flag to indicate it is a group, distinct or sum field
46
+ FLDS = {
47
+ # SHRTNM COLUMNNANE FIELDNAME CNDNAME TBLNAM Size Prc Grp/Sum
48
+ 'D' : ['DATE', "date", 'date', 'codusage', 10, 0, 'G'],
49
+ 'E' : ['EMAIL', "codusage.email", 'codusage.email', 'codusage', 0, 0, 'G'],
50
+ 'G' : ['AGGREID', "aid", 'aid', 'codusage', 0, 0, 'G'],
51
+ 'I' : ['IP', "ip", 'ip', 'codusage', 0, 0, 'G'],
52
+ 'M' : ['MONTH', PgDBI.fmtym("date"), 'date', 'codusage', 7, 0, 'G'],
53
+ 'N' : ['COUNTRY', "country", 'country', 'codusage', 0, 0, 'G'],
54
+ 'O' : ['ORGTYPE', "org_type", 'org_type', 'codusage', 7, 0, 'G'],
55
+ 'P' : ['DSOWNER', "specialist", 'specialist', 'dsowner', 8, 0, 'G'],
56
+ 'Q' : ['QUARTER', "quarter", 'quarter', 'codusage', 7, 0, 'G'],
57
+ 'R' : ['DSTITLE', "search.datasets.title", 'search.datasets.title', 'search.datasets', 0, 0, 'G'],
58
+ 'S' : ['BYTESIZE', "size", 'size', 'codusage', -14, -1, 'G'],
59
+ 'T' : ['DATASET', "codusage.dsid", 'codusage.dsid', 'codusage', 0, 0, 'G'],
60
+ 'V' : ['PERIOD', "perod", 'period', 'codusage', 0, 0, 'G'],
61
+ 'Y' : ['YEAR', PgDBI.fmtyr("date"), 'date', 'codusage', 4, 0, 'G'],
62
+ 'A' : ['DSCOUNT', "codusage.dsid", 'A', 'codusage', -7, -1, 'D'],
63
+ 'B' : ['MBYTEREAD', "round(sum(size)/(1000000), 4)", 'B', 'codusage', -14, 3, 'S'],
64
+ 'C' : ['#AGGRE', "aid", 'G', 'codusage', -8, -1, 'D'],
65
+ 'H' : ['#ACCESS', "sum(count)", 'H', 'codusage', -8, -1, 'S'],
66
+ 'J' : ['#UNIQUSER', "codusage.email", 'C', 'codusage', -9, -1, 'D'],
67
+ 'U' : ['#UNIQIP', "codusage.ip", 'U', 'codusage', -7, -1, 'D'],
68
+ 'X' : ['INDEX', "", 'X', '', -6, 0, ' ']
69
+ }
70
+
71
+ # keys EXPAND - short field names allow zero usage
72
+ # column 0 - expand ID for group of fields
73
+ # column 1 - field name shown in where condition query string
74
+ # column 2 - field name in format as shown in select clauses
75
+ # column 3 - table name that the field belongs to
76
+ EXPAND = {
77
+ # SHRTNM EXPID CNDSTR FIELDNAME TBLNAM
78
+ 'D' : ["TIME", "dDmy"],
79
+ 'M' : ["TIME", "dDmy"],
80
+ 'Q' : ["TIME", "dDmy"],
81
+ 'Y' : ["TIME", "dDmy"],
82
+
83
+ 'E' : ["USER", "eco", "email", "wuser", "user"],
84
+ 'O' : ["USER", "eco", "org_type", "wuser", "user"],
85
+ 'N' : ["USER", "eco", "country", "wuser", "user"],
86
+
87
+ 'R' : ["DSID", "fFsStT", "search.datasets.title", "search.datasets"],
88
+ 'T' : ["DSID", "fFsStT", "dataset.dsid", "dataset"],
89
+ 'P' : ["DSID", "fFsStT", "specialist", "dsowner"]
90
+ }
91
+
92
+ # valid options for params, a hash array of command line parameters
93
+ # a -- 1 to view cod usage info available
94
+ # A -- number or records to return
95
+ # c -- array of specified country codes
96
+ # C -- a string of short field names for viewing usages
97
+ # d -- array of specified dates
98
+ # D -- dates range, array of 1 or 2 dates in format of YYYY-MM-DD
99
+ # e -- array of specified email addresses
100
+ # E -- use given date or date range for email notice of data update
101
+ # g -- array of specified aggregation IDs
102
+ # h -- for give emails, include their histical emails registered before
103
+ # H -- a string of report title to replace the default one
104
+ # i -- array of specified IP addresses
105
+ # I -- use given email IDs for email notice of data update
106
+ # L -- column delimiter for output
107
+ # m -- array of specified months
108
+ # o -- array of specified orginization types
109
+ # O -- a string of short field names for sorting on
110
+ # q -- array of the specified quarters, normcody combined with years
111
+ # S -- array of login names of specialists who owns the datasets
112
+ # t -- array of specified dataset names
113
+ # T -- dataset range, array of 1 or 2 dataset names
114
+ # U -- given unit for file or data sizes
115
+ # w -- generate view without totals
116
+ # y -- array of specified years
117
+ # z -- generate view including entries without usage
118
+
119
+ params = {}
120
+
121
+ # relationship between parameter options and short field names, A option is not
122
+ # related to a field name if it is not in keys SNS
123
+ SNS = {
124
+ 'c' : 'N', 'd' : 'D', 'D' : 'D', 'e' : 'E', 'g' : 'G', 'i' : 'I', 'm' : 'M',
125
+ 'o' : 'O', 'q' : 'Q', 'S' : 'P', 't' : 'T', 'T' : 'T', 'y' : 'Y'
126
+ }
127
+
128
+ tablenames = fieldnames = condition = ''
129
+ sfields = []
130
+ gfields = []
131
+ dfields = []
132
+ pgname = 'viewcodusage'
133
+
134
+ #
135
+ # main function to run this program
136
+ #
137
+ def main():
138
+
139
+ PgDBI.view_dbinfo()
140
+ argv = sys.argv[1:]
141
+ inputs = []
142
+ option = 'C' # default option
143
+
144
+ for arg in argv:
145
+ if re.match(r'^-.*$', arg):
146
+ curopt = arg[1:2]
147
+ if curopt and VUSG['OPTS'].find(curopt) > -1:
148
+ if VUSG['NOPT'].find(option) > -1:
149
+ params[option] = 1
150
+ elif inputs:
151
+ params[option]= inputs # record input array
152
+ inputs = [] # empty input array
153
+ option = curopt # start a new option
154
+ else:
155
+ PgLOG.pglog(arg + ": Unknown Option", PgLOG.LGWNEX)
156
+ else:
157
+ val = arg
158
+ if val != '!':
159
+ if option == 's':
160
+ val = int(val)*1000000 # convert MBytes to Bytes
161
+ elif option in SNS:
162
+ sfld = SNS[option]
163
+ if VUSG['SFLD'].find(sfld) > -1:
164
+ if VUSG['UFLD'].find(sfld) > -1:
165
+ val = arg.upper() # in case not in upper case
166
+ elif VUSG['LFLD'].find(sfld) > -1:
167
+ val = arg.lower() # in case not in lower case
168
+ if option == 'c':
169
+ val = PgView.get_country_name(val)
170
+ elif option == 't' or option == 'T':
171
+ val = PgUtil.format_dataset_id(val) # add 'ds' if only numbers
172
+ val = "'{}'".format(val)
173
+ inputs.append(val)
174
+
175
+ # record the last option
176
+ if VUSG['NOPT'].find(option) > -1:
177
+ params[option] = 1
178
+ elif inputs:
179
+ params[option] = inputs # record input array
180
+
181
+ if not params:
182
+ PgLOG.show_usage(pgname)
183
+ else:
184
+ check_enough_options()
185
+
186
+ if 'o' not in params:
187
+ if 'e' not in params:
188
+ params['o'] = ['!', "'DSS'"] # default to exclude 'DSS' for organization
189
+ elif params['o'][0] == "'ALL'":
190
+ del params['o']
191
+
192
+ usgtable = 'codusage'
193
+ build_query_strings(usgtable) # build tablenames, fieldnames, and condtions
194
+ records = PgDBI.pgmget(tablenames, fieldnames, condition, PgLOG.UCLWEX)
195
+ if not records: PgLOG.pglog("No Usage Found For Given Conditions", PgLOG.LGWNEX)
196
+ totals = None if 'w' in params else {}
197
+ if dfields or totals != None:
198
+ records = PgView.compact_hash_groups(records, gfields, sfields, dfields, totals)
199
+ if 'z' in params: records = expand_records(records)
200
+ ostr = params['O'][0] if 'O' in params else params['C'][0]
201
+ records = PgView.order_records(records, ostr.replace('X', ''))
202
+ PgView.simple_output(params, FLDS, records, totals)
203
+
204
+ PgLOG.pgexit(0)
205
+
206
+ #
207
+ # cehck if enough information entered on command line for generate view/report, exit if not
208
+ #
209
+ def check_enough_options():
210
+
211
+ cols = params['C'][0] if 'C' in params else 'X'
212
+ if cols == 'X': PgLOG.pglog("{}: miss field names '{}'".format(pgname, VUSG['SNMS']), PgLOG.LGWNEX)
213
+
214
+ if cols.find('Q') > -1 and cols.find('Y') < 0: # add Y if Q included
215
+ cols = re.sub('Q', 'YQ', cols)
216
+ params['C'][0] = cols
217
+
218
+ for sn in cols:
219
+ if sn == 'X': continue # do not process INDEX field
220
+ if VUSG['SNMS'].find(sn) < 0:
221
+ PgLOG.pglog("{}: Field {} must be in field names '{}X'".format(pgname, sn, VUSG['SNMS']), PgLOG.LGWNEX)
222
+ if 'z' not in params or sn in EXPAND: continue
223
+ fld = FLDS[sn]
224
+ if fld[6] != 'G': continue
225
+ PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".formt(pgname, sn, fld[0]), PgLOG.LGWNEX)
226
+
227
+ if 'E' in params or 'I' in params:
228
+ if 'z' in params:
229
+ PgLOG.pglog(pgname + ": option -z and -E/-I can not be present at the same time", PgLOG.LGWNEX)
230
+ elif 't' not in params or len(params['t']) > 1:
231
+ PgLOG.pglog(pgname + ": specify one dataset for viewing usage of notified users", PgLOG.LGWNEX)
232
+ elif 'E' in params and 'I' in params:
233
+ PgLOG.pglog(pgname + ": option -E and -I can not be present at the same time", PgLOG.LGWNEX)
234
+
235
+ for opt in params:
236
+ if VUSG['CNDS'].find(opt) > -1: return
237
+ PgLOG.pglog("{}: miss condition options '{}'".format(pgname, VUSG['CNDS']), PgLOG.LGWNEX)
238
+
239
+ #
240
+ # process parameter options to build cod query strings
241
+ # global variables are used directly and nothing passes in and returns back
242
+ #
243
+ def build_query_strings(usgtable):
244
+
245
+ # initialize query strings
246
+ global condition, fieldnames, tablenames, gfields, sfields
247
+ joins = having = groupnames = ''
248
+ tablenames = usgtable
249
+ cols = params['C'][0]
250
+
251
+ if 'U' in params: # reset units for file and read sizes
252
+ if cols.find('B') > -1: FLDS['B'] = PgView.set_data_unit(FLDS['B'], params['U'][0], "sum(size)")
253
+ if cols.find('S') > -1: FLDS['S'] = PgView.set_data_unit(FLDS['S'], params['U'][0], "size")
254
+
255
+ if 'e' in params and 'h' in params: params['e'] = PgView.include_historic_emails(params['e'], 3)
256
+
257
+ for opt in params:
258
+ if opt == 'C': # build field, table and group names
259
+ for sn in cols:
260
+ if sn == 'X': continue # do not process INDEX field
261
+ fld = FLDS[sn]
262
+ if fieldnames: fieldnames += ', '
263
+ fieldnames += "{} {}".format(fld[1], sn) # add to field name string
264
+ (tablenames, joins) = PgView.join_query_tables(fld[3], tablenames, joins, usgtable)
265
+ if fld[6] == 'S':
266
+ sfields.append(sn)
267
+ else:
268
+ if groupnames: groupnames += ', '
269
+ groupnames += sn # add to group name string
270
+ if fld[6] == 'D':
271
+ dfields.append(sn)
272
+ else:
273
+ gfields.append(sn)
274
+ elif opt == 'O':
275
+ continue # order records later
276
+ elif VUSG['CNDS'].find(opt) > -1:
277
+ if VUSG['NOPT'].find(opt) > -1: continue
278
+ sn = SNS[opt]
279
+ fld = FLDS[sn]
280
+ # build where conditon strings
281
+ cnd = PgView.get_view_condition(opt, sn, fld, params, VUSG)
282
+ if cnd:
283
+ if condition: condition += ' AND '
284
+ condition += cnd
285
+ (tablenames, joins) = PgView.join_query_tables(fld[3], tablenames, joins, usgtable)
286
+
287
+ # append joins, group by, order by, and having strings to condition string
288
+ if 'E' in params or 'I' in params:
289
+ (tablenames, joins) = PgView.join_query_tables("emreceive", tablenames, joins, usgtable)
290
+ if joins:
291
+ if condition:
292
+ condition = "{} AND {}".format(joins, condition)
293
+ else:
294
+ condition = joins
295
+ if 'E' in params or 'I' in params:
296
+ condition += PgView.notice_condition(params['E'], params['I'], params['t'][0])
297
+ if groupnames and sfields: condition += " GROUP BY " + groupnames
298
+
299
+ def expand_records(records):
300
+
301
+ recs = PgView.expand_query("TIME", records, params, EXPAND)
302
+
303
+ trecs = PgView.expand_query("USER", records, params, EXPAND, VUSG, SNS, FLDS)
304
+ if trecs: PgUtil.crosshash(recs, trecs)
305
+
306
+ trecs = PgView.expand_query("DSID", records, params, EXPAND, VUSG, SNS, FLDS)
307
+ if trecs: recs = PgUtil.crosshash(recs, trecs)
308
+
309
+ return PgUtil.joinhash(records, recs, 0, 1)
310
+
311
+ #
312
+ # call main() to start program
313
+ #
314
+ if __name__ == "__main__": main()
@@ -0,0 +1,184 @@
1
+
2
+ View usage information of custom OPeNDAP aggregation Data Services from
3
+ information stored in MySQL database 'RDADB'.
4
+
5
+ Usage: viewcodusage [-C] ColumnNames [-O OrderColumnNames] [-a] \
6
+ [-A RowLimit] [-c CountryCodes] [-d DateList] \
7
+ [-D StartDate [EndDate]] [-e EMailList] -h \
8
+ [-E StartNoticeDate [EndNoticeDate]] \
9
+ [-g AggregationIDs] [-i IPAddresses] \
10
+ [-I EmailIDList] [-m MonthList] \
11
+ [-N MinNumberRead [MaxNumberRead]] \
12
+ [-o OrganizationTypes] [-q QuaterList] \
13
+ [-S SpecialistLoginNames] [-t DatasetList] \
14
+ [-T MinDataset [MaxDataset]] [-y YearList] \
15
+ [-H Title] [-L Delimiter] [-U SizeUnit] \
16
+ [-w] [-z] [> OutputFileName] [| lp -d PrinterName]
17
+
18
+ Specify [-C] ColumnNames, refer to Option -C section for detail
19
+ description, and choose at least one of the condition options, -a, -c,
20
+ -d, -D, -e, -E, -g, -i, -I, -m, -N, -o, -q, -S -t, -T, and -y, to
21
+ run this application.
22
+
23
+ For all condition options, except option -a, an '!' sign can be added
24
+ between an option flag and its option values to get an excluding
25
+ condition. For example, choose '-o ! OrganizationTypes' to gather order
26
+ data usage by users from organization types other than the ones given in
27
+ OrganizationTypes. Refer to the example given at the end of this help
28
+ document for how to select excluding condition.
29
+
30
+ String condition options, -c, -e, -g, -i, -o, -S, and -t, allow wildcard
31
+ inputs. '%' matches any number of characters and '_' matches any one
32
+ character. Refer to the example given at the end of this help document
33
+ for how to use wildcard for string condition options.
34
+
35
+ Output of this application is defaulted to page format with a page
36
+ header on each page. A page header includes main title, sub titles and
37
+ column titles according to which column names and options are selected,
38
+ as well as page number and report date. If the output is used directly
39
+ for input of other applications, add option -w to remove page header
40
+ and show only the column titles and the usage information.
41
+
42
+
43
+ Column Options:
44
+ - Option -C, the ColumnNames must be present to run this application.
45
+ The flag -C can be omitted if it is the first parameter option on
46
+ the command line. The ColumnNames is a string that includes column
47
+ names listed below:
48
+
49
+ COLUMN - COLUMN - COLUMN
50
+ NAME - TITLE - DESCRIPTION
51
+ GroupColumns:
52
+ D*- DATE - format as YYYY-MM-DD, for example 2004-04-25
53
+ E*- EMAIL - user email address
54
+ G*- AGGREID - Aggrenation IDs
55
+ I*- IP - user IP address
56
+ M*- MONTH - format as YYYY-MM, for example 2004-04
57
+ N*- COUNTRY - country codes users from
58
+ O*- ORGTYPE - organization types (DSS, NCAR, UNIV and OTHER)
59
+ P*- DSOWNER - login names of specialists who own the datasets
60
+ Q*- QUARTER - quarter of year, 1, 2, 3, or 4
61
+ R*- DSTITLE - dataset titles
62
+ S - BSIZE - size of data read each time, default to Bytes
63
+ T*- DATASET - format as dsnnn.n, for example d540001
64
+ Y*- YEAR - format as YYYY, for example 2004
65
+
66
+ * - field names can processed with zero usages
67
+ SummaryColumns:
68
+ A - DSCOUNT - number of datasets in given GroupColumns
69
+ B - MBREAD - data sizes, default MB, read by given GroupColumns
70
+ C - #AGGRRE - number of unique aggregation IDs in given GroupColumns
71
+ H - #ACCESS - number of accesses by given GroupColumns
72
+ J - #UNIQUSER - number of unique users in in given GroupColumns
73
+ U - #UNIQIP - number of unique users in in given GroupColumns
74
+
75
+ IndexColumn:
76
+ X - INDEX - index of line, it should be the first column
77
+
78
+ The column names are used to build up string of ColumnNames, while
79
+ their associated column titles are shown in view/report output of
80
+ this application. The display order of the column titles is
81
+ determined by the order of the column names in the ColumnNames
82
+ string. At least one of the group and summary columns must be
83
+ selected, in the ColumnNames string, to generate all usage
84
+ view/report;
85
+
86
+ For example, choose '-C EMB' to display column titles of EMAIL,
87
+ MONTH and MBREAD, in the first, second and third columns
88
+ respectively, for numbers of MBytes of data read by each user
89
+ in each month;
90
+
91
+ - Option -O, sort data usage information in ascending or descending
92
+ order based on the column names specified in OrderColumnNames
93
+ string. These column names must be in the selected [-C]
94
+ ColumnNames string. If an column name is in upper case, its
95
+ associated column is sorted in ascending order, and a lower
96
+ case means sorting in descending order;
97
+
98
+
99
+ Condition Options:
100
+ - Option -a, for all usage in table 'codusage';
101
+
102
+ - Option -A, gives a row limit for querrying;
103
+
104
+ - Option -c, for files read by users from given country codes;
105
+
106
+ - Option -d, for data read on given dates, in format YYYY-MM-DD;
107
+
108
+ - Option -D, for data read between two given dates, each date
109
+ is in format YYYY-MM-DD. Omit EndDate for no upper limit;
110
+
111
+ - Option -e, for data read by users with given email addresses;
112
+
113
+ - Option -E, for data read by users who have been notified
114
+ data update of a specified dataset between two given dates,
115
+ each date is in format YYYY-MM-DD. Omit EndNoticeDate for
116
+ no upper limit;
117
+
118
+ - Option -g, for data read from specified Aggrenation IDs;
119
+
120
+ - Option -h, works with Option -e to include historical user emails
121
+ registered before;
122
+
123
+ - Option -i, for data read from machines with given IP addresses;
124
+
125
+ - Option -m, for data read in given months, in format YYYY-MM;
126
+
127
+ - Option -N, for files for numbers of read by each group between
128
+ MinNumberRead and MaxNumberRead. Omit MaxNumberRead for no
129
+ upper limit;
130
+
131
+ - Option -o, for data read by users from given orgnization types.
132
+ It defaults to -o ! DSS to exclude usage from DSS specialists;
133
+ Set it to ALL to include all orgnization types;
134
+
135
+ - Option -q, for data read in given quarters;
136
+
137
+ - Option -S, for login names of specialsts who own the datasets;
138
+
139
+ - Option -t, for data associating to given dataset names;
140
+
141
+ - Option -T, for data associating to datasets between
142
+ MinDataset and MaxDataset. Omit MaxDataset for no upper limit.
143
+ For example, -T d540000 d550009, for datasets numbers d540000-d550009;
144
+
145
+ - Option -y, for data read in given years in format YYYY;
146
+
147
+
148
+ Miscellaneous Options:
149
+ - Option -w, view data usage in simple format without totals;
150
+
151
+ - Option -z, include datasets without without usage
152
+
153
+ - Option -H, use given report title to replace the default one;
154
+
155
+ - Option -L, use given delimiter for output, instead of defaulted spaces;
156
+
157
+ - Option -U, show data sizes in given unit SizeUnit [BKMG].
158
+ B - Byte, K - KiloBytes, M - MegaByte, and G - GigaByte;
159
+
160
+ - Option > OutputFilename, redirect output into an output file,
161
+ for example, ordusage.out, instead of viewing on screen directly;
162
+
163
+ - Option | lp -d PrinterName, redirect output to printer of PrinterName.
164
+ Replace PrinterName with lj100 to print through DSS LaserJet printer.
165
+
166
+
167
+ For example:
168
+ To view annual data usage in year 2005 with columns, INDEX(X),
169
+ EMAIL(E), ORGTYPE(O), #AGGRE(C), and MBREAD(B); ordered by ORGTYPE as
170
+ ascending and MBREAD(B) as descending; the command line should be:
171
+
172
+ viewcodusage XEOCB -y 2005 -O Ob
173
+
174
+ For usage by users not in Organization 'DDS', out of the file usage
175
+ gathered above, the command line should be:
176
+
177
+ viewcodusage XEOCB -y 2005 -o ! DSS -O Ob
178
+
179
+ To redirect the previous output to a file named codusage.out:
180
+
181
+ viewcodusage XEOCB -y 2005 ! DSS -O Ob > codusage.out
182
+
183
+ Then you can view the file or print it as a report.
184
+