client/lib/deltacloud.rb
# List available instance states and transitions between them
List available instance states and transitions between them
List available instance states and transitions between them
def instance_states
      states = []
      request(:get, entry_points[:instance_states]) do |response|
        Nokogiri::XML(response).xpath('states/state').each do |state_el|
          state = DeltaCloud::InstanceState::State.new(state_el['name'])
          state_el.xpath('transition').each do |transition_el|
            state.transitions << DeltaCloud::InstanceState::Transition.new(
              transition_el['to'],
              transition_el['action']
            )
          end
          states << state
        end
      end
      states
    end
def instance_states states = [ ] request ( :get , entry_points [ :instance_states ] ) do | response | Nokogiri :: XML ( response ) . xpath ( 'states/state' ) . each do | state_el | state = DeltaCloud :: InstanceState :: State . new ( state_el [ 'name' ] ) state_el . xpath ( 'transition' ) . each do | transition_el | state . transitions << DeltaCloud :: InstanceState :: Transition . new ( transition_el [ 'to' ] , transition_el [ 'action' ] ) end states << state end end states end
List available instance states and transitions between them
List available instance states and transitions between them