class ScalewayDDNS::Request
- ScalewayDDNS::Request
- Reference
- Object
Overview
The Request class handles interactions with the Scaleway API for managing DNS records.
Defined in:
scaleway_ddns/request.crConstant Summary
-
SCW_API_HOST =
"api.scaleway.com"
-
The host of the Scaleway API used for DNS record management.
Constructors
-
.new(scw_secret_key : String)
Creates a new instance of
ScalewayDDNS::Request
with given Scaleway secret key.
Instance Method Summary
-
#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.
-
#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.
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)