rs_client/ogcapi/ogcapi_client.md
Use OGC API services with rs-client-libraries
OgcApiClient
Bases: RsClient
Class to handle OGC API processes in rs-client-libraries
This class provides python methods to call the different endpoints of the OGC API service.
Remark: this class don't inherits from the owslib.ogcapi.processes.Processes class because the latter doesn't provide wrapping for all endpoints defined in our services (it only provides the /processes and /processes/{processId}/execution endpoints + it doesn't allow to manage apikey_header parameter which is passed as an extra argument).
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
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 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 302 303 | |
endpoint_prefix
property
Return the endpoints prefix, if any.
delete_job(job_id)
Method to get a specific job response
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
199 200 201 202 203 204 205 206 | |
get_job_info(job_id)
Method to get a specific job response
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
190 191 192 193 194 195 196 197 | |
get_job_results(job_id)
Wrapper to get the result of a specfific job
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_id
|
str
|
description |
required |
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
208 209 210 211 212 213 214 215 216 217 218 219 | |
get_jobs()
Method to get running jobs
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
181 182 183 184 185 186 187 188 | |
get_openapi()
classmethod
Return the OpenAPI instance of the subclass
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
58 59 60 61 | |
get_process(process_id, **kwargs)
Wrapper to get a specific process Args: process_id (str): name of the resource
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
138 139 140 141 142 143 144 145 146 147 148 149 150 | |
get_processes()
summary
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
dictionary containing the content of the response |
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
125 126 127 128 129 130 131 132 133 134 135 136 | |
validate_and_unmarshal_request(request)
Validate an endpoint request according to the ogc specifications
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
Request
|
endpoint request |
required |
Returns:
| Type | Description |
|---|---|
Any
|
RequestUnmarshalResult.data: data validated by the openapi_core |
Any
|
unmarshal_response method |
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
validate_and_unmarshal_response(response)
Validate an endpoint response according to the ogc specifications (described as yaml schemas)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
Response
|
endpoint response |
required |
Returns: ResponseUnmarshalResult.data: data validated by the openapi_core unmarshal_response method
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
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 | |
wait_for_job(job_status, logger=None, job_name='', poll_interval=2)
Wait for job to finish.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
job_status
|
dict
|
Returned by |
required |
logger
|
To show advancement in logger |
None
|
|
job_name
|
str
|
Job name to show in the logger |
''
|
timeout
|
Job completion timeout in seconds. NOTE: This argument has been disabled, see the comment bellow ! |
required | |
poll_interval
|
int
|
When to check again for job completion in seconds |
2
|
Returns:
| Type | Description |
|---|---|
dict
|
Job status |
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_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 302 303 | |
OgcValidationException
Bases: Exception
Exception raised when an error occurs during the OGC validation of the endpoints
Source code in docs/rs-client-libraries/rs_client/ogcapi/ogcapi_client.py
35 36 37 38 | |