|
1 | 1 | classdef Onc < onc.OncDiscovery & onc.OncDelivery & onc.OncRealTime & onc.OncArchive
|
2 |
| - %% ONC Facilitates access to Ocean Networks Canada's data through the Oceans 2.0 API. |
3 |
| - % For detailed information and usage examples, visit our official documentation |
4 |
| - % at https://wiki.oceannetworks.ca/display/CLmatlab |
| 2 | + %% ONC Facilitates access to Ocean Networks Canada's data through the Oceans 3.0 API. |
| 3 | + % For detailed information and usage examples, run doc command or visit MATLAB's help browser |
| 4 | + % then find Ocean Networks Canada API Client under supplemental software |
5 | 5 | %
|
6 | 6 | % ONC Properties:
|
7 | 7 | % token - User token, can be obtained at: https://data.oceannetworks.ca/Profile
|
|
63 | 63 | end
|
64 | 64 |
|
65 | 65 | methods (Access = public)
|
| 66 | + %% The ONC class |
| 67 | + % The ONC class provides a wrapper for Oceans 3.0 API requests. All the client library’s functionality is provided as methods of this class. |
| 68 | + % Create an ONC object to access this library’s functionalities. |
| 69 | + % Parameters: |
| 70 | + % * token ([char]) - The ONC API token, which could be retrieved at https://data.oceannetworks.ca/Profile once logged in. |
| 71 | + % * production (logical, optional, default = True) - |
| 72 | + % Whether the ONC Production server URL is used for service requests. |
| 73 | + % True: Use the production server. |
| 74 | + % False: Use the internal ONC test server (reserved for ONC staff IP addresses). |
| 75 | + % * showInfo (logical, optional, default = false) - |
| 76 | + % Whether verbose script messages are displayed, such as request url and processing time information. |
| 77 | + % True: Print all information and debug messages (intended for debugging). |
| 78 | + % False: Only print information messages. |
| 79 | + % * outPath ([char], optional, default = 'output') - Output path for downloaded files |
| 80 | + % The directory will be created if it does not exist during the download. |
| 81 | + % * timeout (int, optional, default = 60) - Number of seconds before a request to the API is canceled |
| 82 | + % |
| 83 | + % Returns: The Onc object created. |
| 84 | + % |
| 85 | + % Examples: |
| 86 | + % onc = ONC("YOUR_TOKEN_HERE", 'showInfo', true, 'outPath', 'myOutPath'); |
| 87 | + %% |
66 | 88 | function this = Onc(token, varargin)
|
67 | 89 | %% Class initializer
|
68 | 90 | % All toolkit functionality must be invoked from an Onc object
|
69 | 91 | %
|
70 | 92 | % Onc(token, production=true, showInfo=false, outPath='output', timeout=60)
|
71 |
| - % |
72 |
| - % * token: ([char]) User token |
73 |
| - % - production: (logical) Send requests to the production server (otherwise use internal QA) |
74 |
| - % - showInfo: (logical) Whether verbose debug messages are displayed |
75 |
| - % - outPath: ([char]) Output path for downloaded files |
76 |
| - % - timeout: (int) Number of seconds before a request to the API is canceled |
77 |
| - % |
78 |
| - % Returns: The Onc object created. |
79 |
| - |
80 | 93 | % parse inputs (can be named or positional)
|
81 | 94 | p = inputParser;
|
82 | 95 | addRequired(p, 'token', @ischar);
|
|
128 | 141 | this.tree = temp.tree;
|
129 | 142 | %These codes can then be used for input to onc.getDevices by
|
130 | 143 | %providing the locationCodes
|
131 |
| - |
| 144 | + |
| 145 | + % check if it's running the latest version. If not, throw a warning |
| 146 | + util.checkVersion; |
132 | 147 |
|
133 | 148 | end
|
134 | 149 |
|
|
0 commit comments