def edit_service(self, loadbal_id, service_id, ip_address_id=None,
                     port=None, enabled=None, hc_type=None, weight=None):
        """Edits an existing service properties.

        :param int loadbal_id: The id of the loadbal where the service resides
        :param int service_id: The id of the service to edit
        :param string ip_address: The ip address of the service
        :param int port: the port of the service
        :param bool enabled: enable or disable the search
        :param int hc_type: The health check type
        :param int weight: the weight to give to the service
        """

        _filter = {
            'virtualServers': {
                'serviceGroups': {
                    'services': {'id': utils.query_filter(service_id)}}}}

        mask = 'serviceGroups[services[groupReferences,healthChecks]]'

        virtual_servers = self.lb_svc.getVirtualServers(id=loadbal_id,
                                                        filter=_filter,
                                                        mask=mask)

        for service in virtual_servers[0]['serviceGroups'][0]['services']:
            if service['id'] == service_id:
                if enabled is not None:
                    service['enabled'] = int(enabled)
                if port is not None:
                    service['port'] = port
                if weight is not None:
                    service['groupReferences'][0]['weight'] = weight
                if hc_type is not None:
                    service['healthChecks'][0]['healthCheckTypeId'] = hc_type
                if ip_address_id is not None:
                    service['ipAddressId'] = ip_address_id

        template = {'virtualServers': list(virtual_servers)}

        load_balancer = self.lb_svc.editObject(template, id=loadbal_id)
        return load_balancer
Edits an existing service properties.

        :param int loadbal_id: The id of the loadbal where the service resides
        :param int service_id: The id of the service to edit
        :param string ip_address: The ip address of the service
        :param int port: the port of the service
        :param bool enabled: enable or disable the search
        :param int hc_type: The health check type
        :param int weight: the weight to give to the service