ORE Studio 0.0.4
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
storage_paths Struct Reference

URL path helpers for the generic object storage HTTP API. More...

#include <storage_paths.hpp>

Collaboration diagram for storage_paths:
Collaboration graph

Static Public Member Functions

static std::string make_object_path (std::string_view bucket, std::string_view key)
 Constructs the URL path for a storage object.
 
static std::string make_object_url (std::string_view base_url, std::string_view bucket, std::string_view key)
 Constructs a full URL for a storage object.
 

Static Public Attributes

static constexpr std::string_view prefix = "/api/v1/storage"
 API path prefix for all storage endpoints.
 

Detailed Description

URL path helpers for the generic object storage HTTP API.

The storage API follows a bucket/key model identical in shape to S3:

PUT /api/v1/storage/{bucket}/{key} upload (create or replace) GET /api/v1/storage/{bucket}/{key} download DELETE /api/v1/storage/{bucket}/{key} delete HEAD /api/v1/storage/{bucket}/{key} existence check / content-length

Use make_object_path to construct the path component, then prepend the HTTP base URL discovered via NATS (http-server.v1.info.get).

Member Function Documentation

◆ make_object_path()

static std::string make_object_path ( std::string_view  bucket,
std::string_view  key 
)
static

Constructs the URL path for a storage object.

Parameters
bucketBucket name (use buckets constants).
keyObject key; may contain slashes for hierarchical keys.
Returns
Path string, e.g. "/api/v1/storage/compute-packages/abc123".
Here is the caller graph for this function:

◆ make_object_url()

static std::string make_object_url ( std::string_view  base_url,
std::string_view  bucket,
std::string_view  key 
)
static

Constructs a full URL for a storage object.

Parameters
base_urlHTTP server base URL (e.g. "http://localhost:51000").
bucketBucket name (use buckets constants).
keyObject key.
Returns
Full URL string.
Here is the caller graph for this function: