# Path: opennsa/shared/xmlhelper.py
# class UTC(datetime.tzinfo):
#     def utcoffset(self, dt):
#     def dst(self, dt):
#     def tzname(self, dt):
# def createXMLTime(timestamp):
# def parseXMLTimestamp(xsd_timestamp):
# 
# Path: opennsa/shared/modifiableresource.py
# RFC850_FORMAT       = '%a, %d %b %Y %H:%M:%S GMT'
# CONTENT_TYPE        = 'Content-type'
# LAST_MODIFIED       = 'Last-modified'
# IF_MODIFIED_SINCE   = 'if-modified-since'
# class ModifiableResource(resource.Resource):
#     def __init__(self, log_system, mime_type=None):
#     def updateResource(self, representation, update_time=None):
#     def render_GET(self, request):


from xml.etree import ElementTree as ET
from opennsa.shared import xmlhelper, modifiableresource
from opennsa.discovery.bindings import discovery

        # if we have multiple networks, we get the provider urn multiple times
        peers_with = set(self.provider_registry.provider_urns.values())

        try:
            peers_with.remove(self.nsa_id)
        except ValueError:
            pass # running in aggregator-only mode

        nsa_element = discovery.NsaType(
            self.nsa_id,
            xmlhelper.createXMLTime(self.version),
            None,
            self.name,
            self.software_version,
            xmlhelper.createXMLTime(self.start_time),
            self.network_ids,
            interface_types,
            feature_types,
            peers_with,
            None,
           )

        e = nsa_element.xml(discovery.nsa)
        payload = ET.tostring(e, 'utf-8')
        return payload


    def resource(self):


# Path: opennsa/shared/xmlhelper.py
# class UTC(datetime.tzinfo):
#     def utcoffset(self, dt):
#     def dst(self, dt):
#     def tzname(self, dt):
# def createXMLTime(timestamp):
# def parseXMLTimestamp(xsd_timestamp):
# 
# Path: opennsa/shared/modifiableresource.py
# RFC850_FORMAT       = '%a, %d %b %Y %H:%M:%S GMT'
# CONTENT_TYPE        = 'Content-type'
# LAST_MODIFIED       = 'Last-modified'
# IF_MODIFIED_SINCE   = 'if-modified-since'
# class ModifiableResource(resource.Resource):
#     def __init__(self, log_system, mime_type=None):
#     def updateResource(self, representation, update_time=None):
#     def render_GET(self, request):


# Path: opennsa/discovery/service.py
from xml.etree import ElementTree as ET
from opennsa.shared import xmlhelper, modifiableresource
from opennsa.discovery.bindings import discovery


        # if we have multiple networks, we get the provider urn multiple times
        peers_with = set(self.provider_registry.provider_urns.values())

        try:
            peers_with.remove(self.nsa_id)
        except ValueError:
            pass # running in aggregator-only mode

        nsa_element = discovery.NsaType(
            self.nsa_id,
            xmlhelper.createXMLTime(self.version),
            None,
            self.name,
            self.software_version,
            xmlhelper.createXMLTime(self.start_time),
            self.network_ids,
            interface_types,
            feature_types,
            peers_with,
            None,
           )

        e = nsa_element.xml(discovery.nsa)
        payload = ET.tostring(e, 'utf-8')
        return payload


    def resource(self):


        r = modifiableresource.ModifiableResource('DiscoveryService', 'application/xml')