lib/cloudcontrol/api/server.rb in cloudcontrol_sdk-0.3.12 vs lib/cloudcontrol/api/server.rb in cloudcontrol_sdk-0.4.0
- old
+ new
@@ -1,50 +1,57 @@
module CloudControl::API
class Server < Core
-
-
def list(options = {})
- endpoint "/#{org_id}/server/server"
+ org_endpoint '/server/server'
query_params options
get_simple
end
-
- def show(server_id, options = {})
- endpoint "/#{org_id}/server/server/#{server_id}"
- get
- end
- def show_by_name(name, options = {})
- options[:name] = name
- single(list(options))
+ def list_anti_affinity_rules(options = {})
+ org_endpoint '/server/antiAffinityRule'
+ query_params options
+ get_simple
end
- def show_by_id(id, options = {})
- options[:id] = id
- single(list(options))
+ def list_snapshots(server_id, options = {})
+ org_endpoint '/snapshot/snapshot'
+ options[:serverId] = server_id
+ query_params options
+ get_simple
end
-
def list_nics(vlan_id, options = {})
- endpoint "/#{org_id}/server/nic"
- get
+ org_endpoint '/server/nic'
+ options[:vlanId] = vlan_id
+ query_params options
+ get_simple
end
- def list_anti_affinity(target_id, options = {})
- endpoint "/#{org_id}/server/nic"
- get
- end
+ # def show(server_id, options = {})
+ # org_endpoint "/server/server/#{server_id}"
+ # get_simple
+ # end
- def show_by_ip(ip, options = {})
- options[:private_ip] = ip
- single(list(options))
- end
-
- # def create(name,
- # description,
- # network_id,
- # image_id,
+ # def show_by_name(name, options = {})
+ # options[:name] = name
+ # single(list(options))
+ # end
+
+ # def show_by_id(id, options = {})
+ # options[:id] = id
+ # single(list(options))
+ # end
+
+ # def show_by_ip(ip, options = {})
+ # options[:private_ip] = ip
+ # single(list(options))
+ # end
+
+ # def create(name,
+ # description,
+ # network_id,
+ # image_id,
# administrator_password=@client.default_password)
# org_endpoint "/server"
# xml_params(
# tag: "Server",
@@ -110,9 +117,7 @@
# def remove_storage(server_id, disk_id)
# org_endpoint "/server/#{server_id}/disk/#{disk_id}?delete"
# get
# end
-
end
end
-