lib/process/cloud/providers/hpcloud/compute.rb in lorj_cloud-0.1.3 vs lib/process/cloud/providers/hpcloud/compute.rb in lorj_cloud-0.1.4
- old
+ new
@@ -22,50 +22,16 @@
def self.query_addresses(oComputeConnect, sQuery)
oComputeConnect.addresses.all(sQuery)
end
- def self.query_server(oComputeConnect, sQuery)
- oComputeConnect.servers.all(sQuery)
- end
-
- def self.query_image(oComputeConnect, sQuery)
- # HP Fog query is exact matching. No way to filter with a Regexp
- # Testing it and filtering it.
- # TODO: Be able to support Regexp in queries then extract all and filter.
- oComputeConnect.images.all(sQuery)
- end
-
- def self.query_flavor(oComputeConnect, sQuery)
- oComputeConnect.flavors.all(sQuery)
- end
-
def self.create_server(oComputeConnect, options, oUser_data, oMeta_data)
if oUser_data
options[:user_data_encoded] = Base64.strict_encode64(oUser_data)
end
options[:metadata] = oMeta_data if oMeta_data
server = oComputeConnect.servers.create(options)
HPCompute.get_server(oComputeConnect, server.id) if server
- end
-
- def self.query_server_assigned_addresses(oComputeConnect, _oServer, sQuery)
- # CloudProcess used a simplified way to manage IPs.
- # Following is the translation to get the public IPs for the server
-
- result = []
- addresses = oComputeConnect.addresses.all
- addresses.each do |oElem|
- is_found = true
- sQuery.each do |key, value|
- if !oElem.attributes.key?(key) || oElem.attributes[key] != value
- is_found = false
- break
- end
- end
- result << oElem if is_found
- end
- result
end
def self.get_server_assigned_address(oComputeConnect, id)
addresses = oComputeConnect.addresses.all
addresses.each { |oElem| return oElem if oElem.attributes['id'] == id }