Esempio n. 1
0
 def GetVersion(self, api, options):
     # peers explicitly in aggregates.xml
     peers =dict ([ (peername,interface.get_url()) for (peername,interface) in api.aggregates.iteritems()
                    if peername != api.hrn])
     version_manager = VersionManager()
     ad_rspec_versions = []
     request_rspec_versions = []
     cred_types = [{'geni_type': 'geni_sfa', 'geni_version': str(i)} for i in range(4)[-2:]]
     for rspec_version in version_manager.versions:
         if rspec_version.content_type in ['*', 'ad']:
             ad_rspec_versions.append(rspec_version.to_dict())
         if rspec_version.content_type in ['*', 'request']:
             request_rspec_versions.append(rspec_version.to_dict())
     xrn=Xrn(api.hrn, 'authority+sm')
     version_more = {
         'interface':'slicemgr',
         'sfa': 2,
         'geni_api': 3,
         'geni_api_versions': {'3': 'http://%s:%s' % (api.config.SFA_SM_HOST, api.config.SFA_SM_PORT)},
         'hrn' : xrn.get_hrn(),
         'urn' : xrn.get_urn(),
         'peers': peers,
         'geni_single_allocation': 0, # Accept operations that act on as subset of slivers in a given state.
         'geni_allocate': 'geni_many',# Multiple slivers can exist and be incrementally added, including those which connect or overlap in some way.
         'geni_credential_types': cred_types,
         }
     sm_version=version_core(version_more)
     # local aggregate if present needs to have localhost resolved
     if api.hrn in api.aggregates:
         local_am_url=api.aggregates[api.hrn].get_url()
         sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
     return sm_version
Esempio n. 2
0
 def GetVersion(self, api, options):
     # peers explicitly in aggregates.xml
     peers =dict ([ (peername,interface.get_url()) for (peername,interface) in api.aggregates.iteritems()
                    if peername != api.hrn])
     version_manager = VersionManager()
     ad_rspec_versions = []
     request_rspec_versions = []
     for rspec_version in version_manager.versions:
         if rspec_version.content_type in ['*', 'ad']:
             ad_rspec_versions.append(rspec_version.to_dict())
         if rspec_version.content_type in ['*', 'request']:
             request_rspec_versions.append(rspec_version.to_dict())
     xrn=Xrn(api.hrn, 'authority+sa')
     version_more = {
         'interface':'slicemgr',
         'sfa': 2,
         'geni_api': 2,
         'geni_api_versions': {'2': 'http://%s:%s' % (api.config.SFA_SM_HOST, api.config.SFA_SM_PORT)},
         'hrn' : xrn.get_hrn(),
         'urn' : xrn.get_urn(),
         'peers': peers,
         'geni_request_rspec_versions': request_rspec_versions,
         'geni_ad_rspec_versions': ad_rspec_versions,
         }
     sm_version=version_core(version_more)
     # local aggregate if present needs to have localhost resolved
     if api.hrn in api.aggregates:
         local_am_url=api.aggregates[api.hrn].get_url()
         sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
     return sm_version
Esempio n. 3
0
def GetVersion(api):
    # peers explicitly in aggregates.xml
    peers =dict ([ (peername,get_serverproxy_url(v)) for (peername,v) in api.aggregates.iteritems()
                   if peername != api.hrn])
    version_manager = VersionManager()
    ad_rspec_versions = []
    request_rspec_versions = []
    for rspec_version in version_manager.versions:
        if rspec_version.content_type in ['*', 'ad']:
            ad_rspec_versions.append(rspec_version.to_dict())
        if rspec_version.content_type in ['*', 'request']:
            request_rspec_versions.append(rspec_version.to_dict())
    default_rspec_version = version_manager.get_version("sfa 1").to_dict()
    xrn=Xrn(api.hrn, 'authority+sa')
    version_more = {'interface':'slicemgr',
                    'hrn' : xrn.get_hrn(),
                    'urn' : xrn.get_urn(),
                    'peers': peers,
                    'request_rspec_versions': request_rspec_versions,
                    'ad_rspec_versions': ad_rspec_versions,
                    'default_ad_rspec': default_rspec_version
                    }
    sm_version=version_core(version_more)
    # local aggregate if present needs to have localhost resolved
    if api.hrn in api.aggregates:
        local_am_url=get_serverproxy_url(api.aggregates[api.hrn])
        sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
    return sm_version
