You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Samples/DotNetSdk/ObservationReportExporter/Readme.md
+32
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,28 @@ The intent is to run this tool on a schedule so that the uploaded location attac
12
12
- Results can be filtered by optional date range, location, location group, property, or analytical group.
13
13
- All filters are cumulative (ie. they are AND-ed together). The more filters you add, the fewer results will be exported.
14
14
- An exit code of 0 indicates the export was successful. An exit code greater than 0 indicates an error. This allows for easy error checking when invoked from scripts.
15
+
- A log file named `ObservationReportExporter.log` will be created in the same folder as the EXE.
15
16
16
17
## Requirements
17
18
18
19
- The .NET 4.7 runtime is required, which is pre-installed on all Windows 10 and Windows Server 2016 systems, and on nearly all up-to-date Windows 7 and Windows Server 2008 systems.
19
20
- No installer is needed. It is just a single .EXE which can be run from any folder.
20
21
22
+
## Basic workflow
23
+
24
+
Each run of the tool will:
25
+
- Validate all the provided options and stop right away if any errors are detected.
26
+
- Determine the AQUARIUS Samples locations from which observations will be exported. This is either the list of `-LocationId=` options locations or locations belonging to the `-LocationGroupId=` options.
27
+
- For each exported location:
28
+
- Find the matching AQUARIUS Time Series location.
29
+
- If the Time Series location is not found:
30
+
- Log a warning and move on to the next export.
31
+
- Otherwise:
32
+
- Determine the exported attachment filename (see [controlling the attachment filename](#controlling-the-aqts-attachment-filename) for details).
33
+
- Delete any existing location attachments with the same filename.
34
+
- Export all the filtered observations from the AQUARIUS Samples location using the named template.
35
+
- Upload the exported spreadsheet of location-specific observations to the AQUARIUS Time-Series location.
36
+
21
37
### Command line option syntax
22
38
23
39
All command line options are case-insensitive, and support both common shell syntaxes: either `/Name=value` (for CMD.EXE) or `-Name=value` (for bash and PowerShell).
@@ -26,6 +42,22 @@ In addition, the [`@options.txt` syntax](https://github.com/AquaticInformatics/e
26
42
27
43
Try the `/help` option for a detailed list of options and their default values.
28
44
45
+
## Running the tool on a periodic schedule
46
+
47
+
The `ObservationReportExporter.exe` too can be run from Windows Task Scheduler, or other scheduling software.
48
+
49
+
Typical configuration involves:
50
+
- Storing all required command-line options in a single text file, in the same folder as the EXE.
51
+
- Specifying the executable as full path to the `ObservationReportExporter.exe` tool.
52
+
- Setting the working directory to the folder containing the EXE.
53
+
- Setting the arguments to the `@Options.txt` file containing all the required options.
54
+
55
+
No special Windows account is required to run the tool. All the required credentials are supplied as command-line options, so it is fine to run the tool using a built-in Windows account like LocalSystem (NT_AUTHORITY/SYSTEM).
56
+
57
+
The tool can be scheduled to run at whatever frequency you would like. The tool will quickly exit if it detects an identical export request already in progress. This allows for simple scheduling for normal loads.
58
+
59
+
If a complete export cycle normally takes 2 hours, but can sometimes take 4 hours to complete, you can still safely schedule the tool to run every 3 hours, and tool will detect when a previous cycle hasn't completed and won't go crazy.
60
+
29
61
## Authentication with AQUARIUS Samples
30
62
31
63
Two options are required to tell the tool how to access your AQUARIUS Samples instance.
0 commit comments