rs_server_catalog/data_management/timestamps_extension.md
Contains all functions for timestamps extension management.
set_timestamps_for_creation(item)
This function set the timestamps for an item creation. It will update the 'updated' and 'published' timestamps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be created. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/timestamps_extension.py
25 26 27 28 29 30 31 32 33 34 35 36 37 | |
set_timestamps_for_insertion(item)
This function set the timestamps for an item insertion. It will update the 'updated' and 'expires' timestamps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be updated. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/timestamps_extension.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
set_timestamps_for_update(item, original_published, original_expires)
This function set the timestamps for an item update. It will update the 'updated' timestamp along with the 'expires' and 'published' ones with the values given.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
dict
|
The item to be updated. |
required |
original_published
|
str
|
Original 'published' timestamp to set. |
required |
original_expires
|
str
|
Original 'expires' timestamp to set. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated item. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/timestamps_extension.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
set_timestamps_to_collection(collection, original_created='')
Sets values for the 'created' and 'updated' fields of a Collection. If there is already a 'created' field, this one is skipped. If there is no 'created' field but an 'original_created' is given, the 'original_created' value is taken, otherwise the value given is the one of the 'updated' field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
dict
|
The collection to update |
required |
original_created
|
str
|
Existing "created" value, if any (optional) |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated collection |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/timestamps_extension.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
set_updated_timestamp_to_now(stac_object, is_item=True)
Updates the 'updated' timestamp of the given object with the current time. If the object is an Item, the 'updated' field is located in the 'properties', otherwise it is at the root of the dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stac_object
|
dict
|
The object to be updated. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The updated object. |
Source code in docs/rs-server/services/catalog/rs_server_catalog/data_management/timestamps_extension.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |