databases¶
Pydantic models/schemas for the LinksResource used in /databases
DatabaseCreate
¶
Bases: EntryResourceCreate
, LinksResourceAttributes
Model for creating new LinksResources representing /databases
resources in the
MongoDB.
Required fields:
name
base_url
Original required fields for a
LinksResourceAttributes
model:
name
description
link_type
Source code in optimade_gateway/models/databases.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 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 |
|
base_url: Annotated[JsonLinkType, StrictField(description=LinksResourceAttributes.model_fields['base_url'].description)]
instance-attribute
¶
description: Annotated[str | None, StrictField(description=LinksResourceAttributes.model_fields['description'].description)] = None
class-attribute
instance-attribute
¶
homepage: Annotated[JsonLinkType | None, StrictField(description=LinksResourceAttributes.model_fields['homepage'].description)] = None
class-attribute
instance-attribute
¶
link_type: Annotated[LinkType | None, StrictField(title=LinksResourceAttributes.model_fields['link_type'].title, description=LinksResourceAttributes.model_fields['link_type'].description)] = None
class-attribute
instance-attribute
¶
ensure_database_link_type(value)
classmethod
¶
Ensure databases are not index meta-database-only types
I.e., ensure they're not of type "root"
or "providers"
.
Note
Both "external"
and "child"
can still represent index meta-dbs,
but "root"
and "providers"
can not represent "regular" dbs.
Source code in optimade_gateway/models/databases.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|