Created
August 14, 2012 12:01
-
-
Save arax/3348688 to your computer and use it in GitHub Desktop.
rOCCI client ideas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'occi/client' | |
include OCCI::Client | |
endpoint = "https://localhost:3300" | |
auth = { :type => "x509", | |
:user_cert => "mycert.pem", | |
:user_cert_password => "mypass", | |
:ca_path => "/etc/grid-security/certificates" } | |
connect endpoint, auth | |
# returns detailed information, perhaps in a Hashie::Mash | |
describe storage | |
describe network | |
describe compute | |
describe os_templates | |
describe resource_templates | |
# returns links to resources in arrays | |
list storage | |
list network | |
list compute | |
# instantiate a VM | |
mixins = [] | |
mixins << 'http://my.occi.service//occi/infrastructure/resource_tpl#medium' | |
mixins << 'http://my.occi.service//occi/infrastructure/os_template#mytemplate' | |
## maybe even | |
#mixins << 'resource_tpl#medium' | |
#mixins << 'os_template#mytemplate' | |
## or | |
#mixins << mixin resource_tpl, "medium" | |
#mixins << mixin os_template, "mytemplate" | |
attributes = { "occi.core.title" => "My rOCCI VM", | |
"org.opennebula.networkinterface.white_ports_tcp" => "22"} | |
compute_location = create compute, mixins, attributes | |
# and the rest | |
describe compute, compute_location | |
delete compute, compute_location | |
trigger action, compute_location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment