Sha256: a60d95fcf71b3b80db89b8ceea996b70d2b51bb638eb57d850a3efce3cdd5fbd

Contents?: true

Size: 825 Bytes

Versions: 12

Compression:

Stored size: 825 Bytes

Contents

# coding: utf-8

module Fog
  module Network
    class SakuraCloud
      class Real
        def create_switch(options)
          body = {
            "Switch" => {
              "Name" => options[:name]
            }
          }

          request(
            :headers => {
              'Authorization' => "Basic #{@auth_encord}"
            },
            :expects  => 201,
            :method => 'POST',
            :path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/switch",
            :body => Fog::JSON.encode(body)
          )
        end
      end # Real

      class Mock
        def create_switch(options)
          response = Excon::Response.new
          response.status = 201
          response.body = {
          }
          response
        end
      end
    end # SakuraCloud
  end # Network
end # Fog

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
fog-sakuracloud-1.3.2 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.3.1 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.3.0 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.2.0 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.1.1 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.1.0 lib/fog/sakuracloud/requests/network/create_switch.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-sakuracloud-1.0.1/lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.0.1 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.0.0 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-0.1.2 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-0.1.1 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-0.1.0 lib/fog/sakuracloud/requests/network/create_switch.rb