Changeset 88dbe63


Ignore:
Timestamp:
Aug 25, 2010 1:14:50 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
208797c
Parents:
4875e93
Message:

Expand the protogeni_proxy class for derivation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/protogeni_access.py

    r4875e93 r88dbe63  
    100100                return "%s XML blob" % method
    101101
     102    def clearinghouse_call(self, method, params, context):
     103        return self.pg_call(self.ch_url, method, params, context)
     104
     105    def slice_authority_call(self, method, params, context):
     106        return self.pg_call(self.sa_url, method, params, context)
     107
     108    def component_manager_call(self, method, params, context):
     109        return self.pg_call(self.cm_url, method, params, context)
     110
     111
     112
    102113
    103114
     
    878889
    879890        try:
    880             gcred = segment_commands.pg_call(self.sa_url,
    881                     'GetCredential', {}, ctxt)
    882         except self.ProtoGENIError, e:
     891            gcred = segment_commands.slice_authority_call('GetCredential',
     892                    {}, ctxt)
     893        except segment_commands.ProtoGENIError, e:
    883894            raise service_error(service_error.federant,
    884895                    "ProtoGENI: %s" % e)
     
    909920                        'type': 'Slice'
    910921                        }
    911                 segment_commands.pg_call(self.sa_url, 'Resolve', param, ctxt)
     922                segment_commands.slice_authority_call('Resolve', param, ctxt)
    912923            except segment_commands.ProtoGENIError, e:
    913924                print e
     
    929940                    'type': 'Slice'
    930941                    }
    931             slice_cred = segment_commands.pg_call(self.sa_url, 'Register',
     942            slice_cred = segment_commands.slice_authority_call('Register',
    932943                    param, ctxt)
    933944            # Resolve the slice to get the URN that PG has assigned it.
     
    937948                    'hrn': slicename
    938949                    }
    939             data = segment_commands.pg_call(self.sa_url, 'Resolve', param,
     950            data = segment_commands.slice_authority_call('Resolve', param,
    940951                    ctxt)
    941952            if 'urn' in data:
     
    954965                    'credential': gcred,
    955966                    }
    956             keys =  segment_commands.pg_call(self.sa_url, 'GetKeys', param,
     967            keys =  segment_commands.slice_authority_call('GetKeys', param,
    957968                    ctxt)
    958969            # Create a Sliver
     
    967978                    'slice_urn': slice_urn,
    968979                    }
    969             sliver_cred, manifest = segment_commands.pg_call(self.cm_url,
     980            sliver_cred, manifest = segment_commands.component_manager_call(
    970981                    'CreateSliver', param, ctxt)
    971982        except segment_commands.ProtoGENIError, e:
     
    9911002                        'slice_urn': slice_urn,
    9921003                        }
    993                 r = segment_commands.pg_call(self.cm_url,
     1004                r = segment_commands.component_manager_call(
    9941005                        'SliverStatus', param, ctxt)
    9951006                status = r.get('status', 'changing')
     
    10141025                    'slice_urn': slice_urn,
    10151026                    }
    1016             segment_commands.pg_call(self.cm_url, 'DeleteSlice',
     1027            segment_commands.component_manager_call('DeleteSlice',
    10171028                    param, ctxt)
    10181029        except segment_commands.ProtoGENIError, e:
     
    14281439            expiration = time.strftime("%Y%m%dT%H:%M:%S",
    14291440                    time.gmtime(time.time() + interval))
    1430             cred = segment_commands.pg_call(self.sa_url, 'GetCredential',
     1441            cred = segment_commands.slice_authority_call('GetCredential',
    14311442                    {}, ctxt)
    14321443
     
    14351446                    'expiration': expiration
    14361447                    }
    1437             r = segment_commands.pg_call(self.sa_url, 'RenewSlice', param, ctxt)
     1448            r = segment_commands.slice_authority_call('RenewSlice', param, ctxt)
    14381449            param = {
    14391450                    'credential': cred,
     
    14411452                    'type': 'Slice',
    14421453                    }
    1443             slice = segment_commands.pg_call(self.sa_url, 'Resolve',
     1454            slice = segment_commands.slice_authority_call('Resolve',
    14441455                    param, ctxt)
    14451456            uuid = slice.get('uuid', None)
     
    14531464                    'type': 'Slice',
    14541465                    }
    1455             new_scred = segment_commands.pg_call(self.sa_url, 'GetCredential',
     1466            new_scred = segment_commands.slice_authority_call('GetCredential',
    14561467                    param, ctxt)
    14571468
     
    14651476                    'slice_urn': slice_urn,
    14661477                    }
    1467             r = segment_commands.pg_call(self.cm_url, 'RenewSlice', param, ctxt)
     1478            r = segment_commands.component_manager_call('RenewSlice', param,
     1479                    ctxt)
    14681480        except segment_commands.ProtoGENIError, e:
    14691481            self.log.warn("Failed to renew sliver for %s: %s" % (name, e))
Note: See TracChangeset for help on using the changeset viewer.