[occi-wg] JSON Rendering Proposal to add CRUD Verb

Jamie Marshall ijm667 at hotmail.com
Thu May 3 09:13:25 EDT 2012


Hello All,
I agree with you Florian, CRUD is really just another set of words for the same things as REST which is the same thing as HTTP 1.1 anyway.The verbs were put in place way back so we can use them as is. ( in my honest opinion )
SincerelyJamie


From: florian.feldhaus at gwdg.de
To: garymazzaferro at gmail.com
Date: Thu, 3 May 2012 12:10:24 +0000
CC: occi-wg at ogf.org
Subject: Re: [occi-wg] JSON Rendering  Proposal to add CRUD Verb

Hi Gary,
 
that's an interesting idea, but from my point of view it may be a bit over the top. CRUD really is such a basic thing, that I don't think we need a dedicated action for it. I usually see the actions as being some kind of methods for the OCCI entities. Then create would be the initialize method and delete the destroy method. Both don't have to be implemented, because they are already implemented in some base class. Read and update are just getters and setters for the attributes and usually don't need to be implemented separately.
 
Cheers,
Florian
 
Am 03.05.2012 um 09:43 schrieb Gary Mazz:
 
> Hi,
> 
> I have a proposal for an addition to the OCCI JSON specification. This proposal is not limited to the JSON specification and may also impact the OCCI Core specification. 
> 
> The JSON specification has nearly fully decoupled OCCI information from the HTTP protocol.  OCCI information represented in JSON is a complete object (frame) serialization.  
> 
> To use the JSON as a declarative document (script)  or take advantage of agnostic transports (i.e. a messaging bus or workflow system) , we need a way to define CRUD operations in the JSON. 
> 
> The OCCI scheme has actions associated with category.  The CRUD actions are inherited by Kind and Mixin, which means inherited by Entity.
> 
> 
> I propose we associate CRUD with category actions. 
> 
> The ABNF is represented below:
> 
>   DeclarativeJSON = CRUD ; OCCI
>   CRUD = CREATE / RETRIEVE / UPDATE / DELETE 
> The definitions:
> 
> scheme  : http://schemas.ogf.org/occi/core/category/action
> term    : CREATE
> mutable : true
> required: false
> type    : string
> 
> scheme  : http://schemas.ogf.org/occi/core/category/action
> term    : RETRIEVE
> mutable : true
> required: false
> type    : string
> 
> scheme  : http://schemas.ogf.org/occi/core/category/action
> term    : UPDATE
> mutable : true
> required: false
> type    : string
> 
> scheme  : http://schemas.ogf.org/occi/core/category/action
> term    : DELETE
> mutable : true
> required: false
> type    : string
> 
> We would have three (3) presentations:  
> 1) The JSON "actions" encapsulating Resources, 
> 2) Resources showing inherited CRUD in JSON "actions" 
> 3) In classes' JSON "actions"
> Examples Below:
> 1) The JSON "actions" encapsulating Resources:
> {
>   "actions": [
>         "title": "CRUD Create Operation",
>         "rel": "http://schemas.ogf.org/occi/core/category/action#CREATE"
>         "resources":[.......]
>         ],
>         [
>         "title": "CRUD Delete Operation",
>         "rel": "http://schemas.ogf.org/occi/core/category/action#DELETE"
>         "resources":[.......]
>         ]
> }
> 
> 2) Resources showing inherited CRUD in JSON "actions":
> {
> "links": [
>      {
>          "title": "My disk",
>          "target": "http://myservice.tld/storage/456",
>          "rel": [ "http://schemas.ogf.org/occi/infrastructure#storage" ],
>          "kind": "http://schemas.ogf.org/occi/infrastructure#storagelink"
>           "attributes": { "occi.storagelink.deviceid": "ide:0:1" },
>           "actions": [
>                 "title": "CRUD Create Operation",
>                 "rel": "http://schemas.ogf.org/occi/core/category/action#CREATE"
>             ]
>      }
>  ]
> }
> 
> 3) In Classes' JSON "actions":
> {
>     "kinds": [
>     {
>         "term": "compute",155 "scheme": "http://schemas.ogf.org/occi/infrastructure#",
>         "title": "Compute Resource",
>         "related": [
>             "http://schemas.ogf.org/occi/core#resource"
>         ],
>         "attributes": {
>             "occi": {
>                 "compute": {
>                     "hostname": {
>                         "mutable": true,
>                         "required": false,
>                         "type": "string",
>                         "pattern": "(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*"
>                     },
>                     "state": {
>                         "mutable": false,
>                         "required": false,
>                         "type": "string",
>                         "pattern": "inactive|active|suspended|failed",
>                         "default": "inactive"
>                     },
>                     ...
>                 }
>             }
>         },
>         "actions": [
>             "http://schemas.ogf.org/occi/core/category/action#CREATE",
>             "http://schemas.ogf.org/occi/core/category/action#RETRIEVE",
>             "http://schemas.ogf.org/occi/core/category/action#UPDATE",
>             "http://schemas.ogf.org/occi/core/category/action#DELETE",
>             "http://schemas.ogf.org/occi/infrastructure/compute/action#start",
>             "http://schemas.ogf.org/occi/infrastructure/compute/action#stop",
>             "http://schemas.ogf.org/occi/infrastructure/compute/action#restart",
>             "http://schemas.ogf.org/occi/infrastructure/compute/action#suspend"
>         ],
>         "location": "/compute/"
>     },
>     ...
> ],
> "mixins": [
>     {
>         "term": "medium",
>         "scheme": "http://example.com/templates/resource#",
>         "title": "Medium VM",
>         "related": [
>             "http://schemas.ogf.org/occi/infrastructure#resource_tpl",
>             "http://schemas.ogf.org/occi/infrastructure#compute"
>         ],
>         "attributes": {
>             "occi": {
>                 "compute": {
>                     "speed": {
>                         "type": "number",
>                         "default": 2.8
>                     }
>                 }
>             }
>         },
>         "actions": [
>             "http://schemas.ogf.org/occi/core/category/action#CREATE",
>             "http://schemas.ogf.org/occi/core/category/action#RETRIEVE",
>             "http://schemas.ogf.org/occi/core/category/action#UPDATE",
>             "http://schemas.ogf.org/occi/core/category/action#DELETE",
>         ],
>     },
>     ...
> ],
> "actions": [
>     {
>         "term": "stop",
>         "scheme": "http://schemas.ogf.org/occi/infrastructure/compute/action#",
>         "title": "Stop Compute instance",
>         "attributes": {
>             "method": {
>                 "mutable": true,
>                 "required": false,
>                 "type": "string",
>                 "pattern": "graceful|acpioff|poweroff",
>                 "default": "poweroff"
>             }
>         }
>    },
>    {
>        "term": "CREATE",
>        "scheme": "http://schemas.ogf.org/occi/core/category/action#",
>        "title": "CREATE Compute instance",
>        "attributes": {
>            "method": {
>               "mutable": false,
>                "required": false,
>                "type": "string",
>            }
>        }
>    },
>    {
>        "term": "RETRIEVE",
>        "scheme": "http://schemas.ogf.org/occi/core/category/action#",
>        "title": "RETRIEVE Compute instance",
>        "attributes": {
>            "method": {
>               "mutable": false,
>                "required": false,
>                "type": "string",
>            }
>        }
>    },
>    {
>        "term": "UPDATE",
>        "scheme": "http://schemas.ogf.org/occi/core/category/action#",
>        "title": "RETRIEVE Compute instance",
>        "attributes": {
>            "method": {
>               "mutable": false,
>                "required": false,
>                "type": "string",
>            }
>        }
>    },
>    {
>        "term": "DELETE",
>        "scheme": "http://schemas.ogf.org/occi/core/category/action#",
>        "title": "DELETE Compute instance",
>        "attributes": {
>            "method": {
>               "mutable": false,
>                "required": false,
>                "type": "string",
>            }
>        }
>    },
>    ...
>    ]
> }
> 
> 
> -gary
> 
> _______________________________________________
> occi-wg mailing list
> occi-wg at ogf.org
> https://www.ogf.org/mailman/listinfo/occi-wg
 

_______________________________________________
occi-wg mailing list
occi-wg at ogf.org
https://www.ogf.org/mailman/listinfo/occi-wg 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/occi-wg/attachments/20120503/67243009/attachment-0001.html>


More information about the occi-wg mailing list