Skip to main content

infrahub_sdk.store

Functions

get_schema_name

get_schema_name(schema: type[SchemaType | SchemaTypeSync] | str | None = None) -> str | None

Classes

NodeStoreBranch

Methods:

count

count(self) -> int

set

set(self, node: InfrahubNode | InfrahubNodeSync | CoreNode | CoreNodeSync, key: str | None = None) -> None

get

get(self, key: str | list[str], kind: type[SchemaType | SchemaTypeSync] | str | None = None, raise_when_missing: bool = True) -> InfrahubNode | InfrahubNodeSync | CoreNode | CoreNodeSync | None

NodeStoreBase

Internal Store for InfrahubNode objects.

Often while creating a lot of new objects, we need to save them in order to reuse them later to associate them with another node for example.

Methods:

count

count(self, branch: str | None = None) -> int

NodeStore

Methods:

get

get(self, key: str | list[str], kind: type[SchemaType], raise_when_missing: Literal[True] = True, branch: str | None = ...) -> SchemaType

get

get(self, key: str | list[str], kind: type[SchemaType], raise_when_missing: Literal[False] = False, branch: str | None = ...) -> SchemaType | None

get

get(self, key: str | list[str], kind: type[SchemaType], raise_when_missing: bool = ..., branch: str | None = ...) -> SchemaType

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: Literal[True] = True, branch: str | None = ...) -> InfrahubNode

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: Literal[False] = False, branch: str | None = ...) -> InfrahubNode | None

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: bool = ..., branch: str | None = ...) -> InfrahubNode

get

get(self, key: str | list[str], kind: str | type[SchemaType] | None = None, raise_when_missing: bool = True, branch: str | None = None) -> InfrahubNode | SchemaType | None

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: Literal[True] = True, branch: str | None = ...) -> InfrahubNode

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: Literal[False] = False, branch: str | None = ...) -> InfrahubNode | None

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: bool = True, branch: str | None = None) -> InfrahubNode | None

set

set(self, node: InfrahubNode | SchemaType, key: str | None = None, branch: str | None = None) -> None

NodeStoreSync

Methods:

get

get(self, key: str | list[str], kind: type[SchemaTypeSync], raise_when_missing: Literal[True] = True, branch: str | None = ...) -> SchemaTypeSync

get

get(self, key: str | list[str], kind: type[SchemaTypeSync], raise_when_missing: Literal[False] = False, branch: str | None = ...) -> SchemaTypeSync | None

get

get(self, key: str | list[str], kind: type[SchemaTypeSync], raise_when_missing: bool = ..., branch: str | None = ...) -> SchemaTypeSync

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: Literal[True] = True, branch: str | None = ...) -> InfrahubNodeSync

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: Literal[False] = False, branch: str | None = ...) -> InfrahubNodeSync | None

get

get(self, key: str | list[str], kind: str | None = ..., raise_when_missing: bool = ..., branch: str | None = ...) -> InfrahubNodeSync

get

get(self, key: str | list[str], kind: str | type[SchemaTypeSync] | None = None, raise_when_missing: bool = True, branch: str | None = None) -> InfrahubNodeSync | SchemaTypeSync | None

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: Literal[True] = True, branch: str | None = ...) -> InfrahubNodeSync

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: Literal[False] = False, branch: str | None = ...) -> InfrahubNodeSync | None

get_by_hfid

get_by_hfid(self, key: str | list[str], raise_when_missing: bool = True, branch: str | None = None) -> InfrahubNodeSync | None

set

set(self, node: InfrahubNodeSync | SchemaTypeSync, key: str | None = None, branch: str | None = None) -> None