Class: TcServer::Instances
- Inherits:
-
Shared::MutableCollection
- Object
- Shared::Resource
- Shared::Collection
- Shared::MutableCollection
- TcServer::Instances
- Defined in:
- lib/vas/tc_server/instances.rb
Overview
Used to enumerate, create, and delete tc Server instances.
Instance Attribute Summary
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#create(installation, name, options = {}) ⇒ Instance
Creates a new instance.
-
#initialize(location, client) ⇒ Instances
constructor
A new instance of Instances.
Methods inherited from Shared::MutableCollection
Methods inherited from Shared::Collection
Constructor Details
Instance Method Details
#create(installation, name, options = {}) ⇒ Instance
Creates a new instance
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/vas/tc_server/instances.rb', line 42 def create(installation, name, = {}) payload = { :installation => installation.location, :name => name } if .has_key?(:properties) payload[:properties] = [:properties] end if .has_key?(:runtime_version) payload['runtime-version'] = [:runtime_version] end if .has_key?(:templates) template_locations = [] [:templates].each { |template| template_locations << template.location } payload[:templates] = template_locations end if .has_key?(:layout) payload[:layout] = [:layout] end super(payload, 'group-instance') end |