ganomede generic public data microservice
1.9K
Expose public data.
Environment variables:
HOST — interface to listen on ('127.0.0.1');PORT — port to listen on ('127.0.0.1');API_SECRET — non-empty string for authorizing non-read operations;REDIS_DATA_PORT_6379_TCP_ADDR — hostname of Redis instance to store documents in;REDIS_DATA_PORT_6379_TCP_PORT — port of Redis instance to store documents in./data/v1/docs/ [POST]{ "secret": "API_SECRET",
"document": {/*…*/} // JSON to insert.
"id": "idString" // Optional ID to insert document with
// (if missing, newly created UUID v4 is used).
}
[200 OK]{ "id": "idString" } // ID of created document.
[403 Forbidden]Invalid secret.
/data/v1/docs/_bulk_upsert [POST]Creates multiple documents, existing documents are overwritten. This is transactional — either all upserts will succeed, or none of them.
{ "secret": "API_SECRET",
// Pass in an object, where keys are ids and values are documents:
"documents": {
"key-1": {"a": {"body": "for key-1"}}, // JSON to upsert at `key-1`
"key-1": {"something": "else"}, // JSON to upsert at `key-2`
/* … */
}
}
[200 OK]Array of IDs.
[ "key-1",
"key-2",
/* … */
]
[403 Forbidden]Invalid secret.
/data/v1/docs [GET]List IDs of all documents, or specify q query string parameter to filter only matching set (substring or redis glob).
[200 OK][
"matchin-id",
"another-matching-id",
// …
]
/data/v1/docs/:id [GET][200 OK]{ /*…*/ } // Document itself as created (without id).
[404 Not Found]Document with specified :id was not found.
/data/v1/docs/:id [POST]{ "secret": "API_SECRET" }
[200 OK]Document replaced.
[404 Not Found]Document with specified :id was not found.
[403 Forbidden]Invalid secret.
/data/v1/docs/:id [DELETE]{ "secret": "API_SECRET" }
[200 OK]Document deleted or does not exist.
[403 Forbidden]Invalid secret.
Content type
Image
Digest
Size
342.3 MB
Last updated
almost 6 years ago
docker pull ganomede/data