- API Reference
- Database
- Get a Redis database
Get a Redis database
Request
- redisDatabaseIdstringrequired
ID of the RedisDatabase to retrieve.
Responses
OK
- configurationobject
The configuration for a RedisDatabase.
- additionalFlagsarray of string (≥ 1 characters)
Additional flags passed to the database.
- Array[
- *string (≥ 1 characters)
]
- maxMemorystring
The database's maximum memory. This may be a number, optionally suffixed by one of the IEC binary suffixes
Ki,MiorGi. - maxMemoryPolicystring
The database's key eviction policy. See the Redis documentation on key evictions for more information.
- persistentboolean
Persistent status of the database.
- createdAtstring (date-time)required
- descriptionstringrequired
- finalizersarray of string (≥ 1 characters)
- Array[
- *string (≥ 1 characters)
]
- hostnamestringrequired
- idstring (uuid)required
- namestringrequired
- portintegerrequired
- projectIdstring (uuid)required
- statusstring (one of: pending, ready, migrating, importing, error, terminating)required
- statusSetAtstring (date-time)required
- storageUsageInBytesinteger (int64)required
- storageUsageInBytesSetAtstring (date-time)required
- updatedAtstring (date-time)required
- versionstringrequired
Content-Type: application/json
{
"configuration": {
"additionalFlags": [
"--tcp-keepalive",
"300"
],
"maxMemory": "16Mi",
"maxMemoryPolicy": "allkeys-lru",
"persistent": true
},
"createdAt": "2023-03-28T13:15:00.000Z",
"description": "My first RedisDatabase!",
"finalizers": [
"app:appinstallation:28471edf-d266-4d79-8ca8-169e330746db"
],
"hostname": "redis-xxxxxx.pg-example.db.example.com",
"id": "fcfe9aea-84d5-46eb-ac6f-a0ccffa908b1",
"name": "redis_xxxxxx",
"port": 6379,
"projectId": "9f2bddf1-dea6-4441-b4fe-a22ff39caff8",
"status": "error",
"statusSetAt": "2024-03-05T09:26:32.000Z",
"storageUsageInBytes": 10485760,
"storageUsageInBytesSetAt": "2024-03-05T09:26:32.000Z",
"updatedAt": "2023-03-29T15:50:10.000Z",
"version": "7.0"
}
{
"example": {
"configuration": {
"additionalFlags": [
"--tcp-keepalive",
"300"
],
"maxMemory": "16Mi",
"maxMemoryPolicy": "allkeys-lru",
"persistent": true
},
"createdAt": "2023-03-28T13:15:00.000Z",
"description": "My first RedisDatabase!",
"finalizers": [
"app:appinstallation:28471edf-d266-4d79-8ca8-169e330746db"
],
"hostname": "redis-xxxxxx.pg-example.db.example.com",
"id": "fcfe9aea-84d5-46eb-ac6f-a0ccffa908b1",
"name": "redis_xxxxxx",
"port": 6379,
"projectId": "9f2bddf1-dea6-4441-b4fe-a22ff39caff8",
"status": "error",
"statusSetAt": "2024-03-05T09:26:32.000Z",
"storageUsageInBytes": 10485760,
"storageUsageInBytesSetAt": "2024-03-05T09:26:32.000Z",
"updatedAt": "2023-03-29T15:50:10.000Z",
"version": "7.0"
},
"properties": {
"configuration": {
"description": "The configuration for a RedisDatabase.",
"properties": {
"additionalFlags": {
"description": "Additional flags passed to the database.",
"items": {
"minLength": 1,
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"maxMemory": {
"description": "The database's maximum memory. This may be a number, optionally suffixed by one of the IEC binary suffixes `Ki`, `Mi` or `Gi`.",
"example": "64Mi",
"type": "string"
},
"maxMemoryPolicy": {
"description": "The database's key eviction policy. See the [Redis documentation on key evictions](https://redis.io/docs/reference/eviction/) for more information.",
"example": "allkeys-lru",
"type": "string"
},
"persistent": {
"description": "Persistent status of the database.",
"type": "boolean"
}
},
"type": "object"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"description": {
"type": "string"
},
"finalizers": {
"items": {
"minLength": 1,
"type": "string"
},
"type": "array",
"uniqueItems": true
},
"hostname": {
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"port": {
"type": "integer"
},
"projectId": {
"format": "uuid",
"type": "string"
},
"status": {
"enum": [
"pending",
"ready",
"migrating",
"importing",
"error",
"terminating"
],
"type": "string"
},
"statusSetAt": {
"format": "date-time",
"type": "string"
},
"storageUsageInBytes": {
"format": "int64",
"type": "integer"
},
"storageUsageInBytesSetAt": {
"format": "date-time",
"type": "string"
},
"updatedAt": {
"format": "date-time",
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"id",
"projectId",
"version",
"hostname",
"port",
"description",
"createdAt",
"updatedAt",
"name",
"storageUsageInBytes",
"storageUsageInBytesSetAt",
"status",
"statusSetAt"
],
"type": "object"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsarray of objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Usage examples
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/redis-databases/string
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.database.getRedisDatabase({
"redisDatabaseId": "string"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Database\GetRedisDatabase\GetRedisDatabaseRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetRedisDatabaseRequest(
redisDatabaseId: "string"
));
$response = $client->database()->getRedisDatabase($request);
var_dump($response->getBody();