-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Archiving) Rework to accomodate metadata (#2799) (patch)
### Added - Metadata in the archival requests towards DDN/Miria. ### Changed - The archival flow sends one request per file.
- Loading branch information
Showing
8 changed files
with
103 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from cg.meta.archive.ddn.constants import MetadataFields | ||
from cg.store.models import Sample | ||
|
||
|
||
def get_metadata(sample: Sample) -> list[dict]: | ||
"""Returns metadata generated from a sample.""" | ||
metadata: list[dict] = [ | ||
{ | ||
MetadataFields.NAME.value: MetadataFields.CUSTOMER_NAME.value, | ||
MetadataFields.VALUE.value: sample.customer.name, | ||
}, | ||
{ | ||
MetadataFields.NAME.value: MetadataFields.PREP_CATEGORY.value, | ||
MetadataFields.VALUE.value: sample.prep_category, | ||
}, | ||
{ | ||
MetadataFields.NAME.value: MetadataFields.SAMPLE_NAME.value, | ||
MetadataFields.VALUE.value: sample.name, | ||
}, | ||
{ | ||
MetadataFields.NAME.value: MetadataFields.SEQUENCED_AT.value, | ||
MetadataFields.VALUE.value: sample.last_sequenced_at, | ||
}, | ||
{ | ||
MetadataFields.NAME.value: MetadataFields.TICKET_NUMBER.value, | ||
MetadataFields.VALUE.value: sample.original_ticket, | ||
}, | ||
] | ||
return metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters