azure_mgmt_service_bus 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_create_or_update_parameters.rb +0 -12
  3. data/lib/2015-08-01/generated/azure_mgmt_service_bus/models/topic_resource.rb +0 -12
  4. data/lib/2015-08-01/generated/azure_mgmt_service_bus/queues.rb +111 -0
  5. data/lib/2015-08-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +7 -6
  6. data/lib/2015-08-01/generated/azure_mgmt_service_bus/topics.rb +111 -0
  7. data/lib/2017-04-01/generated/azure_mgmt_service_bus.rb +20 -17
  8. data/lib/2017-04-01/generated/azure_mgmt_service_bus/migration_configs.rb +777 -0
  9. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery.rb +12 -0
  10. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/correlation_filter.rb +19 -0
  11. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_list_result.rb +100 -0
  12. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_properties.rb +109 -0
  13. data/lib/2017-04-01/generated/azure_mgmt_service_bus/models/sbqueue.rb +12 -0
  14. data/lib/2017-04-01/generated/azure_mgmt_service_bus/queues.rb +36 -8
  15. data/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb +36 -8
  16. data/lib/2017-04-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb +11 -6
  17. data/lib/2017-04-01/generated/azure_mgmt_service_bus/subscriptions.rb +36 -8
  18. data/lib/2017-04-01/generated/azure_mgmt_service_bus/topics.rb +36 -8
  19. data/lib/azure_mgmt_service_bus.rb +1 -1
  20. data/lib/profiles/latest/modules/servicebus_profile_module.rb +64 -54
  21. data/lib/version.rb +1 -1
  22. metadata +8 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 09b9aa7917a86850641b0088011488e77e12ed57
4
- data.tar.gz: 1a655b34881445d1b5597a7cd7054b96101483b4
3
+ metadata.gz: 55c37bd0b0451342829fa9bb39a1f985a4d6d9d5
4
+ data.tar.gz: caee3d7785e6e9f5c0f54a0a686dda3e0bfa21e9
5
5
  SHA512:
6
- metadata.gz: ad2614788cf591e626cb6e55aa04454da7b2475d564cf62ce33d7aa214806d4c4c54369acf23448de8d907db920d6312bdd8d416a6823c5a592577e2f8f314cd
7
- data.tar.gz: d3032d491f9c6aafe58a0a280165aa3f5f7be6549821045129e018979e544687ec6336337f891b807c68f7ec46243e139a8249a3de6ea3e4daefbb860fe30e2f
6
+ metadata.gz: 90daa3527ff95d2cff8480fff380253965e9bdeb1ec85a817ab68050281af2e31fd48ad310530c5ba4995bb4a32c3ea68829aa0a640edf43a96e422bbf25b4cc
7
+ data.tar.gz: 09e198adef9278c02bcbcc3671cd7c12a4371abb654171809239d9544b02a501cfcbf8172dc668c2c1286d187df7809db10afda87cc3cd504b09eca1c175bca8
@@ -60,10 +60,6 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
60
60
  # partitioned across multiple message brokers is enabled.
61
61
  attr_accessor :enable_partitioning
62
62
 
63
- # @return [Boolean] Value that indicates whether partitioning is enabled
64
- # or disabled. NOTE: This property is unsupported, and may be deprecated.
65
- attr_accessor :enable_subscription_partitioning
66
-
67
63
  # @return [Boolean] Whether messages should be filtered before
68
64
  # publishing.
69
65
  attr_accessor :filtering_messages_before_publishing
@@ -217,14 +213,6 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
217
213
  name: 'Boolean'
218
214
  }
219
215
  },
220
- enable_subscription_partitioning: {
221
- client_side_validation: true,
222
- required: false,
223
- serialized_name: 'properties.enableSubscriptionPartitioning',
224
- type: {
225
- name: 'Boolean'
226
- }
227
- },
228
216
  filtering_messages_before_publishing: {
229
217
  client_side_validation: true,
230
218
  required: false,
@@ -54,10 +54,6 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
54
54
  # partitioned across multiple message brokers is enabled.
55
55
  attr_accessor :enable_partitioning
56
56
 
57
- # @return [Boolean] Value that indicates whether partitioning is enabled
58
- # or disabled. NOTE: This property is unsupported, and may be deprecated.
59
- attr_accessor :enable_subscription_partitioning
60
-
61
57
  # @return [Boolean] Whether messages should be filtered before
62
58
  # publishing.
63
59
  attr_accessor :filtering_messages_before_publishing
@@ -230,14 +226,6 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
230
226
  name: 'Boolean'
231
227
  }
232
228
  },