Esempio n. 4
0
def GetVersion(api):
    peers =dict ([ (peername,v._ServerProxy__host) for (peername,v) in api.registries.iteritems() 
                   if peername != api.hrn])
    xrn=Xrn(api.hrn)
    return version_core({'interface':'registry',
                         'hrn':xrn.get_hrn(),
                         'urn':xrn.get_urn(),
                         'peers':peers})
Esempio n. 5
0
 def prepare_response_am(self, result):
     version = version_core() 
     response = {
         'geni_api': 3,              
         'code': self.get_geni_code(result),
         'value': self.get_geni_value(result),
         'output': self.get_geni_output(result),
     }
     return response
Esempio n. 6
0
 def GetVersion(self, api, options):
     peers = dict ( [ (hrn,interface.get_url()) for (hrn,interface) in api.registries.iteritems() 
                    if hrn != api.hrn])
     xrn=Xrn(api.hrn,type='authority')
     return version_core({'interface':'registry',
                          'sfa': 3,
                          'hrn':xrn.get_hrn(),
                          'urn':xrn.get_urn(),
                          'peers':peers})
Esempio n. 7
0
 def prepare_response_am(self, result):
     version = version_core()
     response = {
         'geni_api': 3,
         'code': self.get_geni_code(result),
         'value': self.get_geni_value(result),
         'output': self.get_geni_output(result),
     }
     return response
Esempio n. 8
0
 def GetVersion(self, api, options):
     peers = dict ( [ (hrn,interface.get_url()) for (hrn,interface) in api.registries.iteritems()
                    if hrn != api.hrn])
     xrn=Xrn(api.hrn)
     return version_core({'interface':'registry',
                          'sfa': 2,
                          'geni_api': 2,
                          'hrn':xrn.get_hrn(),
                          'urn':xrn.get_urn(),
                          'peers':peers})
Esempio n. 9
0
File: sfi.py Progetto: planetlab/sfa
 def version(self, opts, args):
     if opts.version_local:
         version=version_core()
     else:
         if opts.version_registry:
             server=self.registry
         else:
             server = self.get_server_from_opts(opts)
         version=server.GetVersion()
     for (k,v) in version.iteritems():
         print "%-20s: %s"%(k,v)
def GetVersion(api):
    xrn=Xrn(api.hrn)
    request_rspec_versions = [dict(sfa_rspec_version)]
    ad_rspec_versions = [dict(sfa_rspec_version)]
    version_more = {'interface':'aggregate',
                    'testbed':'myplc',
                    'hrn':xrn.get_hrn(),
                    'request_rspec_versions': request_rspec_versions,
                    'ad_rspec_versions': ad_rspec_versions,
                    'default_ad_rspec': dict(sfa_rspec_version)
                    }
    return version_core(version_more)
Esempio n. 11
0
 def GetVersion(self, api, options):
     xrn=Xrn(api.hrn)
     version = version_core()
     version_generic = {
         'interface':'aggregate',
         'sfa': 2,
         'geni_api': 2,
         'geni_api_versions': {'2': 'http://%s:%s' % (api.config.SFA_AGGREGATE_HOST, api.config.SFA_AGGREGATE_PORT)}, 
         'hrn':xrn.get_hrn(),
         'urn':xrn.get_urn(),
         }
     version.update(version_generic)
     testbed_version = self.driver.aggregate_version()
     version.update(testbed_version)
     return version
Esempio n. 12
0
    def GetVersion(api, options):

        version_manager = VersionManager()
        ad_rspec_versions = []
        request_rspec_versions = []
        for rspec_version in version_manager.versions:
            if rspec_version.content_type in ['*', 'ad']:
                ad_rspec_versions.append(rspec_version.to_dict())
            if rspec_version.content_type in ['*', 'request']:
                request_rspec_versions.append(rspec_version.to_dict())
        xrn=Xrn(api.hrn)
        version_more = {'interface':'aggregate',
                        'sfa': 1,
                        'geni_api': '2',
                        'testbed':'myplc',
                        'hrn':xrn.get_hrn(),
                        'geni_request_rspec_versions': request_rspec_versions,
                        'geni_ad_rspec_versions': ad_rspec_versions,
                        }
        return version_core(version_more)
