Sha256: 7c5d16e078b1a6f865bcad668f1a8bd6018b730bb0238960f4f7fb3fbc48cc0a

Contents?: true

Size: 997 Bytes

Versions: 5

Compression:

Stored size: 997 Bytes

Contents

require 'securerandom'

module Fog
  module Storage
    class OracleCloud
      class Real

      	def create_container(name)
          request({
            :method   => 'PUT',
            :expects  => [201,202],
            :path     => "/v1/Storage-#{@identity_domain}/#{name}"
          }, false)
        end

      end

      class Mock
      	def create_container (name)
          response = Excon::Response.new

          self.data[:containers][name] = {
            'name' => name,
            'count' => 0,
            'bytes' => 0
          }
          response.status = 201
          response.headers = {
            'Content-Length' => 0,
            'X-Container-Bytes-Used' => 0,
            'X-Container-Object-Count' => 0,
            'Date'=>Time.now.strftime('%Y-%m-%dT%H:%M:%S'),
            'X-Timestamp'=>Time.now.to_i,
            'X-Trans-id'=>SecureRandom.uuid
          }
          response
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-oraclecloud-0.1.12 lib/fog/oraclecloud/requests/storage/create_container.rb
fog-oraclecloud-0.1.11 lib/fog/oraclecloud/requests/storage/create_container.rb
fog-oraclecloud-0.1.10 lib/fog/oraclecloud/requests/storage/create_container.rb
fog-oraclecloud-0.1.9 lib/fog/oraclecloud/requests/storage/create_container.rb
fog-oraclecloud-0.1.8 lib/fog/oraclecloud/requests/storage/create_container.rb