SDK Snippets
Verification RequiredThese examples are illustrative. They demonstrate client-call shape, not validated SDK package coverage.
Guide
Illustrative Python boto3 and AWS SDK for JavaScript v3 workflows for common ObjectDB S3 Core operations, with explicit route evidence and unsupported behavior boundaries.
Current availability
Private Beta. Public beta is scheduled for .
These examples are illustrative. They demonstrate client-call shape, not validated SDK package coverage.
The bucket, object, listing, tags, metadata, and unsupported behavior references map back to ObjectDB route docs and product tests.
| Language | Client | Status | Auth note | Source |
|---|---|---|---|---|
| Python | boto3 | illustrative | Uses unsigned path-style local requests to mirror the local quickstart surface. | docs/examples/objectdb/s3-sdk-examples/snippets/python-boto3-s3-core.py |
| TypeScript | AWS SDK for JavaScript v3 | illustrative | Uses placeholder SigV4 credentials that must map to accepted local ObjectDB credential configuration before execution. | docs/examples/objectdb/s3-sdk-examples/snippets/typescript-aws-sdk-v3-s3-core.ts |
The snippets show client-call shape. They are not the first-success path and should not be treated as tested SDK compatibility until reviewer-run evidence exists.
Bucket lifecycle, object CRUD, list, tags, metadata, and unsupported behavior stay tied to the ObjectDB S3 Core route tests and references.
Credential setup remains environment-specific. Keep real access keys out of docs source, examples, output, screenshots, and support evidence.
ObjectDB S3 Core SDK snippets
Switch between illustrative Python and TypeScript client-call shapes. Copy only local placeholder snippets into a reviewed environment.
Python
docs/examples/objectdb/s3-sdk-examples/snippets/python-boto3-s3-core.py
Path-style unsigned local requests mirroring the ObjectDB quickstart surface.
from __future__ import annotations
import boto3
from botocore import UNSIGNED
from botocore.config import Config
from botocore.exceptions import ClientError
endpoint = "http://127.0.0.1:18080"
bucket = "docs-058-sdk"
key = "raw/photo.txt"
body = b"objectdb-sdk-body"
s3 = boto3.client(
"s3",
endpoint_url=endpoint,
region_name="us-east-1",
config=Config(signature_version=UNSIGNED, s3={"addressing_style": "path"}),
)
s3.create_bucket(Bucket=bucket)
s3.put_object(
Bucket=bucket,
Key=key,
Body=body,
ContentType="text/plain",
Metadata={"source": "docs-058", "workflow": "sdk-example"},
Tagging="kind=raw&stage=example",
)
payload = s3.get_object(Bucket=bucket, Key=key)["Body"].read()
assert payload == body
listed = s3.list_objects_v2(Bucket=bucket, Prefix="raw/")
assert key in [entry["Key"] for entry in listed.get("Contents", [])]
tags = s3.get_object_tagging(Bucket=bucket, Key=key)["TagSet"]
assert {"Key": "stage", "Value": "example"} in tags
try:
s3.get_bucket_versioning(Bucket=bucket)
except ClientError as error:
assert error.response["Error"]["Code"] == "NotImplemented"
else:
raise AssertionError("ObjectDB s3-core-v1 should not report versioning support")
s3.delete_object(Bucket=bucket, Key=key)
s3.delete_bucket(Bucket=bucket)Text
Expected Output
Safe reviewer-visible outcomes from the source example bundle.
ObjectDB S3 Core SDK example summary
Expected reviewer-visible outcomes:
- CreateBucket accepts bucket docs-058-sdk.
- PutObject stores raw/photo.txt with Content-Type text/plain.
- GetObject returns objectdb-sdk-body.
- ListObjectsV2 with Prefix raw/ includes raw/photo.txt.
- GetObjectTagging returns stage=example.
- GetBucketVersioning returns an S3-shaped NotImplemented error.
- DeleteObject and DeleteBucket clean up the example resources.
Status:
- Snippets are illustrative until product SME and docs QA accept exact SDK package versions, auth setup, command transcript, and output.
- Equivalent route behavior is covered by ObjectDB S3 Core route docs and product tests.| Behavior | SDK call | Evidence | Status |
|---|---|---|---|
| Create a bucket | CreateBucket | ODB-EVID-006, ODB-EVID-007, S3CoreApiTests | Route behavior source-backed |
| Put an object | PutObject | ODB-EVID-006, ODB-EVID-007, S3CoreApiTests | Route behavior source-backed |
| Get an object | GetObject | ODB-EVID-006, ODB-EVID-007, S3CoreApiTests | Route behavior source-backed |
| List by prefix | ListObjectsV2 | ODB-EVID-006, ODB-EVID-009, S3CoreApiTests | Route behavior source-backed |
| Write metadata and tags | PutObject Metadata and Tagging | ODB-EVID-009, S3MetadataCopyWorkflowTests | Route behavior source-backed |
| Read object tags | GetObjectTagging | ODB-EVID-009, S3MetadataCopyWorkflowTests | Route behavior source-backed |
| Handle unsupported versioning | GetBucketVersioning | ODB-EVID-002, ODB-EVID-006, ODB-EVID-009, DOCS-042 | Unsupported behavior source-backed |
Versioning is included as the negative example because ObjectDB documents advanced S3 families as outside the active s3-core-v1 profile. SDK callers should treat NotImplemented as an explicit boundary and return to the compatibility matrix before adding more S3 operations.
| Area | Evidence | Reviewer status |
|---|---|---|
| Example source layout | DOCS-057 and docs/examples/README.md | pending |
| Rendered guide route | DOCS-058 and /products/objectdb/guides/s3-sdk-examples/ | pending |
| Route-equivalent product behavior | S3CoreApiTests.cs, S3MetadataCopyWorkflowTests.cs, and ObjectDB S3 Core docs | pending |
| SDK package and auth setup | Reviewer-run transcript; DOCS-063 covers manifest validation | needed before status promotion |
Available: DOCS-022
Run the local quickstartUse the curl workflow for a copy/paste local first success before adapting SDK calls.
Available: DOCS-038
Check S3 Core compatibilityConfirm every SDK call maps to a supported, partial, unsupported, preview, future, or verification-required row.
Available: DOCS-029
Read S3 and HTTP referenceUse route shapes, error behavior, and local adapter constraints when converting examples into runnable code.
Available: DOCS-063
Add example validationUse the manifest gate before changing these examples or promoting them beyond illustrative status.