Sha256: b0baf549f2d4f830a5fd5b31e7e78c0a46c08b60328a940e64af18d5acc905f9

Contents?: true

Size: 799 Bytes

Versions: 2

Compression:

Stored size: 799 Bytes

Contents

# coding: utf-8

module Fog
  module Network
    class SakuraCloud
      class Real
        def connect_interface_to_switch( id, switch_id )
          response = request(
            :headers => {
              'Authorization' => "Basic #{@auth_encode}"
            },
            :expects  => [200],
            :method => 'PUT',
            :path => "#{Fog::SakuraCloud::SAKURACLOUD_API_ENDPOINT}/interface/#{id}/to/switch/#{switch_id}"
          )
          response.body['Interface']['ID']
        end
      end # Real

      class Mock
        def regist_interface_to_server( id, switch_id )
          response = Excon::Response.new
          response.status = 20
          response.body = {
          }
          response
        end
      end
    end # SakuraCloud
  end # Network0
end # Fog

Version data entries

2 entries across 2 versions & 1 rubygems

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