Sha256: f5643ea9c679ab4799c2d491460fc76b3acd03df0d41af734b20f16f55b86372
Contents?: true
Size: 1.88 KB
Versions: 1
Compression:
Stored size: 1.88 KB
Contents
module GenesisClient module Devices # Receive a list of all Devices. # # @return [Array<Hashie::Mash>] Array of hashes representing devices. # @example # client = GenesisClient::Client.new # client.devices def devices(type = nil) (type.nil? ? get('/devices') : get("/devices?type=#{type}"))['devices'] end alias list_devices devices # Receive a single Device. # # @return [Hashie::Mash] Hash representing the device. # @param sku [String] The SKU of the device # @example # client = GenesisClient::Client.new # client.device('UNK-12345534') def device(sku) get("/devices/#{sku}")['device'] end # Create a new Device. # # @return [Hashie::Mash] Hash representing the device # @param sku [String] The SKU of the new device def create_device(sku) post('/devices', sku: sku)['device'] end # Modify an existing Device. # # @return [Hashie::Mash] Hash representing the device # @param sku [String] The SKU of the device # @param data [Hash] Device attributes to update def update_device(sku, data) put("/devices/#{sku}", data)['device'] end # Create a new Log for a Device. # # @return [Hashie::Mash] Hash representing the log # @param sku [String] The SKU of the device # @param message [String] Log message def create_device_log(sku, message) data = { message: message } post("/devices/#{sku}/logs", data)['log'] end # Create a new Log for the current Remote Action for a Device. # # @return [Hashie::Mash] Hash representing the log # @param sku [String] The SKU of the device # @param message [String] Log message def create_device_current_remote_action_log(sku, message) data = { current_action: 'true', log: { message: message } } post("/devices/#{sku}/logs", data)['log'] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
genesis_client-0.1.3 | lib/genesis_client/devices.rb |