Skip to main content

Copy a MySQL database with a MySQL user

POST/v2/mysql-databases/{mysqlDatabaseId}/actions/copy
API version
v2
Request method
POST
Operation ID
database-copy-mysql-database

Request​

  • mysqlDatabaseIdstringrequired

    ID of the MySQLDatabase to copy.

Responses​

Format
application/json
Description

Created

  • idstring (uuid)required
  • userIdstring (uuid)required
Content-Type: application/json

{
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"userId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"userId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"id",
"userId"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"description":"string","user":{"accessLevel":"full","description":"string","externalAccess":true,"password":"string"}}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/mysql-databases/string/actions/copy
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.copyMysqlDatabase({
"mysqlDatabaseId": "string",
"data": {
"description": "string",
"user": {
"accessLevel": "full",
"description": "string",
"externalAccess": true,
"password": "string"
}
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Database\CopyMysqlDatabase\CopyMysqlDatabaseRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Database\CopyMysqlDatabase\CopyMysqlDatabaseRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// CopyMysqlDatabaseRequestBody to learn how to construct a valid instance
$body = new CopyMysqlDatabaseRequestBody(/* TODO: ... */);

$request = (new CopyMysqlDatabaseRequest(
mysqlDatabaseId: "string",
body: $body
));
$response = $client->database()->copyMysqlDatabase($request);

var_dump($response->getBody();

On this page