Class: Azure::ARM::Storage::Models::StorageAccountProperties

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_storage/models/storage_account_properties.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#account_typeAccountType

values include: ‘Standard_LRS’, ‘Standard_ZRS’, ‘Standard_GRS’, ‘Standard_RAGRS’, ‘Premium_LRS’

Returns:

  • (AccountType)

    Gets the type of the storage account. Possible



23
24
25
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 23

def 
  @account_type
end

#creation_timeDateTime

account in UTC.

Returns:

  • (DateTime)

    Gets the creation date and time of the storage



59
60
61
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 59

def creation_time
  @creation_time
end

#custom_domainCustomDomain

to this storage account.

Returns:

  • (CustomDomain)

    Gets the user assigned custom domain assigned



63
64
65
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 63

def custom_domain
  @custom_domain
end

#last_geo_failover_timeDateTime

failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is StandardGRS or StandardRAGRS.

Returns:

  • (DateTime)

    Gets the timestamp of the most recent instance of a



44
45
46
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 44

def last_geo_failover_time
  @last_geo_failover_time
end

#primary_endpointsEndpoints

of a public blob, queue or table object.Note that StandardZRS and PremiumLRS accounts only return the blob endpoint.

Returns:

  • (Endpoints)

    Gets the URLs that are used to perform a retrieval



28
29
30
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 28

def primary_endpoints
  @primary_endpoints
end

#primary_locationString

account.

Returns:

  • (String)

    Gets the location of the primary for the storage



32
33
34
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 32

def primary_location
  @primary_location
end

#provisioning_stateProvisioningState

the time the operation was called. Possible values include: ‘Creating’, ‘ResolvingDNS’, ‘Succeeded’

Returns:



18
19
20
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 18

def provisioning_state
  @provisioning_state
end

#secondary_endpointsEndpoints

of a public blob, queue or table object from the secondary location of the storage account. Only available if the accountType is StandardRAGRS.

Returns:

  • (Endpoints)

    Gets the URLs that are used to perform a retrieval



69
70
71
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 69

def secondary_endpoints
  @secondary_endpoints
end

#secondary_locationString

the storage account. Only available if the accountType is StandardGRS or StandardRAGRS.

Returns:

  • (String)

    Gets the location of the geo replicated secondary for



49
50
51
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 49

def secondary_location
  @secondary_location
end

#status_of_primaryAccountStatus

location of the storage account is available or unavailable. Possible values include: ‘Available’, ‘Unavailable’

Returns:

  • (AccountStatus)

    Gets the status indicating whether the primary



37
38
39
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 37

def status_of_primary
  @status_of_primary
end

#status_of_secondaryAccountStatus

secondary location of the storage account is available or unavailable. Only available if the accountType is StandardGRS or StandardRAGRS. Possible values include: ‘Available’, ‘Unavailable’

Returns:



55
56
57
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 55

def status_of_secondary
  @status_of_secondary
end

Class Method Details

.deserialize_object(object) ⇒ StorageAccountProperties

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 141

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

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

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

  deserialized_property = object['primaryEndpoints']
  unless deserialized_property.nil?
    deserialized_property = Endpoints.deserialize_object(deserialized_property)
  end
  output_object.primary_endpoints = deserialized_property

  deserialized_property = object['primaryLocation']
  output_object.primary_location = deserialized_property

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

  deserialized_property = object['lastGeoFailoverTime']
  deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.last_geo_failover_time = deserialized_property

  deserialized_property = object['secondaryLocation']
  output_object.secondary_location = deserialized_property

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

  deserialized_property = object['creationTime']
  deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.creation_time = deserialized_property

  deserialized_property = object['customDomain']
  unless deserialized_property.nil?
    deserialized_property = CustomDomain.deserialize_object(deserialized_property)
  end
  output_object.custom_domain = deserialized_property

  deserialized_property = object['secondaryEndpoints']
  unless deserialized_property.nil?
    deserialized_property = Endpoints.deserialize_object(deserialized_property)
  end
  output_object.secondary_endpoints = 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.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 85

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

  serialized_property = object.provisioning_state
  output_object['provisioningState'] = serialized_property unless serialized_property.nil?

  serialized_property = object.
  output_object['accountType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.primary_endpoints
  unless serialized_property.nil?
    serialized_property = Endpoints.serialize_object(serialized_property)
  end
  output_object['primaryEndpoints'] = serialized_property unless serialized_property.nil?

  serialized_property = object.primary_location
  output_object['primaryLocation'] = serialized_property unless serialized_property.nil?

  serialized_property = object.status_of_primary
  output_object['statusOfPrimary'] = serialized_property unless serialized_property.nil?

  serialized_property = object.last_geo_failover_time
  serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ')
  output_object['lastGeoFailoverTime'] = serialized_property unless serialized_property.nil?

  serialized_property = object.secondary_location
  output_object['secondaryLocation'] = serialized_property unless serialized_property.nil?

  serialized_property = object.status_of_secondary
  output_object['statusOfSecondary'] = serialized_property unless serialized_property.nil?

  serialized_property = object.creation_time
  serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ')
  output_object['creationTime'] = serialized_property unless serialized_property.nil?

  serialized_property = object.custom_domain
  unless serialized_property.nil?
    serialized_property = CustomDomain.serialize_object(serialized_property)
  end
  output_object['customDomain'] = serialized_property unless serialized_property.nil?

  serialized_property = object.secondary_endpoints
  unless serialized_property.nil?
    serialized_property = Endpoints.serialize_object(serialized_property)
  end
  output_object['secondaryEndpoints'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



74
75
76
77
78
# File 'lib/azure_mgmt_storage/models/storage_account_properties.rb', line 74

def validate
  @primary_endpoints.validate unless @primary_endpoints.nil?
  @custom_domain.validate unless @custom_domain.nil?
  @secondary_endpoints.validate unless @secondary_endpoints.nil?
end