azure_mgmt_cosmosdb 0.23.1 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) 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-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +0 -1
  8. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  9. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  10. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  11. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb.rb +228 -0
  12. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +2348 -0
  13. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection.rb +389 -0
  14. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition.rb +279 -0
  15. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +161 -0
  16. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_region.rb +161 -0
  17. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +211 -0
  18. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database.rb +377 -0
  19. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database_account_region.rb +153 -0
  20. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database_accounts.rb +2281 -0
  21. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +2335 -0
  22. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/api_properties.rb +48 -0
  23. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  24. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb +102 -0
  25. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb +48 -0
  26. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb +48 -0
  27. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb +73 -0
  28. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +77 -0
  29. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy.rb +47 -0
  30. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy_type.rb +16 -0
  31. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
  32. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +112 -0
  33. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb +53 -0
  34. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb +85 -0
  35. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb +110 -0
  36. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
  37. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
  38. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
  39. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
  40. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +112 -0
  41. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb +53 -0
  42. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb +119 -0
  43. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb +110 -0
  44. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
  45. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +80 -0
  46. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
  47. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
  48. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path.rb +60 -0
  49. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb +16 -0
  50. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
  51. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
  52. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +15 -0
  53. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
  54. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +99 -0
  55. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/continuous_mode_backup_policy.rb +50 -0
  56. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cors_policy.rb +99 -0
  57. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/create_update_options.rb +61 -0
  58. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
  59. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
  60. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +424 -0
  61. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +537 -0
  62. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
  63. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
  64. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +77 -0
  65. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
  66. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
  67. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
  68. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +375 -0
  69. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
  70. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
  71. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  72. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response_updated_format.rb +47 -0
  73. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
  74. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +74 -0
  75. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
  76. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
  77. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +112 -0
  78. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb +53 -0
  79. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb +85 -0
  80. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb +110 -0
  81. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
  82. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
  83. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +112 -0
  84. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb +53 -0
  85. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb +150 -0
  86. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb +110 -0
  87. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +58 -0
  88. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
  89. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
  90. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
  91. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
  92. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
  93. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +147 -0
  94. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb +51 -0
  95. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
  96. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/location.rb +114 -0
  97. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity.rb +102 -0
  98. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity_user_assigned_identities_value.rb +61 -0
  99. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
  100. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
  101. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
  102. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
  103. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
  104. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
  105. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
  106. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +112 -0
  107. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb +53 -0
  108. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb +136 -0
  109. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb +110 -0
  110. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
  111. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +97 -0
  112. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +112 -0
  113. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb +53 -0
  114. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb +85 -0
  115. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb +110 -0
  116. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
  117. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
  118. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
  119. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
  120. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
  121. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/network_acl_bypass.rb +16 -0
  122. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb +87 -0
  123. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb +60 -0
  124. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb +62 -0
  125. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb +56 -0
  126. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
  127. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
  128. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
  129. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/options_resource.rb +60 -0
  130. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +17 -0
  131. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
  132. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
  133. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
  134. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
  135. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
  136. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
  137. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
  138. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_backup_policy.rb +63 -0
  139. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_properties.rb +65 -0
  140. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
  141. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +110 -0
  142. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection_list_result.rb +56 -0
  143. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb +46 -0
  144. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource.rb +115 -0
  145. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource_list_result.rb +55 -0
  146. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb +71 -0
  147. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +65 -0
  148. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/public_network_access.rb +16 -0
  149. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
  150. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/resource.rb +86 -0
  151. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/resource_identity_type.rb +18 -0
  152. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/server_version.rb +17 -0
  153. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb +67 -0
  154. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_type.rb +18 -0
  155. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +111 -0
  156. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb +53 -0
  157. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb +161 -0
  158. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb +110 -0
  159. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +58 -0
  160. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +122 -0
  161. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +112 -0
  162. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb +53 -0
  163. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb +109 -0
  164. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb +110 -0
  165. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
  166. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
  167. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb +112 -0
  168. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb +96 -0
  169. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb +98 -0
  170. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb +58 -0
  171. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb +57 -0
  172. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb +111 -0
  173. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb +121 -0
  174. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb +98 -0
  175. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb +58 -0
  176. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb +82 -0
  177. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb +113 -0
  178. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb +97 -0
  179. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb +98 -0
  180. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb +58 -0
  181. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb +57 -0
  182. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +111 -0
  183. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb +53 -0
  184. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb +85 -0
  185. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_results.rb +110 -0
  186. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
  187. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
  188. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb +59 -0
  189. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb +124 -0
  190. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb +98 -0
  191. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb +86 -0
  192. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb +99 -0
  193. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +95 -0
  194. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb +19 -0
  195. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_type.rb +16 -0
  196. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
  197. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
  198. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
  199. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
  200. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
  201. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
  202. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  203. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +2354 -0
  204. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +905 -0
  205. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/operations.rb +220 -0
  206. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +161 -0
  207. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +168 -0
  208. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile.rb +146 -0
  209. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +163 -0
  210. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile_target.rb +153 -0
  211. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/private_endpoint_connections.rb +560 -0
  212. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/private_link_resources.rb +245 -0
  213. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/sql_resources.rb +4065 -0
  214. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/table_resources.rb +1150 -0
  215. data/lib/azure_mgmt_cosmosdb.rb +1 -0
  216. data/lib/profiles/latest/modules/cosmosdb_profile_module.rb +497 -489
  217. data/lib/version.rb +1 -1
  218. metadata +206 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ef0449ebb4759174fa5645530ee37fbd6c06985e5b449f800113c0a059c91c0
4
- data.tar.gz: 9d42a2095bb1c1df79b03386a1bf9b1cce8246019b6da6a01bbf3fafc449fa38
3
+ metadata.gz: 0a912c41bdf36ec51d9026da29df7d3a68677300c2723996e712fcf81a11ca54
4
+ data.tar.gz: f315bab3c361cc32a60ad493c1d8ca9f2017d315e0a4e017eb25ed1699d3401d
5
5
  SHA512:
6
- metadata.gz: c76189ca3a74b4489400f66cdcc1499b9ae05d5a20aceacbc3487920522913e205b42cf773548cd91c15d1342fbee5c7ad32ec0547580a57bf4711f3b2f6797a
7
- data.tar.gz: e71744afb7f5e623d779b0a7b06768bca2375fe4b4aab34061c7f05f6c425cae972550f3a7b359e9e52f53a618a15af32df12aa01085f4c5d90bb16c0f4c3b32
6
+ metadata.gz: c5a377c99adb2a7f0ddacba3c7cd25186f19a952475bcfc6dbf6e3a01648f60de51cf2c81c99a6db61855a1676e1c1351b38f1c02326e5ac4546ee53f5def352
7
+ data.tar.gz: f4dc18121d99f79e2edb8a089cc8bc14c61484c9b288129958601e2d9f6092c8444085c826bfc09eeb6ba03f7f4bd7146d7a09e772a374327f254ce8eb46bf30
@@ -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.23.1"
176
+ sdk_information = "#{sdk_information}/0.24.0"
177
177
  add_user_agent_information(sdk_information)
178
178
  end
179
179
  end
@@ -128,7 +128,7 @@ module Azure::Cosmosdb::Mgmt::V2019_08_01_preview
128
128
  #
129
129
  def add_telemetry
130
130
  sdk_information = 'azure_mgmt_cosmosdb'
131
- sdk_information = "#{sdk_information}/0.23.1"
131
+ sdk_information = "#{sdk_information}/0.24.0"
132
132
  add_user_agent_information(sdk_information)
133
133
  end
134
134
  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.23.1"
196
+ sdk_information = "#{sdk_information}/0.24.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.23.1"
206
+ sdk_information = "#{sdk_information}/0.24.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.23.1"
199
+ sdk_information = "#{sdk_information}/0.24.0"
200
200
  add_user_agent_information(sdk_information)
201
201
  end
202
202
  end
@@ -561,7 +561,6 @@ module Azure::Cosmosdb::Mgmt::V2020_03_01
561
561
 
562
562
  notebook_create_update_parameters = NotebookWorkspaceCreateUpdateParameters.new
563
563
 
564
-
565
564
  request_headers = {}
566
565
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
567
566
 
@@ -196,7 +196,7 @@ module Azure::Cosmosdb::Mgmt::V2020_04_01
196
196
  #
197
197
  def add_telemetry
198
198
  sdk_information = 'azure_mgmt_cosmosdb'
199
- sdk_information = "#{sdk_information}/0.23.1"
199
+ sdk_information = "#{sdk_information}/0.24.0"
200
200
  add_user_agent_information(sdk_information)
201
201
  end
202
202
  end
