Sha256: a6b3268272f35779d9d487387965ce0d2808dba81c6753a2f72c6e4a24847431

Contents?: true

Size: 1.82 KB

Versions: 13

Compression:

Stored size: 1.82 KB

Contents

#############################################################################
# Copyright © 2010 Dan Wanek <dwanek@nd.gov>
#
#
# This file is part of zenoss_client.
# 
# zenoss_client is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# zenoss_client is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
# Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with zenoss_client.  If not, see <http://www.gnu.org/licenses/>.
#############################################################################
module Zenoss
  module Model
    class RRDDataPoint < OpenStruct
      include Zenoss
      include Zenoss::Model

      def initialize(zenoss, datapoint_path)
        @zenoss = zenoss
        super({:uid => datapoint_path})
        model_init
      end

      # -------------------- JSON API Calls ------------------- #



      # ------------------------- Utility Methods ------------------------- #
      # These are methods that do not exist as part of the official Zenoss
      # API, but from an object model they seem to make sense to me.
      # ------------------------------------------------------------------- #



      # --------------------------- REST Methods -------------------------- #

      # @return [String] Name of the data source
      def name
        @cache_vars[:name] ||= rest('name')
      end


      private

      def rest(method)
        @zenoss.rest(URI.encode("#{self.uid}/#{method}"))
      end

    end # DeviceClass
  end # Model
end # Zenoss

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
zenoss_client-0.10.1 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.10.0 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.9.1 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.9.0 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.8.0 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.7.0 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.6.1 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.6.0 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.5.4 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.5.3 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.5.2 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.5.1 lib/zenoss/model/rrd/rrd_data_point.rb
zenoss_client-0.5.0 lib/zenoss/model/rrd/rrd_data_point.rb