This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/wiki/do/viewPage/projects.occi-wg/wiki/Examples at Thu, 03 Nov 2022 00:09:59 GMT SourceForge : View Wiki Page: Examples

Project Home

Tracker

Documents

Tasks

Source Code

Discussions

File Releases

Wiki

Project Admin

Web Site
Search Wiki Pages Project: occi-wg     Wiki > Examples > View Wiki Page
wiki2509: Examples

Example Requests for OCCI Infrastructure

The following HTTP requests and responses are intended as a discussion base to come up with a common understanding of the OCCI Infrastructure lifecycle and to help develop OCCI server and clients.

Common OCCI requests:

  • Query Categories offered by service provider
  • Create Network resource
  • Create Storage resource
  • Create Compute resource
  • Create Compute resource with image upload
  • Create Compute resource with link to CDMI storage
  • Check status of Compute resource
  • Triggering actions on Compute resources
  • Add/Change attributes of Compute resource
  • Add Mixin to Compute resource

Query Categories offered by service provider

All kinds, actions and mixins are to be returned. Entity and Resource must be included to get information on the attributes they offer. An alternative may be, that Categories expose all attributes they and their parent classes offer.

GET /-/ HTTP/1.1
Host: my.occi.service:1234
Accept: text/occi
Content-Type: text/occi

HTTP/1.1 200 OK
Accept: application/json,text/plain,text/occi
Content-Type: text/occi
Status: 200
Category: entity; scheme="http://schemas.ogf.org/occi/core#"; class="kind";title="Entity";attributes="occi.core.title occi.core.id";

Category: resource; scheme="http://schemas.ogf.org/occi/core#"; class="kind";title="Resource";rel="http://schemas.ogf.org/occi/core#entity";attributes="occi.core.summary links";

Category: network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";title="Network Resource";rel="http://schemas.ogf.org/occi/core#resource";location=http://ls38.itmc.tu-dortmund.de:3000/network/;attributes="occi.network.label occi.network.vlan occi.network.state";actions="http://schemas.ogf.org/occi/infrastructure/network/action#down http://schemas.ogf.org/occi/infrastructure/network/action#up";
Category: up; scheme="http://schemas.ogf.org/occi/infrastructure/network/action#"; class="action";title="Network Action Up";
Category: down; scheme="http://schemas.ogf.org/occi/infrastructure/network/action#"; class="action";title="Network Action Down";

Category: storage; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";title="Storage Resource";rel="http://schemas.ogf.org/occi/core#resource";location=http://ls38.itmc.tu-dortmund.de:3000/storage/;attributes="occi.storage.state occi.storage.size";actions="http://schemas.ogf.org/occi/infrastructure/storage/action#backup http://schemas.ogf.org/occi/infrastructure/storage/action#offline http://schemas.ogf.org/occi/infrastructure/storage/action#online http://schemas.ogf.org/occi/infrastructure/storage/action#resize http://schemas.ogf.org/occi/infrastructure/storage/action#snapshot";
Category: online; scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#"; class="action";title="Storage Action Online";
Category: offline; scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#"; class="action";title="Storage Action Offline";
Category: snapshot; scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#"; class="action";title="Storage Action Snapshot";
Category: backup; scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#"; class="action";title="Storage Action Backup";
Category: resize; scheme="http://schemas.ogf.org/occi/infrastructure/storage/action#"; class="action";title="Storage Action Resize";attributes="size";

