diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f20072b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +federation-am-api.html diff --git a/README.md b/README.md index 60139f0..1294e0d 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,12 @@ federation-am-api ================= Standardisation spec of the Federation Aggregate Manager API for testbeds + +Install theme +------------- + +```bash + $ cd /tmp + $ wget http://powerman.name/download/asciidoc/compact-1.3.zip + $ asciidoc --theme install compact-1.3.zip +``` \ No newline at end of file diff --git a/architecture.adoc b/architecture.adoc new file mode 100644 index 0000000..35ef87f --- /dev/null +++ b/architecture.adoc @@ -0,0 +1,7 @@ +== Architecture and concepts + +TODO + +=== History + +TODO diff --git a/calls.adoc b/calls.adoc new file mode 100644 index 0000000..7e5c802 --- /dev/null +++ b/calls.adoc @@ -0,0 +1,252 @@ +== Specific Calls + +TODO + +=== GetVersion + +TODO + +=== Allocate + +TODO + +=== Provision + +TODO + +=== PerformperationalAction + +TODO + +=== Status + +TODO + +=== Describe + +TODO + +=== Renew + +TODO + +[NOTE] +==================================================== +_Wim Van de Meerssche:_ + +There is an issue regarding the return value of Renew, in the cases mutliple +slivers are renewed. See https://github.com/wvdemeer/federation-am-api/issues/1 +==================================================== + +=== Delete + +TODO + +=== Shutdown + +TODO + +[[ListResources]] +=== 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 advertisement RSpecs. + +.ListResources Call Syntax +[source] +---------------- +ListResources(array credentials, struct rspec_version, struct options) +---------------- + +Options defined in this API are: + +* +boolean :available+ +* +boolean :compressed+ + +Return type: +string+ + +==== Argument 1: +credentials+ + +*********************************** +[horizontal] +Supported by the server:: Mandatory +Included by client:: Mandatory +XmlRpc type:: +array of struct+ +*********************************** + +A list of credentials, see <>. When using SFA style credentials, this list must include a valid user credential, granting rights to the caller of the method. + +NOTE: _Wim Van de Meerssche:_ Are slice credentials allowed or +disallowed as authorization for +ListResources+? Or is it always policy of the testbed, with minimum allowed being a user credential of a user at a trusted root. + +==== Argument 2: +rspec_version+ + +*********************************** +[horizontal] +Supported by the server:: Mandatory +Included by client:: Mandatory +XmlRpc type:: +[source] + struct { + string type; # case insensitive + string version; # case insensitive + } +*********************************** + +//////////////////////////////////// +[NOTE] +[caption="Details", icon=None] +==================================== +[horizontal] +Supported by the server:: Mandatory +Included by client:: Mandatory +XmlRpc type:: +[source] + struct { + string type; # case insensitive + string version; # case insensitive + } +==================================== +//////////////////////////////////// + +An XML-RPC struct indicating the type and version of Advertisement RSpec to +return. The struct contains 2 members, type and version. type and version are +case-insensitive strings, matching those in +:ad_rspec_versions+ as returned +by +GetVersion+ at this aggregate. Aggregates should return a :code of 4 +(BADVERSION) if the requested RSpec version is not one advertised as supported +in +GetVersion+. + +TODO: add link to rspec document + +==== Argument 3: +options+ + +A struct containting optional arguments, indexed by name. See <>. + +==== Option: +:available+ + +*********************************** +[horizontal] +Supported by the server:: Mandatory +Included by client:: Optional +XmlRpc type:: +boolean+ +*********************************** + +An XML-RPC boolean value indicating whether the caller is interested in all resources or available resources. If this value is true (1), the result should contain only available resources. If this value is false (0) or unspecified, both available and allocated resources should be returned. The Aggregate Manager is free to limit visibility of certain resources based on the credentials parameter. + +[[OptionCompressed]] +==== Option: +:compressed+ + +*********************************** +[horizontal] +Supported by the server:: Mandatory +Included by client:: Optional +XmlRpc type:: +boolean+ +*********************************** + +//////////////////////////////////// +[NOTE] +[caption="Details", icon=None] +==================================== +[horizontal] +Supported by the server:: Mandatory +Included by client:: Optional +XmlRpc type:: +boolean+ +==================================== +//////////////////////////////////// + +An XML-RPC boolean value indicating whether the caller would like the result +to be compressed. If the value is true (1), the returned resource list will be +compressed according to RFC 1950. If the value is false (0) or unspecified. +Note: compressed or not, the XML-RPC return type of the +ListResources+ value field will always be text. + +==== Return: Advertisement RSpec + +*********************************** +[horizontal] +XmlRpc type:: +string+ +*********************************** + +//////////////////////////////////// +[NOTE] +[caption="Details", icon=None] +==================================== +[horizontal] +XmlRpc type:: +string+ +==================================== +//////////////////////////////////// + ++ListResources+ returns the standard return struct from all AM API methods (output, value, code). See <>. + +The value contains an XmlRpc +string+ containing an Advertisement RSpec, or an XmlRpc +string+ containing a compressed RSpec (see <>). +The returned advertisement RSpec lists and describes resources at this aggregate. Depending on the arguments, these may be all local resources, or only available local resources. + +NOTE: _Wim Van de Meerssche:_ When +compressed+ this returns an +string+ containing base64 encoded +binary data. The binary data is the compressed rspec. This is a bit strange, +because XmlRpc has a type, which could be used instead of a string. +This is implemented this way on aggregates. The reason for this might be that +is is not implemented correctly in some XmlRpc libraries? Does anyone have +more info? In any case, *this should be documented clearly, including an +example (in actual XML, not JSON)*. It might be an option to document this as +`Servers should send a +string+ containing a base64 encoded compressed rspec. +Clients should expect EITHER this +string+ or a +base64+ and work in both +cases.' + +NOTE: _Wim Van de Meerssche:_ This brings up something similar: Dates are encoded with RFC3339 and send as XmlRpc +string+ type. +However, XmlRpc has a +dateTime.iso8601+ type. Why? Library support again? +Again *this should be very clearly documented, with examples*. Also again, we +might require the sender (client or server, depending on call) to do a +specific thing, and require the receiver to handle both cases. + +==== Errors + +See <> for general errors. +There are no special cases for the +ListResources+ call. + +NOTE: _Wim Van de Meerssche:_ I don't think there is a need to describe +errors specifically for +ListResources+. The way they are described in general +should be enough here, there is nothing specific about the errors that +ListResources can generate. + +==== Examples +.Example Request (JSON syntax) +[source] +------------ +[ + [ + { + ":type": "geni_sfa", + ":version": "3", + ":value": " + " + } + ], + { + ":available": true, + ":rspec_version": { + "version": "3", + "type": "geni" + }, + ":compressed": false + } +] +----------------- + +.Example reply (JSON syntax) +[source] +------------------ +{ +"output": "", +"code": { + ":code": 0 + }, +"value": " + + ... (actual RSpec ommited) + " +} +------------------ + diff --git a/concepts.adoc b/concepts.adoc new file mode 100644 index 0000000..48d2960 --- /dev/null +++ b/concepts.adoc @@ -0,0 +1,54 @@ +== Basic Concepts + +TODO + +=== HTTPS with Client Authentication + +TODO + +=== XmlRpc + +TODO + +[[ReturnStructure]] +=== Return Structure + +TODO: describe return structure + +.Reply template (JSON syntax) +[source] +------------------ +{ + "output": "Error output of call", + "code": { + ":code": 0 + }, + "value": "result of call" +} +------------------ + +TODO: Add example in full XML + +TODO: Add some examples. These can be the same as examples later on in the +document. + +[[ErrorCodes]] +==== Error Codes + +TODO + + + +[[Credentials]] +=== Credential Array Argument + +TODO + +=== Rspec Versions + +TODO + +[[OptionsArgument]] +=== Options Argument + +NOTE: TODO: Explain. Basically comes down to: `The +options+ argument contains only optional arguments, direct arguments are always required.' diff --git a/federation-am-api.adoc b/federation-am-api.adoc index c36c869..9a34d9c 100644 --- a/federation-am-api.adoc +++ b/federation-am-api.adoc @@ -12,318 +12,8 @@ Work in progress ==================================================== -== Architecture and concepts +include::architecture.adoc[] -TODO - -=== History - -TODO - -== Basic Concepts - -TODO - -=== HTTPS with Client Authentication - -TODO - -=== XmlRpc - -TODO - -[[ReturnStructure]] -=== Return Structure - -TODO: describe return structure - -.Reply template (JSON syntax) -[source] ------------------- -{ - "output": "Error output of call", - "code": { - ":code": 0 - }, - "value": "result of call" -} ------------------- - -TODO: Add example in full XML - -TODO: Add some examples. These can be the same as examples later on in the -document. - -[[ErrorCodes]] -==== Error Codes - -TODO - - - -[[Credentials]] -=== Credential Array Argument - -TODO - -=== Rspec Versions - -TODO - -[[OptionsArgument]] -=== Options Argument - -NOTE: TODO: Explain. Basically comes down to: `The +options+ argument contains only optional arguments, direct arguments are always required.' - -== Specific Calls - -TODO - -=== GetVersion - -TODO - -=== Allocate - -TODO - -=== Provision - -TODO - -=== PerformperationalAction - -TODO - -=== Status - -TODO - -=== Describe - -TODO - -=== Renew - -TODO - -[NOTE] -==================================================== -_Wim Van de Meerssche:_ - -There is an issue regarding the return value of Renew, in the cases mutliple -slivers are renewed. See https://github.com/wvdemeer/federation-am-api/issues/1 -==================================================== - -=== Delete - -TODO - -=== Shutdown - -TODO - -[[ListResources]] -=== 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 advertisement RSpecs. - -.ListResources Call Syntax -[source] ----------------- -ListResources(array credentials, struct rspec_version, struct options) ----------------- - -Options defined in this API are: - -* +boolean :available+ -* +boolean :compressed+ - -Return type: +string+ - -==== Argument 1: +credentials+ - -*********************************** -[horizontal] -Supported by the server:: Mandatory -Included by client:: Mandatory -XmlRpc type:: +array of struct+ -*********************************** - -A list of credentials, see <>. When using SFA style credentials, this list must include a valid user credential, granting rights to the caller of the method. - -NOTE: _Wim Van de Meerssche:_ Are slice credentials allowed or -disallowed as authorization for +ListResources+? Or is it always policy of the testbed, with minimum allowed being a user credential of a user at a trusted root. - -==== Argument 2: +rspec_version+ - -*********************************** -[horizontal] -Supported by the server:: Mandatory -Included by client:: Mandatory -XmlRpc type:: -[source] - struct { - string type; # case insensitive - string version; # case insensitive - } -*********************************** - -//////////////////////////////////// -[NOTE] -[caption="Details", icon=None] -==================================== -[horizontal] -Supported by the server:: Mandatory -Included by client:: Mandatory -XmlRpc type:: -[source] - struct { - string type; # case insensitive - string version; # case insensitive - } -==================================== -//////////////////////////////////// - -An XML-RPC struct indicating the type and version of Advertisement RSpec to -return. The struct contains 2 members, type and version. type and version are -case-insensitive strings, matching those in +:ad_rspec_versions+ as returned -by +GetVersion+ at this aggregate. Aggregates should return a :code of 4 -(BADVERSION) if the requested RSpec version is not one advertised as supported -in +GetVersion+. - -TODO: add link to rspec document - -==== Argument 3: +options+ - -A struct containting optional arguments, indexed by name. See <>. - -==== Option: +:available+ - -*********************************** -[horizontal] -Supported by the server:: Mandatory -Included by client:: Optional -XmlRpc type:: +boolean+ -*********************************** - -An XML-RPC boolean value indicating whether the caller is interested in all resources or available resources. If this value is true (1), the result should contain only available resources. If this value is false (0) or unspecified, both available and allocated resources should be returned. The Aggregate Manager is free to limit visibility of certain resources based on the credentials parameter. - -[[OptionCompressed]] -==== Option: +:compressed+ - -*********************************** -[horizontal] -Supported by the server:: Mandatory -Included by client:: Optional -XmlRpc type:: +boolean+ -*********************************** - -//////////////////////////////////// -[NOTE] -[caption="Details", icon=None] -==================================== -[horizontal] -Supported by the server:: Mandatory -Included by client:: Optional -XmlRpc type:: +boolean+ -==================================== -//////////////////////////////////// - -An XML-RPC boolean value indicating whether the caller would like the result -to be compressed. If the value is true (1), the returned resource list will be -compressed according to RFC 1950. If the value is false (0) or unspecified. -Note: compressed or not, the XML-RPC return type of the +ListResources+ value field will always be text. - -==== Return: Advertisement RSpec - -*********************************** -[horizontal] -XmlRpc type:: +string+ -*********************************** - -//////////////////////////////////// -[NOTE] -[caption="Details", icon=None] -==================================== -[horizontal] -XmlRpc type:: +string+ -==================================== -//////////////////////////////////// - -+ListResources+ returns the standard return struct from all AM API methods (output, value, code). See <>. - -The value contains an XmlRpc +string+ containing an Advertisement RSpec, or an XmlRpc +string+ containing a compressed RSpec (see <>). -The returned advertisement RSpec lists and describes resources at this aggregate. Depending on the arguments, these may be all local resources, or only available local resources. - -NOTE: _Wim Van de Meerssche:_ When +compressed+ this returns an +string+ containing base64 encoded -binary data. The binary data is the compressed rspec. This is a bit strange, -because XmlRpc has a type, which could be used instead of a string. -This is implemented this way on aggregates. The reason for this might be that -is is not implemented correctly in some XmlRpc libraries? Does anyone have -more info? In any case, *this should be documented clearly, including an -example (in actual XML, not JSON)*. It might be an option to document this as -`Servers should send a +string+ containing a base64 encoded compressed rspec. -Clients should expect EITHER this +string+ or a +base64+ and work in both -cases.' - -NOTE: _Wim Van de Meerssche:_ This brings up something similar: Dates are encoded with RFC3339 and send as XmlRpc +string+ type. -However, XmlRpc has a +dateTime.iso8601+ type. Why? Library support again? -Again *this should be very clearly documented, with examples*. Also again, we -might require the sender (client or server, depending on call) to do a -specific thing, and require the receiver to handle both cases. - -==== Errors - -See <> for general errors. -There are no special cases for the +ListResources+ call. - -NOTE: _Wim Van de Meerssche:_ I don't think there is a need to describe -errors specifically for +ListResources+. The way they are described in general -should be enough here, there is nothing specific about the errors that -ListResources can generate. - -==== Examples -.Example Request (JSON syntax) -[source] ------------- -[ - [ - { - ":type": "geni_sfa", - ":version": "3", - ":value": " - " - } - ], - { - ":available": true, - ":rspec_version": { - "version": "3", - "type": "geni" - }, - ":compressed": false - } -] ------------------ - -.Example reply (JSON syntax) -[source] ------------------- -{ -"output": "", -"code": { - ":code": 0 - }, -"value": " - - ... (actual RSpec ommited) - " -} ------------------- +include::concepts.adoc[] +include::calls.adoc[]