Skip to content

Commit 1733bc0

Browse files
authored
Merge pull request #1010 from opsmill/stable
Merge stable into develop
2 parents cf97718 + c300a41 commit 1733bc0

30 files changed

Lines changed: 1443 additions & 61 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Added SHA-1 idempotency primitives for `CoreFileObject` nodes:
2+
3+
- `InfrahubNode.matches_local_checksum(source)` / sync variant — compare a local `bytes | Path | BinaryIO` source against the node's server-stored checksum without invoking a transfer.
4+
- `InfrahubNode.upload_if_changed(source, name=None)` / sync variant — stage + save only when the local source differs from the server, returning an `UploadResult(was_uploaded, checksum)` dataclass.
5+
- `download_file(..., skip_if_unchanged=True)` — short-circuit the download when `dest` already exists on disk with a matching SHA-1. Returns `0` bytes written when skipped.
6+
7+
A shared `sha1_of_source` helper (streaming, 64 KiB chunks) centralises the hashing convention in `infrahub_sdk.file_handler`.

docs/docs/python-sdk/sdk_ref/infrahub_sdk/client.mdx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ If retry_on_failure is True, the query will retry until the server becomes reach
241241
**Raises:**
242242

243243
- `GraphQLError`: When the GraphQL response contains errors.
244+
- `ServerNotReachableError`: If the server is not reachable after exhausting retries.
245+
- `AuthenticationError`: If the server returns a 401 or 403 response.
246+
- `URLNotFoundError`: If the server returns a 404 response.
247+
- `Error`: If the response is unexpectedly missing.
244248

245249
**Returns:**
246250

@@ -286,6 +290,10 @@ Get complete diff tree with metadata and nodes.
286290

287291
Returns None if no diff exists.
288292

293+
**Raises:**
294+
295+
- `ValueError`: If ``from_time`` is later than ``to_time``.
296+
289297
#### `allocate_next_ip_address`
290298

291299
```python
@@ -324,6 +332,10 @@ Allocate a new IP address by using the provided resource pool.
324332

325333
- Node corresponding to the allocated resource.
326334

335+
**Raises:**
336+
337+
- `ValueError`: If ``resource_pool`` is not a ``CoreIPAddressPool``.
338+
327339
</details>
328340
#### `allocate_next_ip_prefix`
329341

@@ -364,6 +376,10 @@ Allocate a new IP prefix by using the provided resource pool.
364376

365377
- Node corresponding to the allocated resource.
366378

379+
**Raises:**
380+
381+
- `ValueError`: If ``resource_pool`` is not a ``CoreIPPrefixPool``.
382+
367383
</details>
368384
#### `create_batch`
369385

@@ -524,6 +540,10 @@ If retry_on_failure is True, the query will retry until the server becomes reach
524540
**Raises:**
525541

526542
- `GraphQLError`: When the GraphQL response contains errors.
543+
- `ServerNotReachableError`: If the server is not reachable after exhausting retries.
544+
- `AuthenticationError`: If the server returns a 401 or 403 response.
545+
- `URLNotFoundError`: If the server returns a 404 response.
546+
- `Error`: If the response is unexpectedly missing.
527547

528548
**Returns:**
529549

@@ -676,6 +696,10 @@ Get complete diff tree with metadata and nodes.
676696

677697
Returns None if no diff exists.
678698

699+
**Raises:**
700+
701+
- `ValueError`: If ``from_time`` is later than ``to_time``.
702+
679703
#### `allocate_next_ip_address`
680704

681705
```python
@@ -714,6 +738,10 @@ Allocate a new IP address by using the provided resource pool.
714738

715739
- Node corresponding to the allocated resource.
716740

741+
**Raises:**
742+
743+
- `ValueError`: If ``resource_pool`` is not a ``CoreIPAddressPool``.
744+
717745
</details>
718746
#### `allocate_next_ip_prefix`
719747

@@ -754,6 +782,10 @@ Allocate a new IP prefix by using the provided resource pool.
754782

755783
- Node corresponding to the allocated resource.
756784

785+
**Raises:**
786+
787+
- `ValueError`: If ``resource_pool`` is not a ``CoreIPPrefixPool``.
788+
757789
</details>
758790
#### `repository_update_commit`
759791

0 commit comments

Comments
 (0)