Sha256: 55aa43687b91a9b9ab6299104a953ac2031015d5b473238f1cab5847b2527d85

Contents?: true

Size: 1.25 KB

Versions: 29

Compression:

Stored size: 1.25 KB

Contents

module Fog
  module DNS
    class DNSimple
      class Real

        # Create a new host in the specified zone
        #
        # ==== Parameters
        # * domain<~String>
        # * name<~String>
        # * type<~String>
        # * content<~String>
        # * options<~Hash> - optional
        #   * priority<~Integer>
        #   * ttl<~Integer>
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>
        #     * name<~String>
        #     * ttl<~Integer>
        #     * created_at<~String>
        #     * special_type<~String>
        #     * updated_at<~String>
        #     * domain_id<~Integer>
        #     * id<~Integer>
        #     * content<~String>
        #     * record_type<~String>
        #     * prio<~Integer>
        def create_record(domain, name, type, content, options = {})

          body = {
            "record" => {
              "name" => name,
              "record_type" => type,
              "content" => content } }

          body["record"].merge!(options)

          request( :body     => MultiJson.encode(body),
                   :expects  => 201,
                   :method   => 'POST',
                   :path     => "/domains/#{domain}/records" )
        end

      end
    end
  end
end

Version data entries

29 entries across 29 versions & 7 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
michiels-fog-1.3.1 lib/fog/dnsimple/requests/dns/create_record.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.3.1 lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.3.0 lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.2.0 lib/fog/dnsimple/requests/dns/create_record.rb
ktheory-fog-1.1.2 lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.1.2 lib/fog/dnsimple/requests/dns/create_record.rb
fog_tractical-1.1.4 lib/fog/dnsimple/requests/dns/create_record.rb
fog_tractical-1.1.3 lib/fog/dnsimple/requests/dns/create_record.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.1.1 lib/fog/dnsimple/requests/dns/create_record.rb
fog-1.1.0 lib/fog/dnsimple/requests/dns/create_record.rb