Module: GenesisClient::RemoteActions

Included in:
Client
Defined in:
lib/genesis_client/remote_actions.rb

Instance Method Summary collapse

Instance Method Details

#create_remote_action_log(id, message) ⇒ Hashie::Mash

Create a new Log for a Remote Action.

Parameters:

  • id (String, Integer)

    The id of the remote action

  • message (String)

    Log message

Returns:

  • (Hashie::Mash)

    Hash representing the log



42
43
44
45
# File 'lib/genesis_client/remote_actions.rb', line 42

def create_remote_action_log(id, message)
  data = { message: message }
  post("/remote_actions/#{id}/logs", data)['log']
end

#remote_action(id) ⇒ Hashie::Mash

Receive a single Remote Action.

Examples:

client = GenesisClient::Client.new
client.remote_action('234')

Parameters:

  • id (String, Integer)

    The id of the remote action

Returns:

  • (Hashie::Mash)

    Hash representing the remote action.



24
25
26
# File 'lib/genesis_client/remote_actions.rb', line 24

def remote_action(id)
  get("/remote_actions/#{id}")['remote_action']
end

#remote_actions(zone) ⇒ Array<Hashie::Mash> Also known as: list_remote_actions

Receive a list of all Devices.

Examples:

client = GenesisClient::Client.new
client.remote_actions

Returns:

  • (Array<Hashie::Mash>)

    Array of hashes representing remote actions.



9
10
11
12
13
14
# File 'lib/genesis_client/remote_actions.rb', line 9

def remote_actions(zone)
  filters = {
    zone: zone
  }
  get('/remote_actions', filters)['remote_actions']
end

#update_remote_action(id, data) ⇒ Hashie::Mash

Modify an existing Remote Action.

Parameters:

  • id (String, Integer)

    The id of the remote action

  • data (Hash)

    Remote Action attributes to update

Returns:

  • (Hashie::Mash)

    Hash representing the remote action.



33
34
35
# File 'lib/genesis_client/remote_actions.rb', line 33

def update_remote_action(id, data)
  put("/remote_actions/#{id}", data)['remote_action']
end