# Path: acos_client/v30/base.py
# class BaseV30(object):
#     def __init__(self, client):
#     def minimal_dict(self, my_dict, exclude=[]):
#     def url(self, action):
#     def _request(self, method, action, params, retry_count=0, max_retries=None,
#                  timeout=None, axapi_args=None, **kwargs):
#     def _get(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _post(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _put(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _delete(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _is_ipv6(self, ip_address):


from acos_client.v30 import base
    url_base_tmpl = "/slb/server/{server}/port/"
    url_port_tmpl = "{port}+{protocol}/"

    def create(self, server_name, port, protocol, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
               weight=1, range=0, action="enable", **kwargs):
        url = self.url_base_tmpl.format(server=server_name)
        params = self._set(server_name, port, protocol, conn_resume=conn_resume, conn_limit=conn_limit,
                           stats_data_action=stats_data_action, weight=weight, range=range, action=action)
        return self._post(url, params, max_retries=max_retries, timeout=timeout, axapi_args=kwargs)

    def update(self, server_name, port, protocol, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
               weight=1, range=0, action="enable", **kwargs):
        url = self.url_base_tmpl.format(server=server_name)
        url += self.url_port_tmpl.format(port=port, protocol=protocol)
        params = self._set(server_name, port, protocol, conn_resume=conn_resume, conn_limit=conn_limit,
                           stats_data_action=stats_data_action, weight=weight, range=range, action=action)
        return self._put(url, params, max_retries=max_retries, timeout=timeout, axapi_args=kwargs)

    def delete(self, server_name, port, protocol, **kwargs):
        url = (self.url_base_tmpl + self.url_port_tmpl).format(server=server_name,
                                                               port=port,
                                                               protocol=protocol)

        return self._delete(url)

    def _set(self, server_name, port, protocol, conn_resume=None, conn_limit=None,
             stats_data_action="stats-data-enable", weight=1, range=0, action="enable"):
        params = {

# Path: acos_client/v30/base.py
# class BaseV30(object):
#     def __init__(self, client):
#     def minimal_dict(self, my_dict, exclude=[]):
#     def url(self, action):
#     def _request(self, method, action, params, retry_count=0, max_retries=None,
#                  timeout=None, axapi_args=None, **kwargs):
#     def _get(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _post(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _put(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _delete(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _is_ipv6(self, ip_address):


# Path: acos_client/v30/slb/port.py
from acos_client.v30 import base

    url_base_tmpl = "/slb/server/{server}/port/"
    url_port_tmpl = "{port}+{protocol}/"

    def create(self, server_name, port, protocol, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
               weight=1, range=0, action="enable", **kwargs):
        url = self.url_base_tmpl.format(server=server_name)
        params = self._set(server_name, port, protocol, conn_resume=conn_resume, conn_limit=conn_limit,
                           stats_data_action=stats_data_action, weight=weight, range=range, action=action)
        return self._post(url, params, max_retries=max_retries, timeout=timeout, axapi_args=kwargs)

    def update(self, server_name, port, protocol, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
               weight=1, range=0, action="enable", **kwargs):
        url = self.url_base_tmpl.format(server=server_name)
        url += self.url_port_tmpl.format(port=port, protocol=protocol)
        params = self._set(server_name, port, protocol, conn_resume=conn_resume, conn_limit=conn_limit,
                           stats_data_action=stats_data_action, weight=weight, range=range, action=action)
        return self._put(url, params, max_retries=max_retries, timeout=timeout, axapi_args=kwargs)

    def delete(self, server_name, port, protocol, **kwargs):
        url = (self.url_base_tmpl + self.url_port_tmpl).format(server=server_name,
                                                               port=port,
                                                               protocol=protocol)

        return self._delete(url)

    def _set(self, server_name, port, protocol, conn_resume=None, conn_limit=None,
             stats_data_action="stats-data-enable", weight=1, range=0, action="enable"):
        params = {

            "port": {