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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.env_sample +11 -0
  3. data/.gitignore +4 -1
  4. data/.travis.yml +3 -1
  5. data/ChangeLog.txt +17 -1
  6. data/LICENSE.txt +202 -0
  7. data/README.md +58 -20
  8. data/Rakefile +27 -35
  9. data/azure.gemspec +17 -13
  10. data/bin/pfxer +35 -0
  11. data/lib/azure.rb +8 -0
  12. data/lib/azure/base_management/base_management_service.rb +24 -26
  13. data/lib/azure/base_management/management_http_request.rb +17 -14
  14. data/lib/azure/base_management/serialization.rb +1 -0
  15. data/lib/azure/blob/auth/shared_access_signature.rb +141 -0
  16. data/lib/azure/blob/blob_service.rb +221 -217
  17. data/lib/azure/cloud_service_management/cloud_service_management_service.rb +27 -30
  18. data/lib/azure/cloud_service_management/serialization.rb +1 -0
  19. data/lib/azure/core.rb +17 -15
  20. data/lib/azure/core/configuration.rb +7 -0
  21. data/lib/azure/core/http/http_error.rb +1 -1
  22. data/lib/azure/core/http/http_request.rb +4 -1
  23. data/lib/azure/core/utility.rb +16 -1
  24. data/lib/azure/queue/queue_service.rb +13 -13
  25. data/lib/azure/service/cors.rb +11 -0
  26. data/lib/azure/service/cors_rule.rb +15 -0
  27. data/lib/azure/service/serialization.rb +69 -10
  28. data/lib/azure/service/storage_service.rb +10 -6
  29. data/lib/azure/service/storage_service_properties.rb +8 -3
  30. data/lib/azure/service_bus/brokered_message.rb +1 -1
  31. data/lib/azure/service_bus/relay.rb +88 -0
  32. data/lib/azure/service_bus/serialization.rb +1 -0
  33. data/lib/azure/service_bus/service_bus_service.rb +70 -4
  34. data/lib/azure/sql_database_management/serialization.rb +1 -0
  35. data/lib/azure/sql_database_management/sql_database_management_service.rb +22 -22
  36. data/lib/azure/storage_management/serialization.rb +34 -14
  37. data/lib/azure/storage_management/storage_account.rb +9 -1
  38. data/lib/azure/storage_management/storage_management_service.rb +74 -32
  39. data/lib/azure/table/batch.rb +6 -6
  40. data/lib/azure/table/table_service.rb +13 -13
  41. data/lib/azure/version.rb +3 -3
  42. data/lib/azure/virtual_machine_image_management/serialization.rb +19 -0
  43. data/lib/azure/virtual_machine_image_management/virtual_machine_image.rb +1 -1
  44. data/lib/azure/virtual_machine_image_management/virtual_machine_image_management_service.rb +30 -7
  45. data/lib/azure/virtual_machine_management/serialization.rb +32 -12
  46. data/lib/azure/virtual_machine_management/virtual_machine.rb +1 -0
  47. data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +92 -81
  48. data/lib/azure/virtual_network_management/serialization.rb +12 -5
  49. data/lib/azure/virtual_network_management/virtual_network.rb +1 -0
  50. data/lib/azure/virtual_network_management/virtual_network_management_service.rb +11 -11
  51. data/test/fixtures/get_storage_account_properties.xml +6 -4
  52. data/test/fixtures/{list_images.xml → list_os_images.xml} +1 -1
  53. data/test/fixtures/list_storage_accounts.xml +2 -0
  54. data/test/fixtures/list_vm_images.xml +21 -0
  55. data/test/fixtures/metrics.xml +2 -2
  56. data/test/fixtures/sb_default_create_relay_response.xml +15 -0
  57. data/test/fixtures/storage_service_keys.xml +8 -0
  58. data/test/fixtures/storage_service_properties.xml +35 -3
  59. data/test/fixtures/updated_storage_accounts.xml +2 -0
  60. data/test/fixtures/virtual_machine.xml +3 -1
  61. data/test/integration/affinity_group/Affinity_test.rb +1 -1
  62. data/test/integration/affinity_group/Create_Affinity_test.rb +8 -7
  63. data/test/integration/affinity_group/Delete_Affinity_test.rb +3 -3
  64. data/test/integration/affinity_group/List_Affinity_test.rb +1 -1
  65. data/test/integration/affinity_group/Update_Affinity_test.rb +9 -8
  66. data/test/integration/cloud_service/Cloud_Create_test.rb +3 -2
  67. data/test/integration/cloud_service/Cloud_Delete_test.rb +5 -4
  68. data/test/integration/database/create_sql_server_firewall_test.rb +1 -1
  69. data/test/integration/database/create_sql_server_test.rb +1 -1
  70. data/test/integration/database/delete_sql_server_firewall_test.rb +1 -1
  71. data/test/integration/database/delete_sql_server_test.rb +1 -1
  72. data/test/integration/database/list_sql_server_firewall_test.rb +1 -1
  73. data/test/integration/database/list_sql_servers_test.rb +1 -1
  74. data/test/integration/database/reset_password_sql_server_test.rb +1 -1
  75. data/test/integration/service_bus/queues_test.rb +22 -22
  76. data/test/integration/service_bus/relay_test.rb +132 -0
  77. data/test/integration/storage_management/storage_management_test.rb +58 -33
  78. data/test/integration/test_helper.rb +11 -15
  79. data/test/integration/vm/VM_Create_test.rb +17 -18
  80. data/test/integration/vm/VM_Delete_test.rb +2 -4
  81. data/test/integration/vm/VM_Operations_test.rb +1 -2
  82. data/test/integration/vnet/Virtual_Network_Create_test.rb +9 -15
  83. data/test/integration/vnet/Virtual_Network_list_test.rb +4 -9
  84. data/test/support/name_generator.rb +8 -0
  85. data/test/support/virtual_network_helper.rb +2 -2
  86. data/test/test_helper.rb +13 -24
  87. data/test/unit/affinity_group/affinity_group_test.rb +10 -13
  88. data/test/unit/affinity_group/serialization_test.rb +7 -8
  89. data/test/unit/base_management/location_test.rb +1 -2
  90. data/test/unit/blob/auth/shared_access_signature_test.rb +71 -0
  91. data/test/unit/blob/blob_service_test.rb +393 -371
  92. data/test/unit/cloud_service_management/cloud_service_management_service_test.rb +16 -16
  93. data/test/unit/core/auth/shared_key_lite_test.rb +4 -4
  94. data/test/unit/core/auth/shared_key_test.rb +2 -2
  95. data/test/unit/core/http/http_error_test.rb +10 -5
  96. data/test/unit/core/http/http_request_test.rb +72 -25
  97. data/test/unit/database/serialization_test.rb +7 -7
  98. data/test/unit/database/sql_database_server_service_test.rb +43 -47
  99. data/test/unit/service/serialization_test.rb +40 -9
  100. data/test/unit/service/storage_service_test.rb +13 -11
  101. data/test/unit/storage_management/serialization_test.rb +26 -14
  102. data/test/unit/storage_management/storage_management_service_test.rb +48 -62
  103. data/test/unit/virtual_machine_image_management/serialization_test.rb +20 -5
  104. data/test/unit/virtual_machine_image_management/virtual_machine_image_management_service_test.rb +78 -29
  105. data/test/unit/virtual_machine_management/serialization_test.rb +112 -43
  106. data/test/unit/virtual_machine_management/virtual_machine_management_service_test.rb +123 -100
  107. data/test/unit/vnet/serialization_test.rb +7 -7
  108. data/test/unit/vnet/virtual_network_management_service_test.rb +1 -1
  109. metadata +70 -16
  110. data/test/fixtures/certificate.pem +0 -21
