Class: Shared::StateResource
- Defined in:
- lib/vas/shared/state_resource.rb
Direct Known Subclasses
Instance, NodeInstance, TcServer::NodeRevision, TcServer::Revision
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ StateResource
constructor
:nodoc:.
-
#start ⇒ Object
Starts the resource.
-
#state ⇒ Object
The state of the resource.
-
#stop ⇒ Object
Stops the resource.
Constructor Details
#initialize(location, client) ⇒ StateResource
:nodoc:
22 23 24 25 |
# File 'lib/vas/shared/state_resource.rb', line 22 def initialize(location, client) #:nodoc: super(location, client) @state_location = Util::LinkUtils.get_link_href(details, 'state') end |
Instance Method Details
#start ⇒ Object
Starts the resource
28 29 30 |
# File 'lib/vas/shared/state_resource.rb', line 28 def start client.post(@state_location, { :status => 'STARTED' }) end |
#state ⇒ Object
The state of the resource
38 39 40 |
# File 'lib/vas/shared/state_resource.rb', line 38 def state client.get(@state_location)['status'] end |
#stop ⇒ Object
Stops the resource
33 34 35 |
# File 'lib/vas/shared/state_resource.rb', line 33 def stop client.post(@state_location, { :status => 'STOPPED' }) end |