OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

camp message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] Commented: (CAMP-30) Parameter Scheme


    [ http://tools.oasis-open.org/issues/browse/CAMP-30?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32207#action_32207 ] 

Adrian Otto commented on CAMP-30:
---------------------------------

I have considered RFC6570, the original proposal, and the comments. I plan to make a proposal that tries to keep the solution as simple as possible while still providing the ability to pass parameters to the template resources. Because the number of templates may be large in some use cases, I prefer to keep the parameters in the HTTP Request body rather than in the URI.

I plan to use a reserved attribute name called "CAMP:parameters" that can be included in the body of the POST Request to the template resource. I will require that the Platform must check for all reserved attribute names, and fail to deploy an application package from any PDP that provides a template that contains a reserved attribute name. To begin with, the only reserved attribute name will be: "CAMP:parameters".

Templates may set the value of dynamic attributes to the special string "CAMP:parameter". These attributes will be set in the instantiated resource by using the values from the POST request to the template resource. Attribute names will be matched from the "CAMP:parameters" attribute. Template attributes set to the special string value "CAMP:parameter" that are not matched with a "CAMP:parameters" attribute are not created in the resulting resource. If a parameter for a mandatory attribute such as "name" is missing from CAMP:templateParameters, then a 400 Bad Request error is returned to the client.

If a templateParameters attribute is supplied in the POST request body, and the targeted attribute is not set to "CAMP:parameter", then a 400 Bad Request error is returned.

Setting the attribute called "name" will be a special case, because templates have names, and so do the resulting entities. You may pass a parameter for the "name" attribute regardless what value it is set to in the template.

Example:

Template:

{
"definition": "some JSON here",
"name" : "Cool Assembly Template",
"serialNumber" : "CAMP:parameter",
"garbage" : "CAMP:parameter",
"uri" : "/12342/AssemblyTemplates/1"
} 


POST /12342/AssemblyTemplates/1 HTTP/1.1
Host: example.org
Content-Type: application/json
Content-Length: 77

{ "CAMP:parameters" : { "name" : "Rackspace Test", "serialNumber" : "123" } }

The platform would then produce an Assembly resource like this:

{
"name" : "Rackspace Test",
"serialNumber" : "123",
"uri" : "/12342/Assembly/1"
} 

Feedback welcome. 

> Parameter Scheme
> ----------------
>
>                 Key: CAMP-30
>                 URL: http://tools.oasis-open.org/issues/browse/CAMP-30
>             Project: OASIS Cloud Application Management for Platforms (CAMP) TC
>          Issue Type: Improvement
>          Components: Spec
>            Reporter: Adrian Otto
>            Assignee: Adrian Otto
>            Priority: Critical
>
> Create a well defined template parameter scheme that can be used to express special labels in template resource attributes that are used for supplying values upon instantiating entities using the template. In addition to a template parameter label, we also need a standard mechanism to specify values for the labels when using the API.
> This feature can be used for supplying a unique name to an Application Assembly at the time it is created and started. This would allow multiple Application Assemblies to be created from the same template to run concurrently, and offer a way to easily tell them apart from each other. The scheme should be flexible such that it works for Component Templates as well, so that it can be used for passing in configuration parameters that are employed by a downstream configuration management system.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]