Sha256: 157aef739ee107535746449ca5e8c9f0449b0a66e18de15bc1a857f826c02574

Contents?: true

Size: 678 Bytes

Versions: 4

Compression:

Stored size: 678 Bytes

Contents

module Fog
  module Identity
    class HuaweiCloud
      class V2
        class Real
          def get_role(id)
            request(
              :expects => [200, 204],
              :method  => 'GET',
              :path    => "/OS-KSADM/roles/#{id}"
            )
          end
        end

        class Mock
          def get_role(id)
            response = Excon::Response.new
            if data = self.data[:roles][id]
              response.status = 200
              response.body = {'role' => data}
              response
            else
              raise Fog::Identity::HuaweiCloud::NotFound
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/identity/huaweicloud/v2/requests/get_role.rb
fog-huaweicloud-0.0.2 lib/fog/identity/huaweicloud/v2/requests/get_role.rb
fog-huaweicloud-0.1.3 lib/fog/identity/huaweicloud/v2/requests/get_role.rb
fog-huaweicloud-0.1.2 lib/fog/identity/huaweicloud/v2/requests/get_role.rb