Source code for ntnx_networking_py_client.api.ipfix_exporter_api

# coding: utf-8


"""
IGNORE:
    Nutanix Networking Versioned APIs

    Manage networking configuration on Nutanix clusters, including AHV and advanced networking.  # noqa: E501

    OpenAPI spec version: 4.0.1-alpha-1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
IGNORE
"""
from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from ntnx_networking_py_client.api_client import ApiClient


[docs]class IPFIXExporterApi(object): """IGNORE: NOTE: A placeholder for class level description IGNORE """ # noqa: E501 def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client self.__headers_to_skip = { 'authorization', 'cookie', 'ntnx-request-id', 'host', 'user-agent' }
[docs] def create_ipfix_exporter(self, body, **kwargs): # noqa: E501 """Create an IPFIX Exporter. >>> response = api.create_ipfix_exporter(body) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True. >>> thread = api.create_ipfix_exporter(body, async_req=True) >>> result = thread.get() :param body: Request schema to create the IPFIX exporter. :type body: :class:`~ntnx_networking_py_client.models.networking.v4.config.IPFIXExporter`, required :param kwargs: kwargs for the method. The following can be passed for an asynchronous HTTP call:: async_req=True :return: An instance of class :class:`~ntnx_networking_py_client.models.networking.v4.config.TaskReferenceApiResponse`. If the method is called asynchronously, returns the request thread. """ # noqa: E501 kwargs['_return_http_data_only'] = True params = locals() for key, val in six.iteritems(params['kwargs']): params[key] = val del params['kwargs'] del params['self'] # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_ipfix_exporter`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} # 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 # Process operation specific headers extra_params = [] extra_params.append('async_req') extra_params.append('_return_http_data_only') extra_params.append('_preload_content') extra_params.append('_request_timeout') all_params = set(['body']) all_params.update(extra_params) for key, val in six.iteritems(params): if val is not None and key.lower() not in self.__headers_to_skip and key not in all_params: if key.lower() == 'if_match'.lower(): key = 'If-Match' elif key.lower() == 'if_none_match'.lower(): key = 'If-None-Match' header_params[key] = val form_params = [] local_var_files = {} body_params = None if 'body' in params and params['body'] is not None: body_params = params['body'] # Authentication setting auth_settings = ['basicAuthScheme'] # noqa: E501 if kwargs.get('async_req'): return self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) else: (data) = self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) return data
[docs] def delete_ipfix_exporter(self, extId, **kwargs): # noqa: E501 """Delete the specified IPFIX Exporter. >>> response = api.delete_ipfix_exporter(extId) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True. >>> thread = api.delete_ipfix_exporter(extId, async_req=True) >>> result = thread.get() :param extId: UUID of IPFIX exporter. :type extId: :class:`str`, required :param kwargs: kwargs for the method. The following can be passed for an asynchronous HTTP call:: async_req=True :return: An instance of class :class:`~ntnx_networking_py_client.models.networking.v4.config.TaskReferenceApiResponse`. If the method is called asynchronously, returns the request thread. """ # noqa: E501 kwargs['_return_http_data_only'] = True params = locals() for key, val in six.iteritems(params['kwargs']): params[key] = val del params['kwargs'] del params['self'] # verify the required parameter 'extId' is set if ('extId' not in params or params['extId'] is None): raise ValueError("Missing the required parameter `extId` when calling `delete_ipfix_exporter`") # noqa: E501 collection_formats = {} path_params = {} if 'extId' in params and params['extId'] is not None: path_params['extId'] = params['extId'] # noqa: E501 query_params = [] header_params = {} # HTTP header `Accept` header_params['Accept'] = self.api_client._select_header_accept( ['application/json']) # noqa: E501 # Process operation specific headers extra_params = [] extra_params.append('async_req') extra_params.append('_return_http_data_only') extra_params.append('_preload_content') extra_params.append('_request_timeout') all_params = set(['extId']) all_params.update(extra_params) for key, val in six.iteritems(params): if val is not None and key.lower() not in self.__headers_to_skip and key not in all_params: if key.lower() == 'if_match'.lower(): key = 'If-Match' elif key.lower() == 'if_none_match'.lower(): key = 'If-None-Match' header_params[key] = val form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuthScheme'] # noqa: E501 if kwargs.get('async_req'): return self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) else: (data) = self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) return data
[docs] def get_ipfix_exporter(self, extId, **kwargs): # noqa: E501 """Get the specified IPFIX Exporter. >>> response = api.get_ipfix_exporter(extId) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True. >>> thread = api.get_ipfix_exporter(extId, async_req=True) >>> result = thread.get() :param extId: UUID of IPFIX exporter. :type extId: :class:`str`, required :param kwargs: kwargs for the method. The following can be passed for an asynchronous HTTP call:: async_req=True :return: An instance of class :class:`~ntnx_networking_py_client.models.networking.v4.config.IPFIXExporterApiResponse`. If the method is called asynchronously, returns the request thread. """ # noqa: E501 kwargs['_return_http_data_only'] = True params = locals() for key, val in six.iteritems(params['kwargs']): params[key] = val del params['kwargs'] del params['self'] # verify the required parameter 'extId' is set if ('extId' not in params or params['extId'] is None): raise ValueError("Missing the required parameter `extId` when calling `get_ipfix_exporter`") # noqa: E501 collection_formats = {} path_params = {} if 'extId' in params and params['extId'] is not None: path_params['extId'] = params['extId'] # noqa: E501 query_params = [] header_params = {} # HTTP header `Accept` header_params['Accept'] = self.api_client._select_header_accept( ['application/json']) # noqa: E501 # Process operation specific headers extra_params = [] extra_params.append('async_req') extra_params.append('_return_http_data_only') extra_params.append('_preload_content') extra_params.append('_request_timeout') all_params = set(['extId']) all_params.update(extra_params) for key, val in six.iteritems(params): if val is not None and key.lower() not in self.__headers_to_skip and key not in all_params: if key.lower() == 'if_match'.lower(): key = 'If-Match' elif key.lower() == 'if_none_match'.lower(): key = 'If-None-Match' header_params[key] = val form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuthScheme'] # noqa: E501 if kwargs.get('async_req'): return self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.IPFIXExporterApiResponse', # 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) else: (data) = self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.IPFIXExporterApiResponse', # 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) return data
[docs] def list_ipfix_exporters(self, **kwargs): # noqa: E501 """Get the list of existing IPFIX Exporters. >>> response = api.list_ipfix_exporters() This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True. >>> thread = api.list_ipfix_exporters(async_req=True) >>> result = thread.get() :param kwargs: kwargs for the method. The following can be passed for an asynchronous HTTP call:: async_req=True :return: An instance of class :class:`~ntnx_networking_py_client.models.networking.v4.config.IPFIXExporterListApiResponse`. If the method is called asynchronously, returns the request thread. """ # noqa: E501 kwargs['_return_http_data_only'] = True params = locals() for key, val in six.iteritems(params['kwargs']): params[key] = val del params['kwargs'] del params['self'] collection_formats = {} path_params = {} query_params = [] header_params = {} # HTTP header `Accept` header_params['Accept'] = self.api_client._select_header_accept( ['application/json']) # noqa: E501 # Process operation specific headers extra_params = [] extra_params.append('async_req') extra_params.append('_return_http_data_only') extra_params.append('_preload_content') extra_params.append('_request_timeout') all_params = set([]) all_params.update(extra_params) for key, val in six.iteritems(params): if val is not None and key.lower() not in self.__headers_to_skip and key not in all_params: if key.lower() == 'if_match'.lower(): key = 'If-Match' elif key.lower() == 'if_none_match'.lower(): key = 'If-None-Match' header_params[key] = val form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = ['basicAuthScheme'] # noqa: E501 if kwargs.get('async_req'): return self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.IPFIXExporterListApiResponse', # 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) else: (data) = self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.IPFIXExporterListApiResponse', # 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) return data
[docs] def update_ipfix_exporter(self, extId, body, **kwargs): # noqa: E501 """Update the specified IPFIX Exporter. >>> response = api.update_ipfix_exporter(extId, body) This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True. >>> thread = api.update_ipfix_exporter(extId, body, async_req=True) >>> result = thread.get() :param extId: UUID of IPFIX exporter. :type extId: :class:`str`, required :param body: Request schema to update the specified IPFIX exporter. :type body: :class:`~ntnx_networking_py_client.models.networking.v4.config.IPFIXExporter`, required :param kwargs: kwargs for the method. The following can be passed for an asynchronous HTTP call:: async_req=True :return: An instance of class :class:`~ntnx_networking_py_client.models.networking.v4.config.TaskReferenceApiResponse`. If the method is called asynchronously, returns the request thread. """ # noqa: E501 kwargs['_return_http_data_only'] = True params = locals() for key, val in six.iteritems(params['kwargs']): params[key] = val del params['kwargs'] del params['self'] # verify the required parameter 'extId' is set if ('extId' not in params or params['extId'] is None): raise ValueError("Missing the required parameter `extId` when calling `update_ipfix_exporter`") # noqa: E501 # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `update_ipfix_exporter`") # noqa: E501 collection_formats = {} path_params = {} if 'extId' in params and params['extId'] is not None: path_params['extId'] = params['extId'] # noqa: E501 query_params = [] header_params = {} # 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 # Process operation specific headers extra_params = [] extra_params.append('async_req') extra_params.append('_return_http_data_only') extra_params.append('_preload_content') extra_params.append('_request_timeout') all_params = set(['extId', 'body']) all_params.update(extra_params) for key, val in six.iteritems(params): if val is not None and key.lower() not in self.__headers_to_skip and key not in all_params: if key.lower() == 'if_match'.lower(): key = 'If-Match' elif key.lower() == 'if_none_match'.lower(): key = 'If-None-Match' header_params[key] = val form_params = [] local_var_files = {} body_params = None if 'body' in params and params['body'] is not None: body_params = params['body'] # Authentication setting auth_settings = ['basicAuthScheme'] # noqa: E501 if kwargs.get('async_req'): return self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) else: (data) = self.api_client._call_api( '/api/networking/v4.0.a1/config/ipfix-exporters/{extId}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='networking.v4.config.TaskReferenceApiResponse', # 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) return data