class ScalewayDDNS::Request

Overview

The Request class handles interactions with the Scaleway API for managing DNS records.

Defined in:

scaleway_ddns/request.cr

Constant Summary

SCW_API_HOST = "api.scaleway.com"

The host of the Scaleway API used for DNS record management.

Constructors

Instance Method Summary

Constructor Detail

def self.new(scw_secret_key : String) #

Creates a new instance of ScalewayDDNS::Request with given Scaleway secret key.


Instance Method Detail

def address_record_list(domain : String) : Array(Hash(Symbol, String | Int32)) #

Get a list of A (address) record from the Scaleway API for a given domain.

ScalewayDDNS::Request.address_record_list("example.com")
# => [{ :id => 1, :name => "" :ttl => 60 }, { :id => 2, :name => "mail" :ttl => 120 }]

ScalewayDDNS::Request.address_record_list("invalid.com")
# => Scaleway API: Unauthorized, please check configuration variables.

def update_address_record(domain : String, ip : String, record : Hash(Symbol, String | Int32)) #

Update an A (address) record in the Scaleway API for a given domain.

ScalewayDDNS::Request.update_address_record("example.com", "127.0.0.1", record)