@@ -29,13 +29,13 @@ module Azure
29
29
 
30
30
  # Public: Get Storage Service properties
31
31
  #
32
- # See http://msdn.microsoft.com/en-us/library/windowsazure/hh452239
33
- # See http://msdn.microsoft.com/en-us/library/windowsazure/hh452243
32
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452239
33
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452243
34
34
  #
35
35
  # Returns a Hash with the service properties or nil if the operation failed
36
36
  def get_service_properties
37
37
  uri = service_properties_uri
38
- response = call(:get, uri)
38
+ response = call(:get, uri, nil, service_properties_headers)
39
39
  Serialization.service_properties_from_xml response.body
40
40
  end
41
41
 
@@ -43,15 +43,15 @@ module Azure
43
43
  #
44
44
  # service_properties - An instance of Azure::Entity::Service::StorageServiceProperties
45
45
  #
46
- # See http://msdn.microsoft.com/en-us/library/windowsazure/hh452235
47
- # See http://msdn.microsoft.com/en-us/library/windowsazure/hh452232
46
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452235
47
+ # See http://msdn.microsoft.com/en-us/library/azure/hh452232
48
48
  #
49
49
  # Returns boolean indicating success.
50
50
  def set_service_properties(service_properties)
51
51
  body = Serialization.service_properties_to_xml service_properties
