azure 0.6.4 → 0.7.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env_sample +11 -0
- data/.gitignore +4 -1
- data/.travis.yml +3 -1
- data/ChangeLog.txt +17 -1
- data/LICENSE.txt +202 -0
- data/README.md +58 -20
- data/Rakefile +27 -35
- data/azure.gemspec +17 -13
- data/bin/pfxer +35 -0
- data/lib/azure.rb +8 -0
- data/lib/azure/base_management/base_management_service.rb +24 -26
- data/lib/azure/base_management/management_http_request.rb +17 -14
- data/lib/azure/base_management/serialization.rb +1 -0
- data/lib/azure/blob/auth/shared_access_signature.rb +141 -0
- data/lib/azure/blob/blob_service.rb +221 -217
- data/lib/azure/cloud_service_management/cloud_service_management_service.rb +27 -30
- data/lib/azure/cloud_service_management/serialization.rb +1 -0
- data/lib/azure/core.rb +17 -15
- data/lib/azure/core/configuration.rb +7 -0
- data/lib/azure/core/http/http_error.rb +1 -1
- data/lib/azure/core/http/http_request.rb +4 -1
- data/lib/azure/core/utility.rb +16 -1
- data/lib/azure/queue/queue_service.rb +13 -13
- data/lib/azure/service/cors.rb +11 -0
- data/lib/azure/service/cors_rule.rb +15 -0
- data/lib/azure/service/serialization.rb +69 -10
- data/lib/azure/service/storage_service.rb +10 -6
- data/lib/azure/service/storage_service_properties.rb +8 -3
- data/lib/azure/service_bus/brokered_message.rb +1 -1
- data/lib/azure/service_bus/relay.rb +88 -0
- data/lib/azure/service_bus/serialization.rb +1 -0
- data/lib/azure/service_bus/service_bus_service.rb +70 -4
- data/lib/azure/sql_database_management/serialization.rb +1 -0
- data/lib/azure/sql_database_management/sql_database_management_service.rb +22 -22
- data/lib/azure/storage_management/serialization.rb +34 -14
- data/lib/azure/storage_management/storage_account.rb +9 -1
- data/lib/azure/storage_management/storage_management_service.rb +74 -32
- data/lib/azure/table/batch.rb +6 -6
- data/lib/azure/table/table_service.rb +13 -13
- data/lib/azure/version.rb +3 -3
- data/lib/azure/virtual_machine_image_management/serialization.rb +19 -0
- data/lib/azure/virtual_machine_image_management/virtual_machine_image.rb +1 -1
- data/lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb +30 -7
- data/lib/azure/virtual_machine_management/serialization.rb +32 -12
- data/lib/azure/virtual_machine_management/virtual_machine.rb +1 -0
- data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +92 -81
- data/lib/azure/virtual_network_management/serialization.rb +12 -5
- data/lib/azure/virtual_network_management/virtual_network.rb +1 -0
- data/lib/azure/virtual_network_management/virtual_network_management_service.rb +11 -11
- data/test/fixtures/get_storage_account_properties.xml +6 -4
- data/test/fixtures/{list_images.xml → list_os_images.xml} +1 -1
- data/test/fixtures/list_storage_accounts.xml +2 -0
- data/test/fixtures/list_vm_images.xml +21 -0
- data/test/fixtures/metrics.xml +2 -2
- data/test/fixtures/sb_default_create_relay_response.xml +15 -0
- data/test/fixtures/storage_service_keys.xml +8 -0
- data/test/fixtures/storage_service_properties.xml +35 -3
- data/test/fixtures/updated_storage_accounts.xml +2 -0
- data/test/fixtures/virtual_machine.xml +3 -1
- data/test/integration/affinity_group/Affinity_test.rb +1 -1
- data/test/integration/affinity_group/Create_Affinity_test.rb +8 -7
- data/test/integration/affinity_group/Delete_Affinity_test.rb +3 -3
- data/test/integration/affinity_group/List_Affinity_test.rb +1 -1
- data/test/integration/affinity_group/Update_Affinity_test.rb +9 -8
- data/test/integration/cloud_service/Cloud_Create_test.rb +3 -2
- data/test/integration/cloud_service/Cloud_Delete_test.rb +5 -4
- data/test/integration/database/create_sql_server_firewall_test.rb +1 -1
- data/test/integration/database/create_sql_server_test.rb +1 -1
- data/test/integration/database/delete_sql_server_firewall_test.rb +1 -1
- data/test/integration/database/delete_sql_server_test.rb +1 -1
- data/test/integration/database/list_sql_server_firewall_test.rb +1 -1
- data/test/integration/database/list_sql_servers_test.rb +1 -1
- data/test/integration/database/reset_password_sql_server_test.rb +1 -1
- data/test/integration/service_bus/queues_test.rb +22 -22
- data/test/integration/service_bus/relay_test.rb +132 -0
- data/test/integration/storage_management/storage_management_test.rb +58 -33
- data/test/integration/test_helper.rb +11 -15
- data/test/integration/vm/VM_Create_test.rb +17 -18
- data/test/integration/vm/VM_Delete_test.rb +2 -4
- data/test/integration/vm/VM_Operations_test.rb +1 -2
- data/test/integration/vnet/Virtual_Network_Create_test.rb +9 -15
- data/test/integration/vnet/Virtual_Network_list_test.rb +4 -9
- data/test/support/name_generator.rb +8 -0
- data/test/support/virtual_network_helper.rb +2 -2
- data/test/test_helper.rb +13 -24
- data/test/unit/affinity_group/affinity_group_test.rb +10 -13
- data/test/unit/affinity_group/serialization_test.rb +7 -8
- data/test/unit/base_management/location_test.rb +1 -2
- data/test/unit/blob/auth/shared_access_signature_test.rb +71 -0
- data/test/unit/blob/blob_service_test.rb +393 -371
- data/test/unit/cloud_service_management/cloud_service_management_service_test.rb +16 -16
- data/test/unit/core/auth/shared_key_lite_test.rb +4 -4
- data/test/unit/core/auth/shared_key_test.rb +2 -2
- data/test/unit/core/http/http_error_test.rb +10 -5
- data/test/unit/core/http/http_request_test.rb +72 -25
- data/test/unit/database/serialization_test.rb +7 -7
- data/test/unit/database/sql_database_server_service_test.rb +43 -47
- data/test/unit/service/serialization_test.rb +40 -9
- data/test/unit/service/storage_service_test.rb +13 -11
- data/test/unit/storage_management/serialization_test.rb +26 -14
- data/test/unit/storage_management/storage_management_service_test.rb +48 -62
- data/test/unit/virtual_machine_image_management/serialization_test.rb +20 -5
- data/test/unit/virtual_machine_image_management/virtual_machine_image_management_service_test.rb +78 -29
- data/test/unit/virtual_machine_management/serialization_test.rb +112 -43
- data/test/unit/virtual_machine_management/virtual_machine_management_service_test.rb +123 -100
- data/test/unit/vnet/serialization_test.rb +7 -7
- data/test/unit/vnet/virtual_network_management_service_test.rb +1 -1
- metadata +70 -16
- data/test/fixtures/certificate.pem +0 -21
@@ -20,6 +20,7 @@ module Azure
|
|
20
20
|
# Storage management serialization module is responsible for converting
|
21
21
|
# the objects to XML and vice versa.
|
22
22
|
module Serialization
|
23
|
+
extend Azure::Core::Utility
|
23
24
|
def self.storage_services_to_xml(name, options = {})
|
24
25
|
builder = Nokogiri::XML::Builder.new do |xml|
|
25
26
|
xml.CreateStorageServiceInput(
|
@@ -51,11 +52,9 @@ module Azure
|
|
51
52
|
storage_account.name = xml_content(
|
52
53
|
storage_service_xml, 'ServiceName'
|
53
54
|
)
|
54
|
-
|
55
55
|
storage_service_properties = storage_service_xml.css(
|
56
56
|
'StorageServiceProperties'
|
57
57
|
)
|
58
|
-
|
59
58
|
storage_account.description = xml_content(
|
60
59
|
storage_service_properties, 'Description'
|
61
60
|
)
|
@@ -77,6 +76,9 @@ module Azure
|
|
77
76
|
storage_account.geo_replication_enabled = xml_content(
|
78
77
|
storage_service_properties, 'GeoReplicationEnabled'
|
79
78
|
)
|
79
|
+
storage_account.account_type = xml_content(
|
80
|
+
storage_service_properties, 'AccountType'
|
81
|
+
)
|
80
82
|
storage_account.geo_primary_region = xml_content(
|
81
83
|
storage_service_properties, 'GeoPrimaryRegion'
|
82
84
|
)
|
@@ -112,13 +114,13 @@ module Azure
|
|
112
114
|
|
113
115
|
def self.storage_update_to_xml(options)
|
114
116
|
# Cannot update if options is nil or empty
|
115
|
-
fail 'No options specified' if options.
|
117
|
+
fail 'No options specified' if options.empty?
|
116
118
|
|
117
119
|
# Either one of Label, or Description is required.
|
118
120
|
if (options[:label].nil? || options[:label].empty?) &&
|
119
|
-
|
121
|
+
(options[:description].nil? || options[:description].empty?)
|
120
122
|
fail 'Either one of Label or Description'\
|
121
|
-
|
123
|
+
' has to be provided. Both cannot be empty'
|
122
124
|
end
|
123
125
|
|
124
126
|
# The input param may not be nil or empty, but the values inside may
|
@@ -129,15 +131,13 @@ module Azure
|
|
129
131
|
when :description, :label
|
130
132
|
is_empty = value.nil? || value.empty?
|
131
133
|
when :geo_replication_enabled
|
132
|
-
is_empty = !(value.
|
133
|
-
|| value.kind_of?(FalseClass))
|
134
|
+
is_empty = !(value.is_a?(TrueClass) || value.is_a?(FalseClass))
|
134
135
|
when :extended_properties
|
135
136
|
value.each do |p, v|
|
136
137
|
is_empty = ((p.nil? || p.empty?) || (v.nil? || v.empty?))
|
137
138
|
break unless is_empty
|
138
139
|
end
|
139
140
|
end
|
140
|
-
|
141
141
|
break unless is_empty
|
142
142
|
end
|
143
143
|
|
@@ -166,18 +166,38 @@ module Azure
|
|
166
166
|
gre = options[:geo_replication_enabled]
|
167
167
|
xml.GeoReplicationEnabled(
|
168
168
|
gre
|
169
|
-
) unless gre.nil
|
170
|
-
|| !(gre.kind_of?(TrueClass) || gre.kind_of?(FalseClass))
|
169
|
+
) unless gre.nil? || !(gre.is_a?(TrueClass) || gre.is_a?(FalseClass))
|
171
170
|
xml.ExtendedProperties do
|
172
171
|
options[:extended_properties].each do |name, value|
|
173
172
|
xml.ExtendedProperty do
|
174
173
|
xml.Name name
|
175
174
|
xml.Value value
|
176
|
-
end unless (name.
|
177
|
-
|
175
|
+
end unless (name.to_s.empty?) || (value.to_s.empty?)
|
176
|
+
end
|
177
|
+
end unless options[:extended_properties].to_s.empty?
|
178
|
+
xml.AccountType options[:account_type] if options[:account_type]
|
179
|
+
end
|
180
|
+
|
181
|
+
def self.storage_account_keys_from_xml(storage_xml)
|
182
|
+
storage_xml.css('StorageService')
|
183
|
+
storage_service_xml = storage_xml.css('StorageService').first
|
184
|
+
service_key_xml = storage_service_xml.css('StorageServiceKeys').first
|
185
|
+
storage_account_keys = StorageAccountKeys.new
|
186
|
+
storage_account_keys.url = xml_content(storage_service_xml, 'Url')
|
187
|
+
storage_account_keys.primary_key = xml_content(service_key_xml, 'Primary')
|
188
|
+
storage_account_keys.secondary_key = xml_content(service_key_xml, 'Secondary')
|
189
|
+
storage_account_keys
|
190
|
+
end
|
191
|
+
|
192
|
+
def self.regenerate_storage_account_keys_to_xml(key_type)
|
193
|
+
builder = Nokogiri::XML::Builder.new do |xml|
|
194
|
+
xml.RegenerateKeys(
|
195
|
+
'xmlns' => 'http://schemas.microsoft.com/windowsazure'
|
196
|
+
) do
|
197
|
+
xml.KeyType(key_type)
|
178
198
|
end
|
179
|
-
end
|
180
|
-
|
199
|
+
end
|
200
|
+
builder.doc.to_xml
|
181
201
|
end
|
182
202
|
end
|
183
203
|
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
#--------------------------------------------------------------------------
|
15
15
|
module Azure
|
16
16
|
module StorageManagement
|
17
|
-
# Represents a
|
17
|
+
# Represents a Microsoft Azure storage account
|
18
18
|
class StorageAccount
|
19
19
|
def initialize
|
20
20
|
yield self if block_given?
|
@@ -35,6 +35,14 @@ module Azure
|
|
35
35
|
attr_accessor :status_of_secondary
|
36
36
|
attr_accessor :creation_time
|
37
37
|
attr_accessor :extended_properties
|
38
|
+
attr_accessor :account_type
|
39
|
+
end
|
40
|
+
|
41
|
+
# Represents Windows Azure storage account keys
|
42
|
+
class StorageAccountKeys
|
43
|
+
attr_accessor :url
|
44
|
+
attr_accessor :primary_key
|
45
|
+
attr_accessor :secondary_key
|
38
46
|
end
|
39
47
|
end
|
40
48
|
end
|
@@ -17,7 +17,7 @@ require 'azure/storage_management/serialization'
|
|
17
17
|
module Azure
|
18
18
|
module StorageManagement
|
19
19
|
# Provides Storage Management API
|
20
|
-
class StorageManagementService < BaseManagementService
|
20
|
+
class StorageManagementService < BaseManagement::BaseManagementService
|
21
21
|
def initialize
|
22
22
|
super()
|
23
23
|
end
|
@@ -27,7 +27,7 @@ module Azure
|
|
27
27
|
# Returns an array of Azure::StorageManagement::StorageAccount objects
|
28
28
|
def list_storage_accounts
|
29
29
|
request_path = '/services/storageservices'
|
30
|
-
request = ManagementHttpRequest.new(:get, request_path, nil)
|
30
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:get, request_path, nil)
|
31
31
|
response = request.call
|
32
32
|
Serialization.storage_services_from_xml(response)
|
33
33
|
end
|
@@ -38,20 +38,9 @@ module Azure
|
|
38
38
|
#
|
39
39
|
# * +name+ - String. Storage account name.
|
40
40
|
#
|
41
|
-
# Returns
|
42
|
-
# If true, the storage account exists. If false, the storage account
|
43
|
-
# does not exist.
|
41
|
+
# Returns an Azure::StorageManagement::StorageAccount instance
|
44
42
|
def get_storage_account(name)
|
45
|
-
|
46
|
-
flag = false
|
47
|
-
storage_accounts = list_storage_accounts
|
48
|
-
storage_accounts.each do |storage|
|
49
|
-
if storage.name == name
|
50
|
-
flag = true
|
51
|
-
break
|
52
|
-
end
|
53
|
-
end
|
54
|
-
flag
|
43
|
+
list_storage_accounts.select { |x| x.name.casecmp(name.to_s) == 0 }.first
|
55
44
|
end
|
56
45
|
|
57
46
|
# Public: Gets the properties of the storage account specified.
|
@@ -60,17 +49,17 @@ module Azure
|
|
60
49
|
#
|
61
50
|
# * +name+ - String. The name of the storage account. Required.
|
62
51
|
#
|
63
|
-
# See http://msdn.microsoft.com/en-us/library/
|
52
|
+
# See http://msdn.microsoft.com/en-us/library/azure/ee460802.aspx
|
64
53
|
#
|
65
54
|
# Returns the storage account
|
66
55
|
def get_storage_account_properties(name)
|
67
56
|
request_path = "/services/storageservices/#{name}"
|
68
|
-
request = ManagementHttpRequest.new(:get, request_path, nil)
|
57
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:get, request_path, nil)
|
69
58
|
response = request.call
|
70
59
|
Serialization.storage_services_from_xml(response).first
|
71
60
|
end
|
72
61
|
|
73
|
-
# Public: Create a new storage account in
|
62
|
+
# Public: Create a new storage account in Microsoft Azure.
|
74
63
|
#
|
75
64
|
# ==== Attributes
|
76
65
|
#
|
@@ -94,27 +83,31 @@ module Azure
|
|
94
83
|
# * +:extended_properties+ - Hash. Key/Value pairs of extended
|
95
84
|
# properties to add to the storage account. The key is used as the
|
96
85
|
# property name and the value as its value. (optional)
|
86
|
+
# * +:account_type+ - String. Specifies the type of storage account
|
97
87
|
#
|
88
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh264518.aspx
|
89
|
+
#
|
98
90
|
# Returns None
|
99
91
|
def create_storage_account(name, options = {})
|
100
92
|
raise 'Name not specified' if !name || name.class != String || name.empty?
|
93
|
+
options[:account_type] ||= 'Standard_GRS'
|
101
94
|
if get_storage_account(name)
|
102
|
-
Loggerx.warn "Storage Account #{name} already exists. Skipped..."
|
95
|
+
Azure::Loggerx.warn "Storage Account #{name} already exists. Skipped..."
|
103
96
|
else
|
104
|
-
Loggerx.info "Creating Storage Account #{name}."
|
97
|
+
Azure::Loggerx.info "Creating Storage Account #{name}."
|
105
98
|
body = Serialization.storage_services_to_xml(name, options)
|
106
99
|
request_path = '/services/storageservices'
|
107
|
-
request = ManagementHttpRequest.new(:post, request_path, body)
|
100
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:post, request_path, body)
|
108
101
|
request.call
|
109
102
|
end
|
110
103
|
end
|
111
104
|
|
112
|
-
# Public: Updates an existing storage account in
|
105
|
+
# Public: Updates an existing storage account in Microsoft Azure
|
113
106
|
#
|
114
107
|
# ==== Attributes
|
115
108
|
#
|
116
109
|
# * +name+ - String. The name of the storage service.
|
117
|
-
# * +options+ - Hash.
|
110
|
+
# * +options+ - Hash. parameters.
|
118
111
|
#
|
119
112
|
# ==== Options
|
120
113
|
#
|
@@ -126,41 +119,90 @@ module Azure
|
|
126
119
|
# Required if no label is provided. If both label and description are
|
127
120
|
# provided, only the label will get updated.
|
128
121
|
# * +:geo_replication_enabled+ - Boolean (TrueClass/FalseClass). Boolean
|
129
|
-
# flag indicating
|
122
|
+
# flag indicating whether to turn Geo replication on or off. (optional)
|
130
123
|
# * +:extended_properties+ - Hash. Key/Value pairs of extended
|
131
124
|
# properties to add to the storage account. The key is used as the
|
132
125
|
# property name and the value as its value. (optional)
|
126
|
+
# * +:account_type+ - String. Specifies the type of storage account
|
127
|
+
#
|
128
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh264516.aspx
|
133
129
|
#
|
134
130
|
# Returns None
|
135
131
|
# Fails with RuntimeError if invalid options specified
|
136
|
-
def update_storage_account(name, options
|
132
|
+
def update_storage_account(name, options)
|
137
133
|
if get_storage_account name
|
138
|
-
Loggerx.info "Account '#{name}' exists, updating..."
|
134
|
+
Azure::Loggerx.info "Account '#{name}' exists, updating..."
|
139
135
|
body = Serialization.storage_update_to_xml options
|
140
136
|
request_path = "/services/storageservices/#{name}"
|
141
|
-
request = ManagementHttpRequest.new(:put, request_path, body)
|
137
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:put, request_path, body)
|
142
138
|
request.call
|
143
139
|
else
|
144
|
-
Loggerx.warn "Storage Account '#{name}' does not exist. Skipped..."
|
140
|
+
Azure::Loggerx.warn "Storage Account '#{name}' does not exist. Skipped..."
|
145
141
|
end
|
146
142
|
end
|
147
143
|
|
148
144
|
# Public: Deletes the specified storage account of given subscription id
|
149
|
-
# from
|
145
|
+
# from Microsoft Azure.
|
150
146
|
#
|
151
147
|
# ==== Attributes
|
152
148
|
#
|
153
149
|
# * +name+ - String. Storage account name.
|
154
150
|
#
|
151
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh264517.aspx
|
152
|
+
#
|
155
153
|
# Returns: None
|
156
154
|
def delete_storage_account(name)
|
157
|
-
Loggerx.info "Deleting Storage Account #{name}."
|
155
|
+
Azure::Loggerx.info "Deleting Storage Account #{name}."
|
158
156
|
request_path = "/services/storageservices/#{name}"
|
159
|
-
request = ManagementHttpRequest.new(:delete, request_path)
|
157
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:delete, request_path)
|
160
158
|
request.call
|
161
|
-
rescue
|
159
|
+
rescue => e
|
162
160
|
e.message
|
163
161
|
end
|
162
|
+
|
163
|
+
# Public: Regenerates the primary or secondary access key for the specified storage account
|
164
|
+
#
|
165
|
+
# ==== Attributes
|
166
|
+
#
|
167
|
+
# * +name+ - String. Storage account name.
|
168
|
+
# * +key_type+ - String. Specifies which key(primary or secondary) to regenerate
|
169
|
+
#
|
170
|
+
# Returns an Azure::StorageManagement::StorageAccountKeys instance.
|
171
|
+
#
|
172
|
+
# See:
|
173
|
+
# http://msdn.microsoft.com/en-us/library/azure/ee460795.aspx
|
174
|
+
def regenerate_storage_account_keys(name, key_type = 'primary')
|
175
|
+
if get_storage_account name
|
176
|
+
path = "/services/storageservices/#{name}/keys?action=regenerate"
|
177
|
+
body = Serialization.regenerate_storage_account_keys_to_xml key_type
|
178
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:post, path, body)
|
179
|
+
response = request.call
|
180
|
+
Serialization.storage_account_keys_from_xml(response)
|
181
|
+
else
|
182
|
+
Azure::Loggerx.warn "Storage Account '#{name}' does not exist."
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Public: Gets the primary and secondary access keys for the specified storage account.
|
187
|
+
#
|
188
|
+
# ==== Attributes
|
189
|
+
#
|
190
|
+
# * +name+ - String. Storage account name.
|
191
|
+
#
|
192
|
+
# Returns an Azure::StorageManagement::StorageAccountKeys instance.
|
193
|
+
#
|
194
|
+
# See:
|
195
|
+
# http://msdn.microsoft.com/en-us/library/azure/ee460785.aspx
|
196
|
+
def get_storage_account_keys(name)
|
197
|
+
if get_storage_account name
|
198
|
+
path = "/services/storageservices/#{name}/keys"
|
199
|
+
request = Azure::BaseManagement::ManagementHttpRequest.new(:get, path)
|
200
|
+
response = request.call
|
201
|
+
Serialization.storage_account_keys_from_xml(response)
|
202
|
+
else
|
203
|
+
Azure::Loggerx.warn "Storage Account '#{name}' does not exist."
|
204
|
+
end
|
205
|
+
end
|
164
206
|
end
|
165
207
|
end
|
166
208
|
end
|
data/lib/azure/table/batch.rb
CHANGED
@@ -201,7 +201,7 @@ module Azure
|
|
201
201
|
# * +row_key+ - String. The row key
|
202
202
|
# * +entity_values+ - Hash. A hash of the name/value pairs for the entity.
|
203
203
|
#
|
204
|
-
# See http://msdn.microsoft.com/en-us/library/
|
204
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179433
|
205
205
|
public
|
206
206
|
def insert(row_key, entity_values)
|
207
207
|
check_entity_key(row_key)
|
@@ -231,7 +231,7 @@ module Azure
|
|
231
231
|
# * :create_if_not_exists - Boolean. If true, and partition_key and row_key do not reference and existing entity,
|
232
232
|
# that entity will be inserted. If false, the operation will fail. (optional, Default=false)
|
233
233
|
#
|
234
|
-
# See http://msdn.microsoft.com/en-us/library/
|
234
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179427
|
235
235
|
public
|
236
236
|
def update(row_key, entity_values, options={})
|
237
237
|
check_entity_key(row_key)
|
@@ -263,7 +263,7 @@ module Azure
|
|
263
263
|
# * +create_if_not_exists+ - Boolean. If true, and partition_key and row_key do not reference and existing entity,
|
264
264
|
# that entity will be inserted. If false, the operation will fail. (optional, Default=false)
|
265
265
|
#
|
266
|
-
# See http://msdn.microsoft.com/en-us/library/
|
266
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179392
|
267
267
|
public
|
268
268
|
def merge(row_key, entity_values, options={})
|
269
269
|
check_entity_key(row_key)
|
@@ -286,7 +286,7 @@ module Azure
|
|
286
286
|
# * +row_key+ - String. The row key
|
287
287
|
# * +entity_values+ - Hash. A hash of the name/value pairs for the entity.
|
288
288
|
#
|
289
|
-
# See http://msdn.microsoft.com/en-us/library/
|
289
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh452241
|
290
290
|
public
|
291
291
|
def insert_or_merge(row_key, entity_values)
|
292
292
|
merge(row_key, entity_values, { :create_if_not_exists => true })
|
@@ -300,7 +300,7 @@ module Azure
|
|
300
300
|
# * +row_key+ - String. The row key
|
301
301
|
# * +entity_values+ - Hash. A hash of the name/value pairs for the entity.
|
302
302
|
#
|
303
|
-
# See http://msdn.microsoft.com/en-us/library/
|
303
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh452242
|
304
304
|
public
|
305
305
|
def insert_or_replace(row_key, entity_values)
|
306
306
|
update(row_key, entity_values, { :create_if_not_exists => true })
|
@@ -319,7 +319,7 @@ module Azure
|
|
319
319
|
# Accepted key/value pairs in options parameter are:
|
320
320
|
# * +if_match+ - String. A matching condition which is required for update (optional, Default="*")
|
321
321
|
#
|
322
|
-
# See http://msdn.microsoft.com/en-us/library/
|
322
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd135727
|
323
323
|
public
|
324
324
|
def delete(row_key, options={})
|
325
325
|
add_operation(:delete, @table_service.entities_uri(table, partition, row_key), nil, {"If-Match"=> options[:if_match] || "*"})
|
@@ -41,7 +41,7 @@ module Azure
|
|
41
41
|
#
|
42
42
|
# * +:timeout+ - Integer. A timeout in seconds.
|
43
43
|
#
|
44
|
-
# See http://msdn.microsoft.com/en-us/library/
|
44
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd135729
|
45
45
|
#
|
46
46
|
# Returns nil on success
|
47
47
|
def create_table(table_name, options={})
|
@@ -65,7 +65,7 @@ module Azure
|
|
65
65
|
# Accepted key/value pairs in options parameter are:
|
66
66
|
# * +:timeout+ - Integer. A timeout in seconds.
|
67
67
|
#
|
68
|
-
# See http://msdn.microsoft.com/en-us/library/
|
68
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179387
|
69
69
|
#
|
70
70
|
# Returns nil on success
|
71
71
|
def delete_table(table_name, options={})
|
@@ -111,7 +111,7 @@ module Azure
|
|
111
111
|
# larger than a single operation can return at once. (optional)
|
112
112
|
# * +:timeout+ - Integer. A timeout in seconds.
|
113
113
|
#
|
114
|
-
# See http://msdn.microsoft.com/en-us/library/
|
114
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179405
|
115
115
|
#
|
116
116
|
# Returns an array with an extra continuation_token property on success
|
117
117
|
def query_tables(options={})
|
@@ -141,7 +141,7 @@ module Azure
|
|
141
141
|
# Accepted key/value pairs in options parameter are:
|
142
142
|
# * +:timeout+ - Integer. A timeout in seconds.
|
143
143
|
#
|
144
|
-
# See http://msdn.microsoft.com/en-us/library/
|
144
|
+
# See http://msdn.microsoft.com/en-us/library/azure/jj159100
|
145
145
|
#
|
146
146
|
# Returns a list of Azure::Entity::SignedIdentifier instances
|
147
147
|
def get_table_acl(table_name, options={})
|
@@ -168,7 +168,7 @@ module Azure
|
|
168
168
|
# * +:signed_identifiers+ - Array. A list of Azure::Entity::SignedIdentifier instances
|
169
169
|
# * +:timeout+ - Integer. A timeout in seconds.
|
170
170
|
#
|
171
|
-
# See http://msdn.microsoft.com/en-us/library/
|
171
|
+
# See http://msdn.microsoft.com/en-us/library/azure/jj159102
|
172
172
|
#
|
173
173
|
# Returns nil on success
|
174
174
|
def set_table_acl(table_name, options={})
|
@@ -197,7 +197,7 @@ module Azure
|
|
197
197
|
# Accepted key/value pairs in options parameter are:
|
198
198
|
# * +:timeout+ - Integer. A timeout in seconds.
|
199
199
|
#
|
200
|
-
# See http://msdn.microsoft.com/en-us/library/
|
200
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179433
|
201
201
|
#
|
202
202
|
# Returns a Azure::Entity::Table::Entity
|
203
203
|
def insert_entity(table_name, entity_values, options={})
|
@@ -236,7 +236,7 @@ module Azure
|
|
236
236
|
# * +:continuation_token+ - Hash. The continuation token.
|
237
237
|
# * +:timeout+ - Integer. A timeout in seconds.
|
238
238
|
#
|
239
|
-
# See http://msdn.microsoft.com/en-us/library/
|
239
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179421
|
240
240
|
#
|
241
241
|
# Returns an array with an extra continuation_token property on success
|
242
242
|
def query_entities(table_name, options={})
|
@@ -291,7 +291,7 @@ module Azure
|
|
291
291
|
# that entity will be inserted. If false, the operation will fail. (optional, Default=false)
|
292
292
|
# * +:timeout+ - Integer. A timeout in seconds.
|
293
293
|
#
|
294
|
-
# See http://msdn.microsoft.com/en-us/library/
|
294
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179427
|
295
295
|
#
|
296
296
|
# Returns the ETag for the entity on success
|
297
297
|
def update_entity(table_name, entity_values, options={})
|
@@ -329,7 +329,7 @@ module Azure
|
|
329
329
|
# that entity will be inserted. If false, the operation will fail. (optional, Default=false)
|
330
330
|
# * +:timeout+ - Integer. A timeout in seconds.
|
331
331
|
#
|
332
|
-
# See http://msdn.microsoft.com/en-us/library/
|
332
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd179392
|
333
333
|
#
|
334
334
|
# Returns the ETag for the entity on success
|
335
335
|
def merge_entity(table_name, entity_values, options={})
|
@@ -363,7 +363,7 @@ module Azure
|
|
363
363
|
# Accepted key/value pairs in options parameter are:
|
364
364
|
# * +:timeout+ - Integer. A timeout in seconds.
|
365
365
|
#
|
366
|
-
# See http://msdn.microsoft.com/en-us/library/
|
366
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh452241
|
367
367
|
#
|
368
368
|
# Returns the ETag for the entity on success
|
369
369
|
def insert_or_merge_entity(table_name, entity_values, options={})
|
@@ -384,7 +384,7 @@ module Azure
|
|
384
384
|
# Accepted key/value pairs in options parameter are:
|
385
385
|
# * +:timeout+ - Integer. A timeout in seconds.
|
386
386
|
#
|
387
|
-
# See http://msdn.microsoft.com/en-us/library/
|
387
|
+
# See http://msdn.microsoft.com/en-us/library/azure/hh452242
|
388
388
|
#
|
389
389
|
# Returns the ETag for the entity on success
|
390
390
|
def insert_or_replace_entity(table_name, entity_values, options={})
|
@@ -407,7 +407,7 @@ module Azure
|
|
407
407
|
# * +:if_match+ - String. A matching condition which is required for update (optional, Default="*")
|
408
408
|
# * +:timeout+ - Integer. A timeout in seconds.
|
409
409
|
#
|
410
|
-
# See http://msdn.microsoft.com/en-us/library/
|
410
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd135727
|
411
411
|
#
|
412
412
|
# Returns nil on success
|
413
413
|
def delete_entity(table_name, partition_key, row_key, options={})
|
@@ -433,7 +433,7 @@ module Azure
|
|
433
433
|
# Accepted key/value pairs in options parameter are:
|
434
434
|
# * +:timeout+ - Integer. A timeout in seconds.
|
435
435
|
#
|
436
|
-
# See http://msdn.microsoft.com/en-us/library/
|
436
|
+
# See http://msdn.microsoft.com/en-us/library/azure/dd894038
|
437
437
|
#
|
438
438
|
# Returns an array of results, one for each operation in the batch
|
439
439
|
def execute_batch(batch, options={})
|