class OneviewSDK::API200::Alerts

Event resource implementation

Constants

BASE_URI

Public Class Methods

new(client, params = {}, api_ver = nil) click to toggle source

Create a resource object, associate it with a client, and set its properties. @param [OneviewSDK::Client] client The client object for the OneView appliance @param [Hash] params The options for this resource (key-value pairs) @param [Integer] api_ver The api version to use when interracting with this resource.

Calls superclass method OneviewSDK::Resource::new
# File lib/oneview-sdk/resource/api200/alerts.rb, line 23
def initialize(client, params = {}, api_ver = nil)
  super
  # Default values:
  @data['type'] ||= 'AlertResourceV3'
end

Public Instance Methods

update(attributes = {}) click to toggle source
# File lib/oneview-sdk/resource/api200/alerts.rb, line 29
def update(attributes = {})
  set_all(attributes)
  ensure_client && ensure_uri
  data = @data.select { |k, _v| %w[alertState alertUrgency assignedToUser notes eTag].include?(k) }
  response = @client.rest_put(@data['uri'], { 'body' => data }, @api_version)
  @client.response_handler(response)
  self
end