class OpenNebula::MarketPlaceApp

Constants

MARKETPLACEAPP_METHODS

Constants and Class Methods

MARKETPLACEAPP_STATES
MARKETPLACEAPP_TYPES
SHORT_MARKETPLACEAPP_STATES
SHORT_MARKETPLACEAPP_TYPES

Public Class Methods

build_xml(pe_id = nil) click to toggle source

Creates a MarketPlace description with just its identifier this method should be used to create plain MarketPlace objects. id the id of the user

Example:

app = MarketPlaceApp.new(MarketPlace.build_xml(3),rpc_client)
# File lib/opennebula/marketplaceapp.rb, line 71
def MarketPlaceApp.build_xml(pe_id = nil)
    if pe_id
        app_xml = "<MARKETPLACEAPP><ID>#{pe_id}</ID></MARKETPLACEAPP>"
    else
        app_xml = '<MARKETPLACEAPP></MARKETPLACEAPP>'
    end

    XMLElement.build_xml(app_xml, 'MARKETPLACEAPP')
end
new(xml, client) click to toggle source

Class constructor

Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 82
def initialize(xml, client)
    LockableExt.make_lockable(self, MARKETPLACEAPP_METHODS)

    super(xml, client)
end

Public Instance Methods

allocate(description, mp_id) click to toggle source

Allocates a new MarketPlace in OpenNebula

@param description [String] The template of the marketplace app @param mp_id [Integer] The id of the marketplace to create the app

@return [Integer, OpenNebula::Error] the new ID in case of

success, error otherwise
Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 106
def allocate(description, mp_id)
    super(MARKETPLACEAPP_METHODS[:allocate], description, mp_id)
end
chmod(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u, other_m, other_a) click to toggle source

Changes the marketplace app permissions. Each [Integer] argument must be 1 to allow, 0 deny, -1 do not change

@return [nil, OpenNebula::Error] nil in case of success, Error

otherwise
Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 152
def chmod(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u,
        other_m, other_a)
    super(MARKETPLACEAPP_METHODS[:chmod], owner_u, owner_m, owner_a,
        group_u, group_m, group_a, other_u, other_m, other_a)
end
chmod_octet(octet) click to toggle source

Changes the marketplace app permissions.

@param octet [String] Permissions octed , e.g. 640 @return [nil, OpenNebula::Error] nil in case of success, Error

otherwise
Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 143
def chmod_octet(octet)
    super(MARKETPLACEAPP_METHODS[:chmod], octet)
end
chown(uid, gid) click to toggle source

Changes the owner/group

@param uid [Integer] the new owner id. Set to -1 to leave the current one @param gid [Integer] the new group id. Set to -1 to leave the current one

@return [nil, OpenNebula::Error] nil in case of success, Error

otherwise
Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 134
def chown(uid, gid)
    super(MARKETPLACEAPP_METHODS[:chown], uid, gid)
end
delete() click to toggle source

Deletes the marketplace app

Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 111
def delete
    super(MARKETPLACEAPP_METHODS[:delete])
end
disable() click to toggle source

Enables this app

# File lib/opennebula/marketplaceapp.rb, line 174
def disable
    call(MARKETPLACEAPP_METHODS[:enable], @pe_id, false)
end
enable() click to toggle source

Enables this app

# File lib/opennebula/marketplaceapp.rb, line 169
def enable
    call(MARKETPLACEAPP_METHODS[:enable], @pe_id, true)
end
info() click to toggle source

Retrieves the information of the given marketplace app

Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 93
def info
    super(MARKETPLACEAPP_METHODS[:info], 'MARKETPLACEAPP')
end
Also aliased as: info!
info!()
Alias for: info
rename(name) click to toggle source

Renames this marketplace app

@param name [String] New name for the marketplace app

@return [nil, OpenNebula::Error] nil in case of success, Error

otherwise
# File lib/opennebula/marketplaceapp.rb, line 164
def rename(name)
    call(MARKETPLACEAPP_METHODS[:rename], @pe_id, name)
end
short_state_str() click to toggle source

Returns the state of the marketplace app (string value)

# File lib/opennebula/marketplaceapp.rb, line 208
def short_state_str
    SHORT_MARKETPLACEAPP_STATES[state_str]
end
short_type_str() click to toggle source

Returns the marketplace app type (string value)

# File lib/opennebula/marketplaceapp.rb, line 193
def short_type_str
    SHORT_MARKETPLACEAPP_TYPES[type_str]
end
state() click to toggle source

Returns the state of the marketplace app (numeric value)

# File lib/opennebula/marketplaceapp.rb, line 198
def state
    self['STATE'].to_i
end
state_str() click to toggle source

Returns the state of the marketplace app (string value)

# File lib/opennebula/marketplaceapp.rb, line 203
def state_str
    MARKETPLACEAPP_STATES[state]
end
type() click to toggle source

Returns the marketplace app type

# File lib/opennebula/marketplaceapp.rb, line 183
def type
    self['TYPE'].to_i
end
type_str() click to toggle source

Returns the marketplace app type (string value)

# File lib/opennebula/marketplaceapp.rb, line 188
def type_str
    MARKETPLACEAPP_TYPES[type]
end
update(new_template, append = false) click to toggle source

Replaces the template contents

@param new_template [String] New template contents @param append [true, false] True to append new attributes instead of

replace the whole template

@return [nil, OpenNebula::Error] nil in case of success, Error

otherwise
Calls superclass method
# File lib/opennebula/marketplaceapp.rb, line 123
def update(new_template, append = false)
    super(MARKETPLACEAPP_METHODS[:update], new_template, append ? 1 : 0)
end