Edits history of script submission #18096 for ' Add custom domain to the container. (qovery)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Add custom domain to the container.
     * Add a custom domain to this container in order not to use qovery autogenerated domain
     */
    export async function main(auth: RT.Qovery, containerId: string, body: Body) {
    	const url = new URL(`https://api.qovery.com/container/${containerId}/customDomain`)
    
    	const response = await fetch(url, {
    		method: 'POST',
    		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