rs_server_catalog/data_management/stac_manager.md
Module grouping functions dedicated to the manipulation of STAC data
StacManager
Class grouping functions dedicated to the manipulation of STAC data
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/stac_manager.py
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 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 | |
add_authentication_extension(content)
async
staticmethod
Add the stac authentication extension, see: https://github.com/stac-extensions/authentication
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
dict
|
STAC description of the object to which add the authentication extension |
required |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/stac_manager.py
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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
get_s3_filename_from_asset(asset)
staticmethod
Retrieve the S3 key from the asset content.
During the staging process, the content of the asset should be: "filename": { "href": "s3://temp_catalog/path/to/filename", }
Once the asset is inserted in the catalog, the content typically looks like this: "filename": { "alternate": { "https": { "https://127.0.0.1:8083/catalog/collections/user:collection_name/items/filename/download/file", } }, "href": "s3://rs-dev-cluster-catalog/path/to/filename", }
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset
|
dict
|
The content of the asset. |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, bool]
|
tuple[str, bool]: A tuple containing the full S3 path of the object and a boolean indicating whether the S3 key was retrieved from the 'alternate' field. |
Raises:
| Type | Description |
|---|---|
HTTPException
|
If the S3 key could not be loaded or is invalid. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/stac_manager.py
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 | |
update_links_for_all_collections(collections)
staticmethod
Update the links for the endpoint /catalog/collections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collections
|
list[dict]
|
all the collections to be updated. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
list[dict]: all the collections after the links updated. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/stac_manager.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
update_stac_catalog_metadata(metadata)
staticmethod
Update the metadata fields from a catalog
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata
|
dict
|
The metadata that has to be updated. The fields id, title, description and stac_version are to be updated, by using the env vars which have to be set before starting the app/pod. The existing values are used if the env vars are not found |
required |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/stac_manager.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |