azure_mgmt_cosmosdb 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb.rb +140 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection.rb +371 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition.rb +267 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +155 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_region.rb +155 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb +180 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database.rb +359 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_account_region.rb +147 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb +6805 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace.rb +97 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table.rb +120 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +70 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account.rb +313 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +243 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +83 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_patch_parameters.rb +75 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +71 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database.rb +132 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph.rb +197 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +99 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/location.rb +102 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection.rb +137 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +86 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase.rb +97 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +16 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/resource.rb +112 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container.rb +197 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +68 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +111 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database.rb +156 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +69 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table.rb +97 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +68 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/operations.rb +219 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +155 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +162 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile.rb +140 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +157 -0
- data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile_target.rb +147 -0
- data/lib/azure_mgmt_cosmosdb.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/cosmosdb_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/cosmosdb_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/cosmosdb_profile_module.rb +485 -0
- data/lib/version.rb +7 -0
- metadata +240 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 46ec05b9e14622dd3d7729ac00cb4153d0eec4c84110a0df98a4922f7a99c3cf
|
|
4
|
+
data.tar.gz: c081d07cd29758d8caeff6c586ed6b0323f014a03a21acedb584083c33b0c111
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e42a72e7812e5ba5f955abe23a19852738371709563f48c6fc8fc882cefdd97a17e6d0d81a7d32d41d97adf2bdf45a81613adc225992f963125acf2f131a0eb7
|
|
7
|
+
data.tar.gz: 8e99378f413557f7b460fdab9464f27f6f1c274a311ed5a555da6ff29835662f8a1505722a7d6bdfe076faeef54307976bc36e3ba67974c9beb014381a7e881d
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,140 @@
|
|
|
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 '2015-04-08/generated/azure_mgmt_cosmosdb/module_definition'
|
|
20
|
+
require 'ms_rest_azure'
|
|
21
|
+
|
|
22
|
+
module Azure::Cosmosdb::Mgmt::V2015_04_08
|
|
23
|
+
autoload :DatabaseAccounts, '2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb'
|
|
24
|
+
autoload :Operations, '2015-04-08/generated/azure_mgmt_cosmosdb/operations.rb'
|
|
25
|
+
autoload :Database, '2015-04-08/generated/azure_mgmt_cosmosdb/database.rb'
|
|
26
|
+
autoload :Collection, '2015-04-08/generated/azure_mgmt_cosmosdb/collection.rb'
|
|
27
|
+
autoload :CollectionRegion, '2015-04-08/generated/azure_mgmt_cosmosdb/collection_region.rb'
|
|
28
|
+
autoload :DatabaseAccountRegion, '2015-04-08/generated/azure_mgmt_cosmosdb/database_account_region.rb'
|
|
29
|
+
autoload :PercentileSourceTarget, '2015-04-08/generated/azure_mgmt_cosmosdb/percentile_source_target.rb'
|
|
30
|
+
autoload :PercentileTarget, '2015-04-08/generated/azure_mgmt_cosmosdb/percentile_target.rb'
|
|
31
|
+
autoload :Percentile, '2015-04-08/generated/azure_mgmt_cosmosdb/percentile.rb'
|
|
32
|
+
autoload :CollectionPartitionRegion, '2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition_region.rb'
|
|
33
|
+
autoload :CollectionPartition, '2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition.rb'
|
|
34
|
+
autoload :PartitionKeyRangeId, '2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb'
|
|
35
|
+
autoload :PartitionKeyRangeIdRegion, '2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb'
|
|
36
|
+
autoload :CosmosDB, '2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb'
|
|
37
|
+
|
|
38
|
+
module Models
|
|
39
|
+
autoload :DatabaseAccountRegenerateKeyParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb'
|
|
40
|
+
autoload :SqlDatabaseResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb'
|
|
41
|
+
autoload :Capability, '2015-04-08/generated/azure_mgmt_cosmosdb/models/capability.rb'
|
|
42
|
+
autoload :SqlDatabaseCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb'
|
|
43
|
+
autoload :FailoverPolicy, '2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policy.rb'
|
|
44
|
+
autoload :SqlContainerResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb'
|
|
45
|
+
autoload :DatabaseAccountListReadOnlyKeysResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb'
|
|
46
|
+
autoload :DatabaseAccountListKeysResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb'
|
|
47
|
+
autoload :DatabaseAccountConnectionString, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb'
|
|
48
|
+
autoload :Indexes, '2015-04-08/generated/azure_mgmt_cosmosdb/models/indexes.rb'
|
|
49
|
+
autoload :DatabaseAccountListConnectionStringsResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb'
|
|
50
|
+
autoload :ExcludedPath, '2015-04-08/generated/azure_mgmt_cosmosdb/models/excluded_path.rb'
|
|
51
|
+
autoload :ConsistencyPolicy, '2015-04-08/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb'
|
|
52
|
+
autoload :ContainerPartitionKey, '2015-04-08/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb'
|
|
53
|
+
autoload :Location, '2015-04-08/generated/azure_mgmt_cosmosdb/models/location.rb'
|
|
54
|
+
autoload :UniqueKeyPolicy, '2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb'
|
|
55
|
+
autoload :VirtualNetworkRule, '2015-04-08/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb'
|
|
56
|
+
autoload :PartitionMetricListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb'
|
|
57
|
+
autoload :PartitionUsagesResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb'
|
|
58
|
+
autoload :PercentileMetricListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb'
|
|
59
|
+
autoload :SqlContainerCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb'
|
|
60
|
+
autoload :PercentileMetric, '2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb'
|
|
61
|
+
autoload :MongoDBDatabaseResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb'
|
|
62
|
+
autoload :MetricListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb'
|
|
63
|
+
autoload :MongoDBDatabaseCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb'
|
|
64
|
+
autoload :Metric, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric.rb'
|
|
65
|
+
autoload :MongoIndexKeys, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb'
|
|
66
|
+
autoload :MetricValue, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_value.rb'
|
|
67
|
+
autoload :MongoIndexOptions, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb'
|
|
68
|
+
autoload :MetricDefinitionsListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb'
|
|
69
|
+
autoload :MongoIndex, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index.rb'
|
|
70
|
+
autoload :MetricDefinition, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definition.rb'
|
|
71
|
+
autoload :MongoDBCollectionResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb'
|
|
72
|
+
autoload :ErrorResponse, '2015-04-08/generated/azure_mgmt_cosmosdb/models/error_response.rb'
|
|
73
|
+
autoload :MongoDBCollectionCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb'
|
|
74
|
+
autoload :RegionForOnlineOffline, '2015-04-08/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb'
|
|
75
|
+
autoload :TableResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/table_resource.rb'
|
|
76
|
+
autoload :ExtendedResourceProperties, '2015-04-08/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb'
|
|
77
|
+
autoload :TableCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb'
|
|
78
|
+
autoload :DatabaseAccountPatchParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_patch_parameters.rb'
|
|
79
|
+
autoload :CassandraKeyspaceResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb'
|
|
80
|
+
autoload :SqlDatabaseListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb'
|
|
81
|
+
autoload :CassandraKeyspaceCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb'
|
|
82
|
+
autoload :IndexingPolicy, '2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb'
|
|
83
|
+
autoload :Column, '2015-04-08/generated/azure_mgmt_cosmosdb/models/column.rb'
|
|
84
|
+
autoload :ConflictResolutionPolicy, '2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb'
|
|
85
|
+
autoload :CassandraPartitionKey, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb'
|
|
86
|
+
autoload :MongoDBDatabaseListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb'
|
|
87
|
+
autoload :ClusterKey, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cluster_key.rb'
|
|
88
|
+
autoload :TableListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/table_list_result.rb'
|
|
89
|
+
autoload :CassandraSchema, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb'
|
|
90
|
+
autoload :CassandraTableListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb'
|
|
91
|
+
autoload :CassandraTableResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb'
|
|
92
|
+
autoload :GremlinGraphListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb'
|
|
93
|
+
autoload :CassandraTableCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb'
|
|
94
|
+
autoload :Resource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/resource.rb'
|
|
95
|
+
autoload :GremlinDatabaseResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb'
|
|
96
|
+
autoload :DatabaseAccountsListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb'
|
|
97
|
+
autoload :GremlinDatabaseCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb'
|
|
98
|
+
autoload :UniqueKey, '2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key.rb'
|
|
99
|
+
autoload :GremlinGraphResource, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb'
|
|
100
|
+
autoload :MongoDBCollectionListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb'
|
|
101
|
+
autoload :GremlinGraphCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb'
|
|
102
|
+
autoload :GremlinDatabaseListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb'
|
|
103
|
+
autoload :OperationDisplay, '2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_display.rb'
|
|
104
|
+
autoload :MetricAvailability, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_availability.rb'
|
|
105
|
+
autoload :Operation, '2015-04-08/generated/azure_mgmt_cosmosdb/models/operation.rb'
|
|
106
|
+
autoload :SqlContainerListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb'
|
|
107
|
+
autoload :OperationListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb'
|
|
108
|
+
autoload :FailoverPolicies, '2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policies.rb'
|
|
109
|
+
autoload :MetricName, '2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_name.rb'
|
|
110
|
+
autoload :CassandraKeyspaceListResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb'
|
|
111
|
+
autoload :Usage, '2015-04-08/generated/azure_mgmt_cosmosdb/models/usage.rb'
|
|
112
|
+
autoload :IncludedPath, '2015-04-08/generated/azure_mgmt_cosmosdb/models/included_path.rb'
|
|
113
|
+
autoload :UsagesResult, '2015-04-08/generated/azure_mgmt_cosmosdb/models/usages_result.rb'
|
|
114
|
+
autoload :DatabaseAccount, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account.rb'
|
|
115
|
+
autoload :SqlDatabase, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database.rb'
|
|
116
|
+
autoload :SqlContainer, '2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container.rb'
|
|
117
|
+
autoload :MongoDBDatabase, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase.rb'
|
|
118
|
+
autoload :MongoDBCollection, '2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection.rb'
|
|
119
|
+
autoload :Table, '2015-04-08/generated/azure_mgmt_cosmosdb/models/table.rb'
|
|
120
|
+
autoload :CassandraKeyspace, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace.rb'
|
|
121
|
+
autoload :CassandraTable, '2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table.rb'
|
|
122
|
+
autoload :GremlinDatabase, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database.rb'
|
|
123
|
+
autoload :GremlinGraph, '2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph.rb'
|
|
124
|
+
autoload :DatabaseAccountCreateUpdateParameters, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb'
|
|
125
|
+
autoload :PartitionUsage, '2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usage.rb'
|
|
126
|
+
autoload :PercentileMetricValue, '2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb'
|
|
127
|
+
autoload :PartitionMetric, '2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric.rb'
|
|
128
|
+
autoload :DatabaseAccountKind, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb'
|
|
129
|
+
autoload :DatabaseAccountOfferType, '2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb'
|
|
130
|
+
autoload :DefaultConsistencyLevel, '2015-04-08/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb'
|
|
131
|
+
autoload :IndexingMode, '2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb'
|
|
132
|
+
autoload :DataType, '2015-04-08/generated/azure_mgmt_cosmosdb/models/data_type.rb'
|
|
133
|
+
autoload :IndexKind, '2015-04-08/generated/azure_mgmt_cosmosdb/models/index_kind.rb'
|
|
134
|
+
autoload :PartitionKind, '2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_kind.rb'
|
|
135
|
+
autoload :ConflictResolutionMode, '2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb'
|
|
136
|
+
autoload :KeyKind, '2015-04-08/generated/azure_mgmt_cosmosdb/models/key_kind.rb'
|
|
137
|
+
autoload :UnitType, '2015-04-08/generated/azure_mgmt_cosmosdb/models/unit_type.rb'
|
|
138
|
+
autoload :PrimaryAggregationType, '2015-04-08/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb'
|
|
139
|
+
end
|
|
140
|
+
end
|
|
@@ -0,0 +1,371 @@
|
|
|
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::V2015_04_08
|
|
7
|
+
#
|
|
8
|
+
# Azure Cosmos DB Database Service Resource Provider REST API
|
|
9
|
+
#
|
|
10
|
+
class Collection
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the Collection class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [CosmosDB] reference to the CosmosDB
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Retrieves the metrics determined by the given filter for the given database
|
|
26
|
+
# account and collection.
|
|
27
|
+
#
|
|
28
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
29
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
30
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
31
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
32
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
33
|
+
# metrics to return. The parameters that can be filtered are name.value (name
|
|
34
|
+
# of the metric, can have an or of multiple names), startTime, endTime, and
|
|
35
|
+
# timeGrain. The supported operator is eq.
|
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
37
|
+
# will be added to the HTTP request.
|
|
38
|
+
#
|
|
39
|
+
# @return [MetricListResult] operation results.
|
|
40
|
+
#
|
|
41
|
+
def list_metrics(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil)
|
|
42
|
+
response = list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value!
|
|
43
|
+
response.body unless response.nil?
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
#
|
|
47
|
+
# Retrieves the metrics determined by the given filter for the given database
|
|
48
|
+
# account and collection.
|
|
49
|
+
#
|
|
50
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
51
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
52
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
53
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
54
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
55
|
+
# metrics to return. The parameters that can be filtered are name.value (name
|
|
56
|
+
# of the metric, can have an or of multiple names), startTime, endTime, and
|
|
57
|
+
# timeGrain. The supported operator is eq.
|
|
58
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
59
|
+
# will be added to the HTTP request.
|
|
60
|
+
#
|
|
61
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
62
|
+
#
|
|
63
|
+
def list_metrics_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil)
|
|
64
|
+
list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:custom_headers).value!
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
#
|
|
68
|
+
# Retrieves the metrics determined by the given filter for the given database
|
|
69
|
+
# account and collection.
|
|
70
|
+
#
|
|
71
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
72
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
73
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
74
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
75
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
76
|
+
# metrics to return. The parameters that can be filtered are name.value (name
|
|
77
|
+
# of the metric, can have an or of multiple names), startTime, endTime, and
|
|
78
|
+
# timeGrain. The supported operator is eq.
|
|
79
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
80
|
+
# to the HTTP request.
|
|
81
|
+
#
|
|
82
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
83
|
+
#
|
|
84
|
+
def list_metrics_async(resource_group_name, account_name, database_rid, collection_rid, filter, custom_headers:nil)
|
|
85
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
86
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
87
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
|
88
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
|
89
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
|
90
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
|
91
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
|
|
92
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
|
93
|
+
fail ArgumentError, 'database_rid is nil' if database_rid.nil?
|
|
94
|
+
fail ArgumentError, 'collection_rid is nil' if collection_rid.nil?
|
|
95
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
96
|
+
fail ArgumentError, 'filter is nil' if filter.nil?
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
request_headers = {}
|
|
100
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
101
|
+
|
|
102
|
+
# Set Headers
|
|
103
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
104
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
105
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics'
|
|
106
|
+
|
|
107
|
+
request_url = @base_url || @client.base_url
|
|
108
|
+
|
|
109
|
+
options = {
|
|
110
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
111
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid},
|
|
112
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
|
113
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
114
|
+
base_url: request_url
|
|
115
|
+
}
|
|
116
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
117
|
+
|
|
118
|
+
promise = promise.then do |result|
|
|
119
|
+
http_response = result.response
|
|
120
|
+
status_code = http_response.status
|
|
121
|
+
response_content = http_response.body
|
|
122
|
+
unless status_code == 200
|
|
123
|
+
error_model = JSON.load(response_content)
|
|
124
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
128
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
129
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
130
|
+
# Deserialize Response
|
|
131
|
+
if status_code == 200
|
|
132
|
+
begin
|
|
133
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
134
|
+
result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::MetricListResult.mapper()
|
|
135
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
136
|
+
rescue Exception => e
|
|
137
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
result
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
promise.execute
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
#
|
|
148
|
+
# Retrieves the usages (most recent storage data) for the given collection.
|
|
149
|
+
#
|
|
150
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
151
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
152
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
153
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
154
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
155
|
+
# usages to return. The supported parameter is name.value (name of the metric,
|
|
156
|
+
# can have an or of multiple names).
|
|
157
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
158
|
+
# will be added to the HTTP request.
|
|
159
|
+
#
|
|
160
|
+
# @return [UsagesResult] operation results.
|
|
161
|
+
#
|
|
162
|
+
def list_usages(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil)
|
|
163
|
+
response = list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value!
|
|
164
|
+
response.body unless response.nil?
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
#
|
|
168
|
+
# Retrieves the usages (most recent storage data) for the given collection.
|
|
169
|
+
#
|
|
170
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
171
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
172
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
173
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
174
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
175
|
+
# usages to return. The supported parameter is name.value (name of the metric,
|
|
176
|
+
# can have an or of multiple names).
|
|
177
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
178
|
+
# will be added to the HTTP request.
|
|
179
|
+
#
|
|
180
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
181
|
+
#
|
|
182
|
+
def list_usages_with_http_info(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil)
|
|
183
|
+
list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:filter, custom_headers:custom_headers).value!
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
#
|
|
187
|
+
# Retrieves the usages (most recent storage data) for the given collection.
|
|
188
|
+
#
|
|
189
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
190
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
191
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
192
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
193
|
+
# @param filter [String] An OData filter expression that describes a subset of
|
|
194
|
+
# usages to return. The supported parameter is name.value (name of the metric,
|
|
195
|
+
# can have an or of multiple names).
|
|
196
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
197
|
+
# to the HTTP request.
|
|
198
|
+
#
|
|
199
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
200
|
+
#
|
|
201
|
+
def list_usages_async(resource_group_name, account_name, database_rid, collection_rid, filter:nil, custom_headers:nil)
|
|
202
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
203
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
204
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
|
205
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
|
206
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
|
207
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
|
208
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
|
|
209
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
|
210
|
+
fail ArgumentError, 'database_rid is nil' if database_rid.nil?
|
|
211
|
+
fail ArgumentError, 'collection_rid is nil' if collection_rid.nil?
|
|
212
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
request_headers = {}
|
|
216
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
217
|
+
|
|
218
|
+
# Set Headers
|
|
219
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
220
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
221
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages'
|
|
222
|
+
|
|
223
|
+
request_url = @base_url || @client.base_url
|
|
224
|
+
|
|
225
|
+
options = {
|
|
226
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
227
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid},
|
|
228
|
+
query_params: {'api-version' => @client.api_version,'$filter' => filter},
|
|
229
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
230
|
+
base_url: request_url
|
|
231
|
+
}
|
|
232
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
233
|
+
|
|
234
|
+
promise = promise.then do |result|
|
|
235
|
+
http_response = result.response
|
|
236
|
+
status_code = http_response.status
|
|
237
|
+
response_content = http_response.body
|
|
238
|
+
unless status_code == 200
|
|
239
|
+
error_model = JSON.load(response_content)
|
|
240
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
244
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
245
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
246
|
+
# Deserialize Response
|
|
247
|
+
if status_code == 200
|
|
248
|
+
begin
|
|
249
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
250
|
+
result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::UsagesResult.mapper()
|
|
251
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
252
|
+
rescue Exception => e
|
|
253
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
result
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
promise.execute
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
#
|
|
264
|
+
# Retrieves metric definitions for the given collection.
|
|
265
|
+
#
|
|
266
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
267
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
268
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
269
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
270
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
271
|
+
# will be added to the HTTP request.
|
|
272
|
+
#
|
|
273
|
+
# @return [MetricDefinitionsListResult] operation results.
|
|
274
|
+
#
|
|
275
|
+
def list_metric_definitions(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil)
|
|
276
|
+
response = list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value!
|
|
277
|
+
response.body unless response.nil?
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
#
|
|
281
|
+
# Retrieves metric definitions for the given collection.
|
|
282
|
+
#
|
|
283
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
284
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
285
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
286
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
287
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
288
|
+
# will be added to the HTTP request.
|
|
289
|
+
#
|
|
290
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
291
|
+
#
|
|
292
|
+
def list_metric_definitions_with_http_info(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil)
|
|
293
|
+
list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:custom_headers).value!
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
#
|
|
297
|
+
# Retrieves metric definitions for the given collection.
|
|
298
|
+
#
|
|
299
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
|
300
|
+
# @param account_name [String] Cosmos DB database account name.
|
|
301
|
+
# @param database_rid [String] Cosmos DB database rid.
|
|
302
|
+
# @param collection_rid [String] Cosmos DB collection rid.
|
|
303
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
304
|
+
# to the HTTP request.
|
|
305
|
+
#
|
|
306
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
307
|
+
#
|
|
308
|
+
def list_metric_definitions_async(resource_group_name, account_name, database_rid, collection_rid, custom_headers:nil)
|
|
309
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
310
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
311
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
|
312
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
|
313
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
|
314
|
+
fail ArgumentError, 'account_name is nil' if account_name.nil?
|
|
315
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
|
|
316
|
+
fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
|
|
317
|
+
fail ArgumentError, 'database_rid is nil' if database_rid.nil?
|
|
318
|
+
fail ArgumentError, 'collection_rid is nil' if collection_rid.nil?
|
|
319
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
request_headers = {}
|
|
323
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
324
|
+
|
|
325
|
+
# Set Headers
|
|
326
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
327
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
328
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions'
|
|
329
|
+
|
|
330
|
+
request_url = @base_url || @client.base_url
|
|
331
|
+
|
|
332
|
+
options = {
|
|
333
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
334
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseRid' => database_rid,'collectionRid' => collection_rid},
|
|
335
|
+
query_params: {'api-version' => @client.api_version},
|
|
336
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
337
|
+
base_url: request_url
|
|
338
|
+
}
|
|
339
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
340
|
+
|
|
341
|
+
promise = promise.then do |result|
|
|
342
|
+
http_response = result.response
|
|
343
|
+
status_code = http_response.status
|
|
344
|
+
response_content = http_response.body
|
|
345
|
+
unless status_code == 200
|
|
346
|
+
error_model = JSON.load(response_content)
|
|
347
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
351
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
352
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
353
|
+
# Deserialize Response
|
|
354
|
+
if status_code == 200
|
|
355
|
+
begin
|
|
356
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
357
|
+
result_mapper = Azure::Cosmosdb::Mgmt::V2015_04_08::Models::MetricDefinitionsListResult.mapper()
|
|
358
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
359
|
+
rescue Exception => e
|
|
360
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
result
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
promise.execute
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
end
|
|
371
|
+
end
|