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
13 14 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 |
|
base_url: Union[AnyUrl, Link]
class-attribute
¶
description: Optional[str]
class-attribute
¶
homepage: Optional[Union[AnyUrl, Link]] = StrictField(None, description='JSON API links object, pointing to a homepage URL for this implementation.')
class-attribute
¶
link_type: Optional[LinkType] = StrictField(None, title='Link Type', description="The type of the linked relation.\nMUST be one of these values: 'child', 'root', 'external', 'providers'.")
class-attribute
¶
ensure_database_link_type(value)
¶
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
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|