@@ -224,7 +224,7 @@ module Azure::Cosmosdb::Mgmt::V2020_06_01_preview
224
224
  #
225
225
  def add_telemetry
226
226
  sdk_information = 'azure_mgmt_cosmosdb'
227
- sdk_information = "#{sdk_information}/0.23.1"
227
+ sdk_information = "#{sdk_information}/0.24.0"
228
228
  add_user_agent_information(sdk_information)
229
229
  end
230
230
  end
@@ -196,7 +196,7 @@ module Azure::Cosmosdb::Mgmt::V2020_09_01
196
196
  #
197
197
  def add_telemetry
198
198
  sdk_information = 'azure_mgmt_cosmosdb'
199
- sdk_information = "#{sdk_information}/0.23.1"
199
+ sdk_information = "#{sdk_information}/0.24.0"
200
200
  add_user_agent_information(sdk_information)
201
201
  end
202
202
  end
@@ -0,0 +1,228 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2021-01-15/generated/azure_mgmt_cosmosdb/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Cosmosdb::Mgmt::V2021_01_15
23
+ autoload :DatabaseAccounts, '2021-01-15/generated/azure_mgmt_cosmosdb/database_accounts.rb'
24
+ autoload :Operations, '2021-01-15/generated/azure_mgmt_cosmosdb/operations.rb'
25
+ autoload :Database, '2021-01-15/generated/azure_mgmt_cosmosdb/database.rb'
26
+ autoload :Collection, '2021-01-15/generated/azure_mgmt_cosmosdb/collection.rb'
27
+ autoload :CollectionRegion, '2021-01-15/generated/azure_mgmt_cosmosdb/collection_region.rb'
28
+ autoload :DatabaseAccountRegion, '2021-01-15/generated/azure_mgmt_cosmosdb/database_account_region.rb'
29
+ autoload :PercentileSourceTarget, '2021-01-15/generated/azure_mgmt_cosmosdb/percentile_source_target.rb'
30
+ autoload :PercentileTarget, '2021-01-15/generated/azure_mgmt_cosmosdb/percentile_target.rb'
31
+ autoload :Percentile, '2021-01-15/generated/azure_mgmt_cosmosdb/percentile.rb'
32
+ autoload :CollectionPartitionRegion, '2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition_region.rb'
33
+ autoload :CollectionPartition, '2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition.rb'
34
+ autoload :PartitionKeyRangeId, '2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb'
35
+ autoload :PartitionKeyRangeIdRegion, '2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb'
36
+ autoload :SqlResources, '2021-01-15/generated/azure_mgmt_cosmosdb/sql_resources.rb'
37
+ autoload :MongoDBResources, '2021-01-15/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb'
38
+ autoload :TableResources, '2021-01-15/generated/azure_mgmt_cosmosdb/table_resources.rb'
39
+ autoload :CassandraResources, '2021-01-15/generated/azure_mgmt_cosmosdb/cassandra_resources.rb'
40
+ autoload :GremlinResources, '2021-01-15/generated/azure_mgmt_cosmosdb/gremlin_resources.rb'
41
+ autoload :NotebookWorkspaces, '2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb'
42
+ autoload :PrivateLinkResources, '2021-01-15/generated/azure_mgmt_cosmosdb/private_link_resources.rb'
43
+ autoload :PrivateEndpointConnections, '2021-01-15/generated/azure_mgmt_cosmosdb/private_endpoint_connections.rb'
44
+ autoload :CosmosDBManagementClient, '2021-01-15/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb'
45
+
46
+ module Models
47
+ autoload :ErrorResponseUpdatedFormat, '2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response_updated_format.rb'
48
+ autoload :FailoverPolicies, '2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policies.rb'
49
+ autoload :ManagedServiceIdentity, '2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity.rb'
50
+ autoload :RegionForOnlineOffline, '2021-01-15/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb'
51
+ autoload :ConsistencyPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb'
52
+ autoload :ARMResourceProperties, '2021-01-15/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb'
53
+ autoload :Location, '2021-01-15/generated/azure_mgmt_cosmosdb/models/location.rb'
54
+ autoload :ARMProxyResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb'
55
+ autoload :VirtualNetworkRule, '2021-01-15/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb'
56
+ autoload :ExtendedResourceProperties, '2021-01-15/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb'
57
+ autoload :PrivateLinkServiceConnectionStateProperty, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb'
58
+ autoload :ThroughputPolicyResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb'
59
+ autoload :ApiProperties, '2021-01-15/generated/azure_mgmt_cosmosdb/models/api_properties.rb'
60
+ autoload :AutoUpgradePolicyResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb'
61
+ autoload :CorsPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cors_policy.rb'
62
+ autoload :AutoscaleSettingsResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb'
63
+ autoload :DatabaseAccountsListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb'
64
+ autoload :ThroughputSettingsGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb'
65
+ autoload :ClusterKey, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cluster_key.rb'
66
+ autoload :CassandraSchema, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb'
67
+ autoload :SqlDatabaseListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb'
68
+ autoload :CassandraTableGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb'
69
+ autoload :IncludedPath, '2021-01-15/generated/azure_mgmt_cosmosdb/models/included_path.rb'
70
+ autoload :MetricDefinition, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definition.rb'
71
+ autoload :CompositePath, '2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path.rb'
72
+ autoload :MetricAvailability, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_availability.rb'
73
+ autoload :IndexingPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb'
74
+ autoload :CassandraTableListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb'
75
+ autoload :UniqueKey, '2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key.rb'
76
+ autoload :GremlinDatabaseGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb'
77
+ autoload :ConflictResolutionPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb'
78
+ autoload :PartitionUsagesResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb'
79
+ autoload :PrivateEndpointConnectionListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection_list_result.rb'
80
+ autoload :UsagesResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/usages_result.rb'
81
+ autoload :SqlContainerListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb'
82
+ autoload :GremlinDatabaseListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb'
83
+ autoload :NotebookWorkspaceConnectionInfoResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb'
84
+ autoload :GremlinGraphGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb'
85
+ autoload :SqlUserDefinedFunctionGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb'
86
+ autoload :Usage, '2021-01-15/generated/azure_mgmt_cosmosdb/models/usage.rb'
87
+ autoload :SqlUserDefinedFunctionListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb'
88
+ autoload :MetricName, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_name.rb'
89
+ autoload :Resource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/resource.rb'
90
+ autoload :GremlinGraphListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb'
91
+ autoload :MongoDBDatabaseGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb'
92
+ autoload :ErrorResponse, '2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response.rb'
93
+ autoload :PartitionMetricListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb'
94
+ autoload :ManagedServiceIdentityUserAssignedIdentitiesValue, '2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity_user_assigned_identities_value.rb'
95
+ autoload :MongoIndexKeys, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb'
96
+ autoload :IpAddressOrRange, '2021-01-15/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb'
97
+ autoload :MongoIndex, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index.rb'
98
+ autoload :Capability, '2021-01-15/generated/azure_mgmt_cosmosdb/models/capability.rb'
99
+ autoload :PercentileMetricListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb'
100
+ autoload :FailoverPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policy.rb'
101
+ autoload :MongoDBCollectionListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb'
102
+ autoload :PrivateEndpointProperty, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb'
103
+ autoload :MetricListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb'
104
+ autoload :Metric, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric.rb'
105
+ autoload :TableListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_list_result.rb'
106
+ autoload :MongoDBDatabaseResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb'
107
+ autoload :MetricValue, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_value.rb'
108
+ autoload :BackupPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy.rb'
109
+ autoload :CassandraKeyspaceListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb'
110
+ autoload :MongoDBCollectionResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb'
111
+ autoload :CassandraPartitionKey, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb'
112
+ autoload :SqlDatabaseGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb'
113
+ autoload :Indexes, '2021-01-15/generated/azure_mgmt_cosmosdb/models/indexes.rb'
114
+ autoload :OperationListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb'
115
+ autoload :SpatialSpec, '2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb'
116
+ autoload :Operation, '2021-01-15/generated/azure_mgmt_cosmosdb/models/operation.rb'
117
+ autoload :UniqueKeyPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb'
118
+ autoload :OperationDisplay, '2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_display.rb'
119
+ autoload :PrivateLinkResourceListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource_list_result.rb'
120
+ autoload :DatabaseAccountUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb'
121
+ autoload :SqlStoredProcedureListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb'
122
+ autoload :DatabaseAccountListReadOnlyKeysResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb'
123
+ autoload :SqlTriggerGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb'
124
+ autoload :OptionsResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/options_resource.rb'
125
+ autoload :PeriodicModeProperties, '2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_properties.rb'
126
+ autoload :DatabaseAccountConnectionString, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb'
127
+ autoload :MongoIndexOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb'
128
+ autoload :DatabaseAccountListConnectionStringsResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb'
129
+ autoload :PercentileMetric, '2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb'
130
+ autoload :DatabaseAccountRegenerateKeyParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb'
131
+ autoload :CassandraKeyspaceGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb'
132
+ autoload :ThroughputSettingsResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb'
133
+ autoload :Column, '2021-01-15/generated/azure_mgmt_cosmosdb/models/column.rb'
134
+ autoload :GremlinGraphResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb'
135
+ autoload :ExcludedPath, '2021-01-15/generated/azure_mgmt_cosmosdb/models/excluded_path.rb'
136
+ autoload :SqlDatabaseResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb'
137
+ autoload :SqlContainerGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb'
138
+ autoload :AutoscaleSettings, '2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb'
139
+ autoload :NotebookWorkspaceListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb'
140
+ autoload :CreateUpdateOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/create_update_options.rb'
141
+ autoload :MongoDBDatabaseListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb'
142
+ autoload :GremlinDatabaseResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb'
143
+ autoload :TableGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb'
144
+ autoload :SqlContainerResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb'
145
+ autoload :CassandraTableResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb'
146
+ autoload :SqlStoredProcedureGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb'
147
+ autoload :SqlStoredProcedureResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb'
148
+ autoload :MongoDBCollectionGetPropertiesResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb'
149
+ autoload :CassandraKeyspaceResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb'
150
+ autoload :ContainerPartitionKey, '2021-01-15/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb'
151
+ autoload :SqlUserDefinedFunctionResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb'
152
+ autoload :MetricDefinitionsListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb'
153
+ autoload :TableResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_resource.rb'
154
+ autoload :SqlTriggerListResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb'
155
+ autoload :SqlTriggerResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb'
156
+ autoload :PrivateEndpointConnection, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb'
157
+ autoload :DatabaseAccountGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb'
158
+ autoload :SqlDatabaseGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb'
159
+ autoload :SqlDatabaseGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb'
160
+ autoload :SqlContainerGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb'
161
+ autoload :SqlContainerGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb'
162
+ autoload :SqlStoredProcedureGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb'
163
+ autoload :SqlUserDefinedFunctionGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb'
164
+ autoload :SqlTriggerGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb'
165
+ autoload :MongoDBDatabaseGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb'
166
+ autoload :MongoDBDatabaseGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb'
167
+ autoload :MongoDBCollectionGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb'
168
+ autoload :MongoDBCollectionGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb'
169
+ autoload :TableGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb'
170
+ autoload :TableGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_results.rb'
171
+ autoload :CassandraKeyspaceGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb'
172
+ autoload :CassandraKeyspaceGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb'
173
+ autoload :CassandraTableGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb'
174
+ autoload :CassandraTableGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb'
175
+ autoload :GremlinDatabaseGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb'
176
+ autoload :GremlinDatabaseGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb'
177
+ autoload :GremlinGraphGetPropertiesOptions, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb'
178
+ autoload :GremlinGraphGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb'
179
+ autoload :ThroughputSettingsGetResults, '2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb'
180
+ autoload :DatabaseAccountCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb'
181
+ autoload :DatabaseAccountListKeysResult, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb'
182
+ autoload :ThroughputSettingsUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb'
183
+ autoload :SqlDatabaseCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb'
184
+ autoload :SqlContainerCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb'
185
+ autoload :SqlStoredProcedureCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb'
186
+ autoload :SqlUserDefinedFunctionCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb'
187
+ autoload :SqlTriggerCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb'
188
+ autoload :MongoDBDatabaseCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb'
189
+ autoload :MongoDBCollectionCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb'
190
+ autoload :TableCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb'
191
+ autoload :CassandraKeyspaceCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb'
192
+ autoload :CassandraTableCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb'
193
+ autoload :GremlinDatabaseCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb'
194
+ autoload :GremlinGraphCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb'
195
+ autoload :PartitionUsage, '2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usage.rb'
196
+ autoload :PercentileMetricValue, '2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb'
197
+ autoload :PartitionMetric, '2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric.rb'
198
+ autoload :PeriodicModeBackupPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_backup_policy.rb'
199
+ autoload :ContinuousModeBackupPolicy, '2021-01-15/generated/azure_mgmt_cosmosdb/models/continuous_mode_backup_policy.rb'
200
+ autoload :TrackedResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb'
201
+ autoload :AzureEntityResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb'
202
+ autoload :ProxyResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb'
203
+ autoload :NotebookWorkspaceCreateUpdateParameters, '2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb'
204
+ autoload :NotebookWorkspace, '2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb'
205
+ autoload :PrivateLinkResource, '2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource.rb'
206
+ autoload :DatabaseAccountKind, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb'
207
+ autoload :ResourceIdentityType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/resource_identity_type.rb'
208
+ autoload :DatabaseAccountOfferType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb'
209
+ autoload :DefaultConsistencyLevel, '2021-01-15/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb'
210
+ autoload :ConnectorOffer, '2021-01-15/generated/azure_mgmt_cosmosdb/models/connector_offer.rb'
211
+ autoload :PublicNetworkAccess, '2021-01-15/generated/azure_mgmt_cosmosdb/models/public_network_access.rb'
212
+ autoload :ServerVersion, '2021-01-15/generated/azure_mgmt_cosmosdb/models/server_version.rb'
213
+ autoload :NetworkAclBypass, '2021-01-15/generated/azure_mgmt_cosmosdb/models/network_acl_bypass.rb'
214
+ autoload :IndexingMode, '2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb'
215
+ autoload :DataType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/data_type.rb'
216
+ autoload :IndexKind, '2021-01-15/generated/azure_mgmt_cosmosdb/models/index_kind.rb'
217
+ autoload :CompositePathSortOrder, '2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb'
218
+ autoload :SpatialType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_type.rb'
219
+ autoload :PartitionKind, '2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_kind.rb'
220
+ autoload :ConflictResolutionMode, '2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb'
221
+ autoload :TriggerType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_type.rb'
222
+ autoload :TriggerOperation, '2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb'
223
+ autoload :KeyKind, '2021-01-15/generated/azure_mgmt_cosmosdb/models/key_kind.rb'
224
+ autoload :UnitType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/unit_type.rb'
225
+ autoload :PrimaryAggregationType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb'
226
+ autoload :BackupPolicyType, '2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy_type.rb'
227
+ end
228
+ end
@@ -0,0 +1,2348 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Cosmosdb::Mgmt::V2021_01_15
7
+ #
8
+ # Azure Cosmos DB Database Service Resource Provider REST API
9
+ #
10
+ class CassandraResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the CassandraResources class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database
26
+ # account.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group. The name
29
+ # is case insensitive.
30
+ # @param account_name [String] Cosmos DB database account name.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CassandraKeyspaceListResult] operation results.
35
+ #
36
+ def list_cassandra_keyspaces(resource_group_name, account_name, custom_headers:nil)
37
+ response = list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database
43
+ # account.
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group. The name
46
+ # is case insensitive.
47
+ # @param account_name [String] Cosmos DB database account name.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_cassandra_keyspaces_with_http_info(resource_group_name, account_name, custom_headers:nil)
54
+ list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Lists the Cassandra keyspaces under an existing Azure Cosmos DB database
59
+ # account.
60
+ #
61
+ # @param resource_group_name [String] The name of the resource group. The name
62
+ # is case insensitive.
63
+ # @param account_name [String] Cosmos DB database account name.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_cassandra_keyspaces_async(resource_group_name, account_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
72
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
75
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
76
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
77
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
78
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
79
+ 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?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
82
+
83
+
84
+ request_headers = {}
85
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
97
+ query_params: {'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
114
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
115
+ # Deserialize Response
116
+ if status_code == 200
117
+ begin
118
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
119
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraKeyspaceListResult.mapper()
120
+ result.body = @client.deserialize(result_mapper, parsed_response)
121
+ rescue Exception => e
122
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
123
+ end
124
+ end
125
+
126
+ result
127
+ end
128
+
129
+ promise.execute
130
+ end
131
+
132
+ #
133
+ # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database
134
+ # account with the provided name.
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group. The name
137
+ # is case insensitive.
138
+ # @param account_name [String] Cosmos DB database account name.
139
+ # @param keyspace_name [String] Cosmos DB keyspace name.
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [CassandraKeyspaceGetResults] operation results.
144
+ #
145
+ def get_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil)
146
+ response = get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
147
+ response.body unless response.nil?
148
+ end
149
+
150
+ #
151
+ # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database
152
+ # account with the provided name.
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group. The name
155
+ # is case insensitive.
156
+ # @param account_name [String] Cosmos DB database account name.
157
+ # @param keyspace_name [String] Cosmos DB keyspace name.
158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
159
+ # will be added to the HTTP request.
160
+ #
161
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
162
+ #
163
+ def get_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
164
+ get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
165
+ end
166
+
167
+ #
168
+ # Gets the Cassandra keyspaces under an existing Azure Cosmos DB database
169
+ # account with the provided name.
170
+ #
171
+ # @param resource_group_name [String] The name of the resource group. The name
172
+ # is case insensitive.
173
+ # @param account_name [String] Cosmos DB database account name.
174
+ # @param keyspace_name [String] Cosmos DB keyspace name.
175
+ # @param [Hash{String => String}] A hash of custom headers that will be added
176
+ # to the HTTP request.
177
+ #
178
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
179
+ #
180
+ def get_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
181
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
182
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
183
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
184
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
186
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
187
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
188
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
189
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
190
+ 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?
191
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
192
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
193
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
194
+
195
+
196
+ request_headers = {}
197
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
198
+
199
+ # Set Headers
200
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
201
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
202
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'
203
+
204
+ request_url = @base_url || @client.base_url
205
+
206
+ options = {
207
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
208
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
209
+ query_params: {'api-version' => @client.api_version},
210
+ headers: request_headers.merge(custom_headers || {}),
211
+ base_url: request_url
212
+ }
213
+ promise = @client.make_request_async(:get, path_template, options)
214
+
215
+ promise = promise.then do |result|
216
+ http_response = result.response
217
+ status_code = http_response.status
218
+ response_content = http_response.body
219
+ unless status_code == 200
220
+ error_model = JSON.load(response_content)
221
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
222
+ end
223
+
224
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
225
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
226
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
227
+ # Deserialize Response
228
+ if status_code == 200
229
+ begin
230
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
231
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraKeyspaceGetResults.mapper()
232
+ result.body = @client.deserialize(result_mapper, parsed_response)
233
+ rescue Exception => e
234
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
235
+ end
236
+ end
237
+
238
+ result
239
+ end
240
+
241
+ promise.execute
242
+ end
243
+
244
+ #
245
+ # Create or update an Azure Cosmos DB Cassandra keyspace
246
+ #
247
+ # @param resource_group_name [String] The name of the resource group. The name
248
+ # is case insensitive.
249
+ # @param account_name [String] Cosmos DB database account name.
250
+ # @param keyspace_name [String] Cosmos DB keyspace name.
251
+ # @param create_update_cassandra_keyspace_parameters
252
+ # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the
253
+ # current Cassandra keyspace.
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [CassandraKeyspaceGetResults] operation results.
258
+ #
259
+ def create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
260
+ response = create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
261
+ response.body unless response.nil?
262
+ end
263
+
264
+ #
265
+ # @param resource_group_name [String] The name of the resource group. The name
266
+ # is case insensitive.
267
+ # @param account_name [String] Cosmos DB database account name.
268
+ # @param keyspace_name [String] Cosmos DB keyspace name.
269
+ # @param create_update_cassandra_keyspace_parameters
270
+ # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the
271
+ # current Cassandra keyspace.
272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
+ # will be added to the HTTP request.
274
+ #
275
+ # @return [Concurrent::Promise] promise which provides async access to http
276
+ # response.
277
+ #
278
+ def create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
279
+ # Send request
280
+ promise = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers)
281
+
282
+ promise = promise.then do |response|
283
+ # Defining deserialization method.
284
+ deserialize_method = lambda do |parsed_response|
285
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraKeyspaceGetResults.mapper()
286
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
287
+ end
288
+
289
+ # Waiting for response.
290
+ @client.get_long_running_operation_result(response, deserialize_method)
291
+ end
292
+
293
+ promise
294
+ end
295
+
296
+ #
297
+ # Deletes an existing Azure Cosmos DB Cassandra keyspace.
298
+ #
299
+ # @param resource_group_name [String] The name of the resource group. The name
300
+ # is case insensitive.
301
+ # @param account_name [String] Cosmos DB database account name.
302
+ # @param keyspace_name [String] Cosmos DB keyspace name.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ def delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil)
307
+ response = delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
308
+ nil
309
+ end
310
+
311
+ #
312
+ # @param resource_group_name [String] The name of the resource group. The name
313
+ # is case insensitive.
314
+ # @param account_name [String] Cosmos DB database account name.
315
+ # @param keyspace_name [String] Cosmos DB keyspace name.
316
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
317
+ # will be added to the HTTP request.
318
+ #
319
+ # @return [Concurrent::Promise] promise which provides async access to http
320
+ # response.
321
+ #
322
+ def delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
323
+ # Send request
324
+ promise = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers)
325
+
326
+ promise = promise.then do |response|
327
+ # Defining deserialization method.
328
+ deserialize_method = lambda do |parsed_response|
329
+ end
330
+
331
+ # Waiting for response.
332
+ @client.get_long_running_operation_result(response, deserialize_method)
333
+ end
334
+
335
+ promise
336
+ end
337
+
338
+ #
339
+ # Gets the RUs per second of the Cassandra Keyspace under an existing Azure
340
+ # Cosmos DB database account with the provided name.
341
+ #
342
+ # @param resource_group_name [String] The name of the resource group. The name
343
+ # is case insensitive.
344
+ # @param account_name [String] Cosmos DB database account name.
345
+ # @param keyspace_name [String] Cosmos DB keyspace name.
346
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
347
+ # will be added to the HTTP request.
348
+ #
349
+ # @return [ThroughputSettingsGetResults] operation results.
350
+ #
351
+ def get_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, custom_headers:nil)
352
+ response = get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
353
+ response.body unless response.nil?
354
+ end
355
+
356
+ #
357
+ # Gets the RUs per second of the Cassandra Keyspace under an existing Azure
358
+ # Cosmos DB database account with the provided name.
359
+ #
360
+ # @param resource_group_name [String] The name of the resource group. The name
361
+ # is case insensitive.
362
+ # @param account_name [String] Cosmos DB database account name.
363
+ # @param keyspace_name [String] Cosmos DB keyspace name.
364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
365
+ # will be added to the HTTP request.
366
+ #
367
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
368
+ #
369
+ def get_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
370
+ get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
371
+ end
372
+
373
+ #
374
+ # Gets the RUs per second of the Cassandra Keyspace under an existing Azure
375
+ # Cosmos DB database account with the provided name.
376
+ #
377
+ # @param resource_group_name [String] The name of the resource group. The name
378
+ # is case insensitive.
379
+ # @param account_name [String] Cosmos DB database account name.
380
+ # @param keyspace_name [String] Cosmos DB keyspace name.
381
+ # @param [Hash{String => String}] A hash of custom headers that will be added
382
+ # to the HTTP request.
383
+ #
384
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
385
+ #
386
+ def get_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
387
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
388
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
389
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
390
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
391
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
392
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
393
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
394
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
395
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
396
+ 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?
397
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
398
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
399
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
400
+
401
+
402
+ request_headers = {}
403
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
404
+
405
+ # Set Headers
406
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
407
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
408
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default'
409
+
410
+ request_url = @base_url || @client.base_url
411
+
412
+ options = {
413
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
414
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
415
+ query_params: {'api-version' => @client.api_version},
416
+ headers: request_headers.merge(custom_headers || {}),
417
+ base_url: request_url
418
+ }
419
+ promise = @client.make_request_async(:get, path_template, options)
420
+
421
+ promise = promise.then do |result|
422
+ http_response = result.response
423
+ status_code = http_response.status
424
+ response_content = http_response.body
425
+ unless status_code == 200
426
+ error_model = JSON.load(response_content)
427
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
428
+ end
429
+
430
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
431
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
432
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
433
+ # Deserialize Response
434
+ if status_code == 200
435
+ begin
436
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
437
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
438
+ result.body = @client.deserialize(result_mapper, parsed_response)
439
+ rescue Exception => e
440
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
441
+ end
442
+ end
443
+
444
+ result
445
+ end
446
+
447
+ promise.execute
448
+ end
449
+
450
+ #
451
+ # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace
452
+ #
453
+ # @param resource_group_name [String] The name of the resource group. The name
454
+ # is case insensitive.
455
+ # @param account_name [String] Cosmos DB database account name.
456
+ # @param keyspace_name [String] Cosmos DB keyspace name.
457
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
458
+ # RUs per second of the parameters to provide for the current Cassandra
459
+ # Keyspace.
460
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
461
+ # will be added to the HTTP request.
462
+ #
463
+ # @return [ThroughputSettingsGetResults] operation results.
464
+ #
465
+ def update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil)
466
+ response = update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
467
+ response.body unless response.nil?
468
+ end
469
+
470
+ #
471
+ # @param resource_group_name [String] The name of the resource group. The name
472
+ # is case insensitive.
473
+ # @param account_name [String] Cosmos DB database account name.
474
+ # @param keyspace_name [String] Cosmos DB keyspace name.
475
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
476
+ # RUs per second of the parameters to provide for the current Cassandra
477
+ # Keyspace.
478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
+ # will be added to the HTTP request.
480
+ #
481
+ # @return [Concurrent::Promise] promise which provides async access to http
482
+ # response.
483
+ #
484
+ def update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil)
485
+ # Send request
486
+ promise = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers)
487
+
488
+ promise = promise.then do |response|
489
+ # Defining deserialization method.
490
+ deserialize_method = lambda do |parsed_response|
491
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
492
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
493
+ end
494
+
495
+ # Waiting for response.
496
+ @client.get_long_running_operation_result(response, deserialize_method)
497
+ end
498
+
499
+ promise
500
+ end
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::V2021_01_15::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::V2021_01_15::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
+
596
+ #
597
+ # Lists the Cassandra table under an existing Azure Cosmos DB database account.
598
+ #
599
+ # @param resource_group_name [String] The name of the resource group. The name
600
+ # is case insensitive.
601
+ # @param account_name [String] Cosmos DB database account name.
602
+ # @param keyspace_name [String] Cosmos DB keyspace name.
603
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
604
+ # will be added to the HTTP request.
605
+ #
606
+ # @return [CassandraTableListResult] operation results.
607
+ #
608
+ def list_cassandra_tables(resource_group_name, account_name, keyspace_name, custom_headers:nil)
609
+ response = list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
610
+ response.body unless response.nil?
611
+ end
612
+
613
+ #
614
+ # Lists the Cassandra table under an existing Azure Cosmos DB database account.
615
+ #
616
+ # @param resource_group_name [String] The name of the resource group. The name
617
+ # is case insensitive.
618
+ # @param account_name [String] Cosmos DB database account name.
619
+ # @param keyspace_name [String] Cosmos DB keyspace name.
620
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
621
+ # will be added to the HTTP request.
622
+ #
623
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
624
+ #
625
+ def list_cassandra_tables_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
626
+ list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
627
+ end
628
+
629
+ #
630
+ # Lists the Cassandra table under an existing Azure Cosmos DB database account.
631
+ #
632
+ # @param resource_group_name [String] The name of the resource group. The name
633
+ # is case insensitive.
634
+ # @param account_name [String] Cosmos DB database account name.
635
+ # @param keyspace_name [String] Cosmos DB keyspace name.
636
+ # @param [Hash{String => String}] A hash of custom headers that will be added
637
+ # to the HTTP request.
638
+ #
639
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
640
+ #
641
+ def list_cassandra_tables_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
642
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
643
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
644
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
645
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
646
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
647
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
648
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
649
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
650
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
651
+ 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?
652
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
653
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
654
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
655
+
656
+
657
+ request_headers = {}
658
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
659
+
660
+ # Set Headers
661
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
662
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
663
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables'
664
+
665
+ request_url = @base_url || @client.base_url
666
+
667
+ options = {
668
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
669
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
670
+ query_params: {'api-version' => @client.api_version},
671
+ headers: request_headers.merge(custom_headers || {}),
672
+ base_url: request_url
673
+ }
674
+ promise = @client.make_request_async(:get, path_template, options)
675
+
676
+ promise = promise.then do |result|
677
+ http_response = result.response
678
+ status_code = http_response.status
679
+ response_content = http_response.body
680
+ unless status_code == 200
681
+ error_model = JSON.load(response_content)
682
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
683
+ end
684
+
685
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
686
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
687
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
688
+ # Deserialize Response
689
+ if status_code == 200
690
+ begin
691
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
692
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraTableListResult.mapper()
693
+ result.body = @client.deserialize(result_mapper, parsed_response)
694
+ rescue Exception => e
695
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
696
+ end
697
+ end
698
+
699
+ result
700
+ end
701
+
702
+ promise.execute
703
+ end
704
+
705
+ #
706
+ # Gets the Cassandra table under an existing Azure Cosmos DB database account.
707
+ #
708
+ # @param resource_group_name [String] The name of the resource group. The name
709
+ # is case insensitive.
710
+ # @param account_name [String] Cosmos DB database account name.
711
+ # @param keyspace_name [String] Cosmos DB keyspace name.
712
+ # @param table_name [String] Cosmos DB table name.
713
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
714
+ # will be added to the HTTP request.
715
+ #
716
+ # @return [CassandraTableGetResults] operation results.
717
+ #
718
+ def get_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
719
+ response = get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
720
+ response.body unless response.nil?
721
+ end
722
+
723
+ #
724
+ # Gets the Cassandra table under an existing Azure Cosmos DB database account.
725
+ #
726
+ # @param resource_group_name [String] The name of the resource group. The name
727
+ # is case insensitive.
728
+ # @param account_name [String] Cosmos DB database account name.
729
+ # @param keyspace_name [String] Cosmos DB keyspace name.
730
+ # @param table_name [String] Cosmos DB table name.
731
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
732
+ # will be added to the HTTP request.
733
+ #
734
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
735
+ #
736
+ def get_cassandra_table_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
737
+ get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
738
+ end
739
+
740
+ #
741
+ # Gets the Cassandra table under an existing Azure Cosmos DB database account.
742
+ #
743
+ # @param resource_group_name [String] The name of the resource group. The name
744
+ # is case insensitive.
745
+ # @param account_name [String] Cosmos DB database account name.
746
+ # @param keyspace_name [String] Cosmos DB keyspace name.
747
+ # @param table_name [String] Cosmos DB table name.
748
+ # @param [Hash{String => String}] A hash of custom headers that will be added
749
+ # to the HTTP request.
750
+ #
751
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
752
+ #
753
+ def get_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
754
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
755
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
756
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
757
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
758
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
760
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
761
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
762
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
763
+ 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?
764
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
765
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
766
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
767
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
768
+
769
+
770
+ request_headers = {}
771
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
772
+
773
+ # Set Headers
774
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
775
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
776
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}'
777
+
778
+ request_url = @base_url || @client.base_url
779
+
780
+ options = {
781
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
782
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
783
+ query_params: {'api-version' => @client.api_version},
784
+ headers: request_headers.merge(custom_headers || {}),
785
+ base_url: request_url
786
+ }
787
+ promise = @client.make_request_async(:get, path_template, options)
788
+
789
+ promise = promise.then do |result|
790
+ http_response = result.response
791
+ status_code = http_response.status
792
+ response_content = http_response.body
793
+ unless status_code == 200
794
+ error_model = JSON.load(response_content)
795
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
796
+ end
797
+
798
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
799
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
800
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
801
+ # Deserialize Response
802
+ if status_code == 200
803
+ begin
804
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
805
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraTableGetResults.mapper()
806
+ result.body = @client.deserialize(result_mapper, parsed_response)
807
+ rescue Exception => e
808
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
809
+ end
810
+ end
811
+
812
+ result
813
+ end
814
+
815
+ promise.execute
816
+ end
817
+
818
+ #
819
+ # Create or update an Azure Cosmos DB Cassandra Table
820
+ #
821
+ # @param resource_group_name [String] The name of the resource group. The name
822
+ # is case insensitive.
823
+ # @param account_name [String] Cosmos DB database account name.
824
+ # @param keyspace_name [String] Cosmos DB keyspace name.
825
+ # @param table_name [String] Cosmos DB table name.
826
+ # @param create_update_cassandra_table_parameters
827
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
828
+ # current Cassandra Table.
829
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
830
+ # will be added to the HTTP request.
831
+ #
832
+ # @return [CassandraTableGetResults] operation results.
833
+ #
834
+ def create_update_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
835
+ response = create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers).value!
836
+ response.body unless response.nil?
837
+ end
838
+
839
+ #
840
+ # @param resource_group_name [String] The name of the resource group. The name
841
+ # is case insensitive.
842
+ # @param account_name [String] Cosmos DB database account name.
843
+ # @param keyspace_name [String] Cosmos DB keyspace name.
844
+ # @param table_name [String] Cosmos DB table name.
845
+ # @param create_update_cassandra_table_parameters
846
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
847
+ # current Cassandra Table.
848
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
849
+ # will be added to the HTTP request.
850
+ #
851
+ # @return [Concurrent::Promise] promise which provides async access to http
852
+ # response.
853
+ #
854
+ def create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:nil)
855
+ # Send request
856
+ promise = begin_create_update_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, create_update_cassandra_table_parameters, custom_headers:custom_headers)
857
+
858
+ promise = promise.then do |response|
859
+ # Defining deserialization method.
860
+ deserialize_method = lambda do |parsed_response|
861
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraTableGetResults.mapper()
862
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
863
+ end
864
+
865
+ # Waiting for response.
866
+ @client.get_long_running_operation_result(response, deserialize_method)
867
+ end
868
+
869
+ promise
870
+ end
871
+
872
+ #
873
+ # Deletes an existing Azure Cosmos DB Cassandra table.
874
+ #
875
+ # @param resource_group_name [String] The name of the resource group. The name
876
+ # is case insensitive.
877
+ # @param account_name [String] Cosmos DB database account name.
878
+ # @param keyspace_name [String] Cosmos DB keyspace name.
879
+ # @param table_name [String] Cosmos DB table name.
880
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
881
+ # will be added to the HTTP request.
882
+ #
883
+ def delete_cassandra_table(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
884
+ response = delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
885
+ nil
886
+ end
887
+
888
+ #
889
+ # @param resource_group_name [String] The name of the resource group. The name
890
+ # is case insensitive.
891
+ # @param account_name [String] Cosmos DB database account name.
892
+ # @param keyspace_name [String] Cosmos DB keyspace name.
893
+ # @param table_name [String] Cosmos DB table name.
894
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
895
+ # will be added to the HTTP request.
896
+ #
897
+ # @return [Concurrent::Promise] promise which provides async access to http
898
+ # response.
899
+ #
900
+ def delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
901
+ # Send request
902
+ promise = begin_delete_cassandra_table_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers)
903
+
904
+ promise = promise.then do |response|
905
+ # Defining deserialization method.
906
+ deserialize_method = lambda do |parsed_response|
907
+ end
908
+
909
+ # Waiting for response.
910
+ @client.get_long_running_operation_result(response, deserialize_method)
911
+ end
912
+
913
+ promise
914
+ end
915
+
916
+ #
917
+ # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos
918
+ # DB database account with the provided name.
919
+ #
920
+ # @param resource_group_name [String] The name of the resource group. The name
921
+ # is case insensitive.
922
+ # @param account_name [String] Cosmos DB database account name.
923
+ # @param keyspace_name [String] Cosmos DB keyspace name.
924
+ # @param table_name [String] Cosmos DB table name.
925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
926
+ # will be added to the HTTP request.
927
+ #
928
+ # @return [ThroughputSettingsGetResults] operation results.
929
+ #
930
+ def get_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
931
+ response = get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
932
+ response.body unless response.nil?
933
+ end
934
+
935
+ #
936
+ # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos
937
+ # DB database account with the provided name.
938
+ #
939
+ # @param resource_group_name [String] The name of the resource group. The name
940
+ # is case insensitive.
941
+ # @param account_name [String] Cosmos DB database account name.
942
+ # @param keyspace_name [String] Cosmos DB keyspace name.
943
+ # @param table_name [String] Cosmos DB table name.
944
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
945
+ # will be added to the HTTP request.
946
+ #
947
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
948
+ #
949
+ def get_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
950
+ get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:custom_headers).value!
951
+ end
952
+
953
+ #
954
+ # Gets the RUs per second of the Cassandra table under an existing Azure Cosmos
955
+ # DB database account with the provided name.
956
+ #
957
+ # @param resource_group_name [String] The name of the resource group. The name
958
+ # is case insensitive.
959
+ # @param account_name [String] Cosmos DB database account name.
960
+ # @param keyspace_name [String] Cosmos DB keyspace name.
961
+ # @param table_name [String] Cosmos DB table name.
962
+ # @param [Hash{String => String}] A hash of custom headers that will be added
963
+ # to the HTTP request.
964
+ #
965
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
966
+ #
967
+ def get_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, custom_headers:nil)
968
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
969
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
970
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
971
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
972
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
973
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
974
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
975
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
976
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
977
+ 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?
978
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
979
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
980
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
981
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
982
+
983
+
984
+ request_headers = {}
985
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
986
+
987
+ # Set Headers
988
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
989
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
990
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'
991
+
992
+ request_url = @base_url || @client.base_url
993
+
994
+ options = {
995
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
996
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
997
+ query_params: {'api-version' => @client.api_version},
998
+ headers: request_headers.merge(custom_headers || {}),
999
+ base_url: request_url
1000
+ }
1001
+ promise = @client.make_request_async(:get, path_template, options)
1002
+
1003
+ promise = promise.then do |result|
1004
+ http_response = result.response
1005
+ status_code = http_response.status
1006
+ response_content = http_response.body
1007
+ unless status_code == 200
1008
+ error_model = JSON.load(response_content)
1009
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1010
+ end
1011
+
1012
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1013
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1014
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1015
+ # Deserialize Response
1016
+ if status_code == 200
1017
+ begin
1018
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1019
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1020
+ result.body = @client.deserialize(result_mapper, parsed_response)
1021
+ rescue Exception => e
1022
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1023
+ end
1024
+ end
1025
+
1026
+ result
1027
+ end
1028
+
1029
+ promise.execute
1030
+ end
1031
+
1032
+ #
1033
+ # Update RUs per second of an Azure Cosmos DB Cassandra table
1034
+ #
1035
+ # @param resource_group_name [String] The name of the resource group. The name
1036
+ # is case insensitive.
1037
+ # @param account_name [String] Cosmos DB database account name.
1038
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1039
+ # @param table_name [String] Cosmos DB table name.
1040
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1041
+ # RUs per second of the parameters to provide for the current Cassandra table.
1042
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1043
+ # will be added to the HTTP request.
1044
+ #
1045
+ # @return [ThroughputSettingsGetResults] operation results.
1046
+ #
1047
+ def update_cassandra_table_throughput(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
1048
+ response = update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
1049
+ response.body unless response.nil?
1050
+ end
1051
+
1052
+ #
1053
+ # @param resource_group_name [String] The name of the resource group. The name
1054
+ # is case insensitive.
1055
+ # @param account_name [String] Cosmos DB database account name.
1056
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1057
+ # @param table_name [String] Cosmos DB table name.
1058
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1059
+ # RUs per second of the parameters to provide for the current Cassandra table.
1060
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1061
+ # will be added to the HTTP request.
1062
+ #
1063
+ # @return [Concurrent::Promise] promise which provides async access to http
1064
+ # response.
1065
+ #
1066
+ def update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
1067
+ # Send request
1068
+ promise = begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers)
1069
+
1070
+ promise = promise.then do |response|
1071
+ # Defining deserialization method.
1072
+ deserialize_method = lambda do |parsed_response|
1073
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1074
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
1075
+ end
1076
+
1077
+ # Waiting for response.
1078
+ @client.get_long_running_operation_result(response, deserialize_method)
1079
+ end
1080
+
1081
+ promise
1082
+ end
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::V2021_01_15::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::V2021_01_15::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
+
1182
+ #
1183
+ # Create or update an Azure Cosmos DB Cassandra keyspace
1184
+ #
1185
+ # @param resource_group_name [String] The name of the resource group. The name
1186
+ # is case insensitive.
1187
+ # @param account_name [String] Cosmos DB database account name.
1188
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1189
+ # @param create_update_cassandra_keyspace_parameters
1190
+ # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the
1191
+ # current Cassandra keyspace.
1192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1193
+ # will be added to the HTTP request.
1194
+ #
1195
+ # @return [CassandraKeyspaceGetResults] operation results.
1196
+ #
1197
+ def begin_create_update_cassandra_keyspace(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
1198
+ response = begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
1199
+ response.body unless response.nil?
1200
+ end
1201
+
1202
+ #
1203
+ # Create or update an Azure Cosmos DB Cassandra keyspace
1204
+ #
1205
+ # @param resource_group_name [String] The name of the resource group. The name
1206
+ # is case insensitive.
1207
+ # @param account_name [String] Cosmos DB database account name.
1208
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1209
+ # @param create_update_cassandra_keyspace_parameters
1210
+ # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the
1211
+ # current Cassandra keyspace.
1212
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1213
+ # will be added to the HTTP request.
1214
+ #
1215
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1216
+ #
1217
+ def begin_create_update_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
1218
+ begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:custom_headers).value!
1219
+ end
1220
+
1221
+ #
1222
+ # Create or update an Azure Cosmos DB Cassandra keyspace
1223
+ #
1224
+ # @param resource_group_name [String] The name of the resource group. The name
1225
+ # is case insensitive.
1226
+ # @param account_name [String] Cosmos DB database account name.
1227
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1228
+ # @param create_update_cassandra_keyspace_parameters
1229
+ # [CassandraKeyspaceCreateUpdateParameters] The parameters to provide for the
1230
+ # current Cassandra keyspace.
1231
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1232
+ # to the HTTP request.
1233
+ #
1234
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1235
+ #
1236
+ def begin_create_update_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, create_update_cassandra_keyspace_parameters, custom_headers:nil)
1237
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1238
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1239
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1240
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1241
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1242
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1243
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1244
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1245
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1246
+ 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?
1247
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1248
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1249
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1250
+ fail ArgumentError, 'create_update_cassandra_keyspace_parameters is nil' if create_update_cassandra_keyspace_parameters.nil?
1251
+
1252
+
1253
+ request_headers = {}
1254
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1255
+
1256
+ # Set Headers
1257
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1258
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1259
+
1260
+ # Serialize Request
1261
+ request_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraKeyspaceCreateUpdateParameters.mapper()
1262
+ request_content = @client.serialize(request_mapper, create_update_cassandra_keyspace_parameters)
1263
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1264
+
1265
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'
1266
+
1267
+ request_url = @base_url || @client.base_url
1268
+
1269
+ options = {
1270
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1271
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1272
+ query_params: {'api-version' => @client.api_version},
1273
+ body: request_content,
1274
+ headers: request_headers.merge(custom_headers || {}),
1275
+ base_url: request_url
1276
+ }
1277
+ promise = @client.make_request_async(:put, path_template, options)
1278
+
1279
+ promise = promise.then do |result|
1280
+ http_response = result.response
1281
+ status_code = http_response.status
1282
+ response_content = http_response.body
1283
+ unless status_code == 202 || status_code == 200
1284
+ error_model = JSON.load(response_content)
1285
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1286
+ end
1287
+
1288
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1289
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1290
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1291
+ # Deserialize Response
1292
+ if status_code == 200
1293
+ begin
1294
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1295
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::CassandraKeyspaceGetResults.mapper()
1296
+ result.body = @client.deserialize(result_mapper, parsed_response)
1297
+ rescue Exception => e
1298
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1299
+ end
1300
+ end
1301
+
1302
+ result
1303
+ end
1304
+
1305
+ promise.execute
1306
+ end
1307
+
1308
+ #
1309
+ # Deletes an existing Azure Cosmos DB Cassandra keyspace.
1310
+ #
1311
+ # @param resource_group_name [String] The name of the resource group. The name
1312
+ # is case insensitive.
1313
+ # @param account_name [String] Cosmos DB database account name.
1314
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1316
+ # will be added to the HTTP request.
1317
+ #
1318
+ #
1319
+ def begin_delete_cassandra_keyspace(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1320
+ response = begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1321
+ nil
1322
+ end
1323
+
1324
+ #
1325
+ # Deletes an existing Azure Cosmos DB Cassandra keyspace.
1326
+ #
1327
+ # @param resource_group_name [String] The name of the resource group. The name
1328
+ # is case insensitive.
1329
+ # @param account_name [String] Cosmos DB database account name.
1330
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1332
+ # will be added to the HTTP request.
1333
+ #
1334
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1335
+ #
1336
+ def begin_delete_cassandra_keyspace_with_http_info(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1337
+ begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:custom_headers).value!
1338
+ end
1339
+
1340
+ #
1341
+ # Deletes an existing Azure Cosmos DB Cassandra keyspace.
1342
+ #
1343
+ # @param resource_group_name [String] The name of the resource group. The name
1344
+ # is case insensitive.
1345
+ # @param account_name [String] Cosmos DB database account name.
1346
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1347
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1348
+ # to the HTTP request.
1349
+ #
1350
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1351
+ #
1352
+ def begin_delete_cassandra_keyspace_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1353
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1354
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1355
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1356
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1357
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1358
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1359
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1360
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1361
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1362
+ 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?
1363
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1364
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1365
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1366
+
1367
+
1368
+ request_headers = {}
1369
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1370
+
1371
+ # Set Headers
1372
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1373
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1374
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}'
1375
+
1376
+ request_url = @base_url || @client.base_url
1377
+
1378
+ options = {
1379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1380
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1381
+ query_params: {'api-version' => @client.api_version},
1382
+ headers: request_headers.merge(custom_headers || {}),
1383
+ base_url: request_url
1384
+ }
1385
+ promise = @client.make_request_async(:delete, path_template, options)
1386
+
1387
+ promise = promise.then do |result|
1388
+ http_response = result.response
1389
+ status_code = http_response.status
1390
+ response_content = http_response.body
1391
+ unless status_code == 202 || status_code == 204
1392
+ error_model = JSON.load(response_content)
1393
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1394
+ end
1395
+
1396
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1397
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1398
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1399
+
1400
+ result
1401
+ end
1402
+
1403
+ promise.execute
1404
+ end
1405
+
1406
+ #
1407
+ # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace
1408
+ #
1409
+ # @param resource_group_name [String] The name of the resource group. The name
1410
+ # is case insensitive.
1411
+ # @param account_name [String] Cosmos DB database account name.
1412
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1413
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1414
+ # RUs per second of the parameters to provide for the current Cassandra
1415
+ # Keyspace.
1416
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1417
+ # will be added to the HTTP request.
1418
+ #
1419
+ # @return [ThroughputSettingsGetResults] operation results.
1420
+ #
1421
+ def begin_update_cassandra_keyspace_throughput(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil)
1422
+ response = begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
1423
+ response.body unless response.nil?
1424
+ end
1425
+
1426
+ #
1427
+ # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace
1428
+ #
1429
+ # @param resource_group_name [String] The name of the resource group. The name
1430
+ # is case insensitive.
1431
+ # @param account_name [String] Cosmos DB database account name.
1432
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1433
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1434
+ # RUs per second of the parameters to provide for the current Cassandra
1435
+ # Keyspace.
1436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1437
+ # will be added to the HTTP request.
1438
+ #
1439
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1440
+ #
1441
+ def begin_update_cassandra_keyspace_throughput_with_http_info(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil)
1442
+ begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:custom_headers).value!
1443
+ end
1444
+
1445
+ #
1446
+ # Update RUs per second of an Azure Cosmos DB Cassandra Keyspace
1447
+ #
1448
+ # @param resource_group_name [String] The name of the resource group. The name
1449
+ # is case insensitive.
1450
+ # @param account_name [String] Cosmos DB database account name.
1451
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1452
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1453
+ # RUs per second of the parameters to provide for the current Cassandra
1454
+ # Keyspace.
1455
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1456
+ # to the HTTP request.
1457
+ #
1458
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1459
+ #
1460
+ def begin_update_cassandra_keyspace_throughput_async(resource_group_name, account_name, keyspace_name, update_throughput_parameters, custom_headers:nil)
1461
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1462
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1463
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1464
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1465
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1466
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1467
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1468
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1469
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1470
+ 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?
1471
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1472
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1473
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1474
+ fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil?
1475
+
1476
+
1477
+ request_headers = {}
1478
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1479
+
1480
+ # Set Headers
1481
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1482
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1483
+
1484
+ # Serialize Request
1485
+ request_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsUpdateParameters.mapper()
1486
+ request_content = @client.serialize(request_mapper, update_throughput_parameters)
1487
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1488
+
1489
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default'
1490
+
1491
+ request_url = @base_url || @client.base_url
1492
+
1493
+ options = {
1494
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1495
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1496
+ query_params: {'api-version' => @client.api_version},
1497
+ body: request_content,
1498
+ headers: request_headers.merge(custom_headers || {}),
1499
+ base_url: request_url
1500
+ }
1501
+ promise = @client.make_request_async(:put, path_template, options)
1502
+
1503
+ promise = promise.then do |result|
1504
+ http_response = result.response
1505
+ status_code = http_response.status
1506
+ response_content = http_response.body
1507
+ unless status_code == 202 || status_code == 200
1508
+ error_model = JSON.load(response_content)
1509
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1510
+ end
1511
+
1512
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1513
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1514
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1515
+ # Deserialize Response
1516
+ if status_code == 200
1517
+ begin
1518
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1519
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1520
+ result.body = @client.deserialize(result_mapper, parsed_response)
1521
+ rescue Exception => e
1522
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1523
+ end
1524
+ end
1525
+
1526
+ result
1527
+ end
1528
+
1529
+ promise.execute
1530
+ end
1531
+
1532
+ #
1533
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1534
+ # autoscale
1535
+ #
1536
+ # @param resource_group_name [String] The name of the resource group. The name
1537
+ # is case insensitive.
1538
+ # @param account_name [String] Cosmos DB database account name.
1539
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1540
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1541
+ # will be added to the HTTP request.
1542
+ #
1543
+ # @return [ThroughputSettingsGetResults] operation results.
1544
+ #
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!
1547
+ response.body unless response.nil?
1548
+ end
1549
+
1550
+ #
1551
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1552
+ # autoscale
1553
+ #
1554
+ # @param resource_group_name [String] The name of the resource group. The name
1555
+ # is case insensitive.
1556
+ # @param account_name [String] Cosmos DB database account name.
1557
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1558
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1559
+ # will be added to the HTTP request.
1560
+ #
1561
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1562
+ #
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!
1565
+ end
1566
+
1567
+ #
1568
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to
1569
+ # autoscale
1570
+ #
1571
+ # @param resource_group_name [String] The name of the resource group. The name
1572
+ # is case insensitive.
1573
+ # @param account_name [String] Cosmos DB database account name.
1574
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1575
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1576
+ # to the HTTP request.
1577
+ #
1578
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1579
+ #
1580
+ def begin_migrate_cassandra_keyspace_to_autoscale_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1581
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1582
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1583
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1584
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1585
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1586
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1587
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1588
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1589
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
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?
1591
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1592
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1593
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1594
+
1595
+
1596
+ request_headers = {}
1597
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1598
+
1599
+ # Set Headers
1600
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1601
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1602
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale'
1603
+
1604
+ request_url = @base_url || @client.base_url
1605
+
1606
+ options = {
1607
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1608
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1609
+ query_params: {'api-version' => @client.api_version},
1610
+ headers: request_headers.merge(custom_headers || {}),
1611
+ base_url: request_url
1612
+ }
1613
+ promise = @client.make_request_async(:post, path_template, options)
1614
+
1615
+ promise = promise.then do |result|
1616
+ http_response = result.response
1617
+ status_code = http_response.status
1618
+ response_content = http_response.body
1619
+ unless status_code == 202 || status_code == 200
1620
+ error_model = JSON.load(response_content)
1621
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1622
+ end
1623
+
1624
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1625
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1626
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1627
+ # Deserialize Response
1628
+ if status_code == 200
1629
+ begin
1630
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1631
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1632
+ result.body = @client.deserialize(result_mapper, parsed_response)
1633
+ rescue Exception => e
1634
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1635
+ end
1636
+ end
1637
+
1638
+ result
1639
+ end
1640
+
1641
+ promise.execute
1642
+ end
1643
+
1644
+ #
1645
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1646
+ # throughput
1647
+ #
1648
+ # @param resource_group_name [String] The name of the resource group. The name
1649
+ # is case insensitive.
1650
+ # @param account_name [String] Cosmos DB database account name.
1651
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1652
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1653
+ # will be added to the HTTP request.
1654
+ #
1655
+ # @return [ThroughputSettingsGetResults] operation results.
1656
+ #
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?
1660
+ end
1661
+
1662
+ #
1663
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1664
+ # throughput
1665
+ #
1666
+ # @param resource_group_name [String] The name of the resource group. The name
1667
+ # is case insensitive.
1668
+ # @param account_name [String] Cosmos DB database account name.
1669
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1670
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1671
+ # will be added to the HTTP request.
1672
+ #
1673
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1674
+ #
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!
1677
+ end
1678
+
1679
+ #
1680
+ # Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual
1681
+ # throughput
1682
+ #
1683
+ # @param resource_group_name [String] The name of the resource group. The name
1684
+ # is case insensitive.
1685
+ # @param account_name [String] Cosmos DB database account name.
1686
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1687
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1688
+ # to the HTTP request.
1689
+ #
1690
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1691
+ #
1692
+ def begin_migrate_cassandra_keyspace_to_manual_throughput_async(resource_group_name, account_name, keyspace_name, custom_headers:nil)
1693
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1694
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1695
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1696
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1697
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1698
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1699
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1700
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1701
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
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?
1703
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
1704
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1705
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1706
+
1707
+
1708
+ request_headers = {}
1709
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1710
+
1711
+ # Set Headers
1712
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1713
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1714
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput'
1715
+
1716
+ request_url = @base_url || @client.base_url
1717
+
1718
+ options = {
1719
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1720
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name},
1721
+ query_params: {'api-version' => @client.api_version},
1722
+ headers: request_headers.merge(custom_headers || {}),
1723
+ base_url: request_url
1724
+ }
1725
+ promise = @client.make_request_async(:post, path_template, options)
1726
+
1727
+ promise = promise.then do |result|
1728
+ http_response = result.response
1729
+ status_code = http_response.status
1730
+ response_content = http_response.body
1731
+ unless status_code == 202 || status_code == 200
1732
+ error_model = JSON.load(response_content)
1733
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1734
+ end
1735
+
1736
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1737
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
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::V2021_01_15::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
1749
+
1750
+ result
1751
+ end
1752
+
1753
+ promise.execute
1754
+ end
1755
+
1756
+ #
1757
+ # Create or update an Azure Cosmos DB Cassandra Table
1758
+ #
1759
+ # @param resource_group_name [String] The name of the resource group. The name
1760
+ # is case insensitive.
1761
+ # @param account_name [String] Cosmos DB database account name.
1762
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1763
+ # @param table_name [String] Cosmos DB table name.
1764
+ # @param create_update_cassandra_table_parameters
1765
+ # [CassandraTableCreateUpdateParameters] The parameters to provide for the
1766
+ # current Cassandra Table.
1767
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1768
+ # will be added to the HTTP request.
1769
+ #
1770
+ # @return [CassandraTableGetResults] operation results.
1771
+ #
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!
1774
+ response.body unless response.nil?
1775
+ end
1776
+
1777
+ #
1778
+ # Create or update an Azure Cosmos DB Cassandra Table
1779
+ #
1780
+ # @param resource_group_name [String] The name of the resource group. The name
1781
+ # is case insensitive.
1782
+ # @param account_name [String] Cosmos DB database account name.
1783
+ # @param keyspace_name [String] Cosmos DB keyspace name.
1784
+ # @param table_name [String] Cosmos DB table name.
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::V2021_01_15::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::V2021_01_15::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.
2018
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2019
+ # will be added to the HTTP request.
2020
+ #
2021
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2022
+ #
2023
+ def begin_update_cassandra_table_throughput_with_http_info(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
2024
+ begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
2025
+ end
2026
+
2027
+ #
2028
+ # Update RUs per second of an Azure Cosmos DB Cassandra table
2029
+ #
2030
+ # @param resource_group_name [String] The name of the resource group. The name
2031
+ # is case insensitive.
2032
+ # @param account_name [String] Cosmos DB database account name.
2033
+ # @param keyspace_name [String] Cosmos DB keyspace name.
2034
+ # @param table_name [String] Cosmos DB table name.
2035
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
2036
+ # RUs per second of the parameters to provide for the current Cassandra table.
2037
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2038
+ # to the HTTP request.
2039
+ #
2040
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2041
+ #
2042
+ def begin_update_cassandra_table_throughput_async(resource_group_name, account_name, keyspace_name, table_name, update_throughput_parameters, custom_headers:nil)
2043
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2044
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2045
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2046
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2047
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2048
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2049
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2050
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2051
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2052
+ 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?
2053
+ fail ArgumentError, 'keyspace_name is nil' if keyspace_name.nil?
2054
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
2055
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2056
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2057
+ fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil?
2058
+
2059
+
2060
+ request_headers = {}
2061
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2062
+
2063
+ # Set Headers
2064
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2065
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2066
+
2067
+ # Serialize Request
2068
+ request_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsUpdateParameters.mapper()
2069
+ request_content = @client.serialize(request_mapper, update_throughput_parameters)
2070
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2071
+
2072
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'
2073
+
2074
+ request_url = @base_url || @client.base_url
2075
+
2076
+ options = {
2077
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2078
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'keyspaceName' => keyspace_name,'tableName' => table_name},
2079
+ query_params: {'api-version' => @client.api_version},
2080
+ body: request_content,
2081
+ headers: request_headers.merge(custom_headers || {}),
2082
+ base_url: request_url
2083
+ }
2084
+ promise = @client.make_request_async(:put, path_template, options)
2085
+
2086
+ promise = promise.then do |result|
2087
+ http_response = result.response
2088
+ status_code = http_response.status
2089
+ response_content = http_response.body
2090
+ unless status_code == 202 || status_code == 200
2091
+ error_model = JSON.load(response_content)
2092
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2093
+ end
2094
+
2095
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2096
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2097
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2098
+ # Deserialize Response
2099
+ if status_code == 200
2100
+ begin
2101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2102
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
2103
+ result.body = @client.deserialize(result_mapper, parsed_response)
2104
+ rescue Exception => e
2105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2106
+ end
2107
+ end
2108
+
2109
+ result
2110
+ end
2111
+
2112
+ promise.execute
2113
+ end
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 MsRest::HttpOperationError.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::V2021_01_15::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 MsRest::HttpOperationError.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::V2021_01_15::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
+
2347
+ end
2348
+ end