Esempio n. 13
0
def GetVersion(api):

    version_manager = VersionManager()
    ad_rspec_versions = []
    request_rspec_versions = []
    for rspec_version in version_manager.versions:
        if rspec_version.content_type in ['*', 'ad']:
            ad_rspec_versions.append(rspec_version.to_dict())
        if rspec_version.content_type in ['*', 'request']:
            request_rspec_versions.append(rspec_version.to_dict()) 
    default_rspec_version = version_manager.get_version("sfa 1").to_dict()
    xrn=Xrn(api.hrn)
    version_more = {'interface':'aggregate',
                    'testbed':'myplc',
                    'hrn':xrn.get_hrn(),
                    'request_rspec_versions': request_rspec_versions,
                    'ad_rspec_versions': ad_rspec_versions,
                    'default_ad_rspec': default_rspec_version
                    }
    return version_core(version_more)
Esempio n. 14
0
 def GetVersion(self, api, options):
     xrn=Xrn(api.hrn, type='authority+am')
     version = version_core()
     cred_types = [{'geni_type': 'geni_sfa', 'geni_version': str(i)} for i in range(4)[-2:]]
     geni_api_versions = ApiVersions().get_versions()
     geni_api_versions['3'] = 'http://%s:%s' % (api.config.sfa_aggregate_host, api.config.sfa_aggregate_port)
     version_generic = {
         'testbed': api.driver.testbed_name(),
         'interface':'aggregate',
         'sfa': 3,
         'hrn':xrn.get_hrn(),
         'urn':xrn.get_urn(),
         'geni_api': 3,
         'geni_api_versions': geni_api_versions,
         'geni_single_allocation': 0, # Accept operations that act on as subset of slivers in a given state.
         'geni_allocate': 'geni_many',# Multiple slivers can exist and be incrementally added, including those which connect or overlap in some way.
         'geni_credential_types': cred_types,
         'geni_handles_speaksfor': True,     # supports 'speaks for' credentials
     }
     version.update(version_generic)
     version.update(self.rspec_versions())
     testbed_version = api.driver.aggregate_version()
     version.update(testbed_version)
     return version
Esempio n. 15
0
 def GetVersion(self, api, options):
     xrn=Xrn(api.hrn, type='authority+am')
     version = version_core()
     cred_types = [{'geni_type': 'geni_sfa', 'geni_version': str(i)} for i in range(4)[-2:]]
     geni_api_versions = ApiVersions().get_versions()
     geni_api_versions['3'] = 'http://%s:%s' % (api.config.sfa_aggregate_host, api.config.sfa_aggregate_port)
     version_generic = {
         'testbed': api.driver.testbed_name(),
         'interface':'aggregate',
         'sfa': 3,
         'hrn':xrn.get_hrn(),
         'urn':xrn.get_urn(),
         'geni_api': 3,
         'geni_api_versions': geni_api_versions,
         'geni_single_allocation': 0, # Accept operations that act on as subset of slivers in a given state.
         'geni_allocate': 'geni_many',# Multiple slivers can exist and be incrementally added, including those which connect or overlap in some way.
         'geni_credential_types': cred_types,
         'geni_handles_speaksfor': True,     # supports 'speaks for' credentials
     }
     version.update(version_generic)
     version.update(self.rspec_versions())
     testbed_version = api.driver.aggregate_version()
     version.update(testbed_version)
     return version
Esempio n. 16
0
def GetVersion(api):
    xrn=Xrn(api.hrn)
    return version_core({'interface':'aggregate',
                         'testbed':'myplc.vini',
                         'hrn':xrn.get_hrn(),
                         })
Esempio n. 17
0
def GetVersion(api, options):
    return version_core({'interface':'component',
                         'testbed':'myplc'})