//native
/**
* Edit a Custom Domain
* To edit a Custom Domain you must have the project user permission
*/
export async function main(auth: RT.Qovery, helmId: string, customDomainId: string, body: Body) {
const url = new URL(`https://api.qovery.com/helm/${helmId}/customDomain/${customDomainId}`)
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Authorization: 'Token ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface Body {
/**
* your custom domain
*/
domain: string
/**
* to control if a certificate has to be generated for this custom domain by Qovery. The default value is `true`. This flag should be set to `false` if a CDN or other entities are managing the certificate for the specified domain and the traffic is proxied by the CDN to Qovery.
*/
generate_certificate: boolean
/**
* Indicates if the custom domain is behind a CDN (i.e Cloudflare).
* This will condition the way we are checking CNAME before & during a deployment:
* * If `true` then we only check the domain points to an IP
* * If `false` then we check that the domain resolves to the correct service Load Balancer
*
*/
use_cdn?: boolean
[k: string]: unknown
}
Submitted by hugo697 235 days ago