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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02053227bff79836f5bfad197611029d243403c01a1d553d082a65bb1985df96
4
- data.tar.gz: 95b5daf8f69b0dcfae79380b74d0e655717e130d95cc54813915397e97654cef
3
+ metadata.gz: aae0a5cb2a6e7b17de5f5b945023b17997bcd7d5cd4adbe174ef3dfc1780d3f0
4
+ data.tar.gz: 8aa3c6fd6c8dd5b269e2992dd23e5271e6a38eaf869c55b03c898b4d19dd4e6c
5
5
  SHA512:
6
- metadata.gz: 25e3477fe4e2e8c7b6258ec50222086c97371d8c3c29cd6f7ac815646f837f08df41fd4dee2fa5858c62455d324a61633e8a900670ba8012f4474d834defe9e4
7
- data.tar.gz: c4aa8d98545984222d0a0123e271476ef42ecac7f44782abb1ec6489a18a28435684bc98d78bad77a3d136cde940c3d5c1cae8f3f503fe74ca0edb1d602e13e3
6
+ metadata.gz: 9e524d3a56daae6ece5ed24b5b90f404e78239e8eaa758f7660f0176f4d029e1d9270bc77205b36622171f7469209ce42260e75755547b69da7f1f8a81af6264
7
+ data.tar.gz: ad01e5602186f6e95001774a547e20e3799388e797eb5ca175d40a0ff45570bbfacd832db12d19ed3b74a2d4d4de77981231cf55f336b1a8d39c38ac59a4fa0c
@@ -173,7 +173,7 @@ module Azure::Cosmosdb::Mgmt::V2015_04_08
173
173
  #
174
174
  def add_telemetry
175
175
  sdk_information = 'azure_mgmt_cosmosdb'
176
- sdk_information = "#{sdk_information}/0.21.2"
176
+ sdk_information = "#{sdk_information}/0.22.0"
177
177
  add_user_agent_information(sdk_information)
178
178
  end
179
179
  end
@@ -135,7 +135,7 @@ module Azure::Cosmosdb::Mgmt::V2019_08_01_preview
135
135
  #
136
136
  def add_telemetry
137
137
  sdk_information = 'azure_mgmt_cosmosdb'
138
- sdk_information = "#{sdk_information}/0.21.2"
138
+ sdk_information = "#{sdk_information}/0.22.0"
139
139
  add_user_agent_information(sdk_information)
140
140
  end
141
141
  end
@@ -193,7 +193,7 @@ module Azure::Cosmosdb::Mgmt::V2019_08_01
193
193
  #
194
194
  def add_telemetry
195
195
  sdk_information = 'azure_mgmt_cosmosdb'
196
- sdk_information = "#{sdk_information}/0.21.2"
196
+ sdk_information = "#{sdk_information}/0.22.0"
197
197
  add_user_agent_information(sdk_information)
198
198
  end
199
199
  end
@@ -203,7 +203,7 @@ module Azure::Cosmosdb::Mgmt::V2019_12_12
203
203
  #
204
204
  def add_telemetry
205
205
  sdk_information = 'azure_mgmt_cosmosdb'
206
- sdk_information = "#{sdk_information}/0.21.2"
206
+ sdk_information = "#{sdk_information}/0.22.0"
207
207
  add_user_agent_information(sdk_information)
208
208
  end
209
209
  end
@@ -196,7 +196,7 @@ module Azure::Cosmosdb::Mgmt::V2020_03_01
196
196
  #
197
197
  def add_telemetry
198
198
  sdk_information = 'azure_mgmt_cosmosdb'
199
- sdk_information = "#{sdk_information}/0.21.2"
199
+ sdk_information = "#{sdk_information}/0.22.0"
200
200
  add_user_agent_information(sdk_information)
201
201
  end
202
202
  end
@@ -42,21 +42,23 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
42
42
  autoload :CosmosDBManagementClient, '2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb'
43
43
 
44
44
  module Models
45
+ autoload :GremlinGraphListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb'
45
46
  autoload :ErrorResponse, '2020-04-01/generated/azure_mgmt_cosmosdb/models/error_response.rb'
46
- autoload :IpAddressOrRange, '2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb'
47
+ autoload :ConsistencyPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb'
47
48
  autoload :FailoverPolicies, '2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb'
48
- autoload :Capability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb'
49
+ autoload :Location, '2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb'
49
50
  autoload :RegionForOnlineOffline, '2020-04-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb'
50
- autoload :FailoverPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb'
51
+ autoload :VirtualNetworkRule, '2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb'
51
52
  autoload :ARMResourceProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb'
52
- autoload :PrivateEndpointProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb'
53
+ autoload :PrivateLinkServiceConnectionStateProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb'
53
54
  autoload :ARMProxyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb'
54
- autoload :PartitionUsagesResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb'
55
+ autoload :ApiProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb'
56
+ autoload :ExtendedResourceProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb'
55
57
  autoload :UsagesResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb'
56
58
  autoload :CassandraKeyspaceListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb'
57
59
  autoload :SqlDatabaseGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb'
58
60
  autoload :Column, '2020-04-01/generated/azure_mgmt_cosmosdb/models/column.rb'
