Skip to content

Commit

Permalink
v2.2.1 (#24)
Browse files Browse the repository at this point in the history
* Upgrade to version 2.2.0 (support HTTP proxy)

* Update example in readme

* Version 2.2.1

* Update readme with TLSv1.2 info

* Update readme with 2.2.x changes
  • Loading branch information
Vasily V authored Oct 19, 2017
1 parent 5712e9f commit 51966b9
Show file tree
Hide file tree
Showing 139 changed files with 15,050 additions and 9,958 deletions.
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,26 @@ If you're looking for the V1 API, the API client can be found in the api-v1 bran

## Requirements

- Python 2.7 and higher
- OpenSSL 1.0 and higher
- Python 2.7 or higher
- OpenSSL 1.0.1 or higher (TLSv1.2 support)

**Note**: As of April 2017 Macs ship with OpenSSL version 0.9.8. You may need to upgrade to 1.0 if you have not already. To upgrade using Homebrew, run:
**Note ("[Errno 54] Connection reset by peer" error)**:
This is a known issue affecting Python 2.7 on most Macs. macOS ships with an outdated version of the OpenSSL library that only supports deprecated encryption protocols. As a result, Python 2.7 that ships with the system, doesn't support TLSv1.2. During SSL handshake it attempts to use TLSv1 encryption protocol, which is no longer considered secure, and Wavefront servers are terminating the connection, which results in a "Connection reset by peer" error.
To work around this issue, the easiest way would be to install an updated version of Python 2.7 using Homebrew (https://brew.sh), which doesn't rely on the system-provided OpenSSL library, or switch to Python 3.

**Note:** v2.2.x libraries require a minor code modification to be compatible with v2.1.x and earlier versions due to breaking changes introduced by swagger-codegen.
Before:

```python
client = wave_api.ApiClient(host=base_url, header_name='Authorization', header_value='Bearer ' + api_key)
```
brew upgrade openssl

After:

```python
config = wave_api.Configuration()
config.host = base_url
client = wave_api.ApiClient(configuration=config, header_name='Authorization', header_value='Bearer ' + api_key)
```

## Setuptools
Expand Down Expand Up @@ -63,7 +76,9 @@ import wavefront_api_client as wave_api
base_url = 'https://YOUR_INSTANCE.wavefront.com'
api_key = 'YOUR_API_TOKEN'

client = wave_api.ApiClient(host=base_url, header_name='Authorization', header_value='Bearer ' + api_key)
config = wave_api.Configuration()
config.host = base_url
client = wave_api.ApiClient(configuration=config, header_name='Authorization', header_value='Bearer ' + api_key)

# instantiate source API
source_api = wave_api.SourceApi(client)
Expand Down
4 changes: 3 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
base_url = 'https://try.wavefront.com'
api_key = 'YOUR_API_KEY'

client = wave_api.ApiClient(host=base_url, header_name='Authorization', header_value='Bearer ' + api_key)
config = wave_api.Configuration()
config.host = base_url
client = wave_api.ApiClient(configuration=config, header_name='Authorization', header_value='Bearer ' + api_key)

# instantiate source API

Expand Down
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
certifi >= 14.05.14
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
22 changes: 14 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# coding: utf-8

import sys
from setuptools import setup, find_packages
"""
Wavefront Public API
NAME = "wavefront-client"
VERSION = "2.1.0"
<p>The Wavefront public API enables you to interact with Wavefront servers using standard web service API tools. You can use the API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make API calls outside the Wavefront API documentation you must add the header \"Authorization: Bearer &lt;&lt;API-TOKEN&gt;&gt;\" to your HTTP requests.</p><p>For legacy versions of the Wavefront API, see the <a href=\"/api-docs/ui/deprecated\">legacy API documentation</a>.</p>
OpenAPI spec version: v2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import sys
from setuptools import setup, find_packages

NAME = "wavefront-client"
VERSION = "2.2.1"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools

REQUIRES = ["urllib3 >= 1.10", "six >= 1.9", "certifi", "python-dateutil"]
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]

setup(
name=NAME,
Expand All @@ -29,8 +37,6 @@
packages=find_packages(),
include_package_data=True,
long_description="""\
&lt;p&gt;Wavefront public APIs enable you to interact with Wavefront servers using standard web service API tools. You can use the APIs to automate commonly executed operations such as automatically tagging sources.&lt;/p&gt;&lt;p&gt;When you make API calls outside the Wavefront UI you must add the header \&quot;Authorization: Bearer &amp;lt;&amp;lt;API-TOKEN&amp;gt;&amp;gt;\&quot; to your HTTP requests.&lt;/p&gt;&lt;p&gt;For legacy versions of the Wavefront API, see the &lt;a href=\&quot;/api-docs/ui/deprecated\&quot;&gt;legacy API documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Wavefront public API enables you to interact with Wavefront servers using standard web service API tools. You can use the API to automate commonly executed operations such as automatically tagging sources.&lt;/p&gt;&lt;p&gt;When you make API calls outside the Wavefront API documentation you must add the header \&quot;Authorization: Bearer &amp;lt;&amp;lt;API-TOKEN&amp;gt;&amp;gt;\&quot; to your HTTP requests.&lt;/p&gt;&lt;p&gt;For legacy versions of the Wavefront API, see the &lt;a href&#x3D;\&quot;/api-docs/ui/deprecated\&quot;&gt;legacy API documentation&lt;/a&gt;.&lt;/p&gt;
"""
)


35 changes: 24 additions & 11 deletions wavefront_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
Wavefront Public API
<p>Wavefront public APIs enable you to interact with Wavefront servers using standard web service API tools. You can use the APIs to automate commonly executed operations such as automatically tagging sources.</p><p>When you make API calls outside the Wavefront UI you must add the header \"Authorization: Bearer &lt;&lt;API-TOKEN&gt;&gt;\" to your HTTP requests.</p><p>For legacy versions of the Wavefront API, see the <a href=\"/api-docs/ui/deprecated\">legacy API documentation</a>.</p>
<p>The Wavefront public API enables you to interact with Wavefront servers using standard web service API tools. You can use the API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make API calls outside the Wavefront API documentation you must add the header \"Authorization: Bearer &lt;&lt;API-TOKEN&gt;&gt;\" to your HTTP requests.</p><p>For legacy versions of the Wavefront API, see the <a href=\"/api-docs/ui/deprecated\">legacy API documentation</a>.</p>
OpenAPI spec version: v2
Expand Down Expand Up @@ -36,33 +36,43 @@
from .models.facet_search_request_container import FacetSearchRequestContainer
from .models.facets_response_container import FacetsResponseContainer
from .models.facets_search_request_container import FacetsSearchRequestContainer
from .models.gcp_configuration import GCPConfiguration
from .models.history_entry import HistoryEntry
from .models.history_response import HistoryResponse
from .models.integration import Integration
from .models.integration_dashboard import IntegrationDashboard
from .models.integration_manifest_group import IntegrationManifestGroup
from .models.integration_metrics import IntegrationMetrics
from .models.integration_status import IntegrationStatus
from .models.iterator_entry_string_json_node import IteratorEntryStringJsonNode
from .models.iterator_json_node import IteratorJsonNode
from .models.iterator_string import IteratorString
from .models.logical_type import LogicalType
from .models.maintenance_window import MaintenanceWindow
from .models.message import Message
from .models.metric_details import MetricDetails
from .models.metric_details_response import MetricDetailsResponse
from .models.metric_status import MetricStatus
from .models.notificant import Notificant
from .models.number import Number
from .models.paged import Paged
from .models.paged_alert import PagedAlert
from .models.paged_cloud_integration import PagedCloudIntegration
from .models.paged_dashboard import PagedDashboard
from .models.paged_event import PagedEvent
from .models.paged_external_link import PagedExternalLink
from .models.paged_integration import PagedIntegration
from .models.paged_maintenance_window import PagedMaintenanceWindow
from .models.paged_message import PagedMessage
from .models.paged_notificant import PagedNotificant
from .models.paged_proxy import PagedProxy
from .models.paged_saved_search import PagedSavedSearch
from .models.paged_source import PagedSource
from .models.paged_webhook import PagedWebhook
from .models.point import Point
from .models.proxy import Proxy
from .models.query_key_container import QueryKeyContainer
from .models.query_event import QueryEvent
from .models.query_result import QueryResult
from .models.report_event import ReportEvent
from .models.raw_timeseries import RawTimeseries
from .models.response_container import ResponseContainer
from .models.response_container_alert import ResponseContainerAlert
from .models.response_container_cloud_integration import ResponseContainerCloudIntegration
Expand All @@ -72,29 +82,33 @@
from .models.response_container_facet_response import ResponseContainerFacetResponse
from .models.response_container_facets_response_container import ResponseContainerFacetsResponseContainer
from .models.response_container_history_response import ResponseContainerHistoryResponse
from .models.response_container_integration import ResponseContainerIntegration
from .models.response_container_integration_status import ResponseContainerIntegrationStatus
from .models.response_container_list_integration_manifest_group import ResponseContainerListIntegrationManifestGroup
from .models.response_container_maintenance_window import ResponseContainerMaintenanceWindow
from .models.response_container_map_string_integer import ResponseContainerMapStringInteger
from .models.response_container_map_string_integration_status import ResponseContainerMapStringIntegrationStatus
from .models.response_container_message import ResponseContainerMessage
from .models.response_container_notificant import ResponseContainerNotificant
from .models.response_container_paged import ResponseContainerPaged
from .models.response_container_paged_alert import ResponseContainerPagedAlert
from .models.response_container_paged_cloud_integration import ResponseContainerPagedCloudIntegration
from .models.response_container_paged_dashboard import ResponseContainerPagedDashboard
from .models.response_container_paged_event import ResponseContainerPagedEvent
from .models.response_container_paged_external_link import ResponseContainerPagedExternalLink
from .models.response_container_paged_integration import ResponseContainerPagedIntegration
from .models.response_container_paged_maintenance_window import ResponseContainerPagedMaintenanceWindow
from .models.response_container_paged_message import ResponseContainerPagedMessage
from .models.response_container_paged_notificant import ResponseContainerPagedNotificant
from .models.response_container_paged_proxy import ResponseContainerPagedProxy
from .models.response_container_paged_saved_search import ResponseContainerPagedSavedSearch
from .models.response_container_paged_source import ResponseContainerPagedSource
from .models.response_container_paged_webhook import ResponseContainerPagedWebhook
from .models.response_container_proxy import ResponseContainerProxy
from .models.response_container_saved_search import ResponseContainerSavedSearch
from .models.response_container_source import ResponseContainerSource
from .models.response_container_tags_response import ResponseContainerTagsResponse
from .models.response_container_webhook import ResponseContainerWebhook
from .models.response_status import ResponseStatus
from .models.saved_search import SavedSearch
from .models.scoped_dto_converter import ScopedDTOConverter
from .models.search_query import SearchQuery
from .models.sortable_search_request import SortableSearchRequest
from .models.sorting import Sorting
Expand All @@ -103,22 +117,23 @@
from .models.source_search_request_container import SourceSearchRequestContainer
from .models.stats_model import StatsModel
from .models.tags_response import TagsResponse
from .models.target_info import TargetInfo
from .models.timeseries import Timeseries
from .models.timeseries_stats_container import TimeseriesStatsContainer
from .models.user_model import UserModel
from .models.user_to_create import UserToCreate
from .models.wf_tags import WFTags
from .models.webhook import Webhook

# import apis into sdk package
from .apis.alert_api import AlertApi
from .apis.cloud_integration_api import CloudIntegrationApi
from .apis.dashboard_api import DashboardApi
from .apis.event_api import EventApi
from .apis.external_link_api import ExternalLinkApi
from .apis.integration_api import IntegrationApi
from .apis.maintenance_window_api import MaintenanceWindowApi
from .apis.message_api import MessageApi
from .apis.metric_api import MetricApi
from .apis.notificant_api import NotificantApi
from .apis.proxy_api import ProxyApi
from .apis.query_api import QueryApi
from .apis.saved_search_api import SavedSearchApi
Expand All @@ -131,5 +146,3 @@
from .api_client import ApiClient

from .configuration import Configuration

configuration = Configuration()
Loading

0 comments on commit 51966b9

Please sign in to comment.