azure_mgmt_cosmosdb 0.21.2 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb +1 -1
  3. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  4. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  5. data/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  6. data/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  7. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb.rb +28 -27
  8. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +708 -60
  9. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  10. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +700 -60
  11. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cors_policy.rb +99 -0
  12. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +21 -0
  13. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +21 -0
  14. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +21 -0
  15. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb +11 -0
  16. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +11 -0
  17. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +711 -63
  18. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/sql_resources.rb +692 -60
  19. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/table_resources.rb +310 -0
  20. data/lib/version.rb +1 -1
  21. metadata +3 -2
@@ -492,6 +492,98 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
492
492
  promise
493
493
  end
494
494
 
495
+ #
496
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
497
+ #
498
+ # @param resource_group_name [String] The name of the resource group. The name
499
+ # is case insensitive.
500
+ # @param account_name [String] Cosmos DB database account name.
501
+ # @param table_name [String] Cosmos DB table name.
502
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
503
+ # will be added to the HTTP request.
504
+ #
505
+ # @return [ThroughputSettingsGetResults] operation results.
506
+ #
507
+ def migrate_table_to_autoscale(resource_group_name, account_name, table_name, custom_headers:nil)
508
+ response = migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
509
+ response.body unless response.nil?
510
+ end
511
+
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group. The name
514
+ # is case insensitive.
515
+ # @param account_name [String] Cosmos DB database account name.
516
+ # @param table_name [String] Cosmos DB table name.
517
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
518
+ # will be added to the HTTP request.
519
+ #
520
+ # @return [Concurrent::Promise] promise which provides async access to http
521
+ # response.
522
+ #
523
+ def migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:nil)
524
+ # Send request
525
+ promise = begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers)
526
+
527
+ promise = promise.then do |response|
528
+ # Defining deserialization method.
529
+ deserialize_method = lambda do |parsed_response|
530
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
531
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
532
+ end
533
+
534
+ # Waiting for response.
535
+ @client.get_long_running_operation_result(response, deserialize_method)
536
+ end
537
+
538
+ promise
539
+ end
540
+
541
+ #
542
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
543
+ #
544
+ # @param resource_group_name [String] The name of the resource group. The name
545
+ # is case insensitive.
546
+ # @param account_name [String] Cosmos DB database account name.
547
+ # @param table_name [String] Cosmos DB table name.
548
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
549
+ # will be added to the HTTP request.
550
+ #
551
+ # @return [ThroughputSettingsGetResults] operation results.
552
+ #
553
+ def migrate_table_to_manual_throughput(resource_group_name, account_name, table_name, custom_headers:nil)
554
+ response = migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
555
+ response.body unless response.nil?
556
+ end
557
+
558
+ #
559
+ # @param resource_group_name [String] The name of the resource group. The name
560
+ # is case insensitive.
561
+ # @param account_name [String] Cosmos DB database account name.
562
+ # @param table_name [String] Cosmos DB table name.
563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
564
+ # will be added to the HTTP request.
565
+ #
566
+ # @return [Concurrent::Promise] promise which provides async access to http
567
+ # response.
568
+ #
569
+ def migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil)
570
+ # Send request
571
+ promise = begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers)
572
+
573
+ promise = promise.then do |response|
574
+ # Defining deserialization method.
575
+ deserialize_method = lambda do |parsed_response|
576
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
577
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
578
+ end
579
+
580
+ # Waiting for response.
581
+ @client.get_long_running_operation_result(response, deserialize_method)
582
+ end
583
+
584
+ promise
585
+ end
586
+
495
587
  #
496
588
  # Create or update an Azure Cosmos DB Table
497
589
  #
@@ -836,5 +928,223 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
836
928
  promise.execute
837
929
  end
838
930
 
