Commit 124c47ed authored by Gary Wong's avatar Gary Wong

Added support for a GetVersion call on the CH, CM, SA and SES. The

return value is 1, which is hereby defined to mean "GetVersion() and all
previous API features are supported".
parent f6f57cac
......@@ -39,6 +39,18 @@ my $BOSSNODE = "@BOSSNODE@";
my $OURDOMAIN = "@OURDOMAIN@";
my $SLICESHUTDOWN = "$TB/sbin/protogeni/shutdownslice";
my $API_VERSION = 1;
#
# Tell the client what API revision we support. The correspondence
# between revision numbers and API features is to be specified elsewhere.
# No credentials are required.
#
sub GetVersion()
{
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $API_VERSION );
}
#
# Get a credential to use the ClearingHouse. For the moment, the initial
# credential will be provided to callers with the proper certificate, which
......
......@@ -79,6 +79,18 @@ my $SNMPIT = "$TB/bin/snmpit";
my $PRERENDER = "$TB/libexec/vis/prerender";
my $EMULAB_PEMFILE = "@prefix@/etc/genicm.pem";
my $API_VERSION = 1;
#
# Tell the client what API revision we support. The correspondence
# between revision numbers and API features is to be specified elsewhere.
# No credentials are required.
#
sub GetVersion()
{
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $API_VERSION );
}
# Look up a node by an identifier of unspecified type (perhaps a URN, an
# (obsolete) UUID, or an old-style HRN. Ultimately, all IDs should be
# URNs and this mess will go away, but for now we try not to make
......
......@@ -39,6 +39,18 @@ my $OURDOMAIN = "@OURDOMAIN@";
my $PGENIDOMAIN = "@PROTOGENI_DOMAIN@";
my $SLICESHUTDOWN = "$TB/sbin/protogeni/shutdownslice";
my $API_VERSION = 1;
#
# Tell the client what API revision we support. The correspondence
# between revision numbers and API features is to be specified elsewhere.
# No credentials are required.
#
sub GetVersion()
{
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $API_VERSION );
}
#
# Get a credential for an object. Ignoring the type for now. If no credential
# provided, then return a generic credential for the registered Emulab user.
......
......@@ -44,6 +44,18 @@ my $PGENIDOMAIN = "@PROTOGENI_DOMAIN@";
my $HAVE_XERCES = "@HAVE_XERCES@";
my $ASSIGN = "$TB/libexec/assign";
my $API_VERSION = 1;
#
# Tell the client what API revision we support. The correspondence
# between revision numbers and API features is to be specified elsewhere.
# No credentials are required.
#
sub GetVersion()
{
return GeniResponse->Create( GENIRESPONSE_SUCCESS, $API_VERSION );
}
#
# Map a virtual topology onto (a subset of) an advertised physical
# topology.
......
#! /usr/bin/env python
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
# All rights reserved.
#
# Permission to use, copy, modify and distribute this software is hereby
# granted provided that (1) source code retains these copyright, permission,
# and disclaimer notices, and (2) redistributions including binaries
# reproduce the notices in supporting documentation.
#
# THE UNIVERSITY OF UTAH ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
# CONDITION. THE UNIVERSITY OF UTAH DISCLAIMS ANY LIABILITY OF ANY KIND
# FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
#
#
#
import sys
import pwd
import getopt
import os
import re
import xmlrpclib
from M2Crypto import X509
def Usage():
print "usage: " + sys.argv[ 0 ] + " [option...] [authority]"
print """Options:
-d, --debug be verbose about XML methods invoked
-h, --help show options and usage
-r file, --read-commands=file specify additional configuration file"""
execfile( "test-common.py" )
if len( args ) > 1:
Usage()
sys.exit( 1 )
elif len( args ) == 1:
authority = args[ 0 ]
else:
authority = "sa"
rval,response = do_method( authority, "GetVersion", {} )
if rval:
Fatal("Could not obtain the API version")
else:
print str( response[ "value" ] )
......@@ -118,6 +118,7 @@ if (!defined($request)) {
LogStart(0, undef, LIBAUDIT_LOGTBOPS());
my $responder = Frontier::Responder->new( "methods" => {
"GetVersion" => \&GeniCH::GetVersion,
"GetCredential" => \&GeniCH::GetCredential,
"Resolve" => \&GeniCH::Resolve,
"Register" => \&GeniCH::Register,
......
......@@ -128,6 +128,7 @@ LogStart(0, undef, LIBAUDIT_LOGTBOPS());
Genixmlrpc->SetContext(Genixmlrpc->Context($certificate));
my $responder = Frontier::Responder->new( "methods" => {
"GetVersion" => \&GeniCM::GetVersion,
"Resolve" => \&GeniCM::Resolve,
"DiscoverResources" => \&GeniCM::DiscoverResources,
"GetTicket" => \&GeniCM::GetTicket,
......
......@@ -124,6 +124,7 @@ LogStart(0, undef, LIBAUDIT_LOGTBOPS());
Genixmlrpc->SetContext(Genixmlrpc->Context($certificate));
my $responder = Frontier::Responder->new( "methods" => {
"GetVersion" => \&GeniSA::GetVersion,
"GetCredential" => \&GeniSA::GetCredential,
"Resolve" => \&GeniSA::Resolve,
"Register" => \&GeniSA::Register,
......
......@@ -124,7 +124,8 @@ LogStart(0, undef, LIBAUDIT_LOGTBOPS());
Genixmlrpc->SetContext(Genixmlrpc->Context($certificate));
my $responder = Frontier::Responder->new( "methods" => {
"Map" => \&GeniSES::Map
"GetVersion" => \&GeniSES::GetVersion,
"Map" => \&GeniSES::Map
}
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment