Commit a6abc538 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add CreateImage() to the AM, which just calls into CMV2.

parent 750be519
......@@ -659,5 +659,30 @@ sub Shutdown()
return GeniResponse->Create(GENIRESPONSE_SUCCESS, $coder->boolean(1));
}
sub CreateImage()
{
my ($slice_urn, $imagename, $sliver_urn, $credentials, $options) = @_;
if (! defined($slice_urn) || ! defined($credentials) ||
! defined($sliver_urn) || ! defined($imagename)
|| (! defined($options) && $API_VERSION > 1)) {
return GeniResponse->MalformedArgsResponse("Missing arguments");
}
my $args = {
'slice_urn' => $slice_urn,
'sliver_urn' => $sliver_urn,
'imagename' => $imagename,
'credentials' => $credentials
};
my $response = GeniCMV2::CreateImage($args);
if (GeniResponse::IsError($response)) {
return $response;
}
# Return an XML-RPC boolean
my $coder = Frontier::RPC2->new();
return GeniResponse->Create(GENIRESPONSE_SUCCESS, $coder->boolean(1));
}
# _Always_ make sure that this 1 is at the end of the file...
1;
#!/usr/bin/perl -w
#
# GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2010 University of Utah and the Flux Group.
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -38,6 +38,7 @@ if ($GENI_VERSION eq "1.0" || $GENI_VERSION eq "2.0") {
"SliverStatus" => \&GeniAM::SliverStatus,
"RenewSliver" => \&GeniAM::RenewSliver,
"Shutdown" => \&GeniAM::Shutdown,
"CreateImage" => \&GeniAM::CreateImage,
};
}
......
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