%global _empty_manifest_terminate_build 0 Name: python-datadog-api-client Version: 2.11.0 Release: 1 Summary: Collection of all Datadog Public endpoints License: BSD URL: https://github.com/DataDog/datadog-api-client-python Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4e/fd/dc494ea12f5b1080b83c80f197ec5b7811769ed9e3b6a233bb121534ee65/datadog-api-client-2.11.0.tar.gz BuildArch: noarch Requires: python3-urllib3 Requires: python3-certifi Requires: python3-dateutil Requires: python3-typing-extensions Requires: python3-ddtrace Requires: python3-aiosonic Requires: python3-aiosonic Requires: python3-glom Requires: python3-jinja2 Requires: python3-pytest Requires: python3-pytest-bdd Requires: python3-pytest-asyncio Requires: python3-pytest-randomly Requires: python3-pytest-recording Requires: python3-dateutil Requires: python3-mypy Requires: python3-types-python-dateutil Requires: python3-zstandard Requires: python3-zstandard %description # datadog-api-client-python This repository contains a Python API client for the [Datadog API](https://docs.datadoghq.com/api/). ## Requirements Building and using the API client library requires [Python 3.7+](https://www.python.org/downloads/). ## Installation To install the API client library, simply execute: ```shell pip install datadog-api-client ``` ## Getting Started Please follow the [installation](#installation) instruction and execute the following Python code: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.monitors_api import MonitorsApi from datadog_api_client.v1.model.monitor import Monitor from datadog_api_client.v1.model.monitor_type import MonitorType body = Monitor( name="example", type=MonitorType("log alert"), query='logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2', message="some message Notify: @hipchat-channel", tags=["test:example", "env:ci"], priority=3, ) configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = MonitorsApi(api_client) response = api_instance.create_monitor(body=body) print(response) ``` ### Authentication By default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API. To provide your own set of credentials, you need to set some keys on the configuration: ```python configuration.api_key["apiKeyAuth"] = "" configuration.api_key["appKeyAuth"] = "" ``` ### Unstable Endpoints This client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints: ```python configuration.unstable_operations[""] = True ``` where `` is the name of the method used to interact with that endpoint. For example: `list_log_indexes`, or `get_logs_index` ### Changing Server When talking to a different server, like the `eu` instance, change the `server_variables` on your configuration object: ```python configuration.server_variables["site"] = "datadoghq.eu" ``` ### Disable compressed payloads If you want to disable GZIP compressed responses, set the `compress` flag on your configuration object: ```python configuration.compress = False ``` ### Enable requests logging If you want to enable requests logging, set the `debug` flag on your configuration object: ```python configuration.debug = True ``` ### Configure proxy You can configure the client to use proxy by setting the `proxy` key on configuration object: ```python configuration.proxy = "http://127.0.0.1:80" ``` ### Threads support You can run API calls in a thread by using `ThreadedApiClient` in place of `ApiClient`. API calls will then return a `AsyncResult` instance on which you can call get to retrieve the result: ```python from datadog_api_client import Configuration, ThreadedApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi configuration = Configuration() with ThreadedApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) result = api_instance.list_dashboards() dashboards = result.get() print(dashboards) ``` ### Asyncio support The library supports asynchronous operations when using `AsyncApiClient` for the transport. When that client is used, the API methods will then return coroutines that you can wait for. To make async support available, you need to install the extra `async` qualifiers during installation: `pip install datadog-api-client[async]`. ```python import asyncio from datadog_api_client import Configuration, AsyncApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi async def main(): configuration = Configuration() async with AsyncApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) dashboards = await api_instance.list_dashboards() print(dashboards) asyncio.run(main()) ``` ### Pagination Several listing operations have a pagination method to help consume all the items available. For example, to retrieve all your incidents: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.incidents_api import IncidentsApi configuration = Configuration() configuration.unstable_operations["list_incidents"] = True with ApiClient(configuration) as api_client: api_instance = IncidentsApi(api_client) for incident in api_instance.list_incidents_with_pagination(): print(incident.id) ``` ## Documentation for API Endpoints and Models Documentation for API endpoints and models are available on [readthedocs](https://datadog-api-client.readthedocs.io/). ## Documentation for Authorization Authenticate with the API by providing your API and Application keys in the configuration: ```python configuration.api_key["apiKeyAuth"] = "YOUR_API_KEY" configuration.api_key["appKeyAuth"] = "YOUR_APPLICATION_KEY" ``` ## Author support@datadoghq.com %package -n python3-datadog-api-client Summary: Collection of all Datadog Public endpoints Provides: python-datadog-api-client BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-datadog-api-client # datadog-api-client-python This repository contains a Python API client for the [Datadog API](https://docs.datadoghq.com/api/). ## Requirements Building and using the API client library requires [Python 3.7+](https://www.python.org/downloads/). ## Installation To install the API client library, simply execute: ```shell pip install datadog-api-client ``` ## Getting Started Please follow the [installation](#installation) instruction and execute the following Python code: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.monitors_api import MonitorsApi from datadog_api_client.v1.model.monitor import Monitor from datadog_api_client.v1.model.monitor_type import MonitorType body = Monitor( name="example", type=MonitorType("log alert"), query='logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2', message="some message Notify: @hipchat-channel", tags=["test:example", "env:ci"], priority=3, ) configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = MonitorsApi(api_client) response = api_instance.create_monitor(body=body) print(response) ``` ### Authentication By default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API. To provide your own set of credentials, you need to set some keys on the configuration: ```python configuration.api_key["apiKeyAuth"] = "" configuration.api_key["appKeyAuth"] = "" ``` ### Unstable Endpoints This client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints: ```python configuration.unstable_operations[""] = True ``` where `` is the name of the method used to interact with that endpoint. For example: `list_log_indexes`, or `get_logs_index` ### Changing Server When talking to a different server, like the `eu` instance, change the `server_variables` on your configuration object: ```python configuration.server_variables["site"] = "datadoghq.eu" ``` ### Disable compressed payloads If you want to disable GZIP compressed responses, set the `compress` flag on your configuration object: ```python configuration.compress = False ``` ### Enable requests logging If you want to enable requests logging, set the `debug` flag on your configuration object: ```python configuration.debug = True ``` ### Configure proxy You can configure the client to use proxy by setting the `proxy` key on configuration object: ```python configuration.proxy = "http://127.0.0.1:80" ``` ### Threads support You can run API calls in a thread by using `ThreadedApiClient` in place of `ApiClient`. API calls will then return a `AsyncResult` instance on which you can call get to retrieve the result: ```python from datadog_api_client import Configuration, ThreadedApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi configuration = Configuration() with ThreadedApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) result = api_instance.list_dashboards() dashboards = result.get() print(dashboards) ``` ### Asyncio support The library supports asynchronous operations when using `AsyncApiClient` for the transport. When that client is used, the API methods will then return coroutines that you can wait for. To make async support available, you need to install the extra `async` qualifiers during installation: `pip install datadog-api-client[async]`. ```python import asyncio from datadog_api_client import Configuration, AsyncApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi async def main(): configuration = Configuration() async with AsyncApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) dashboards = await api_instance.list_dashboards() print(dashboards) asyncio.run(main()) ``` ### Pagination Several listing operations have a pagination method to help consume all the items available. For example, to retrieve all your incidents: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.incidents_api import IncidentsApi configuration = Configuration() configuration.unstable_operations["list_incidents"] = True with ApiClient(configuration) as api_client: api_instance = IncidentsApi(api_client) for incident in api_instance.list_incidents_with_pagination(): print(incident.id) ``` ## Documentation for API Endpoints and Models Documentation for API endpoints and models are available on [readthedocs](https://datadog-api-client.readthedocs.io/). ## Documentation for Authorization Authenticate with the API by providing your API and Application keys in the configuration: ```python configuration.api_key["apiKeyAuth"] = "YOUR_API_KEY" configuration.api_key["appKeyAuth"] = "YOUR_APPLICATION_KEY" ``` ## Author support@datadoghq.com %package help Summary: Development documents and examples for datadog-api-client Provides: python3-datadog-api-client-doc %description help # datadog-api-client-python This repository contains a Python API client for the [Datadog API](https://docs.datadoghq.com/api/). ## Requirements Building and using the API client library requires [Python 3.7+](https://www.python.org/downloads/). ## Installation To install the API client library, simply execute: ```shell pip install datadog-api-client ``` ## Getting Started Please follow the [installation](#installation) instruction and execute the following Python code: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v1.api.monitors_api import MonitorsApi from datadog_api_client.v1.model.monitor import Monitor from datadog_api_client.v1.model.monitor_type import MonitorType body = Monitor( name="example", type=MonitorType("log alert"), query='logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2', message="some message Notify: @hipchat-channel", tags=["test:example", "env:ci"], priority=3, ) configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = MonitorsApi(api_client) response = api_instance.create_monitor(body=body) print(response) ``` ### Authentication By default the library will use the `DD_API_KEY` and `DD_APP_KEY` environment variables to authenticate against the Datadog API. To provide your own set of credentials, you need to set some keys on the configuration: ```python configuration.api_key["apiKeyAuth"] = "" configuration.api_key["appKeyAuth"] = "" ``` ### Unstable Endpoints This client includes access to Datadog API endpoints while they are in an unstable state and may undergo breaking changes. An extra configuration step is required to enable these endpoints: ```python configuration.unstable_operations[""] = True ``` where `` is the name of the method used to interact with that endpoint. For example: `list_log_indexes`, or `get_logs_index` ### Changing Server When talking to a different server, like the `eu` instance, change the `server_variables` on your configuration object: ```python configuration.server_variables["site"] = "datadoghq.eu" ``` ### Disable compressed payloads If you want to disable GZIP compressed responses, set the `compress` flag on your configuration object: ```python configuration.compress = False ``` ### Enable requests logging If you want to enable requests logging, set the `debug` flag on your configuration object: ```python configuration.debug = True ``` ### Configure proxy You can configure the client to use proxy by setting the `proxy` key on configuration object: ```python configuration.proxy = "http://127.0.0.1:80" ``` ### Threads support You can run API calls in a thread by using `ThreadedApiClient` in place of `ApiClient`. API calls will then return a `AsyncResult` instance on which you can call get to retrieve the result: ```python from datadog_api_client import Configuration, ThreadedApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi configuration = Configuration() with ThreadedApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) result = api_instance.list_dashboards() dashboards = result.get() print(dashboards) ``` ### Asyncio support The library supports asynchronous operations when using `AsyncApiClient` for the transport. When that client is used, the API methods will then return coroutines that you can wait for. To make async support available, you need to install the extra `async` qualifiers during installation: `pip install datadog-api-client[async]`. ```python import asyncio from datadog_api_client import Configuration, AsyncApiClient from datadog_api_client.v1.api.dashboards_api import DashboardsApi async def main(): configuration = Configuration() async with AsyncApiClient(configuration) as api_client: api_instance = DashboardsApi(api_client) dashboards = await api_instance.list_dashboards() print(dashboards) asyncio.run(main()) ``` ### Pagination Several listing operations have a pagination method to help consume all the items available. For example, to retrieve all your incidents: ```python from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.incidents_api import IncidentsApi configuration = Configuration() configuration.unstable_operations["list_incidents"] = True with ApiClient(configuration) as api_client: api_instance = IncidentsApi(api_client) for incident in api_instance.list_incidents_with_pagination(): print(incident.id) ``` ## Documentation for API Endpoints and Models Documentation for API endpoints and models are available on [readthedocs](https://datadog-api-client.readthedocs.io/). ## Documentation for Authorization Authenticate with the API by providing your API and Application keys in the configuration: ```python configuration.api_key["apiKeyAuth"] = "YOUR_API_KEY" configuration.api_key["appKeyAuth"] = "YOUR_APPLICATION_KEY" ``` ## Author support@datadoghq.com %prep %autosetup -n datadog-api-client-2.11.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-datadog-api-client -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon Apr 10 2023 Python_Bot - 2.11.0-1 - Package Spec generated