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