Class: Azure::ARM::Redis::Models::RedisRebootParameters

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_redis/models/redis_reboot_parameters.rb

Overview

Specifies which redis node(s) to reboot.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reboot_typeRebootType

value data loss is possible. Possible values include: ‘PrimaryNode’, ‘SecondaryNode’, ‘AllNodes’

Returns:

  • (RebootType)

    Which redis node(s) to reboot. Depending on this



18
19
20
# File 'lib/azure_mgmt_redis/models/redis_reboot_parameters.rb', line 18

def reboot_type
  @reboot_type
end

#shard_idInteger

which should be rebooted.

Returns:

  • (Integer)

    In case of cluster cache, this specifies shard id



22
23
24
# File 'lib/azure_mgmt_redis/models/redis_reboot_parameters.rb', line 22

def shard_id
  @shard_id
end

Class Method Details

.deserialize_object(object) ⇒ RedisRebootParameters

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/azure_mgmt_redis/models/redis_reboot_parameters.rb', line 54

def self.deserialize_object(object)
  return if object.nil?
  output_object = RedisRebootParameters.new

  deserialized_property = object['rebootType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = RebootType.constants.any? { |e| RebootType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum RebootType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.reboot_type = deserialized_property

  deserialized_property = object['shardId']
  deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.shard_id = deserialized_property

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/azure_mgmt_redis/models/redis_reboot_parameters.rb', line 36

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.reboot_type
  output_object['rebootType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.shard_id
  output_object['shardId'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



27
28
29
# File 'lib/azure_mgmt_redis/models/redis_reboot_parameters.rb', line 27

def validate
  fail MsRest::ValidationError, 'property reboot_type is nil' if @reboot_type.nil?
end