From 7106bce21e1eee634bc1265a91cc434892e6693a Mon Sep 17 00:00:00 2001 From: wf-jenkins Date: Tue, 14 Nov 2023 08:16:20 -0800 Subject: [PATCH] Autogenerated Update v2.210.2. --- .swagger-codegen/config.json | 2 +- .swagger-codegen/config.jsone | 2 +- README.md | 12 +- docs/SecurityPolicyApi.md | 281 ++++++++++ setup.py | 2 +- test/test_security_policy_api.py | 69 +++ wavefront_api_client/__init__.py | 2 +- wavefront_api_client/api/__init__.py | 2 +- .../api/security_policy_api.py | 517 ++++++++++++++++++ wavefront_api_client/api_client.py | 2 +- wavefront_api_client/configuration.py | 2 +- 11 files changed, 880 insertions(+), 13 deletions(-) create mode 100644 docs/SecurityPolicyApi.md create mode 100644 test/test_security_policy_api.py create mode 100644 wavefront_api_client/api/security_policy_api.py diff --git a/.swagger-codegen/config.json b/.swagger-codegen/config.json index 6edb882..d1a9877 100644 --- a/.swagger-codegen/config.json +++ b/.swagger-codegen/config.json @@ -3,5 +3,5 @@ "gitUserId": "wavefrontHQ", "packageName": "wavefront_api_client", "packageUrl": "https://github.com/wavefrontHQ/python-client", - "packageVersion": "2.203.2" + "packageVersion": "2.210.2" } diff --git a/.swagger-codegen/config.jsone b/.swagger-codegen/config.jsone index 9b50fe2..6edb882 100644 --- a/.swagger-codegen/config.jsone +++ b/.swagger-codegen/config.jsone @@ -3,5 +3,5 @@ "gitUserId": "wavefrontHQ", "packageName": "wavefront_api_client", "packageUrl": "https://github.com/wavefrontHQ/python-client", - "packageVersion": "2.202.0" + "packageVersion": "2.203.2" } diff --git a/README.md b/README.md index 00116f0..9779106 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: v2 -- Package version: 2.203.2 +- Package version: 2.210.2 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -224,11 +224,6 @@ Class | Method | HTTP request | Description *MessageApi* | [**user_get_messages**](docs/MessageApi.md#user_get_messages) | **GET** /api/v2/message | Gets messages applicable to the current user, i.e. within time range and distribution scope *MessageApi* | [**user_read_message**](docs/MessageApi.md#user_read_message) | **POST** /api/v2/message/{id}/read | Mark a specific message as read *MetricApi* | [**get_metric_details**](docs/MetricApi.md#get_metric_details) | **GET** /api/v2/chart/metric/detail | Get more details on a metric, including reporting sources and approximate last time reported -*MetricsPolicyApi* | [**get_metrics_policy**](docs/MetricsPolicyApi.md#get_metrics_policy) | **GET** /api/v2/metricspolicy | Get the metrics policy -*MetricsPolicyApi* | [**get_metrics_policy_by_version**](docs/MetricsPolicyApi.md#get_metrics_policy_by_version) | **GET** /api/v2/metricspolicy/history/{version} | Get a specific historical version of a metrics policy -*MetricsPolicyApi* | [**get_metrics_policy_history**](docs/MetricsPolicyApi.md#get_metrics_policy_history) | **GET** /api/v2/metricspolicy/history | Get the version history of metrics policy -*MetricsPolicyApi* | [**revert_metrics_policy_by_version**](docs/MetricsPolicyApi.md#revert_metrics_policy_by_version) | **POST** /api/v2/metricspolicy/revert/{version} | Revert to a specific historical version of a metrics policy -*MetricsPolicyApi* | [**update_metrics_policy**](docs/MetricsPolicyApi.md#update_metrics_policy) | **PUT** /api/v2/metricspolicy | Update the metrics policy *MonitoredApplicationApi* | [**get_all_applications**](docs/MonitoredApplicationApi.md#get_all_applications) | **GET** /api/v2/monitoredapplication | Get all monitored services *MonitoredApplicationApi* | [**get_application**](docs/MonitoredApplicationApi.md#get_application) | **GET** /api/v2/monitoredapplication/{application} | Get a specific application *MonitoredApplicationApi* | [**update_service**](docs/MonitoredApplicationApi.md#update_service) | **PUT** /api/v2/monitoredapplication/{application} | Update a specific service @@ -402,6 +397,11 @@ Class | Method | HTTP request | Description *SearchApi* | [**search_web_hook_entities**](docs/SearchApi.md#search_web_hook_entities) | **POST** /api/v2/search/webhook | Search over a customer's webhooks *SearchApi* | [**search_web_hook_for_facet**](docs/SearchApi.md#search_web_hook_for_facet) | **POST** /api/v2/search/webhook/{facet} | Lists the values of a specific facet over the customer's webhooks *SearchApi* | [**search_webhook_for_facets**](docs/SearchApi.md#search_webhook_for_facets) | **POST** /api/v2/search/webhook/facets | Lists the values of one or more facets over the customer's webhooks +*SecurityPolicyApi* | [**get_metrics_policy**](docs/SecurityPolicyApi.md#get_metrics_policy) | **GET** /api/v2/metricspolicy | Get the metrics policy +*SecurityPolicyApi* | [**get_metrics_policy_by_version**](docs/SecurityPolicyApi.md#get_metrics_policy_by_version) | **GET** /api/v2/metricspolicy/history/{version} | Get a specific historical version of a metrics policy +*SecurityPolicyApi* | [**get_metrics_policy_history**](docs/SecurityPolicyApi.md#get_metrics_policy_history) | **GET** /api/v2/metricspolicy/history | Get the version history of metrics policy +*SecurityPolicyApi* | [**revert_metrics_policy_by_version**](docs/SecurityPolicyApi.md#revert_metrics_policy_by_version) | **POST** /api/v2/metricspolicy/revert/{version} | Revert to a specific historical version of a metrics policy +*SecurityPolicyApi* | [**update_metrics_policy**](docs/SecurityPolicyApi.md#update_metrics_policy) | **PUT** /api/v2/metricspolicy | Update the metrics policy *SourceApi* | [**add_source_tag**](docs/SourceApi.md#add_source_tag) | **PUT** /api/v2/source/{id}/tag/{tagValue} | Add a tag to a specific source *SourceApi* | [**create_source**](docs/SourceApi.md#create_source) | **POST** /api/v2/source | Create metadata (description or tags) for a specific source *SourceApi* | [**delete_source**](docs/SourceApi.md#delete_source) | **DELETE** /api/v2/source/{id} | Delete metadata (description and tags) for a specific source diff --git a/docs/SecurityPolicyApi.md b/docs/SecurityPolicyApi.md new file mode 100644 index 0000000..84a7b2c --- /dev/null +++ b/docs/SecurityPolicyApi.md @@ -0,0 +1,281 @@ +# wavefront_api_client.SecurityPolicyApi + +All URIs are relative to *https://YOUR_INSTANCE.wavefront.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_metrics_policy**](SecurityPolicyApi.md#get_metrics_policy) | **GET** /api/v2/metricspolicy | Get the metrics policy +[**get_metrics_policy_by_version**](SecurityPolicyApi.md#get_metrics_policy_by_version) | **GET** /api/v2/metricspolicy/history/{version} | Get a specific historical version of a metrics policy +[**get_metrics_policy_history**](SecurityPolicyApi.md#get_metrics_policy_history) | **GET** /api/v2/metricspolicy/history | Get the version history of metrics policy +[**revert_metrics_policy_by_version**](SecurityPolicyApi.md#revert_metrics_policy_by_version) | **POST** /api/v2/metricspolicy/revert/{version} | Revert to a specific historical version of a metrics policy +[**update_metrics_policy**](SecurityPolicyApi.md#update_metrics_policy) | **PUT** /api/v2/metricspolicy | Update the metrics policy + + +# **get_metrics_policy** +> ResponseContainerMetricsPolicyReadModel get_metrics_policy() + +Get the metrics policy + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) + +try: + # Get the metrics policy + api_response = api_instance.get_metrics_policy() + pprint(api_response) +except ApiException as e: + print("Exception when calling SecurityPolicyApi->get_metrics_policy: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_metrics_policy_by_version** +> ResponseContainerMetricsPolicyReadModel get_metrics_policy_by_version(version) + +Get a specific historical version of a metrics policy + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) +version = 789 # int | + +try: + # Get a specific historical version of a metrics policy + api_response = api_instance.get_metrics_policy_by_version(version) + pprint(api_response) +except ApiException as e: + print("Exception when calling SecurityPolicyApi->get_metrics_policy_by_version: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **version** | **int**| | + +### Return type + +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_metrics_policy_history** +> ResponseContainerHistoryResponse get_metrics_policy_history(offset=offset, limit=limit) + +Get the version history of metrics policy + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) +offset = 0 # int | (optional) (default to 0) +limit = 100 # int | (optional) (default to 100) + +try: + # Get the version history of metrics policy + api_response = api_instance.get_metrics_policy_history(offset=offset, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling SecurityPolicyApi->get_metrics_policy_history: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **int**| | [optional] [default to 0] + **limit** | **int**| | [optional] [default to 100] + +### Return type + +[**ResponseContainerHistoryResponse**](ResponseContainerHistoryResponse.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + +# **revert_metrics_policy_by_version** +> ResponseContainerMetricsPolicyReadModel revert_metrics_policy_by_version(version) + +Revert to a specific historical version of a metrics policy + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) +version = 789 # int | + +try: + # Revert to a specific historical version of a metrics policy + api_response = api_instance.revert_metrics_policy_by_version(version) + pprint(api_response) +except ApiException as e: + print("Exception when calling SecurityPolicyApi->revert_metrics_policy_by_version: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **version** | **int**| | + +### Return type + +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_metrics_policy** +> ResponseContainerMetricsPolicyReadModel update_metrics_policy(body=body) + +Update the metrics policy + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) +body = wavefront_api_client.MetricsPolicyWriteModel() # MetricsPolicyWriteModel | Example Body:
{ \"policyRules\": [{   \"name\": \"Policy rule1 name\",   \"description\": \"Policy rule1 description\",   \"prefixes\": [\"revenue.*\"],   \"tags\": [{\"key\":\"sensitive\",  \"value\":\"false\"},              {\"key\":\"source\",  \"value\":\"app1\"}],   \"tagsAnded\": \"true\",   \"accessType\": \"ALLOW\",   \"accounts\": [\"accountId1\", \"accountId2\"],   \"userGroups\": [\"userGroupId1\"],   \"roles\": [\"roleId\"] }, {   \"name\": \"Policy rule2 name\",   \"description\": \"Policy rule2 description\",   \"prefixes\": [\"revenue.*\"],   \"accessType\": \"BLOCK\",   \"accounts\": [\"accountId3\"],   \"userGroups\": [\"userGroupId1\"] }] }
(optional) + +try: + # Update the metrics policy + api_response = api_instance.update_metrics_policy(body=body) + pprint(api_response) +except ApiException as e: + print("Exception when calling SecurityPolicyApi->update_metrics_policy: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**MetricsPolicyWriteModel**](MetricsPolicyWriteModel.md)| Example Body: <pre>{ \"policyRules\": [{ \"name\": \"Policy rule1 name\", \"description\": \"Policy rule1 description\", \"prefixes\": [\"revenue.*\"], \"tags\": [{\"key\":\"sensitive\", \"value\":\"false\"}, {\"key\":\"source\", \"value\":\"app1\"}], \"tagsAnded\": \"true\", \"accessType\": \"ALLOW\", \"accounts\": [\"accountId1\", \"accountId2\"], \"userGroups\": [\"userGroupId1\"], \"roles\": [\"roleId\"] }, { \"name\": \"Policy rule2 name\", \"description\": \"Policy rule2 description\", \"prefixes\": [\"revenue.*\"], \"accessType\": \"BLOCK\", \"accounts\": [\"accountId3\"], \"userGroups\": [\"userGroupId1\"] }] }</pre> | [optional] + +### Return type + +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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/setup.py b/setup.py index bfa58be..ff4510e 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "wavefront-api-client" -VERSION = "2.203.2" +VERSION = "2.210.2" # To install the library, run the following # # python setup.py install diff --git a/test/test_security_policy_api.py b/test/test_security_policy_api.py new file mode 100644 index 0000000..52a9ec2 --- /dev/null +++ b/test/test_security_policy_api.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + Wavefront REST API Documentation + +

The REST API enables you to interact with the Wavefront service by using standard REST API tools. You can use the REST API to automate commonly executed operations, for example to tag sources automatically.

When you make REST API calls outside the REST API documentation UI, to authenticate to the service, you must use an API token associated with a user account or a service account. For information on how to get the API token and examples, see Use the Wavefront REST API.

# noqa: E501 + + OpenAPI spec version: v2 + Contact: chitimba@wavefront.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import wavefront_api_client +from wavefront_api_client.api.security_policy_api import SecurityPolicyApi # noqa: E501 +from wavefront_api_client.rest import ApiException + + +class TestSecurityPolicyApi(unittest.TestCase): + """SecurityPolicyApi unit test stubs""" + + def setUp(self): + self.api = wavefront_api_client.api.security_policy_api.SecurityPolicyApi() # noqa: E501 + + def tearDown(self): + pass + + def test_get_metrics_policy(self): + """Test case for get_metrics_policy + + Get the metrics policy # noqa: E501 + """ + pass + + def test_get_metrics_policy_by_version(self): + """Test case for get_metrics_policy_by_version + + Get a specific historical version of a metrics policy # noqa: E501 + """ + pass + + def test_get_metrics_policy_history(self): + """Test case for get_metrics_policy_history + + Get the version history of metrics policy # noqa: E501 + """ + pass + + def test_revert_metrics_policy_by_version(self): + """Test case for revert_metrics_policy_by_version + + Revert to a specific historical version of a metrics policy # noqa: E501 + """ + pass + + def test_update_metrics_policy(self): + """Test case for update_metrics_policy + + Update the metrics policy # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/wavefront_api_client/__init__.py b/wavefront_api_client/__init__.py index 13e0c43..033444f 100644 --- a/wavefront_api_client/__init__.py +++ b/wavefront_api_client/__init__.py @@ -31,7 +31,6 @@ from wavefront_api_client.api.maintenance_window_api import MaintenanceWindowApi from wavefront_api_client.api.message_api import MessageApi from wavefront_api_client.api.metric_api import MetricApi -from wavefront_api_client.api.metrics_policy_api import MetricsPolicyApi from wavefront_api_client.api.monitored_application_api import MonitoredApplicationApi from wavefront_api_client.api.monitored_service_api import MonitoredServiceApi from wavefront_api_client.api.notificant_api import NotificantApi @@ -46,6 +45,7 @@ from wavefront_api_client.api.saved_traces_search_api import SavedTracesSearchApi from wavefront_api_client.api.saved_traces_search_group_api import SavedTracesSearchGroupApi from wavefront_api_client.api.search_api import SearchApi +from wavefront_api_client.api.security_policy_api import SecurityPolicyApi from wavefront_api_client.api.source_api import SourceApi from wavefront_api_client.api.span_sampling_policy_api import SpanSamplingPolicyApi from wavefront_api_client.api.usage_api import UsageApi diff --git a/wavefront_api_client/api/__init__.py b/wavefront_api_client/api/__init__.py index f043315..21b30d0 100644 --- a/wavefront_api_client/api/__init__.py +++ b/wavefront_api_client/api/__init__.py @@ -18,7 +18,6 @@ from wavefront_api_client.api.maintenance_window_api import MaintenanceWindowApi from wavefront_api_client.api.message_api import MessageApi from wavefront_api_client.api.metric_api import MetricApi -from wavefront_api_client.api.metrics_policy_api import MetricsPolicyApi from wavefront_api_client.api.monitored_application_api import MonitoredApplicationApi from wavefront_api_client.api.monitored_service_api import MonitoredServiceApi from wavefront_api_client.api.notificant_api import NotificantApi @@ -33,6 +32,7 @@ from wavefront_api_client.api.saved_traces_search_api import SavedTracesSearchApi from wavefront_api_client.api.saved_traces_search_group_api import SavedTracesSearchGroupApi from wavefront_api_client.api.search_api import SearchApi +from wavefront_api_client.api.security_policy_api import SecurityPolicyApi from wavefront_api_client.api.source_api import SourceApi from wavefront_api_client.api.span_sampling_policy_api import SpanSamplingPolicyApi from wavefront_api_client.api.usage_api import UsageApi diff --git a/wavefront_api_client/api/security_policy_api.py b/wavefront_api_client/api/security_policy_api.py new file mode 100644 index 0000000..331e4e3 --- /dev/null +++ b/wavefront_api_client/api/security_policy_api.py @@ -0,0 +1,517 @@ +# coding: utf-8 + +""" + Wavefront REST API Documentation + +

The REST API enables you to interact with the Wavefront service by using standard REST API tools. You can use the REST API to automate commonly executed operations, for example to tag sources automatically.

When you make REST API calls outside the REST API documentation UI, to authenticate to the service, you must use an API token associated with a user account or a service account. For information on how to get the API token and examples, see Use the Wavefront REST API.

# noqa: E501 + + OpenAPI spec version: v2 + Contact: chitimba@wavefront.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from wavefront_api_client.api_client import ApiClient + + +class SecurityPolicyApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_metrics_policy(self, **kwargs): # noqa: E501 + """Get the metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_metrics_policy_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_metrics_policy_with_http_info(**kwargs) # noqa: E501 + return data + + def get_metrics_policy_with_http_info(self, **kwargs): # noqa: E501 + """Get the metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_metrics_policy" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/metricspolicy', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerMetricsPolicyReadModel', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_metrics_policy_by_version(self, version, **kwargs): # noqa: E501 + """Get a specific historical version of a metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy_by_version(version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int version: (required) + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_metrics_policy_by_version_with_http_info(version, **kwargs) # noqa: E501 + else: + (data) = self.get_metrics_policy_by_version_with_http_info(version, **kwargs) # noqa: E501 + return data + + def get_metrics_policy_by_version_with_http_info(self, version, **kwargs): # noqa: E501 + """Get a specific historical version of a metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy_by_version_with_http_info(version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int version: (required) + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_metrics_policy_by_version" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and ('version' not in params or + params['version'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `version` when calling `get_metrics_policy_by_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/metricspolicy/history/{version}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerMetricsPolicyReadModel', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_metrics_policy_history(self, **kwargs): # noqa: E501 + """Get the version history of metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy_history(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int offset: + :param int limit: + :return: ResponseContainerHistoryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_metrics_policy_history_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_metrics_policy_history_with_http_info(**kwargs) # noqa: E501 + return data + + def get_metrics_policy_history_with_http_info(self, **kwargs): # noqa: E501 + """Get the version history of metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_metrics_policy_history_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int offset: + :param int limit: + :return: ResponseContainerHistoryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['offset', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_metrics_policy_history" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/metricspolicy/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerHistoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def revert_metrics_policy_by_version(self, version, **kwargs): # noqa: E501 + """Revert to a specific historical version of a metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.revert_metrics_policy_by_version(version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int version: (required) + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.revert_metrics_policy_by_version_with_http_info(version, **kwargs) # noqa: E501 + else: + (data) = self.revert_metrics_policy_by_version_with_http_info(version, **kwargs) # noqa: E501 + return data + + def revert_metrics_policy_by_version_with_http_info(self, version, **kwargs): # noqa: E501 + """Revert to a specific historical version of a metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.revert_metrics_policy_by_version_with_http_info(version, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int version: (required) + :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['version'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method revert_metrics_policy_by_version" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'version' is set + if self.api_client.client_side_validation and ('version' not in params or + params['version'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `version` when calling `revert_metrics_policy_by_version`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'version' in params: + path_params['version'] = params['version'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/metricspolicy/revert/{version}', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerMetricsPolicyReadModel', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_metrics_policy(self, **kwargs): # noqa: E501 + """Update the metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_metrics_policy(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param MetricsPolicyWriteModel body: Example Body:
{ \"policyRules\": [{   \"name\": \"Policy rule1 name\",   \"description\": \"Policy rule1 description\",   \"prefixes\": [\"revenue.*\"],   \"tags\": [{\"key\":\"sensitive\",  \"value\":\"false\"},              {\"key\":\"source\",  \"value\":\"app1\"}],   \"tagsAnded\": \"true\",   \"accessType\": \"ALLOW\",   \"accounts\": [\"accountId1\", \"accountId2\"],   \"userGroups\": [\"userGroupId1\"],   \"roles\": [\"roleId\"] }, {   \"name\": \"Policy rule2 name\",   \"description\": \"Policy rule2 description\",   \"prefixes\": [\"revenue.*\"],   \"accessType\": \"BLOCK\",   \"accounts\": [\"accountId3\"],   \"userGroups\": [\"userGroupId1\"] }] }
+ :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_metrics_policy_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.update_metrics_policy_with_http_info(**kwargs) # noqa: E501 + return data + + def update_metrics_policy_with_http_info(self, **kwargs): # noqa: E501 + """Update the metrics policy # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_metrics_policy_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param MetricsPolicyWriteModel body: Example Body:
{ \"policyRules\": [{   \"name\": \"Policy rule1 name\",   \"description\": \"Policy rule1 description\",   \"prefixes\": [\"revenue.*\"],   \"tags\": [{\"key\":\"sensitive\",  \"value\":\"false\"},              {\"key\":\"source\",  \"value\":\"app1\"}],   \"tagsAnded\": \"true\",   \"accessType\": \"ALLOW\",   \"accounts\": [\"accountId1\", \"accountId2\"],   \"userGroups\": [\"userGroupId1\"],   \"roles\": [\"roleId\"] }, {   \"name\": \"Policy rule2 name\",   \"description\": \"Policy rule2 description\",   \"prefixes\": [\"revenue.*\"],   \"accessType\": \"BLOCK\",   \"accounts\": [\"accountId3\"],   \"userGroups\": [\"userGroupId1\"] }] }
+ :return: ResponseContainerMetricsPolicyReadModel + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_metrics_policy" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/metricspolicy', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerMetricsPolicyReadModel', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/wavefront_api_client/api_client.py b/wavefront_api_client/api_client.py index b4452c4..eb5df00 100644 --- a/wavefront_api_client/api_client.py +++ b/wavefront_api_client/api_client.py @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/2.203.2/python' + self.user_agent = 'Swagger-Codegen/2.210.2/python' self.client_side_validation = configuration.client_side_validation def __del__(self): diff --git a/wavefront_api_client/configuration.py b/wavefront_api_client/configuration.py index 06302bb..27a8fa2 100644 --- a/wavefront_api_client/configuration.py +++ b/wavefront_api_client/configuration.py @@ -251,5 +251,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v2\n"\ - "SDK Package Version: 2.203.2".\ + "SDK Package Version: 2.210.2".\ format(env=sys.platform, pyversion=sys.version)