52
52
 
53
53
  uri = service_properties_uri
54
- call(:put, uri, body)
54
+ call(:put, uri, body, service_properties_headers)
55
55
  nil
56
56
  end
57
57
 
@@ -74,6 +74,10 @@ module Azure
74
74
  headers["x-ms-meta-#{key}"] = value
75
75
  end
76
76
  end
77
+
78
+ def service_properties_headers
79
+ {"x-ms-version" => "2013-08-15"}
80
+ end
77
81
  end
78
82
  end
79
83
  end
@@ -14,19 +14,24 @@
14
14
  #--------------------------------------------------------------------------
15
15
  require 'azure/service/logging'
16
16
  require 'azure/service/metrics'
17
+ require 'azure/service/cors'
17
18
 
18
19
  module Azure
19
20
  module Service
20
21
  class StorageServiceProperties
21
22
  def initialize
22
23
  @logging = Logging.new
23
- @metrics = Metrics.new
24
+ @hour_metrics = Metrics.new
25
+ @minute_metrics = Metrics.new
26
+ @cors = Cors.new
24
27
  yield self if block_given?
25
28
  end
26
29
 
27
30
  attr_accessor :logging
28
- attr_accessor :metrics
31
+ attr_accessor :hour_metrics
32
+ attr_accessor :minute_metrics
33
+ attr_accessor :cors
29
34
  attr_accessor :default_service_version
30
35
  end
31
36
  end
32
- end
37
+ end
@@ -16,7 +16,7 @@ module Azure
16
16
  module ServiceBus
17
17
  class BrokeredMessage
18
18
 
19
- # Please read http://msdn.microsoft.com/en-us/library/windowsazure/hh780742
19
+ # Please read http://msdn.microsoft.com/en-us/library/azure/hh780742
20
20
  # for more information on brokered message properties
21
21
 
22
22
  # Public: Get/Set the ContentType of the message
@@ -0,0 +1,88 @@
1
+ #-------------------------------------------------------------------------
2
+ # # Copyright (c) Microsoft and contributors. All rights reserved.
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #--------------------------------------------------------------------------
15
+ require 'azure/service_bus/resource'
16
+
17
+ module Azure
18
+ module ServiceBus
19
+ class Relay < Resource
20
+ # Public: Initialize the relay endpoint.
21
+ #
22
+ # ==== Attributes
23
+ #
24
+ # * +name+ - A String with the name of the relay endpoint.
25
+ # * +options+ - The resource options Hash
26
+ #
27
+ # ==== Options
28
+ #
29
+ # Accepted key/value pairs in options parameter are:
30
+ # * +:relay_type+ - String. Determines the type of the relay endpoint. This is required.
31
+ # * +:requires_client_authorization+ - Boolean. Determines whether or not clients need to authenticate when making calls.
32
+ # * +:requires_transport_security+ - Boolean. Determines whether or not the endpoint uses transport security.
33
+ #
34
+ def initialize(name, options = {})
35
+ normalized_options = {}
36
+ normalized_options["RelayType"] = options[:relay_type].to_s
37
+ normalized_options["RequiresClientAuthorization"] = options[:requires_client_authorization].to_s if options.has_key?(:requires_client_authorization)
38
+ normalized_options["RequiresTransportSecurity"] = options[:requires_transport_security].to_s if options.has_key?(:requires_transport_security)
39
+ super(name, normalized_options)
40
+ end
41
+
42
+ # RelayType: String
43
+ #
44
+ # Displays the relay type of the endpoint.
45
+ def relay_type
46
+ description['RelayType']
47
+ end
48
+
49
+ def relay_type=(val)
50
+ _set 'RelayType', val
51
+ end
52
+
53
+ # RequiresClientAuthorization: Boolean
54
+ #
55
+ # Determines whether or not clients need to authenticate when making calls.
56
+ #
57
+ # Default: true
58
+ def requires_client_authorization
59
+ to_bool description['RequiresClientAuthorization']
60
+ end
61
+
62
+ def requires_client_authorization=(val)
63
+ _set 'RequiresClientAuthorization', val
64
+ end
65
+
66
+ # RequiresTransportSecurity: Boolean
67
+ #
68
+ # Determines whether or not the endpoint uses transport security.
69
+ #
70
+ # Default: true
71
+ def requires_transport_security
72
+ to_bool description['RequiresTransportSecurity']
73
+ end
74
+
75
+ def requires_transport_security=(val)
76
+ _set 'RequiresTransportSecurity', val
77
+ end
78
+
79
+ def ordered_props
80
+ [
81
+ 'RelayType',
82
+ 'RequiresClientAuthorization',
83
+ 'RequiresTransportSecurity'
84
+ ]
85
+ end
86
+ end
87
+ end
88
+ end
@@ -18,6 +18,7 @@ require "azure/service_bus/queue"
18
18
  require "azure/service_bus/topic"
