postPlatformProjectsByProjectAppsByAppDomains method
- String project,
- String app,
- AddDomainReq addDomainReq
Attaches a hostname — instantly if you already own it, otherwise with a DNS challenge.
Attaches a hostname — instantly if you already own it, otherwise with a DNS challenge. It attaches host to the app, and which of two things happens depends on who owns the name. A host inside the caller org's own subtree is structurally owned, so it goes ACTIVE immediately and answers 201. A bring-your-own host is claimed as PENDING and answers the DNS challenge records to publish; it is NOT rendered into the app's ingress until /verify passes. Claims are globally unique. A host already claimed by another organization is 409, and so is one claimed by a different app in your own; re-adding this app's OWN claim is idempotent and answers its current state at 200. The default host is always attached and re-adding it is 409. A host under the platform's shared apex that is not the caller's own subtree is 403 — it belongs to whoever owns that subtree and can never be grabbed through the custom path. host must be a valid DNS hostname; anything else is 400. Requires a validated principal; 403 without one.
Parameters:
-
String project (required): Project is the project the application lives under, from the path.
-
String app (required): App is the application's slug, from the path.
-
AddDomainReq addDomainReq (required):
Implementation
Future<DomainView?> postPlatformProjectsByProjectAppsByAppDomains(String project, String app, AddDomainReq addDomainReq,) async {
final response = await postPlatformProjectsByProjectAppsByAppDomainsWithHttpInfo(project, app, addDomainReq,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DomainView',) as DomainView;
}
return null;
}