Index: fedd/fedd_client.py
===================================================================
--- fedd/fedd_client.py	(revision 53dfd4be7b4ce2ea07887a6d91799abf8e651de1)
+++ fedd/fedd_client.py	(revision 23dec62633bcb34c43ec1c951f9e3830f25bb784)
@@ -234,4 +234,10 @@
                 help="Size of output in pixels (diagrams are square")
 
+class fedd_start_opts(fedd_client_opts):
+    def __init__(self):
+        fedd_client_opts.__init__(self)
+        self.add_option("-f", "--file", dest="file", 
+                help="experiment description file")
+
 def exit_with_fault(dict, out=sys.stderr):
     """ Print an error message and exit.
@@ -299,5 +305,5 @@
             raise OptionValueError("Bad node description: %s" % value)
 
-    def get_user_info(self, access_keys):
+    def get_user_info(self, access_keys=None):
         pw = pwd.getpwuid(os.getuid());
         try_cert=None
@@ -309,5 +315,5 @@
             if not os.access(try_cert, os.R_OK):
                 try_cert = None
-            if len(access_keys) == 0:
+            if access_keys is not None and len(access_keys) == 0:
                 for k in ["%s/.ssh/id_rsa.pub", "%s/.ssh/id_dsa.pub", 
                         "%s/.ssh/identity.pub"]:
@@ -1223,4 +1229,89 @@
                 sys.exit("No log returned")
 
+class terminate_segment(fedd_rpc):
+    def __init__(self): 
+        """
+        Termination request
+        """
+
+        fedd_rpc.__init__(self, "TerminateSegment")
+
+    def __call__(self):
+        """
+        The control flow.  Compose the request and print the response.
+        """
+        # Process the options using the customized option parser defined above
+        parser = fedd_terminate_opts()
+
+        (opts, args) = parser.parse_args()
+
+        (user, cert) = self.get_user_info([])
+        if opts.trusted:
+            if ( not os.access(opts.trusted, os.R_OK) ) :
+                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
+
+        if opts.debug > 0: opts.tracefile=sys.stderr
+
+        if opts.cert != None: cert = opts.cert
+
+        if cert == None:
+            sys.exit("No certificate given (--cert) or found")
+
+        if os.access(cert, os.R_OK):
+            fid = fedid(file=cert)
+        else:
+            sys.exit("Cannot read certificate (%s)" % cert)
+
+        if opts.exp_name and opts.exp_certfile:
+            sys.exit("Only one of --experiment_cert and " +\
+                    "--experiment_name permitted")
+
+        if opts.print_log and opts.logfile:
+            sys.exit("Only one of --logfile and --print_log is permitted")
+        elif opts.print_log:
+            out = sys.stdout
+        elif opts.logfile:
+            try:
+                out = open(opts.logfile, "w")
+            except IOError,e:
+                sys.exit("Cannot open logfile: %s" %e)
+        else:
+            out = None
+
+        exp_id = None
+
+        if opts.exp_certfile:
+            exp_id = { 'fedid': fedid(file=opts.exp_certfile) }
+
+        if opts.exp_name:
+            exp_id = { 'localname' : opts.exp_name }
+
+        if not exp_id:
+            sys.exit("Must give one of --experiment_cert and " +\
+                    "--experiment_name");
+
+        req = { 'allocID': exp_id, 'force': opts.force }
+
+        try:
+            resp_dict = self.do_rpc(req,
+                    opts.url, opts.transport, cert, opts.trusted, 
+                    serialize_only=opts.serialize_only,
+                    tracefile=opts.tracefile)
+        except self.RPCException, e:
+            exit_with_fault(\
+                    {'desc': e.desc, 'errstr': e.errstr, 'code': e.code})
+        except RuntimeError, e:
+            print e
+            sys.exit("Error processing RPC: %s" % e)
+
+        if out:
+            log = resp_dict.get('deallocationLog', None)
+            if log:
+                print >>out, log
+                out.close()
+            else:
+                out.close()
+                sys.exit("No log returned")
+
 class create(fedd_rpc):
     def __init__(self): 
@@ -1597,4 +1688,63 @@
         out.close()
 
+class start_segment(fedd_rpc):
+    def __init__(self): 
+        fedd_rpc.__init__(self, "StartSegment")
+    def __call__(self):
+        # Process the options using the customized option parser defined above
+        parser = fedd_start_opts()
+
+        (opts, args) = parser.parse_args()
+
+        if opts.trusted:
+            if ( not os.access(opts.trusted, os.R_OK) ) :
+                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
+
+        if opts.debug > 0: opts.tracefile=sys.stderr
+
+        (user, cert) = self.get_user_info()
+
+        if opts.cert != None: cert = opts.cert
+
+        if cert == None:
+            sys.exit("No certificate given (--cert) or found")
+
+        if os.access(cert, os.R_OK):
+            fid = fedid(file=cert)
+        else:
+            sys.exit("Cannot read certificate (%s)" % cert)
+
+        if opts.file:
+            try:
+		top = topdl.topology_from_xml(filename=opts.file, 
+			top='experiment')
+            except IOError:
+                sys.exit("Cannot read description file (%s)" %opts.file)
+        else:
+            sys.exit("Must specify an experiment description (--file)")
+
+        msg = {
+                'segmentdescription': { 'topdldescription': top.to_dict() },
+                'allocID': pack_id(fid),
+		'master': False,
+                }
+
+        if opts.debug > 1: print >>sys.stderr, msg
+
+        try:
+            resp_dict = self.do_rpc(msg, 
+                    opts.url, opts.transport, cert, opts.trusted, 
+                    serialize_only=opts.serialize_only,
+                    tracefile=opts.tracefile)
+        except self.RPCException, e:
+            exit_with_fault(\
+                    {'desc': e.desc, 'errstr': e.errstr, 'code': e.code})
+        except RuntimeError, e:
+            sys.exit("Error processing RPC: %s" % e)
+
+        if opts.debug > 1: print >>sys.stderr, resp_dict
+	print resp_dict
+
+
 
 cmds = {\
@@ -1613,4 +1763,6 @@
         'spewlog': spew_log(),\
         'topdl_image': topdl_image(),\
+        'start_segment': start_segment(),\
+        'terminate_segment': terminate_segment(),\
     }
 
