diff --git a/.apigentools-info b/.apigentools-info index 3286b138ed..3a74732981 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.3.0", - "regenerated": "2020-11-23 18:02:58.303012", - "spec_repo_commit": "96fd18a" + "regenerated": "2020-11-24 09:46:11.720897", + "spec_repo_commit": "8ea24b0" }, "v2": { "apigentools_version": "1.3.0", - "regenerated": "2020-11-23 18:03:09.878302", - "spec_repo_commit": "96fd18a" + "regenerated": "2020-11-24 09:46:22.351897", + "spec_repo_commit": "8ea24b0" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 6578203e66..5b8d9c0f99 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ datadog_api_client/v2/api/incident_teams_api.py datadog_api_client/v2/api/incidents_api.py datadog_api_client/v2/api/logs_api.py datadog_api_client/v2/api/logs_archives_api.py +datadog_api_client/v2/api/processes_api.py datadog_api_client/v2/api/roles_api.py datadog_api_client/v2/api/security_monitoring_api.py datadog_api_client/v2/api/users_api.py @@ -146,6 +147,12 @@ datadog_api_client/v2/model/permission.py datadog_api_client/v2/model/permission_attributes.py datadog_api_client/v2/model/permissions_response.py datadog_api_client/v2/model/permissions_type.py +datadog_api_client/v2/model/process_summaries_meta.py +datadog_api_client/v2/model/process_summaries_meta_page.py +datadog_api_client/v2/model/process_summaries_response.py +datadog_api_client/v2/model/process_summary.py +datadog_api_client/v2/model/process_summary_attributes.py +datadog_api_client/v2/model/process_summary_type.py datadog_api_client/v2/model/query_sort_order.py datadog_api_client/v2/model/relationship_to_incident_integration_metadata_data.py datadog_api_client/v2/model/relationship_to_incident_integration_metadatas.py @@ -368,6 +375,13 @@ docs/Permission.md docs/PermissionAttributes.md docs/PermissionsResponse.md docs/PermissionsType.md +docs/ProcessSummariesMeta.md +docs/ProcessSummariesMetaPage.md +docs/ProcessSummariesResponse.md +docs/ProcessSummary.md +docs/ProcessSummaryAttributes.md +docs/ProcessSummaryType.md +docs/ProcessesApi.md docs/QuerySortOrder.md docs/RelationshipToIncidentIntegrationMetadataData.md docs/RelationshipToIncidentIntegrationMetadatas.md @@ -591,6 +605,13 @@ test/test_permission.py test/test_permission_attributes.py test/test_permissions_response.py test/test_permissions_type.py +test/test_process_summaries_meta.py +test/test_process_summaries_meta_page.py +test/test_process_summaries_response.py +test/test_process_summary.py +test/test_process_summary_attributes.py +test/test_process_summary_type.py +test/test_processes_api.py test/test_query_sort_order.py test/test_relationship_to_incident_integration_metadata_data.py test/test_relationship_to_incident_integration_metadatas.py diff --git a/docs/v2/ProcessSummariesMeta.md b/docs/v2/ProcessSummariesMeta.md new file mode 100644 index 0000000000..7024ee44bb --- /dev/null +++ b/docs/v2/ProcessSummariesMeta.md @@ -0,0 +1,11 @@ +# ProcessSummariesMeta + +Response metadata object. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | [**ProcessSummariesMetaPage**](ProcessSummariesMetaPage.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/v2/ProcessSummariesMetaPage.md b/docs/v2/ProcessSummariesMetaPage.md new file mode 100644 index 0000000000..6118871e6e --- /dev/null +++ b/docs/v2/ProcessSummariesMetaPage.md @@ -0,0 +1,12 @@ +# ProcessSummariesMetaPage + +Paging attributes. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**after** | **str** | The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`. | [optional] +**size** | **int** | Number of results returned. | [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/v2/ProcessSummariesResponse.md b/docs/v2/ProcessSummariesResponse.md new file mode 100644 index 0000000000..08aa25db56 --- /dev/null +++ b/docs/v2/ProcessSummariesResponse.md @@ -0,0 +1,12 @@ +# ProcessSummariesResponse + +List of process summaries. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[ProcessSummary]**](ProcessSummary.md) | Array of process summary objects. | [optional] +**meta** | [**ProcessSummariesMeta**](ProcessSummariesMeta.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/v2/ProcessSummary.md b/docs/v2/ProcessSummary.md new file mode 100644 index 0000000000..b6a07191e0 --- /dev/null +++ b/docs/v2/ProcessSummary.md @@ -0,0 +1,13 @@ +# ProcessSummary + +Process summary object. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**ProcessSummaryAttributes**](ProcessSummaryAttributes.md) | | [optional] +**id** | **str** | Process ID. | [optional] +**type** | [**ProcessSummaryType**](ProcessSummaryType.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/v2/ProcessSummaryAttributes.md b/docs/v2/ProcessSummaryAttributes.md new file mode 100644 index 0000000000..2d7082ea74 --- /dev/null +++ b/docs/v2/ProcessSummaryAttributes.md @@ -0,0 +1,18 @@ +# ProcessSummaryAttributes + +Attributes for a process summary. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cmdline** | **str** | Process command line. | [optional] +**host** | **str** | Host running the process. | [optional] +**pid** | **int** | Process ID. | [optional] +**ppid** | **int** | Parent process ID. | [optional] +**start** | **str** | Time the process was started. | [optional] +**tags** | **[str]** | List of tags associated with the process. | [optional] +**timestamp** | **str** | Time the process was seen. | [optional] +**user** | **str** | Process owner. | [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/v2/ProcessSummaryType.md b/docs/v2/ProcessSummaryType.md new file mode 100644 index 0000000000..f690a1130f --- /dev/null +++ b/docs/v2/ProcessSummaryType.md @@ -0,0 +1,11 @@ +# ProcessSummaryType + +Type of process summary. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Type of process summary. | defaults to "process", must be one of ["process", ] + +[[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/v2/ProcessesApi.md b/docs/v2/ProcessesApi.md new file mode 100644 index 0000000000..1626cde763 --- /dev/null +++ b/docs/v2/ProcessesApi.md @@ -0,0 +1,104 @@ +# datadog_api_client.v2.ProcessesApi + +All URIs are relative to *https://api.datadoghq.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_processes**](ProcessesApi.md#list_processes) | **GET** /api/v2/processes | Get all processes + + +# **list_processes** +> ProcessSummariesResponse list_processes() + +Get all processes + +Get all processes for your organization. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +import datadog_api_client.v2 +from datadog_api_client.v2.api import processes_api +from datadog_api_client.v2.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.v2.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.v2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = processes_api.ProcessesApi(api_client) + search = "search_example" # str | String to search processes by. (optional) + tags = "account:prod,user:admin" # str | Comma-separated list of tags to filter processes by. (optional) + _from = 1 # int | Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`. (optional) + to = 1 # int | Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window will be 15 minutes after the `from` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`. (optional) + page_limit = 1000 # int | Maximum number of results returned. (optional) if omitted the server will use the default value of 1000 + page_cursor = "page[cursor]_example" # str | String to query the next page of results. This key is provided with each valid response from the API in `meta.page.after`. (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Get all processes + api_response = api_instance.list_processes(search=search, tags=tags, _from=_from, to=to, page_limit=page_limit, page_cursor=page_cursor) + pprint(api_response) + except datadog_api_client.v2.ApiException as e: + print("Exception when calling ProcessesApi->list_processes: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **search** | **str**| String to search processes by. | [optional] + **tags** | **str**| Comma-separated list of tags to filter processes by. | [optional] + **_from** | **int**| Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`. | [optional] + **to** | **int**| Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window will be 15 minutes after the `from` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`. | [optional] + **page_limit** | **int**| Maximum number of results returned. | [optional] if omitted the server will use the default value of 1000 + **page_cursor** | **str**| String to query the next page of results. This key is provided with each valid response from the API in `meta.page.after`. | [optional] + +### Return type + +[**ProcessSummariesResponse**](ProcessSummariesResponse.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) + diff --git a/docs/v2/README.md b/docs/v2/README.md index b0ebf2ab82..bf8419805f 100644 --- a/docs/v2/README.md +++ b/docs/v2/README.md @@ -143,6 +143,7 @@ Class | Method | HTTP request | Description *LogsArchivesApi* | [**remove_role_from_archive**](LogsArchivesApi.md#remove_role_from_archive) | **DELETE** /api/v2/logs/config/archives/{archive_id}/readers | Revoke role from an archive *LogsArchivesApi* | [**update_logs_archive**](LogsArchivesApi.md#update_logs_archive) | **PUT** /api/v2/logs/config/archives/{archive_id} | Update an archive *LogsArchivesApi* | [**update_logs_archive_order**](LogsArchivesApi.md#update_logs_archive_order) | **PUT** /api/v2/logs/config/archive-order | Update archive order +*ProcessesApi* | [**list_processes**](ProcessesApi.md#list_processes) | **GET** /api/v2/processes | Get all processes *RolesApi* | [**add_permission_to_role**](RolesApi.md#add_permission_to_role) | **POST** /api/v2/roles/{role_id}/permissions | Grant permission to a role *RolesApi* | [**add_user_to_role**](RolesApi.md#add_user_to_role) | **POST** /api/v2/roles/{role_id}/users | Add a user to a role *RolesApi* | [**create_role**](RolesApi.md#create_role) | **POST** /api/v2/roles | Create role @@ -305,6 +306,12 @@ Class | Method | HTTP request | Description - [PermissionAttributes](PermissionAttributes.md) - [PermissionsResponse](PermissionsResponse.md) - [PermissionsType](PermissionsType.md) + - [ProcessSummariesMeta](ProcessSummariesMeta.md) + - [ProcessSummariesMetaPage](ProcessSummariesMetaPage.md) + - [ProcessSummariesResponse](ProcessSummariesResponse.md) + - [ProcessSummary](ProcessSummary.md) + - [ProcessSummaryAttributes](ProcessSummaryAttributes.md) + - [ProcessSummaryType](ProcessSummaryType.md) - [QuerySortOrder](QuerySortOrder.md) - [RelationshipToIncidentIntegrationMetadataData](RelationshipToIncidentIntegrationMetadataData.md) - [RelationshipToIncidentIntegrationMetadatas](RelationshipToIncidentIntegrationMetadatas.md) diff --git a/src/datadog_api_client/v2/api/processes_api.py b/src/datadog_api_client/v2/api/processes_api.py new file mode 100644 index 0000000000..597a3836ad --- /dev/null +++ b/src/datadog_api_client/v2/api/processes_api.py @@ -0,0 +1,185 @@ +# 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 + +from datadog_api_client.v2.api_client import ApiClient, Endpoint +from datadog_api_client.v2.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from datadog_api_client.v2.model.api_error_response import APIErrorResponse +from datadog_api_client.v2.model.process_summaries_response import ProcessSummariesResponse + + +class ProcessesApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def __list_processes( + self, + **kwargs + ): + """Get all processes # noqa: E501 + + Get all processes for your organization. # 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_processes(async_req=True) + >>> result = thread.get() + + + Keyword Args: + search (str): String to search processes by.. [optional] + tags (str): Comma-separated list of tags to filter processes by.. [optional] + _from (int): Unix timestamp (number of seconds since epoch) of the start of the query window. If not provided, the start of the query window will be 15 minutes before the `to` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`.. [optional] + to (int): Unix timestamp (number of seconds since epoch) of the end of the query window. If not provided, the end of the query window will be 15 minutes after the `from` timestamp. If neither `from` nor `to` are provided, the query window will be `[now - 15m, now]`.. [optional] + page_limit (int): Maximum number of results returned.. [optional] if omitted the server will use the default value of 1000 + page_cursor (str): String to query the next page of results. This key is provided with each valid response from the API in `meta.page.after`.. [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: + ProcessSummariesResponse + 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') + return self.call_with_http_info(**kwargs) + + self.list_processes = Endpoint( + settings={ + 'response_type': (ProcessSummariesResponse,), + 'auth': [ + 'apiKeyAuth', + 'appKeyAuth' + ], + 'endpoint_path': '/api/v2/processes', + 'operation_id': 'list_processes', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'search', + 'tags', + '_from', + 'to', + 'page_limit', + 'page_cursor', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'page_limit', + ] + }, + root_map={ + 'validations': { + ('page_limit',): { + + 'inclusive_maximum': 10000, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'search': + (str,), + 'tags': + (str,), + '_from': + (int,), + 'to': + (int,), + 'page_limit': + (int,), + 'page_cursor': + (str,), + }, + 'attribute_map': { + 'search': 'search', + 'tags': 'tags', + '_from': 'from', + 'to': 'to', + 'page_limit': 'page[limit]', + 'page_cursor': 'page[cursor]', + }, + 'location_map': { + 'search': 'query', + 'tags': 'query', + '_from': 'query', + 'to': 'query', + 'page_limit': 'query', + 'page_cursor': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client, + callable=__list_processes + ) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 3c6bcbfacb..2bc86df286 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -21,6 +21,7 @@ from datadog_api_client.v2.api.incidents_api import IncidentsApi from datadog_api_client.v2.api.logs_api import LogsApi from datadog_api_client.v2.api.logs_archives_api import LogsArchivesApi +from datadog_api_client.v2.api.processes_api import ProcessesApi from datadog_api_client.v2.api.roles_api import RolesApi from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi from datadog_api_client.v2.api.users_api import UsersApi diff --git a/src/datadog_api_client/v2/model/process_summaries_meta.py b/src/datadog_api_client/v2/model/process_summaries_meta.py new file mode 100644 index 0000000000..4994ccd928 --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summaries_meta.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.v2.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.v2.model.process_summaries_meta_page import ProcessSummariesMetaPage + globals()['ProcessSummariesMetaPage'] = ProcessSummariesMetaPage + + +class ProcessSummariesMeta(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 { + 'page': (ProcessSummariesMetaPage,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'page': 'page', # 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 + """ProcessSummariesMeta - 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,) + page (ProcessSummariesMetaPage): [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/v2/model/process_summaries_meta_page.py b/src/datadog_api_client/v2/model/process_summaries_meta_page.py new file mode 100644 index 0000000000..706631172e --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summaries_meta_page.py @@ -0,0 +1,172 @@ +# 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.v2.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 ProcessSummariesMetaPage(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 = { + ('size',): { + 'inclusive_maximum': 10000, + 'inclusive_minimum': 0, + }, + } + + 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 { + 'after': (str,), # noqa: E501 + 'size': (int,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'after': 'after', # noqa: E501 + 'size': 'size', # 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 + """ProcessSummariesMetaPage - 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,) + after (str): The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`.. [optional] # noqa: E501 + size (int): Number of results returned.. [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/v2/model/process_summaries_response.py b/src/datadog_api_client/v2/model/process_summaries_response.py new file mode 100644 index 0000000000..f3fc2b21da --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summaries_response.py @@ -0,0 +1,175 @@ +# 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.v2.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.v2.model.process_summaries_meta import ProcessSummariesMeta + from datadog_api_client.v2.model.process_summary import ProcessSummary + globals()['ProcessSummariesMeta'] = ProcessSummariesMeta + globals()['ProcessSummary'] = ProcessSummary + + +class ProcessSummariesResponse(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 { + 'data': ([ProcessSummary],), # noqa: E501 + 'meta': (ProcessSummariesMeta,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'meta': 'meta', # 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 + """ProcessSummariesResponse - 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,) + data ([ProcessSummary]): Array of process summary objects.. [optional] # noqa: E501 + meta (ProcessSummariesMeta): [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/v2/model/process_summary.py b/src/datadog_api_client/v2/model/process_summary.py new file mode 100644 index 0000000000..db88589da9 --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summary.py @@ -0,0 +1,178 @@ +# 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.v2.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.v2.model.process_summary_attributes import ProcessSummaryAttributes + from datadog_api_client.v2.model.process_summary_type import ProcessSummaryType + globals()['ProcessSummaryAttributes'] = ProcessSummaryAttributes + globals()['ProcessSummaryType'] = ProcessSummaryType + + +class ProcessSummary(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 { + 'attributes': (ProcessSummaryAttributes,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'type': (ProcessSummaryType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'attributes': 'attributes', # noqa: E501 + 'id': 'id', # noqa: E501 + 'type': 'type', # 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 + """ProcessSummary - 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,) + attributes (ProcessSummaryAttributes): [optional] # noqa: E501 + id (str): Process ID.. [optional] # noqa: E501 + type (ProcessSummaryType): [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/v2/model/process_summary_attributes.py b/src/datadog_api_client/v2/model/process_summary_attributes.py new file mode 100644 index 0000000000..860e845ad7 --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summary_attributes.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.v2.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 ProcessSummaryAttributes(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 { + 'cmdline': (str,), # noqa: E501 + 'host': (str,), # noqa: E501 + 'pid': (int,), # noqa: E501 + 'ppid': (int,), # noqa: E501 + 'start': (str,), # noqa: E501 + 'tags': ([str],), # noqa: E501 + 'timestamp': (str,), # noqa: E501 + 'user': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'cmdline': 'cmdline', # noqa: E501 + 'host': 'host', # noqa: E501 + 'pid': 'pid', # noqa: E501 + 'ppid': 'ppid', # noqa: E501 + 'start': 'start', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'timestamp': 'timestamp', # noqa: E501 + 'user': 'user', # 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 + """ProcessSummaryAttributes - 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,) + cmdline (str): Process command line.. [optional] # noqa: E501 + host (str): Host running the process.. [optional] # noqa: E501 + pid (int): Process ID.. [optional] # noqa: E501 + ppid (int): Parent process ID.. [optional] # noqa: E501 + start (str): Time the process was started.. [optional] # noqa: E501 + tags ([str]): List of tags associated with the process.. [optional] # noqa: E501 + timestamp (str): Time the process was seen.. [optional] # noqa: E501 + user (str): Process owner.. [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/v2/model/process_summary_type.py b/src/datadog_api_client/v2/model/process_summary_type.py new file mode 100644 index 0000000000..d4ad5d6f62 --- /dev/null +++ b/src/datadog_api_client/v2/model/process_summary_type.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.v2.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 ProcessSummaryType(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',): { + 'PROCESS': "process", + }, + } + + 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): + """ProcessSummaryType - 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): Type of process summary.. if omitted defaults to "process", must be one of ["process", ] # noqa: E501 + + Keyword Args: + value (str): Type of process summary.. if omitted defaults to "process", must be one of ["process", ] # 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: + value = "process" + + _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/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 89f46eb3ae..831084a919 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -141,6 +141,12 @@ from datadog_api_client.v2.model.permission_attributes import PermissionAttributes from datadog_api_client.v2.model.permissions_response import PermissionsResponse from datadog_api_client.v2.model.permissions_type import PermissionsType +from datadog_api_client.v2.model.process_summaries_meta import ProcessSummariesMeta +from datadog_api_client.v2.model.process_summaries_meta_page import ProcessSummariesMetaPage +from datadog_api_client.v2.model.process_summaries_response import ProcessSummariesResponse +from datadog_api_client.v2.model.process_summary import ProcessSummary +from datadog_api_client.v2.model.process_summary_attributes import ProcessSummaryAttributes +from datadog_api_client.v2.model.process_summary_type import ProcessSummaryType from datadog_api_client.v2.model.query_sort_order import QuerySortOrder from datadog_api_client.v2.model.relationship_to_incident_integration_metadata_data import RelationshipToIncidentIntegrationMetadataData from datadog_api_client.v2.model.relationship_to_incident_integration_metadatas import RelationshipToIncidentIntegrationMetadatas diff --git a/src/datadog_api_client/v2/openapi.yaml b/src/datadog_api_client/v2/openapi.yaml index c44862a129..6ad2b15437 100644 --- a/src/datadog_api_client/v2/openapi.yaml +++ b/src/datadog_api_client/v2/openapi.yaml @@ -2281,6 +2281,91 @@ components: type: string x-enum-varnames: - PERMISSIONS + ProcessSummariesMeta: + description: Response metadata object. + properties: + page: + description: Paging attributes. + properties: + after: + description: 'The cursor used to get the next results, if any. To make + the next request, use the same + + parameters with the addition of the `page[cursor]`.' + example: 911abf1204838d9cdfcb9a96d0b6a1bd03e1b514074f1ce1737c4cbd + type: string + size: + description: Number of results returned. + format: int32 + maximum: 10000 + minimum: 0 + type: integer + type: object + type: object + ProcessSummariesResponse: + description: List of process summaries. + properties: + data: + description: Array of process summary objects. + items: + $ref: '#/components/schemas/ProcessSummary' + type: array + meta: + $ref: '#/components/schemas/ProcessSummariesMeta' + type: object + ProcessSummary: + description: Process summary object. + properties: + attributes: + $ref: '#/components/schemas/ProcessSummaryAttributes' + id: + description: Process ID. + type: string + type: + $ref: '#/components/schemas/ProcessSummaryType' + type: object + ProcessSummaryAttributes: + description: Attributes for a process summary. + properties: + cmdline: + description: Process command line. + type: string + host: + description: Host running the process. + type: string + pid: + description: Process ID. + format: int64 + type: integer + ppid: + description: Parent process ID. + format: int64 + type: integer + start: + description: Time the process was started. + type: string + tags: + description: List of tags associated with the process. + items: + description: A tag associated with the process. + type: string + type: array + timestamp: + description: Time the process was seen. + type: string + user: + description: Process owner. + type: string + type: object + ProcessSummaryType: + default: process + description: Type of process summary. + enum: + - process + example: process + type: string + x-enum-varnames: + - PROCESS QuerySortOrder: default: desc description: Direction of sort. @@ -4350,6 +4435,90 @@ paths: summary: List permissions tags: - Roles + /api/v2/processes: + get: + description: Get all processes for your organization. + operationId: ListProcesses + parameters: + - description: String to search processes by. + in: query + name: search + required: false + schema: + type: string + - description: Comma-separated list of tags to filter processes by. + example: account:prod,user:admin + in: query + name: tags + required: false + schema: + type: string + - description: 'Unix timestamp (number of seconds since epoch) of the start + of the query window. + + If not provided, the start of the query window will be 15 minutes before + the `to` timestamp. If neither + + `from` nor `to` are provided, the query window will be `[now - 15m, now]`.' + in: query + name: from + required: false + schema: + format: int64 + type: integer + - description: 'Unix timestamp (number of seconds since epoch) of the end of + the query window. + + If not provided, the end of the query window will be 15 minutes after the + `from` timestamp. If neither + + `from` nor `to` are provided, the query window will be `[now - 15m, now]`.' + in: query + name: to + required: false + schema: + format: int64 + type: integer + - description: Maximum number of results returned. + in: query + name: page[limit] + required: false + schema: + default: 1000 + format: int32 + maximum: 10000 + minimum: 1 + type: integer + - description: 'String to query the next page of results. + + This key is provided with each valid response from the API in `meta.page.after`.' + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProcessSummariesResponse' + 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 + summary: Get all processes + tags: + - Processes /api/v2/roles: get: description: Returns all roles, including their names and IDs. @@ -5656,6 +5825,8 @@ tags: description: Find out more at url: https://docs.datadoghq.com/logs/archives/ name: Logs Archives +- description: The processes API allows you to query processes data for your organization. + name: Processes - description: 'The Roles API is used to create and manage Datadog roles, what [global permissions](https://docs.datadoghq.com/account_management/rbac/) diff --git a/tests/v2/cassettes/test_get_all_processes_returns_ok_response.frozen b/tests/v2/cassettes/test_get_all_processes_returns_ok_response.frozen new file mode 100644 index 0000000000..55643d0aa5 --- /dev/null +++ b/tests/v2/cassettes/test_get_all_processes_returns_ok_response.frozen @@ -0,0 +1 @@ +2020-11-19T21:55:18.782838+00:00 \ No newline at end of file diff --git a/tests/v2/cassettes/test_get_all_processes_returns_ok_response.yaml b/tests/v2/cassettes/test_get_all_processes_returns_ok_response.yaml new file mode 100644 index 0000000000..6298b52705 --- /dev/null +++ b/tests/v2/cassettes/test_get_all_processes_returns_ok_response.yaml @@ -0,0 +1,64 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - ListProcesses + User-Agent: + - datadog-api-client-python/0.1.dev135+dirty (python 3.8.6; os Linux; arch x86_64) + method: GET + uri: https://api.datadoghq.com/api/v2/processes?page%5Blimit%5D=2&search=process-agent&tags=testing%3Atrue + response: + body: + string: '{"meta":{"page":{"after":"48ad51e27501000015e90400c5f73d639eae5b250aeeb430a3acb093","size":2}},"data":[{"type":"process","id":"15e90400c53674fe2bf07fb2988d3c1cbe735b5f","attributes":{"cmdline":"/opt/datadog-agent/embedded/bin/process-agent + --config=/etc/datadog-agent/datadog.yaml --sysprobe-config=/etc/datadog-agent/system-probe.yaml + --pid=/opt/datadog-agent/run/process-agent.pid","timestamp":"2020-11-19T21:52:09","start":"2020-11-19T19:05:21","user":"uid:118","pid":1168,"ppid":1,"host":"gardie-frog","tags":["testing:true","host:gardie-frog","user:uid:118","command:process-agent","state_zombie:false"]}},{"type":"process","id":"15e90400c5f73d639eae5b250aeeb430a3acb093","attributes":{"cmdline":"process-agent + --config=/etc/datadog-agent/datadog.yaml","timestamp":"2020-11-19T21:54:09","start":"2020-11-19T21:03:25","user":"root","pid":16407,"ppid":16402,"host":"gardie-frog","tags":["testing:true","host:gardie-frog","user:uid:118","command:process-agent","state_zombie:false"]}}]}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Length: + - '988' + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + DD-POOL: + - dogweb + Date: + - Thu, 19 Nov 2020 21:55:18 GMT + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 26-Nov-2020 21:55:18 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-DD-Debug: + - bOYRvpIMaDWtEAFc77xh4cYKoSxr/zmllvfW+/1TUFo7Zbru0n5QEX4LCoKiS3Mv + X-DD-VERSION: + - '35.3401942' + X-Frame-Options: + - SAMEORIGIN + X-RateLimit-Limit: + - '100' + X-RateLimit-Period: + - '60' + X-RateLimit-Remaining: + - '99' + X-RateLimit-Reset: + - '42' + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/processes.feature b/tests/v2/features/processes.feature new file mode 100644 index 0000000000..0c9bf6cb6a --- /dev/null +++ b/tests/v2/features/processes.feature @@ -0,0 +1,15 @@ +@endpoint(processes) +Feature: Processes + The processes API allows you to query processes data for your + organization. + + Scenario: Get all processes returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Processes" API + And new "ListProcesses" request + And request contains "search" parameter with value "process-agent" + And request contains "tags" parameter with value "testing:true" + And request contains "page[limit]" parameter with value 2 + When the request is sent + Then the response status is 200 OK diff --git a/tests/v2/test_process_summaries_meta.py b/tests/v2/test_process_summaries_meta.py new file mode 100644 index 0000000000..65eba13603 --- /dev/null +++ b/tests/v2/test_process_summaries_meta.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.v2 +from datadog_api_client.v2.model.process_summaries_meta_page import ProcessSummariesMetaPage +globals()['ProcessSummariesMetaPage'] = ProcessSummariesMetaPage +from datadog_api_client.v2.model.process_summaries_meta import ProcessSummariesMeta + + +class TestProcessSummariesMeta(unittest.TestCase): + """ProcessSummariesMeta unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummariesMeta(self): + """Test ProcessSummariesMeta""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummariesMeta() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_process_summaries_meta_page.py b/tests/v2/test_process_summaries_meta_page.py new file mode 100644 index 0000000000..c2c9ad7dba --- /dev/null +++ b/tests/v2/test_process_summaries_meta_page.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.v2 +from datadog_api_client.v2.model.process_summaries_meta_page import ProcessSummariesMetaPage + + +class TestProcessSummariesMetaPage(unittest.TestCase): + """ProcessSummariesMetaPage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummariesMetaPage(self): + """Test ProcessSummariesMetaPage""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummariesMetaPage() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_process_summaries_response.py b/tests/v2/test_process_summaries_response.py new file mode 100644 index 0000000000..c40f373ea6 --- /dev/null +++ b/tests/v2/test_process_summaries_response.py @@ -0,0 +1,36 @@ +# 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.v2 +from datadog_api_client.v2.model.process_summaries_meta import ProcessSummariesMeta +from datadog_api_client.v2.model.process_summary import ProcessSummary +globals()['ProcessSummariesMeta'] = ProcessSummariesMeta +globals()['ProcessSummary'] = ProcessSummary +from datadog_api_client.v2.model.process_summaries_response import ProcessSummariesResponse + + +class TestProcessSummariesResponse(unittest.TestCase): + """ProcessSummariesResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummariesResponse(self): + """Test ProcessSummariesResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummariesResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_process_summary.py b/tests/v2/test_process_summary.py new file mode 100644 index 0000000000..3980274997 --- /dev/null +++ b/tests/v2/test_process_summary.py @@ -0,0 +1,36 @@ +# 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.v2 +from datadog_api_client.v2.model.process_summary_attributes import ProcessSummaryAttributes +from datadog_api_client.v2.model.process_summary_type import ProcessSummaryType +globals()['ProcessSummaryAttributes'] = ProcessSummaryAttributes +globals()['ProcessSummaryType'] = ProcessSummaryType +from datadog_api_client.v2.model.process_summary import ProcessSummary + + +class TestProcessSummary(unittest.TestCase): + """ProcessSummary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummary(self): + """Test ProcessSummary""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummary() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_process_summary_attributes.py b/tests/v2/test_process_summary_attributes.py new file mode 100644 index 0000000000..3add7a5081 --- /dev/null +++ b/tests/v2/test_process_summary_attributes.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.v2 +from datadog_api_client.v2.model.process_summary_attributes import ProcessSummaryAttributes + + +class TestProcessSummaryAttributes(unittest.TestCase): + """ProcessSummaryAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummaryAttributes(self): + """Test ProcessSummaryAttributes""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummaryAttributes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_process_summary_type.py b/tests/v2/test_process_summary_type.py new file mode 100644 index 0000000000..2c7186eba0 --- /dev/null +++ b/tests/v2/test_process_summary_type.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.v2 +from datadog_api_client.v2.model.process_summary_type import ProcessSummaryType + + +class TestProcessSummaryType(unittest.TestCase): + """ProcessSummaryType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProcessSummaryType(self): + """Test ProcessSummaryType""" + # FIXME: construct object with mandatory attributes with example values + # model = ProcessSummaryType() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/v2/test_processes_api.py b/tests/v2/test_processes_api.py new file mode 100644 index 0000000000..7f6bd5ef1f --- /dev/null +++ b/tests/v2/test_processes_api.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 unittest + +import datadog_api_client.v2 +from datadog_api_client.v2.api.processes_api import ProcessesApi # noqa: E501 + + +class TestProcessesApi(unittest.TestCase): + """ProcessesApi unit test stubs""" + + def setUp(self): + self.api = ProcessesApi() # noqa: E501 + + def tearDown(self): + pass + + def test_list_processes(self): + """Test case for list_processes + + Get all processes # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main()