233
- enable_subscription_partitioning: {
234
- client_side_validation: true,
235
- required: false,
236
- serialized_name: 'properties.enableSubscriptionPartitioning',
237
- type: {
238
- name: 'Boolean'
239
- }
240
- },
241
229
  filtering_messages_before_publishing: {
242
230
  client_side_validation: true,
243
231
  required: false,
@@ -668,6 +668,117 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
668
668
  promise.execute
669
669
  end
670
670
 
671
+ #
672
+ # Gets an authorization rule for a queue by rule name.
673
+ #
674
+ # @param resource_group_name [String] Name of the Resource group within the
675
+ # Azure subscription.
676
+ # @param namespace_name [String] The namespace name
677
+ # @param queue_name [String] The queue name.
678
+ # @param authorization_rule_name [String] The authorizationrule name.
679
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
680
+ # will be added to the HTTP request.
681
+ #
682
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
683
+ #
684
+ def post_authorization_rule(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers:nil)
685
+ response = post_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers:custom_headers).value!
686
+ response.body unless response.nil?
687
+ end
688
+
689
+ #
690
+ # Gets an authorization rule for a queue by rule name.
691
+ #
692
+ # @param resource_group_name [String] Name of the Resource group within the
693
+ # Azure subscription.
694
+ # @param namespace_name [String] The namespace name
695
+ # @param queue_name [String] The queue name.
696
+ # @param authorization_rule_name [String] The authorizationrule name.
697
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
698
+ # will be added to the HTTP request.
699
+ #
700
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
701
+ #
702
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers:nil)
703
+ post_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers:custom_headers).value!
704
+ end
705
+
706
+ #
707
+ # Gets an authorization rule for a queue by rule name.
708
+ #
709
+ # @param resource_group_name [String] Name of the Resource group within the
710
+ # Azure subscription.
711
+ # @param namespace_name [String] The namespace name
712
+ # @param queue_name [String] The queue name.
713
+ # @param authorization_rule_name [String] The authorizationrule name.
714
+ # @param [Hash{String => String}] A hash of custom headers that will be added
715
+ # to the HTTP request.
716
+ #
717
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
718
+ #
719
+ def post_authorization_rule_async(resource_group_name, namespace_name, queue_name, authorization_rule_name, custom_headers:nil)
720
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
721
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
722
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
723
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
724
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
725
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
726
+ fail ArgumentError, 'queue_name is nil' if queue_name.nil?
727
+ fail ArgumentError, "'queue_name' should satisfy the constraint - 'MaxLength': '50'" if !queue_name.nil? && queue_name.length > 50
728
+ fail ArgumentError, "'queue_name' should satisfy the constraint - 'MinLength': '1'" if !queue_name.nil? && queue_name.length < 1
729
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
730
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
731
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
732
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
733
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
734
+
735
+
736
+ request_headers = {}
737
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
738
+
739
+ # Set Headers
740
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
741
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
742
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName}/authorizationRules/{authorizationRuleName}'
743
+
744
+ request_url = @base_url || @client.base_url
745
+
746
+ options = {
747
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
748
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'queueName' => queue_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
749
+ query_params: {'api-version' => @client.api_version},
750
+ headers: request_headers.merge(custom_headers || {}),
751
+ base_url: request_url
752
+ }
753
+ promise = @client.make_request_async(:post, path_template, options)
754
+
755
+ promise = promise.then do |result|
756
+ http_response = result.response
757
+ status_code = http_response.status
758
+ response_content = http_response.body
759
+ unless status_code == 200
760
+ error_model = JSON.load(response_content)
761
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
762
+ end
763
+
764
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
765
+ # Deserialize Response
766
+ if status_code == 200
767
+ begin
768
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
769
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleResource.mapper()
770
+ result.body = @client.deserialize(result_mapper, parsed_response)
771
+ rescue Exception => e
772
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
773
+ end
774
+ end
775
+
776
+ result
777
+ end
778
+
779
+ promise.execute
780
+ end
781
+
671
782
  #
672
783
  # Deletes a queue authorization rule.
673
784
  #
@@ -25,15 +25,16 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
25
25
  # @return [String] Client API version.
26
26
  attr_reader :api_version
27
27
 
28
- # @return [String] Gets or sets the preferred language for the response.
28
+ # @return [String] The preferred language for the response.
29
29
  attr_accessor :accept_language
30
30
 
31
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
- # Running Operations. Default value is 30.
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
33
  attr_accessor :long_running_operation_retry_timeout
34
34
 
35
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
- # is generated and included in each request. Default is true.
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
37
38
  attr_accessor :generate_client_request_id
38
39
 
39
40
  # @return [Operations] operations
@@ -141,7 +142,7 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
141
142
  #
142
143
  def add_telemetry
143
144
  sdk_information = 'azure_mgmt_service_bus'
144
- sdk_information = "#{sdk_information}/0.16.0"
145
+ sdk_information = "#{sdk_information}/0.17.0"
145
146
  add_user_agent_information(sdk_information)
146
147
  end
147
148
  end
@@ -668,6 +668,117 @@ module Azure::ServiceBus::Mgmt::V2015_08_01
668
668
  promise.execute
669
669
  end
670
670
 
