@cumulus/update-granules-cmr-metadata-file-links
v22.3.3
Published
Update CMR metadata files with correct online access urls and etags and transfer etag info to granules' CMR files
Downloads
899
Keywords
Readme
@cumulus/update-granules-cmr-metadata-file-links
This Cumulus task component updates CMR metadata files to have correct values for producerGranuleId and granuleIdCMR, and update all granule URL
- CMR UMMG Metadata is updated with
producerGranuleIdadded/updated inDataGranule.Identifiersas an array item with the type ofProducerGranuleIdin the CMR metadata file,DataGranule.DayNightFlagandDataGranule.ProductionDateTimewill also be populated if they are not already - CMR UMMG Metadata is updated with
granuleIdset toGranuleURin the CMR metadata file - CMR UMMG Metadata updates
OnlineAccessUrlssuch that the CMR granule metadata has the correct URL based on the incominggranuleobject and Cumulus bucket configuration - CMR XML Metadata is updated with
producerGranuleIdset as the value forGranule.DataGranule.ProducerGranuleId - CMR XML Metadata is updated with
granuleIdset as the value forGranule.GranuleUR - CMR XML Metadata updates the
OnlineResourcessuch that the CMR granule metadata has the correct URL based on the incominggranuleobject and Cumulus bucket configuration
Note As default behavior for this task, for UMMG and ECHO10 granules, a Granule.DataGranule section will be added if not already present within the metadata. For UMMG granules (as of CSD-85), the required fields (as seen here) of ProductionDateTime and DayNightFlag will be populated with default values (the time the task is ran for ProductionDateTime and Unspecified for DayNightFlag) if they are not already included, along with the other updates described above. For ECHO10 granules, the required field for DataGranules, ProducerGranuleId (as seen here), will be populated, along with the other updates described above. To disable adding/updating the granule's metadata in this task for both ECHO10 and UMMG granules, set excludeDataGranule as true (boolean, not a string) (added as part of CSD-85) in the task config schema. If set to true this task will not change anything relating to the Granule.DataGranule in the granule's metadata, no adding or updating.
Note To disable updating the granule metadata's identifiers and granuleUr in this task for both ECHO10 and UMMG, set updateGranuleIdentifiers to false (boolean, not a string) in the task config schema (added as part of CSD-91). By default, this task sets updateGranuleIdentifiers to true for both ECHO10 and UMMG.
Input/Output Schema
Input
{
"granules": [
{
"granuleId": "<granule-id>",
"files": [
{
"bucket": "cumulus-bucket",
"key": "path/to/file.hdf",
"filename": "s3://cumulus-bucket/path/to/file.hdf"
},
{
"bucket": "cumulus-bucket",
"key": "path/to/file.cmr.xml",
"filename": "s3://cumulus-bucket/path/to/file.cmr.xml"
}
]
}
]
}Output
{
"granules": [
{
"granuleId": "<granule-id>",
"files": [
{
"bucket": "cumulus-bucket",
"key": "path/to/file.hdf",
"filename": "s3://cumulus-bucket/path/to/file.hdf"
},
{
"bucket": "cumulus-bucket",
"key": "path/to/file.cmr.xml",
"filename": "s3://cumulus-bucket/path/to/file.cmr.xml"
}
]
}
]
}The task updates the URLs in the CMR metadata files but returns the same granules object structure that was provided as input. The CMR file metadata (e.g. size) is updated to reflect any modifications made, as needed.
About Cumulus
Cumulus is a cloud-based data ingest, archive, distribution and management prototype for NASA's future Earth science data streams.
Contributing
Please refer to: https://github.com/nasa/cumulus/blob/master/CONTRIBUTING.md
