Datasource API
Source code in upriver/sdk/datasource/datasource_api.py
22 23 | |
create_datasource
create_datasource(
name,
owners,
data_connection_configuration,
*,
id=None,
contract_generation_configuration=None,
incident_configuration=None,
pivot_fields=(),
tags=None,
pause_on_creation=False,
is_key_asset=False
)
Creates a new datasource with the given parameters. See the NewDatasource class for more detailed information on the parameters.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the datasource.
TYPE:
|
owners
|
The list of the names of the owners of the datasource.
TYPE:
|
data_connection_configuration
|
The configuration connecting to pull data for this datasource. These configurations cannot be changed once the datasource is created. |
id
|
(optional) The id of the datasource. This id will not be used by upriver internally, and is meant to be used by the client to identify the datasource.
TYPE:
|
contract_generation_configuration
|
(optional) Configurations that alter the behaviour of Upriver when generating the contract for this datasource.
TYPE:
|
incident_configuration
|
(optional) Configurations that alter the behaviour of Upriver when raising incidents for the datasource.
TYPE:
|
pivot_fields
|
(optional) The fields that will be used to pivot the datasource and generate derived datasources. The order of the fields matter - the datasources will be nested by the order of the fields here. This pivot fields cannot be changed once the datasource is created.
TYPE:
|
tags
|
(optional) A list of tags to associate with the datasource.
TYPE:
|
pause_on_creation
|
If true, the datasource will be paused after creation.
TYPE:
|
is_key_asset
|
If true, the datasource will be considered a key asset.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NewDatasourceResponse
|
The id of the created datasource. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
get_root_datasources
get_root_datasources()
Gets all root datasources.
| RETURNS | DESCRIPTION |
|---|---|
List[Datasource]
|
A list of all root datasources. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
83 84 85 86 87 88 89 90 | |
get_datasource
get_datasource(upriver_id)
Gets the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to get.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Datasource
|
The datasource with the given id. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
92 93 94 95 96 97 98 99 100 | |
get_datasource_schema
get_datasource_schema(upriver_id)
Gets the schema of the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to get the schema of.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
SchemaResponse
|
The schema of the datasource with the given id. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
102 103 104 105 106 107 108 109 110 | |
get_all_datasources
get_all_datasources()
Gets all datasources.
| RETURNS | DESCRIPTION |
|---|---|
List[Datasource]
|
A list of all datasources. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
112 113 114 115 116 117 118 119 | |
get_datasource_settings
get_datasource_settings(upriver_id)
Gets the settings of the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to get.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasourceSettings
|
The settings of the datasource with the given id. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
121 122 123 124 125 126 127 128 129 | |
update_datasource_settings
update_datasource_settings(
upriver_id, datasource_settings, sync_children=False
)
Updates the settings of the datasource with the given id. None values in the settings will be updated to None in the datasource if allowed.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to update.
TYPE:
|
datasource_settings
|
The new settings of the datasource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
The updated settings of the datasource. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
patch_datasource_settings
patch_datasource_settings(
upriver_id, datasource_settings, sync_children=False
)
Patches the settings of the datasource with the given id. Ignores None values in the settings.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to patch.
TYPE:
|
datasource_settings
|
The settings to patch the datasource with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Response
|
The updated settings of the datasource. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
run_datasource
run_datasource(upriver_id)
Runs the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to run.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RunResponse
|
The id of the run. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
163 164 165 166 167 168 169 170 171 | |
get_datasource_status
get_datasource_status(upriver_id)
Gets a detailed status of the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DatasourceStatus
|
The status of the run. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
173 174 175 176 177 178 179 180 181 | |
get_datasource_run_status
get_datasource_run_status(upriver_id, run_id)
Gets the status of the run of the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource.
TYPE:
|
run_id
|
The id of the run.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RunStatusResponse
|
The status of the run. |
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
183 184 185 186 187 188 189 190 191 192 | |
set_user_defined_schema
set_user_defined_schema(
upriver_id, user_defined_schema_file_path, sync
)
Sets a user defined schema for the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource.
TYPE:
|
user_defined_schema_file_path
|
Path to a user defined schema file if exists.
TYPE:
|
sync
|
If true, the schema will also be applied to descendants datasources.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | |
delete_user_defined_schema
delete_user_defined_schema(upriver_id)
Delete the user defined schema for the datasource with the given id. Will also delete all user expectations.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource.
TYPE:
|
sync
|
If true, the schema will also be applied to descendants datasources.
|
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
212 213 214 215 216 217 218 219 | |
set_datasource_metadata_expectations
set_datasource_metadata_expectations(
upriver_id, metadata_expectations, sync_children=False
)
Sets the metadata expectations for the datasource with the given id.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to update.
TYPE:
|
metadata_expectations
|
The metadata expectations to set over the datasource. |
sync_children
|
If true, the metadata expectations will also be applied to descendants datasources.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
force_running_state_datasource
force_running_state_datasource(upriver_id)
Fast forward provided datasource to running state. This action is only available for datasources that are in the learning state. Note: This action will shorten the baseline learning time and may affect the accuracy of the monitoring.
| PARAMETER | DESCRIPTION |
|---|---|
upriver_id
|
The id of the datasource to force running state.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
requests.HTTPError
|
If the request fails. |
Source code in upriver/sdk/datasource/datasource_api.py
236 237 238 239 240 241 242 243 244 245 | |