Ejemplo n.º 1
0
 def status (self, urns, options=None):
     if options is None: options={}
     aggregate = DummyAggregate(self)
     desc =  aggregate.describe(urns, version='GENI 3')
     status = {'geni_urn': desc['geni_urn'],
               'geni_slivers': desc['geni_slivers']}
     return status
Ejemplo n.º 2
0
    def allocate(self, urn, rspec_string, expiration, options={}):
        xrn = Xrn(urn)
        aggregate = DummyAggregate(self)
        slices = DummySlices(self)
        slice_record = None
        users = options.get('geni_users', [])
        if users:
            slice_record = users[0].get('slice_record', {})

        # parse rspec
        rspec = RSpec(rspec_string)
        requested_attributes = rspec.version.get_slice_attributes()

        # ensure slice record exists
        slice = slices.verify_slice(xrn.hrn,
                                    slice_record,
                                    expiration=expiration,
                                    options=options)
        # ensure person records exists
        #persons = slices.verify_persons(xrn.hrn, slice, users, peer, sfa_peer, options=options)

        # add/remove slice from nodes
        request_nodes = rspec.version.get_nodes_with_slivers()
        nodes = slices.verify_slice_nodes(urn, slice, request_nodes)

        return aggregate.describe([xrn.get_urn()], version=rspec.version)
Ejemplo n.º 3
0
 def status(self, urns, options={}):
     aggregate = DummyAggregate(self)
     desc = aggregate.describe(urns, version='GENI 3')
     status = {
         'geni_urn': desc['geni_urn'],
         'geni_slivers': desc['geni_slivers']
     }
     return status
Ejemplo n.º 4
0
    def allocate (self, urn, rspec_string, expiration, options={}):
        xrn = Xrn(urn)
        aggregate = DummyAggregate(self)
        slices = DummySlices(self)
        slice_record=None
        users = options.get('geni_users', [])
        if users:
            slice_record = users[0].get('slice_record', {})

        # parse rspec
        rspec = RSpec(rspec_string)
        requested_attributes = rspec.version.get_slice_attributes()

        # ensure slice record exists
        slice = slices.verify_slice(xrn.hrn, slice_record, expiration=expiration, options=options)
        # ensure person records exists
        #persons = slices.verify_persons(xrn.hrn, slice, users, peer, sfa_peer, options=options)

        # add/remove slice from nodes
        request_nodes = rspec.version.get_nodes_with_slivers()
        nodes = slices.verify_slice_nodes(urn, slice, request_nodes)

        return aggregate.describe([xrn.get_urn()], version=rspec.version)
Ejemplo n.º 5
0
 def describe(self, urns, version, options={}):
     aggregate = DummyAggregate(self)
     return aggregate.describe(urns, version=version, options=options)
Ejemplo n.º 6
0
 def describe(self, urns, version, options={}):
     aggregate = DummyAggregate(self)
     return aggregate.describe(urns, version=version, options=options)
Ejemplo n.º 7
0
 def describe(self, urns, version, options=None):
     if options is None: options={}
     aggregate = DummyAggregate(self)
     return aggregate.describe(urns, version=version, options=options)