diff --git a/.apigentools-info b/.apigentools-info index dcd15e1d42..ba43e62e3a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.3.0", - "regenerated": "2020-11-24 11:32:41.427732", - "spec_repo_commit": "edb67b7" + "regenerated": "2020-11-24 15:02:29.562802", + "spec_repo_commit": "217b6e8" }, "v2": { "apigentools_version": "1.3.0", - "regenerated": "2020-11-24 11:32:52.753559", - "spec_repo_commit": "edb67b7" + "regenerated": "2020-11-24 15:02:41.111923", + "spec_repo_commit": "217b6e8" } } } \ No newline at end of file diff --git a/docs/v1/AWSIntegrationApi.md b/docs/v1/AWSIntegrationApi.md index 66a10e0fac..727eb42513 100644 --- a/docs/v1/AWSIntegrationApi.md +++ b/docs/v1/AWSIntegrationApi.md @@ -5,10 +5,13 @@ All URIs are relative to *https://api.datadoghq.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**create_aws_account**](AWSIntegrationApi.md#create_aws_account) | **POST** /api/v1/integration/aws | Create an AWS integration +[**create_aws_tag_filter**](AWSIntegrationApi.md#create_aws_tag_filter) | **POST** /api/v1/integration/aws/filtering | Set an AWS tag filter [**create_new_aws_external_id**](AWSIntegrationApi.md#create_new_aws_external_id) | **PUT** /api/v1/integration/aws/generate_new_external_id | Generate a new external ID [**delete_aws_account**](AWSIntegrationApi.md#delete_aws_account) | **DELETE** /api/v1/integration/aws | Delete an AWS integration +[**delete_aws_tag_filter**](AWSIntegrationApi.md#delete_aws_tag_filter) | **DELETE** /api/v1/integration/aws/filtering | Delete a tag filtering entry [**list_available_aws_namespaces**](AWSIntegrationApi.md#list_available_aws_namespaces) | **GET** /api/v1/integration/aws/available_namespace_rules | List namespace rules [**list_aws_accounts**](AWSIntegrationApi.md#list_aws_accounts) | **GET** /api/v1/integration/aws | List all AWS integrations +[**list_aws_tag_filters**](AWSIntegrationApi.md#list_aws_tag_filters) | **GET** /api/v1/integration/aws/filtering | Get all AWS tag filters [**update_aws_account**](AWSIntegrationApi.md#update_aws_account) | **PUT** /api/v1/integration/aws | Update an AWS integration @@ -114,6 +117,94 @@ 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) +# **create_aws_tag_filter** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} create_aws_tag_filter(body) + +Set an AWS tag filter + +Set an AWS tag filter. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +import datadog_api_client.v1 +from datadog_api_client.v1.api import aws_integration_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" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['appKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with datadog_api_client.v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aws_integration_api.AWSIntegrationApi(api_client) + body = AWSTagFilterCreateRequest( + account_id="1234567", + namespace=AWSNamespace("elb"), + tag_filter_str="prod*", + ) # AWSTagFilterCreateRequest | Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`. + + # example passing only required values which don't have defaults set + try: + # Set an AWS tag filter + api_response = api_instance.create_aws_tag_filter(body) + pprint(api_response) + except datadog_api_client.v1.ApiException as e: + print("Exception when calling AWSIntegrationApi->create_aws_tag_filter: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AWSTagFilterCreateRequest**](AWSTagFilterCreateRequest.md)| Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`. | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Authentication Error | - | + +[[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) + # **create_new_aws_external_id** > AWSAccountCreateResponse create_new_aws_external_id(body) @@ -317,6 +408,93 @@ 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) +# **delete_aws_tag_filter** +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} delete_aws_tag_filter(body) + +Delete a tag filtering entry + +Delete a tag filtering entry. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +import datadog_api_client.v1 +from datadog_api_client.v1.api import aws_integration_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" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['appKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with datadog_api_client.v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aws_integration_api.AWSIntegrationApi(api_client) + body = AWSTagFilterDeleteRequest( + aws_account_identifier="FAKEAC0FAKEAC2FAKEAC", + namespace=AWSNamespace("elb"), + ) # AWSTagFilterDeleteRequest | Delete a tag filtering entry for a given AWS account and `dd-aws` namespace. + + # example passing only required values which don't have defaults set + try: + # Delete a tag filtering entry + api_response = api_instance.delete_aws_tag_filter(body) + pprint(api_response) + except datadog_api_client.v1.ApiException as e: + print("Exception when calling AWSIntegrationApi->delete_aws_tag_filter: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AWSTagFilterDeleteRequest**](AWSTagFilterDeleteRequest.md)| Delete a tag filtering entry for a given AWS account and `dd-aws` namespace. | + +### Return type + +**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Authentication Error | - | + +[[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) + # **list_available_aws_namespaces** > [str] list_available_aws_namespaces() @@ -485,6 +663,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) +# **list_aws_tag_filters** +> AWSTagFilterListResponse list_aws_tag_filters(account_id) + +Get all AWS tag filters + +Get all AWS tag filters. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +import datadog_api_client.v1 +from datadog_api_client.v1.api import aws_integration_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" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['appKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with datadog_api_client.v1.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = aws_integration_api.AWSIntegrationApi(api_client) + account_id = "account_id_example" # str | Only return AWS filters that matches this `account_id`. + + # example passing only required values which don't have defaults set + try: + # Get all AWS tag filters + api_response = api_instance.list_aws_tag_filters(account_id) + pprint(api_response) + except datadog_api_client.v1.ApiException as e: + print("Exception when calling AWSIntegrationApi->list_aws_tag_filters: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **account_id** | **str**| Only return AWS filters that matches this `account_id`. | + +### Return type + +[**AWSTagFilterListResponse**](AWSTagFilterListResponse.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**403** | Authentication Error | - | + +[[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) + # **update_aws_account** > {str: (bool, date, datetime, dict, float, int, list, str, none_type)} update_aws_account(body) diff --git a/docs/v1/AWSNamespace.md b/docs/v1/AWSNamespace.md new file mode 100644 index 0000000000..cf0ce68c2e --- /dev/null +++ b/docs/v1/AWSNamespace.md @@ -0,0 +1,11 @@ +# AWSNamespace + +The namespace associated with the tag filter entry. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The namespace associated with the tag filter entry. | must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] + +[[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/AWSTagFilterCreateRequest.md b/docs/v1/AWSTagFilterCreateRequest.md new file mode 100644 index 0000000000..4eb0a587db --- /dev/null +++ b/docs/v1/AWSTagFilterCreateRequest.md @@ -0,0 +1,13 @@ +# AWSTagFilterCreateRequest + +The objects used to set an AWS tag filter. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account_id** | **str** | Your AWS Account ID without dashes. | [optional] +**namespace** | [**AWSNamespace**](AWSNamespace.md) | | [optional] +**tag_filter_str** | **str** | The tag filter string. | [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/AWSTagFilterDeleteRequest.md b/docs/v1/AWSTagFilterDeleteRequest.md new file mode 100644 index 0000000000..e421f9fe0d --- /dev/null +++ b/docs/v1/AWSTagFilterDeleteRequest.md @@ -0,0 +1,12 @@ +# AWSTagFilterDeleteRequest + +The objects used to delete an AWS tag filter entry. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aws_account_identifier** | **str** | The unique identifier of your AWS account. | [optional] +**namespace** | [**AWSNamespace**](AWSNamespace.md) | | [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/AWSTagFilterListResponse.md b/docs/v1/AWSTagFilterListResponse.md new file mode 100644 index 0000000000..cefba6674c --- /dev/null +++ b/docs/v1/AWSTagFilterListResponse.md @@ -0,0 +1,11 @@ +# AWSTagFilterListResponse + +An array of tag filter rules by `namespace` and tag filter string. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**[AWSTagFilterListResponseFilters]**](AWSTagFilterListResponseFilters.md) | An array of tag filters. | [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/AWSTagFilterListResponseFilters.md b/docs/v1/AWSTagFilterListResponseFilters.md new file mode 100644 index 0000000000..6a30f6d873 --- /dev/null +++ b/docs/v1/AWSTagFilterListResponseFilters.md @@ -0,0 +1,12 @@ +# AWSTagFilterListResponseFilters + +A list of tag filters. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**namespace** | [**AWSNamespace**](AWSNamespace.md) | | [optional] +**tag_filter_str** | **str** | The tag filter string. | [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/README.md b/docs/v1/README.md index ea326f81b3..2dc2973dde 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -55,6 +55,9 @@ from datadog_api_client.v1.model.api_error_response import APIErrorResponse from datadog_api_client.v1.model.aws_account import AWSAccount from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse +from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest +from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest +from datadog_api_client.v1.model.aws_tag_filter_list_response import AWSTagFilterListResponse # 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( @@ -117,10 +120,13 @@ All URIs are relative to *https://api.datadoghq.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *AWSIntegrationApi* | [**create_aws_account**](AWSIntegrationApi.md#create_aws_account) | **POST** /api/v1/integration/aws | Create an AWS integration +*AWSIntegrationApi* | [**create_aws_tag_filter**](AWSIntegrationApi.md#create_aws_tag_filter) | **POST** /api/v1/integration/aws/filtering | Set an AWS tag filter *AWSIntegrationApi* | [**create_new_aws_external_id**](AWSIntegrationApi.md#create_new_aws_external_id) | **PUT** /api/v1/integration/aws/generate_new_external_id | Generate a new external ID *AWSIntegrationApi* | [**delete_aws_account**](AWSIntegrationApi.md#delete_aws_account) | **DELETE** /api/v1/integration/aws | Delete an AWS integration +*AWSIntegrationApi* | [**delete_aws_tag_filter**](AWSIntegrationApi.md#delete_aws_tag_filter) | **DELETE** /api/v1/integration/aws/filtering | Delete a tag filtering entry *AWSIntegrationApi* | [**list_available_aws_namespaces**](AWSIntegrationApi.md#list_available_aws_namespaces) | **GET** /api/v1/integration/aws/available_namespace_rules | List namespace rules *AWSIntegrationApi* | [**list_aws_accounts**](AWSIntegrationApi.md#list_aws_accounts) | **GET** /api/v1/integration/aws | List all AWS integrations +*AWSIntegrationApi* | [**list_aws_tag_filters**](AWSIntegrationApi.md#list_aws_tag_filters) | **GET** /api/v1/integration/aws/filtering | Get all AWS tag filters *AWSIntegrationApi* | [**update_aws_account**](AWSIntegrationApi.md#update_aws_account) | **PUT** /api/v1/integration/aws | Update an AWS integration *AWSLogsIntegrationApi* | [**check_aws_logs_lambda_async**](AWSLogsIntegrationApi.md#check_aws_logs_lambda_async) | **POST** /api/v1/integration/aws/logs/check_async | Check that an AWS Lambda Function exists *AWSLogsIntegrationApi* | [**check_aws_logs_services_async**](AWSLogsIntegrationApi.md#check_aws_logs_services_async) | **POST** /api/v1/integration/aws/logs/services_async | Check permissions for log services @@ -289,6 +295,11 @@ Class | Method | HTTP request | Description - [AWSLogsListResponseLambdas](AWSLogsListResponseLambdas.md) - [AWSLogsListServicesResponse](AWSLogsListServicesResponse.md) - [AWSLogsServicesRequest](AWSLogsServicesRequest.md) + - [AWSNamespace](AWSNamespace.md) + - [AWSTagFilterCreateRequest](AWSTagFilterCreateRequest.md) + - [AWSTagFilterDeleteRequest](AWSTagFilterDeleteRequest.md) + - [AWSTagFilterListResponse](AWSTagFilterListResponse.md) + - [AWSTagFilterListResponseFilters](AWSTagFilterListResponseFilters.md) - [AccessRole](AccessRole.md) - [AlertGraphWidgetDefinition](AlertGraphWidgetDefinition.md) - [AlertGraphWidgetDefinitionType](AlertGraphWidgetDefinitionType.md) diff --git a/src/datadog_api_client/v1/api/aws_integration_api.py b/src/datadog_api_client/v1/api/aws_integration_api.py index d246a35f44..0cf2c50652 100644 --- a/src/datadog_api_client/v1/api/aws_integration_api.py +++ b/src/datadog_api_client/v1/api/aws_integration_api.py @@ -22,6 +22,9 @@ from datadog_api_client.v1.model.aws_account import AWSAccount from datadog_api_client.v1.model.aws_account_create_response import AWSAccountCreateResponse from datadog_api_client.v1.model.aws_account_list_response import AWSAccountListResponse +from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest +from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest +from datadog_api_client.v1.model.aws_tag_filter_list_response import AWSTagFilterListResponse class AWSIntegrationApi(object): @@ -157,6 +160,159 @@ def __create_aws_account( callable=__create_aws_account ) + def __create_aws_tag_filter( + self, + body, + **kwargs + ): + """Set an AWS tag filter # noqa: E501 + + Set an AWS tag filter. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_aws_tag_filter(body, async_req=True) + >>> result = thread.get() + + Args: + body (AWSTagFilterCreateRequest): Set an AWS tag filter using an `aws_account_identifier`, `namespace`, and filtering string. Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, `rds`, `sqs`, and `custom`. + + Keyword Args: + _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: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + 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['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.create_aws_tag_filter = Endpoint( + settings={ + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + 'auth': [ + 'apiKeyAuth', + 'appKeyAuth' + ], + 'endpoint_path': '/api/v1/integration/aws/filtering', + 'operation_id': 'create_aws_tag_filter', + 'http_method': 'POST', + 'servers': [ + { + 'url': "https://{subdomain}.{site}", + 'description': "No description provided", + 'variables': { + 'site': { + 'description': "The regional site for our customers.", + 'default_value': "datadoghq.com", + 'enum_values': [ + "datadoghq.com" + ] + }, + 'subdomain': { + 'description': "The subdomain where the API is deployed.", + 'default_value': "api", + } + } + }, + { + 'url': "{protocol}://{name}", + 'description': "No description provided", + 'variables': { + 'name': { + 'description': "Full site DNS name.", + 'default_value': "api.datadoghq.com", + }, + 'protocol': { + 'description': "The protocol for accessing the API.", + 'default_value': "https", + } + } + }, + ] + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (AWSTagFilterCreateRequest,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__create_aws_tag_filter + ) + def __create_new_aws_external_id( self, body, @@ -399,6 +555,159 @@ def __delete_aws_account( callable=__delete_aws_account ) + def __delete_aws_tag_filter( + self, + body, + **kwargs + ): + """Delete a tag filtering entry # noqa: E501 + + Delete a tag filtering entry. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_aws_tag_filter(body, async_req=True) + >>> result = thread.get() + + Args: + body (AWSTagFilterDeleteRequest): Delete a tag filtering entry for a given AWS account and `dd-aws` namespace. + + Keyword Args: + _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: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + 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['body'] = \ + body + return self.call_with_http_info(**kwargs) + + self.delete_aws_tag_filter = Endpoint( + settings={ + 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + 'auth': [ + 'apiKeyAuth', + 'appKeyAuth' + ], + 'endpoint_path': '/api/v1/integration/aws/filtering', + 'operation_id': 'delete_aws_tag_filter', + 'http_method': 'DELETE', + 'servers': [ + { + 'url': "https://{subdomain}.{site}", + 'description': "No description provided", + 'variables': { + 'site': { + 'description': "The regional site for our customers.", + 'default_value': "datadoghq.com", + 'enum_values': [ + "datadoghq.com" + ] + }, + 'subdomain': { + 'description': "The subdomain where the API is deployed.", + 'default_value': "api", + } + } + }, + { + 'url': "{protocol}://{name}", + 'description': "No description provided", + 'variables': { + 'name': { + 'description': "Full site DNS name.", + 'default_value': "api.datadoghq.com", + }, + 'protocol': { + 'description': "The protocol for accessing the API.", + 'default_value': "https", + } + } + }, + ] + }, + params_map={ + 'all': [ + 'body', + ], + 'required': [ + 'body', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'body': + (AWSTagFilterDeleteRequest,), + }, + 'attribute_map': { + }, + 'location_map': { + 'body': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client, + callable=__delete_aws_tag_filter + ) + def __list_available_aws_namespaces( self, **kwargs @@ -633,6 +942,158 @@ def __list_aws_accounts( callable=__list_aws_accounts ) + def __list_aws_tag_filters( + self, + account_id, + **kwargs + ): + """Get all AWS tag filters # noqa: E501 + + Get all AWS tag filters. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_aws_tag_filters(account_id, async_req=True) + >>> result = thread.get() + + Args: + account_id (str): Only return AWS filters that matches this `account_id`. + + Keyword Args: + _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: + AWSTagFilterListResponse + 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['account_id'] = \ + account_id + return self.call_with_http_info(**kwargs) + + self.list_aws_tag_filters = Endpoint( + settings={ + 'response_type': (AWSTagFilterListResponse,), + 'auth': [ + 'apiKeyAuth', + 'appKeyAuth' + ], + 'endpoint_path': '/api/v1/integration/aws/filtering', + 'operation_id': 'list_aws_tag_filters', + 'http_method': 'GET', + 'servers': [ + { + 'url': "https://{subdomain}.{site}", + 'description': "No description provided", + 'variables': { + 'site': { + 'description': "The regional site for our customers.", + 'default_value': "datadoghq.com", + 'enum_values': [ + "datadoghq.com" + ] + }, + 'subdomain': { + 'description': "The subdomain where the API is deployed.", + 'default_value': "api", + } + } + }, + { + 'url': "{protocol}://{name}", + 'description': "No description provided", + 'variables': { + 'name': { + 'description': "Full site DNS name.", + 'default_value': "api.datadoghq.com", + }, + 'protocol': { + 'description': "The protocol for accessing the API.", + 'default_value': "https", + } + } + }, + ] + }, + params_map={ + 'all': [ + 'account_id', + ], + 'required': [ + 'account_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'account_id': + (str,), + }, + 'attribute_map': { + 'account_id': 'account_id', + }, + 'location_map': { + 'account_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__list_aws_tag_filters + ) + def __update_aws_account( self, body, diff --git a/src/datadog_api_client/v1/model/aws_namespace.py b/src/datadog_api_client/v1/model/aws_namespace.py new file mode 100644 index 0000000000..8b2b42bef5 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_namespace.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +# 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 AWSNamespace(ModelSimple): + """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. + 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 = { + ('value',): { + 'ELB': "elb", + 'APPLICATION_ELB': "application_elb", + 'SQS': "sqs", + 'RDS': "rds", + 'CUSTOM': "custom", + 'NETWORK_ELB': "network_elb", + 'LAMBDA': "lambda", + }, + } + + 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 { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + _composed_schemas = None + + 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): + """AWSNamespace - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The namespace associated with the tag filter entry.., must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] # noqa: E501 + + Keyword Args: + value (str): The namespace associated with the tag filter entry.., must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] # noqa: E501 + _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,) + """ + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _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__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py b/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py new file mode 100644 index 0000000000..f21fc75a06 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py @@ -0,0 +1,176 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace + globals()['AWSNamespace'] = AWSNamespace + + +class AWSTagFilterCreateRequest(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 { + 'account_id': (str,), # noqa: E501 + 'namespace': (AWSNamespace,), # noqa: E501 + 'tag_filter_str': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'account_id': 'account_id', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'tag_filter_str': 'tag_filter_str', # 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 + """AWSTagFilterCreateRequest - 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,) + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + namespace (AWSNamespace): [optional] # noqa: E501 + tag_filter_str (str): The tag filter string.. [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/aws_tag_filter_delete_request.py b/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py new file mode 100644 index 0000000000..32ee2ce904 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace + globals()['AWSNamespace'] = AWSNamespace + + +class AWSTagFilterDeleteRequest(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 { + 'aws_account_identifier': (str,), # noqa: E501 + 'namespace': (AWSNamespace,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'aws_account_identifier': 'aws_account_identifier', # noqa: E501 + 'namespace': 'namespace', # 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 + """AWSTagFilterDeleteRequest - 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,) + aws_account_identifier (str): The unique identifier of your AWS account.. [optional] # noqa: E501 + namespace (AWSNamespace): [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/aws_tag_filter_list_response.py b/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py new file mode 100644 index 0000000000..26b99bcdb5 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +# 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.aws_tag_filter_list_response_filters import AWSTagFilterListResponseFilters + globals()['AWSTagFilterListResponseFilters'] = AWSTagFilterListResponseFilters + + +class AWSTagFilterListResponse(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 { + 'filters': ([AWSTagFilterListResponseFilters],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'filters': 'filters', # 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 + """AWSTagFilterListResponse - 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,) + filters ([AWSTagFilterListResponseFilters]): An array of tag filters.. [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/aws_tag_filter_list_response_filters.py b/src/datadog_api_client/v1/model/aws_tag_filter_list_response_filters.py new file mode 100644 index 0000000000..2007dcf409 --- /dev/null +++ b/src/datadog_api_client/v1/model/aws_tag_filter_list_response_filters.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace + globals()['AWSNamespace'] = AWSNamespace + + +class AWSTagFilterListResponseFilters(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 { + 'namespace': (AWSNamespace,), # noqa: E501 + 'tag_filter_str': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'namespace': 'namespace', # noqa: E501 + 'tag_filter_str': 'tag_filter_str', # 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 + """AWSTagFilterListResponseFilters - 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,) + namespace (AWSNamespace): [optional] # noqa: E501 + tag_filter_str (str): The tag filter string.. [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/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 9ee69b930a..e30c204951 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -22,6 +22,11 @@ from datadog_api_client.v1.model.aws_logs_list_response_lambdas import AWSLogsListResponseLambdas from datadog_api_client.v1.model.aws_logs_list_services_response import AWSLogsListServicesResponse from datadog_api_client.v1.model.aws_logs_services_request import AWSLogsServicesRequest +from datadog_api_client.v1.model.aws_namespace import AWSNamespace +from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest +from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest +from datadog_api_client.v1.model.aws_tag_filter_list_response import AWSTagFilterListResponse +from datadog_api_client.v1.model.aws_tag_filter_list_response_filters import AWSTagFilterListResponseFilters from datadog_api_client.v1.model.access_role import AccessRole from datadog_api_client.v1.model.alert_graph_widget_definition import AlertGraphWidgetDefinition from datadog_api_client.v1.model.alert_graph_widget_definition_type import AlertGraphWidgetDefinitionType diff --git a/src/datadog_api_client/v1/openapi.yaml b/src/datadog_api_client/v1/openapi.yaml index 14b952b163..18881f8ab3 100644 --- a/src/datadog_api_client/v1/openapi.yaml +++ b/src/datadog_api_client/v1/openapi.yaml @@ -224,6 +224,66 @@ components: - account_id - services type: object + AWSNamespace: + description: The namespace associated with the tag filter entry. + enum: + - elb + - application_elb + - sqs + - rds + - custom + - network_elb + - lambda + type: string + x-enum-varnames: + - ELB + - APPLICATION_ELB + - SQS + - RDS + - CUSTOM + - NETWORK_ELB + - LAMBDA + AWSTagFilterCreateRequest: + description: The objects used to set an AWS tag filter. + properties: + account_id: + description: Your AWS Account ID without dashes. + example: '1234567' + type: string + namespace: + $ref: '#/components/schemas/AWSNamespace' + tag_filter_str: + description: The tag filter string. + example: prod* + type: string + type: object + AWSTagFilterDeleteRequest: + description: The objects used to delete an AWS tag filter entry. + properties: + aws_account_identifier: + description: The unique identifier of your AWS account. + example: FAKEAC0FAKEAC2FAKEAC + type: string + namespace: + $ref: '#/components/schemas/AWSNamespace' + type: object + AWSTagFilterListResponse: + description: An array of tag filter rules by `namespace` and tag filter string. + properties: + filters: + description: An array of tag filters. + items: + description: A list of tag filters. + properties: + namespace: + $ref: '#/components/schemas/AWSNamespace' + tag_filter_str: + description: The tag filter string. + example: prod* + type: string + type: object + type: array + type: object AccessRole: default: st description: The access role of the user. Options are **st** (standard user), @@ -11215,6 +11275,169 @@ paths: summary: List namespace rules tags: - AWS Integration + /api/v1/integration/aws/filtering: + delete: + description: Delete a tag filtering entry. + operationId: DeleteAWSTagFilter + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSTagFilterDeleteRequest' + description: Delete a tag filtering entry for a given AWS account and `dd-aws` + namespace. + required: true + responses: + '200': + content: + application/json: + schema: + example: {} + type: object + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + servers: + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The regional site for our customers. + enum: + - datadoghq.com + subdomain: + default: api + description: The subdomain where the API is deployed. + - url: '{protocol}://{name}' + variables: + name: + default: api.datadoghq.com + description: Full site DNS name. + protocol: + default: https + description: The protocol for accessing the API. + summary: Delete a tag filtering entry + tags: + - AWS Integration + x-codegen-request-body-name: body + get: + description: Get all AWS tag filters. + operationId: ListAWSTagFilters + parameters: + - description: Only return AWS filters that matches this `account_id`. + in: query + name: account_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSTagFilterListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + servers: + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The regional site for our customers. + enum: + - datadoghq.com + subdomain: + default: api + description: The subdomain where the API is deployed. + - url: '{protocol}://{name}' + variables: + name: + default: api.datadoghq.com + description: Full site DNS name. + protocol: + default: https + description: The protocol for accessing the API. + summary: Get all AWS tag filters + tags: + - AWS Integration + post: + description: Set an AWS tag filter. + operationId: CreateAWSTagFilter + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSTagFilterCreateRequest' + description: 'Set an AWS tag filter using an `aws_account_identifier`, `namespace`, + and filtering string. + + Namespace options are `application_elb`, `elb`, `lambda`, `network_elb`, + `rds`, `sqs`, and `custom`.' + required: true + responses: + '200': + content: + application/json: + schema: + example: {} + type: object + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication Error + servers: + - url: https://{subdomain}.{site} + variables: + site: + default: datadoghq.com + description: The regional site for our customers. + enum: + - datadoghq.com + subdomain: + default: api + description: The subdomain where the API is deployed. + - url: '{protocol}://{name}' + variables: + name: + default: api.datadoghq.com + description: Full site DNS name. + protocol: + default: https + description: The protocol for accessing the API. + summary: Set an AWS tag filter + tags: + - AWS Integration + x-codegen-request-body-name: body /api/v1/integration/aws/generate_new_external_id: put: description: Generate a new AWS external ID for a given AWS account ID and role diff --git a/tests/v1/features/aws_integration.feature b/tests/v1/features/aws_integration.feature index f9360d3795..7d0437fb51 100644 --- a/tests/v1/features/aws_integration.feature +++ b/tests/v1/features/aws_integration.feature @@ -48,3 +48,23 @@ Feature: AWS Integration And body {} When the request is sent Then the response status is 200 OK + + @generated @skip + Scenario: Delete a tag filtering entry returns "OK" response + Given new "DeleteAWSTagFilter" request + And body {} + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Get all AWS tag filters returns "OK" response + Given new "ListAWSTagFilters" request + When the request is sent + Then the response status is 200 OK + + @generated @skip + Scenario: Set an AWS tag filter returns "OK" response + Given new "CreateAWSTagFilter" request + And body {} + When the request is sent + Then the response status is 200 OK diff --git a/tests/v1/test_aws_namespace.py b/tests/v1/test_aws_namespace.py new file mode 100644 index 0000000000..3af1f134fc --- /dev/null +++ b/tests/v1/test_aws_namespace.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace + + +class TestAWSNamespace(unittest.TestCase): + """AWSNamespace unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAWSNamespace(self): + """Test AWSNamespace""" + # FIXME: construct object with mandatory attributes with example values + # model = AWSNamespace() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v1/test_aws_tag_filter_create_request.py b/tests/v1/test_aws_tag_filter_create_request.py new file mode 100644 index 0000000000..cc813f1fc1 --- /dev/null +++ b/tests/v1/test_aws_tag_filter_create_request.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace +globals()['AWSNamespace'] = AWSNamespace +from datadog_api_client.v1.model.aws_tag_filter_create_request import AWSTagFilterCreateRequest + + +class TestAWSTagFilterCreateRequest(unittest.TestCase): + """AWSTagFilterCreateRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAWSTagFilterCreateRequest(self): + """Test AWSTagFilterCreateRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = AWSTagFilterCreateRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v1/test_aws_tag_filter_delete_request.py b/tests/v1/test_aws_tag_filter_delete_request.py new file mode 100644 index 0000000000..c171c5fc58 --- /dev/null +++ b/tests/v1/test_aws_tag_filter_delete_request.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace +globals()['AWSNamespace'] = AWSNamespace +from datadog_api_client.v1.model.aws_tag_filter_delete_request import AWSTagFilterDeleteRequest + + +class TestAWSTagFilterDeleteRequest(unittest.TestCase): + """AWSTagFilterDeleteRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAWSTagFilterDeleteRequest(self): + """Test AWSTagFilterDeleteRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = AWSTagFilterDeleteRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v1/test_aws_tag_filter_list_response.py b/tests/v1/test_aws_tag_filter_list_response.py new file mode 100644 index 0000000000..191d70032c --- /dev/null +++ b/tests/v1/test_aws_tag_filter_list_response.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# 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.aws_tag_filter_list_response_filters import AWSTagFilterListResponseFilters +globals()['AWSTagFilterListResponseFilters'] = AWSTagFilterListResponseFilters +from datadog_api_client.v1.model.aws_tag_filter_list_response import AWSTagFilterListResponse + + +class TestAWSTagFilterListResponse(unittest.TestCase): + """AWSTagFilterListResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAWSTagFilterListResponse(self): + """Test AWSTagFilterListResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = AWSTagFilterListResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v1/test_aws_tag_filter_list_response_filters.py b/tests/v1/test_aws_tag_filter_list_response_filters.py new file mode 100644 index 0000000000..e5f7336c66 --- /dev/null +++ b/tests/v1/test_aws_tag_filter_list_response_filters.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# 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.aws_namespace import AWSNamespace +globals()['AWSNamespace'] = AWSNamespace +from datadog_api_client.v1.model.aws_tag_filter_list_response_filters import AWSTagFilterListResponseFilters + + +class TestAWSTagFilterListResponseFilters(unittest.TestCase): + """AWSTagFilterListResponseFilters unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAWSTagFilterListResponseFilters(self): + """Test AWSTagFilterListResponseFilters""" + # FIXME: construct object with mandatory attributes with example values + # model = AWSTagFilterListResponseFilters() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()