Commit a4b4b101 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added playbook controller, service , POJO, DAO

parent 0c81f034
...@@ -125,6 +125,12 @@ from the machine the keys correspond to.</span> ...@@ -125,6 +125,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span> <td> <span class="datatype-name">PlanResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html"> <tr class="clickable-row" data-href="json_ProvisionRequest.html">
...@@ -298,6 +304,12 @@ from the machine the keys correspond to.</span> ...@@ -298,6 +304,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span> <td> <span class="datatype-name">planResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html"> <tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-gwt-json-overlay.jar"> <tr class="clickable-row" data-href="drip-api-gwt-json-overlay.jar">
<td><span class="downloadfile-name">drip-api-gwt-json-overlay.jar</span></td> <td><span class="downloadfile-name">drip-api-gwt-json-overlay.jar</span></td>
<td><span class="downloadfile-size">8.98K</span></td> <td><span class="downloadfile-size">9.53K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td> <td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -116,12 +116,12 @@ ...@@ -116,12 +116,12 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-json-client.jar"> <tr class="clickable-row" data-href="drip-api-json-client.jar">
<td><span class="downloadfile-name">drip-api-json-client.jar</span></td> <td><span class="downloadfile-name">drip-api-json-client.jar</span></td>
<td><span class="downloadfile-size">11.77K</span></td> <td><span class="downloadfile-size">12.49K</span></td>
<td><span class="downloadfile-description">The binaries for the Java JSON client library.</span></td> <td><span class="downloadfile-description">The binaries for the Java JSON client library.</span></td>
</tr> </tr>
<tr class="clickable-row" data-href="drip-api-json-client-json-sources.jar"> <tr class="clickable-row" data-href="drip-api-json-client-json-sources.jar">
<td><span class="downloadfile-name">drip-api-json-client-json-sources.jar</span></td> <td><span class="downloadfile-name">drip-api-json-client-json-sources.jar</span></td>
<td><span class="downloadfile-size">9.29K</span></td> <td><span class="downloadfile-size">9.87K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td> <td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -144,12 +144,12 @@ ...@@ -144,12 +144,12 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-xml-client.jar"> <tr class="clickable-row" data-href="drip-api-xml-client.jar">
<td><span class="downloadfile-name">drip-api-xml-client.jar</span></td> <td><span class="downloadfile-name">drip-api-xml-client.jar</span></td>
<td><span class="downloadfile-size">19.85K</span></td> <td><span class="downloadfile-size">20.45K</span></td>
<td><span class="downloadfile-description">The binaries for the Java XML client library.</span></td> <td><span class="downloadfile-description">The binaries for the Java XML client library.</span></td>
</tr> </tr>
<tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar"> <tr class="clickable-row" data-href="drip-api-xml-client-xml-sources.jar">
<td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td> <td><span class="downloadfile-name">drip-api-xml-client-xml-sources.jar</span></td>
<td><span class="downloadfile-size">17.89K</span></td> <td><span class="downloadfile-size">18.44K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td> <td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-js.zip"> <tr class="clickable-row" data-href="drip-api-js.zip">
<td><span class="downloadfile-name">drip-api-js.zip</span></td> <td><span class="downloadfile-name">drip-api-js.zip</span></td>
<td><span class="downloadfile-size">3.53K</span></td> <td><span class="downloadfile-size">3.57K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip"> <tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td> <td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">3.72K</span></td> <td><span class="downloadfile-size">3.75K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api-php.zip"> <tr class="clickable-row" data-href="drip-api-php.zip">
<td><span class="downloadfile-name">drip-api-php.zip</span></td> <td><span class="downloadfile-name">drip-api-php.zip</span></td>
<td><span class="downloadfile-size">7.58K</span></td> <td><span class="downloadfile-size">7.62K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
<tbody data-link="row" class="rowlink"> <tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api.rb"> <tr class="clickable-row" data-href="drip-api.rb">
<td><span class="downloadfile-name">drip-api.rb</span></td> <td><span class="downloadfile-name">drip-api.rb</span></td>
<td><span class="downloadfile-size">47.03K</span></td> <td><span class="downloadfile-size">48.54K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td> <td><span class="downloadfile-description">&nbsp;</span></td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -557,74 +557,13 @@ module V1 ...@@ -557,74 +557,13 @@ module V1
module Types module Types
# (no documentation provided) # (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject class Type
# the keyValue
attr_accessor :keyValue
# the id
attr_accessor :id
# the json hash for this KeyValueHolder
def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this KeyValueHolder with a json hash #
def init_jaxb_json_hash(_o) PRIVATE = "PRIVATE"
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a KeyValueHolder from a (parsed) JSON hash #
def self.from_json(o) PUBLIC = "PUBLIC"
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end end
end end
...@@ -777,13 +716,74 @@ module V1 ...@@ -777,13 +716,74 @@ module V1
module Types module Types
# (no documentation provided) # (no documentation provided)
class Type class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject
# # the keyValue
PRIVATE = "PRIVATE" attr_accessor :keyValue
# the id
attr_accessor :id
# # the json hash for this KeyValueHolder
PUBLIC = "PUBLIC" def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this KeyValueHolder with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a KeyValueHolder from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end end
end end
...@@ -1267,105 +1267,6 @@ module Commons ...@@ -1267,105 +1267,6 @@ module Commons
module V1 module V1
module Types
# (no documentation provided)
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the json hash for this DeployResponse
def to_jaxb_json_hash
_h = super
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this DeployResponse with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a DeployResponse from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end
end
end
end
end
end
end
end
module Nl
module Uva
module Sne
module Drip
module Commons
module V1
module Types module Types
# (no documentation provided) # (no documentation provided)
...@@ -1590,6 +1491,105 @@ module Commons ...@@ -1590,6 +1491,105 @@ module Commons
module V1 module V1
module Types
# (no documentation provided)
class DeployResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::DeployRequest
# (no documentation provided)
attr_accessor :key
# the id
attr_accessor :id
# the json hash for this DeployResponse
def to_jaxb_json_hash
_h = super
_h['key'] = key.to_jaxb_json_hash unless key.nil?
_h['id'] = id.to_jaxb_json_hash unless id.nil?
return _h
end
#initializes this DeployResponse with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['key'].nil?
_oa = _o['key']
if(_oa.is_a? Hash)
@key = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@key = Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@key = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@key.push Nl::Uva::Sne::Drip::Commons::V1::Types::Key.from_json(_item)
else
@key.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@key = _oa
end
end
if !_o['id'].nil?
_oa = _o['id']
if(_oa.is_a? Hash)
@id = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@id = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@id = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@id.push String.from_json(_item)
else
@id.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@id = _oa
end
end
end
# constructs a DeployResponse from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end
end
end
end
end
end
end
end
module Nl
module Uva
module Sne
module Drip
module Commons
module V1
module Types module Types
# (no documentation provided) # (no documentation provided)
...@@ -1711,6 +1711,83 @@ module Commons ...@@ -1711,6 +1711,83 @@ module Commons
module V1 module V1
module Types
# (no documentation provided)
class PlaybookRepresentation < Nl::Uva::Sne::Drip::Commons::V1::Types::KeyValueHolder
# the name
attr_accessor :name
# the json hash for this PlaybookRepresentation
def to_jaxb_json_hash
_h = super
_h['name'] = name.to_jaxb_json_hash unless name.nil?
return _h
end
#initializes this PlaybookRepresentation with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['name'].nil?
_oa = _o['name']
if(_oa.is_a? Hash)
@name = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@name = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@name = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@name.push String.from_json(_item)
else
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@name = _oa
end
end
end
# constructs a PlaybookRepresentation from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
else
inst = new
inst.init_jaxb_json_hash o
return inst
end
end
end
end
end
end
end
end
end
end
module Nl
module Uva
module Sne
module Drip
module Commons
module V1
module Types module Types
# (no documentation provided) # (no documentation provided)
......
...@@ -200,6 +200,25 @@ provisopned based on a TOSCA description.</span> ...@@ -200,6 +200,25 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td> </samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be <td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span> provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html"> <tr class="clickable-row" data-href="resource_ProvisionController.html">
...@@ -389,6 +408,12 @@ from the machine the keys correspond to.</span> ...@@ -389,6 +408,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span> <td> <span class="datatype-name">PlanResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html"> <tr class="clickable-row" data-href="json_ProvisionRequest.html">
...@@ -562,6 +587,12 @@ from the machine the keys correspond to.</span> ...@@ -562,6 +587,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span> <td> <span class="datatype-name">planResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html"> <tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd> <dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd> <dd><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a>, <a href="json_Script.html">Script</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_ToscaRepresentation.html">ToscaRepresentation</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_PlanResponse.html">PlanResponse</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_Key.html">Key</a>, <a href="json_CloudCredentials.html">CloudCredentials</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlayBookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlayBookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_json.html">JSON</a></li>
<li class="dropdown"><a href="json_PlayBookRepresentation.html">PlayBookRepresentation</a></li>
</ol>
<h1 class="page-header">PlayBookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_KeyValueHolder.html">KeyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">keyValue</span></td>
<td><span class="datatype-reference">map of object
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_OwnedObject.html">OwnedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;name&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlaybookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlaybookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_json.html">JSON</a></li>
<li class="dropdown"><a href="json_PlaybookRepresentation.html">PlaybookRepresentation</a></li>
</ol>
<h1 class="page-header">PlaybookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_KeyValueHolder.html">KeyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">keyValue</span></td>
<td><span class="datatype-reference">map of object
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
<tr>
<td colspan="3"><h5 class="text-muted">Properties inherited from <a href="json_OwnedObject.html">OwnedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;name&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
...@@ -427,6 +427,17 @@ to specify the domain name for ec2]]> ...@@ -427,6 +427,17 @@ to specify the domain name for ec2]]>
</xs:complexContent> </xs:complexContent>
</xs:complexType> </xs:complexType>
<xs:complexType name="playbookRepresentation">
<xs:complexContent>
<xs:extension base="keyValueHolder">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="provisionRequest"> <xs:complexType name="provisionRequest">
<xs:complexContent> <xs:complexContent>
<xs:extension base="keyValueHolder"> <xs:extension base="keyValueHolder">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlayBookController</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlayBookController</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_PlayBookController_deleteAll_DELETE">DELETE /user/v1.0/playbook/all</a></li>
<li><a href="#resource_PlayBookController_getIds_GET">GET /user/v1.0/playbook/ids</a></li>
<li><a href="#resource_PlayBookController_post_POST">POST /user/v1.0/playbook/post</a></li>
<li><a href="#resource_PlayBookController_toscaUpload_POST"><abbr title="POST /user/v1.0/playbook/upload">POST /user/v1.0/playbook/uploa...</abbr></a></li>
<li><a href="#resource_PlayBookController_delete_DELETE"><abbr title="DELETE /user/v1.0/playbook/{id}">DELETE /user/v1.0/playbook/{id...</abbr></a></li>
<li><a href="#resource_PlayBookController_get_GET">GET /user/v1.0/playbook/{id}</a></li>
<li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="resources.html">Resources</a></li>
<li class="dropdown"><a href="resource_PlayBookController.html">PlayBookController</a></li>
</ol>
<h1 class="page-header">PlayBookController <small>Resource</small></h1>
<p>This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</p>
<div id="resource_PlayBookController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/playbook/all <a href="../user/v1.0/playbook/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored PlayBook descriptions.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">a list of all the IDs</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/playbook/all
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlayBookController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/playbook/ids <a href="../user/v1.0/playbook/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored PlayBook descriptions.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">array of string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">a list of all the IDs</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">list of string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/playbook/ids
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlayBookController_post_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/playbook/post <a href="../user/v1.0/playbook/post" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-request-body">
<caption>Request Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Content-Type: application/json&quot; HTTP header to specify this media type to the server."><span class="request-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Content-Type: application/xml&quot; HTTP header to specify this media type to the server."><span class="request-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/playbook/post
Content-Type: application/json
Accept: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 201 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlayBookController_toscaUpload_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/playbook/upload <a href="../user/v1.0/playbook/upload" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Uploads and stores a PlayBook description file</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">file</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the ID of the PlayBook description</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/playbook/upload
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 201 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlayBookController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/playbook/{id} <a href="../user/v1.0/playbook/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Deletes the PlayBook description.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">id</span></td>
<td>path</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">The ID of the deleted PlayBook description.</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/playbook/{id}
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlayBookController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/playbook/{id} <a href="../user/v1.0/playbook/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the PlayBook description.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">id</span></td>
<td>path</td>
<td><span class="parameter-description">the ID PlayBook description.</span></td>
</tr>
<tr>
<td><span class="parameter-name">format</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the PlayBook description.</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/playbook/{id}
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: PlaybookController</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: PlaybookController</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li><a href="#resource_PlaybookController_deleteAll_DELETE">DELETE /user/v1.0/playbook/all</a></li>
<li><a href="#resource_PlaybookController_getIds_GET">GET /user/v1.0/playbook/ids</a></li>
<li><a href="#resource_PlaybookController_post_POST">POST /user/v1.0/playbook/post</a></li>
<li><a href="#resource_PlaybookController_toscaUpload_POST"><abbr title="POST /user/v1.0/playbook/upload">POST /user/v1.0/playbook/uploa...</abbr></a></li>
<li><a href="#resource_PlaybookController_delete_DELETE"><abbr title="DELETE /user/v1.0/playbook/{id}">DELETE /user/v1.0/playbook/{id...</abbr></a></li>
<li><a href="#resource_PlaybookController_get_GET">GET /user/v1.0/playbook/{id}</a></li>
<li class="divider"></li>
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="resources.html">Resources</a></li>
<li class="dropdown"><a href="resource_PlaybookController.html">PlaybookController</a></li>
</ol>
<h1 class="page-header">PlaybookController <small>Resource</small></h1>
<p>This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</p>
<div id="resource_PlaybookController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/playbook/all <a href="../user/v1.0/playbook/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored PlayBook descriptions.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">a list of all the IDs</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/playbook/all
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlaybookController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/playbook/ids <a href="../user/v1.0/playbook/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored PlayBook descriptions.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">array of string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">a list of all the IDs</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">list of string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/playbook/ids
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlaybookController_post_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/playbook/post <a href="../user/v1.0/playbook/post" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-request-body">
<caption>Request Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Content-Type: application/json&quot; HTTP header to specify this media type to the server."><span class="request-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Content-Type: application/xml&quot; HTTP header to specify this media type to the server."><span class="request-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/playbook/post
Content-Type: application/json
Accept: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 201 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlaybookController_toscaUpload_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/playbook/upload <a href="../user/v1.0/playbook/upload" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Uploads and stores a PlayBook description file</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">file</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the ID of the PlayBook description</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
POST /user/v1.0/playbook/upload
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 201 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlaybookController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/playbook/{id} <a href="../user/v1.0/playbook/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Deletes the PlayBook description.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">id</span></td>
<td>path</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">The ID of the deleted PlayBook description.</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
DELETE /user/v1.0/playbook/{id}
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 204 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_PlaybookController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/playbook/{id} <a href="../user/v1.0/playbook/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the PlayBook description.</p>
<dl class="dl-horizontal">
<dt>Security Roles Allowed</dt>
<dd>ADMIN, USER</dd>
</dl>
<table class="table resource-parameters">
<caption>Request Parameters</caption>
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parameter-name">id</span></td>
<td>path</td>
<td><span class="parameter-description">the ID PlayBook description.</span></td>
</tr>
<tr>
<td><span class="parameter-name">format</span></td>
<td>query</td>
<td><span class="parameter-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-body">
<caption>Response Body</caption>
<thead>
<tr>
<th>media type</th>
<th>data type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/json&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/json</span></abbr></td>
<td><span class="datatype-reference">string
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the PlayBook description.</span></td>
</tr>
<tr>
<td><abbr data-toggle="tooltip" data-placement="top" title="Use the &quot;Accept: application/xml&quot; HTTP header to request that this media type be provided by the server."><span class="response-type">application/xml</span></abbr></td>
<td><span class="datatype-reference">string
(XML)</span></td>
</tr>
</tbody>
</table>
<h4>Example</h4>
<div class="container-fluid example panel">
<div class="row panel-body">
<div class="col-md-6">
<h5>Request</h5>
<pre>
GET /user/v1.0/playbook/{id}
Accept: application/json
</pre>
</div>
<div class="col-md-6">
<h5>Response</h5>
<pre>
HTTP/1.1 200 Looks Good
Content-Type: application/json
<code class="prettyprint language-txt">
...
</code>
</pre>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
...@@ -192,6 +192,25 @@ provisopned based on a TOSCA description.</span> ...@@ -192,6 +192,25 @@ provisopned based on a TOSCA description.</span>
</samp></li></ul></td> </samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for planing the type of resources to be <td> <span class="resource-description">This controller is responsible for planing the type of resources to be
provisopned based on a TOSCA description.</span> provisopned based on a TOSCA description.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_PlaybookController.html">
<td> <span class="resource-name">PlaybookController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/playbook/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/post</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/playbook/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">DELETE</span>
</samp></li><li><samp> <span class="label label-default resource-method">GET</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><li><samp> <span class="label label-default resource-method">DELETE</span> <span class="label label-default resource-method">GET</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for storing PlayBook descriptions that can be
used by the planner.</span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="resource_ProvisionController.html"> <tr class="clickable-row" data-href="resource_ProvisionController.html">
......
...@@ -120,6 +120,12 @@ from the machine the keys correspond to.</span> ...@@ -120,6 +120,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">PlanResponse</span> <td> <span class="datatype-name">PlanResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_PlaybookRepresentation.html">
<td> <span class="datatype-name">PlaybookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="json_ProvisionRequest.html"> <tr class="clickable-row" data-href="json_ProvisionRequest.html">
......
...@@ -193,6 +193,12 @@ from the machine the keys correspond to.</span> ...@@ -193,6 +193,12 @@ from the machine the keys correspond to.</span>
<td> <span class="datatype-name">planResponse</span> <td> <span class="datatype-name">planResponse</span>
</td> </td>
<td> <span class="datatype-description">This class represents a plan generated by the planner.</span> <td> <span class="datatype-description">This class represents a plan generated by the planner.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_playbookRepresentation.html">
<td> <span class="datatype-name">playbookRepresentation</span>
</td>
<td> <span class="datatype-description"></span>
</td> </td>
</tr> </tr>
<tr class="clickable-row" data-href="xml_ns0_provisionRequest.html"> <tr class="clickable-row" data-href="xml_ns0_provisionRequest.html">
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<dt>Schema</dt> <dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd> <dd><a href="ns0.xsd">ns0.xsd</a></dd>
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd> <dd><a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<dt>Schema</dt> <dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd> <dd><a href="ns0.xsd">ns0.xsd</a></dd>
<dt>Subtypes</dt> <dt>Subtypes</dt>
<dd><a href="xml_ns0_cloudCredentials.html">cloudCredentials</a>, <a href="xml_ns0_deployRequest.html">deployRequest</a>, <a href="xml_ns0_deployResponse.html">deployResponse</a>, <a href="xml_ns0_key.html">key</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd> <dd><a href="xml_ns0_cloudCredentials.html">cloudCredentials</a>, <a href="xml_ns0_deployRequest.html">deployRequest</a>, <a href="xml_ns0_deployResponse.html">deployResponse</a>, <a href="xml_ns0_key.html">key</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_planResponse.html">planResponse</a>, <a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_toscaRepresentation.html">toscaRepresentation</a></dd>
</dl> </dl>
<table class="table datatype-properties"> <table class="table datatype-properties">
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: playBookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: playBookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_xml.html">XML</a></li>
<li class="dropdown"><a href="xml_ns0_playBookRepresentation.html">playBookRepresentation</a></li>
</ol>
<h1 class="page-header">playBookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
<dt>Namespace</dt>
<dd>(Default)</dd>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>type</th>
<th>namespace</th>
<th>min/max occurs</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the name</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the id</span></td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_ownedObject.html">ownedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the owner</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;name&gt;...&lt;/name&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>drip-api: playbookRepresentation</title>
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!--custom css for these pages-->
<link rel="stylesheet" href="css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#apinav">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">drip-api: playbookRepresentation</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="resources.html">Resources</a></li>
<li><a href="data.html">Data Types</a></li>
<li><a href="downloads.html">Files and Libraries</a></li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-3 col-md-2 sidebar" id="apinav">
<ul class="nav nav-sidebar">
<li class="text-right"><a href="#top"><small>Back to Top</small></a></li>
</ul>
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<ol class="breadcrumb" id="top">
<li class="active dropdown"><a href="index.html">Home</a></li>
<li class="active dropdown"><a href="syntax_xml.html">XML</a></li>
<li class="dropdown"><a href="xml_ns0_playbookRepresentation.html">playbookRepresentation</a></li>
</ol>
<h1 class="page-header">playbookRepresentation <small>Data Type</small></h1>
<p></p>
<dl class="dl-horizontal">
<dt>Namespace</dt>
<dd>(Default)</dd>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
</dl>
<table class="table datatype-properties">
<caption>Properties</caption>
<thead>
<tr>
<th>name</th>
<th>data type</th>
<th>type</th>
<th>namespace</th>
<th>min/max occurs</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">name</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the name</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">id</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the id</span></td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_ownedObject.html">ownedObject</a></h5></td>
</tr>
<tbody>
<tr>
<td><span class="property-name">owner</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
</span></td>
<td><span class="property-namespaceInfo">
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the owner</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;name&gt;...&lt;/name&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
</pre>
<footer class="footer">
<div class="container">
<p class="text-muted">Generated by <a href="http://enunciate.webcohesion.com">Enunciate</a>.</p>
</div>
</footer>
</div>
</div>
</div>
<!-- JavaScript placed at the end of the document so the pages load faster. -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Bootstrap core JavaScript
================================================== -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- prettify code blocks. see http://code.google.com/p/google-code-prettify/ -->
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"></script>
<script>
$(function() {
$(".clickable-row").click(function() {
window.document.location = $(this).data("href");
});
$('[data-toggle="tooltip"]').tooltip()
});
</script>
</body>
</html>
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* 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.
*/
package nl.uva.sne.drip.api.dao;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
*
* @author S. Koulouzis
*/
public interface PlaybookDao extends MongoRepository<PlaybookRepresentation, String> {
}
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* 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.
*/
package nl.uva.sne.drip.api.service;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.utils.Constants;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.v1.types.User;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.api.dao.PlaybookDao;
/**
*
* @author S. Koulouzis
*/
@Service
@PreAuthorize("isAuthenticated()")
public class PlaybookService {
@Autowired
private PlaybookDao dao;
public String get(String id, String fromat) throws JSONException {
PlaybookRepresentation playbook = findOne(id);
if (playbook == null) {
throw new NotFoundException();
}
Map<String, Object> map = playbook.getKeyValue();
if (fromat != null && fromat.toLowerCase().equals("yml")) {
String ymlStr = Converter.map2YmlString(map);
ymlStr = ymlStr.replaceAll("\\uff0E", "\\.");
ymlStr = ymlStr.replaceAll("\'---':", "---");
return ymlStr;
}
if (fromat != null && fromat.toLowerCase().equals("json")) {
String jsonStr = Converter.map2JsonString(map);
jsonStr = jsonStr.replaceAll("\\uff0E", "\\.");
return jsonStr;
}
String ymlStr = Converter.map2YmlString(map);
ymlStr = ymlStr.replaceAll("\\uff0E", "\\.");
ymlStr = ymlStr.replaceAll("\'---':", "---");
return ymlStr;
}
public String saveFile(MultipartFile file) throws IOException {
String originalFileName = file.getOriginalFilename();
String name = System.currentTimeMillis() + "_" + originalFileName;
byte[] bytes = file.getBytes();
String str = new String(bytes, "UTF-8");
return saveStringContents(str, name);
}
public String saveYamlString(String yamlString, String name) throws IOException {
if (name == null) {
name = System.currentTimeMillis() + "_" + "playbook.yaml";
}
yamlString = yamlString.replaceAll("\\.", "\uff0E");
Map<String, Object> map = Converter.ymlString2Map(yamlString);
PlaybookRepresentation t = new PlaybookRepresentation();
t.setName(name);
t.setKvMap(map);
save(t);
return t.getId();
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation delete(String id) {
PlaybookRepresentation tr = dao.findOne(id);
dao.delete(tr);
return tr;
}
@PostFilter("(filterObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public List<PlaybookRepresentation> findAll() {
return dao.findAll();
}
@PostAuthorize("(returnObject.owner == authentication.name) or (hasRole('ROLE_ADMIN'))")
public PlaybookRepresentation findOne(String id) {
return dao.findOne(id);
}
private PlaybookRepresentation save(PlaybookRepresentation t) {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername();
t.setOwner(owner);
return dao.save(t);
}
@PostAuthorize("(hasRole('ROLE_ADMIN'))")
public void deleteAll() {
dao.deleteAll();
}
public String saveStringContents(String playbookContents, String name) throws IOException {
//Remove '\' and 'n' if they are together and replace them with '\n'
char[] array = playbookContents.toCharArray();
StringBuilder sb = new StringBuilder();
int prevChar = -1;
for (int i = 0; i < array.length; i++) {
int currentChar = (int) array[i];
if (prevChar > 0 && prevChar == 92 && currentChar == 110) {
sb.delete(sb.length() - 1, sb.length());
sb.append('\n');
} else {
sb.append((char) currentChar);
}
prevChar = (int) array[i];
}
playbookContents = sb.toString();
playbookContents = playbookContents.replaceAll("(?m)^[ \t]*\r?\n", "");
for (int i = 0; i < Constants.BAD_CHARS.length; i++) {
int hex = Constants.BAD_CHARS[i];
playbookContents = playbookContents.replaceAll(String.valueOf((char) hex), "");
}
playbookContents = playbookContents.replaceAll("\\.", "\uff0E");
Map<String, Object> map = Converter.ymlString2Map(playbookContents);
PlaybookRepresentation t = new PlaybookRepresentation();
t.setName(name);
t.setKvMap(map);
save(t);
return t.getId();
}
}
...@@ -20,6 +20,7 @@ import java.util.List; ...@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import nl.uva.sne.drip.api.dao.ToscaDao; import nl.uva.sne.drip.api.dao.ToscaDao;
import nl.uva.sne.drip.api.exception.NotFoundException; import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.utils.Constants;
import nl.uva.sne.drip.commons.v1.types.ToscaRepresentation; import nl.uva.sne.drip.commons.v1.types.ToscaRepresentation;
import nl.uva.sne.drip.commons.utils.Converter; import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.v1.types.User; import nl.uva.sne.drip.commons.v1.types.User;
...@@ -40,8 +41,6 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -40,8 +41,6 @@ import org.springframework.web.multipart.MultipartFile;
@PreAuthorize("isAuthenticated()") @PreAuthorize("isAuthenticated()")
public class ToscaService { public class ToscaService {
private static final int[] BAD_CHARS = {0x80};
@Autowired @Autowired
private ToscaDao dao; private ToscaDao dao;
...@@ -137,8 +136,8 @@ public class ToscaService { ...@@ -137,8 +136,8 @@ public class ToscaService {
} }
toscaContents = sb.toString(); toscaContents = sb.toString();
toscaContents = toscaContents.replaceAll("(?m)^[ \t]*\r?\n", ""); toscaContents = toscaContents.replaceAll("(?m)^[ \t]*\r?\n", "");
for (int i = 0; i < BAD_CHARS.length; i++) { for (int i = 0; i < Constants.BAD_CHARS.length; i++) {
int hex = BAD_CHARS[i]; int hex = Constants.BAD_CHARS[i];
toscaContents = toscaContents.replaceAll(String.valueOf((char) hex), ""); toscaContents = toscaContents.replaceAll(String.valueOf((char) hex), "");
} }
......
/*
* Copyright 2017 S. Koulouzis.
*
* 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.
*/
package nl.uva.sne.drip.api.v1.rest;
import nl.uva.sne.drip.commons.v1.types.PlaybookRepresentation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.security.RolesAllowed;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.service.PlaybookService;
import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
/**
* This controller is responsible for storing PlayBook descriptions that can be
* used by the planner.
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/playbook")
@Component
public class PlaybookController {
@Autowired
private PlaybookService playbookService;
@RequestMapping(value = "/post", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String post(@RequestBody String toscaContents) {
try {
return playbookService.saveStringContents(toscaContents, String.valueOf(System.currentTimeMillis()));
} catch (IOException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Uploads and stores a PlayBook description file
*
* @param file. The PlayBook description file
* @return the ID of the PlayBook description
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String toscaUpload(@RequestParam("file") MultipartFile file) {
if (file.isEmpty()) {
throw new BadRequestException("Must uplaod a file");
}
try {
return playbookService.saveFile(file);
} catch (IOException | IllegalStateException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Gets the PlayBook description.
*
* @param id the ID PlayBook description.
* @param format. the format to display the PlayBook description.
* @return the PlayBook description.
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET, params = {"format"})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String get(@PathVariable("id") String id, @RequestParam(value = "format") String format) {
try {
return playbookService.get(id, format);
} catch (JSONException ex) {
Logger.getLogger(PlaybookController.class.getName()).log(Level.SEVERE, null, ex);
}
return null;
}
/**
* Deletes the PlayBook description.
*
* @param id. The ID of PlayBook description to delete.
* @return The ID of the deleted PlayBook description.
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String delete(@PathVariable("id") String id) {
playbookService.delete(id);
return "Deleted : " + id;
}
/**
* Gets the IDs of all the stored PlayBook descriptions.
*
* @return a list of all the IDs
*/
@RequestMapping(value = "/ids", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
List<String> getIds() {
List<PlaybookRepresentation> all = playbookService.findAll();
List<String> ids = new ArrayList<>();
for (PlaybookRepresentation tr : all) {
ids.add(tr.getId());
}
return ids;
}
/**
* Gets the IDs of all the stored PlayBook descriptions.
*
* @return a list of all the IDs
*/
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
playbookService.deleteAll();
return "Done";
}
}
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* 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.
*/
package nl.uva.sne.drip.commons.utils;
/**
*
* @author S. Koulouzis
*/
public class Constants {
public static final int[] BAD_CHARS = {0x80};
}
...@@ -52,7 +52,13 @@ public class Converter { ...@@ -52,7 +52,13 @@ public class Converter {
public static Map<String, Object> ymlString2Map(String yamlString) { public static Map<String, Object> ymlString2Map(String yamlString) {
Yaml yaml = new Yaml(); Yaml yaml = new Yaml();
return (Map<String, Object>) yaml.load(yamlString); Object object = yaml.load(yamlString);
if (object instanceof List) {
Map<String, Object> map = new HashMap<>();
map.put("---", object);
return map;
}
return (Map<String, Object>) object;
} }
public static Map<String, Object> ymlString2Map(InputStream in) { public static Map<String, Object> ymlString2Map(InputStream in) {
......
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* 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.
*/
package nl.uva.sne.drip.commons.v1.types;
import org.springframework.data.mongodb.core.mapping.Document;
/**
*
* @author S. Koulouzis
*/
@Document
public class PlaybookRepresentation extends KeyValueHolder {
private String name;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}
--- ---
- hosts: all - hosts: all
tasks: tasks:
- name: install sysbench - name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest apt: name="{{ item }}" update_cache=yes state=latest
with_items: with_items: [phoronix-test-suite, sysbench, expect, git, python-pexpect, php-zip]
- phoronix-test-suite become: true
- sysbench - {name: Phoronix-test-suite accept User Agreement, command: 'expect -c "spawn phoronix-test-suite;
- expect expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y
- git \"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send
- python-pexpect \"n \"; expect \"Enable anonymous statistical reporting of installed software
- php-zip / hardware \(Y/n\):\"; send \"n \"; interact;"', become: true}
become: true - {name: Install stream, command: phoronix-test-suite install-test stream, become: true}
- {name: Install iozone, command: phoronix-test-suite install-test iozone, become: true}
- name: Phoronix-test-suite accept User Agreement - {name: Count vCPU, command: nproc, register: vcpunumber, become: true}
command: expect -c "spawn phoronix-test-suite; expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y\n\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send \"n\n\"; expect \"Enable anonymous statistical reporting of installed software / hardware \(Y/n\):\"; send \"n\n\"; interact;" - {debug: 'msg="{{ vcpunumber.stdout }}"'}
become: true - {name: Run sysbench, command: 'sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{
vcpunumber.stdout }} run', register: sysbenchoutput, become: true}
- name: Install stream - {debug: 'msg="{{ sysbenchoutput.stdout }}"'}
command: phoronix-test-suite install-test stream - {name: Run stream, command: 'expect -c "spawn phoronix-test-suite run-test stream;
become: true expect \"Type:\"; send \"4 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect
\"Enter a name to save these results under:\"; send \"out \"; expect \"Enter
- name: Install iozone a unique name to describe this test run / configuration:\"; send -- \"unique\r\";
command: phoronix-test-suite install-test iozone expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload
become: true the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: streamoutput,
become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
- name: Count vCPU - {name: Run iozone, command: 'expect -c "spawn phoronix-test-suite run-test iozone;
command: nproc expect \"Record Size:\"; send \"2 \"; expect \"File Size:\"; send \"2 \"; expect
register: vcpunumber \"Disk Test:\"; send \"3 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter
become: true a name to save these results under:\"; send \"out \"; expect \"Enter a unique
- debug: msg="{{ vcpunumber.stdout }}" name to describe this test run / configuration:\"; send -- \"unique\r\"; expect
\"New Description:\"; send \"\r\"; expect \"Would you like to upload the results
to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: iozoneoutput,
- name: Run sysbench become: true}
command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run - {name: Get stream results, command: phoronix-test-suite result-file-to-csv out,
register: sysbenchoutput register: streamoutput, become: true}
become: true - {debug: 'msg="{{ streamoutput.stdout }}"'}
- debug: msg="{{ sysbenchoutput.stdout }}" \ No newline at end of file
- name: Run stream
command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
- name: Run iozone
command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: iozoneoutput
become: true
- name: Get stream results
command: phoronix-test-suite result-file-to-csv out
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
#- debug: msg="{{ iozoneoutput.stdout }}"
#- local_action: copy content="{{ iozoneoutput.stdout }}" dest="{{ resultslocation }}iozone"
\ No newline at end of file
---
- hosts: all
tasks:
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items:
- phoronix-test-suite
- sysbench
- expect
- git
- python-pexpect
- php-zip
become: true
- name: Phoronix-test-suite accept User Agreement
command: expect -c "spawn phoronix-test-suite; expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y\n\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send \"n\n\"; expect \"Enable anonymous statistical reporting of installed software / hardware \(Y/n\):\"; send \"n\n\"; interact;"
become: true
- name: Install stream
command: phoronix-test-suite install-test stream
become: true
- name: Install iozone
command: phoronix-test-suite install-test iozone
become: true
- name: Count vCPU
command: nproc
register: vcpunumber
become: true
- debug: msg="{{ vcpunumber.stdout }}"
- name: Run sysbench
command: sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{ vcpunumber.stdout }} run
register: sysbenchoutput
become: true
- debug: msg="{{ sysbenchoutput.stdout }}"
- name: Run stream
command: expect -c "spawn phoronix-test-suite run-test stream; expect \"Type:\"; send \"4\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
- name: Run iozone
command: expect -c "spawn phoronix-test-suite run-test iozone; expect \"Record Size:\"; send \"2\n\"; expect \"File Size:\"; send \"2\n\"; expect \"Disk Test:\"; send \"3\n\"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter a name to save these results under:\"; send \"out\n\"; expect \"Enter a unique name to describe this test run / configuration:\"; send -- \"unique\r\"; expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"
register: iozoneoutput
become: true
- name: Get stream results
command: phoronix-test-suite result-file-to-csv out
register: streamoutput
become: true
- debug: msg="{{ streamoutput.stdout }}"
\ No newline at end of file
---
- hosts: all
tasks:
- name: install sysbench
apt: name="{{ item }}" update_cache=yes state=latest
with_items: [phoronix-test-suite, sysbench, expect, git, python-pexpect, php-zip]
become: true
- {name: Phoronix-test-suite accept User Agreement, command: 'expect -c "spawn phoronix-test-suite;
expect \"Do you agree to these terms and wish to proceed \(Y/n\):\"; send \"Y
\"; expect \"Enable anonymous usage / statistics reporting \(Y/n\):\"; send
\"n \"; expect \"Enable anonymous statistical reporting of installed software
/ hardware \(Y/n\):\"; send \"n \"; interact;"', become: true}
- {name: Install stream, command: phoronix-test-suite install-test stream, become: true}
- {name: Install iozone, command: phoronix-test-suite install-test iozone, become: true}
- {name: Count vCPU, command: nproc, register: vcpunumber, become: true}
- {debug: 'msg="{{ vcpunumber.stdout }}"'}
- {name: Run sysbench, command: 'sysbench --test=cpu --cpu-max-prime=100000 --num-threads={{
vcpunumber.stdout }} run', register: sysbenchoutput, become: true}
- {debug: 'msg="{{ sysbenchoutput.stdout }}"'}
- {name: Run stream, command: 'expect -c "spawn phoronix-test-suite run-test stream;
expect \"Type:\"; send \"4 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect
\"Enter a name to save these results under:\"; send \"out \"; expect \"Enter
a unique name to describe this test run / configuration:\"; send -- \"unique\r\";
expect \"New Description:\"; send \"\r\"; expect \"Would you like to upload
the results to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: streamoutput,
become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
- {name: Run iozone, command: 'expect -c "spawn phoronix-test-suite run-test iozone;
expect \"Record Size:\"; send \"2 \"; expect \"File Size:\"; send \"2 \"; expect
\"Disk Test:\"; send \"3 \"; expect \"\(Y/n\):\"; send -- \"y\r\"; expect \"Enter
a name to save these results under:\"; send \"out \"; expect \"Enter a unique
name to describe this test run / configuration:\"; send -- \"unique\r\"; expect
\"New Description:\"; send \"\r\"; expect \"Would you like to upload the results
to OpenBenchmarking.org (Y/n):\"; send \"n\r\"; interact;"', register: iozoneoutput,
become: true}
- {name: Get stream results, command: phoronix-test-suite result-file-to-csv out,
register: streamoutput, become: true}
- {debug: 'msg="{{ streamoutput.stdout }}"'}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment