Zum Hauptinhalt springen

Create a DNS Zone for a verified Ingress in a Project

POST/v2/projects/{projectId}/dns-zones
API-Version
v2
Request-Methode
POST
Operation-ID
dns-create-project-dns-zone

Creates a DNSZone for a verified Ingress in a Project. The service resolves whether the domain is a root zone or a subzone and creates it accordingly. This lets a project prepare DNS for a domain that is not yet hosted at mittwald once ownership has been proven via a verified vHost.

Request​

  • projectIdstring
    required

    ID of the Project to create the DNSZone in.

Responses​

Format
application/json
Beschreibung

The ID of the created DNSZone.

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

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

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"name":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/projects/string/dns-zones
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.domain.dnsCreateProjectDnsZone({
"projectId": "string",
"data": {
"name": "string"
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Domain\DnsCreateProjectDnsZone\DnsCreateProjectDnsZoneRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Domain\DnsCreateProjectDnsZone\DnsCreateProjectDnsZoneRequestBody;

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

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

$request = (new DnsCreateProjectDnsZoneRequest(
projectId: "string",
body: $body
));
$response = $client->domain()->dnsCreateProjectDnsZone($request);

var_dump($response->getBody();

Auf dieser Seite