Ejemplo n.º 1
0
def add_ps_nodes():
    #it would be better to use the TopologyProvider.getInstance but that isn't working. Hence this tempoary code
    estopo = ESnetTopology()

    if (estopo):
        links = estopo.getLinks()
        for link in links:
            if "pt" in link:

                desc = ESnetTopology.idToDescription(link)

                ps_node = PerfSONARTester()

                node_name = desc[3:]
                ps_node.setResourceName(node_name)
                ps_node.addLink(links.get(link))
                perf_testers[node_name + '.es.net'] = ps_node
Ejemplo n.º 2
0
# software, please contact Berkeley Lab's Innovation & Partnerships
# Office at [email protected].
#
# NOTICE.  This Software was developed under funding from the
# U.S. Department of Energy and the U.S. Government consequently retains
# certain rights. As such, the U.S. Government has been granted for
# itself and others acting on its behalf a paid-up, nonexclusive,
# irrevocable, worldwide license in the Software to reproduce,
# distribute copies to the public, prepare derivative works, and perform
# publicly and display publicly, and to permit other to do so.
#
from net.es.enos.esnet import ESnetTopology,OSCARSReservations
from org.joda.time import DateTime

if not 'esnet' in globals():
    globals()['esnet'] = ESnetTopology()

def makeURN (node,domain="es.net",port="",link=""):
    """
    makeURN takes the name and domain of a node and builds a URN following the NMWG
    topology format that is used by IDCP that OSCARS implements. The format is as follow:
            urn:ogf:network:domain:node:port:link

    for instance: urn:ogf:network:domain=es.net:node=denv-cr5:port=9/1/4:link=*

    :param node: node name, i.e. star-cr5
    :param domain: domain name. Default is es.net
    :param port
    :param link
    :return: string
    """