Changes between Initial Version and Version 1 of AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures


Ignore:
Timestamp:
04/04/12 11:52:48 (12 years ago)
Author:
Aaron Helsinger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AaronHelsinger/GAPI_AM_API_DRAFT/MethodSignatures

    v1 v1  
     1[[PageOutline]]
     2
     3= GENI Aggregate Manager API Draft Revisions Method Signatures Summary =
     4
     5This 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.
     6
     7The current officially adopted version of the API is '''2''' and is documented on [wiki:GAPI_AM_API the main API page].
     8
     9The 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].
     10
     11 = Change summary - method signatures =
     12If the generally agreed-upon change sets listed here are adopted, the final method signatures will be as follows:
     13
     14== Common Arguments and Returns ==
     15=== structs and optional arguments ===
     16Unless otherwise specified, all arguments and returns of type `struct` may include aggregate or resource-specific entries. As arguments, such options must be optional for the client to supply, with the aggregate providing a reasonable default.
     17
     18=== datetime data type ===
     19All datetime arguments and returns in this API shall conform to [http://tools.ietf.org/html/rfc3339 RFC 3339]. This represents a subset of the valid date/time strings permissible by the standard XML-RPC date/time data type, [http://xmlrpc.scripting.com/spec dateTime.iso8601].
     20
     21In the specification of this API, this is described as `dateTime.rfc3339`.
     22
     23=== RSpec data type ===
     24Throughout this API, multiple arguments and returns are labeled as an RSpec. These fields shall be understood as XML documents following one of the schemas advertised in the return from !GetVersion. All such RSpecs must pass an XML schema validator, must list all used schemas and namespaces within the document, using schemas that are publicly available. The !GetVersion return advertises schemas for advertisment and request RSpecs; the schemas for manifest RSpecs are assumed to be available at the same base URL, but using a corresponding manifest schema.
     25
     26A fully GENI AM API compliant aggregate will always support the GENI standard schemas for RSpecs, available at http://www.geni.net/resources/rspec. As of 4/2012, the current GENI RSpec version is '''3'''. Aggregates are free to use an alternate format internally, but must accept and produce compliant RSpecs on demand.
     27
     28The Aggregate Manager API requires this contract: Aggregates advertise the `type` and `version` of RSpec formats that they support. If available, they specify the `schema`, `namespace` and `extensions` combination which is the authoritative definition of that format. Clients of the API should understand that combination in order to know how to understand the resources available at that aggregate.
     29
     30If an aggregate advertises a particular `type`/`version` (optionally defined with a combination of `schema`, `namespace` and `extensions`) in the `geni_ad_rspec_versions` attribute of !GetVersion, then it promises to send a correct Advertisement RSpec in response to a !ListResources call which supplies a `geni_rspec_version` option containing that `type`/`version`. (`geni_rspec_version` is a struct with 2 members, `type` and `version`. `type` and `version` are case-insensitive strings, matching those in `geni_ad_rspec_versions`).
     31
     32If an Aggregate advertises a particular `type`/`version` (optionally defined with a combination of `schema`, `namespace` and `extensions`) in the `geni_request_rspec_versions` attribute of !GetVersion then it promises to correctly honor an Allocate (was !CreateSliver in API v2) call containing a request RSpec in the given format, and then to return a Manifest RSpec in the corresponding format (i.e. a GENI format request is answered with a GENI format manifest). The aggregate also promises to send a correctly formatted Manifest RSpec in response to a Describe call which supplies a valid slice or sliver URN and an `geni_rspec_version` option containing that supported `type`/`version`.
     33
     34In this API, such RSpec fields are labeled as type `geni.rspec`.
     35
     36=== `credentials` ===
     37Many methods take an array of credentials. This is an array of credential type, version, and string value.
     38{{{
     39credentials = [
     40   {
     41    geni_type: <string>,
     42    geni_version: <string>,
     43    geni_value: <string>,
     44    <others>
     45   }
     46]
     47}}}
     48
     49At least one credential must be a valid slice credential for the slice specified in `slice_urn` if that is an argument, or for the slice that contains the named slivers, if sliver urns are an argument, or a valid administrative credential with sufficient privileges. When sliver_urns are supplied, all such slivers must belong to the same slice, over which the given credential provides access. Credentials must be valid (signed by a valid GENI certificate authority either directly or by chain, not expired, and grant privileges to the client identified by the SSL client certificate). Each method requires specific privileges, which must be granted by the provided credentials. Note that the semantics of this argument is not clear: most implementations require a single credential to provide all needed privileges. Alternative interpretations might, for example, accumulate privileges from each valid credential to determine overall caller permissions. For details on GENI AM API format credentials, see [wiki:GeniApiCredentials the GENI wiki].
     50
     51=== `geni_end_time` ===
     52The `geni_end_time` argument requests an expiration of the specified slivers. It is in dateTime.rfc3339 format (defined above).
     53When an explicit argument, it is required, and aggregates must honor the request to the extent local policy permits.
     54When an option in the `options` struct, clients may omit the option, and AMs may choose not to or be unable to honor this option, but may still succeed the overall request.
     55
     56=== `geni_best_effort` ===
     57 {{{geni_best_effort: <XML-RPC boolean 1 or 0, default false (0)>}}}
     58Clients may omit this option, but aggregates must honor the option if possible. This option modifies the way that the operation applies to all named slivers. By default (`geni_best_effort`=false), the operation must apply equally to all slivers, either succeeding or failing for all. When true, the aggregate may succeed the operation for some slivers, while failing the operation for other slivers.
     59
     60=== `geni_users` ===
     61`struct geni_users[]` is an option for some methods.
     62
     63Clients may omit this option. Aggregates should honor this option for any resource that accepts the provided login keys, and ignore it for other resources. This option is an array of user structs, which contain information about the users that might login to the sliver that the AM needs to know about. For example, this option is the mechanism by which users supply their SSH public keys, permitting SSH login to allocated nodes. In such cases, the corresponding manifest RSpec will contain the `ssh-users` element on each such node, showing the login username and applicable public keys. When this option is supplied, each struct must include the key 'keys', which is an array of strings and can be empty. The struct must also include the key 'urn', which is the user’s URN string. For example:
     64{{{
     65[
     66  {
     67    urn: urn:publicid:IDN+geni.net:gcf+user+alice
     68    keys: [<ssh key>, <ssh key>]
     69  },
     70  {
     71    urn: urn:publicid:IDN+geni.net:gcf+user+bob
     72    keys: [<ssh key>]
     73  }
     74]
     75}}}
     76
     77=== `options` ===
     78An XML-RPC struct. For !GetVersion only, this argument is optional. In all other methods, it is required. Only !ListResources has required entries in the options struct. Aggregates are compliant with this API change by accepting this argument. Aggregates may accept entries to this struct. Aggregates should not require any new options to any method - they should always have a reasonable default for any such option. Aggregates should document new `options` arguments. The prefix `geni_` is reserved for members that are part of this API specification. Implementations should choose an appropriate prefix to avoid conflicts.
     79
     80=== `urns[]` ===
     81Several methods take some URNs to identify what to operate on. These methods are defined as accepting a list of arbitrary strings we call URNs.
     82This API defines two kinds of URNs that may be supplied here, slice URNs and sliver URNs (see [wiki:GeniApiIdentifiers the GENI identifiers page], and [wiki:AaronHelsinger/GAPI_AM_API_DRAFT#Adopted:ChangeSetK:Standardizecertificatesandcredentials Change Set K]). Some aggregates may understand other URNs, but these are not defined or required here. Aggregates that accept only URNs defined by this API will return an error when given URNs not in one of those forms.
     83This API requires that aggregates accept either a single slice URN, or 1+ sliver URNs that all belong to the same slice. Aggregates are not required to accept both a slice URN and sliver URNs, 2+ slice URNs, or a set of sliver URNs that crosses multiple slices. Some aggregates may choose to accept other such combinations of URNs. Aggregates that accept only arguments defined by this API will return an error when given more than 1 slice URN, a combination of both slice and sliver URNs, or a set of sliver URNs that belong to more than 1 slice.
     84
     85 == !GetVersion ==
     86Query static configuration information about this aggregate manager implementation, such as API and RSpec versions supported.
     87{{{
     88struct GetVersion([optional: struct options])
     89}}}
     90
     91The `options` argument may be omitted entirely by clients.
     92
     93Return struct:
     94{{{
     95
     96      {
     97        int geni_api;
     98        struct geni_api_versions {
     99             URL <this API version #>; # value is a URL, name is a number
     100             [optional: other supported API versions and the URLs where they run]
     101        }
     102        array geni_request_rspec_versions of {
     103             string type;
     104             string version;
     105             string schema;
     106             string namespace;
     107             array extensions of string;
     108        };
     109        array geni_ad_rspec_versions of {
     110             string type;
     111             string version;
     112             string schema;
     113             string namespace;
     114             array extensions of string;
     115        };
     116        array geni_credential_types of {
     117             string geni_type <case insensitive>;
     118             string geni_version <containing an integer>;
     119       };
     120    }
     121}}}
     122
     123 == !ListResources ==
     124Retrieve RSpecs listing resources at this aggregate, an Advertisement RSpec of available resources.
     125
     126{{{
     127struct ListResources(struct credentials[], struct options)
     128}}}
     129
     130Where options include:
     131{{{
     132{
     133  boolean geni_available <optional>;
     134  boolean geni_compressed <optional>;
     135  struct geni_rspec_version {
     136    string type;
     137    string version;
     138  };
     139}
     140}}}
     141
     142Note that all options may be omitted by the client, exception `geni_rspec_version` which is required. The aggregate must honor all supplied options.
     143
     144`credentials` is the standard argument defined above.
     145
     146Return:
     147A `geni.rspec` advertisment RSpec.
     148
     149 == Describe ==
     150AKA !ListResources when supplied a slice URN.
     151
     152Retrieve a manifest describing the resources contained by the entities named, e.g. a single slice or a set of the slivers in a slice.
     153{{{
     154struct Describe(string urns[], struct credentials[], struct options[])
     155}}}
     156
     157Where options include:
     158{{{
     159{
     160  boolean geni_compressed <optional>;
     161  struct geni_rspec_version {
     162    string type;
     163    string version;
     164  };
     165}
     166}}}
     167
     168Note that all options may be omitted by the client, exception `geni_rspec_version` which is required. The aggregate must honor all supplied options.
     169
     170`credentials` is the standard argument defined elsewhere.
     171
     172Note that the manifest RSpec for allocated slivers may contain less detail than for provisioned slivers.
     173
     174Return struct:
     175{{{
     176{
     177   geni_rspec: <geni.rspec, Manifest - may be empty though)>
     178   geni_urn: <string slice urn, as requested>
     179   geni_slivers: [
     180               {
     181                  geni_sliver_urn: <string sliver urn>
     182                  geni_expires: <dateTime.rfc3339 allocation expiration string, as in geni_expires from SliversStatus>,
     183                  geni_allocation_status: <string sliver state - allocated or ?? >,
     184                  geni_operational_status: <string sliver operational state>
     185               },
     186               ...
     187         ]
     188}
     189}}}
     190
     191Aggregates are expected to combine the manifests of all requested slivers into a single manifest RSpec.
     192
     193FIXME: Allow multiple manifests? Options to specify only allocated or only provisioned slivers?
     194 == Allocate ==
     195AKA !CreateSlivers()
     196Request resources described by the given request RSpec to be allocated to the given slice. On success, one or more slivers are allocated, containing resources satisfying the request, and assigned to the given slice. The manifest RSpec describing those resources is returned.
     197{{{
     198struct Allocate(string slice_urn,
     199                    struct credentials[],
     200                    geni.rspec rspec,
     201                    struct options)
     202}}}
     203
     204`credentials` is the standard argument defined above.
     205
     206Options include:
     207{{{
     208{
     209  [optional geni_end_time: <dateTime.rfc3339>]
     210}
     211}}}
     212
     213Return struct:
     214{{{
     215{
     216 geni_rspec: <geni.rspec manifest>,
     217 geni_slivers: [
     218        {
     219                  geni_sliver_urn: <string sliver urn>
     220                  geni_expires: <dateTime.rfc3339 allocation expiration string, as in geni_expires from SliversStatus>,
     221                  geni_allocation_status: <string sliver state - allocated or ?? >
     222        },
     223        ...
     224    ]
     225}
     226}}}
     227
     228The manifest is a manifest of only newly allocated slivers.
     229
     230 == Renew ==
     231AKA !RenewSliver() or !RenewAllocated
     232Request 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.
     233
     234{{{
     235struct Renew(string urns[],
     236                    struct credentials[],
     237                    dateTime.rfc3339 expiration_time,
     238                    struct options)
     239}}}
     240
     241`credentials` is the standard argument defined above.
     242
     243Options include {{{geni_best_effort}}}
     244
     245Return list of structs:
     246{{{
     247[
     248  {
     249   geni_sliver_urn: <string>,
     250   geni_allocation_status: <string>,
     251   geni_operational_status: <string>,
     252   geni_expires: <dateTime.rfc3339 when the sliver expires from its current state>,
     253  },
     254  ...
     255]
     256}}}
     257
     258 == !UpdateAllocations ==
     259AKA !UpdateAllocated()
     260This 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.
     261
     262Details are suppressed pending agreement on this method.
     263{{{
     264#!comment
     265
     266{{{
     267struct UpdateAllocations(string urns[], struct credentials[], geni.rspec rspec,
     268                                struct options)
     269}}}
     270
     271`credentials` is the standard argument defined above.
     272
     273Options include:
     274 - {{{geni_end_time}}}:
     275 - {{{geni_best_effort}}}
     276
     277Return struct:
     278{{{
     279{
     280 geni_rspec: <geni.rspec manifest>,
     281 geni_slivers: [
     282        {
     283                  geni_sliver_urn: <string sliver urn>
     284                  geni_expires: <dateTime.rfc3339 allocation expiration string, as in geni_expires from SliversStatus>,
     285                  geni_allocation_status: <string sliver state - allocated or ?? >
     286        },
     287        ...
     288    ]
     289}
     290}}}
     291
     292The manifest is a manifest of only referenced allocated slivers.
     293
     294FIXME: Is this the same method as for updating provisioned slivers?
     295}}}
     296
     297 == Provision ==
     298AKA !ProvisionSlivers()
     299Request 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.
     300
     301{{{
     302struct Provision(string urns[], struct credentials[], 
     303                                   struct options)
     304}}}
     305
     306`credentials` is the standard argument defined above.
     307
     308Options include:
     309 - {{{geni_best_effort}}}
     310 - {{{geni_end_time}}}
     311 - `struct geni_users[]`
     312
     313Return struct:
     314{{{
     315  geni_rspec: <geni.rspec, RSpec manifest>,
     316  geni_slivers:
     317  [
     318    {
     319     geni_sliver_urn: <string>,
     320     geni_allocation_status: <string>,
     321     geni_operational_status: <string>,
     322     geni_expires <dateTime.rfc3339 when the sliver expires from its current state>,
     323    },
     324    ...
     325  ],
     326}}}
     327
     328FIXME: Is the returned manifest only for newly provisioned slivers? Or all slivers at this AM for this slice?
     329
     330 == !UpdateSlivers ==
     331AKA Update()
     332This method requests a modification to 1 or more provisioned slivers. The slivers end up in a new `geni_allocated+geni_provisioned` state.
     333
     334Details are suppressed pending agreement on this method.
     335{{{
     336#!comment
     337
     338{{{
     339struct UpdateSlivers(string urns[], struct credentials[], geni.rspec rspec,
     340                                                 struct options)
     341}}}
     342
     343`credentials` is the standard argument defined above.
     344
     345Options include:
     346 - {{{geni_end_time}}}
     347 - {{{geni_best_effort}}}
     348 - `struct geni_users[]`
     349
     350Return struct:
     351{{{
     352{
     353 rspec: <geni.rspec manifest>,
     354 geni_slivers: [
     355        {
     356                  geni_sliver_urn: <string sliver urn>
     357                  geni_expires: <dateTime.rfc3339 allocation expiration string, as in geni_expires from SliversStatus>,
     358                  geni_allocation_status: <string sliver state - allocated or ?? >
     359        },
     360        ...
     361    ]
     362}
     363}}}
     364
     365The RSpec argument may be a new delta format.
     366The manifest is a manifest of only referenced provisioned slivers.
     367
     368FIXME: Is this the same method as for updating allocated slivers?
     369FIXME: Return both a manifest and a delta RSpec?
     370}}}
     371
     372 == Status ==
     373AKA !SliverStatus
     374Retrieve status information about the named slivers. This should be relatively dynamic data, not descriptive data as returned in the manifest RSpec.
     375
     376
     377{{{
     378struct Status(string urns[], struct credentials[], struct options)
     379}}}
     380
     381`credentials` is the standard argument defined above.
     382
     383Return:
     384{{{
     385{
     386  geni_urn: <slice URN>
     387  geni_slivers: [
     388                    { geni_sliver_urn: <sliver URN>
     389                      geni_allocation_status: <string, eg provisioned>
     390                      geni_operational_status: <string, eg ready>
     391                      geni_expires: <dateTime.rfc3339 of individual sliver expiration>
     392                      geni_error: <string, eg ''>,
     393                     },
     394                    { geni_sliver_urn: <sliver URN>
     395                      geni_allocation_status: <string, eg provisioned>
     396                      geni_operational_status: <string, eg ready>
     397                      geni_expires: <dateTime.rfc3339 of individual sliver expiration>
     398                      geni_error: <string, eg ''>,
     399                      }
     400                  ]
     401}
     402}}}
     403
     404 == !PerformOperationalAction ==
     405Perform the named operational action on the named slivers, possibly changing the `geni_operational_status` of the named slivers.
     406
     407{{{
     408struct PerformOperationalAction (string urns[], struct credentials[], string action,
     409                                                    struct options={})
     410}}}
     411
     412`credentials` is the standard argument defined above.
     413
     414Options include: {{{geni_best_effort}}}
     415
     416Return list of structs:
     417{{{
     418[ {
     419        geni_sliver_urn : <string>,
     420        geni_allocation_status: <string, eg provisioned>
     421        geni_operational_status : <string>,
     422        geni_expires: <dateTime.rfc3339 of individual sliver expiration>
     423        },
     424        ...
     425]
     426;
     427}}}
     428
     429 == Delete ==
     430AKA !DeleteSliver
     431Delete the named slivers, making them `geni_unallocated`. Resources are de-provisioned. No further AM API operations may be performed on slivers that have been deleted.
     432
     433{{{
     434struct Delete(string urns, struct credentials[], struct options)
     435}}}
     436
     437`credentials` is the standard argument defined above.
     438
     439Options include: {{{geni_best_effort}}}
     440
     441Return list of structs:
     442{{{
     443[
     444  {
     445   geni_sliver_urn: <string>,
     446   geni_allocation_status: <string>,
     447   geni_expires: <dateTime.rfc3339 when the sliver expires from its current state>,
     448  },
     449  ...
     450]
     451}}}
     452
     453 == Shutdown ==
     454Perform 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.
     455{{{
     456struct Shutdown(string slice_urn, struct credentials[], struct options)
     457}}}
     458
     459`credentials` is the standard argument defined above.
     460
     461Return: XML-RPC boolean