BonFIRE logo and link to main BonFIRE site

Table Of Contents

Previous topic

Basic network resources

Next topic

Portal How-To

This Page

OCCI How-To

Listing network resources

Listing network resources is easily achieved with a simple GET request:

$ curl -kni https://api.bonfire-project.eu/locations/fr-inria/networks
HTTP/1.1 200 OK
Date: Wed, 12 Oct 2011 13:17:56 GMT
Server: thin 1.2.11 codename Bat-Shit Crazy
Cache-Control: public,max-age=30
Via: 1.1 enactor:8080 (bonfire-enactor/0.5),1.1 bonfire-api (bonfire-api/0.10.1)
Allow: GET,POST,OPTIONS,HEAD
Content-Type: application/vnd.bonfire+xml; charset=utf-8
ETag: "23522379bbb92138c5b5e467c4a925fc"
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 0.386735
Vary: Authorization,Accept
Connection: close
Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://api.bonfire-project.eu/doc/schemas/occi">
  <items>
    <network href="/locations/fr-inria/networks/20" name="Public Network"/>
    <network href="/locations/fr-inria/networks/47" name="BonFIRE WAN"/>
  </items>
</collection>

Creating network resources

Network resources MUST be created within an experiment. Assuming you have a running experiment with ID 3600, then you can create a network as follows:

$ curl -kni https://api.bonfire-project.eu/experiments/3600/networks \
-X POST -H 'Content-Type: application/vnd.bonfire+xml' -d '
<network xmlns="http://api.bonfire-project.eu/doc/schemas/occi">
  <name>Network name</name>
  <description>Network description</description>
  <address>192.168.0.0</address>
  <size>C</size>
  <bandwidth>1000</bandwidth>
  <latency>0</latency>
  <lossrate>0</lossrate>
  <throughput>200</throughput>
  <protocol>UDP</protocol>
  <packetsize>10</packetsize>
  <link rel="location"
        href="/locations/be-ibbt" />
</network>
'
HTTP/1.1 201 Created
Date: Wed, 12 Oct 2011 13:26:13 GMT
Server: thin 1.2.11 codename Bat-Shit Crazy
Via: 1.1 enactor:8080 (bonfire-enactor/0.5),1.1 bonfire-api (bonfire-api/0.10.1)
Location: https://api.bonfire-project.eu/locations/be-ibbt/networks/27
Content-Type: application/vnd.bonfire+xml; charset=utf-8
Cache-Control: no-cache
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 0.212910
Vary: Authorization,Accept
Connection: close
Transfer-Encoding: chunked

<?xml version="1.0" encoding="UTF-8"?>
<network xmlns="http://api.bonfire-project.eu/doc/schemas/occi" href="/locations/be-ibbt/networks/27">
  <address>192.168.0.0</address>
  <bandwidth>1000</bandwidth>
  <id>27</id>
  <latency>0</latency>
  <lossrate>0</lossrate>
  <name>Network name</name>
  <public>No</public>
  <size>C</size>
  <throughput>200</throughput>
  <protocol>UDP</protocol>
  <packetsize>10</packetsize>
</network>

See below for the complete list of attributes you can give when creating a network.

Note

OpenNebula testbeds are currently NOT configured to properly create private networks, therefore creation of network resources is disabled on the fr-inria, de-hlrs, and uk-epcc testbeds. This means for now you have to use the default networks.

Deleting network resources

As with every resource, just send a DELETE request to the resource URI:

$ curl -kni https://api.bonfire-project.eu/locations/be-ibbt/networks/27 -X DELETE

If everything went well, you’ll receive a 204 No Content status code:

HTTP/1.1 204 No Content
Date: Wed, 12 Oct 2011 13:44:30 GMT
Server: thin 1.2.11 codename Bat-Shit Crazy
Via: 1.1 enactor:8080 (bonfire-enactor/0.5),1.1 bonfire-api (bonfire-api/0.10.1)
Cache-Control: no-cache
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 0.173453
Vary: Authorization,Accept
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

Note that in the specific case of be-ibbt, deleting individual resources is a no-op, i.e. be-ibbt resources are only deleted when you delete the experiment.