Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/attribute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ sidebarTitle: attribute

Represents an attribute of a Node, including its schema, value, and properties.

An ``Attribute`` wraps a single attribute on an :class:`InfrahubNode`. It tracks the
current value, the metadata properties (``source``, ``owner``, ``is_protected``, ...),
and whether the value has been mutated since the node was loaded. Mutation tracking is
used by ``InfrahubNode.update()`` to send only the changed fields to the API.

**Attributes:**

- `name`: The name of the attribute.
- `id`: The unique identifier of the attribute, when known.
- `value`: The current attribute value. Setting this marks the attribute as mutated.
- `value_has_been_mutated`: True when ``value`` has been assigned after construction.
- `is_default`: True when the value comes from the schema default.
- `is_from_profile`: True when the value is inherited from a profile.
- `is_inherited`: True when the attribute is inherited from a generic.
- `is_protected`: True when the attribute is protected from modification.
- `updated_at`: ISO-8601 timestamp of the most recent update.
- `source`: The node that supplied this attribute value.
- `owner`: The node that owns this attribute.
- `updated_by`: The account that performed the most recent update.

**Methods:**

#### `value`
Expand Down
20 changes: 20 additions & 0 deletions docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ sidebarTitle: metadata

Represents metadata about a node (created_at, created_by, updated_at, updated_by).

Populated from the ``node_metadata`` GraphQL block when ``include_metadata=True``
is passed to a query. The ``*_by`` fields point to the user who created or last
updated the node, exposed as :class:`NodeProperty` references.

**Attributes:**

- `created_at`: ISO-8601 timestamp of node creation.
- `created_by`: The account that created the node.
- `updated_at`: ISO-8601 timestamp of the most recent update.
- `updated_by`: The account that performed the most recent update.

### `RelationshipMetadata`

Represents metadata about a relationship edge (updated_at, updated_by).

Populated from the ``relationship_metadata`` GraphQL block when ``include_metadata=True``
is passed to a query. Unlike :class:`NodeMetadata`, this only carries update info because
the creation timestamp of an edge is not tracked separately from its peer node.

**Attributes:**

- `updated_at`: ISO-8601 timestamp of the most recent edge update.
- `updated_by`: The account that performed the most recent edge update.
Loading