Sha256: 8822283e6eb513d07c6d1c6f069aa834c8296d487ffce6743e95014ce42a8d5e

Contents?: true

Size: 776 Bytes

Versions: 10

Compression:

Stored size: 776 Bytes

Contents

require 'fog/core/model'
require 'rackspace-monitoring/monitoring/models/base'

module Fog
  module Monitoring
    class Rackspace
      class AgentToken < Fog::Monitoring::Rackspace::Base

        identity :id

        attribute :label
        attribute :token

        def prep
          options = {
            'label'                => label,
            'token'                => token
          }
          options = options.reject {|key, value| value.nil?}
          options
        end

        def save
          options = prep
          if identity then
            data = connection.update_agent_token(identity, options)
          else
            data = connection.create_agent_token(options)
          end
          true
        end

      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rackspace-monitoring-0.2.8 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.7 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.6 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.5 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.4 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.3 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.2 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.1 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.2.0 lib/rackspace-monitoring/monitoring/models/agent_token.rb
rackspace-monitoring-0.1.4 lib/rackspace-monitoring/monitoring/models/agent_token.rb