671
+ #
672
+ # Returns the specified authorization rule.
673
+ #
674
+ # @param resource_group_name [String] Name of the Resource group within the
675
+ # Azure subscription.
676
+ # @param namespace_name [String] The namespace name
677
+ # @param topic_name [String] The topic name.
678
+ # @param authorization_rule_name [String] The authorizationrule name.
679
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
680
+ # will be added to the HTTP request.
681
+ #
682
+ # @return [SharedAccessAuthorizationRuleResource] operation results.
683
+ #
684
+ def post_authorization_rule(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:nil)
685
+ response = post_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:custom_headers).value!
686
+ response.body unless response.nil?
687
+ end
688
+
689
+ #
690
+ # Returns the specified authorization rule.
691
+ #
692
+ # @param resource_group_name [String] Name of the Resource group within the
693
+ # Azure subscription.
694
+ # @param namespace_name [String] The namespace name
695
+ # @param topic_name [String] The topic name.
696
+ # @param authorization_rule_name [String] The authorizationrule name.
697
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
698
+ # will be added to the HTTP request.
699
+ #
700
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
701
+ #
702
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:nil)
703
+ post_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:custom_headers).value!
704
+ end
705
+
706
+ #
707
+ # Returns the specified authorization rule.
708
+ #
709
+ # @param resource_group_name [String] Name of the Resource group within the
710
+ # Azure subscription.
711
+ # @param namespace_name [String] The namespace name
712
+ # @param topic_name [String] The topic name.
713
+ # @param authorization_rule_name [String] The authorizationrule name.
714
+ # @param [Hash{String => String}] A hash of custom headers that will be added
715
+ # to the HTTP request.
716
+ #
717
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
718
+ #
719
+ def post_authorization_rule_async(resource_group_name, namespace_name, topic_name, authorization_rule_name, custom_headers:nil)
720
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
721
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
722
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
723
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
724
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
725
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
726
+ fail ArgumentError, 'topic_name is nil' if topic_name.nil?
727
+ fail ArgumentError, "'topic_name' should satisfy the constraint - 'MaxLength': '50'" if !topic_name.nil? && topic_name.length > 50
728
+ fail ArgumentError, "'topic_name' should satisfy the constraint - 'MinLength': '1'" if !topic_name.nil? && topic_name.length < 1
729
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
730
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
731
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
732
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
733
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
734
+
735
+
736
+ request_headers = {}
737
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
738
+
739
+ # Set Headers
740
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
741
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
742
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}'
743
+
744
+ request_url = @base_url || @client.base_url
745
+
746
+ options = {
747
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
748
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'topicName' => topic_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
749
+ query_params: {'api-version' => @client.api_version},
750
+ headers: request_headers.merge(custom_headers || {}),
751
+ base_url: request_url
752
+ }
753
+ promise = @client.make_request_async(:post, path_template, options)
754
+
755
+ promise = promise.then do |result|
756
+ http_response = result.response
757
+ status_code = http_response.status
758
+ response_content = http_response.body
759
+ unless status_code == 200
760
+ error_model = JSON.load(response_content)
761
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
762
+ end
763
+
764
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
765
+ # Deserialize Response
766
+ if status_code == 200
767
+ begin
768
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
769
+ result_mapper = Azure::ServiceBus::Mgmt::V2015_08_01::Models::SharedAccessAuthorizationRuleResource.mapper()
770
+ result.body = @client.deserialize(result_mapper, parsed_response)
771
+ rescue Exception => e
772
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
773
+ end
774
+ end
775
+
776
+ result
777
+ end
778
+
779
+ promise.execute
780
+ end
781
+
671
782
  #
672
783
  # Returns the specified authorization rule.
673
784
  #
@@ -23,6 +23,7 @@ module Azure::ServiceBus::Mgmt::V2017_04_01
23
23
  autoload :Operations, '2017-04-01/generated/azure_mgmt_service_bus/operations.rb'
24
24
  autoload :Namespaces, '2017-04-01/generated/azure_mgmt_service_bus/namespaces.rb'
25
25
  autoload :DisasterRecoveryConfigs, '2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb'
26
+ autoload :MigrationConfigs, '2017-04-01/generated/azure_mgmt_service_bus/migration_configs.rb'
26
27
  autoload :Queues, '2017-04-01/generated/azure_mgmt_service_bus/queues.rb'
27
28
  autoload :Topics, '2017-04-01/generated/azure_mgmt_service_bus/topics.rb'
28
29
  autoload :Subscriptions, '2017-04-01/generated/azure_mgmt_service_bus/subscriptions.rb'
@@ -33,33 +34,34 @@ module Azure::ServiceBus::Mgmt::V2017_04_01
33
34
  autoload :ServiceBusManagementClient, '2017-04-01/generated/azure_mgmt_service_bus/service_bus_management_client.rb'
34
35
 
35
36
  module Models
36
- autoload :CheckNameAvailabilityResult, '2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability_result.rb'
37
+ autoload :OperationDisplay, '2017-04-01/generated/azure_mgmt_service_bus/models/operation_display.rb'
37
38
  autoload :SBQueueListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbqueue_list_result.rb'
