Selection Input API
Overview
The Selection Input API provides JSON key/value storage with search capabilities. It supports two API versions (v1 and v2) with different operation models.
Base URL
https://<manager-host>/api/v1/selection_input
https://<manager-host>/api/v2/selection_input
Version Comparison
| Feature | v1 /api/v1/selection_input | v2 /api/v2/selection_input |
|---|---|---|
| Primary operation | Merge/UPSERT (POST) | Insert/Replace (PUT) |
| List append | N/A | POST to push to list |
| Search syntax | Wildcard prefix (foo* implicit) | Full wildcard (foo* explicit) |
| Query params | search, sort, limit, ttl | search, ttl, correlation_id |
| Sort support | Yes (asc/desc) | No |
| Limit support | Yes | No |
| Use case | Simple key-value with optional search | List-like operations, full wildcard |
When to Use Each Version
| Scenario | Recommended Version |
|---|---|
| Simple key-value storage | v1 |
| List/queue operations (append to array) | v2 POST |
| Full wildcard pattern matching | v2 |
| Need to sort or paginate results | v1 |
v1 Endpoints
GET /api/v1/selection_input/{path}
Fetch stored JSON. If value is an object, optional search/limit/sort applies to its keys.
Query Parameters:
search- Wildcard prefix search (adds*implicitly)sort- Sort order (ascordesc)limit- Maximum results (must be > 0)
Success Response (200):
{
"foo": 1,
"foobar": 2
}
Errors:
404- Path does not exist400- Invalid search/sort/limit parameters500- Backend failure
Example:
curl -s "https://cdn-manager/api/v1/selection_input/config?search=foo&limit=2"
POST /api/v1/selection_input/{path}
Upsert (merge) JSON at path. Nested objects are merged recursively.
Query Parameters:
ttl- Expiry time as humantime string (e.g.,10m,1h)
Request:
{
"feature_flag": true,
"ratio": 0.5
}
Success: 201 Created echoing the payload
Errors:
500/503- Backend failure
Example:
curl -s -X POST "https://cdn-manager/api/v1/selection_input/config?ttl=10m" \
-H "Content-Type: application/json" \
-d '{
"feature_flag": true,
"ratio": 0.5
}'
DELETE /api/v1/selection_input/{path}
Delete stored value.
Success: 204 No Content
Errors: 503 - Backend failure
v2 Endpoints
GET /api/v2/selection_input/{path}
Fetch stored JSON with optional wildcard filtering.
Query Parameters:
search- Full wildcard pattern (e.g.,foo*,*bar*)correlation_id- Accepted but currently ignored (logging only)
Success Response (200):
{
"foo": 1,
"foobar": 2
}
Errors:
400- Invalid search pattern404- Path does not exist500- Backend failure
Example:
curl -s "https://cdn-manager/api/v2/selection_input/config?search=foo*"
PUT /api/v2/selection_input/{path}
Insert/replace value. Old value is discarded.
Query Parameters:
ttl- Expiry time as humantime string
Request:
{
"items": ["a", "b", "c"]
}
Success: 200 OK
Example:
curl -s -X PUT "https://cdn-manager/api/v2/selection_input/catalog" \
-H "Content-Type: application/json" \
-d '{
"items": ["a", "b", "c"]
}'
POST /api/v2/selection_input/{path}
Push a value to the back of a list-like entry (append to array).
Query Parameters:
ttl- Expiry time as humantime string
Request (any JSON value):
{
"item": 42
}
Or a simple string:
"ready-for-publish"
Success: 200 OK
Example:
curl -s -X POST "https://cdn-manager/api/v2/selection_input/queue" \
-H "Content-Type: application/json" \
-d '"ready-for-publish"'
DELETE /api/v2/selection_input/{path}
Delete stored value.
Success: 204 No Content
Next Steps
- Data Store API - Generic key/value storage
- Subnets API - CIDR-to-value mappings
- OpenAPI Specification - Complete API specification