Sha256: 111f5da204e0ace48cf96e38c86000cad4f00675f1bfdbae6c968becc1ffe950

Contents?: true

Size: 825 Bytes

Versions: 2

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_encode}"
            },
            :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

2 entries across 2 versions & 1 rubygems

Version Path
fog-sakuracloud-1.4.0 lib/fog/sakuracloud/requests/network/create_switch.rb
fog-sakuracloud-1.3.3 lib/fog/sakuracloud/requests/network/create_switch.rb