curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/custom-domain/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "domain": "www.example.com", "cert_mode": "acme", "certificate_id": 15}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/custom-domain/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "domain": "www.example.com", "cert_mode": "acme", "certificate_id": 15, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/custom-domain/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "domain": "www.example.com", "cert_mode": "acme", "certificate_id": 15 }),});console.log(await response.json());Adds a custom domain to an L7 Load Balancer, or replaces the one it has. The address E2E gave the Load Balancer keeps working. With cert_mode acme a free certificate is requested and is issued once the domain’s DNS points at the Load Balancer; this turns HTTP on, with redirect to HTTPS, if the Load Balancer is HTTPS only. With upload the Load Balancer serves a certificate you uploaded. Point a CNAME record for the domain at cname_target. The Load Balancer needs the Update permission.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Load Balancer ID
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
The domain. Lower-cased and a trailing dot removed. Letters, digits and hyphens in labels of up to 63 characters, with at least one dot. A name under e2enetworks.net is refused.
Example
www.example.comacme for a free certificate that renews itself, or upload to use a certificate of the project. Default acme.
Example
acmeID of the certificate to serve. Required when cert_mode is upload. It must belong to the project and cover the domain.
Example
15Responses
Section titled “Responses”The custom domain as set
object
object
The certificate, with the fields shown in Get Load Balancer Custom Domain.
object
object
Example
{ "code": 200, "message": "Success", "data": { "domain": "www.example.com", "status": "pending_dns", "cname_target": "lb-12-abc123.e2enetworks.net", "dns_verified": false, "reason": "" }, "errors": {}}The Load Balancer is L4 (“Custom domains apply to L7 (HTTP/HTTPS) load balancers only.”); domain is empty, is not a valid name, or is under e2enetworks.net (errors is keyed by domain); cert_mode is not acme or upload; cert_mode is upload without certificate_id; the certificate is not in the project or does not cover the domain; the domain is already used by another Load Balancer (“‘errors “Project ID is missing or invalid”.
object
object
Example
{ "code": 400, "message": "Bad Request", "data": {}, "errors": "Custom domains apply to L7 (HTTP/HTTPS) load balancers only."}No Load Balancer with that ID in the project and region.
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Gateway not found"}