ow2 webinar erocci

19
© 2014 Jean Parpaillon 1

Upload: jean-parpaillon

Post on 25-Dec-2014

87 views

Category:

Technology


0 download

DESCRIPTION

erocci is a new erlang frameowrk for building OCCI compliant REST APIs.

TRANSCRIPT

Page 1: Ow2 webinar erocci

©2014JeanParpaillon

1

Page 2: Ow2 webinar erocci

©2014JeanParpaillon

LET'SGOCLOUDWATCHING

ISCLOUDVIRTUALIZATION?ISCLOUDSTORAGE?ISCLOUDWEB++?

2

Page 3: Ow2 webinar erocci

©2014JeanParpaillon

CLOUDISREST...

intcreate_vm(char*name,intcores,intmem);

defget_bucket(size)

module:erase_stuff/3

GEThttp://example.com/bucket?size=12

PUThttp://example.com/vm{"name":"myvm1","cores":4,"mem":2.5}

DELETEhttp://example.com/stuff/id1

objectoriented

relationaltables

relationaltables

Resourceoriented

factorypattern

builder iteratorobserver

C(reate)R(ead)U(pdate)D(elete)

3

Page 4: Ow2 webinar erocci

©2014JeanParpaillon

...SOISEROCCI

PUT/myresource/id1

CREATE

POST/myresource/id1

UPDATE

GET/myresource/id1

READ

DELETE/myresource/id1

DELETE

4

Page 5: Ow2 webinar erocci

©2014JeanParpaillon

"YETANOTHERRESTFRAMEWORK"?

RESTAPIslookssimilar,butarenotinteroperable

5

Page 6: Ow2 webinar erocci

©2014JeanParpaillon

OCCIISTYPED

Kind:anamedlistofattributesandactionse.g.:http://schemas.ogf.org/occi/infrastructure#compute

Attribute:name,type(string,numeric,etc),mutability,occurrence,defaultvalue

Resource:aninstanceofakind,identifiedwithaURI

Action:aninvocableoperationapplicabletoaresource

e.g.:http://schemas.ogf.org/occi/infrastructure/compute/action#start

Kindsareinheritable

Inheritsattributesandactions

6

Page 7: Ow2 webinar erocci

©2014JeanParpaillon

OCCIISEXTENSIBLE

Mixin:anamedsetofadditionalattributesandactionse.g.:http://schemas.ogf.org/occi/infrastructure/networkinterface#ipnetworkinterface

Resourcecanbeassociatedwithoneorseveralmixin

UserMixin:ausercancreateitsownmixin,totagresourcese.g.:http://example.com/occi/mixins#my_group1

7

Page 8: Ow2 webinar erocci

©2014JeanParpaillon

OCCIISRELATIONAL

Linksareresourceswithspecificattributes:occi.core.source:resourceURIocci.core.target:resourceURI

AcollectionisalistofresourceURIsofthesamekind/mixinGET/collections/compute/GET/collections/os_tpl/

8

Page 9: Ow2 webinar erocci

©2014JeanParpaillon

OCCIISSELF-DESCRIBED

GET/-/(capabilities)Listofsupportedkinds+descriptionListofsupportedmixins+descriptionListofsupportedactions+description

Capabilitiesshowcollection'sURLhttp://schemas.ogf.org/occi/infrsatructure#compute->/collections/compute

9

Page 10: Ow2 webinar erocci

©2014JeanParpaillon

OCCIISMETA-MODELBASED

Categoryscheme:URIterm:Stringtitle:String[0..1]

Kind MixinAction

Entityid:URI

Resource Link

Attributename:Stringtype:String[0..1]mutable:Boolean[0..1]required:Boolean[0..1]default:String[0..1]description:String[0..1]

0..1 *actions 1* actions

*mixins

* entities

1kind

*entities

1 target

1 source *links

0..1parent

*

*depends

*

1 *attributes

* applies

Modelconsistencychecking

Renderingindependant

text/plain,application/json,etc.

Transportindependant

HTTP,others...

Automaticmodelimplementation

10

Page 11: Ow2 webinar erocci

©2014JeanParpaillon

OCCIIMPLEMENTATIONS

rOCCIocci4java

Frameworks

DoYouSpeakOCCI:test