59
- autoload :NotebookWorkspaceListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb'
61
+ autoload :NotebookWorkspaceConnectionInfoResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb'
60
62
  autoload :CassandraPartitionKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb'
61
63
  autoload :Indexes, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexes.rb'
62
64
  autoload :ClusterKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb'
@@ -85,28 +87,27 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
85
87
  autoload :MetricListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb'
86
88
  autoload :OptionsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb'
87
89
  autoload :MongoDBDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb'
88
- autoload :GremlinGraphListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb'
90
+ autoload :IpAddressOrRange, '2020-04-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb'
89
91
  autoload :MongoIndexOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb'
90
- autoload :ConsistencyPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb'
92
+ autoload :Capability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/capability.rb'
91
93
  autoload :MongoDBCollectionGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb'
92
- autoload :Location, '2020-04-01/generated/azure_mgmt_cosmosdb/models/location.rb'
94
+ autoload :FailoverPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb'
93
95
  autoload :MetricDefinitionsListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb'
94
- autoload :VirtualNetworkRule, '2020-04-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb'
96
+ autoload :PrivateEndpointProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb'
95
97
  autoload :TableGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb'
96
- autoload :PrivateLinkServiceConnectionStateProperty, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb'
97
- autoload :MetricAvailability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb'
98
+ autoload :MetricDefinition, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb'
99
+ autoload :SqlUserDefinedFunctionResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb'
100
+ autoload :TableListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb'
101
+ autoload :CorsPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cors_policy.rb'
102
+ autoload :PartitionUsagesResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb'
98
103
  autoload :GremlinGraphResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb'
99
- autoload :CassandraKeyspaceGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb'
100
- autoload :ExtendedResourceProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb'
101
- autoload :DatabaseAccountsListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb'
102
104
  autoload :ThroughputPolicyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb'
103
- autoload :SqlDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb'
105
+ autoload :IncludedPath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb'
104
106
  autoload :AutoUpgradePolicyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb'
105
- autoload :CompositePath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb'
107
+ autoload :IndexingPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb'
106
108
  autoload :AutoscaleSettingsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb'
107
- autoload :UniqueKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb'
109
+ autoload :ConflictResolutionPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb'
108
110
  autoload :ThroughputSettingsGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb'
109
- autoload :SqlUserDefinedFunctionResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb'
110
111
  autoload :SqlContainerListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb'
111
112
  autoload :GremlinDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb'
112
113
  autoload :SqlUserDefinedFunctionGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb'
@@ -119,11 +120,11 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
119
120
  autoload :CassandraKeyspaceResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb'
120
121
  autoload :MongoDBCollectionListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb'
121
122
  autoload :DatabaseAccountConnectionString, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb'
122
- autoload :TableListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb'
123
+ autoload :CassandraKeyspaceGetPropertiesResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb'
123
124
  autoload :DatabaseAccountListConnectionStringsResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb'
124
- autoload :NotebookWorkspaceConnectionInfoResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb'
125
+ autoload :SqlDatabaseListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb'
125
126
  autoload :DatabaseAccountRegenerateKeyParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb'
126
- autoload :IndexingPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb'
127
+ autoload :UniqueKey, '2020-04-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb'
127
128
  autoload :ThroughputSettingsResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb'
128
129
  autoload :PartitionMetricListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb'
129
130
  autoload :TableResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb'
@@ -131,19 +132,18 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
131
132
  autoload :SqlDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb'
132
133
  autoload :MetricValue, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb'
133
134
  autoload :AutoscaleSettings, '2020-04-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb'
134
- autoload :ApiProperties, '2020-04-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb'
135
+ autoload :DatabaseAccountsListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb'
135
136
  autoload :CreateUpdateOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb'
136
- autoload :ConflictResolutionPolicy, '2020-04-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb'
137
+ autoload :NotebookWorkspaceListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb'
137
138
  autoload :MongoDBCollectionResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb'
138
139
  autoload :MongoIndexKeys, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb'
139
140
  autoload :SqlContainerResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb'
140
- autoload :IncludedPath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/included_path.rb'
141
+ autoload :CompositePath, '2020-04-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb'
141
142
  autoload :MongoDBDatabaseResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb'
142
- autoload :MetricDefinition, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb'
143
+ autoload :MetricAvailability, '2020-04-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb'
143
144
  autoload :SqlStoredProcedureResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb'
144
145
  autoload :SqlUserDefinedFunctionListResult, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb'
145
146
  autoload :SqlTriggerResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb'
146
- autoload :ProxyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb'
147
147
  autoload :PrivateEndpointConnection, '2020-04-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb'
148
148
  autoload :DatabaseAccountGetResults, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb'
149
149
  autoload :SqlDatabaseGetPropertiesOptions, '2020-04-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb'
@@ -188,6 +188,7 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
188
188
  autoload :PartitionMetric, '2020-04-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb'
189
189
  autoload :TrackedResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb'
190
190
  autoload :AzureEntityResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb'
191
+ autoload :ProxyResource, '2020-04-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb'
191
192
  autoload :NotebookWorkspaceCreateUpdateParameters, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb'