931
+ #
932
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
933
+ #
934
+ # @param resource_group_name [String] The name of the resource group. The name
935
+ # is case insensitive.
936
+ # @param account_name [String] Cosmos DB database account name.
937
+ # @param table_name [String] Cosmos DB table name.
938
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
939
+ # will be added to the HTTP request.
940
+ #
941
+ # @return [ThroughputSettingsGetResults] operation results.
942
+ #
943
+ def begin_migrate_table_to_autoscale(resource_group_name, account_name, table_name, custom_headers:nil)
944
+ response = begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
945
+ response.body unless response.nil?
946
+ end
947
+
948
+ #
949
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
950
+ #
951
+ # @param resource_group_name [String] The name of the resource group. The name
952
+ # is case insensitive.
953
+ # @param account_name [String] Cosmos DB database account name.
954
+ # @param table_name [String] Cosmos DB table name.
955
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
956
+ # will be added to the HTTP request.
957
+ #
958
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
959
+ #
960
+ def begin_migrate_table_to_autoscale_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
961
+ begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
962
+ end
963
+
964
+ #
965
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
966
+ #
967
+ # @param resource_group_name [String] The name of the resource group. The name
968
+ # is case insensitive.
969
+ # @param account_name [String] Cosmos DB database account name.
970
+ # @param table_name [String] Cosmos DB table name.
971
+ # @param [Hash{String => String}] A hash of custom headers that will be added
972
+ # to the HTTP request.
973
+ #
974
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
975
+ #
976
+ def begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:nil)
977
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
978
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
979
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
980
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
981
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
982
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
983
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
984
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
985
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
986
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
987
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
988
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
989
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
990
+
991
+
992
+ request_headers = {}
993
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
994
+
995
+ # Set Headers
996
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
997
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
998
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'
999
+
1000
+ request_url = @base_url || @client.base_url
1001
+
1002
+ options = {
1003
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1004
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
1005
+ query_params: {'api-version' => @client.api_version},
1006
+ headers: request_headers.merge(custom_headers || {}),
1007
+ base_url: request_url
1008
+ }
1009
+ promise = @client.make_request_async(:post, path_template, options)
1010
+
1011
+ promise = promise.then do |result|
1012
+ http_response = result.response
1013
+ status_code = http_response.status
1014
+ response_content = http_response.body
1015
+ unless status_code == 202 || status_code == 200
1016
+ error_model = JSON.load(response_content)
1017
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1018
+ end
1019
+
1020
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1021
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1022
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1023
+ # Deserialize Response
1024
+ if status_code == 200
1025
+ begin
1026
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1027
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1028
+ result.body = @client.deserialize(result_mapper, parsed_response)
1029
+ rescue Exception => e
1030
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1031
+ end
1032
+ end
1033
+
1034
+ result
1035
+ end
1036
+
1037
+ promise.execute
1038
+ end
1039
+
1040
+ #
1041
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1042
+ #
1043
+ # @param resource_group_name [String] The name of the resource group. The name
1044
+ # is case insensitive.
1045
+ # @param account_name [String] Cosmos DB database account name.
1046
+ # @param table_name [String] Cosmos DB table name.
1047
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1048
+ # will be added to the HTTP request.
1049
+ #
1050
+ # @return [ThroughputSettingsGetResults] operation results.
1051
+ #
1052
+ def begin_migrate_table_to_manual_throughput(resource_group_name, account_name, table_name, custom_headers:nil)
1053
+ response = begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
1054
+ response.body unless response.nil?
1055
+ end
1056
+
1057
+ #
1058
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1059
+ #
1060
+ # @param resource_group_name [String] The name of the resource group. The name
1061
+ # is case insensitive.
1062
+ # @param account_name [String] Cosmos DB database account name.
1063
+ # @param table_name [String] Cosmos DB table name.
1064
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1065
+ # will be added to the HTTP request.
1066
+ #
1067
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1068
+ #
1069
+ def begin_migrate_table_to_manual_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
1070
+ begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
1071
+ end
1072
+
1073
+ #
1074
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1075
+ #
1076
+ # @param resource_group_name [String] The name of the resource group. The name
1077
+ # is case insensitive.
1078
+ # @param account_name [String] Cosmos DB database account name.
1079
+ # @param table_name [String] Cosmos DB table name.
1080
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1081
+ # to the HTTP request.
1082
+ #
1083
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1084
+ #
1085
+ def begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil)
1086
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1087
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1088
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1089
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1090
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1091
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1092
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1093
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1094
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1095
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1096
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
1097
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1098
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1099
+
1100
+
1101
+ request_headers = {}
1102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1107
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'
1108
+
1109
+ request_url = @base_url || @client.base_url
1110
+
1111
+ options = {
1112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1113
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
1114
+ query_params: {'api-version' => @client.api_version},
1115
+ headers: request_headers.merge(custom_headers || {}),
1116
+ base_url: request_url
1117
+ }
1118
+ promise = @client.make_request_async(:post, path_template, options)
1119
+
1120
+ promise = promise.then do |result|
1121
+ http_response = result.response
1122
+ status_code = http_response.status
1123
+ response_content = http_response.body
1124
+ unless status_code == 202 || status_code == 200
1125
+ error_model = JSON.load(response_content)
1126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1127
+ end
1128
+
1129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1130
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1131
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1132
+ # Deserialize Response
1133
+ if status_code == 200
1134
+ begin
1135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1136
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1137
+ result.body = @client.deserialize(result_mapper, parsed_response)
1138
+ rescue Exception => e
1139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1140
+ end
1141
+ end
1142
+
1143
+ result
1144
+ end
1145
+
1146
+ promise.execute
1147
+ end
1148
+
839
1149
  end
840
1150
  end
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::Cosmosdb::Mgmt
6
- VERSION = '0.21.2'
6
+ VERSION = '0.22.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_cosmosdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.2
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -773,6 +773,7 @@ files:
773
773
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb
774
774
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb
775
775
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb
776
+ - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/cors_policy.rb
776
777
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb
777
778
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/data_type.rb
778
779
  - lib/2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb