Class: RestCartridge10
- Inherits:
-
OpenShift::Model
- Object
- OpenShift::Model
- RestCartridge10
- Defined in:
- app/models/rest_cartridge10.rb
Instance Attribute Summary collapse
-
#links ⇒ Object
Returns the value of attribute links.
-
#name ⇒ Object
Returns the value of attribute name.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#status_messages ⇒ Object
Returns the value of attribute status_messages.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, name, app, url, status_messages, nolinks = false) ⇒ RestCartridge10
constructor
A new instance of RestCartridge10.
- #to_xml(options = {}) ⇒ Object
Constructor Details
#initialize(type, name, app, url, status_messages, nolinks = false) ⇒ RestCartridge10
Returns a new instance of RestCartridge10.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/models/rest_cartridge10.rb', line 4 def initialize(type, name, app, url, , nolinks=false) self.name = name self.type = type self.properties = {} self. = if app and !nolinks self.properties = app.[name] domain_id = app.domain.namespace app_id = app.name if not app_id.nil? and not domain_id.nil? self.links = { "GET" => Link.new("Get embedded cartridge", "GET", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}")) } self.links.merge!({ "START" => Link.new("Start embedded cartridge", "POST", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}/events"), [ Param.new("event", "string", "event", "start") ]), "STOP" => Link.new("Stop embedded cartridge", "POST", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}/events"), [ Param.new("event", "string", "event", "stop") ]), "RESTART" => Link.new("Restart embedded cartridge", "POST", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}/events"), [ Param.new("event", "string", "event", "restart") ]), "RELOAD" => Link.new("Reload embedded cartridge", "POST", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}/events"), [ Param.new("event", "string", "event", "reload") ]), "DELETE" => Link.new("Delete embedded cartridge", "DELETE", URI::join(url, "domains/#{domain_id}/applications/#{app_id}/cartridges/#{name}")) }) if type == "embedded" end end end |
Instance Attribute Details
#links ⇒ Object
Returns the value of attribute links.
2 3 4 |
# File 'app/models/rest_cartridge10.rb', line 2 def links @links end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'app/models/rest_cartridge10.rb', line 2 def name @name end |
#properties ⇒ Object
Returns the value of attribute properties.
2 3 4 |
# File 'app/models/rest_cartridge10.rb', line 2 def properties @properties end |
#status_messages ⇒ Object
Returns the value of attribute status_messages.
2 3 4 |
# File 'app/models/rest_cartridge10.rb', line 2 def @status_messages end |
#type ⇒ Object
Returns the value of attribute type.
2 3 4 |
# File 'app/models/rest_cartridge10.rb', line 2 def type @type end |
Instance Method Details
#to_xml(options = {}) ⇒ Object
37 38 39 40 |
# File 'app/models/rest_cartridge10.rb', line 37 def to_xml(={}) [:tag_name] = "cartridge" super() end |