infrahub_sdk.checks
Classes
InfrahubCheckInitializer
Information about the originator of the check.
InfrahubCheck
Methods:
client
client(self) -> InfrahubClient
client
client(self, value: InfrahubClient) -> None
init
init(cls, client: InfrahubClient | None = None, *args: Any, **kwargs: Any) -> InfrahubCheck
Async init method, If an existing InfrahubClient client hasn't been provided, one will be created automatically.
errors
errors(self) -> list[dict[str, Any]]
log_error
log_error(self, message: str, object_id: str | None = None, object_type: str | None = None) -> None
log_info
log_info(self, message: str, object_id: str | None = None, object_type: str | None = None) -> None
log_entries
log_entries(self) -> str
branch_name
branch_name(self) -> str
Return the name of the current git branch.
validate
validate(self, data: dict) -> None
Code to validate the status of this check.
collect_data
collect_data(self) -> dict
Query the result of the GraphQL Query defined in self.query and return the result
run
run(self, data: dict | None = None) -> bool
Execute the check after collecting the data from the GraphQL query. The result of the check is determined based on the presence or not of ERROR log messages.