192
193
  autoload :NotebookWorkspace, '2020-04-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb'
193
194
  autoload :DatabaseAccountKind, '2020-04-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb'
@@ -499,6 +499,100 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
499
499
  promise
500
500
  end
501
501
 
502
+ #
503
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
504
+ # autoscale
505
+ #
506
+ # @param resource_group_name [String] The name of the resource group. The name
507
+ # is case insensitive.
508
+ # @param account_name [String] Cosmos DB database account name.
509
+ # @param keyspace_name [String] Cosmos DB keyspace name.
510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
511
+ # will be added to the HTTP request.
512
+ #
513
+ # @return [ThroughputSettingsGetResults] operation results.
514
+ #
515
+ def migrate_cassandra_keyspace_to_autoscale(resource_group_name, account_name, keyspace_name, custom_headers:nil)
516
+ response = migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
517
+ response.body unless response.nil?
518
+ end
519
+
520
+ #
521
+ # @param resource_group_name [String] The name of the resource group. The name
522
+ # is case insensitive.
523
+ # @param account_name [String] Cosmos DB database account name.
524
+ # @param keyspace_name [String] Cosmos DB keyspace name.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [Concurrent::Promise] promise which provides async access to http
529
+ # response.
530
+ #
531
+ def migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
532
+ # Send request
533
+ promise = begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers)
534
+
535
+ promise = promise.then do |response|
536
+ # Defining deserialization method.
537
+ deserialize_method = lambda do |parsed_response|
538
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
539
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
540
+ end
541
+
542
+ # Waiting for response.
543
+ @client.get_long_running_operation_result(response, deserialize_method)
544
+ end
545
+
546
+ promise
547
+ end
548
+
549
+ #
550
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
551
+ # throughput
552
+ #
553
+ # @param resource_group_name [String] The name of the resource group. The name
554
+ # is case insensitive.
555
+ # @param account_name [String] Cosmos DB database account name.
556
+ # @param keyspace_name [String] Cosmos DB keyspace name.
557
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
558
+ # will be added to the HTTP request.
559
+ #
560
+ # @return [ThroughputSettingsGetResults] operation results.
561
+ #
562
+ def migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil)
563
+ response = migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
564
+ response.body unless response.nil?
565
+ end
566
+
567
+ #
568
+ # @param resource_group_name [String] The name of the resource group. The name
569
+ # is case insensitive.
570
+ # @param account_name [String] Cosmos DB database account name.
571
+ # @param keyspace_name [String] Cosmos DB keyspace name.
572
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
573
+ # will be added to the HTTP request.
574
+ #
575
+ # @return [Concurrent::Promise] promise which provides async access to http
576
+ # response.
577
+ #
578
+ def migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
579
+ # Send request
580
+ promise = begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers)
581
+
582
+ promise = promise.then do |response|
583
+ # Defining deserialization method.
584
+ deserialize_method = lambda do |parsed_response|
585
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
586
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
587
+ end
588
+
589
+ # Waiting for response.
590
+ @client.get_long_running_operation_result(response, deserialize_method)
591
+ end
592
+
593
+ promise
594
+ end
595
+
502
596
  #
503
597
  # Lists the Cassandra table under an existing Azure Cosmos DB database account.
504
598
  #
@@ -987,6 +1081,104 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
987
1081
  promise
988
1082
  end
989
1083
 
1084
+ #
1085
+ # Migrate an Azure Cosmos DB Cassandra table from manual throughput to
1086
+ # autoscale
1087
+ #
1088
+ # @param resource_group_name [String] The name of the resource group. The name
1089
+ # is case insensitive.
1090
+ # @param account_name [String] Cosmos DB database account name.
1091
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1092
+ # @param table_name [String] Cosmos DB table name.
1093
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1094
+ # will be added to the HTTP request.
1095
+ #
1096
+ # @return [ThroughputSettingsGetResults] operation results.
1097
+ #
1098
+ def migrate_cassandra_table_to_autoscale(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1099
+ response = migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1100
+ response.body unless response.nil?
1101
+ end
1102
+
1103
+ #
1104
+ # @param resource_group_name [String] The name of the resource group. The name
1105
+ # is case insensitive.
1106
+ # @param account_name [String] Cosmos DB database account name.
1107
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1108
+ # @param table_name [String] Cosmos DB table name.
1109
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1110
+ # will be added to the HTTP request.
1111
+ #
1112
+ # @return [Concurrent::Promise] promise which provides async access to http
1113
+ # response.
1114
+ #
1115
+ def migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1116
+ # Send request
1117
+ promise = begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers)
1118
+
1119
+ promise = promise.then do |response|
1120
+ # Defining deserialization method.
1121
+ deserialize_method = lambda do |parsed_response|
1122
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1123
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1124
+ end
1125
+
1126
+ # Waiting for response.
1127
+ @client.get_long_running_operation_result(response, deserialize_method)
1128
+ end
1129
+
1130
+ promise
1131
+ end
1132
+
1133
+ #
1134
+ # Migrate an Azure Cosmos DB Cassandra table from autoscale to manual
1135
+ # throughput
1136
+ #
1137
+ # @param resource_group_name [String] The name of the resource group. The name
1138
+ # is case insensitive.
1139
+ # @param account_name [String] Cosmos DB database account name.
1140
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1141
+ # @param table_name [String] Cosmos DB table name.
1142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1143
+ # will be added to the HTTP request.
1144
+ #
1145
+ # @return [ThroughputSettingsGetResults] operation results.
1146
+ #
1147
+ def migrate_cassandra_table_to_manual_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1148
+ response = migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1149
+ response.body unless response.nil?
1150
+ end
1151
+
1152
+ #
1153
+ # @param resource_group_name [String] The name of the resource group. The name
1154
+ # is case insensitive.
1155
+ # @param account_name [String] Cosmos DB database account name.
1156
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1157
+ # @param table_name [String] Cosmos DB table name.
1158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1159
+ # will be added to the HTTP request.
1160
+ #
1161
+ # @return [Concurrent::Promise] promise which provides async access to http
1162
+ # response.
1163
+ #
1164
+ def migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1165
+ # Send request
1166
+ promise = begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers)
1167
+
1168
+ promise = promise.then do |response|
1169
+ # Defining deserialization method.
1170
+ deserialize_method = lambda do |parsed_response|
1171
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1172
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1173
+ end
1174
+
1175
+ # Waiting for response.
1176
+ @client.get_long_running_operation_result(response, deserialize_method)
1177
+ end
1178
+
1179
+ promise
1180
+ end
1181
+
990
1182
  #