38
- autoload :Resource, '2017-04-01/generated/azure_mgmt_service_bus/models/resource.rb'
39
- autoload :PremiumMessagingRegionsListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb'
40
- autoload :SBSku, '2017-04-01/generated/azure_mgmt_service_bus/models/sbsku.rb'
39
+ autoload :Destination, '2017-04-01/generated/azure_mgmt_service_bus/models/destination.rb'
41
40
  autoload :SBTopicListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbtopic_list_result.rb'
42
- autoload :SBNamespaceListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
43
- autoload :PremiumMessagingRegionsProperties, '2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb'
44
- autoload :CaptureDescription, '2017-04-01/generated/azure_mgmt_service_bus/models/capture_description.rb'
41
+ autoload :MigrationConfigListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_list_result.rb'
42
+ autoload :PremiumMessagingRegionsListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb'
43
+ autoload :ArmDisasterRecoveryListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb'
45
44
  autoload :SBSubscriptionListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbsubscription_list_result.rb'
46
- autoload :AuthorizationRuleProperties, '2017-04-01/generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
45
+ autoload :SBAuthorizationRuleListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
47
46
  autoload :CheckNameAvailability, '2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability.rb'
48
- autoload :RegenerateAccessKeyParameters, '2017-04-01/generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
49
- autoload :RuleListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/rule_list_result.rb'
50
- autoload :Destination, '2017-04-01/generated/azure_mgmt_service_bus/models/destination.rb'
51
- autoload :OperationDisplay, '2017-04-01/generated/azure_mgmt_service_bus/models/operation_display.rb'
52
- autoload :ArmDisasterRecoveryListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb'
47
+ autoload :AccessKeys, '2017-04-01/generated/azure_mgmt_service_bus/models/access_keys.rb'
48
+ autoload :CheckNameAvailabilityResult, '2017-04-01/generated/azure_mgmt_service_bus/models/check_name_availability_result.rb'
49
+ autoload :MessageCountDetails, '2017-04-01/generated/azure_mgmt_service_bus/models/message_count_details.rb'
50
+ autoload :PremiumMessagingRegionsProperties, '2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb'
51
+ autoload :Resource, '2017-04-01/generated/azure_mgmt_service_bus/models/resource.rb'
53
52
  autoload :Operation, '2017-04-01/generated/azure_mgmt_service_bus/models/operation.rb'
54
- autoload :SBAuthorizationRuleListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
53
+ autoload :SBNamespaceListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
55
54
  autoload :OperationListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/operation_list_result.rb'
56
- autoload :MessageCountDetails, '2017-04-01/generated/azure_mgmt_service_bus/models/message_count_details.rb'
55
+ autoload :AuthorizationRuleProperties, '2017-04-01/generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
57
56
  autoload :ErrorResponse, '2017-04-01/generated/azure_mgmt_service_bus/models/error_response.rb'
58
- autoload :EventHubListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/event_hub_list_result.rb'
57
+ autoload :CaptureDescription, '2017-04-01/generated/azure_mgmt_service_bus/models/capture_description.rb'
59
58
  autoload :Action, '2017-04-01/generated/azure_mgmt_service_bus/models/action.rb'
59
+ autoload :EventHubListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/event_hub_list_result.rb'
60
60
  autoload :SqlFilter, '2017-04-01/generated/azure_mgmt_service_bus/models/sql_filter.rb'
61
- autoload :AccessKeys, '2017-04-01/generated/azure_mgmt_service_bus/models/access_keys.rb'
61
+ autoload :SBSku, '2017-04-01/generated/azure_mgmt_service_bus/models/sbsku.rb'
62
62
  autoload :CorrelationFilter, '2017-04-01/generated/azure_mgmt_service_bus/models/correlation_filter.rb'
63
+ autoload :RegenerateAccessKeyParameters, '2017-04-01/generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
64
+ autoload :RuleListResult, '2017-04-01/generated/azure_mgmt_service_bus/models/rule_list_result.rb'
63
65
  autoload :TrackedResource, '2017-04-01/generated/azure_mgmt_service_bus/models/tracked_resource.rb'
64
66
  autoload :ResourceNamespacePatch, '2017-04-01/generated/azure_mgmt_service_bus/models/resource_namespace_patch.rb'
65
67
  autoload :SBNamespace, '2017-04-01/generated/azure_mgmt_service_bus/models/sbnamespace.rb'
@@ -73,6 +75,7 @@ module Azure::ServiceBus::Mgmt::V2017_04_01
73
75
  autoload :PremiumMessagingRegions, '2017-04-01/generated/azure_mgmt_service_bus/models/premium_messaging_regions.rb'
74
76
  autoload :Eventhub, '2017-04-01/generated/azure_mgmt_service_bus/models/eventhub.rb'
75
77
  autoload :ArmDisasterRecovery, '2017-04-01/generated/azure_mgmt_service_bus/models/arm_disaster_recovery.rb'
