diff --git a/.apigentools-info b/.apigentools-info index 2513c8ac4c..4cf2760b92 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-29 07:52:53.496255", - "spec_repo_commit": "6dc3341" + "regenerated": "2021-01-29 12:49:08.176509", + "spec_repo_commit": "bc876ff" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-29 07:53:05.627056", - "spec_repo_commit": "6dc3341" + "regenerated": "2021-01-29 12:49:19.740192", + "spec_repo_commit": "bc876ff" } } } \ No newline at end of file diff --git a/docs/v1/README.md b/docs/v1/README.md index ba038d723a..a0da668ea6 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -249,6 +249,7 @@ Class | Method | HTTP request | Description *UsageMeteringApi* | [**get_usage_fargate**](UsageMeteringApi.md#get_usage_fargate) | **GET** /api/v1/usage/fargate | Get hourly usage for Fargate *UsageMeteringApi* | [**get_usage_hosts**](UsageMeteringApi.md#get_usage_hosts) | **GET** /api/v1/usage/hosts | Get hourly usage for hosts and containers *UsageMeteringApi* | [**get_usage_indexed_spans**](UsageMeteringApi.md#get_usage_indexed_spans) | **GET** /api/v1/usage/indexed-spans | Get hourly usage for indexed spans +*UsageMeteringApi* | [**get_usage_internet_of_things**](UsageMeteringApi.md#get_usage_internet_of_things) | **GET** /api/v1/usage/iot | Get hourly usage for IoT *UsageMeteringApi* | [**get_usage_lambda**](UsageMeteringApi.md#get_usage_lambda) | **GET** /api/v1/usage/aws_lambda | Get hourly usage for Lambda *UsageMeteringApi* | [**get_usage_logs**](UsageMeteringApi.md#get_usage_logs) | **GET** /api/v1/usage/logs | Get hourly usage for Logs *UsageMeteringApi* | [**get_usage_logs_by_index**](UsageMeteringApi.md#get_usage_logs_by_index) | **GET** /api/v1/usage/logs_by_index | Get hourly usage for Logs by Index @@ -669,6 +670,8 @@ Class | Method | HTTP request | Description - [UsageIndexedSpansResponse](UsageIndexedSpansResponse.md) - [UsageIngestedSpansHour](UsageIngestedSpansHour.md) - [UsageIngestedSpansResponse](UsageIngestedSpansResponse.md) + - [UsageIoTHour](UsageIoTHour.md) + - [UsageIoTResponse](UsageIoTResponse.md) - [UsageLambdaHour](UsageLambdaHour.md) - [UsageLambdaResponse](UsageLambdaResponse.md) - [UsageLogsByIndexHour](UsageLogsByIndexHour.md) diff --git a/docs/v1/UsageIoTHour.md b/docs/v1/UsageIoTHour.md new file mode 100644 index 0000000000..94a8a27ba3 --- /dev/null +++ b/docs/v1/UsageIoTHour.md @@ -0,0 +1,12 @@ +# UsageIoTHour + +IoT usage for a given organization for a given hour. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hour** | **datetime** | The hour for the usage. | [optional] +**iot_device_count** | **int** | The total number of IoT device hours from the start of the given hour's month until the given hour. | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/UsageIoTResponse.md b/docs/v1/UsageIoTResponse.md new file mode 100644 index 0000000000..b571a38fae --- /dev/null +++ b/docs/v1/UsageIoTResponse.md @@ -0,0 +1,11 @@ +# UsageIoTResponse + +Response containing the IoT usage for each hour for a given organization. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**usage** | [**[UsageIoTHour]**](UsageIoTHour.md) | Get hourly usage for IoT. | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/UsageMeteringApi.md b/docs/v1/UsageMeteringApi.md index 8e2056d8a3..bc5208ec09 100644 --- a/docs/v1/UsageMeteringApi.md +++ b/docs/v1/UsageMeteringApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**get_usage_fargate**](UsageMeteringApi.md#get_usage_fargate) | **GET** /api/v1/usage/fargate | Get hourly usage for Fargate [**get_usage_hosts**](UsageMeteringApi.md#get_usage_hosts) | **GET** /api/v1/usage/hosts | Get hourly usage for hosts and containers [**get_usage_indexed_spans**](UsageMeteringApi.md#get_usage_indexed_spans) | **GET** /api/v1/usage/indexed-spans | Get hourly usage for indexed spans +[**get_usage_internet_of_things**](UsageMeteringApi.md#get_usage_internet_of_things) | **GET** /api/v1/usage/iot | Get hourly usage for IoT [**get_usage_lambda**](UsageMeteringApi.md#get_usage_lambda) | **GET** /api/v1/usage/aws_lambda | Get hourly usage for Lambda [**get_usage_logs**](UsageMeteringApi.md#get_usage_logs) | **GET** /api/v1/usage/logs | Get hourly usage for Logs [**get_usage_logs_by_index**](UsageMeteringApi.md#get_usage_logs_by_index) | **GET** /api/v1/usage/logs_by_index | Get hourly usage for Logs by Index @@ -1095,6 +1096,90 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **get_usage_internet_of_things** +> UsageIoTResponse get_usage_internet_of_things(start_hr) + +Get hourly usage for IoT + +Get hourly usage for IoT. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +from datadog_api_client.v1 import ApiClient, ApiException, Configuration +from datadog_api_client.v1.api import usage_metering_api +from datadog_api_client.v1.models import * +from pprint import pprint +# Defining the host is optional and defaults to https://api.datadoghq.com +# See configuration.py for a list of all supported configuration parameters. +configuration = datadog_api_client.v1.Configuration( + host="https://api.datadoghq.com" +) + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Enter a context with an instance of the API client +with ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = usage_metering_api.UsageMeteringApi(api_client) + start_hr = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. + end_hr = dateutil_parser('1970-01-01T00:00:00.00Z') # datetime | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. (optional) + + # example passing only required values which don't have defaults set + try: + # Get hourly usage for IoT + api_response = api_instance.get_usage_internet_of_things(start_hr) + pprint(api_response) + except ApiException as e: + print("Exception when calling UsageMeteringApi->get_usage_internet_of_things: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Get hourly usage for IoT + api_response = api_instance.get_usage_internet_of_things(start_hr, end_hr=end_hr) + pprint(api_response) + except ApiException as e: + print("Exception when calling UsageMeteringApi->get_usage_internet_of_things: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **start_hr** | **datetime**| Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. | + **end_hr** | **datetime**| Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. | [optional] + +### Return type + +[**UsageIoTResponse**](UsageIoTResponse.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json;datetime-format=rfc3339 + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Forbidden - User is not authorized | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **get_usage_lambda** > UsageLambdaResponse get_usage_lambda(start_hr) diff --git a/docs/v1/UsageSummaryDate.md b/docs/v1/UsageSummaryDate.md index f5f927c0bc..c3a36e61df 100644 --- a/docs/v1/UsageSummaryDate.md +++ b/docs/v1/UsageSummaryDate.md @@ -23,6 +23,8 @@ Name | Type | Description | Notes **indexed_events_count_sum** | **int** | Shows the sum of all log events indexed over all hours in the current date for all organizations. | [optional] **infra_host_top99p** | **int** | Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for all organizations. | [optional] **ingested_events_bytes_sum** | **int** | Shows the sum of all log bytes ingested over all hours in the current date for all organizations. | [optional] +**iot_device_agg_sum** | **int** | Shows the sum of all IoT devices over all hours in the current date for all organizations. | [optional] +**iot_device_top99p_sum** | **int** | Shows the 99th percentile of all IoT devices over all hours in the current date all organizations. | [optional] **mobile_rum_session_count_android_sum** | **int** | Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for all organizations. | [optional] **mobile_rum_session_count_ios_sum** | **int** | Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for all organizations. | [optional] **mobile_rum_session_count_sum** | **int** | Shows the sum of all mobile RUM Sessions over all hours in the current date for all organizations | [optional] diff --git a/docs/v1/UsageSummaryDateOrg.md b/docs/v1/UsageSummaryDateOrg.md index 50c576e2ff..a9a909d48f 100644 --- a/docs/v1/UsageSummaryDateOrg.md +++ b/docs/v1/UsageSummaryDateOrg.md @@ -23,6 +23,8 @@ Name | Type | Description | Notes **indexed_events_count_sum** | **int** | Shows the sum of all log events indexed over all hours in the current date for the given org. | [optional] **infra_host_top99p** | **int** | Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for the given org. | [optional] **ingested_events_bytes_sum** | **int** | Shows the sum of all log bytes ingested over all hours in the current date for the given org. | [optional] +**iot_device_agg_sum** | **int** | Shows the sum of all IoT devices over all hours in the current date for the given org. | [optional] +**iot_device_top99p_sum** | **int** | Shows the 99th percentile of all IoT devices over all hours in the current date for the given org. | [optional] **mobile_rum_session_count_android_sum** | **int** | Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for the given org. | [optional] **mobile_rum_session_count_ios_sum** | **int** | Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for the given org. | [optional] **mobile_rum_session_count_sum** | **int** | Shows the sum of all mobile RUM Sessions over all hours in the current date for the given org. | [optional] diff --git a/docs/v1/UsageSummaryResponse.md b/docs/v1/UsageSummaryResponse.md index 7354001a7d..4761dda848 100644 --- a/docs/v1/UsageSummaryResponse.md +++ b/docs/v1/UsageSummaryResponse.md @@ -24,6 +24,8 @@ Name | Type | Description | Notes **indexed_events_count_agg_sum** | **int** | Shows the sum of all log events indexed over all hours in the current months for all organizations. | [optional] **infra_host_top99p_sum** | **int** | Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current months for all organizations. | [optional] **ingested_events_bytes_agg_sum** | **int** | Shows the sum of all log bytes ingested over all hours in the current months for all organizations. | [optional] +**iot_device_agg_sum** | **int** | Shows the sum of all IoT devices over all hours in the current months for all organizations. | [optional] +**iot_device_top99p_sum** | **int** | Shows the 99th percentile of all IoT devices over all hours in the current months of all organizations. | [optional] **last_updated** | **datetime** | Shows the the most recent hour in the current months for all organizations for which all usages were calculated. | [optional] **live_indexed_events_agg_sum** | **int** | Shows the sum of all live logs indexed over all hours in the current months for all organizations (data available as of December 1, 2020). | [optional] **live_ingested_bytes_agg_sum** | **int** | Shows the sum of all live logs bytes ingested over all hours in the current months for all organizations (data available as of December 1, 2020). | [optional] diff --git a/src/datadog_api_client/v1/api/usage_metering_api.py b/src/datadog_api_client/v1/api/usage_metering_api.py index 265247416b..b91af896fb 100644 --- a/src/datadog_api_client/v1/api/usage_metering_api.py +++ b/src/datadog_api_client/v1/api/usage_metering_api.py @@ -27,6 +27,7 @@ from datadog_api_client.v1.model.usage_incident_management_response import UsageIncidentManagementResponse from datadog_api_client.v1.model.usage_indexed_spans_response import UsageIndexedSpansResponse from datadog_api_client.v1.model.usage_ingested_spans_response import UsageIngestedSpansResponse +from datadog_api_client.v1.model.usage_io_t_response import UsageIoTResponse from datadog_api_client.v1.model.usage_lambda_response import UsageLambdaResponse from datadog_api_client.v1.model.usage_logs_by_index_response import UsageLogsByIndexResponse from datadog_api_client.v1.model.usage_logs_response import UsageLogsResponse @@ -1708,6 +1709,132 @@ def __get_usage_indexed_spans( callable=__get_usage_indexed_spans ) + def __get_usage_internet_of_things( + self, + start_hr, + **kwargs + ): + """Get hourly usage for IoT # noqa: E501 + + Get hourly usage for IoT. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_usage_internet_of_things(start_hr, async_req=True) + >>> result = thread.get() + + Args: + start_hr (datetime): Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. + + Keyword Args: + end_hr (datetime): Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + UsageIoTResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['start_hr'] = \ + start_hr + return self.call_with_http_info(**kwargs) + + self.get_usage_internet_of_things = _Endpoint( + settings={ + 'response_type': (UsageIoTResponse,), + 'auth': [ + 'apiKeyAuth', + 'appKeyAuth' + ], + 'endpoint_path': '/api/v1/usage/iot', + 'operation_id': 'get_usage_internet_of_things', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'start_hr', + 'end_hr', + ], + 'required': [ + 'start_hr', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'start_hr': + (datetime,), + 'end_hr': + (datetime,), + }, + 'attribute_map': { + 'start_hr': 'start_hr', + 'end_hr': 'end_hr', + }, + 'location_map': { + 'start_hr': 'query', + 'end_hr': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json;datetime-format=rfc3339' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__get_usage_internet_of_things + ) + def __get_usage_lambda( self, start_hr, diff --git a/src/datadog_api_client/v1/model/usage_io_t_hour.py b/src/datadog_api_client/v1/model/usage_io_t_hour.py new file mode 100644 index 0000000000..0004ddd67d --- /dev/null +++ b/src/datadog_api_client/v1/model/usage_io_t_hour.py @@ -0,0 +1,166 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class UsageIoTHour(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'hour': (datetime,), # noqa: E501 + 'iot_device_count': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'hour': 'hour', # noqa: E501 + 'iot_device_count': 'iot_device_count', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UsageIoTHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + iot_device_count (int): The total number of IoT device hours from the start of the given hour's month until the given hour.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/usage_io_t_response.py b/src/datadog_api_client/v1/model/usage_io_t_response.py new file mode 100644 index 0000000000..f5b42434f6 --- /dev/null +++ b/src/datadog_api_client/v1/model/usage_io_t_response.py @@ -0,0 +1,168 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + +def lazy_import(): + from datadog_api_client.v1.model.usage_io_t_hour import UsageIoTHour + globals()['UsageIoTHour'] = UsageIoTHour + + +class UsageIoTResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'usage': ([UsageIoTHour],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'usage': 'usage', # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """UsageIoTResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageIoTHour]): Get hourly usage for IoT.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/usage_summary_date.py b/src/datadog_api_client/v1/model/usage_summary_date.py index ef3a0faace..2265458648 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date.py +++ b/src/datadog_api_client/v1/model/usage_summary_date.py @@ -93,6 +93,8 @@ def openapi_types(): 'indexed_events_count_sum': (int,), # noqa: E501 'infra_host_top99p': (int,), # noqa: E501 'ingested_events_bytes_sum': (int,), # noqa: E501 + 'iot_device_agg_sum': (int,), # noqa: E501 + 'iot_device_top99p_sum': (int,), # noqa: E501 'mobile_rum_session_count_android_sum': (int,), # noqa: E501 'mobile_rum_session_count_ios_sum': (int,), # noqa: E501 'mobile_rum_session_count_sum': (int,), # noqa: E501 @@ -133,6 +135,8 @@ def discriminator(): 'indexed_events_count_sum': 'indexed_events_count_sum', # noqa: E501 'infra_host_top99p': 'infra_host_top99p', # noqa: E501 'ingested_events_bytes_sum': 'ingested_events_bytes_sum', # noqa: E501 + 'iot_device_agg_sum': 'iot_device_agg_sum', # noqa: E501 + 'iot_device_top99p_sum': 'iot_device_top99p_sum', # noqa: E501 'mobile_rum_session_count_android_sum': 'mobile_rum_session_count_android_sum', # noqa: E501 'mobile_rum_session_count_ios_sum': 'mobile_rum_session_count_ios_sum', # noqa: E501 'mobile_rum_session_count_sum': 'mobile_rum_session_count_sum', # noqa: E501 @@ -213,6 +217,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 indexed_events_count_sum (int): Shows the sum of all log events indexed over all hours in the current date for all organizations.. [optional] # noqa: E501 infra_host_top99p (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 ingested_events_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for all organizations.. [optional] # noqa: E501 + iot_device_agg_sum (int): Shows the sum of all IoT devices over all hours in the current date for all organizations.. [optional] # noqa: E501 + iot_device_top99p_sum (int): Shows the 99th percentile of all IoT devices over all hours in the current date all organizations.. [optional] # noqa: E501 mobile_rum_session_count_android_sum (int): Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for all organizations.. [optional] # noqa: E501 mobile_rum_session_count_ios_sum (int): Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for all organizations.. [optional] # noqa: E501 mobile_rum_session_count_sum (int): Shows the sum of all mobile RUM Sessions over all hours in the current date for all organizations. [optional] # noqa: E501 diff --git a/src/datadog_api_client/v1/model/usage_summary_date_org.py b/src/datadog_api_client/v1/model/usage_summary_date_org.py index 63c236b8fb..2572d017ce 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date_org.py +++ b/src/datadog_api_client/v1/model/usage_summary_date_org.py @@ -88,6 +88,8 @@ def openapi_types(): 'indexed_events_count_sum': (int,), # noqa: E501 'infra_host_top99p': (int,), # noqa: E501 'ingested_events_bytes_sum': (int,), # noqa: E501 + 'iot_device_agg_sum': (int,), # noqa: E501 + 'iot_device_top99p_sum': (int,), # noqa: E501 'mobile_rum_session_count_android_sum': (int,), # noqa: E501 'mobile_rum_session_count_ios_sum': (int,), # noqa: E501 'mobile_rum_session_count_sum': (int,), # noqa: E501 @@ -129,6 +131,8 @@ def discriminator(): 'indexed_events_count_sum': 'indexed_events_count_sum', # noqa: E501 'infra_host_top99p': 'infra_host_top99p', # noqa: E501 'ingested_events_bytes_sum': 'ingested_events_bytes_sum', # noqa: E501 + 'iot_device_agg_sum': 'iot_device_agg_sum', # noqa: E501 + 'iot_device_top99p_sum': 'iot_device_top99p_sum', # noqa: E501 'mobile_rum_session_count_android_sum': 'mobile_rum_session_count_android_sum', # noqa: E501 'mobile_rum_session_count_ios_sum': 'mobile_rum_session_count_ios_sum', # noqa: E501 'mobile_rum_session_count_sum': 'mobile_rum_session_count_sum', # noqa: E501 @@ -210,6 +214,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 indexed_events_count_sum (int): Shows the sum of all log events indexed over all hours in the current date for the given org.. [optional] # noqa: E501 infra_host_top99p (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for the given org.. [optional] # noqa: E501 ingested_events_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for the given org.. [optional] # noqa: E501 + iot_device_agg_sum (int): Shows the sum of all IoT devices over all hours in the current date for the given org.. [optional] # noqa: E501 + iot_device_top99p_sum (int): Shows the 99th percentile of all IoT devices over all hours in the current date for the given org.. [optional] # noqa: E501 mobile_rum_session_count_android_sum (int): Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for the given org.. [optional] # noqa: E501 mobile_rum_session_count_ios_sum (int): Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for the given org.. [optional] # noqa: E501 mobile_rum_session_count_sum (int): Shows the sum of all mobile RUM Sessions over all hours in the current date for the given org.. [optional] # noqa: E501 diff --git a/src/datadog_api_client/v1/model/usage_summary_response.py b/src/datadog_api_client/v1/model/usage_summary_response.py index 8550650ee9..198c569268 100644 --- a/src/datadog_api_client/v1/model/usage_summary_response.py +++ b/src/datadog_api_client/v1/model/usage_summary_response.py @@ -94,6 +94,8 @@ def openapi_types(): 'indexed_events_count_agg_sum': (int,), # noqa: E501 'infra_host_top99p_sum': (int,), # noqa: E501 'ingested_events_bytes_agg_sum': (int,), # noqa: E501 + 'iot_device_agg_sum': (int,), # noqa: E501 + 'iot_device_top99p_sum': (int,), # noqa: E501 'last_updated': (datetime,), # noqa: E501 'live_indexed_events_agg_sum': (int,), # noqa: E501 'live_ingested_bytes_agg_sum': (int,), # noqa: E501 @@ -142,6 +144,8 @@ def discriminator(): 'indexed_events_count_agg_sum': 'indexed_events_count_agg_sum', # noqa: E501 'infra_host_top99p_sum': 'infra_host_top99p_sum', # noqa: E501 'ingested_events_bytes_agg_sum': 'ingested_events_bytes_agg_sum', # noqa: E501 + 'iot_device_agg_sum': 'iot_device_agg_sum', # noqa: E501 + 'iot_device_top99p_sum': 'iot_device_top99p_sum', # noqa: E501 'last_updated': 'last_updated', # noqa: E501 'live_indexed_events_agg_sum': 'live_indexed_events_agg_sum', # noqa: E501 'live_ingested_bytes_agg_sum': 'live_ingested_bytes_agg_sum', # noqa: E501 @@ -230,6 +234,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 indexed_events_count_agg_sum (int): Shows the sum of all log events indexed over all hours in the current months for all organizations.. [optional] # noqa: E501 infra_host_top99p_sum (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 ingested_events_bytes_agg_sum (int): Shows the sum of all log bytes ingested over all hours in the current months for all organizations.. [optional] # noqa: E501 + iot_device_agg_sum (int): Shows the sum of all IoT devices over all hours in the current months for all organizations.. [optional] # noqa: E501 + iot_device_top99p_sum (int): Shows the 99th percentile of all IoT devices over all hours in the current months of all organizations.. [optional] # noqa: E501 last_updated (datetime): Shows the the most recent hour in the current months for all organizations for which all usages were calculated.. [optional] # noqa: E501 live_indexed_events_agg_sum (int): Shows the sum of all live logs indexed over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 live_ingested_bytes_agg_sum (int): Shows the sum of all live logs bytes ingested over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 0ba07295be..1196da8dc0 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -405,6 +405,8 @@ from datadog_api_client.v1.model.usage_indexed_spans_response import UsageIndexedSpansResponse from datadog_api_client.v1.model.usage_ingested_spans_hour import UsageIngestedSpansHour from datadog_api_client.v1.model.usage_ingested_spans_response import UsageIngestedSpansResponse +from datadog_api_client.v1.model.usage_io_t_hour import UsageIoTHour +from datadog_api_client.v1.model.usage_io_t_response import UsageIoTResponse from datadog_api_client.v1.model.usage_lambda_hour import UsageLambdaHour from datadog_api_client.v1.model.usage_lambda_response import UsageLambdaResponse from datadog_api_client.v1.model.usage_logs_by_index_hour import UsageLogsByIndexHour diff --git a/src/datadog_api_client/v1/openapi.yaml b/src/datadog_api_client/v1/openapi.yaml index 3c8e3a48c3..94ab5b6670 100644 --- a/src/datadog_api_client/v1/openapi.yaml +++ b/src/datadog_api_client/v1/openapi.yaml @@ -8483,6 +8483,28 @@ components: $ref: '#/components/schemas/UsageIngestedSpansHour' type: array type: object + UsageIoTHour: + description: IoT usage for a given organization for a given hour. + properties: + hour: + description: The hour for the usage. + format: date-time + type: string + iot_device_count: + description: The total number of IoT device hours from the start of the + given hour's month until the given hour. + format: int64 + type: integer + type: object + UsageIoTResponse: + description: Response containing the IoT usage for each hour for a given organization. + properties: + usage: + description: Get hourly usage for IoT. + items: + $ref: '#/components/schemas/UsageIoTHour' + type: array + type: object UsageLambdaHour: description: 'Number of lambda functions and sum of the invocations of all lambda functions @@ -8922,6 +8944,16 @@ components: current date for all organizations. format: int64 type: integer + iot_device_agg_sum: + description: Shows the sum of all IoT devices over all hours in the current + date for all organizations. + format: int64 + type: integer + iot_device_top99p_sum: + description: Shows the 99th percentile of all IoT devices over all hours + in the current date all organizations. + format: int64 + type: integer mobile_rum_session_count_android_sum: description: Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for all organizations. @@ -9084,6 +9116,16 @@ components: current date for the given org. format: int64 type: integer + iot_device_agg_sum: + description: Shows the sum of all IoT devices over all hours in the current + date for the given org. + format: int64 + type: integer + iot_device_top99p_sum: + description: Shows the 99th percentile of all IoT devices over all hours + in the current date for the given org. + format: int64 + type: integer mobile_rum_session_count_android_sum: description: Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for the given org. @@ -9254,6 +9296,16 @@ components: current months for all organizations. format: int64 type: integer + iot_device_agg_sum: + description: Shows the sum of all IoT devices over all hours in the current + months for all organizations. + format: int64 + type: integer + iot_device_top99p_sum: + description: Shows the 99th percentile of all IoT devices over all hours + in the current months of all organizations. + format: int64 + type: integer last_updated: description: Shows the the most recent hour in the current months for all organizations for which all usages were calculated. @@ -16744,6 +16796,53 @@ paths: - Usage Metering x-undo: type: safe + /api/v1/usage/iot: + get: + description: Get hourly usage for IoT. + operationId: GetUsageInternetOfThings + parameters: + - description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` + for usage beginning at this hour.' + in: query + name: start_hr + required: true + schema: + format: date-time + type: string + - description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` + for usage ending + + **before** this hour.' + in: query + name: end_hr + required: false + schema: + format: date-time + type: string + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/UsageIoTResponse' + description: OK + '400': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + summary: Get hourly usage for IoT + tags: + - Usage Metering + x-undo: + type: safe /api/v1/usage/logs: get: description: Get hourly usage for logs. diff --git a/tests/v1/features/undo.json b/tests/v1/features/undo.json index dfcaf2ae83..7a2f3d48da 100644 --- a/tests/v1/features/undo.json +++ b/tests/v1/features/undo.json @@ -982,6 +982,12 @@ "type": "safe" } }, + "GetUsageInternetOfThings": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "GetUsageLogs": { "tag": "Usage Metering", "undo": { diff --git a/tests/v1/features/usage_metering.feature b/tests/v1/features/usage_metering.feature index 9a82ed8c79..a2e1454900 100644 --- a/tests/v1/features/usage_metering.feature +++ b/tests/v1/features/usage_metering.feature @@ -43,6 +43,18 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK + @generated @skip + Scenario: Get hourly usage for IoT returns "Bad Request" response + Given new "GetUsageInternetOfThings" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip + Scenario: Get hourly usage for IoT returns "OK" response + Given new "GetUsageInternetOfThings" request + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Get hourly usage for Lambda returns "Bad Request" response Given new "GetUsageLambda" request diff --git a/tests/v1/test_usage_io_t_hour.py b/tests/v1/test_usage_io_t_hour.py new file mode 100644 index 0000000000..0863d26796 --- /dev/null +++ b/tests/v1/test_usage_io_t_hour.py @@ -0,0 +1,30 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.usage_io_t_hour import UsageIoTHour + + +class TestUsageIoTHour(unittest.TestCase): + """UsageIoTHour unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUsageIoTHour(self): + """Test UsageIoTHour""" + # FIXME: construct object with mandatory attributes with example values + # model = UsageIoTHour() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v1/test_usage_io_t_response.py b/tests/v1/test_usage_io_t_response.py new file mode 100644 index 0000000000..d9ec42b5b6 --- /dev/null +++ b/tests/v1/test_usage_io_t_response.py @@ -0,0 +1,32 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.usage_io_t_hour import UsageIoTHour +globals()['UsageIoTHour'] = UsageIoTHour +from datadog_api_client.v1.model.usage_io_t_response import UsageIoTResponse + + +class TestUsageIoTResponse(unittest.TestCase): + """UsageIoTResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUsageIoTResponse(self): + """Test UsageIoTResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = UsageIoTResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()