Represent a generic resource available on the market The instance will have the #local_id of the instance as created on the supplied resource and an #instance_id for reference within the market.
State representing an instance which is fully built and ready for use
State representing an instance which is being built
State representing an instance which has been deleted
State representing an instance which could not be created
The API used to manage this resource
Build state of instance - must include:
Creation date (CO favours Unix Timestamp)
Deleted
Deletion date (UNIX Timestamp)
Description - user note or information about this instance
The instance id within the market
Label - user summary
The local id of the instance on the original resource
The resource id that this instance was created upon
User.user_id of supplier
User.local_id of supplier
Transaction ID
The type
The user id of the creator of this resource
User.local_id of creator
All instances shall share the same namespace
# File lib/onapp_market/instance.rb, line 63 def self.namespace Instance::TYPE end
Create a resource instance object
hash - Hash of attributes to apply
type - type for serialization help
# File lib/onapp_market/instance.rb, line 72 def initialize(hash = {}, type = nil) super(hash, type) # Restrict access restrict [:user_id, :user_local_id], :admin restrict [:local_id, :supplier_id, :supplier_local_id], [:admin, :supplier, :ro_admin] end
Remove an instance from a resource
OnappMarket::API::Response - Response
trader, admin
# File lib/onapp_market/instance.rb, line 87 def remove @api.delete("/instance/#{self.instance_id.url_safe}") end
Get additional status information about an instance In the future specific status information
OnappMarket::API::Response - data contains a Hash of values if is_ok?
trader, admin
# File lib/onapp_market/instance.rb, line 100 def status @api.get("/instance/#{self.instance_id.url_safe}/status") end