Commit 504e1228 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Fix EC2.conf mapping

Rename script service 
parent 5d404579
......@@ -81,6 +81,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......@@ -242,6 +248,12 @@ from the machine the keys correspond to.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -91,7 +91,7 @@
<tbody data-link="row" class="rowlink">
<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-size">8.25K</span></td>
<td><span class="downloadfile-size">8.98K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr>
</tbody>
......@@ -116,12 +116,12 @@
<tbody data-link="row" class="rowlink">
<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-size">10.75K</span></td>
<td><span class="downloadfile-size">11.77K</span></td>
<td><span class="downloadfile-description">The binaries for the Java JSON client library.</span></td>
</tr>
<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-size">8.50K</span></td>
<td><span class="downloadfile-size">9.29K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr>
</tbody>
......@@ -144,12 +144,12 @@
<tbody data-link="row" class="rowlink">
<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-size">18.93K</span></td>
<td><span class="downloadfile-size">19.85K</span></td>
<td><span class="downloadfile-description">The binaries for the Java XML client library.</span></td>
</tr>
<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-size">17.11K</span></td>
<td><span class="downloadfile-size">17.89K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr>
</tbody>
......@@ -184,7 +184,7 @@
<tbody data-link="row" class="rowlink">
<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-size">3.26K</span></td>
<td><span class="downloadfile-size">3.53K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -213,7 +213,7 @@
<tbody data-link="row" class="rowlink">
<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-size">3.40K</span></td>
<td><span class="downloadfile-size">3.72K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -245,7 +245,7 @@
<tbody data-link="row" class="rowlink">
<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-size">7.16K</span></td>
<td><span class="downloadfile-size">7.58K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......@@ -276,7 +276,7 @@
<tbody data-link="row" class="rowlink">
<tr class="clickable-row" data-href="drip-api.rb">
<td><span class="downloadfile-name">drip-api.rb</span></td>
<td><span class="downloadfile-size">42.59K</span></td>
<td><span class="downloadfile-size">47.03K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -410,13 +410,221 @@ module V1
module Types
# (no documentation provided)
class Type
class DeployParameter
# the cloudCertificateName
attr_accessor :cloudCertificateName
# the IP
attr_accessor :IP
# the user
attr_accessor :user
# the role
attr_accessor :role
# the json hash for this DeployParameter
def to_jaxb_json_hash
_h = {}
_h['cloudCertificateName'] = cloudCertificateName.to_jaxb_json_hash unless cloudCertificateName.nil?
_h['IP'] = IP.to_jaxb_json_hash unless IP.nil?
_h['user'] = user.to_jaxb_json_hash unless user.nil?
_h['role'] = role.to_jaxb_json_hash unless role.nil?
return _h
end
#
PRIVATE = "PRIVATE"
# the json (string form) for this DeployParameter
def to_json
to_jaxb_json_hash.to_json
end
#
PUBLIC = "PUBLIC"
#initializes this DeployParameter with a json hash
def init_jaxb_json_hash(_o)
if !_o['cloudCertificateName'].nil?
_oa = _o['cloudCertificateName']
if(_oa.is_a? Hash)
@cloudCertificateName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudCertificateName = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudCertificateName = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudCertificateName.push String.from_json(_item)
else
@cloudCertificateName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudCertificateName = _oa
end
end
if !_o['IP'].nil?
_oa = _o['IP']
if(_oa.is_a? Hash)
@IP = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@IP = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@IP = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@IP.push String.from_json(_item)
else
@IP.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@IP = _oa
end
end
if !_o['user'].nil?
_oa = _o['user']
if(_oa.is_a? Hash)
@user = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@user = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@user = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@user.push String.from_json(_item)
else
@user.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@user = _oa
end
end
if !_o['role'].nil?
_oa = _o['role']
if(_oa.is_a? Hash)
@role = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@role = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@role = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@role.push String.from_json(_item)
else
@role.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@role = _oa
end
end
end
# constructs a DeployParameter 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
# (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject
# 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)
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
......@@ -569,74 +777,13 @@ module V1
module Types
# (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Commons::V1::Types::OwnedObject
# 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
class Type
#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
#
PRIVATE = "PRIVATE"
# 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
#
PUBLIC = "PUBLIC"
end
end
......@@ -1120,6 +1267,105 @@ module Commons
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
# (no documentation provided)
......@@ -1267,105 +1513,6 @@ module Commons
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
# (no documentation provided)
......@@ -1452,18 +1599,15 @@ module Types
attr_accessor :cloudCredentialsID
# the planID
attr_accessor :planID
# the scriptID
attr_accessor :scriptID
# the userKeyID
attr_accessor :userKeyID
# the publicKeyID
attr_accessor :publicKeyID
# the json hash for this ProvisionRequest
def to_jaxb_json_hash
_h = super
_h['cloudCredentialsID'] = cloudCredentialsID.to_jaxb_json_hash unless cloudCredentialsID.nil?
_h['planID'] = planID.to_jaxb_json_hash unless planID.nil?
_h['scriptID'] = scriptID.to_jaxb_json_hash unless scriptID.nil?
_h['userKeyID'] = userKeyID.to_jaxb_json_hash unless userKeyID.nil?
_h['publicKeyID'] = publicKeyID.to_jaxb_json_hash unless publicKeyID.nil?
return _h
end
......@@ -1508,42 +1652,23 @@ module Types
@planID = _oa
end
end
if !_o['scriptID'].nil?
_oa = _o['scriptID']
if(_oa.is_a? Hash)
@scriptID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scriptID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@scriptID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@scriptID.push String.from_json(_item)
else
@scriptID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@scriptID = _oa
end
end
if !_o['userKeyID'].nil?
_oa = _o['userKeyID']
if !_o['publicKeyID'].nil?
_oa = _o['publicKeyID']
if(_oa.is_a? Hash)
@userKeyID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@userKeyID = String.from_json(_oa) unless _oa['@class']
@publicKeyID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@publicKeyID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@userKeyID = Array.new
@publicKeyID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@userKeyID.push String.from_json(_item)
@publicKeyID.push String.from_json(_item)
else
@userKeyID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@publicKeyID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@userKeyID = _oa
@publicKeyID = _oa
end
end
end
......@@ -1591,16 +1716,42 @@ module Types
# (no documentation provided)
class ProvisionResponse < Nl::Uva::Sne::Drip::Commons::V1::Types::ProvisionRequest
# the deployParameters
attr_accessor :deployParameters
# the json hash for this ProvisionResponse
def to_jaxb_json_hash
_h = super
if !deployParameters.nil?
_ha = Array.new
deployParameters.each { | _item | _ha.push _item.to_jaxb_json_hash }
_h['deployParameters'] = _ha
end
return _h
end
#initializes this ProvisionResponse with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['deployParameters'].nil?
_oa = _o['deployParameters']
if(_oa.is_a? Hash)
@deployParameters = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@deployParameters = Nl::Uva::Sne::Drip::Commons::V1::Types::DeployParameter.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@deployParameters = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@deployParameters.push Nl::Uva::Sne::Drip::Commons::V1::Types::DeployParameter.from_json(_item)
else
@deployParameters.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@deployParameters = _oa
end
end
end
# constructs a ProvisionResponse from a (parsed) JSON hash
......
......@@ -208,11 +208,13 @@ provisopned based on a TOSCA description.</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{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">GET</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 obtaining resources from cloud providers
......@@ -230,6 +232,27 @@ based the plan generated by the planner</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
based the plan generated by the planner and uploaded by the user</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ScriptController.html">
<td> <span class="resource-name">ScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/script</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><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">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">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 handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ToscaController.html">
......@@ -289,23 +312,6 @@ used by the planner.</span>
<td> <span class="resource-description">This controller is responsible for handling user public keys. These keys can
be used by the provisoner to allow the user to login to the VMs from the
machine the keys correspond to.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{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">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 handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController0.html">
......@@ -339,6 +345,12 @@ used by the provisoner to run on the created VMs.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......@@ -500,6 +512,12 @@ from the machine the keys correspond to.</span>
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -68,7 +68,7 @@
<dl class="dl-horizontal">
<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_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>
<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>
</dl>
<table class="table datatype-properties">
......
......@@ -100,16 +100,7 @@
</td>
</tr>
<tr>
<td> <span class="property-name">scriptID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">userKeyID</span>
<td> <span class="property-name">publicKeyID</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -153,8 +144,7 @@
<pre class="prettyprint language-js example">{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
......@@ -79,6 +79,15 @@
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">deployParameters</span>
</td>
<td> <span class="datatype-reference">array of <a href="json_DeployParameter.html">DeployParameter</a>
</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_ProvisionRequest.html">ProvisionRequest</a></h5></td>
......@@ -97,13 +106,7 @@
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">scriptID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
</tr>
<tr>
<td><span class="property-name">userKeyID</span></td>
<td><span class="property-name">publicKeyID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-description"></span></td>
......@@ -142,10 +145,20 @@
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;deployParameters&quot; : [ {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
}, {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
} ],
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
......@@ -280,6 +280,19 @@ to request for resources.]]>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="deployParameter">
<xs:sequence>
<xs:element name="cloudCertificateName" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="IP" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="user" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="role" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="deployRequest">
<xs:complexContent>
<xs:extension base="ownedObject">
......@@ -422,9 +435,7 @@ to specify the domain name for ec2]]>
</xs:element>
<xs:element name="planID" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="scriptID" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="userKeyID" type="xs:string" minOccurs="0">
<xs:element name="publicKeyID" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
......@@ -434,6 +445,10 @@ to specify the domain name for ec2]]>
<xs:complexType name="provisionResponse">
<xs:complexContent>
<xs:extension base="provisionRequest">
<xs:sequence>
<xs:element name="deployParameters" type="deployParameter" minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
......
......@@ -54,6 +54,7 @@
<li><a href="#resource_ProvisionController_deleteAll_DELETE"><abbr title="DELETE /user/v1.0/provisioner/all">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_getIds_GET">GET /user/v1.0/provisioner/ids</a></li>
<li><a href="#resource_ProvisionController_provision_POST"><abbr title="POST /user/v1.0/provisioner/provision">POST /user/v1.0/provisioner/pr...</abbr></a></li>
<li><a href="#resource_ProvisionController_provision_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li>
<li><a href="#resource_ProvisionController_delete_DELETE"><abbr title="DELETE /user/v1.0/provisioner/{id}">DELETE /user/v1.0/provisioner/...</abbr></a></li>
<li><a href="#resource_ProvisionController_get_GET"><abbr title="GET /user/v1.0/provisioner/{id}">GET /user/v1.0/provisioner/{id...</abbr></a></li>
<li class="divider"></li>
......@@ -261,8 +262,7 @@ Accept: application/json
{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......@@ -288,6 +288,74 @@ Content-Type: application/json
</div>
</div>
<div id="resource_ProvisionController_provision_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/provisioner/sample <a href="../user/v1.0/provisioner/sample" 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-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"><a href="json_ProvisionRequest.html">ProvisionRequest</a>
(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"><a href="xml_ns0_provisionRequest.html">provisionRequest</a>
(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/provisioner/sample
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-js">
{
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
},
&quot;id&quot; : &quot;...&quot;,
&quot;owner&quot; : &quot;...&quot;
}
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_ProvisionController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/provisioner/{id} <a href="../user/v1.0/provisioner/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
......@@ -437,10 +505,20 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;deployParameters&quot; : [ {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
}, {
&quot;cloudCertificateName&quot; : &quot;...&quot;,
&quot;IP&quot; : &quot;...&quot;,
&quot;user&quot; : &quot;...&quot;,
&quot;role&quot; : &quot;...&quot;
} ],
&quot;cloudCredentialsID&quot; : &quot;...&quot;,
&quot;planID&quot; : &quot;...&quot;,
&quot;scriptID&quot; : &quot;...&quot;,
&quot;userKeyID&quot; : &quot;...&quot;,
&quot;publicKeyID&quot; : &quot;...&quot;,
&quot;keyValue&quot; : {
&quot;property1&quot; : { },
&quot;property2&quot; : { }
......
<!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: ScriptController</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: ScriptController</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_ScriptController_uploadUserScript_POST">POST /user/v1.0/script</a></li>
<li><a href="#resource_ScriptController_deleteAll_DELETE">DELETE /user/v1.0/script/all</a></li>
<li><a href="#resource_ScriptController_getIds_GET">GET /user/v1.0/script/ids</a></li>
<li><a href="#resource_ScriptController_get_GET">GET /user/v1.0/script/sample</a></li>
<li><a href="#resource_ScriptController_uploadUserScript_POST">POST /user/v1.0/script/upload</a></li>
<li><a href="#resource_ScriptController_delete_DELETE">DELETE /user/v1.0/script/{id}</a></li>
<li><a href="#resource_ScriptController_get_GET">GET /user/v1.0/script/{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_ScriptController.html">ScriptController</a></li>
</ol>
<h1 class="page-header">ScriptController <small>Resource</small></h1>
<p>This controller is responsible for handling user scripts. These user can be
used by the provisoner to run on the created VMs.</p>
<div id="resource_ScriptController_uploadUserScript_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/script <a href="../user/v1.0/script" 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"><a href="json_Script.html">Script</a>
(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"><a href="xml_ns0_script.html">script</a>
(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/script
Content-Type: application/json
Accept: application/json
<code class="prettyprint language-js">
{
&quot;id&quot; : &quot;...&quot;,
&quot;name&quot; : &quot;config.sh&quot;,
&quot;contents&quot; : &quot; #!/bin/bash\necho \&quot;Reading system-wide config....\&quot; &gt;&amp;2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \&quot;Reading user config....\&quot; &gt;&amp;2\\n . ~/.coolrc\\nfi&quot;,
&quot;owner&quot; : &quot;...&quot;
}
</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_ScriptController_deleteAll_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/script/all <a href="../user/v1.0/script/all" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p></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>
</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>
DELETE /user/v1.0/script/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_ScriptController_getIds_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/script/ids <a href="../user/v1.0/script/ids" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets the IDs of all the stored scripts</p>
<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/script/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_ScriptController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/script/sample <a href="../user/v1.0/script/sample" 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-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"><a href="json_Script.html">Script</a>
(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"><a href="xml_ns0_script.html">script</a>
(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/script/sample
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-js">
{
&quot;id&quot; : &quot;...&quot;,
&quot;name&quot; : &quot;config.sh&quot;,
&quot;contents&quot; : &quot; #!/bin/bash\necho \&quot;Reading system-wide config....\&quot; &gt;&amp;2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \&quot;Reading user config....\&quot; &gt;&amp;2\\n . ~/.coolrc\\nfi&quot;,
&quot;owner&quot; : &quot;...&quot;
}
</code>
</pre>
</div>
</div>
</div>
</div>
<div id="resource_ScriptController_uploadUserScript_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/script/upload <a href="../user/v1.0/script/upload" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Uploads a script</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 stopred script</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/script/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_ScriptController_delete_DELETE">
<h3><span class="label label-default resource-method">DELETE</span> <span class="resource-path">/user/v1.0/script/{id} <a href="../user/v1.0/script/{id}" 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-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>
</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>
DELETE /user/v1.0/script/{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_ScriptController_get_GET">
<h3><span class="label label-default resource-method">GET</span> <span class="resource-path">/user/v1.0/script/{id} <a href="../user/v1.0/script/{id}" class="glyphicon glyphicon-new-window" target="_blank"></a></span></h3>
<p>Gets a script</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"><a href="json_Script.html">Script</a>
(JSON)</span></td>
<td rowspan="2" class="multi-row-description"><span class="response-description">the script</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"><a href="xml_ns0_script.html">script</a>
(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/script/{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-js">
{
&quot;id&quot; : &quot;...&quot;,
&quot;name&quot; : &quot;config.sh&quot;,
&quot;contents&quot; : &quot; #!/bin/bash\necho \&quot;Reading system-wide config....\&quot; &gt;&amp;2\\n. /etc/cool.cfg\nif [ -r ~/.coolrc ]; then\n echo \&quot;Reading user config....\&quot; &gt;&amp;2\\n . ~/.coolrc\\nfi&quot;,
&quot;owner&quot; : &quot;...&quot;
}
</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>
......@@ -200,11 +200,13 @@ provisopned based on a TOSCA description.</span>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/provisioner/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/provision</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{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">GET</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 obtaining resources from cloud providers
......@@ -222,6 +224,27 @@ based the plan generated by the planner</span>
</samp></li></ul></td>
<td> <span class="resource-description">This controller is responsible for obtaining resources from cloud providers
based the plan generated by the planner and uploaded by the user</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ScriptController.html">
<td> <span class="resource-name">ScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/script</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/sample</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/script/{id}</span>
</samp></li></ul></td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li><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">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">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 handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_ToscaController.html">
......@@ -281,23 +304,6 @@ used by the planner.</span>
<td> <span class="resource-description">This controller is responsible for handling user public keys. These keys can
be used by the provisoner to allow the user to login to the VMs from the
machine the keys correspond to.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController.html">
<td> <span class="resource-name">UserScriptController</span>
</td>
<td class="text-nowrap"><ul class="list-unstyled"><li><samp> <span class="resource-path">/user/v1.0/user_script/all</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/ids</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/upload</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/user_script/{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">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 handling user scripts. These user can be
used by the provisoner to run on the created VMs.</span>
</td>
</tr>
<tr class="clickable-row" data-href="resource_UserScriptController0.html">
......
......@@ -76,6 +76,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployParameter.html">
<td> <span class="datatype-name">DeployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="json_DeployRequest.html">
......
......@@ -143,6 +143,12 @@
</td>
<td> <span class="datatype-description">This class represents the cloud credentials. They are used by the provisoner
to request for resources.</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployParameter.html">
<td> <span class="datatype-name">deployParameter</span>
</td>
<td> <span class="datatype-description"></span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_deployRequest.html">
......
......@@ -125,7 +125,7 @@
</td>
</tr>
<tr>
<td> <span class="property-name">scriptID</span>
<td> <span class="property-name">publicKeyID</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -139,25 +139,7 @@
<td> <span class="property-minMaxOccurs">0/1
</span>
</td>
<td> <span class="property-description">the scriptID</span>
</td>
</tr>
<tr>
<td> <span class="property-name">userKeyID</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 userKeyID</span>
<td> <span class="property-description">the publicKeyID</span>
</td>
</tr>
</tbody>
......@@ -202,8 +184,7 @@
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;cloudCredentialsID&gt;...&lt;/cloudCredentialsID&gt;
&lt;planID&gt;...&lt;/planID&gt;
&lt;scriptID&gt;...&lt;/scriptID&gt;
&lt;userKeyID&gt;...&lt;/userKeyID&gt;
&lt;publicKeyID&gt;...&lt;/publicKeyID&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;owner&gt;...&lt;/owner&gt;
&lt;/p-----&gt;
......
......@@ -86,6 +86,24 @@
</tr>
</thead>
<tbody>
<tr>
<td> <span class="property-name">deployParameters</span>
</td>
<td> <span class="datatype-reference"><a href="xml_ns0_deployParameter.html">deployParameter</a>
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">0/unbounded
</span>
</td>
<td> <span class="property-description">the deployParameters</span>
</td>
</tr>
</tbody>
<tr>
<td colspan="6"><h5 class="text-muted">Properties inherited from <a href="xml_ns0_provisionRequest.html">provisionRequest</a></h5></td>
......@@ -116,19 +134,7 @@
<td><span class="property-description">the planID</span></td>
</tr>
<tr>
<td><span class="property-name">scriptID</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 scriptID</span></td>
</tr>
<tr>
<td><span class="property-name">userKeyID</span></td>
<td><span class="property-name">publicKeyID</span></td>
<td><span class="datatype-reference">string
</span></td>
<td><span class="property-type">element
......@@ -137,7 +143,7 @@
</span></td>
<td><span class="property-minMaxOccurs">0/1
</span></td>
<td><span class="property-description">the userKeyID</span></td>
<td><span class="property-description">the publicKeyID</span></td>
</tr>
</tbody>
<tr>
......@@ -179,10 +185,15 @@
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;p-----&gt;
&lt;deployParameters&gt;
&lt;cloudCertificateName&gt;...&lt;/cloudCertificateName&gt;
&lt;IP&gt;...&lt;/IP&gt;
&lt;user&gt;...&lt;/user&gt;
&lt;role&gt;...&lt;/role&gt;
&lt;/deployParameters&gt;
&lt;cloudCredentialsID&gt;...&lt;/cloudCredentialsID&gt;
&lt;planID&gt;...&lt;/planID&gt;
&lt;scriptID&gt;...&lt;/scriptID&gt;
&lt;userKeyID&gt;...&lt;/userKeyID&gt;
&lt;publicKeyID&gt;...&lt;/publicKeyID&gt;
&lt;id&gt;...&lt;/id&gt;
&lt;/p-----&gt;
</pre>
......
......@@ -79,7 +79,7 @@ public class ProvisionService {
private SimplePlannerService planService;
@Autowired
private UserScriptService userScriptService;
private ScriptService userScriptService;
@Autowired
private KeyService userKeysService;
......@@ -186,13 +186,7 @@ public class ProvisionService {
List<MessageParameter> topologies = buildTopologyParams(pReq.getPlanID());
parameters.addAll(topologies);
String scriptID = pReq.getscriptID();
if (scriptID != null) {
List<MessageParameter> userScripts = buildScriptParams(scriptID);
parameters.addAll(userScripts);
}
String userKeyID = pReq.getUserKeyID();
String userKeyID = pReq.getPublicKeyID();
if (userKeyID != null) {
List<MessageParameter> userKeys = buildKeysParams(userKeyID);
parameters.addAll(userKeys);
......
......@@ -33,7 +33,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
*/
@Service
@PreAuthorize("isAuthenticated()")
public class UserScriptService {
public class ScriptService {
@Autowired
ScriptDao dao;
......
......@@ -37,7 +37,7 @@ import nl.uva.sne.drip.api.service.CloudCredentialsService;
import nl.uva.sne.drip.api.service.PlannerService;
import nl.uva.sne.drip.api.service.ProvisionService;
import nl.uva.sne.drip.api.service.KeyService;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v0.types.Execute;
import nl.uva.sne.drip.commons.v0.types.Attribute;
......@@ -65,7 +65,7 @@ import org.springframework.web.bind.annotation.RequestBody;
public class ProvisionController0 {
@Autowired
private UserScriptService userScriptService;
private ScriptService userScriptService;
@Autowired
private KeyService userKeysService;
......@@ -108,12 +108,7 @@ public class ProvisionController0 {
List<Key> allKeys = userKeysService.findAll();
if (allKeys != null && !allKeys.isEmpty()) {
String userKeyID = allKeys.get(0).getId();
resp.setUserKeyID(userKeyID);
}
List<Script> allScripts = userScriptService.findAll();
if (allScripts != null && !allScripts.isEmpty()) {
String scriptID = allScripts.get(0).getId();
resp.setScriptID(scriptID);
resp.setPublicKeyID(userKeyID);
}
resp = provisionService.save(resp);
return "Success: Infrastructure files are uploaded! Action number: "
......
......@@ -62,7 +62,7 @@ public class UserPublicKeysController0 {
upk = service.save(upk);
ProvisionResponse provPlan = provisionService.findOne(confUserKey.action);
provPlan.setUserKeyID(upk.getId());
provPlan.setPublicKeyID(upk.getId());
provisionService.save(provPlan);
return "Success: " + upk.getId();
......
......@@ -21,7 +21,7 @@ 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.RestController;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v0.types.ConfScript;
import nl.uva.sne.drip.commons.v1.types.ProvisionResponse;
......@@ -43,10 +43,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class UserScriptController0 {
@Autowired
private UserScriptService scriptService;
@Autowired
private ProvisionService provisionService;
private ScriptService scriptService;
@RequestMapping(value = "/confscript", method = RequestMethod.POST, consumes = MediaType.TEXT_XML_VALUE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
......@@ -55,11 +52,6 @@ public class UserScriptController0 {
Script script = new Script();
script.setContents(confScript.script);
script = scriptService.save(script);
ProvisionResponse provPlan = provisionService.findOne(confScript.action);
provPlan.setScriptID(script.getId());
provisionService.save(provPlan);
return "Success: script for GUI is uploaded: " + script.getId();
}
......
......@@ -31,8 +31,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.api.service.CloudCredentialsService;
import nl.uva.sne.drip.api.service.PlannerService;
import nl.uva.sne.drip.api.service.ProvisionService;
import nl.uva.sne.drip.api.service.UserService;
import nl.uva.sne.drip.commons.v1.types.CloudCredentials;
import nl.uva.sne.drip.commons.v1.types.PlanResponse;
import nl.uva.sne.drip.commons.v1.types.ProvisionResponse;
import org.json.JSONException;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -52,6 +56,12 @@ public class ProvisionController {
@Autowired
private ProvisionService provisionService;
@Autowired
private CloudCredentialsService cloudCredentialService;
@Autowired
private PlannerService plannServcie;
/**
* Gets the ProvisionRequest
*
......@@ -137,4 +147,16 @@ public class ProvisionController {
return null;
}
@RequestMapping(value = "/sample", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
ProvisionRequest provision() {
ProvisionRequest r = new ProvisionRequest();
r.setCloudCredentialsID("Cloud_Credentials_ID");
r.setPlanID("Plan_ID");
r.setPublicKeyID("Public_Key_ID");
return r;
}
}
......@@ -32,8 +32,9 @@ import org.springframework.web.multipart.MultipartFile;
import nl.uva.sne.drip.api.exception.NotFoundException;
import nl.uva.sne.drip.commons.v1.types.Script;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.service.UserScriptService;
import nl.uva.sne.drip.api.service.ScriptService;
import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
/**
* This controller is responsible for handling user scripts. These user can be
......@@ -42,12 +43,12 @@ import nl.uva.sne.drip.api.service.UserService;
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v1.0/user_script")
@RequestMapping("/user/v1.0/script")
@Component
public class UserScriptController {
public class ScriptController {
@Autowired
private UserScriptService userScriptService;
private ScriptService scriptService;
// curl -v -X POST -F "file=@script.sh" localhost:8080/drip-api/rest/user_script/upload
/**
......@@ -57,7 +58,7 @@ public class UserScriptController {
* @return the ID of the stopred script
*/
@RequestMapping(value = "/upload", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String uploadUserScript(@RequestParam("file") MultipartFile file) {
if (!file.isEmpty()) {
......@@ -71,16 +72,23 @@ public class UserScriptController {
us.setContents(conents);
us.setName(name);
userScriptService.save(us);
scriptService.save(us);
return us.getId();
} catch (IOException | IllegalStateException ex) {
Logger.getLogger(UserScriptController.class.getName()).log(Level.SEVERE, null, ex);
Logger.getLogger(ScriptController.class.getName()).log(Level.SEVERE, null, ex);
}
}
return null;
}
@RequestMapping(method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String uploadUserScript(@RequestBody Script script) {
return null;
}
/**
* Gets a script
*
......@@ -88,31 +96,52 @@ public class UserScriptController {
* @return the script
*/
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Script get(@PathVariable("id") String id) {
return userScriptService.findOne(id);
return scriptService.findOne(id);
}
@RequestMapping(value = "/sample", method = RequestMethod.GET)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
Script get() {
Script script = new Script();
script.setContents("#! /bin/bash\n"
+ " apt-get update\n"
+ " apt-get -y install linux-image-extra-$(uname -r) linux-image-extra-virtual\n"
+ " apt-get -y install apt-transport-https ca-certificates curl software-properties-common\n"
+ " curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -\n"
+ " apt-key fingerprint 0EBFCD88\n"
+ " add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\"\n"
+ " apt-get update\n"
+ " apt-get -y install docker-ce\n"
+ " service docker restart");
script.setName("setupDocker.sh");
return script;
}
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody String delete(@PathVariable("id") String id) {
Script script = userScriptService.findOne(id);
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
String delete(@PathVariable("id") String id) {
Script script = scriptService.findOne(id);
if (script == null) {
throw new NotFoundException();
}
userScriptService.delete(id);
scriptService.delete(id);
return "Deleted: " + id;
}
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody String deleteAll() {
userScriptService.deleteAll();
@RequestMapping(value = "/all", method = RequestMethod.DELETE)
@RolesAllowed({UserService.ADMIN})
public @ResponseBody
String deleteAll() {
scriptService.deleteAll();
return "Done";
}
/**
* Gets the IDs of all the stored scripts
*
......@@ -121,7 +150,7 @@ public class UserScriptController {
@RequestMapping(value = "/ids", method = RequestMethod.GET)
public @ResponseBody
List<String> getIds() {
List<Script> all = userScriptService.findAll();
List<Script> all = scriptService.findAll();
List<String> ids = new ArrayList<>();
for (Script us : all) {
ids.add(us.getId());
......
......@@ -141,8 +141,8 @@ public class Converter {
}
private static void initEC2_NAME_MAP() {
EC2_NAME_MAP.put("keyIdAlias", "AWSAccessKeyId");
EC2_NAME_MAP.put("key", "AWSSecretKey");
EC2_NAME_MAP.put(CloudCredentials.ACCESS_KEY_NAME, "AWSAccessKeyId");
EC2_NAME_MAP.put(CloudCredentials.SECRET_KEY_NAME, "AWSSecretKey");
}
public static Message string2Message(String clean) throws JSONException, IOException {
......
......@@ -29,6 +29,9 @@ import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class CloudCredentials extends OwnedObject {
public static String ACCESS_KEY_NAME = "accessKeyId";
public static String SECRET_KEY_NAME = "secretKey";
@Id
private String id;
......
......@@ -15,7 +15,6 @@
*/
package nl.uva.sne.drip.commons.v1.types;
import java.util.List;
import org.springframework.data.mongodb.core.mapping.Document;
/**
......@@ -29,9 +28,7 @@ public class ProvisionRequest extends KeyValueHolder {
private String planID;
private String scriptID;
private String userKeyID;
private String publicKeyID;
/**
* @return the cloudCredentialsID
......@@ -62,34 +59,16 @@ public class ProvisionRequest extends KeyValueHolder {
}
/**
* @return the scriptID
*/
public String getscriptID() {
return scriptID;
}
/**
* @param scriptID the scriptID to set
* @return the publicKeyID
*/
public void setScriptID(String scriptID) {
this.scriptID = scriptID;
public String getPublicKeyID() {
return publicKeyID;
}
/**
* @return the userKeyID
* @param userKeyID the publicKeyID to set
*/
public String getUserKeyID() {
return userKeyID;
}
/**
* @param userKeyID the userKeyID to set
*/
public void setUserKeyID(String userKeyID) {
this.userKeyID = userKeyID;
}
public void setDeployParameters(List<DeployParameter> deployParameters) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
public void setPublicKeyID(String userKeyID) {
this.publicKeyID = userKeyID;
}
}
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