19
19
  require "azure/service_bus/subscription"
20
20
  require "azure/service_bus/rule"
21
+ require "azure/service_bus/relay"
21
22
 
22
23
  require "azure/service/enumeration_results"
23
24
 
@@ -34,10 +34,67 @@ module Azure
34
34
  req.headers.delete "x-ms-version"
35
35
  req.headers.delete "DataServiceVersion"
36
36
  req.headers.delete "MaxDataServiceVersion"
37
+ req.headers["X-Process-At"] = "servicebus"
37
38
  res.call
38
39
  end
39
40
  end
40
41
 
42
+ # Creates a new relay endpoint. Once created, this relay endpoint resource manifest is immutable.
43
+ #
44
+ # ==== Attributes
45
+ #
46
+ # * +relay+ - Azure::ServiceBus::Relay instance to create on server, or a string of the relay endpoint name
47
+ # * +options+ - Hash. The relay endpoint properties.
48
+ #
49
+ # ==== Options
50
+ #
51
+ # Accepted key/value pairs in options parameter are:
52
+ # * +:relay_type+ - String. Determines the type of the relay endpoint.
53
+ # * +:requires_client_authorization+ - Boolean. Determines whether or not clients need to authenticate when making calls.
54
+ # * +:requires_transport_security+ - Boolean. Determines whether or not the endpoint uses transport security.
55
+ #
56
+ def create_relay(relay, options={})
57
+ relay = _new_or_existing(Azure::ServiceBus::Relay, relay, options ? options : {})
58
+ create_resource_entry(:relay, relay, relay.name)
59
+ end
60
+
61
+ # Deletes an existing relay endpoint.
62
+ #
63
+ # ==== Attributes
64
+ #
65
+ # * +relay+ - Azure::ServiceBus::Relay instance to delete or a string of the relay endpoint name
66
+ def delete_relay(relay)
67
+ delete_resource_entry(:relay, _name_for(relay))
68
+ end
69
+
70
+ # Retrieves the description for the specified relay endpoint.
71
+ #
72
+ # ==== Attributes
73
+ #
74
+ # * +relay+ - Azure::ServiceBus::Relay instance to retrieve or a string of the relay endpoint name
75
+ def get_relay(relay)
76
+ resource_entry(:relay, _name_for(relay))
77
+ end
78
+
79
+ # Enumerates the relay endpoints in the service namespace.
80
+ #
81
+ # ==== Attributes
82
+ #
83
+ # * +options+ - Hash. Optional parameters.
84
+ #
85
+ # ==== Options
86
+ #
87
+ # Accepted key/value pairs in options parameter are:
88
+ # * +:skip+ - Integer. Number of queues to skip.
89
+ # * +:top+ - Integer. Number of queues to list.
90
+ def list_relays(options={})
91
+ query = {}
92
+ query["$skip"] = options[:skip].to_i.to_s if options[:skip]
93
+ query["$top"] = options[:top].to_i.to_s if options[:top]
94
+
95
+ resource_list(:relay, query)
96
+ end
97
+
41
98
  # Creates a new queue. Once created, this queue's resource manifest is immutable.
42
99
  #
43
100
  # ==== Attributes
@@ -510,8 +567,7 @@ module Azure
510
567
  # * +:timeout+ - Integer. Timeout for the REST call.
511
568
  #
512
569
  def receive_queue_message(queue, options={})
513
- peek_lock = true
514
- peek_lock = options[:peek_lock] if options[:peek_lock]
570
+ peek_lock = options.fetch(:peek_lock, true)
515
571
 
516
572
  options[:timeout] = options[:timeout] ? options[:timeout] : DEFAULT_TIMEOUT
517
573
  if peek_lock
