# 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
# class Port(base.BaseV30):
# 
#     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": {
#                 "stats-data-action": stats_data_action,
#                 "weight": weight,
#                 "port-number": port,
#                 "range": range,
#                 "action": action,
#                 "protocol": protocol
#             }
#         }
# 
#         if conn_resume:
#             params['port']['conn-resume'] = conn_resume
# 
#         if conn_limit:
#             params['port']['conn-limit'] = conn_limit
# 
#         return params


from acos_client.v30 import base
from acos_client.v30.slb.port import Port
               conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._post(self.url_prefix, params, max_retries=max_retries, timeout=timeout,
                          axapi_args=kwargs)

    def update(self, name, ip_address, status=1, server_templates=None,
               port_list=None, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._post(self.url_prefix + name, params, max_retries=max_retries, timeout=timeout,
                          axapi_args=kwargs)

    def replace(self, name, ip_address, status=1, server_templates=None,
                port_list=None, max_retries=None, timeout=None,
                conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._put(self.url_prefix + name, params, max_retries=max_retries, timeout=timeout,
                         axapi_args=kwargs)

    def delete(self, name):
        return self._delete(self.url_prefix + name)

    @property
    def port(self):

# 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
# class Port(base.BaseV30):
# 
#     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": {
#                 "stats-data-action": stats_data_action,
#                 "weight": weight,
#                 "port-number": port,
#                 "range": range,
#                 "action": action,
#                 "protocol": protocol
#             }
#         }
# 
#         if conn_resume:
#             params['port']['conn-resume'] = conn_resume
# 
#         if conn_limit:
#             params['port']['conn-limit'] = conn_limit
# 
#         return params


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

               conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._post(self.url_prefix, params, max_retries=max_retries, timeout=timeout,
                          axapi_args=kwargs)

    def update(self, name, ip_address, status=1, server_templates=None,
               port_list=None, max_retries=None, timeout=None,
               conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._post(self.url_prefix + name, params, max_retries=max_retries, timeout=timeout,
                          axapi_args=kwargs)

    def replace(self, name, ip_address, status=1, server_templates=None,
                port_list=None, max_retries=None, timeout=None,
                conn_resume=None, conn_limit=None, health_check=None, **kwargs):
        params = self._set(name, ip_address, status=status, port_list=port_list,
                           conn_resume=conn_resume, conn_limit=conn_limit, health_check=health_check,
                           server_templates=server_templates, **kwargs)
        return self._put(self.url_prefix + name, params, max_retries=max_retries, timeout=timeout,
                         axapi_args=kwargs)

    def delete(self, name):
        return self._delete(self.url_prefix + name)

    @property
    def port(self):

        return Port(self.client)