Skip to main content

ONTAP REST envelope/HAL builders for nessie-store — PyO3 bindings.

Project description

nessie-ontap-protocol

ONTAP REST wire shapes — the HAL envelope, the {job,record,num_records} create envelope, the simplified delete job, the always-success poll, and the ONTAP-native {error:{code,message,target}} envelope — for nessie-store. The PyO3 bindings let you assemble ONTAP-faithful response bodies from plain Python dicts.

Install

pip install nessie-ontap-protocol      # Python
cargo add nessie-ontap-protocol        # Rust

Usage (Python)

import nessie_ontap_protocol as proto

# Wrap your own record dict in ONTAP's create envelope.
volume = {"uuid": "…", "name": "build-cache", "state": "online"}
created = proto.create_response("job-1", volume)
#   {"job": {"uuid": "job-1", "_links": {...}}, "record": {...}, "num_records": 1}

# A HAL collection, an error envelope, a delta duration.
coll = proto.hal_collection([volume], "/api/storage/volumes")
err = proto.error_envelope("404", "volume not found", "volume")
assert proto.iso8601_duration(3 * 3600 + 27 * 60 + 45) == "PT3H27M45S"

Usage (Rust)

use nessie_ontap_protocol::{CreateResponse, iso8601_duration};

let resp = CreateResponse::new("job-1", serde_json::json!({ "name": "vol1" }));
assert_eq!(iso8601_duration(45), "PT45S");

Dual-licensed MIT OR Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nessie_ontap_protocol-0.3.0-cp310-abi3-win_amd64.whl (158.1 kB view details)

Uploaded CPython 3.10+Windows x86-64

nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (285.1 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (281.1 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nessie_ontap_protocol-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (510.6 kB view details)

Uploaded CPython 3.10+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file nessie_ontap_protocol-0.3.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0e8c042f5e1e309f69d3195bde5fde46fa59e214225d60b5733fde93c750fb92
MD5 b004c501e72f2cd7176fddf571924ab3
BLAKE2b-256 1621e18373739547796ce64fbb6eacf89ce6c9b7efac89de830ada424534ebd2

See more details on using hashes here.

File details

Details for the file nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47e87ef3d4fd5f03eb0c979d5399c6ad17ff3c9bcb63f0cf478b96eb4d8f0b85
MD5 54f31fae19761175edcf8e10cbfddc3b
BLAKE2b-256 c212adc24e21a0bde77dc4d687ba47c257dc359585789ce7968a1749b051d2a8

See more details on using hashes here.

File details

Details for the file nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 21d5b1922cbf27769c1cd14554bd0191182b7dff67ce6ea6bc024174eb3c93a7
MD5 c766403e79c3698fa50581f77120f407
BLAKE2b-256 fde76cf65bd8f003a3e85f14b6b784f97f5059e53ea3dfcbcff11605c4fab25d

See more details on using hashes here.

File details

Details for the file nessie_ontap_protocol-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.3.0-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 fd375a51757e743e89ea5dd7b63d926a23fc8501b1ef0b5e5d42d0084e5d41e6
MD5 6c2474e3291227ecf598f3a4168ebe9d
BLAKE2b-256 1e474ddd1fd5addad2ba1ee14b2eab988f275ff6e0bf322b924eb4dda30d83de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page