[[PageOutline]] = GENI Aggregate Manager API Draft Revisions Method Signatures Summary = This page documents the DRAFT GENI Aggregate Manager API full method signatures, if all proposed revisions are adopted. This includes proposals that have already been adopted, and others still under discussion. The current officially adopted version of the API is '''2''' and is documented on [wiki:GAPI_AM_API the main API page]. The current adopted or proposed changes for the AM API, whose impacts are reflected here, are documented on [wiki:AaronHelsinger/GAPI_AM_API_DRAFT the AM API Draft wiki page]. For a summary of the Aggregate Manager API, typical workflow, common concepts, arguments, and returns, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts this sub page]. If the generally agreed-upon change sets listed here are adopted, the final method signatures will be as follows: == !GetVersion == Query static configuration information about this aggregate manager implementation, such as API and RSpec versions supported. For details on the arguments, return structure, and semantics, see [wiki:GAPI_AM_API_V2_DETAILS#GetVersionDetails the details page]. The !GetVersion operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#GetVersion GetVersion] operation. The [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] specification does not include this operation. {{{ struct GetVersion([optional: struct options]) }}} The `options` argument may be omitted entirely by clients. The result is an [http://www.xmlrpc.com/spec XML-RPC] struct with at least the following members: {{{ { int geni_api; struct code = { int geni_code; [optional: string am_type;] [optional: int am_code;] } struct value { int geni_api; struct geni_api_versions { URL ; # value is a URL, name is a number [optional: other supported API versions and the URLs where they run] } array geni_request_rspec_versions of { string type; string version; string schema; string namespace; array extensions of string; }; array geni_ad_rspec_versions of { string type; string version; string schema; string namespace; array extensions of string; }; array geni_credential_types of { string geni_type ; string geni_version ; }; } string output; } }}} === Return Summary === As with all AM API methods, the return is an XML-RPC struct. For !GetVersion, it includes: * The standard AM API {{{code}}}, {{{value}}}, and {{{output}}} entries. For details, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts#ReturnStruct the Common Concepts page] * {{{geni_api}}}: integer version of this API ('''3'''). Repeated here for backwards compatibility. !GetVersion {{{value}}} required return members: * {{{geni_api}}} = '''3''' (Integer current version of this API). * List of versions of the API supported by this aggregate. For details on doing this, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts#SupportingMultipleAPIVersions the Common Concepts page]. * List of request RSpec formats supported by this aggregate. For details on RSpecs, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts#RSpecs the Common Concepts page]. * List of advertisement RSpec formats supported by this aggregate. For details on RSpecs, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts#RSpecs the Common Concepts page]. * List of supported credential types and versions. For details, see [wiki:AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures/CommonConcepts the Common Concepts page]. For details on !GetVersion arguments, returns, and semantics, and a sample minimal return, see [wiki:GAPI_AM_API_V2_DETAILS#GetVersionDetails the Details page]. == !ListResources == Return a listing and description of available resources at this aggregate. The resource listing and description provides sufficient information for clients to select among available resources. These listings are known as RSpecs. {{{ struct ListResources(struct credentials[], struct options) }}} The following members are available for use in the options parameter. All aggregate managers are required to honor these options.: {{{ { boolean geni_available ; boolean geni_compressed ; struct geni_rspec_version { string type; string version; }; } }}} Note that all options may be omitted by the client, except `geni_rspec_version` which is required. Return: A `geni.rspec` advertisment RSpec. Note that this is only part of what !ListResources did in earlier versions of this API. For the what-is-in-my-slice functionality, see `Describe()`. This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#DiscoverResources DiscoverResources] operation and to the [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA]'s !GetResources operation (sec. 6.2.4). == Describe == AKA !ListResources when supplied a slice URN. Retrieve a manifest RSpec describing the resources contained by the entities named, e.g. a single slice or a set of the slivers in a slice. This listing and description should be sufficient to allow experimenters to use the resources. {{{ struct Describe(string urns[], struct credentials[], struct options[]) }}} The following members are available for use in the options parameter. All aggregate managers are required to honor these options.: {{{ { boolean geni_compressed ; struct geni_rspec_version { string type; string version; }; } }}} Note that all options may be omitted by the client, exception `geni_rspec_version` which is required. This method is part of what !ListResources used to do, and is similar to ProtoGENI [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#Resolve Resolve]. Return struct: {{{ { geni_rspec: geni_urn: geni_slivers: [ { geni_sliver_urn: geni_expires: , geni_allocation_status: , geni_operational_status: }, ... ] } }}} Note that the manifest RSpec for allocated slivers may contain less detail than for provisioned slivers. Aggregates are expected to combine the manifests of all requested slivers into a single manifest RSpec. Note that a manifest returned here for only some of the slivers in a slice at this aggregate, may contain references to resources not described in this manifest (they are in other slivers). As a result, such manifests may not be directly usable as a subsequent request. == Allocate == AKA !CreateSlivers() Allocate resources as described in a request RSpec argument to a slice with the named URN. On success, one or more slivers are allocated, containing resources satisfying the request, and assigned to the given slice. This method returns a listing and description of the resources reserved for the slice by this operation, in the form of a manifest RSpec. Allocated slivers are held for an aggregate-determined period. Clients must Renew or Provision slivers before the expiration time (given in the return struct), or the aggregate will automatically Delete them. Aggregates should implement Allocate() as quick, cheap, and not impacting Provisioned resources, such that it can be readily undone. {{{ struct Allocate(string slice_urn, struct credentials[], geni.rspec rspec, struct options) }}} This is the first part of what !CreateSliver used to do. The next part is now done by Provision. This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#GetTicket GetTicket] operation. * {{{slice_urn}}}: The URN of the slice to which the resources specified in {{{rspec}}} will be allocated. For details on GENI AM API URN identifiers, see the [wiki:GeniApiIdentifiers GENI wiki page]. * {{{rspec}}}: An RSpec matching the [http://www.protogeni.net/trac/protogeni/wiki/RSpec GENI standard] request RSpec [http://www.geni.net/resources/rspec/3/request.xsd schema] containing the resources that the caller is requesting for allocation to the slice specified in {{{slice_urn}}}. Options include: {{{ { [optional geni_end_time: ] } }}} Return struct: {{{ { geni_rspec: , geni_slivers: [ { geni_sliver_urn: geni_expires: , geni_allocation_status: }, ... ] } }}} The manifest is a manifest of only newly allocated slivers. == Renew == AKA !RenewSliver() or !RenewAllocated Request that the named slivers be renewed, with their expiration extended. If possible, the aggregate should extend the slivers to the requested expiration time, or to a sooner time if policy limits apply. This method applies to slivers that are `geni_allocated` or to slivers that are `geni_provisioned`, though different policies may apply to slivers in the different states, resulting in much shorter max expiration times for `geni_allocated` slivers. {{{ struct Renew(string urns[], struct credentials[], dateTime.rfc3339 expiration_time, struct options) }}} This operation used to be called !RenewSliver. Use Renew() to get the equivalent functionality. This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#RenewSlice RenewSlice] operation. Options include {{{geni_best_effort}}}, specifying whether the client prefers all included slivers to be renewed or none, or wants a partial success if possible. {{{expiration_time}}}: The date-time string in [http://tools.ietf.org/html/rfc3339 RFC 3339] format in UTC when the reservation(s) should be extended until. Return value is a list of structs: {{{ [ { geni_sliver_urn: , geni_allocation_status: , geni_operational_status: , geni_expires: , }, ... ] }}} == !UpdateAllocations == AKA !UpdateAllocated() This method modifies a set of allocated slivers in place. The existing reservations are not lost if the newly requested allocations cannot be satisfied by the aggregate. Details are suppressed pending agreement on this method. {{{ #!comment {{{ struct UpdateAllocations(string urns[], struct credentials[], geni.rspec rspec, struct options) }}} `credentials` is the standard argument defined above. Options include: - {{{geni_end_time}}}: - {{{geni_best_effort}}} Return struct: {{{ { geni_rspec: , geni_slivers: [ { geni_sliver_urn: geni_expires: , geni_allocation_status: }, ... ] } }}} The manifest is a manifest of only referenced allocated slivers. FIXME: Is this the same method as for updating provisioned slivers? }}} == Provision == AKA !ProvisionSlivers() Request that the named `geni_allocated` slivers be made `geni_provisioned`, instantiating or otherwise realizing the resources, such that they have a valid `geni_operational_status` and may possibly be made `geni_ready` for experimenter use. This operation is synchronous, but may start a longer process, such as creating and imaging a virtual machine. {{{ struct Provision(string urns[], struct credentials[], struct options) }}} This operation is part of what !CreateSliver used to do. The first part of what !CreateSliver did is now in `Allocate()`. Note that resources are not necessarily ready for experimenter use after the work that this function initiates finally completes. Consult the `geni_operational_status`, and the advertised operational state machine. Consider calling `PerformOperationalAction`, e.g. with the command name `geni_start`. The operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#RedeemTicket RedeemTicket] method. Options include: - {{{geni_best_effort}}} - {{{geni_end_time}}} - `struct geni_users[]` Return struct: {{{ geni_rspec: , geni_slivers: [ { geni_sliver_urn: , geni_allocation_status: , geni_operational_status: , geni_expires , }, ... ], }}} The returned manifest covers only newly provisioned slivers. Use `Describe` to get a manifest of all provisioned slivers. == !UpdateSlivers == AKA Update() This method requests a modification to 1 or more provisioned slivers. The slivers end up in a new `geni_allocated+geni_provisioned` state. Details are suppressed pending agreement on this method. {{{ #!comment {{{ struct UpdateSlivers(string urns[], struct credentials[], geni.rspec rspec, struct options) }}} `credentials` is the standard argument defined above. Options include: - {{{geni_end_time}}} - {{{geni_best_effort}}} - `struct geni_users[]` Return struct: {{{ { rspec: , geni_slivers: [ { geni_sliver_urn: geni_expires: , geni_allocation_status: }, ... ] } }}} The RSpec argument may be a new delta format. The manifest is a manifest of only referenced provisioned slivers. FIXME: Is this the same method as for updating allocated slivers? FIXME: Return both a manifest and a delta RSpec? }}} == Status == AKA !SliverStatus Get the status of a sliver or slivers belonging to a single slice at the given aggregate. Status may include other dynamic reservation or instantiation information as required by the resource type and aggregate. This method is used to provide updates on the state of the resources after the completion of Provision, which began to asynchronously provision the resources. This should be relatively dynamic data, not descriptive data as returned in the manifest RSpec. {{{ struct Status(string urns[], struct credentials[], struct options) }}} This operation used to be called !SliverStatus in earlier versions of the AM API. `geni_slivers` has replaced `geni_resources` and `geni_sliver_urn` replaces `geni_urn`. `geni_status` is replaced with 2 fields, `geni_allocation_status` and `geni_operational_status`. This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#SliverStatus,WaitForStatus SliverStatus] operation. The [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] specification does not include this operation. Return `value` is a struct: {{{ { geni_urn: geni_slivers: [ { geni_sliver_urn: geni_allocation_status: geni_operational_status: geni_expires: geni_error: , }, { geni_sliver_urn: geni_allocation_status: geni_operational_status: geni_expires: geni_error: , } ] } }}} == !PerformOperationalAction == Perform the named operational action on the named slivers, possibly changing the `geni_operational_status` of the named slivers. E.G. 'start' a VM. For valid operations and expected states, consult the state diagram advertised in the Aggregate's Ad RSpec. {{{ struct PerformOperationalAction (string urns[], struct credentials[], string action, struct options={}) }}} This operation is similar to ProtoGENI functions like `StartSliver`, `StopSliver`, `RestartSliver` in the [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2 PG CMv2 API]. Options include: {{{geni_best_effort}}} Return value is a list of structs: {{{ [ { geni_sliver_urn : , geni_allocation_status: geni_operational_status : , geni_expires: }, ... ] ; }}} == Delete == AKA !DeleteSliver Delete the named slivers, making them `geni_unallocated`. Resources are stopped in necessary, and both de-provisioned and de-allocated. No further AM API operations may be performed on slivers that have been deleted. {{{ struct Delete(string urns, struct credentials[], struct options) }}} This operation used to be called !DeleteSliver in earlier versions of this API. To get the functionality of !DeleteSliver, call Delete with the slice URN. This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#DeleteSliver DeleteSliver] operation and to the [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA]'s !DeleteSlice operation (sec. 6.2.3). Options include: {{{geni_best_effort}}} Return list of structs: {{{ [ { geni_sliver_urn: , geni_allocation_status: , geni_expires: , }, ... ] }}} == Shutdown == Perform an emergency shutdown on the slice at this aggregate. Resources should be taken offline, such that experimenter access (on both the control and data plane) is cut off. No further actions on the slice should be possible at this aggregate, until an un-specified operator action restores the slice. This operation is intended for operator use. The sliver is shut down but remains available for further forensics. {{{ struct Shutdown(string slice_urn, struct credentials[], struct options) }}} This operation is similar to ProtoGENI's [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#Shutdown Shutdown] operation. The [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] specification does not include this operation. Return: XML-RPC boolean, indicating whether the resources associated with this reservation were successfully shut down to a state suitable for forensics.