Tools

CompatibleOnepyOCNIOpenStack,OpenNebula,etc

Specificimplementations

Modelsarelanguageextensions/libsHardtoexchangemodels:whataboutinteroperability?

Limits

Seehttp://occi-wg.org/community/implementations/

11

Page 12: Ow2 webinar erocci

occi_store

occi_backend

supervisor

occi_backend_riak

backend

occi_backend_mnesia

backend

/

/path/to/resources

mount

createloadupdatedelete

occi_hook

supervisor

call

on_saveon_loadon_updateon_deleteon_action occi_hook_mgr

hook

notify

occi_renderer_json

occi_renderer

occi_renderer_occi

occi_renderer

occi_renderer_xml

occi_renderer

parse

render

parse

render

occi_listener_http

occi_listener

occi_listener_xmpp

occi_listenerbasedoncowboy basedonexmpp

occi_category_mgr

supervisorcategoriesdescription

<?xml><occi:extension>

<occi:kind>...

</occi:kind>

</occi:extension>load

APPLICA

TIO

NM

OD

EL

STANDARDOCCIAPI

STORAGE

occi_backend_XXX

backend

PROPRIETARYAPI

/other/path/to/resources

©2014JeanParpaillon

EROCCIARCHITECTURE12

Page 13: Ow2 webinar erocci

©2014JeanParpaillon

MULTIPLEREPRESENTATIONS

text/plain

Writeyourownrendering:

Implements:render,parse

text/occi

application/json(draft)

application/xml(experimental):seeXSD:https://github.com/jeanparpaillon/occi-schemas

13

Page 14: Ow2 webinar erocci

/

/store/db1

/store/db2

/virt

occi_backend_mnesia

occi_backend_riak

occi_backend_odbc

occi_backend_libvirt

©2014JeanParpaillon

MULTIPLEBACKENDS

Backendsattachedtomountpoints

Backendsdeclareaschema

Storagebackend:user-definedschemaAPIadapter:backendspecificschema

SimplebackendAPI

ImplementsCRUDoperations

Sharedkinds/mixins

Collectionrequestsruninparallel

14

Page 15: Ow2 webinar erocci

©2014JeanParpaillon

MULTIPLETRANSPORTS

HTTP(S)

NaturalRESTtransport

cowboywebserver

100%erlang(easytoport)

Small,tested,scalable

(distributed)

XMPP

IdealforM2M,IoT

Basedonforkedexmpp(erim)

<iq/>based

XMLschemaavailable

Extensible

SimpleAPIsfor:

-dispatchingrequests(occi_store)

-parsing/rendering

Faulttolerant:

-erlangsupervisor'ed

15

Page 16: Ow2 webinar erocci

©2014JeanParpaillon

EXTENDINGEROCCI

ASAREST"ORM"

Chooseastoragebackend

LoadOCCIschemaasXML

Choosealistener

Startit!

ASAPIADAPTOR

Writeyourownbackend

ImplementsCRUDoperations

w/callstoyourfavouriteAPI

NEWTRANSPORT

Shareyourmodel

Justtransportitdifferently

->Noerlangneeded!

->Needtowriteerlang(noharm)

->Enjoyscalability,faulttolerance,transports,etc.

16

Page 17: Ow2 webinar erocci

©2014JeanParpaillon

ROADMAP

authn/authzx509,HTTPbasicetc,XMPProsters,oauth/openid,etc.POSIXbasedwithfile-basedbackend?

Contributionswelcome!

TestingFunctionaltests:migratetoCommonTestUnittests:useeunit,addtestsPOSIXbasedwithfile-basedbackend?

Optimizeocci_store

NewstoragebackendsRiak(started...)ODBC(SQL)etc.

XMPPlistenerXMPPcomponent(APIproxy)Implementsrosters,presence,etc

17

Page 18: Ow2 webinar erocci

©2014JeanParpaillon

RESOURCES

Website:

Sourcecode:

Continuousintegration:

Mailinglists:

http://erocci.ow2.org

http://github.com/jeanparpaillon/erocci

https://travis-ci.org/jeanparpaillon/erocci

[email protected] [email protected]

(ongoingwork)

18

Page 19: Ow2 webinar erocci

©2014JeanParpaillon

THANKS19