@@ -535,8 +591,7 @@ module Azure
535
591
  # * +:timeout+ - Integer. Timeout for the REST call.
536
592
  #
537
593
  def receive_subscription_message(topic, subscription, options={})
538
- peek_lock = true
539
- peek_lock = options[:peek_lock] if options[:peek_lock]
594
+ peek_lock = options.fetch(:peek_lock, true)
540
595
 
541
596
  options[:timeout] = options[:timeout] ? options[:timeout] : DEFAULT_TIMEOUT
542
597
  if peek_lock
@@ -782,6 +837,12 @@ module Azure
782
837
  generate_uri(subscriptions_path(topic, subscription), query)
783
838
  end
784
839
 
840
+ protected
841
+ def relay_uri(relay, query={})
842
+ query["api-version"] = "2013-10"
843
+ generate_uri(relay, query)
844
+ end
845
+
785
846
  protected
786
847
  def queue_uri(topic, query={})
787
848
  generate_uri(topic, query)
@@ -804,6 +865,11 @@ module Azure
804
865
  resource_list_uri(:subscription, query, topic)
805
866
  end
806
867
 
868
+ protected
869
+ def relay_list_uri(query={})
870
+ resource_list_uri(:relay, query)
871
+ end
872
+
807
873
  protected
808
874
  def queue_list_uri(query={})
809
875
  resource_list_uri(:queue, query)
@@ -17,6 +17,7 @@ require 'azure/sql_database_management/sql_database'
17
17
  module Azure
18
18
  module SqlDatabaseManagement
19
19
  module Serialization
20
+ extend Azure::Core::Utility
20
21
 
21
22
  def self.database_to_xml(login, password, location)
22
23
  builder = Nokogiri::XML::Builder.new do |xml|
@@ -16,7 +16,7 @@ require 'azure/sql_database_management/serialization'
16
16
 
17
17
  module Azure
18
18
  module SqlDatabaseManagement
19
- class SqlDatabaseManagementService < BaseManagementService
19
+ class SqlDatabaseManagementService < BaseManagement::BaseManagementService
20
20
 
21
21
  def initialize
22
22
  super()
@@ -25,17 +25,17 @@ module Azure
25
25
  # Public: Gets a list of database servers available under the
26
26
  # current subscription.
27
27
  #
28
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715269.aspx
28
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715269.aspx
29
29
  #
30
30
  # Returns an array of Azure::SqlDatabaseManagement::SqlDatabase objects
31
31
  def list_servers
32
32
  request_path = '/servers'
33
- request = SqlManagementHttpRequest.new(:get, request_path, nil)
33
+ request = BaseManagement::SqlManagementHttpRequest.new(:get, request_path, nil)
34
34
  response = request.call
35
35
  Serialization.databases_from_xml(response)
36
36
  end
37
37
 
38
- # Public: Create a new database server in Windows Azure.
38
+ # Public: Create a new database server in Microsoft Azure.
39
39
  #
40
40
  # ==== Attributes
41
41
  #
@@ -43,35 +43,35 @@ module Azure
43
43
  # * +password+ - String. The administrator login password.
44
44
  # * +:location+ - String. The location where the database server will be created.
45
45
  #
46
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715274.aspx
46
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715274.aspx
47
47
  #
48
48
  # Returns Azure::SqlDatabaseManagement::SqlDatabase object
49
49
  def create_server(login, password, location)
50
50
  body = Serialization.database_to_xml(login, password, location)
51
51
  request_path = '/servers'
52
- request = SqlManagementHttpRequest.new(:post, request_path, body)
52
+ request = BaseManagement::SqlManagementHttpRequest.new(:post, request_path, body)
53
53
  response = request.call
54
54
  sql_server = Serialization.server_name_from_xml(response, login, location)
55
- Loggerx.info "SQL database server #{sql_server.name} is created." if sql_server
55
+ Azure::Loggerx.info "SQL database server #{sql_server.name} is created." if sql_server
56
56
  sql_server
57
57
  end
58
58
 
59
59
  # Public: Deletes the specified database server of given
60
- # subscription id from Windows Azure.
60
+ # subscription id from Microsoft Azure.
61
61
  #
62
62
  # ==== Attributes
63
63
  #
64
64
  # * +name+ - String. Database server name.
65
65
  #
66
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715285.aspx
66
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715285.aspx
67
67
  #
68
68
  # Returns: None
69
69
  def delete_server(name)
70
70
  if get_sql_server(name)
71
71
  request_path = "/servers/#{name}"
