# Path: acos_client/client.py
# VERSION_IMPORTS = {
#     '21': {
#         'DNS': v21_DNS,
#         'http': v21_http,
#         'HA': v21_HA,
#         'Interface': v21_Interface,
#         'LicenseManager': v21_LicenseManager,
#         'Nat': v21_Nat,
#         'Network': v21_Network,
#         'Session': v21_Session,
#         'SFlow': v21_SFlow,
#         'SLB': v21_SLB,
#         'System': v21_System,
#         'Vlan': None,
#         'VRRPA': v21_VRRPA
#     },
#     '30': {
#         'DNS': v30_DNS,
#         'http': v30_http,
#         'Interface': v30_Interface,
#         'HA': v30_HA,
#         'LicenseManager': v30_LicenseManager,
#         'Nat': v30_Nat,
#         'Network': v30_Network,
#         'Overlay': v30_Overlay,
#         'RIB': v30_RIB,
#         'Session': v30_Session,
#         'SFlow': v30_SFlow,
#         'SLB': v30_SLB,
#         'System': v30_System,
#         'File': v30_File,
#         'Vlan': v30_Vlan,
#         'VRRPA': v30_VRRPA,
#         'DeviceContext': v30_DeviceContext,
#         'Flexpool': Flexpool,
#         'Delete': Delete,
#     },
# }
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(
#             self,
#             host,              # ip address or name of the A10 device
#             version,           # either 21 or 30
#             username,          # username to use for authenticating to the A10 device
#             password,          # password to use for authenticating to the A10 device
#             max_retries=3,     # number of times to retry a connection before giving up
#             port=None,         # TCP port to use for connecting to the A10 device
#             protocol="https",  # transport protocol - http or https, encryption recommended
#             timeout=5          # seconds to wait for return data before giving up
#     ):
#     def _just_digits(self, s):
#     def dns(self):
#     def ha(self):
#     def interface(self):
#     def system(self):
#     def slb(self):
#     def network(self):
#     def nat(self):
#     def file(self):
#     def sflow(self):
#     def license_manager(self):
#     def glm(self):
#     def overlay(self):
#     def vlan(self):
#     def route(self):
#     def vrrpa(self):
#     def device_context(self):
#     def delete(self):
#     def wait_for_connect(self, max_timeout=60):


import json
import responses
    import unittest
    import unittest2 as unittest
import acos_client.errors as acos_errors
from acos_client import client
                'arp-disable': 1,
                'vrid': 1,
                'template-virtual-server': 'TEST_VIP_TEMPLATE',
                'template-logging': 'template_lg',
                'template-policy': None,
                'template-scaleout': None,
                'description': None,
            }
        }

        resp = self.client.slb.virtual_server.replace(
            name='test',
            ip_address='192.168.2.254',
            arp_disable=1,
            vrid=1,
            virtual_server_templates={'template-logging': 'template_lg'}, template_virtual_server='TEST_VIP_TEMPLATE',
        )

        self.assertEqual(resp, json_response)
        self.assertEqual(len(responses.calls), 2)
        self.assertEqual(responses.calls[1].request.method, responses.PUT)
        self.assertEqual(responses.calls[1].request.url, OBJECT_URL)
        self.assertEqual(json.loads(responses.calls[1].request.body), params)

    @responses.activate
    def test_virtual_server_delete(self):
        responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
        json_response = {"foo": "bar"}
        responses.add(responses.DELETE, OBJECT_URL, json=json_response, status=200)


# Path: acos_client/client.py
# VERSION_IMPORTS = {
#     '21': {
#         'DNS': v21_DNS,
#         'http': v21_http,
#         'HA': v21_HA,
#         'Interface': v21_Interface,
#         'LicenseManager': v21_LicenseManager,
#         'Nat': v21_Nat,
#         'Network': v21_Network,
#         'Session': v21_Session,
#         'SFlow': v21_SFlow,
#         'SLB': v21_SLB,
#         'System': v21_System,
#         'Vlan': None,
#         'VRRPA': v21_VRRPA
#     },
#     '30': {
#         'DNS': v30_DNS,
#         'http': v30_http,
#         'Interface': v30_Interface,
#         'HA': v30_HA,
#         'LicenseManager': v30_LicenseManager,
#         'Nat': v30_Nat,
#         'Network': v30_Network,
#         'Overlay': v30_Overlay,
#         'RIB': v30_RIB,
#         'Session': v30_Session,
#         'SFlow': v30_SFlow,
#         'SLB': v30_SLB,
#         'System': v30_System,
#         'File': v30_File,
#         'Vlan': v30_Vlan,
#         'VRRPA': v30_VRRPA,
#         'DeviceContext': v30_DeviceContext,
#         'Flexpool': Flexpool,
#         'Delete': Delete,
#     },
# }
# LOG = logging.getLogger(__name__)
# class Client(object):
#     def __init__(
#             self,
#             host,              # ip address or name of the A10 device
#             version,           # either 21 or 30
#             username,          # username to use for authenticating to the A10 device
#             password,          # password to use for authenticating to the A10 device
#             max_retries=3,     # number of times to retry a connection before giving up
#             port=None,         # TCP port to use for connecting to the A10 device
#             protocol="https",  # transport protocol - http or https, encryption recommended
#             timeout=5          # seconds to wait for return data before giving up
#     ):
#     def _just_digits(self, s):
#     def dns(self):
#     def ha(self):
#     def interface(self):
#     def system(self):
#     def slb(self):
#     def network(self):
#     def nat(self):
#     def file(self):
#     def sflow(self):
#     def license_manager(self):
#     def glm(self):
#     def overlay(self):
#     def vlan(self):
#     def route(self):
#     def vrrpa(self):
#     def device_context(self):
#     def delete(self):
#     def wait_for_connect(self, max_timeout=60):


# Path: acos_client/tests/unit/v30/test_slb_virtual_server.py
import json
import responses
    import unittest
    import unittest2 as unittest
import acos_client.errors as acos_errors
from acos_client import client

                'arp-disable': 1,
                'vrid': 1,
                'template-virtual-server': 'TEST_VIP_TEMPLATE',
                'template-logging': 'template_lg',
                'template-policy': None,
                'template-scaleout': None,
                'description': None,
            }
        }

        resp = self.client.slb.virtual_server.replace(
            name='test',
            ip_address='192.168.2.254',
            arp_disable=1,
            vrid=1,
            virtual_server_templates={'template-logging': 'template_lg'}, template_virtual_server='TEST_VIP_TEMPLATE',
        )

        self.assertEqual(resp, json_response)
        self.assertEqual(len(responses.calls), 2)
        self.assertEqual(responses.calls[1].request.method, responses.PUT)
        self.assertEqual(responses.calls[1].request.url, OBJECT_URL)
        self.assertEqual(json.loads(responses.calls[1].request.body), params)

    @responses.activate
    def test_virtual_server_delete(self):
        responses.add(responses.POST, AUTH_URL, json={'session_id': 'foobar'})
        json_response = {"foo": "bar"}
        responses.add(responses.DELETE, OBJECT_URL, json=json_response, status=200)


        resp = self.client.slb.virtual_server.delete('test')