78
+ autoload :MigrationConfigProperties, '2017-04-01/generated/azure_mgmt_service_bus/models/migration_config_properties.rb'
76
79
  autoload :SkuName, '2017-04-01/generated/azure_mgmt_service_bus/models/sku_name.rb'
77
80
  autoload :SkuTier, '2017-04-01/generated/azure_mgmt_service_bus/models/sku_tier.rb'
78
81
  autoload :AccessRights, '2017-04-01/generated/azure_mgmt_service_bus/models/access_rights.rb'
@@ -0,0 +1,777 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ServiceBus::Mgmt::V2017_04_01
7
+ #
8
+ # Azure Service Bus client
9
+ #
10
+ class MigrationConfigs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the MigrationConfigs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all migrationConfigurations
26
+ #
27
+ # @param resource_group_name [String] Name of the Resource group within the
28
+ # Azure subscription.
29
+ # @param namespace_name [String] The namespace name
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<MigrationConfigProperties>] operation results.
34
+ #
35
+ def list(resource_group_name, namespace_name, custom_headers:nil)
36
+ first_page = list_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all migrationConfigurations
42
+ #
43
+ # @param resource_group_name [String] Name of the Resource group within the
44
+ # Azure subscription.
45
+ # @param namespace_name [String] The namespace name
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
52
+ list_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all migrationConfigurations
57
+ #
58
+ # @param resource_group_name [String] Name of the Resource group within the
59
+ # Azure subscription.
60
+ # @param namespace_name [String] The namespace name
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(resource_group_name, namespace_name, custom_headers:nil)
67
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
68
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
70
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
71
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
72
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigListResult.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Creates Migration configuration and starts migration of enties from Standard
125
+ # to Premium namespace
126
+ #
127
+ # @param resource_group_name [String] Name of the Resource group within the
128
+ # Azure subscription.
129
+ # @param namespace_name [String] The namespace name
130
+ # @param parameters [MigrationConfigProperties] Parameters required to create
131
+ # Migration Configuration
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [MigrationConfigProperties] operation results.
136
+ #
137
+ def create_and_start_migration(resource_group_name, namespace_name, parameters, custom_headers:nil)
138
+ response = create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # @param resource_group_name [String] Name of the Resource group within the
144
+ # Azure subscription.
145
+ # @param namespace_name [String] The namespace name
146
+ # @param parameters [MigrationConfigProperties] Parameters required to create
147
+ # Migration Configuration
148
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
149
+ # will be added to the HTTP request.
150
+ #
151
+ # @return [Concurrent::Promise] promise which provides async access to http
152
+ # response.
153
+ #
154
+ def create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
155
+ # Send request
156
+ promise = begin_create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers)
157
+
158
+ promise = promise.then do |response|
159
+ # Defining deserialization method.
160
+ deserialize_method = lambda do |parsed_response|
161
+ result_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigProperties.mapper()
162
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
163
+ end
164
+
165
+ # Waiting for response.
166
+ @client.get_long_running_operation_result(response, deserialize_method)
167
+ end
168
+
169
+ promise
170
+ end
171
+
172
+ #
173
+ # Deletes a MigrationConfiguration
174
+ #
175
+ # @param resource_group_name [String] Name of the Resource group within the
176
+ # Azure subscription.
177
+ # @param namespace_name [String] The namespace name
178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
179
+ # will be added to the HTTP request.
180
+ #
181
+ #
182
+ def delete(resource_group_name, namespace_name, custom_headers:nil)
183
+ response = delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
184
+ nil
185
+ end
186
+
187
+ #
188
+ # Deletes a MigrationConfiguration
189
+ #
190
+ # @param resource_group_name [String] Name of the Resource group within the
191
+ # Azure subscription.
192
+ # @param namespace_name [String] The namespace name
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
197
+ #
198
+ def delete_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
199
+ delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
200
+ end
201
+
202
+ #
203
+ # Deletes a MigrationConfiguration
204
+ #
205
+ # @param resource_group_name [String] Name of the Resource group within the
206
+ # Azure subscription.
207
+ # @param namespace_name [String] The namespace name
208
+ # @param [Hash{String => String}] A hash of custom headers that will be added
209
+ # to the HTTP request.
210
+ #
211
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
212
+ #
213
+ def delete_async(resource_group_name, namespace_name, custom_headers:nil)
214
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
215
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
216
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
217
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
218
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
219
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
220
+ config_name = '$default'
221
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
222
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
223
+
224
+
225
+ request_headers = {}
226
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
227
+
228
+ # Set Headers
229
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
230
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
231
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'
232
+
233
+ request_url = @base_url || @client.base_url
234
+
235
+ options = {
236
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
237
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'configName' => config_name,'subscriptionId' => @client.subscription_id},
238
+ query_params: {'api-version' => @client.api_version},
239
+ headers: request_headers.merge(custom_headers || {}),
240
+ base_url: request_url
241
+ }
242
+ promise = @client.make_request_async(:delete, path_template, options)
243
+
244
+ promise = promise.then do |result|
245
+ http_response = result.response
246
+ status_code = http_response.status
247
+ response_content = http_response.body
248
+ unless status_code == 200 || status_code == 204
249
+ error_model = JSON.load(response_content)
250
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
251
+ end
252
+
253
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
254
+
255
+ result
256
+ end
257
+
258
+ promise.execute
259
+ end
260
+
261
+ #
262
+ # Retrieves Migration Config
263
+ #
264
+ # @param resource_group_name [String] Name of the Resource group within the
265
+ # Azure subscription.
266
+ # @param namespace_name [String] The namespace name
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ # @return [MigrationConfigProperties] operation results.
271
+ #
272
+ def get(resource_group_name, namespace_name, custom_headers:nil)
273
+ response = get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
274
+ response.body unless response.nil?
275
+ end
276
+
277
+ #
278
+ # Retrieves Migration Config
279
+ #
280
+ # @param resource_group_name [String] Name of the Resource group within the
281
+ # Azure subscription.
282
+ # @param namespace_name [String] The namespace name
283
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
284
+ # will be added to the HTTP request.
285
+ #
286
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
287
+ #
288
+ def get_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
289
+ get_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
290
+ end
291
+
292
+ #
293
+ # Retrieves Migration Config
294
+ #
295
+ # @param resource_group_name [String] Name of the Resource group within the
296
+ # Azure subscription.
297
+ # @param namespace_name [String] The namespace name
298
+ # @param [Hash{String => String}] A hash of custom headers that will be added
299
+ # to the HTTP request.
300
+ #
301
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
302
+ #
303
+ def get_async(resource_group_name, namespace_name, custom_headers:nil)
304
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
305
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
306
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
307
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
308
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
309
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
310
+ config_name = '$default'
311
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
312
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
313
+
314
+
315
+ request_headers = {}
316
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
317
+
318
+ # Set Headers
319
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
320
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
321
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'
322
+
323
+ request_url = @base_url || @client.base_url
324
+
325
+ options = {
326
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
327
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'configName' => config_name,'subscriptionId' => @client.subscription_id},
328
+ query_params: {'api-version' => @client.api_version},
329
+ headers: request_headers.merge(custom_headers || {}),
330
+ base_url: request_url
331
+ }
332
+ promise = @client.make_request_async(:get, path_template, options)
333
+
334
+ promise = promise.then do |result|
335
+ http_response = result.response
336
+ status_code = http_response.status
337
+ response_content = http_response.body
338
+ unless status_code == 200
339
+ error_model = JSON.load(response_content)
340
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
341
+ end
342
+
343
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
344
+ # Deserialize Response
345
+ if status_code == 200
346
+ begin
347
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
348
+ result_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigProperties.mapper()
349
+ result.body = @client.deserialize(result_mapper, parsed_response)
350
+ rescue Exception => e
351
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
352
+ end
353
+ end
354
+
355
+ result
356
+ end
357
+
358
+ promise.execute
359
+ end
360
+
361
+ #
362
+ # This operation Completes Migration of entities by pointing the connection
363
+ # strings to Premium namespace and any enties created after the operation will
364
+ # be under Premium Namespace. CompleteMigration operation will fail when entity
365
+ # migration is in-progress.
366
+ #
367
+ # @param resource_group_name [String] Name of the Resource group within the
368
+ # Azure subscription.
369
+ # @param namespace_name [String] The namespace name
370
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
371
+ # will be added to the HTTP request.
372
+ #
373
+ #
374
+ def complete_migration(resource_group_name, namespace_name, custom_headers:nil)
375
+ response = complete_migration_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
376
+ nil
377
+ end
378
+
379
+ #
380
+ # This operation Completes Migration of entities by pointing the connection
381
+ # strings to Premium namespace and any enties created after the operation will
382
+ # be under Premium Namespace. CompleteMigration operation will fail when entity
383
+ # migration is in-progress.
384
+ #
385
+ # @param resource_group_name [String] Name of the Resource group within the
386
+ # Azure subscription.
387
+ # @param namespace_name [String] The namespace name
388
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
389
+ # will be added to the HTTP request.
390
+ #
391
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
392
+ #
393
+ def complete_migration_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
394
+ complete_migration_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
395
+ end
396
+
397
+ #
398
+ # This operation Completes Migration of entities by pointing the connection
399
+ # strings to Premium namespace and any enties created after the operation will
400
+ # be under Premium Namespace. CompleteMigration operation will fail when entity
401
+ # migration is in-progress.
402
+ #
403
+ # @param resource_group_name [String] Name of the Resource group within the
404
+ # Azure subscription.
405
+ # @param namespace_name [String] The namespace name
406
+ # @param [Hash{String => String}] A hash of custom headers that will be added
407
+ # to the HTTP request.
408
+ #
409
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
410
+ #
411
+ def complete_migration_async(resource_group_name, namespace_name, custom_headers:nil)
412
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
413
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
414
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
415
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
416
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
417
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
418
+ config_name = '$default'
419
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
420
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
421
+
422
+
423
+ request_headers = {}
424
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
425
+
426
+ # Set Headers
427
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
428
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
429
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade'
430
+
431
+ request_url = @base_url || @client.base_url
432
+
433
+ options = {
434
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
435
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'configName' => config_name,'subscriptionId' => @client.subscription_id},
436
+ query_params: {'api-version' => @client.api_version},
437
+ headers: request_headers.merge(custom_headers || {}),
438
+ base_url: request_url
439
+ }
440
+ promise = @client.make_request_async(:post, path_template, options)
441
+
442
+ promise = promise.then do |result|
443
+ http_response = result.response
444
+ status_code = http_response.status
445
+ response_content = http_response.body
446
+ unless status_code == 200
447
+ error_model = JSON.load(response_content)
448
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
449
+ end
450
+
451
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
452
+
453
+ result
454
+ end
455
+
456
+ promise.execute
457
+ end
458
+
459
+ #
460
+ # This operation reverts Migration
461
+ #
462
+ # @param resource_group_name [String] Name of the Resource group within the
463
+ # Azure subscription.
464
+ # @param namespace_name [String] The namespace name
465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
+ # will be added to the HTTP request.
467
+ #
468
+ #
469
+ def revert(resource_group_name, namespace_name, custom_headers:nil)
470
+ response = revert_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
471
+ nil
472
+ end
473
+
474
+ #
475
+ # This operation reverts Migration
476
+ #
477
+ # @param resource_group_name [String] Name of the Resource group within the
478
+ # Azure subscription.
479
+ # @param namespace_name [String] The namespace name
480
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
481
+ # will be added to the HTTP request.
482
+ #
483
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
484
+ #
485
+ def revert_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
486
+ revert_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
487
+ end
488
+
489
+ #
490
+ # This operation reverts Migration
491
+ #
492
+ # @param resource_group_name [String] Name of the Resource group within the
493
+ # Azure subscription.
494
+ # @param namespace_name [String] The namespace name
495
+ # @param [Hash{String => String}] A hash of custom headers that will be added
496
+ # to the HTTP request.
497
+ #
498
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
499
+ #
500
+ def revert_async(resource_group_name, namespace_name, custom_headers:nil)
501
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
502
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
503
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
504
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
505
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
506
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
507
+ config_name = '$default'
508
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
509
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
510
+
511
+
512
+ request_headers = {}
513
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
514
+
515
+ # Set Headers
516
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
517
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
518
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/revert'
519
+
520
+ request_url = @base_url || @client.base_url
521
+
522
+ options = {
523
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
524
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'configName' => config_name,'subscriptionId' => @client.subscription_id},
525
+ query_params: {'api-version' => @client.api_version},
526
+ headers: request_headers.merge(custom_headers || {}),
527
+ base_url: request_url
528
+ }
529
+ promise = @client.make_request_async(:post, path_template, options)
530
+
531
+ promise = promise.then do |result|
532
+ http_response = result.response
533
+ status_code = http_response.status
534
+ response_content = http_response.body
535
+ unless status_code == 200
536
+ error_model = JSON.load(response_content)
537
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
538
+ end
539
+
540
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
541
+
542
+ result
543
+ end
544
+
545
+ promise.execute
546
+ end
547
+
548
+ #
549
+ # Creates Migration configuration and starts migration of enties from Standard
550
+ # to Premium namespace
551
+ #
552
+ # @param resource_group_name [String] Name of the Resource group within the
553
+ # Azure subscription.
554
+ # @param namespace_name [String] The namespace name
555
+ # @param parameters [MigrationConfigProperties] Parameters required to create
556
+ # Migration Configuration
557
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
558
+ # will be added to the HTTP request.
559
+ #
560
+ # @return [MigrationConfigProperties] operation results.
561
+ #
562
+ def begin_create_and_start_migration(resource_group_name, namespace_name, parameters, custom_headers:nil)
563
+ response = begin_create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
564
+ response.body unless response.nil?
565
+ end
566
+
567
+ #
568
+ # Creates Migration configuration and starts migration of enties from Standard
569
+ # to Premium namespace
570
+ #
571
+ # @param resource_group_name [String] Name of the Resource group within the
572
+ # Azure subscription.
573
+ # @param namespace_name [String] The namespace name
574
+ # @param parameters [MigrationConfigProperties] Parameters required to create
575
+ # Migration Configuration
576
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
577
+ # will be added to the HTTP request.
578
+ #
579
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
580
+ #
581
+ def begin_create_and_start_migration_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
582
+ begin_create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
583
+ end
584
+
585
+ #
586
+ # Creates Migration configuration and starts migration of enties from Standard
587
+ # to Premium namespace
588
+ #
589
+ # @param resource_group_name [String] Name of the Resource group within the
590
+ # Azure subscription.
591
+ # @param namespace_name [String] The namespace name
592
+ # @param parameters [MigrationConfigProperties] Parameters required to create
593
+ # Migration Configuration
594
+ # @param [Hash{String => String}] A hash of custom headers that will be added
595
+ # to the HTTP request.
596
+ #
597
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
598
+ #
599
+ def begin_create_and_start_migration_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
600
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
601
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
602
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
603
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
604
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
605
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
606
+ config_name = '$default'
607
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
608
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
609
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
610
+
611
+
612
+ request_headers = {}
613
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
614
+
615
+ # Set Headers
616
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
617
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
618
+
619
+ # Serialize Request
620
+ request_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigProperties.mapper()
621
+ request_content = @client.serialize(request_mapper, parameters)
622
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
623
+
624
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}'
625
+
626
+ request_url = @base_url || @client.base_url
627
+
628
+ options = {
629
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
630
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'configName' => config_name,'subscriptionId' => @client.subscription_id},
631
+ query_params: {'api-version' => @client.api_version},
632
+ body: request_content,
633
+ headers: request_headers.merge(custom_headers || {}),
634
+ base_url: request_url
635
+ }
636
+ promise = @client.make_request_async(:put, path_template, options)
637
+
638
+ promise = promise.then do |result|
639
+ http_response = result.response
640
+ status_code = http_response.status
641
+ response_content = http_response.body
642
+ unless status_code == 200 || status_code == 201
643
+ error_model = JSON.load(response_content)
644
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
645
+ end
646
+
647
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
648
+ # Deserialize Response
649
+ if status_code == 200
650
+ begin
651
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
652
+ result_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigProperties.mapper()
653
+ result.body = @client.deserialize(result_mapper, parsed_response)
654
+ rescue Exception => e
655
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
656
+ end
657
+ end
658
+
659
+ result
660
+ end
661
+
662
+ promise.execute
663
+ end
664
+
665
+ #
666
+ # Gets all migrationConfigurations
667
+ #
668
+ # @param next_page_link [String] The NextLink from the previous successful call
669
+ # to List operation.
670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
671
+ # will be added to the HTTP request.
672
+ #
673
+ # @return [MigrationConfigListResult] operation results.
674
+ #
675
+ def list_next(next_page_link, custom_headers:nil)
676
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
677
+ response.body unless response.nil?
678
+ end
679
+
680
+ #
681
+ # Gets all migrationConfigurations
682
+ #
683
+ # @param next_page_link [String] The NextLink from the previous successful call
684
+ # to List operation.
685
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
686
+ # will be added to the HTTP request.
687
+ #
688
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
689
+ #
690
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
691
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
692
+ end
693
+
694
+ #
695
+ # Gets all migrationConfigurations
696
+ #
697
+ # @param next_page_link [String] The NextLink from the previous successful call
698
+ # to List operation.
699
+ # @param [Hash{String => String}] A hash of custom headers that will be added
700
+ # to the HTTP request.
701
+ #
702
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
703
+ #
704
+ def list_next_async(next_page_link, custom_headers:nil)
705
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
706
+
707
+
708
+ request_headers = {}
709
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
710
+
711
+ # Set Headers
712
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
713
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
714
+ path_template = '{nextLink}'
715
+
716
+ request_url = @base_url || @client.base_url
717
+
718
+ options = {
719
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
720
+ skip_encoding_path_params: {'nextLink' => next_page_link},
721
+ headers: request_headers.merge(custom_headers || {}),
722
+ base_url: request_url
723
+ }
724
+ promise = @client.make_request_async(:get, path_template, options)
725
+
726
+ promise = promise.then do |result|
727
+ http_response = result.response
728
+ status_code = http_response.status
729
+ response_content = http_response.body
730
+ unless status_code == 200
731
+ error_model = JSON.load(response_content)
732
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
733
+ end
734
+
735
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
736
+ # Deserialize Response
737
+ if status_code == 200
738
+ begin
739
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
740
+ result_mapper = Azure::ServiceBus::Mgmt::V2017_04_01::Models::MigrationConfigListResult.mapper()
741
+ result.body = @client.deserialize(result_mapper, parsed_response)
742
+ rescue Exception => e
743
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
744
+ end
745
+ end
746
+
747
+ result
748
+ end
749
+
750
+ promise.execute
751
+ end
752
+
753
+ #
754
+ # Gets all migrationConfigurations
755
+ #
756
+ # @param resource_group_name [String] Name of the Resource group within the
757
+ # Azure subscription.
758
+ # @param namespace_name [String] The namespace name
759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
+ # will be added to the HTTP request.
761
+ #
762
+ # @return [MigrationConfigListResult] which provide lazy access to pages of the
763
+ # response.
764
+ #
765
+ def list_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
766
+ response = list_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
767
+ unless response.nil?
768
+ page = response.body
769
+ page.next_method = Proc.new do |next_page_link|
770
+ list_next_async(next_page_link, custom_headers:custom_headers)
771
+ end
772
+ page
773
+ end
774
+ end
775
+
776
+ end
777
+ end