Skip to main content

infrahub_sdk.schema.main

Classes​

RelationshipCardinality ​

BranchSupportType ​

RelationshipKind ​

RelationshipDirection ​

AttributeKind ​

SchemaState ​

AllowOverrideType ​

RelationshipDeleteBehavior ​

AttributeSchema ​

AttributeSchemaAPI ​

RelationshipSchema ​

RelationshipSchemaAPI ​

BaseSchemaAttrRel ​

BaseSchemaAttrRelAPI ​

Methods:

get_field ​

get_field(self, name: str, raise_on_error: bool = True) -> AttributeSchemaAPI | RelationshipSchemaAPI | None

get_attribute ​

get_attribute(self, name: str) -> AttributeSchemaAPI

get_attribute_or_none ​

get_attribute_or_none(self, name: str) -> AttributeSchemaAPI | None

get_relationship ​

get_relationship(self, name: str) -> RelationshipSchemaAPI

get_relationship_or_none ​

get_relationship_or_none(self, name: str) -> RelationshipSchemaAPI | None

get_relationship_by_identifier ​

get_relationship_by_identifier(self, id: str, raise_on_error: bool = True) -> RelationshipSchemaAPI | None

get_matching_relationship ​

get_matching_relationship(self, id: str, direction: RelationshipDirection = RelationshipDirection.BIDIR) -> RelationshipSchemaAPI

attribute_names ​

attribute_names(self) -> list[str]

relationship_names ​

relationship_names(self) -> list[str]

mandatory_input_names ​

mandatory_input_names(self) -> list[str]

mandatory_attribute_names ​

mandatory_attribute_names(self) -> list[str]

mandatory_relationship_names ​

mandatory_relationship_names(self) -> list[str]

local_attributes ​

local_attributes(self) -> list[AttributeSchemaAPI]

local_relationships ​

local_relationships(self) -> list[RelationshipSchemaAPI]

unique_attributes ​

unique_attributes(self) -> list[AttributeSchemaAPI]

BaseSchema ​

Methods:

kind ​

kind(self) -> str

GenericSchema ​

Methods:

convert_api ​

convert_api(self) -> GenericSchemaAPI

GenericSchemaAPI ​

A Generic can be either an Interface or a Union depending if there are some Attributes or Relationships defined.

BaseNodeSchema ​

NodeSchema ​

Methods:

convert_api ​

convert_api(self) -> NodeSchemaAPI

NodeSchemaAPI ​

ProfileSchemaAPI ​

TemplateSchemaAPI ​

NodeExtensionSchema ​

SchemaRoot ​

Methods:

to_schema_dict ​

to_schema_dict(self) -> dict[str, Any]

SchemaRootAPI ​

BranchSchema ​

Methods:

from_api_response ​

from_api_response(cls, data: MutableMapping[str, Any]) -> Self

Convert an API response from /api/schema into a BranchSchema object.

from_schema_root_api ​

from_schema_root_api(cls, data: SchemaRootAPI) -> Self

Convert a SchemaRootAPI object to a BranchSchema object.