daemon.models.id module
class daemon.models.id.DaemonID(value: Union[str, daemon.models.enums.IDLiterals], \args, **kwargs*)[source]
Bases: str
Custom datatype defining an ID in Daemon
Validate str and create DaemonID object
Parameters
value – input value
args – args
kwargs – keyword args
Returns
DaemonID object
pattern = ‘^(jdeployment|jpod|jflow|jnetwork|jworkspace)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$’
property jtype: str
Get IDLiterals from DaemonID
Return type
str
Returns
get jtype
property jid
Get uuid from DaemonID
Returns
get uuid
property type
Get jina object type from DaemonID
Returns
get type
property tag
Get tag (: separated type & id) from DaemonID
Returns
get tag
classmethod validate(value)[source]
Validate DaemonID
Parameters
value (
str
) – str to be validatedReturn type
str
Returns
str of type DaemonID
classmethod pydantic_validate(value)[source]
Validate method for pydantic
Parameters
value (
str
) – str to be validatedReturns
str of type DaemonID
daemon.models.id.daemonize(identity, kind=’workspace’)[source]
Convert to DaemonID
Parameters
identity (
str
) – uuid or DaemonIDkind (
str
) – defaults to ‘workspace’
Return type
Returns
DaemonID from identity