72
- request = SqlManagementHttpRequest.new(:delete, request_path)
72
+ request = BaseManagement::SqlManagementHttpRequest.new(:delete, request_path)
73
73
  request.call
74
- Loggerx.info "Deleted database server #{name}."
74
+ Azure::Loggerx.info "Deleted database server #{name}."
75
75
  end
76
76
  end
77
77
 
@@ -83,16 +83,16 @@ module Azure
83
83
  # * +name+ - String. Database server name.
84
84
  # * +password+ - String. Database server new password.
85
85
  #
86
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715272.aspx
86
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715272.aspx
87
87
  #
88
88
  # Returns: None
89
89
  def reset_password(name, password)
90
90
  if get_sql_server(name)
91
91
  body = Serialization.reset_password_to_xml(password)
92
92
  request_path = "/servers/#{name}?op=ResetPassword"
93
- request = SqlManagementHttpRequest.new(:post, request_path, body)
93
+ request = BaseManagement::SqlManagementHttpRequest.new(:post, request_path, body)
94
94
  request.call
95
- Loggerx.info "Password for server #{name} changed successfully."
95
+ Azure::Loggerx.info "Password for server #{name} changed successfully."
96
96
  end
97
97
  end
98
98
 
@@ -111,7 +111,7 @@ module Azure
111
111
  # * +:start_ip_address+ - String. Start of the IP Range
112
112
  # * +:end_ip_address+ - String. End of the IP Range
113
113
  #
114
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715280.aspx
114
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715280.aspx
115
115
  #
116
116
  # Returns: None
117
117
  def set_sql_server_firewall_rule(server_name, rule_name, options = {})
@@ -127,14 +127,14 @@ module Azure
127
127
  request_path = "/servers/#{server_name}/firewallrules/#{rule_name}?op=AutoDetectClientIP"
128
128
  method = :post
129
129
  end
130
- request = SqlManagementHttpRequest.new(method, request_path, body)
130
+ request = BaseManagement::SqlManagementHttpRequest.new(method, request_path, body)
131
131
  request.headers['x-ms-version'] = '1.0'
132
132
  request.uri = URI.parse(Azure.config.sql_database_management_endpoint + Azure.config.subscription_id + request_path)
133
133
  # Management certificate authentication Endpoint throws errors for this operation. Need to re-visit
134
134
  # this once the Azure API is working.
135
135
 
136
136
  request.call
137
- Loggerx.info "Added server-level firewall rule #{rule_name}."
137
+ Azure::Loggerx.info "Added server-level firewall rule #{rule_name}."
138
138
  end
139
139
  end
140
140
 
@@ -145,13 +145,13 @@ module Azure
145
145
  #
146
146
  # * +server_name+ - String. Database server name.
147
147
  #
148
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715278.aspx
148
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715278.aspx
149
149
  #
150
150
  # Returns an array of firewall
151
151
  def list_sql_server_firewall_rules(server_name)
152
152
  if get_sql_server(server_name)
153
153
  request_path = "/servers/#{server_name}/firewallrules"
154
- request = SqlManagementHttpRequest.new(:get, request_path)
154
+ request = BaseManagement::SqlManagementHttpRequest.new(:get, request_path)
155
155
  response = request.call
156
156
  Serialization.database_firewall_from_xml(response)
157
157
  end
@@ -164,7 +164,7 @@ module Azure
164
164
  # * +name+ - String. SQL database server name.
165
165
  # * +rule_name+ - String. SQL database server firewall rule name.
166
166
  #
167
- # See http://msdn.microsoft.com/en-us/library/windowsazure/gg715277.aspx
167
+ # See http://msdn.microsoft.com/en-us/library/azure/gg715277.aspx
168
168
  #
169
169
  # Returns: None
170
170
  def delete_sql_server_firewall_rule(server_name, rule_name)
@@ -173,9 +173,9 @@ module Azure
173
173
  raise error
174
174
  elsif get_sql_server(server_name)
175
175
  request_path = "/servers/#{server_name}/firewallrules/#{rule_name}"
176
- request = SqlManagementHttpRequest.new(:delete, request_path)
176
+ request = BaseManagement::SqlManagementHttpRequest.new(:delete, request_path)
177
177
  request.call
178
- Loggerx.info "Deleted server-level firewall rule #{rule_name}."
178
+ Azure::Loggerx.info "Deleted server-level firewall rule #{rule_name}."
179
179
  end
180
180
  end
181
181