Copy a MySQL database with a MySQL user
POST/mysql-databases/ {mysqlDatabaseId}/ actions/ copy/
v2
POST
database-copy-mysql-database
Request
Responses
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-X POST \
-d '{"description":"string","user":{"accessLevel":"full","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",
"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();