Skip to main content

infrahub_sdk.query_groups

Classes

InfrahubGroupContextBase

Base class for InfrahubGroupContext and InfrahubGroupContextSync

Methods:

set_properties

set_properties(self, identifier: str, params: dict[str, str] | None = None, delete_unused_nodes: bool = False, group_type: str | None = None, group_params: dict[str, Any] | None = None, branch: str | None = None) -> None

Setter method to set the values of identifier and params.

Args:

  • identifier: The new value for the identifier.
  • params: A dictionary with new values for the params.

InfrahubGroupContext

Represents a Infrahub GroupContext in an asynchronous context.

Methods:

get_group

get_group(self, store_peers: bool = False) -> InfrahubNode | None

delete_unused

delete_unused(self) -> None
add_related_nodes(self, ids: list[str], update_group_context: bool | None = None) -> None

Add related Nodes IDs to the context.

Args:

  • ids: List of node IDs to be added.
  • update_group_context: Flag to control whether to update the group context.
add_related_groups(self, ids: list[str], update_group_context: bool | None = None) -> None

Add related Groups IDs to the context.

Args:

  • ids: List of group IDs to be added.
  • update_group_context: Flag to control whether to update the group context.

update_group

update_group(self) -> None

Create or update (using upsert) a CoreStandardGroup to store all the Nodes and Groups used during an execution.

InfrahubGroupContextSync

Represents a Infrahub GroupContext in an synchronous context.

Methods:

get_group

get_group(self, store_peers: bool = False) -> InfrahubNodeSync | None

delete_unused

delete_unused(self) -> None
add_related_nodes(self, ids: list[str], update_group_context: bool | None = None) -> None

Add related Nodes IDs to the context.

Args:

  • ids: List of node IDs to be added.
  • update_group_context: Flag to control whether to update the group context.
add_related_groups(self, ids: list[str], update_group_context: bool | None = None) -> None

Add related Groups IDs to the context.

Args:

  • ids: List of group IDs to be added.
  • update_group_context: Flag to control whether to update the group context.

update_group

update_group(self) -> None

Create or update (using upsert) a CoreStandardGroup to store all the Nodes and Groups used during an execution.