Class: Azure::StorageAccount
- Inherits:
-
Object
- Object
- Azure::StorageAccount
- Includes:
- AzureUtility
- Defined in:
- lib/azure/service_management/storageaccount.rb
Instance Attribute Summary collapse
-
#affinityGroup ⇒ Object
Returns the value of attribute affinityGroup.
-
#georeplicationenabled ⇒ Object
Returns the value of attribute georeplicationenabled.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #create(params) ⇒ Object
-
#initialize(connection) ⇒ StorageAccount
constructor
A new instance of StorageAccount.
- #parse(serviceXML) ⇒ Object
Methods included from AzureUtility
#error_from_response_xml, #xml_content
Constructor Details
#initialize(connection) ⇒ StorageAccount
Returns a new instance of StorageAccount.
94 95 96 |
# File 'lib/azure/service_management/storageaccount.rb', line 94 def initialize(connection) @connection = connection end |
Instance Attribute Details
#affinityGroup ⇒ Object
Returns the value of attribute affinityGroup.
93 94 95 |
# File 'lib/azure/service_management/storageaccount.rb', line 93 def affinityGroup @affinityGroup end |
#georeplicationenabled ⇒ Object
Returns the value of attribute georeplicationenabled.
93 94 95 |
# File 'lib/azure/service_management/storageaccount.rb', line 93 def georeplicationenabled @georeplicationenabled end |
#location ⇒ Object
Returns the value of attribute location.
92 93 94 |
# File 'lib/azure/service_management/storageaccount.rb', line 92 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
92 93 94 |
# File 'lib/azure/service_management/storageaccount.rb', line 92 def name @name end |
Instance Method Details
#create(params) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/azure/service_management/storageaccount.rb', line 110 def create(params) builder = Nokogiri::XML::Builder.new do |xml| xml.CreateStorageServiceInput("xmlns" => "http://schemas.microsoft.com/windowsazure") do xml.ServiceName params[:azure_storage_account] xml.Label Base64.encode64(params[:azure_storage_account]) xml.Description params[:azure_storage_account_description] || "Explicitly created storage service" # Location defaults to 'West US' if params[:azure_affinity_group] xml.AffinityGroup params[:azure_affinity_group] else xml.Location params[:azure_service_location] || "West US" end end end @connection.query_azure("storageservices", "post", builder.to_xml) end |
#parse(serviceXML) ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/azure/service_management/storageaccount.rb', line 98 def parse(serviceXML) @name = xml_content(serviceXML, "ServiceName") @description = xml_content(serviceXML, "Description") @label = xml_content(serviceXML, "Label") @affinitygroup = xml_content(serviceXML, "AffinityGroup") @location = xml_content(serviceXML, "Location") @georeplicationenabled = xml_content(serviceXML, "GeoReplicationEnabled") @extendpropertyname = xml_content(serviceXML, "ExtendedProperties ExtendedProperty Name") @extendpropertyvalue = xml_content(serviceXML, "ExtendedProperties ExtendedProperty Value") self end |