Sha256: c417d144f5e1ca12e68853fb7afbfb98e54dc58768f7e6957d3c49d78b3dd240

Contents?: true

Size: 842 Bytes

Versions: 4

Compression:

Stored size: 842 Bytes

Contents

module Fog
  module Introspection
    class HuaweiCloud
      class Real
        def create_introspection(node_id, options = {})
          if options
            data = {
              'new_ipmi_username' => options[:new_ipmi_username],
              'new_ipmi_password' => options[:new_ipmi_password]
            }
            body = Fog::JSON.encode(data)
          else
            body = ""
          end

          request(
            :body    => body,
            :expects => 202,
            :method  => "POST",
            :path    => "introspection/#{node_id}"
          )
        end
      end

      class Mock
        def create_introspection(_node_id, _options = {})
          response = Excon::Response.new
          response.status = 202
          response.body = ""
          response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/introspection/huaweicloud/requests/create_introspection.rb
fog-huaweicloud-0.0.2 lib/fog/introspection/huaweicloud/requests/create_introspection.rb
fog-huaweicloud-0.1.3 lib/fog/introspection/huaweicloud/requests/create_introspection.rb
fog-huaweicloud-0.1.2 lib/fog/introspection/huaweicloud/requests/create_introspection.rb