From 986e3cd0412895bd4f8612f98f373745bfdaa1d5 Mon Sep 17 00:00:00 2001 From: "Marcus Vinicius G. Cesario" Date: Tue, 30 Jan 2018 18:44:17 -0200 Subject: [PATCH] Delete v2 methods: ClientFactory.ApiVipRequest.get_by_pk ClientFactory.ApiVipRequest.save ClientFactory.ApiVipRequest.add_pools ClientFactory.ApiVipRequest.delete_vip --- networkapiclient/ApiVipRequest.py | 174 ------------------------------ networkapiclient/__init__.py | 2 +- requirements.txt | 1 + 3 files changed, 2 insertions(+), 175 deletions(-) diff --git a/networkapiclient/ApiVipRequest.py b/networkapiclient/ApiVipRequest.py index f107e32..6dc389d 100644 --- a/networkapiclient/ApiVipRequest.py +++ b/networkapiclient/ApiVipRequest.py @@ -36,31 +36,6 @@ def __init__(self, networkapi_url, user, password, user_ldap=None, log_level='IN log_level ) - def add_pools(self, vip_request_id, pool_ids): - """ - """ - - uri = 'api/vip/request/add/pools/' - - data = dict() - - data['vip_request_id'] = vip_request_id - data['pool_ids'] = pool_ids - - return super(ApiVipRequest, self).post(uri, data=data) - - def delete_vip(self, ids, delete_pools=True): - """ - """ - - uri = 'api/vip/request/delete/%s/' % (delete_pools) - - data = dict() - - data['ids'] = ids - - return super(ApiVipRequest, self).post(uri, data=data) - def list_environment_by_environmet_vip(self, environment_vip_id): """ """ @@ -70,155 +45,6 @@ def list_environment_by_environmet_vip(self, environment_vip_id): return super(ApiVipRequest, self).get(uri) - def save(self, id_ipv4, id_ipv6, finality, client, environment, cache, persistence, timeout, - host, areanegocio, nome_servico, l7_filter, vip_ports_to_pools=None, rule_id=None, - pk=None, trafficreturn=None): - """ - Save/Update Request Vip. - :param id_ipv4: int - :param id_ipv6: int - :param finality: str - :param client: str - :param environment: str - :param cache: str - :param persistence: str - :param timeout: str - :param host: str - :param areanegocio: str - :param nome_servico: str - :param l7_filter: str - :param vip_ports_to_pools: list of dict - :param rule_id: int - :param pk: int identifier Id Vip Request. - - :return Following dictionary: - - { - 'id': , - 'ip': , - 'ipv6': , - 'l7_filter': , - 'filter_applied': , - 'filter_rollback': , - 'filter_valid': , - 'applied_l7_datetime': , - 'healthcheck_expect': , - 'rule': , - 'rule_applied': , - 'rule_rollback': , - 'areanegocio': '', - 'nome_servico': '', - 'host': , - 'vip_ports_to_pools': [{ - 'id': , - 'requisicao_vip': , - 'server_pool': , - 'port_vip': - },...], - 'finalidade': , - 'cliente': , - 'ambiente': - } - - :raise EnvironmentVipDoesNotExistException: Environment Vip Does Not Exists - :raise InvalidIdVipRequestException: Invalid Id For Vip Request. - :raise VipRequestDoesNotExistException: Vip Request Does Not Exists. - :raise NetworkAPIException: Fail to Access Data Base. - """ - - data = dict() - - data['ip'] = id_ipv4 - data['ipv6'] = id_ipv6 - data['finalidade'] = finality - data['cliente'] = client - data['ambiente'] = environment - data['cache'] = cache - data['timeout'] = timeout - data['persistencia'] = persistence - data['timeout'] = timeout - data['host'] = host - data['areanegocio'] = areanegocio - data['nome_servico'] = nome_servico - data['l7_filter'] = l7_filter - data['rule'] = rule_id - data['vip_ports_to_pools'] = vip_ports_to_pools - data['trafficreturn'] = trafficreturn - - uri = 'api/vip/request/save/' - - if pk: - uri += '%s/' % pk - return self.put(uri, data=data) - - return super(ApiVipRequest, self).post(uri, data=data) - - def get_by_pk(self, pk): - """ - Get Request Vip by Identifier. - - :param pk: int identifier Vip Request. - - :return: Following dictionary: - - { - 'persistencia': , - 'id': , - 'cache': , - 'ambiente':, - 'cliente': , - 'areanegocio': '' - 'vip_criado': , - 'id_ip': , - 'id_healthcheck_expect': , - 'reals_weights':{'reals_weight': [,...]}, - 'host': , - 'l7_filter': , - 'validado': , - 'reals_prioritys':{'reals_priority':[,...]}, - 'finalidade': , - 'rule_id': , - 'id_ipv6': , - 'nome_servico': '', - 'timeout': , - 'pools':[{ - 'lb_method': , - 'healthcheck': , - 'pool_created': , - 'id': , - 'environment': , - 'port_vip_id': , - 'port_vip': , - 'default_port': , - 'default_limit': , - 'identifier': , - 'server_pool_members':[{ - 'status': , - 'port_real': , - 'weight': , - 'ip':{'ip_formated': }, - 'ipv6': {'ip_formated': }, - 'equipment_name': , - 'id': , - 'priority': , - 'limit': , - 'healthcheck': { - 'healthcheck_type': - }, - 'identifier': '', - 'server_pool': - },...], - },...], - } - - :raise InvalidIdVipRequestException: Invalid Id For Vip Request. - :raise VipRequestDoesNotExistException: Vip Request Does Not Exists. - :raise NetworkAPIException: Fail to Access Data Base. - """ - uri = 'api/vip/request/get/%s/' % pk - - return super(ApiVipRequest, self).get(uri) - ####################### # API V3 ####################### diff --git a/networkapiclient/__init__.py b/networkapiclient/__init__.py index e5fe2b4..b2b4b64 100644 --- a/networkapiclient/__init__.py +++ b/networkapiclient/__init__.py @@ -16,5 +16,5 @@ MAJOR_VERSION = '0' MINOR_VERSION = '8' -PATCH_VERSION = '0' +PATCH_VERSION = '1' VERSION = '.'.join((MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION,)) diff --git a/requirements.txt b/requirements.txt index c9fb7c7..5d1faa8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ requests==2.12.4 +twine