Class: Ridley::SandboxObject

Inherits:
ChefObject show all
Defined in:
lib/ridley/chef_objects/sandbox_object.rb

Instance Method Summary collapse

Methods inherited from ChefObject

#<=>, #==, chef_id, #chef_id, chef_json_class, chef_type, #eql?, #hash, #initialize, #inspect, #reload, #save, set_chef_id, set_chef_json_class, set_chef_type, #update

Constructor Details

This class inherits a constructor from Ridley::ChefObject

Instance Method Details

#checksum(chk_id) ⇒ Hash

Return information about the given checksum

Examples:

sandbox.checksum("e5a0f6b48d0712382295ff30bec1f9cc") => {
  needs_upload: true,
  url: "https://s3.amazonaws.com/opscode-platform-production-data/organization"
}

Parameters:

  • chk_id (#to_sym)

    checksum to retrieve information about

Returns:

  • (Hash)

    a hash containing the checksum information



31
32
33
# File 'lib/ridley/chef_objects/sandbox_object.rb', line 31

def checksum(chk_id)
  checksums[chk_id.to_sym]
end

#commitObject

Notify the Chef Server that uploading to this sandbox has completed



52
53
54
55
# File 'lib/ridley/chef_objects/sandbox_object.rb', line 52

def commit
  response = resource.commit(self)
  set_attribute(:is_completed, response[:is_completed])
end

#upload(checksums) ⇒ Object

Concurrently upload all of this sandboxes files into the checksum containers of the sandbox

Examples:

sandbox.upload(
  "e5a0f6b48d0712382295ff30bec1f9cc" => "/Users/reset/code/rbenv-cookbook/recipes/default.rb",
  "de6532a7fbe717d52020dc9f3ae47dbe" => "/Users/reset/code/rbenv-cookbook/recipes/ohai_plugin.rb"
)

Parameters:

  • checksums (Hash)

    a hash of file checksums and file paths



45
46
47
# File 'lib/ridley/chef_objects/sandbox_object.rb', line 45

def upload(checksums)
  resource.upload(self, checksums)
end