Edits history of script submission #18259 for ' Edit Advanced settings (qovery)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Edit Advanced settings
     *
     */
    export async function main(auth: RT.Qovery, terraformId: string, body: TerraformAdvancedSettings) {
    	const url = new URL(`https://api.qovery.com/terraform/${terraformId}/advancedSettings`)
    
    	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 TerraformAdvancedSettings {
    	/**
    	 * define the max timeout for the build
    	 */
    	'build.timeout_max_sec'?: number
    	/**
    	 * define the max cpu resources (in milli)
    	 */
    	'build.cpu_max_in_milli'?: number
    	/**
    	 * define the max ram resources (in gib)
    	 */
    	'build.ram_max_in_gib'?: number
    	'build.ephemeral_storage_in_gib'?: number
    	/**
    	 * define how long in seconds an application is supposed to be stopped gracefully
    	 */
    	'deployment.termination_grace_period_seconds'?: number
    	/**
    	 * Set pod placement on specific Kubernetes nodes labels
    	 */
    	'deployment.affinity.node.required'?: {
    		[k: string]: string
    	}
    	/**
    	 * Allows you to set an existing Kubernetes service account name
    	 *
    	 */
    	'security.service_account_name'?: string
    	/**
    	 * Mounts the container's root filesystem as read-only
    	 *
    	 */
    	'security.read_only_root_filesystem'?: boolean
    	[k: string]: unknown
    }
    

    Submitted by hugo697 235 days ago