OnApp specific supply functions
Create new instance
api - The api which manages this resource
# File lib/onapp_market/onapp/supply.rb, line 14 def initialize(api) super(api) end
Get a list of resources owned by this user on a specific cloud, or all resource if cloud_id is nil
OnappMarket::API::Response - data will contain an Array of Hashes containing resource_id and local_id of resource if is_ok?
supplier, admin
# File lib/onapp_market/onapp/supply.rb, line 25 def get_resources_by_cloud(cloud_id = nil) return get_resources({"cloud_id" => cloud_id}) end
Submit event data about a resource for forwarding to interested traders (market will rewrite VM ids)
resource_id - resource id of resource which is raising the
specified event
type - type of the event
data - data associated with the event
OnappMarket::API::Response - object/hash of JSON billing data if is_ok?
supplier, admin
# File lib/onapp_market/onapp/supply.rb, line 38 def submit_event(resource_id, type, data) @api.post("/onapp/hypervisor_zone/#{resource_id.url_safe}/submit_event", {:event_type => type, :event_data => data}) end