Class: DLDInternet::DOctl::API::Compute::Domain::Create
- Defined in:
- lib/dldinternet/doctl/api/compute/domain/create.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#CreateDomain(domain, ip_address) ⇒ Object
noinspection RubyUnnecessaryReturnValue.
Methods inherited from Base
Constructor Details
This class inherits a constructor from DLDInternet::DOctl::API::Base
Instance Method Details
#CreateDomain(domain, ip_address) ⇒ Object
noinspection RubyUnnecessaryReturnValue
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dldinternet/doctl/api/compute/domain/create.rb', line 12 def CreateDomain(domain, ip_address) client.domains.create(Hashie::Mash.new({name: domain, ip_address: ip_address})) rescue ::DropletKit::Error => e if matches = e..match(%r{^([0-9]{3}):\s+(\{.*\})\s*$}) json = JSON.parse(matches[2]) @logger.fatal json['message'] else @logger.fatal e. end exit 1 end |