Category: link; scheme="http://schemas.ogf.org/occi/core#"; class="kind";title="Link";rel="http://schemas.ogf.org/occi/core#entity";location=http://ls38.itmc.tu-dortmund.de:3000/link/;attributes="occi.core.source occi.core.target";
Category: storagelink; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";title="StorageLink";rel="http://schemas.ogf.org/occi/core#link";location=http://ls38.itmc.tu-dortmund.de:3000/storagelink/;attributes="occi.storagelink.state occi.storagelink.mountpoint occi.storagelink.deviceid";
Category: up; scheme="http://schemas.ogf.org/occi/infrastructure/storagelink/action#"; class="action";title="Network Action Up";
Category: networkinterface; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";title="Networkinterface";rel="http://schemas.ogf.org/occi/core#link";location=http://ls38.itmc.tu-dortmund.de:3000/networkinterface/;attributes="occi.networkinterface.mac occi.networkinterface.state occi.networkinterface.interface";

Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind";title="Compute Resource";rel="http://schemas.ogf.org/occi/core#resource";location=http://ls38.itmc.tu-dortmund.de:3000/compute/;attributes="occi.compute.cores occi.compute.memory occi.compute.state occi.compute.speed occi.compute.hostname occi.compute.architecture";actions="http://schemas.ogf.org/occi/infrastructure/compute/action#restart 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#suspend";
Category: start; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action";title="Compute Action Start";
Category: restart; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action";title="Compute Action Restart";attributes="cold graceful warm";
Category: suspend; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action";title="Compute Action Suspend";attributes="hibernate suspend";
Category: stop; scheme="http://schemas.ogf.org/occi/infrastructure/compute/action#"; class="action";title="Compute Action Stop";attributes="acpioff poweroff graceful";

Category: ipnetwork; scheme="http://schemas.ogf.org/occi/infrastructure/network#"; class="mixin";title="IP Network Mixin";attributes="occi.network.allocation occi.network.address occi.network.gateway";

Network

Create network

POST /network/ HTTP/1.1
Host: my.occi.service:1234
Accept: text/occi
Content-Type: text/occi
Category: network;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";
Category: ipnetwork;scheme="http://schemas.ogf.org/occi/infrastructure/network#";class="mixin";
X-OCCI-Attribute: occi.core.title="My Network"
X-OCCI-Attribute: occi.core.summary="A short summary"
X-OCCI-Attribute: occi.network.vlan=1
X-OCCI-Attribute: occi.network.label="My VLAN"
X-OCCI-Attribute: occi.network.address="192.168.0.0/24"
X-OCCI-Attribute: occi.network.allocation="dynamic"

HTTP/1.1 200 OK
Accept: application/json,text/plain,text/occi
Content-Type: text/occi
Status: 200
Location: http://my.occi.service:1234/network/a20769ea-f4d0-11e0-a212-00163e211167

Read all networks

GET /network/ HTTP/1.1
Host: my.occi.service:1234
Accept: text/occi
Content-Type: text/occi

HTTP/1.1 200 OK
Accept: application/json,text/plain,text/occi
Content-Type: text/occi
Status: 200
X-OCCI-Location: http://my.occi.service:1234/network/a20769ea-f4d0-11e0-a212-00163e211167

Read single network

GET /network/ HTTP/1.1
Host: my.occi.service:1234
Accept: text/occi
Content-Type: text/occi

HTTP/1.1 200 OK
Accept: application/json,text/plain,text/occi
Content-Type: text/occi
Status: 200
Category: network;scheme="http://schemas.ogf.org/occi/infrastructure#";class="kind";
Category: ipnetwork;scheme="http://schemas.ogf.org/occi/infrastructure/network#";class="mixin";
X-OCCI-Attribute: occi.core.title="My Network"
X-OCCI-Attribute: occi.core.summary="A short summary"
X-OCCI-Attribute: occi.network.vlan=1
X-OCCI-Attribute: occi.network.label="My VLAN"
X-OCCI-Attribute: occi.network.address="192.168.0.0/24"
X-OCCI-Attribute: occi.network.allocation="dynamic"
X-OCCI-Attribute: occi.network.state=inactive

Delete network

DELETE /network/a20769ea-f4d0-11e0-a212-00163e211167
Host: my.occi.service:1234
Accept: text/occi
Content-Type: text/occi

HTTP/1.1 200 OK

Proposals

 




The Open Grid Forum Contact Webmaster | Report a problem | GridForge Help
This is a static archive of the previous Open Grid Forum GridForge content management system saved from host forge.ogf.org file /sf/wiki/do/viewPage/projects.occi-wg/wiki/Examples at Thu, 03 Nov 2022 00:09:59 GMT