cloudflare-go
cloudflare-go copied to clipboard
Spectrum: Support IPv4 in `SpectrumApplication` like we can do on the web interface
Current cloudflare-go version
v0.89.0
Description
The web interface allows to create a spectrum application using an origin IP address. Here's the description:
Origin
You can designate an IP, DNS record, or a Cloudflare Load Balancer as your origin.
Enter the IP or DNS record and port of your service. Your service must use the same transport protocol as the edge port.
However, the API doesn't seem to support using IPv4/6 addresses as origin. Likewise the go library comes with the error:
The origin DNS configuration is invalid. (11001)
if we use an IP address such as:
ip := &cloudflare.SpectrumApplicationOriginDNS{
Name: "1.2.3.4", // "origin.domain.com"
}
Use cases
Registering spectrum applications via API using IP addresses for origins and not DNS names.
Potential cloudflare-go usage
Registering spectrum applications via API using IP addresses for origin's and not DNS names using cloudflare-go.
References
No response
@atmosx take a look at https://github.com/cloudflare/cloudflare-go/blob/dff7a6ef2d1e2058405a9cde0f20c74dd67d7dd2/spectrum_test.go#L58, I guess the dashboard handles either using SpectrumApplicationOriginDNS or OriginDirect.