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.2.1-cp310-abi3-win_amd64.whl (158.0 kB view details)

Uploaded CPython 3.10+Windows x86-64

nessie_ontap_protocol-0.2.1-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.2.1-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.2.1-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.2.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.2.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 811a0982fff6d12d18598d39565760c996505a10e00fa1857e02663333180604
MD5 c0dc990738931edd6d9ed3417bafc8db
BLAKE2b-256 3c7cda6edeedcbf6a5a1ce03c113a6746625a9dc64e5c3bb0a330b0fead9db9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7681489660b25dbb65ae63d729a17522fd16f7dadb027cef4ef9a2b9af5de29
MD5 6f586165dd622b4234a3da70868f9fc9
BLAKE2b-256 18c970e37c52eb6a1fadb7c02d5288489d20631ab4b465b381d667f798dc3263

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nessie_ontap_protocol-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ea1e5d8683b2cb1657c739924f31d7f55aca0d0b56a10afc6f33e3cd7c579eeb
MD5 5c65ac648018d2a5fba6813cfc688509
BLAKE2b-256 5ab07fa656f954fc7c93b67f09d9978f76714feebf57ee4edec084b0dfa406d2

See more details on using hashes here.

File details

Details for the file nessie_ontap_protocol-0.2.1-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.2.1-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 71c78653f898012829966f59d7f8573caeaa8066ea2d39fb0f03aa9ad4e457aa
MD5 116733f13783f1999cb22beb3b0876f0
BLAKE2b-256 d70ce6d6bcd5073ce594ae540e27498a6da5592df8c6c189a5c244d6e0f1c7d2

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