rs_client/ogcapi/dpr_client.md
Use "DPR as a service" implemented by rs-dpr-service
ClusterInfo
dataclass
Information to connect to a DPR Dask cluster.
Attributes:
| Name | Type | Description |
|---|---|---|
jupyter_token |
str
|
JupyterHub API token. Only used in cluster mode, not local mode. |
cluster_label |
str
|
Dask cluster label e.g. "dask-l0" |
cluster_instance |
str | None
|
Dask cluster instance ID (something like "dask-gateway.17e196069443463495547eb97f532834"). |
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
DprClient
Bases: OgcApiClient
Implement the OGC API client for 'DPR as a service'.
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
endpoint_prefix
property
Return the endpoints prefix, if any.
href_service
property
Return the rs-dpr-service URL hostname. This URL can be overwritten using the RSPY_HOST_DPR_SERVICE env variable (used e.g. for local mode). Otherwise it should just be the RS-Server URL.
get_jobs()
Get all registered jobs with logging.
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
205 206 207 208 209 | |
get_process(process_id, cluster_info, **kwargs)
Call parent method with additional HTTP Get parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process_id
|
str
|
name of the resource |
required |
cluster_info
|
ClusterInfo
|
Information to connect to a DPR Dask cluster |
required |
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
get_processes()
Get all defined processes with logging.
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
199 200 201 202 203 | |
run_conv_safe_zarr(payload, cluster_info)
Method to start the safe to zarr conversion process from rs-client - Call the endpoint /processes/conv_safe_zarr/execution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
dict
|
Dictionary to pass to the processor, |
required |
cluster_info
|
ClusterInfo
|
Information to connect to a DPR Dask cluster |
required |
Return: job_id (int, str): Returns the status code of the request + the identifier (or None if endpoint fails) of the running job
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
run_process(process, cluster_info, s3_config_dir, payload_subpath, s3_report_dir, extra_data=None)
Method to start the process from rs-client - Call the endpoint /processes/{process}/execution
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
process
|
DprProcessor
|
DPR process |
required |
cluster_info
|
ClusterInfo
|
Information to connect to a DPR Dask cluster |
required |
s3_config_dir
|
str
|
S3 bucket folder that contains the payload and configuration files to pass to the processor |
required |
payload_subpath
|
str
|
Payload file path, relative to the config folder |
required |
s3_report_dir
|
str | None
|
S3 bucket folder were the processor report files will be written (optional). All the eopf |
required |
extra_data
|
dict | None
|
Extra data to pass to the processor. |
None
|
Return
job_id (int, str): Returns the status code of the request + the identifier (or None if endpoint fails) of the running job
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
update_configuration(local_path, s3_path, is_payload=False, **kwargs)
async
Update local configuration file depending on the environment, upload it to the s3 bucket, and initialize output bucket folders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
local_path
|
str | Path
|
Local configuration file path |
required |
s3_path
|
str | Path
|
S3 bucket path where to upload to modified updated configuration file |
required |
is_payload
|
bool
|
Specific behavior for the processor payload files |
False
|
kwargs
|
Specific environment variables to expand in the configuration file |
{}
|
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
wait_for_job(*args, **kwargs)
Wait for job to finish.
Returns:
| Type | Description |
|---|---|
list[dict]
|
EOPF results |
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
184 185 186 187 188 189 190 191 192 193 | |
DprProcessor
Bases: str, Enum
DPR processor name
Source code in docs/rs-client-libraries/rs_client/ogcapi/dpr_client.py
43 44 45 46 47 48 49 50 | |