991
1183
  # Create or update an Azure Cosmos DB Cassandra keyspace
992
1184
  #
@@ -1338,63 +1530,54 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1338
1530
  end
1339
1531
 
1340
1532
  #
1341
- # Create or update an Azure Cosmos DB Cassandra Table
1533
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1534
+ # autoscale
1342
1535
  #
1343
1536
  # @param resource_group_name [String] The name of the resource group. The name
1344
1537
  # is case insensitive.
1345
1538
  # @param account_name [String] Cosmos DB database account name.
1346
1539
  # @param keyspace_name [String] Cosmos DB keyspace name.
1347
- # @param table_name [String] Cosmos DB table name.
1348
- # @param create_update_cassandra_table_parameters
1349
- # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1350
- # current Cassandra Table.
1351
1540
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1352
1541
  # will be added to the HTTP request.
1353
1542
  #
1354
- # @return [CassandraTableGetResults] operation results.
1543
+ # @return [ThroughputSettingsGetResults] operation results.
1355
1544
  #
1356
- def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1357
- response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
1545
+ def begin_migrate_cassandra_keyspace_to_autoscale(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1546
+ response = begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1358
1547
  response.body unless response.nil?
1359
1548
  end
1360
1549
 
1361
1550
  #
1362
- # Create or update an Azure Cosmos DB Cassandra Table
1551
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1552
+ # autoscale
1363
1553
  #
1364
1554
  # @param resource_group_name [String] The name of the resource group. The name
1365
1555
  # is case insensitive.
1366
1556
  # @param account_name [String] Cosmos DB database account name.
1367
1557
  # @param keyspace_name [String] Cosmos DB keyspace name.
1368
- # @param table_name [String] Cosmos DB table name.
1369
- # @param create_update_cassandra_table_parameters
1370
- # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1371
- # current Cassandra Table.
1372
1558
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1373
1559
  # will be added to the HTTP request.
1374
1560
  #
1375
1561
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1376
1562
  #
1377
- def begin_create_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1378
- begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
1563
+ def begin_migrate_cassandra_keyspace_to_autoscale_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1564
+ begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1379
1565
  end
1380
1566
 
1381
1567
  #
1382
- # Create or update an Azure Cosmos DB Cassandra Table
1568
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1569
+ # autoscale
1383
1570
  #
1384
1571
  # @param resource_group_name [String] The name of the resource group. The name
1385
1572
  # is case insensitive.
1386
1573
  # @param account_name [String] Cosmos DB database account name.
1387
1574
  # @param keyspace_name [String] Cosmos DB keyspace name.
1388
- # @param table_name [String] Cosmos DB table name.
1389
- # @param create_update_cassandra_table_parameters
1390
- # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1391
- # current Cassandra Table.
1392
1575
  # @param [Hash{String => String}] A hash of custom headers that will be added
1393
1576
  # to the HTTP request.
1394
1577
  #
1395
1578
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1396
1579
  #
1397
- def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1580
+ def begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1398
1581
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1399
1582
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1400
1583
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -1406,10 +1589,8 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1406
1589
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1407
1590
  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?
1408
1591
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1409
- fail ArgumentError, 'table_name is nil' if table_name.nil?
1410
1592
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1411
1593
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1412
- fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil?
1413
1594
 
1414
1595
 
1415
1596
  request_headers = {}
@@ -1418,25 +1599,18 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1418
1599
  # Set Headers
1419
1600
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1420
1601
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1421
-
1422
- # Serialize Request
1423
- request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableCreateUpdateParameters.mapper()
1424
- request_content = @client.serialize(request_mapper, create_update_cassandra_table_parameters)
1425
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1426
-
1427
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'
1602
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale'
1428
1603
 
1429
1604
  request_url = @base_url || @client.base_url
1430
1605
 
1431
1606
  options = {
1432
1607
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1433
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
1608
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1434
1609
  query_params: {'api-version' => @client.api_version},
1435
- body: request_content,
1436
1610
  headers: request_headers.merge(custom_headers || {}),
1437
1611
  base_url: request_url
1438
1612
  }
1439
- promise = @client.make_request_async(:put, path_template, options)
1613
+ promise = @client.make_request_async(:post, path_template, options)
1440
1614
 
1441
1615
  promise = promise.then do |result|
1442
1616
  http_response = result.response
@@ -1454,7 +1628,7 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1454
1628
  if status_code == 200
1455
1629
  begin
1456
1630
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1457
- result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableGetResults.mapper()
1631
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1458
1632
  result.body = @client.deserialize(result_mapper, parsed_response)
1459
1633
  rescue Exception => e
1460
1634
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
@@ -1468,53 +1642,54 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1468
1642
  end
1469
1643
 
1470
1644
  #
1471
- # Deletes an existing Azure Cosmos DB Cassandra table.
1645
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1646
+ # throughput
1472
1647
  #
1473
1648
  # @param resource_group_name [String] The name of the resource group. The name
1474
1649
  # is case insensitive.
1475
1650
  # @param account_name [String] Cosmos DB database account name.
1476
1651
  # @param keyspace_name [String] Cosmos DB keyspace name.
1477
- # @param table_name [String] Cosmos DB table name.
1478
1652
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1479
1653
  # will be added to the HTTP request.
1480
1654
  #
1655
+ # @return [ThroughputSettingsGetResults] operation results.
1481
1656
  #
1482
- def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1483
- response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1484
- nil
1657
+ def begin_migrate_cassandra_keyspace_to_manual_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1658
+ response = begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1659
+ response.body unless response.nil?
1485
1660
  end
1486
1661
 
1487
1662
  #
1488
- # Deletes an existing Azure Cosmos DB Cassandra table.
1663
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1664
+ # throughput
1489
1665
  #
1490
1666
  # @param resource_group_name [String] The name of the resource group. The name
1491
1667
  # is case insensitive.
1492
1668
  # @param account_name [String] Cosmos DB database account name.
1493
1669
  # @param keyspace_name [String] Cosmos DB keyspace name.
1494
- # @param table_name [String] Cosmos DB table name.
1495
1670
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1496
1671
  # will be added to the HTTP request.
1497
1672
  #
1498
1673
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1499
1674
  #
1500
- def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1501
- begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1675
+ def begin_migrate_cassandra_keyspace_to_manual_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1676
+ begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1502
1677
  end
1503
1678
 
1504
1679
  #
1505
- # Deletes an existing Azure Cosmos DB Cassandra table.
1680
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1681
+ # throughput
1506
1682
  #
1507
1683
  # @param resource_group_name [String] The name of the resource group. The name
1508
1684
  # is case insensitive.
1509
1685
  # @param account_name [String] Cosmos DB database account name.
1510
1686
  # @param keyspace_name [String] Cosmos DB keyspace name.
1511
- # @param table_name [String] Cosmos DB table name.
1512
1687
  # @param [Hash{String => String}] A hash of custom headers that will be added
1513
1688
  # to the HTTP request.
1514
1689
  #
1515
1690
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1516
1691
  #
1517
- def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1692
+ def begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1518
1693
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1519
1694
  fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1520
1695
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
@@ -1526,7 +1701,6 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1526
1701
  fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1527
1702
  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?
1528
1703
  fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1529
- fail ArgumentError, 'table_name is nil' if table_name.nil?
1530
1704
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1531
1705
  fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1532
1706
 
@@ -1537,24 +1711,24 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1537
1711
  # Set Headers
1538
1712
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1539
1713
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1540
- path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'
1714
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput'
1541
1715
 
1542
1716
  request_url = @base_url || @client.base_url
1543
1717
 
1544
1718
  options = {
1545
1719
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1546
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
1720
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1547
1721
  query_params: {'api-version' => @client.api_version},
1548
1722
  headers: request_headers.merge(custom_headers || {}),
1549
1723
  base_url: request_url
1550
1724
  }
1551
- promise = @client.make_request_async(:delete, path_template, options)
1725
+ promise = @client.make_request_async(:post, path_template, options)
1552
1726
 
1553
1727
  promise = promise.then do |result|
1554
1728
  http_response = result.response
1555
1729
  status_code = http_response.status
1556
1730
  response_content = http_response.body
1557
- unless status_code == 202 || status_code == 204
1731
+ unless status_code == 202 || status_code == 200
1558
1732
  error_model = JSON.load(response_content)
1559
1733
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1560
1734
  end
@@ -1562,6 +1736,16 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1562
1736
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1563
1737
  result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1564
1738
  result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1739
+ # Deserialize Response
1740
+ if status_code == 200
1741
+ begin
1742
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1743
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
1744
+ result.body = @client.deserialize(result_mapper, parsed_response)
1745
+ rescue Exception => e
1746
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1747
+ end
1748
+ end
1565
1749
 
1566
1750
  result
1567
1751
  end
@@ -1570,35 +1754,267 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1570
1754
  end
1571
1755
 
1572
1756
  #
1573
- # Update RUs per second of an Azure Cosmos DB Cassandra table
1757
+ # Create or update an Azure Cosmos DB Cassandra Table
1574
1758
  #
1575
1759
  # @param resource_group_name [String] The name of the resource group. The name
1576
1760
  # is case insensitive.
1577
1761
  # @param account_name [String] Cosmos DB database account name.
1578
1762
  # @param keyspace_name [String] Cosmos DB keyspace name.
1579
1763
  # @param table_name [String] Cosmos DB table name.
1580
- # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1581
- # RUs per second of the parameters to provide for the current Cassandra table.
1764
+ # @param create_update_cassandra_table_parameters
1765
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1766
+ # current Cassandra Table.
1582
1767
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1583
1768
  # will be added to the HTTP request.
1584
1769
  #
1585
- # @return [ThroughputSettingsGetResults] operation results.
1770
+ # @return [CassandraTableGetResults] operation results.
1586
1771
  #
1587
- def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
1588
- response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
1772
+ def begin_create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1773
+ response = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
1589
1774
  response.body unless response.nil?
1590
1775
  end
1591
1776
 
1592
1777
  #
1593
- # Update RUs per second of an Azure Cosmos DB Cassandra table
1778
+ # Create or update an Azure Cosmos DB Cassandra Table
1594
1779
  #
1595
1780
  # @param resource_group_name [String] The name of the resource group. The name
1596
1781
  # is case insensitive.
1597
1782
  # @param account_name [String] Cosmos DB database account name.
1598
1783
  # @param keyspace_name [String] Cosmos DB keyspace name.
1599
1784
  # @param table_name [String] Cosmos DB table name.
1600
- # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1601
- # RUs per second of the parameters to provide for the current Cassandra table.
1785
+ # @param create_update_cassandra_table_parameters
1786
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1787
+ # current Cassandra Table.
1788
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1789
+ # will be added to the HTTP request.
1790
+ #
1791
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1792
+ #
1793
+ def begin_create_update_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1794
+ begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
1795
+ end
1796
+
1797
+ #
1798
+ # Create or update an Azure Cosmos DB Cassandra Table
1799
+ #
1800
+ # @param resource_group_name [String] The name of the resource group. The name
1801
+ # is case insensitive.
1802
+ # @param account_name [String] Cosmos DB database account name.
1803
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1804
+ # @param table_name [String] Cosmos DB table name.
1805
+ # @param create_update_cassandra_table_parameters
1806
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1807
+ # current Cassandra Table.
1808
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1809
+ # to the HTTP request.
1810
+ #
1811
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1812
+ #
1813
+ def begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
1814
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1815
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1816
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1817
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1818
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1819
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1820
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1821
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1822
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1823
+ 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?
1824
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1825
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
1826
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1827
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1828
+ fail ArgumentError, 'create_update_cassandra_table_parameters is nil' if create_update_cassandra_table_parameters.nil?
1829
+
1830
+
1831
+ request_headers = {}
1832
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1833
+
1834
+ # Set Headers
1835
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1836
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1837
+
1838
+ # Serialize Request
1839
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableCreateUpdateParameters.mapper()
1840
+ request_content = @client.serialize(request_mapper, create_update_cassandra_table_parameters)
1841
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1842
+
1843
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'
1844
+
1845
+ request_url = @base_url || @client.base_url
1846
+
1847
+ options = {
1848
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1849
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
1850
+ query_params: {'api-version' => @client.api_version},
1851
+ body: request_content,
1852
+ headers: request_headers.merge(custom_headers || {}),
1853
+ base_url: request_url
1854
+ }
1855
+ promise = @client.make_request_async(:put, path_template, options)
1856
+
1857
+ promise = promise.then do |result|
1858
+ http_response = result.response
1859
+ status_code = http_response.status
1860
+ response_content = http_response.body
1861
+ unless status_code == 202 || status_code == 200
1862
+ error_model = JSON.load(response_content)
1863
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1864
+ end
1865
+
1866
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1867
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1868
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1869
+ # Deserialize Response
1870
+ if status_code == 200
1871
+ begin
1872
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1873
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::CassandraTableGetResults.mapper()
1874
+ result.body = @client.deserialize(result_mapper, parsed_response)
1875
+ rescue Exception => e
1876
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1877
+ end
1878
+ end
1879
+
1880
+ result
1881
+ end
1882
+
1883
+ promise.execute
1884
+ end
1885
+
1886
+ #
1887
+ # Deletes an existing Azure Cosmos DB Cassandra table.
1888
+ #
1889
+ # @param resource_group_name [String] The name of the resource group. The name
1890
+ # is case insensitive.
1891
+ # @param account_name [String] Cosmos DB database account name.
1892
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1893
+ # @param table_name [String] Cosmos DB table name.
1894
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1895
+ # will be added to the HTTP request.
1896
+ #
1897
+ #
1898
+ def begin_delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1899
+ response = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1900
+ nil
1901
+ end
1902
+
1903
+ #
1904
+ # Deletes an existing Azure Cosmos DB Cassandra table.
1905
+ #
1906
+ # @param resource_group_name [String] The name of the resource group. The name
1907
+ # is case insensitive.
1908
+ # @param account_name [String] Cosmos DB database account name.
1909
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1910
+ # @param table_name [String] Cosmos DB table name.
1911
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1912
+ # will be added to the HTTP request.
1913
+ #
1914
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1915
+ #
1916
+ def begin_delete_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1917
+ begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
1918
+ end
1919
+
1920
+ #
1921
+ # Deletes an existing Azure Cosmos DB Cassandra table.
1922
+ #
1923
+ # @param resource_group_name [String] The name of the resource group. The name
1924
+ # is case insensitive.
1925
+ # @param account_name [String] Cosmos DB database account name.
1926
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1927
+ # @param table_name [String] Cosmos DB table name.
1928
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1929
+ # to the HTTP request.
1930
+ #
1931
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1932
+ #
1933
+ def begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
1934
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1935
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1936
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1937
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1938
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1939
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1940
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1941
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1942
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1943
+ 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?
1944
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1945
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
1946
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1947
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1948
+
1949
+
1950
+ request_headers = {}
1951
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1952
+
1953
+ # Set Headers
1954
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1955
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1956
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'
1957
+
1958
+ request_url = @base_url || @client.base_url
1959
+
1960
+ options = {
1961
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1962
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
1963
+ query_params: {'api-version' => @client.api_version},
1964
+ headers: request_headers.merge(custom_headers || {}),
1965
+ base_url: request_url
1966
+ }
1967
+ promise = @client.make_request_async(:delete, path_template, options)
1968
+
1969
+ promise = promise.then do |result|
1970
+ http_response = result.response
1971
+ status_code = http_response.status
1972
+ response_content = http_response.body
1973
+ unless status_code == 202 || status_code == 204
1974
+ error_model = JSON.load(response_content)
1975
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1976
+ end
1977
+
1978
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1979
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1980
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1981
+
1982
+ result
1983
+ end
1984
+
1985
+ promise.execute
1986
+ end
1987
+
1988
+ #
1989
+ # Update RUs per second of an Azure Cosmos DB Cassandra table
1990
+ #
1991
+ # @param resource_group_name [String] The name of the resource group. The name
1992
+ # is case insensitive.
1993
+ # @param account_name [String] Cosmos DB database account name.
1994
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1995
+ # @param table_name [String] Cosmos DB table name.
1996
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1997
+ # RUs per second of the parameters to provide for the current Cassandra table.
1998
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1999
+ # will be added to the HTTP request.
2000
+ #
2001
+ # @return [ThroughputSettingsGetResults] operation results.
2002
+ #
2003
+ def begin_update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
2004
+ response = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
2005
+ response.body unless response.nil?
2006
+ end
2007
+
2008
+ #
2009
+ # Update RUs per second of an Azure Cosmos DB Cassandra table
2010
+ #
2011
+ # @param resource_group_name [String] The name of the resource group. The name
2012
+ # is case insensitive.
2013
+ # @param account_name [String] Cosmos DB database account name.
2014
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2015
+ # @param table_name [String] Cosmos DB table name.
2016
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
2017
+ # RUs per second of the parameters to provide for the current Cassandra table.
1602
2018
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1603
2019
  # will be added to the HTTP request.
1604
2020
  #
@@ -1696,5 +2112,237 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
1696
2112
  promise.execute
1697
2113
  end
1698
2114
 
2115
+ #
2116
+ # Migrate an Azure Cosmos DB Cassandra table from manual throughput to
2117
+ # autoscale
2118
+ #
2119
+ # @param resource_group_name [String] The name of the resource group. The name
2120
+ # is case insensitive.
2121
+ # @param account_name [String] Cosmos DB database account name.
2122
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2123
+ # @param table_name [String] Cosmos DB table name.
2124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2125
+ # will be added to the HTTP request.
2126
+ #
2127
+ # @return [ThroughputSettingsGetResults] operation results.
2128
+ #
2129
+ def begin_migrate_cassandra_table_to_autoscale(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2130
+ response = begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
2131
+ response.body unless response.nil?
2132
+ end
2133
+
2134
+ #
2135
+ # Migrate an Azure Cosmos DB Cassandra table from manual throughput to
2136
+ # autoscale
2137
+ #
2138
+ # @param resource_group_name [String] The name of the resource group. The name
2139
+ # is case insensitive.
2140
+ # @param account_name [String] Cosmos DB database account name.
2141
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2142
+ # @param table_name [String] Cosmos DB table name.
2143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2144
+ # will be added to the HTTP request.
2145
+ #
2146
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2147
+ #
2148
+ def begin_migrate_cassandra_table_to_autoscale_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2149
+ begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
2150
+ end
2151
+
2152
+ #
2153
+ # Migrate an Azure Cosmos DB Cassandra table from manual throughput to
2154
+ # autoscale
2155
+ #
2156
+ # @param resource_group_name [String] The name of the resource group. The name
2157
+ # is case insensitive.
2158
+ # @param account_name [String] Cosmos DB database account name.
2159
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2160
+ # @param table_name [String] Cosmos DB table name.
2161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2162
+ # to the HTTP request.
2163
+ #
2164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2165
+ #
2166
+ def begin_migrate_cassandra_table_to_autoscale_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2167
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2168
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2169
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2170
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2171
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2172
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2173
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2174
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2175
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2176
+ 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?
2177
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
2178
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
2179
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2180
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2181
+
2182
+
2183
+ request_headers = {}
2184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2185
+
2186
+ # Set Headers
2187
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2188
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2189
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'
2190
+
2191
+ request_url = @base_url || @client.base_url
2192
+
2193
+ options = {
2194
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2195
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
2196
+ query_params: {'api-version' => @client.api_version},
2197
+ headers: request_headers.merge(custom_headers || {}),
2198
+ base_url: request_url
2199
+ }
2200
+ promise = @client.make_request_async(:post, path_template, options)
2201
+
2202
+ promise = promise.then do |result|
2203
+ http_response = result.response
2204
+ status_code = http_response.status
2205
+ response_content = http_response.body
2206
+ unless status_code == 202 || status_code == 200
2207
+ error_model = JSON.load(response_content)
2208
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2209
+ end
2210
+
2211
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2212
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2213
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2214
+ # Deserialize Response
2215
+ if status_code == 200
2216
+ begin
2217
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2218
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
2219
+ result.body = @client.deserialize(result_mapper, parsed_response)
2220
+ rescue Exception => e
2221
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2222
+ end
2223
+ end
2224
+
2225
+ result
2226
+ end
2227
+
2228
+ promise.execute
2229
+ end
2230
+
2231
+ #
2232
+ # Migrate an Azure Cosmos DB Cassandra table from autoscale to manual
2233
+ # throughput
2234
+ #
2235
+ # @param resource_group_name [String] The name of the resource group. The name
2236
+ # is case insensitive.
2237
+ # @param account_name [String] Cosmos DB database account name.
2238
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2239
+ # @param table_name [String] Cosmos DB table name.
2240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2241
+ # will be added to the HTTP request.
2242
+ #
2243
+ # @return [ThroughputSettingsGetResults] operation results.
2244
+ #
2245
+ def begin_migrate_cassandra_table_to_manual_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2246
+ response = begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
2247
+ response.body unless response.nil?
2248
+ end
2249
+
2250
+ #
2251
+ # Migrate an Azure Cosmos DB Cassandra table from autoscale to manual
2252
+ # throughput
2253
+ #
2254
+ # @param resource_group_name [String] The name of the resource group. The name
2255
+ # is case insensitive.
2256
+ # @param account_name [String] Cosmos DB database account name.
2257
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2258
+ # @param table_name [String] Cosmos DB table name.
2259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2260
+ # will be added to the HTTP request.
2261
+ #
2262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2263
+ #
2264
+ def begin_migrate_cassandra_table_to_manual_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2265
+ begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
2266
+ end
2267
+
2268
+ #
2269
+ # Migrate an Azure Cosmos DB Cassandra table from autoscale to manual
2270
+ # throughput
2271
+ #
2272
+ # @param resource_group_name [String] The name of the resource group. The name
2273
+ # is case insensitive.
2274
+ # @param account_name [String] Cosmos DB database account name.
2275
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2276
+ # @param table_name [String] Cosmos DB table name.
2277
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2278
+ # to the HTTP request.
2279
+ #
2280
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2281
+ #
2282
+ def begin_migrate_cassandra_table_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
2283
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2284
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2286
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2287
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2288
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2289
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2290
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2291
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2292
+ 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?
2293
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
2294
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
2295
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2296
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2297
+
2298
+
2299
+ request_headers = {}
2300
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2301
+
2302
+ # Set Headers
2303
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2304
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2305
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'
2306
+
2307
+ request_url = @base_url || @client.base_url
2308
+
2309
+ options = {
2310
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2311
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
2312
+ query_params: {'api-version' => @client.api_version},
2313
+ headers: request_headers.merge(custom_headers || {}),
2314
+ base_url: request_url
2315
+ }
2316
+ promise = @client.make_request_async(:post, path_template, options)
2317
+
2318
+ promise = promise.then do |result|
2319
+ http_response = result.response
2320
+ status_code = http_response.status
2321
+ response_content = http_response.body
2322
+ unless status_code == 202 || status_code == 200
2323
+ error_model = JSON.load(response_content)
2324
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2325
+ end
2326
+
2327
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2328
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2329
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2330
+ # Deserialize Response
2331
+ if status_code == 200
2332
+ begin
2333
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2334
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_04_01::Models::ThroughputSettingsGetResults.mapper()
2335
+ result.body = @client.deserialize(result_mapper, parsed_response)
2336
+ rescue Exception => e
2337
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2338
+ end
2339
+ end
2340
+
2341
+ result
2342
+ end
2343
+
2344
+ promise.execute
2345
+ end
2346
+
1699
2347
  end
1700
2348
  end