forked from gwdg/rOCCI
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring of the code base. Improved rendering. Overall usage of ru…
…by and sinatra best practises. Code cleanup. Dummy backend now persistent. Improved rSpec scenarios.
- Loading branch information
Florian Feldhaus
committed
May 19, 2012
1 parent
fcf81ba
commit c979a76
Showing
69 changed files
with
3,830 additions
and
5,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
rOCCI was designed and is mainly developed by Florian Feldhaus (GWDG) and Piotr Kasprzak (GWDG) in Germany. | ||
|
||
Special thanks to the following extraordinary individuals, who-out which rOCCI would not be possible: | ||
|
||
* Hayati Bice - who wrote the initial version of an OCCI server rOCCI is based on | ||
* Max Günther - who wrote the EC2 backend | ||
* Andre Thevapalan - for his input regarding the JSON rendering | ||
* the OCCI Working Group - for developing OCCI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright (c) 2012 GWDG | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"kinds":[ | ||
{ | ||
"term":"console", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/compute#", | ||
"title":"Link to the VM's console", | ||
"related":[ | ||
"http://schemas.ogf.org/occi/core#link" | ||
], | ||
"location":"/consolelink/" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
"kinds":[ | ||
{ | ||
"term":"compute", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure#", | ||
"title":"Compute Resource", | ||
"related":[ | ||
"http://schemas.ogf.org/occi/core#resource" | ||
], | ||
"attributes":{ | ||
"occi":{ | ||
"compute":{ | ||
"architecture":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"x86|x64", | ||
"default":"x86" | ||
}, | ||
"cores":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"number", | ||
"minimum":1, | ||
"maximum":32767 | ||
}, | ||
"hostname":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*" | ||
}, | ||
"speed":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"number", | ||
"minimum":0, | ||
"maximum":32767 | ||
}, | ||
"memory":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"number", | ||
"minimum":0, | ||
"maximum":32767 | ||
}, | ||
"state":{ | ||
"mutable":false, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"inactive|active|suspended|failed", | ||
"default":"inactive" | ||
} | ||
} | ||
} | ||
}, | ||
"actions":[ | ||
"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/" | ||
} | ||
], | ||
"actions":[ | ||
{ | ||
"term":"start", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/compute/action#", | ||
"title":"Start Compute instance" | ||
}, | ||
{ | ||
"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":"restart", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/compute/action#", | ||
"title":"Restart Compute instance", | ||
"attributes":{ | ||
"method":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"graceful|warm|cold", | ||
"default":"cold" | ||
} | ||
} | ||
}, | ||
{ | ||
"term":"suspend", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/compute/action#", | ||
"title":"Suspend Compute instance", | ||
"attributes":{ | ||
"method":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"hibernate|suspend", | ||
"default":"suspend" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"mixins":[ | ||
{ | ||
"term":"ipnetwork", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/network#", | ||
"title":"IP Network Mixin", | ||
"attributes":{ | ||
"occi":{ | ||
"network":{ | ||
"address":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*(\\/(\\d|\\d\\d|1[0-1]\\d|12[0-8]))$)|(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(\\d|[1-2]\\d|3[0-2]))$)", | ||
"default":"10.0.0.0/8" | ||
}, | ||
"gateway":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":{ | ||
"string":{ | ||
"pattern":"(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*)" | ||
} | ||
}, | ||
"default":"10.0.0.1" | ||
}, | ||
"allocation":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":{ | ||
"string":{ | ||
"pattern":"dynamic|static" | ||
} | ||
}, | ||
"default":"dynamic" | ||
}, | ||
"state":{ | ||
"mutable":false, | ||
"required":false, | ||
"type":{ | ||
"string":{ | ||
"pattern":"active|inactive" | ||
} | ||
}, | ||
"default":"inactive" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"mixins":[ | ||
{ | ||
"term":"ipnetworkinterface", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/networkinterface#", | ||
"title":"IP Networkinterface Mixin", | ||
"attributes":{ | ||
"occi":{ | ||
"networkinterface":{ | ||
"address":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*)", | ||
"default":"10.0.0.0/8" | ||
}, | ||
"gateway":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"(^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$)|(^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*)", | ||
"default":"10.0.0.1" | ||
}, | ||
"allocation":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"dynamic|static", | ||
"default":"dynamic" | ||
}, | ||
"state":{ | ||
"mutable":false, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"active|inactive", | ||
"default":"inactive" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"kinds":[ | ||
{ | ||
"term":"network", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure#", | ||
"title":"Network Resource", | ||
"related":[ | ||
"http://schemas.ogf.org/occi/core#resource" | ||
], | ||
"attributes":{ | ||
"occi":{ | ||
"storage":{ | ||
"vlan":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"number", | ||
"minimum":0, | ||
"maximum":4095, | ||
"default":0 | ||
}, | ||
"label":{ | ||
"mutable":true, | ||
"required":false, | ||
"type":"string", | ||
"pattern":".*" | ||
}, | ||
"state":{ | ||
"mutable":false, | ||
"required":false, | ||
"type":"string", | ||
"pattern":"active|inactive", | ||
"default":"inactive" | ||
} | ||
} | ||
} | ||
}, | ||
"actions":[ | ||
"http://schemas.ogf.org/occi/infrastructure/network/action#up" , | ||
"http://schemas.ogf.org/occi/infrastructure/network/action#down" | ||
], | ||
"location":"/network/" | ||
} | ||
], | ||
"actions":[ | ||
{ | ||
"term":"up", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/network/action#", | ||
"title":"Activate network" | ||
}, | ||
{ | ||
"term":"down", | ||
"scheme":"http://schemas.ogf.org/occi/infrastructure/network/action#up", | ||
"title":"Activate network" | ||
} | ||
] | ||
} |
Oops, something went wrong.