SDK Snippets
Confirm FirstThese 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 limits and compatibility guidance 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. | 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. | 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 manual validation 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 details.
These are complete illustrative files for comparing client-call structure, including imports, initialization, assertions, and success-path cleanup. They are not installation or credential setup instructions. Python uses boto3 and botocore; TypeScript uses @aws-sdk/client-s3. Exact package versions and live SDK compatibility have not been established.
Both examples address the loopback endpoint http://127.0.0.1:18080 and synthetic bucket docs-058-sdk, object raw/photo.txt, body, metadata, and tags. Python sends unsigned requests. TypeScript signs with placeholder access and secret key strings; those strings do not grant access or establish a supported authentication path.
Executing either file would create and delete a bucket and object. The cleanup calls run only after preceding assertions succeed; a failure can leave resources behind. Do not use these fixed names in a shared environment or treat these files as a verified cleanup procedure. Use the local quickstart for the documented first-success workflow.
Python
Python boto3 illustrative source
python-boto3-s3-core.py
Complete illustrative file. Uses unsigned path-style local requests and includes main, assertions, and success-path cleanup. It is not a validated SDK integration or authentication procedure.
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"}),
)
def main() -> None:
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",
)
get_result = s3.get_object(Bucket=bucket, Key=key)
payload = get_result["Body"].read()
assert payload == body
listed = s3.list_objects_v2(Bucket=bucket, Prefix="raw/")
keys = [entry["Key"] for entry in listed.get("Contents", [])]
assert key in keys
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)
if __name__ == "__main__":
main()
TypeScript
TypeScript SDK v3 illustrative source
typescript-aws-sdk-v3-s3-core.ts
Complete illustrative file. Uses placeholder signing credentials with AWS SDK for JavaScript v3. The strings are placeholders, not issued credentials; package versions and endpoint signing compatibility are unverified.
import {
CreateBucketCommand,
DeleteBucketCommand,
DeleteObjectCommand,
GetBucketVersioningCommand,
GetObjectCommand,
GetObjectTaggingCommand,
ListObjectsV2Command,
PutObjectCommand,
S3Client,
S3ServiceException,
} from "@aws-sdk/client-s3";
const endpoint = "http://127.0.0.1:18080";
const bucket = "docs-058-sdk";
const key = "raw/photo.txt";
const body = "objectdb-sdk-body";
const s3 = new S3Client({
endpoint,
region: "us-east-1",
forcePathStyle: true,
credentials: {
accessKeyId: "OBJECTDB_LOCAL_ACCESS_KEY",
secretAccessKey: "OBJECTDB_LOCAL_SECRET_KEY",
},
});
async function main(): Promise<void> {
await s3.send(new CreateBucketCommand({ Bucket: bucket }));
await s3.send(
new PutObjectCommand({
Bucket: bucket,
Key: key,
Body: body,
ContentType: "text/plain",
Metadata: {
source: "docs-058",
workflow: "sdk-example",
},
Tagging: "kind=raw&stage=example",
})
);
const getResult = await s3.send(
new GetObjectCommand({ Bucket: bucket, Key: key })
);
const payload = await getResult.Body?.transformToString();
if (payload !== body) {
throw new Error("ObjectDB returned an unexpected object body");
}
const listed = await s3.send(
new ListObjectsV2Command({ Bucket: bucket, Prefix: "raw/" })
);
const keys = (listed.Contents ?? []).map((object) => object.Key);
if (!keys.includes(key)) {
throw new Error("ObjectDB did not list the uploaded object");
}
const tagResult = await s3.send(
new GetObjectTaggingCommand({ Bucket: bucket, Key: key })
);
const hasExampleTag = (tagResult.TagSet ?? []).some(
(tag) => tag.Key === "stage" && tag.Value === "example"
);
if (!hasExampleTag) {
throw new Error("ObjectDB did not return the expected object tag");
}
try {
await s3.send(new GetBucketVersioningCommand({ Bucket: bucket }));
throw new Error("ObjectDB s3-core-v1 should not report versioning support");
} catch (error) {
if (
!(error instanceof S3ServiceException) ||
error.name !== "NotImplemented"
) {
throw error;
}
}
await s3.send(new DeleteObjectCommand({ Bucket: bucket, Key: key }));
await s3.send(new DeleteBucketCommand({ Bucket: bucket }));
}
void main();
Text
Expected Output
Safe team-visible outcomes from the source example bundle.
ObjectDB S3 Core SDK example summary
Illustrative expected outcomes (not an execution transcript):
- 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. Exact SDK versions, authentication setup, and live SDK behavior are unverified.
- Equivalent route behavior is covered by ObjectDB S3 Core route docs and product tests.| Behavior | SDK call | Source scope | Status |
|---|---|---|---|
| Create a bucket | CreateBucket | documented source scope, S3CoreApiTests | Route behavior source-backed |
| Put an object | PutObject | documented source scope, S3CoreApiTests | Route behavior source-backed |
| Get an object | GetObject | documented source scope, S3CoreApiTests | Route behavior source-backed |
| List by prefix | ListObjectsV2 | documented source scope, S3CoreApiTests | Route behavior source-backed |
| Write metadata and tags | PutObject Metadata and Tagging | documented source scope, S3MetadataCopyWorkflowTests | Route behavior source-backed |
| Read object tags | GetObjectTagging | documented source scope, S3MetadataCopyWorkflowTests | Route behavior source-backed |
| Handle unsupported versioning | GetBucketVersioning | documented source scope | 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 | Source scope | Validation status |
|---|---|---|
| Example source layout | documented source scope and docs/examples/README.md | Source-scoped |
| Rendered guide route | documented source scope and /products/objectdb/guides/s3-sdk-examples/ | Source-scoped |
| Route-equivalent product behavior | S3CoreApiTests.cs, S3MetadataCopyWorkflowTests.cs, and ObjectDB S3 Core docs | Source-scoped |
| SDK package and auth setup | Manual transcript; documented source scope covers manifest validation | needed before status promotion |
Available
Run the local quickstartUse the curl workflow for a copy/paste local first success before adapting SDK calls.
Available
Check S3 Core compatibilityConfirm every SDK call maps to a supported, partial, unsupported, preview, future, or verification-required row.
Available
Read S3 and HTTP referenceUse route shapes, error behavior, and local adapter constraints when converting examples into runnable code.
Available
Review guide patternsUse the manifest check before changing these examples or promoting them beyond illustrative status.