Commit 5f3f8698 authored by Spiros Koulouzis's avatar Spiros Koulouzis

implementing vm scaling. We hit null pointer exception at EGISEngine line 654

parent 97fcf58a
......@@ -182,8 +182,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......@@ -365,8 +365,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application.
......@@ -91,13 +91,13 @@
<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">13.55K</span></td>
<td><span class="downloadfile-size">13.51K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
......@@ -116,18 +116,18 @@
<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">16.84K</span></td>
<td><span class="downloadfile-size">16.80K</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">14.00K</span></td>
<td><span class="downloadfile-size">13.97K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Java client-side library is used to access the Web service API for this application using Java.
</p>
......@@ -144,18 +144,18 @@
<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">24.61K</span></td>
<td><span class="downloadfile-size">24.60K</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">22.41K</span></td>
<td><span class="downloadfile-size">22.39K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -184,13 +184,13 @@
<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">5.26K</span></td>
<td><span class="downloadfile-size">5.27K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -213,13 +213,13 @@
<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">5.90K</span></td>
<td><span class="downloadfile-size">5.89K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only
......@@ -245,13 +245,13 @@
<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">9.01K</span></td>
<td><span class="downloadfile-size">8.99K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only
......@@ -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">75.64K</span></td>
<td><span class="downloadfile-size">75.70K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -1211,77 +1211,168 @@ module V1
module External
module Ansible
# (no documentation provided)
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class ScaleRequest < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :start
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :delta
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :host
# the scaleTargetID
attr_accessor :scaleTargetID
# the scaleTargetName
attr_accessor :scaleTargetName
# the numOfInstances
attr_accessor :numOfInstances
# the json hash for this BenchmarkResult
# the json hash for this ScaleRequest
def to_jaxb_json_hash
_h = super
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
_h['scaleTargetID'] = scaleTargetID.to_jaxb_json_hash unless scaleTargetID.nil?
_h['scaleTargetName'] = scaleTargetName.to_jaxb_json_hash unless scaleTargetName.nil?
_h['numOfInstances'] = numOfInstances.to_jaxb_json_hash unless numOfInstances.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
#initializes this ScaleRequest with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if !_o['scaleTargetID'].nil?
_oa = _o['scaleTargetID']
if(_oa.is_a? Hash)
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
@scaleTargetID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scaleTargetID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudDeploymentDomain = Array.new
@scaleTargetID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudDeploymentDomain.push String.from_json(_item)
@scaleTargetID.push String.from_json(_item)
else
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@scaleTargetID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudDeploymentDomain = _oa
@scaleTargetID = _oa
end
end
if !_o['start'].nil?
_oa = _o['start']
if !_o['scaleTargetName'].nil?
_oa = _o['scaleTargetName']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
@scaleTargetName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scaleTargetName = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
@scaleTargetName = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
@scaleTargetName.push String.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@scaleTargetName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
@scaleTargetName = _oa
end
end
if !_o['numOfInstances'].nil?
_oa = _o['numOfInstances']
if(_oa.is_a? Hash)
@numOfInstances = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@numOfInstances = Fixnum.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@numOfInstances = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@numOfInstances.push Fixnum.from_json(_item)
else
@numOfInstances.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@numOfInstances = _oa
end
end
end
# constructs a ScaleRequest 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
end
end
module Nl
module Uva
module Sne
module Drip
module Drip
module Commons
module Data
module V1
module External
module Ansible
# (no documentation provided)
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :delta
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :start
# (no documentation provided)
attr_accessor :host
# the json hash for this BenchmarkResult
def to_jaxb_json_hash
_h = super
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['vmType'].nil?
_oa = _o['vmType']
if(_oa.is_a? Hash)
......@@ -1301,6 +1392,25 @@ module Ansible
@vmType = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
end
end
if !_o['delta'].nil?
_oa = _o['delta']
if(_oa.is_a? Hash)
......@@ -1320,23 +1430,42 @@ module Ansible
@delta = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
@cloudDeploymentDomain = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
@cloudDeploymentDomain.push String.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
@cloudDeploymentDomain = _oa
end
end
if !_o['start'].nil?
_oa = _o['start']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
end
end
if !_o['host'].nil?
......@@ -1559,113 +1688,6 @@ module Data
module V1
module External
# (no documentation provided)
class Script < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the name
attr_accessor :name
# the contents
attr_accessor :contents
# the json hash for this Script
def to_jaxb_json_hash
_h = super
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['contents'] = contents.to_jaxb_json_hash unless contents.nil?
return _h
end
#initializes this Script 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
if !_o['contents'].nil?
_oa = _o['contents']
if(_oa.is_a? Hash)
@contents = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@contents = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@contents = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@contents.push String.from_json(_item)
else
@contents.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@contents = _oa
end
end
end
# constructs a Script 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
end
end
module Nl
module Uva
module Sne
module Drip
module Drip
module Commons
module Data
module V1
module External
# (no documentation provided)
......@@ -1715,87 +1737,43 @@ module V1
module External
# (no documentation provided)
class ScaleDeploymetRequest < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class KeyValueHolder < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the deployID
attr_accessor :deployID
# the serviceName
attr_accessor :serviceName
# the numOfInstances
attr_accessor :numOfInstances
# the keyValue
attr_accessor :keyValue
# the json hash for this ScaleDeploymetRequest
# the json hash for this KeyValueHolder
def to_jaxb_json_hash
_h = super
_h['deployID'] = deployID.to_jaxb_json_hash unless deployID.nil?
_h['serviceName'] = serviceName.to_jaxb_json_hash unless serviceName.nil?
_h['numOfInstances'] = numOfInstances.to_jaxb_json_hash unless numOfInstances.nil?
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
return _h
end
#initializes this ScaleDeploymetRequest with a json hash
#initializes this KeyValueHolder with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['deployID'].nil?
_oa = _o['deployID']
if(_oa.is_a? Hash)
@deployID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@deployID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@deployID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@deployID.push String.from_json(_item)
else
@deployID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@deployID = _oa
end
end
if !_o['serviceName'].nil?
_oa = _o['serviceName']
if(_oa.is_a? Hash)
@serviceName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@serviceName = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@serviceName = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@serviceName.push String.from_json(_item)
else
@serviceName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@serviceName = _oa
end
end
if !_o['numOfInstances'].nil?
_oa = _o['numOfInstances']
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@numOfInstances = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@numOfInstances = Fixnum.from_json(_oa) unless _oa['@class']
@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
@numOfInstances = Array.new
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@numOfInstances.push Fixnum.from_json(_item)
@keyValue.push Hash.from_json(_item)
else
@numOfInstances.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@numOfInstances = _oa
@keyValue = _oa
end
end
end
# constructs a ScaleDeploymetRequest from a (parsed) JSON hash
# constructs a KeyValueHolder from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -1973,43 +1951,65 @@ module V1
module External
# (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class Script < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the keyValue
attr_accessor :keyValue
# the name
attr_accessor :name
# the contents
attr_accessor :contents
# the json hash for this KeyValueHolder
# the json hash for this Script
def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['contents'] = contents.to_jaxb_json_hash unless contents.nil?
return _h
end
#initializes this KeyValueHolder with a json hash
#initializes this Script with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if !_o['name'].nil?
_oa = _o['name']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
@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
@keyValue = Array.new
@name = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
@name.push String.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _oa
@name = _oa
end
end
if !_o['contents'].nil?
_oa = _o['contents']
if(_oa.is_a? Hash)
@contents = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@contents = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@contents = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@contents.push String.from_json(_item)
else
@contents.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@contents = _oa
end
end
end
# constructs a KeyValueHolder from a (parsed) JSON hash
# constructs a Script from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -2616,13 +2616,13 @@ module External
_oa = _o['scale']
if(_oa.is_a? Hash)
@scale = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scale = Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleDeploymetRequest.from_json(_oa) unless _oa['@class']
@scale = Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleRequest.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@scale = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@scale.push Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleDeploymetRequest.from_json(_item)
@scale.push Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleRequest.from_json(_item)
else
@scale.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
......
......@@ -273,6 +273,7 @@ provisopned based on a TOSCA description.</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/scale</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td>
......@@ -280,6 +281,7 @@ provisopned based on a TOSCA description.</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">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><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li></ul></td>
......@@ -512,8 +514,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......@@ -695,8 +697,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -81,7 +81,7 @@ class</p>
</thead>
<tbody>
<tr>
<td> <span class="property-name">vmType</span>
<td> <span class="property-name">host</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -90,43 +90,43 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">delta</span>
<td> <span class="property-name">cloudDeploymentDomain</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">cloudDeploymentDomain</span>
<td> <span class="property-name">delta</span>
</td>
<td> <span class="datatype-reference">string
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">start</span>
<td> <span class="property-name">vmType</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">host</span>
<td> <span class="property-name">end</span>
</td>
<td> <span class="datatype-reference">string
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">end</span>
<td> <span class="property-name">start</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -165,12 +165,12 @@ object is saved.</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -102,7 +102,7 @@ pair is only used by kubernetes</p>
<tr>
<td> <span class="property-name">scale</span>
</td>
<td> <span class="datatype-reference"><a href="json_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a>
<td> <span class="datatype-reference"><a href="json_ScaleRequest.html">ScaleRequest</a>
</span>
</td>
<td> <span class="property-description">The scale information if any for this deployment</span>
......@@ -190,8 +190,8 @@ object is saved.</span></td>
&quot;timestamp&quot; : 1499793079011
},
&quot;scale&quot; : {
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a></dd>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_ScaleRequest.html">ScaleRequest</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
</dl>
<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: ScaleRequest</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: ScaleRequest</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_ScaleRequest.html">ScaleRequest</a></li>
</ol>
<h1 class="page-header">ScaleRequest <small>Data Type</small></h1>
<p>This class represents a scale request for a deployment. At the moment we only
support swarm.</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">scaleTargetID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description">The ID of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetName</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description">The name of the service or topology to scale.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">numOfInstances</span>
</td>
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description">The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1</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">The owner (username) for the particular object. This value is set when
the DAO saves the object based on the principal how made the call</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">The UID of this object. This value is auto generated by the DAO when the
object is saved.</span></td>
</tr>
<tr>
<td><span class="property-name">timestamp</span></td>
<td><span class="datatype-reference">number
</span></td>
<td><span class="property-description">The object's creation date in unix time stamp</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
}</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>
......@@ -363,7 +363,7 @@ pair is only used by kubernetes]]>
<xs:sequence>
<xs:element name="ansibleOutputList" type="xs:string" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="scale" type="scaleDeploymetRequest" minOccurs="0">
<xs:element name="scale" type="scaleRequest" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The scale information if any for this deployment]]>
......@@ -615,7 +615,7 @@ provisioner to request for cloud resources.]]>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="scaleDeploymetRequest">
<xs:complexType name="scaleRequest">
<xs:annotation>
<xs:documentation>
<![CDATA[This class represents a scale request for a deployment. At the moment we only
......@@ -625,26 +625,27 @@ support swarm.]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="deployID" type="xs:string" minOccurs="0">
<xs:element name="scaleTargetID" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The deployment ID. At the moment only swarm deployments are supported.]]>
<![CDATA[The ID of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.]]>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="serviceName" type="xs:string" minOccurs="0">
<xs:element name="scaleTargetName" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The name of the service to scale.]]>
<![CDATA[The name of the service or topology to scale.]]>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="numOfInstances" type="xs:int" minOccurs="1">
<xs:annotation>
<xs:documentation>
<![CDATA[The number of services to start. This number is absolute not cumulative.
If we have 2 service numbers running and we request for 3 we'll have 3 if
we request 1 we'll have 1]]>
<![CDATA[The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1]]>
</xs:documentation>
</xs:annotation>
</xs:element>
......@@ -807,14 +808,14 @@ class]]>
</xs:element>
<xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
......
......@@ -144,12 +144,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......@@ -514,12 +514,12 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;delta&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;end&quot; : 12345,
&quot;start&quot; : 12345,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
......
......@@ -458,12 +458,12 @@ Content-Type: application/json
<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_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a>
<td><span class="datatype-reference"><a href="json_ScaleRequest.html">ScaleRequest</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_scaleDeploymetRequest.html">scaleDeploymetRequest</a>
<td><span class="datatype-reference"><a href="xml_ns0_scaleRequest.html">scaleRequest</a>
(XML)</span></td>
</tr>
</tbody>
......@@ -519,8 +519,8 @@ Accept: application/json
<code class="prettyprint language-js">
{
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......@@ -767,8 +767,8 @@ Content-Type: application/json
&quot;timestamp&quot; : 1499793079011
},
&quot;scale&quot; : {
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -55,6 +55,7 @@
<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_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li>
<li><a href="#resource_ProvisionController_scaleDeployment_POST"><abbr title="POST /user/v1.0/provisioner/scale">POST /user/v1.0/provisioner/sc...</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><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision">POST /user/v1.0/provisioner/po...</abbr></a></li>
......@@ -433,6 +434,113 @@ Content-Type: application/json
</div>
</div>
<div id="resource_ProvisionController_scaleDeployment_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/scale <a href="../user/v1.0/provisioner/scale" 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_ScaleRequest.html">ScaleRequest</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_scaleRequest.html">scaleRequest</a>
(XML)</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-codes">
<caption>Response Codes</caption>
<thead>
<tr>
<th>code</th>
<th>condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</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/provisioner/scale
Content-Type: application/json
Accept: application/json
<code class="prettyprint language-js">
{
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
}
</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_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>
......
......@@ -265,6 +265,7 @@ provisopned based on a TOSCA description.</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/scale</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td>
......@@ -272,6 +273,7 @@ provisopned based on a TOSCA description.</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">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><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li></ul></td>
......
......@@ -177,8 +177,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -222,8 +222,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -233,10 +233,10 @@ the DAO saves the object based on the principal how made the call</span></td>
<pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
&lt;/b-----&gt;
......
......@@ -109,7 +109,7 @@ pair is only used by kubernetes</p>
<tr>
<td> <span class="property-name">scale</span>
</td>
<td> <span class="datatype-reference"><a href="xml_ns0_scaleDeploymetRequest.html">scaleDeploymetRequest</a>
<td> <span class="datatype-reference"><a href="xml_ns0_scaleRequest.html">scaleRequest</a>
</span>
</td>
<td> <span class="property-type">element
......@@ -205,8 +205,8 @@ the DAO saves the object based on the principal how made the call</span></td>
<pre class="prettyprint language-xml example">&lt;d-----&gt;
&lt;ansibleOutputList&gt;...&lt;/ansibleOutputList&gt;
&lt;scale&gt;
&lt;deployID&gt;58e3946e0fb4f562d84ba1ad&lt;/deployID&gt;
&lt;serviceName&gt;telegreen_db&lt;/serviceName&gt;
&lt;scaleTargetID&gt;58e3946e0fb4f562d84ba1ad&lt;/scaleTargetID&gt;
&lt;scaleTargetName&gt;telegreen_db&lt;/scaleTargetName&gt;
&lt;numOfInstances&gt;5&lt;/numOfInstances&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
......
......@@ -73,7 +73,7 @@ class</p>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
<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_keyPair.html">keyPair</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_scaleDeploymetRequest.html">scaleDeploymetRequest</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_ansibleOutput.html">ansibleOutput</a>, <a href="xml_ns0_benchmarkResult.html">benchmarkResult</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_keyPair.html">keyPair</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_scaleRequest.html">scaleRequest</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_ansibleOutput.html">ansibleOutput</a>, <a href="xml_ns0_benchmarkResult.html">benchmarkResult</a></dd>
</dl>
<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: scaleRequest</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: scaleRequest</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_scaleRequest.html">scaleRequest</a></li>
</ol>
<h1 class="page-header">scaleRequest <small>Data Type</small></h1>
<p>This class represents a scale request for a deployment. At the moment we only
support swarm.</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">numOfInstances</span>
</td>
<td> <span class="datatype-reference">int
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">1/1
</span>
</td>
<td> <span class="property-description">The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetID</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 of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetName</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 of the service or topology to scale.</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 (username) for the particular object. This value is set when
the DAO saves the object based on the principal how made the call</span></td>
</tr>
<tr>
<td><span class="property-name">timestamp</span></td>
<td><span class="datatype-reference">long
</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 object's creation date in unix time stamp</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;s-----&gt;
&lt;scaleTargetID&gt;58e3946e0fb4f562d84ba1ad&lt;/scaleTargetID&gt;
&lt;scaleTargetName&gt;telegreen_db&lt;/scaleTargetName&gt;
&lt;numOfInstances&gt;5&lt;/numOfInstances&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
&lt;/s-----&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>
......@@ -182,8 +182,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......@@ -365,8 +365,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -72,7 +72,7 @@
<h1 class="page-header">Files and Libraries</h1>
<h3 id="artifact_gwt_json_overlay">GWT JSON Overlay</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p> <p>
The <a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> JSON Overlay library provides the JSON Overlays that
can be used to access the Web service API for this application.
......@@ -91,13 +91,13 @@
<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">13.55K</span></td>
<td><span class="downloadfile-size">13.51K</span></td>
<td><span class="downloadfile-description">The sources for the GWT JSON overlay.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_java_json_client_library">Java JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Java client-side library is used to provide the set of Java objects that can be serialized
to/from JSON using <a href="http://jackson.codehaus.org/">Jackson</a>. This is useful for accessing the
......@@ -116,18 +116,18 @@
<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">16.84K</span></td>
<td><span class="downloadfile-size">16.80K</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">14.00K</span></td>
<td><span class="downloadfile-size">13.97K</span></td>
<td><span class="downloadfile-description">The sources for the Java JSON client library.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_java_xml_client_library">Java XML Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Java client-side library is used to access the Web service API for this application using Java.
</p>
......@@ -144,18 +144,18 @@
<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">24.61K</span></td>
<td><span class="downloadfile-size">24.60K</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">22.41K</span></td>
<td><span class="downloadfile-size">22.39K</span></td>
<td><span class="downloadfile-description">The sources for the Java XML client library.</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_js_client_library">JavaScript Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The JavaScript client-side library defines classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -184,13 +184,13 @@
<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">5.26K</span></td>
<td><span class="downloadfile-size">5.27K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_php_json_client_library">PHP JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The PHP JSON client-side library defines the PHP classes that can be (de)serialized to/from JSON.
This is useful for accessing the resources that are published by this application, but only
......@@ -213,13 +213,13 @@
<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">5.90K</span></td>
<td><span class="downloadfile-size">5.89K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_php_xml_client_library">PHP XML Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML.
This is useful for accessing the resources that are published by this application, but only
......@@ -245,13 +245,13 @@
<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">9.01K</span></td>
<td><span class="downloadfile-size">8.99K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
</table>
<h3 id="artifact_ruby_json_client_library">Ruby JSON Client Library</h3>
<p class="lead">Created July 12, 2017</p>
<p class="lead">Created July 14, 2017</p>
<p><p>
The Ruby JSON client-side library defines the Ruby classes that can be (de)serialized to/from JSON.
This is useful for accessing the REST endpoints that are published by this application, but only
......@@ -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">75.64K</span></td>
<td><span class="downloadfile-size">75.70K</span></td>
<td><span class="downloadfile-description">&nbsp;</span></td>
</tr>
</tbody>
......
......@@ -1211,77 +1211,168 @@ module V1
module External
module Ansible
# (no documentation provided)
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class ScaleRequest < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :start
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :delta
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :host
# the scaleTargetID
attr_accessor :scaleTargetID
# the scaleTargetName
attr_accessor :scaleTargetName
# the numOfInstances
attr_accessor :numOfInstances
# the json hash for this BenchmarkResult
# the json hash for this ScaleRequest
def to_jaxb_json_hash
_h = super
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
_h['scaleTargetID'] = scaleTargetID.to_jaxb_json_hash unless scaleTargetID.nil?
_h['scaleTargetName'] = scaleTargetName.to_jaxb_json_hash unless scaleTargetName.nil?
_h['numOfInstances'] = numOfInstances.to_jaxb_json_hash unless numOfInstances.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
#initializes this ScaleRequest with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if !_o['scaleTargetID'].nil?
_oa = _o['scaleTargetID']
if(_oa.is_a? Hash)
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
@scaleTargetID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scaleTargetID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@cloudDeploymentDomain = Array.new
@scaleTargetID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@cloudDeploymentDomain.push String.from_json(_item)
@scaleTargetID.push String.from_json(_item)
else
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@scaleTargetID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@cloudDeploymentDomain = _oa
@scaleTargetID = _oa
end
end
if !_o['start'].nil?
_oa = _o['start']
if !_o['scaleTargetName'].nil?
_oa = _o['scaleTargetName']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
@scaleTargetName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scaleTargetName = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
@scaleTargetName = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
@scaleTargetName.push String.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@scaleTargetName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
@scaleTargetName = _oa
end
end
if !_o['numOfInstances'].nil?
_oa = _o['numOfInstances']
if(_oa.is_a? Hash)
@numOfInstances = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@numOfInstances = Fixnum.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@numOfInstances = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@numOfInstances.push Fixnum.from_json(_item)
else
@numOfInstances.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@numOfInstances = _oa
end
end
end
# constructs a ScaleRequest 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
end
end
module Nl
module Uva
module Sne
module Drip
module Drip
module Commons
module Data
module V1
module External
module Ansible
# (no documentation provided)
class BenchmarkResult < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# (no documentation provided)
attr_accessor :vmType
# (no documentation provided)
attr_accessor :end
# (no documentation provided)
attr_accessor :delta
# (no documentation provided)
attr_accessor :cloudDeploymentDomain
# (no documentation provided)
attr_accessor :start
# (no documentation provided)
attr_accessor :host
# the json hash for this BenchmarkResult
def to_jaxb_json_hash
_h = super
_h['vmType'] = vmType.to_jaxb_json_hash unless vmType.nil?
_h['end'] = end.to_jaxb_json_hash unless end.nil?
_h['delta'] = delta.to_jaxb_json_hash unless delta.nil?
_h['cloudDeploymentDomain'] = cloudDeploymentDomain.to_jaxb_json_hash unless cloudDeploymentDomain.nil?
_h['start'] = start.to_jaxb_json_hash unless start.nil?
_h['host'] = host.to_jaxb_json_hash unless host.nil?
return _h
end
#initializes this BenchmarkResult with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['vmType'].nil?
_oa = _o['vmType']
if(_oa.is_a? Hash)
......@@ -1301,6 +1392,25 @@ module Ansible
@vmType = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
end
end
if !_o['delta'].nil?
_oa = _o['delta']
if(_oa.is_a? Hash)
......@@ -1320,23 +1430,42 @@ module Ansible
@delta = _oa
end
end
if !_o['end'].nil?
_oa = _o['end']
if !_o['cloudDeploymentDomain'].nil?
_oa = _o['cloudDeploymentDomain']
if(_oa.is_a? Hash)
@end = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@end = Time.from_json(_oa) unless _oa['@class']
@cloudDeploymentDomain = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@cloudDeploymentDomain = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@end = Array.new
@cloudDeploymentDomain = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@end.push Time.from_json(_item)
@cloudDeploymentDomain.push String.from_json(_item)
else
@end.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@cloudDeploymentDomain.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@end = _oa
@cloudDeploymentDomain = _oa
end
end
if !_o['start'].nil?
_oa = _o['start']
if(_oa.is_a? Hash)
@start = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@start = Time.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@start = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@start.push Time.from_json(_item)
else
@start.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@start = _oa
end
end
if !_o['host'].nil?
......@@ -1559,113 +1688,6 @@ module Data
module V1
module External
# (no documentation provided)
class Script < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the name
attr_accessor :name
# the contents
attr_accessor :contents
# the json hash for this Script
def to_jaxb_json_hash
_h = super
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['contents'] = contents.to_jaxb_json_hash unless contents.nil?
return _h
end
#initializes this Script 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
if !_o['contents'].nil?
_oa = _o['contents']
if(_oa.is_a? Hash)
@contents = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@contents = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@contents = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@contents.push String.from_json(_item)
else
@contents.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@contents = _oa
end
end
end
# constructs a Script 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
end
end
module Nl
module Uva
module Sne
module Drip
module Drip
module Commons
module Data
module V1
module External
# (no documentation provided)
......@@ -1715,87 +1737,43 @@ module V1
module External
# (no documentation provided)
class ScaleDeploymetRequest < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class KeyValueHolder < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the deployID
attr_accessor :deployID
# the serviceName
attr_accessor :serviceName
# the numOfInstances
attr_accessor :numOfInstances
# the keyValue
attr_accessor :keyValue
# the json hash for this ScaleDeploymetRequest
# the json hash for this KeyValueHolder
def to_jaxb_json_hash
_h = super
_h['deployID'] = deployID.to_jaxb_json_hash unless deployID.nil?
_h['serviceName'] = serviceName.to_jaxb_json_hash unless serviceName.nil?
_h['numOfInstances'] = numOfInstances.to_jaxb_json_hash unless numOfInstances.nil?
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
return _h
end
#initializes this ScaleDeploymetRequest with a json hash
#initializes this KeyValueHolder with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['deployID'].nil?
_oa = _o['deployID']
if(_oa.is_a? Hash)
@deployID = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@deployID = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@deployID = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@deployID.push String.from_json(_item)
else
@deployID.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@deployID = _oa
end
end
if !_o['serviceName'].nil?
_oa = _o['serviceName']
if(_oa.is_a? Hash)
@serviceName = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@serviceName = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@serviceName = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@serviceName.push String.from_json(_item)
else
@serviceName.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@serviceName = _oa
end
end
if !_o['numOfInstances'].nil?
_oa = _o['numOfInstances']
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if(_oa.is_a? Hash)
@numOfInstances = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@numOfInstances = Fixnum.from_json(_oa) unless _oa['@class']
@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
@numOfInstances = Array.new
@keyValue = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@numOfInstances.push Fixnum.from_json(_item)
@keyValue.push Hash.from_json(_item)
else
@numOfInstances.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@numOfInstances = _oa
@keyValue = _oa
end
end
end
# constructs a ScaleDeploymetRequest from a (parsed) JSON hash
# constructs a KeyValueHolder from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -1973,43 +1951,65 @@ module V1
module External
# (no documentation provided)
class KeyValueHolder < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
class Script < Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::OwnedObject
# the keyValue
attr_accessor :keyValue
# the name
attr_accessor :name
# the contents
attr_accessor :contents
# the json hash for this KeyValueHolder
# the json hash for this Script
def to_jaxb_json_hash
_h = super
_h['keyValue'] = keyValue.to_jaxb_json_hash unless keyValue.nil?
_h['name'] = name.to_jaxb_json_hash unless name.nil?
_h['contents'] = contents.to_jaxb_json_hash unless contents.nil?
return _h
end
#initializes this KeyValueHolder with a json hash
#initializes this Script with a json hash
def init_jaxb_json_hash(_o)
super _o
if !_o['keyValue'].nil?
_oa = _o['keyValue']
if !_o['name'].nil?
_oa = _o['name']
if(_oa.is_a? Hash)
@keyValue = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@keyValue = Hash.from_json(_oa) unless _oa['@class']
@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
@keyValue = Array.new
@name = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@keyValue.push Hash.from_json(_item)
@name.push String.from_json(_item)
else
@keyValue.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
@name.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@keyValue = _oa
@name = _oa
end
end
if !_o['contents'].nil?
_oa = _o['contents']
if(_oa.is_a? Hash)
@contents = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@contents = String.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@contents = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@contents.push String.from_json(_item)
else
@contents.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
}
else
@contents = _oa
end
end
end
# constructs a KeyValueHolder from a (parsed) JSON hash
# constructs a Script from a (parsed) JSON hash
def self.from_json(o)
if o.nil?
return nil
......@@ -2616,13 +2616,13 @@ module External
_oa = _o['scale']
if(_oa.is_a? Hash)
@scale = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']
@scale = Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleDeploymetRequest.from_json(_oa) unless _oa['@class']
@scale = Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleRequest.from_json(_oa) unless _oa['@class']
elsif (_oa.is_a? Array)
#an array(of hashes hopefully) or scalar
@scale = Array.new
_oa.each { | _item |
if ((_item.nil? || _item['@class'].nil?)rescue true)
@scale.push Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleDeploymetRequest.from_json(_item)
@scale.push Nl::Uva::Sne::Drip::Drip::Commons::Data::V1::External::ScaleRequest.from_json(_item)
else
@scale.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)
end
......
......@@ -273,6 +273,7 @@ provisopned based on a TOSCA description.</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/scale</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td>
......@@ -280,6 +281,7 @@ provisopned based on a TOSCA description.</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">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><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li></ul></td>
......@@ -512,8 +514,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......@@ -695,8 +697,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -81,7 +81,7 @@ class</p>
</thead>
<tbody>
<tr>
<td> <span class="property-name">cloudDeploymentDomain</span>
<td> <span class="property-name">vmType</span>
</td>
<td> <span class="datatype-reference">string
</span>
......@@ -90,7 +90,7 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">start</span>
<td> <span class="property-name">end</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -99,25 +99,25 @@ class</p>
</td>
</tr>
<tr>
<td> <span class="property-name">vmType</span>
<td> <span class="property-name">delta</span>
</td>
<td> <span class="datatype-reference">string
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">delta</span>
<td> <span class="property-name">cloudDeploymentDomain</span>
</td>
<td> <span class="datatype-reference">number
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description"></span>
</td>
</tr>
<tr>
<td> <span class="property-name">end</span>
<td> <span class="property-name">start</span>
</td>
<td> <span class="datatype-reference">number
</span>
......@@ -165,11 +165,11 @@ object is saved.</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;end&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -102,7 +102,7 @@ pair is only used by kubernetes</p>
<tr>
<td> <span class="property-name">scale</span>
</td>
<td> <span class="datatype-reference"><a href="json_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a>
<td> <span class="datatype-reference"><a href="json_ScaleRequest.html">ScaleRequest</a>
</span>
</td>
<td> <span class="property-description">The scale information if any for this deployment</span>
......@@ -190,8 +190,8 @@ object is saved.</span></td>
&quot;timestamp&quot; : 1499793079011
},
&quot;scale&quot; : {
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -69,7 +69,7 @@ class</p>
<dl class="dl-horizontal">
<dt>Subtypes</dt>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a>, <a href="json_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a></dd>
<dd><a href="json_KeyPair.html">KeyPair</a>, <a href="json_AnsibleOutput.html">AnsibleOutput</a>, <a href="json_ScaleRequest.html">ScaleRequest</a>, <a href="json_CloudCredentials.html">CloudCredentials</a>, <a href="json_BenchmarkResult.html">BenchmarkResult</a>, <a href="json_DeployResponse.html">DeployResponse</a>, <a href="json_ProvisionRequest.html">ProvisionRequest</a>, <a href="json_Script.html">Script</a>, <a href="json_KeyValueHolder.html">KeyValueHolder</a>, <a href="json_DeployRequest.html">DeployRequest</a>, <a href="json_ProvisionResponse.html">ProvisionResponse</a></dd>
</dl>
<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: ScaleRequest</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: ScaleRequest</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_ScaleRequest.html">ScaleRequest</a></li>
</ol>
<h1 class="page-header">ScaleRequest <small>Data Type</small></h1>
<p>This class represents a scale request for a deployment. At the moment we only
support swarm.</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">scaleTargetID</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description">The ID of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetName</span>
</td>
<td> <span class="datatype-reference">string
</span>
</td>
<td> <span class="property-description">The name of the service or topology to scale.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">numOfInstances</span>
</td>
<td> <span class="datatype-reference">number
</span>
</td>
<td> <span class="property-description">The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1</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">The owner (username) for the particular object. This value is set when
the DAO saves the object based on the principal how made the call</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">The UID of this object. This value is auto generated by the DAO when the
object is saved.</span></td>
</tr>
<tr>
<td><span class="property-name">timestamp</span></td>
<td><span class="datatype-reference">number
</span></td>
<td><span class="property-description">The object's creation date in unix time stamp</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-js example">{
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
}</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>
......@@ -363,7 +363,7 @@ pair is only used by kubernetes]]>
<xs:sequence>
<xs:element name="ansibleOutputList" type="xs:string" minOccurs="0" maxOccurs="unbounded">
</xs:element>
<xs:element name="scale" type="scaleDeploymetRequest" minOccurs="0">
<xs:element name="scale" type="scaleRequest" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The scale information if any for this deployment]]>
......@@ -615,7 +615,7 @@ provisioner to request for cloud resources.]]>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="scaleDeploymetRequest">
<xs:complexType name="scaleRequest">
<xs:annotation>
<xs:documentation>
<![CDATA[This class represents a scale request for a deployment. At the moment we only
......@@ -625,26 +625,27 @@ support swarm.]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="deployID" type="xs:string" minOccurs="0">
<xs:element name="scaleTargetID" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The deployment ID. At the moment only swarm deployments are supported.]]>
<![CDATA[The ID of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.]]>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="serviceName" type="xs:string" minOccurs="0">
<xs:element name="scaleTargetName" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>
<![CDATA[The name of the service to scale.]]>
<![CDATA[The name of the service or topology to scale.]]>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="numOfInstances" type="xs:int" minOccurs="1">
<xs:annotation>
<xs:documentation>
<![CDATA[The number of services to start. This number is absolute not cumulative.
If we have 2 service numbers running and we request for 3 we'll have 3 if
we request 1 we'll have 1]]>
<![CDATA[The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1]]>
</xs:documentation>
</xs:annotation>
</xs:element>
......@@ -803,17 +804,17 @@ class]]>
<xs:complexContent>
<xs:extension base="ownedObject">
<xs:sequence>
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
<xs:element name="vmType" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="start" type="xs:dateTime" minOccurs="0">
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="vmType" type="xs:string" minOccurs="0">
<xs:element name="end" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="host" type="xs:string" minOccurs="0">
</xs:element>
<xs:element name="delta" type="xs:dateTime" minOccurs="0">
<xs:element name="start" type="xs:dateTime" minOccurs="0">
</xs:element>
<xs:element name="end" type="xs:dateTime" minOccurs="0">
<xs:element name="cloudDeploymentDomain" type="xs:string" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:extension>
......
......@@ -144,11 +144,11 @@ Content-Type: application/json
<code class="prettyprint language-js">
[ {
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;end&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......@@ -514,11 +514,11 @@ Content-Type: application/json
<code class="prettyprint language-js">
{
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;vmType&quot; : &quot;...&quot;,
&quot;delta&quot; : 12345,
&quot;end&quot; : 12345,
&quot;delta&quot; : 12345,
&quot;cloudDeploymentDomain&quot; : &quot;us-east-1&quot;,
&quot;start&quot; : 12345,
&quot;host&quot; : &quot;147.228.242.58&quot;,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -458,12 +458,12 @@ Content-Type: application/json
<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_ScaleDeploymetRequest.html">ScaleDeploymetRequest</a>
<td><span class="datatype-reference"><a href="json_ScaleRequest.html">ScaleRequest</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_scaleDeploymetRequest.html">scaleDeploymetRequest</a>
<td><span class="datatype-reference"><a href="xml_ns0_scaleRequest.html">scaleRequest</a>
(XML)</span></td>
</tr>
</tbody>
......@@ -519,8 +519,8 @@ Accept: application/json
<code class="prettyprint language-js">
{
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......@@ -767,8 +767,8 @@ Content-Type: application/json
&quot;timestamp&quot; : 1499793079011
},
&quot;scale&quot; : {
&quot;deployID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;serviceName&quot; : &quot;telegreen_db&quot;,
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
......
......@@ -55,6 +55,7 @@
<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_sample_GET"><abbr title="GET /user/v1.0/provisioner/sample">GET /user/v1.0/provisioner/sam...</abbr></a></li>
<li><a href="#resource_ProvisionController_scaleDeployment_POST"><abbr title="POST /user/v1.0/provisioner/scale">POST /user/v1.0/provisioner/sc...</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><a href="#resource_ProvisionController_postProvisionResponse_POST"><abbr title="POST /user/v1.0/provisioner/post/provision">POST /user/v1.0/provisioner/po...</abbr></a></li>
......@@ -433,6 +434,113 @@ Content-Type: application/json
</div>
</div>
<div id="resource_ProvisionController_scaleDeployment_POST">
<h3><span class="label label-default resource-method">POST</span> <span class="resource-path">/user/v1.0/provisioner/scale <a href="./user/v1.0/provisioner/scale" 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_ScaleRequest.html">ScaleRequest</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_scaleRequest.html">scaleRequest</a>
(XML)</span></td>
</tr>
</tbody>
</table>
<table class="table resource-response-codes">
<caption>Response Codes</caption>
<thead>
<tr>
<th>code</th>
<th>condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="label label-warning response-code">401</span></td>
<td><span class="response-condition">Bad credentials</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/provisioner/scale
Content-Type: application/json
Accept: application/json
<code class="prettyprint language-js">
{
&quot;scaleTargetID&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;scaleTargetName&quot; : &quot;telegreen_db&quot;,
&quot;numOfInstances&quot; : 5,
&quot;owner&quot; : &quot;user1&quot;,
&quot;id&quot; : &quot;58e3946e0fb4f562d84ba1ad&quot;,
&quot;timestamp&quot; : 1499793079011
}
</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_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>
......
......@@ -265,6 +265,7 @@ provisopned based on a TOSCA description.</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/scale</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/{id}</span>
</samp></li><li><samp> <span class="resource-path">/user/v1.0/provisioner/post/provision</span>
</samp></li></ul></td>
......@@ -272,6 +273,7 @@ provisopned based on a TOSCA description.</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">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><li><samp> <span class="label label-default resource-method">POST</span>
</samp></li></ul></td>
......
......@@ -177,8 +177,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="json_ScaleDeploymetRequest.html">
<td> <span class="datatype-name">ScaleDeploymetRequest</span>
<tr class="clickable-row" data-href="json_ScaleRequest.html">
<td> <span class="datatype-name">ScaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -222,8 +222,8 @@ provisioner to request for cloud resources.</span>
<td> <span class="datatype-description">This class represents a description of provisioned resources</span>
</td>
</tr>
<tr class="clickable-row" data-href="xml_ns0_scaleDeploymetRequest.html">
<td> <span class="datatype-name">scaleDeploymetRequest</span>
<tr class="clickable-row" data-href="xml_ns0_scaleRequest.html">
<td> <span class="datatype-name">scaleRequest</span>
</td>
<td> <span class="datatype-description">This class represents a scale request for a deployment. At the moment we only
support swarm.</span>
......
......@@ -231,12 +231,12 @@ the DAO saves the object based on the principal how made the call</span></td>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;b-----&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;vmType&gt;...&lt;/vmType&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;delta&gt;...&lt;/delta&gt;
&lt;end&gt;...&lt;/end&gt;
&lt;host&gt;147.228.242.58&lt;/host&gt;
&lt;start&gt;...&lt;/start&gt;
&lt;cloudDeploymentDomain&gt;us-east-1&lt;/cloudDeploymentDomain&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
&lt;/b-----&gt;
......
......@@ -109,7 +109,7 @@ pair is only used by kubernetes</p>
<tr>
<td> <span class="property-name">scale</span>
</td>
<td> <span class="datatype-reference"><a href="xml_ns0_scaleDeploymetRequest.html">scaleDeploymetRequest</a>
<td> <span class="datatype-reference"><a href="xml_ns0_scaleRequest.html">scaleRequest</a>
</span>
</td>
<td> <span class="property-type">element
......@@ -205,8 +205,8 @@ the DAO saves the object based on the principal how made the call</span></td>
<pre class="prettyprint language-xml example">&lt;d-----&gt;
&lt;ansibleOutputList&gt;...&lt;/ansibleOutputList&gt;
&lt;scale&gt;
&lt;deployID&gt;58e3946e0fb4f562d84ba1ad&lt;/deployID&gt;
&lt;serviceName&gt;telegreen_db&lt;/serviceName&gt;
&lt;scaleTargetID&gt;58e3946e0fb4f562d84ba1ad&lt;/scaleTargetID&gt;
&lt;scaleTargetName&gt;telegreen_db&lt;/scaleTargetName&gt;
&lt;numOfInstances&gt;5&lt;/numOfInstances&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
......
......@@ -73,7 +73,7 @@ class</p>
<dt>Schema</dt>
<dd><a href="ns0.xsd">ns0.xsd</a></dd>
<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_keyPair.html">keyPair</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_scaleDeploymetRequest.html">scaleDeploymetRequest</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_ansibleOutput.html">ansibleOutput</a>, <a href="xml_ns0_benchmarkResult.html">benchmarkResult</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_keyPair.html">keyPair</a>, <a href="xml_ns0_keyValueHolder.html">keyValueHolder</a>, <a href="xml_ns0_provisionRequest.html">provisionRequest</a>, <a href="xml_ns0_provisionResponse.html">provisionResponse</a>, <a href="xml_ns0_scaleRequest.html">scaleRequest</a>, <a href="xml_ns0_script.html">script</a>, <a href="xml_ns0_ansibleOutput.html">ansibleOutput</a>, <a href="xml_ns0_benchmarkResult.html">benchmarkResult</a></dd>
</dl>
<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: scaleRequest</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: scaleRequest</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_scaleRequest.html">scaleRequest</a></li>
</ol>
<h1 class="page-header">scaleRequest <small>Data Type</small></h1>
<p>This class represents a scale request for a deployment. At the moment we only
support swarm.</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">numOfInstances</span>
</td>
<td> <span class="datatype-reference">int
</span>
</td>
<td> <span class="property-type">element
</span>
</td>
<td> <span class="property-namespaceInfo">
</span>
</td>
<td> <span class="property-minMaxOccurs">1/1
</span>
</td>
<td> <span class="property-description">The number of instances to start. This number is absolute not cumulative.
If we have 2 instances running and we request for 3 we'll have 3 if we
request 1 we'll have 1</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetID</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 of the deployment or provisioned resources to scale. For
deployment scale only swarm deployments are supported.</span>
</td>
</tr>
<tr>
<td> <span class="property-name">scaleTargetName</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 of the service or topology to scale.</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 (username) for the particular object. This value is set when
the DAO saves the object based on the principal how made the call</span></td>
</tr>
<tr>
<td><span class="property-name">timestamp</span></td>
<td><span class="datatype-reference">long
</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 object's creation date in unix time stamp</span></td>
</tr>
</tbody>
</table>
<p class="lead">Example</p>
<pre class="prettyprint language-xml example">&lt;s-----&gt;
&lt;scaleTargetID&gt;58e3946e0fb4f562d84ba1ad&lt;/scaleTargetID&gt;
&lt;scaleTargetName&gt;telegreen_db&lt;/scaleTargetName&gt;
&lt;numOfInstances&gt;5&lt;/numOfInstances&gt;
&lt;owner&gt;user1&lt;/owner&gt;
&lt;timestamp&gt;1499793079011&lt;/timestamp&gt;
&lt;/s-----&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>
......@@ -34,7 +34,7 @@ public class DeployResponse extends DeployRequest {
private List<String> ansibleOutputListIDs;
private ScaleDeploymetRequest scale;
private ScaleRequest scale;
public void setAnsibleOutputList(List<String> outputListIDs) {
this.ansibleOutputListIDs = outputListIDs;
......@@ -64,14 +64,14 @@ public class DeployResponse extends DeployRequest {
* The scale information if any for this deployment
* @return the scale
*/
public ScaleDeploymetRequest getScale() {
public ScaleRequest getScale() {
return scale;
}
/**
* @param scale the scale to set
*/
public void setScale(ScaleDeploymetRequest scale) {
public void setScale(ScaleRequest scale) {
this.scale = scale;
}
......
/*
* 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.drip.commons.data.v1.external;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.webcohesion.enunciate.metadata.DocumentationExample;
/**
*
* This class represents a scale request for a deployment. At the moment we only
* support swarm.
*
*
* @author S. Koulouzis
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ScaleDeploymetRequest extends OwnedObject {
private String deployID;
private String serviceName;
private int numOfInstances;
/**
* The deployment ID. At the moment only swarm deployments are supported.
*
* @return the deployID
*/
@DocumentationExample("58e3946e0fb4f562d84ba1ad")
public String getDeployID() {
return deployID;
}
/**
*
* @param deployID the deployID to set
*/
public void setDeployID(String deployID) {
this.deployID = deployID;
}
/**
* The name of the service to scale.
*
* @return the serviceName
*/
@DocumentationExample("telegreen_db")
public String getServiceName() {
return serviceName;
}
/**
* @param serviceName the serviceName to set
*/
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
/**
* The number of services to start. This number is absolute not cumulative.
* If we have 2 service numbers running and we request for 3 we'll have 3 if
* we request 1 we'll have 1
*
* @return the numOfInstances
*/
@DocumentationExample("5")
public int getNumOfInstances() {
return numOfInstances;
}
/**
* @param numOfInstances the numOfInstances to set
*/
public void setNumOfInstances(int numOfInstances) {
this.numOfInstances = numOfInstances;
}
}
......@@ -26,6 +26,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
* @author S. Koulouzis
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ScaleDeploymetResponse extends ScaleDeploymetRequest {
public class ScaleDeploymetResponse extends ScaleRequest {
}
......@@ -16,10 +16,12 @@
package nl.uva.sne.drip.drip.commons.data.v1.external;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.webcohesion.enunciate.metadata.DocumentationExample;
/**
*
* This class represents a scale request for either a deployment of a provision.
* This class represents a scale request for a deployment. At the moment we only
* support swarm.
*
*
* @author S. Koulouzis
......@@ -27,6 +29,65 @@ import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ScaleRequest extends OwnedObject {
private String scaleTargetID;
private String scaleTargetName;
private int numOfInstances;
/**
* The ID of the deployment or provisioned resources to scale. For
* deployment scale only swarm deployments are supported.
*
* @return the scaleTargetID
*/
@DocumentationExample("58e3946e0fb4f562d84ba1ad")
public String getScaleTargetID() {
return scaleTargetID;
}
/**
*
* @param deployID the scaleTargetID to set
*/
public void setScaleTargetID(String deployID) {
this.scaleTargetID = deployID;
}
/**
* The name of the service or topology to scale.
*
* @return the scaleTargetName
*/
@DocumentationExample("telegreen_db")
public String getScaleTargetName() {
return scaleTargetName;
}
/**
* @param serviceName the scaleTargetName to set
*/
public void setScaleTargetName(String serviceName) {
this.scaleTargetName = serviceName;
}
/**
* The number of instances to start. This number is absolute not cumulative.
* If we have 2 instances running and we request for 3 we'll have 3 if we
* request 1 we'll have 1
*
* @return the numOfInstances
*/
@DocumentationExample("5")
public int getNumOfInstances() {
return numOfInstances;
}
/**
* @param numOfInstances the numOfInstances to set
*/
public void setNumOfInstances(int numOfInstances) {
this.numOfInstances = numOfInstances;
}
}
......@@ -17,18 +17,12 @@ package nl.uva.sne.drip.drip.provisioner.utils;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.security.cert.CertificateEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -132,13 +126,30 @@ public class MessageParsing {
return sshKeys;
}
public static MessageParameter getScaleInfo(JSONArray parameters) throws JSONException, IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
for (int i = 0; i < parameters.length(); i++) {
JSONObject param = (JSONObject) parameters.get(i);
MessageParameter messageParam = mapper.readValue(param.toString(), MessageParameter.class);
String name = messageParam.getName();
String value = messageParam.getValue();
if(name.equals("scale_topology_name")){
return messageParam;
}
}
return null;
}
public static Map<String, Object> ymlStream2Map(InputStream in) {
Yaml yaml = new Yaml();
Map<String, Object> map = (Map<String, Object>) yaml.load(in);
return map;
}
public static List<Credential> getCloudCredentials(JSONArray parameters, String tempInputDirPath) throws JSONException, FileNotFoundException, IOException, CertificateEncodingException, GSSException {
public static List<Credential> getCloudCredentials(JSONArray parameters, String tempInputDirPath) throws JSONException, FileNotFoundException, IOException, CertificateEncodingException, GSSException {
List<Credential> credentials = new ArrayList<>();
for (int i = 0; i < parameters.length(); i++) {
JSONObject param = (JSONObject) parameters.get(i);
......
......@@ -57,7 +57,6 @@ import provisioning.database.EC2.EC2Database;
import provisioning.database.EGI.EGIDatabase;
import provisioning.database.UserDatabase;
import provisioning.engine.TEngine.TEngine;
import provisioning.engine.VEngine.EGI.EGIAgent;
import provisioning.request.ScalingRequest;
import topologyAnalysis.TopologyAnalysisMain;
import topologyAnalysis.dataStructure.SubTopologyInfo;
......@@ -78,17 +77,6 @@ public class Consumer extends DefaultConsumer {
public Consumer(Channel channel) throws IOException {
super(channel);
this.channel = channel;
// em.put("Virginia", "ec2.us-east-1.amazonaws.com");
// em.put("California", "ec2.us-west-1.amazonaws.com");
// em.put("Oregon", "ec2.us-west-2.amazonaws.com");
// em.put("Mumbai", "ec2.ap-south-1.amazonaws.com");
// em.put("Singapore", "ec2.ap-southeast-1.amazonaws.com");
// em.put("Seoul", "ec2.ap-northeast-2.amazonaws.com");
// em.put("Sydney", "ec2.ap-southeast-2.amazonaws.com");
// em.put("Tokyo", "ec2.ap-northeast-1.amazonaws.com");
// em.put("Frankfurt", "ec2.eu-central-1.amazonaws.com");
// em.put("Ireland", "ec2.eu-west-1.amazonaws.com");
// em.put("Paulo", "ec2.sa-east-1.amazonaws.com");
}
@Override
......@@ -215,152 +203,9 @@ public class Consumer extends DefaultConsumer {
userDatabase = getUserDB();
/*ProvisionRequest pq = new ProvisionRequest();
pq.topologyName = "ec2_zh_b";
ArrayList<ProvisionRequest> provisionReqs = new ArrayList<ProvisionRequest>();
provisionReqs.add(pq);*/
//tEngine.provision(tam.wholeTopology, userCredential, userDatabase, provisionReqs);
tEngine.provisionAll(tam.wholeTopology, userCredential, userDatabase);
String topologyUserName = tam.wholeTopology.userName;
return buildTopologuResponse(tam, tempInputDirPath, userPublicKeyName, userPrivateName);
String charset = "UTF-8";
List<MessageParameter> responseParameters = new ArrayList<>();
MessageParameter param = new MessageParameter();
param.setEncoding(charset);
String fileName = tam.wholeTopology.loadingPath;
if (!fileName.endsWith(".yml")) {
fileName += ".yml";
}
File f = new File(fileName);
if (f.exists()) {
param.setName(FilenameUtils.removeExtension(FilenameUtils.getBaseName(fileName)));
byte[] bytes = Files.readAllBytes(Paths.get(f.getAbsolutePath()));
param.setValue(new String(bytes, charset));
responseParameters.add(param);
} else {
param.setName(FilenameUtils.removeExtension(FilenameUtils.getBaseName(fileName)));
param.setValue("ERROR::There is no output for topology topology_main");
responseParameters.add(param);
}
for (SubTopologyInfo sub : tam.wholeTopology.topologies) {
param = new MessageParameter();
param.setEncoding(charset);
fileName = tempInputDirPath + File.separator + sub.topology;
if (!fileName.endsWith(".yml")) {
fileName += ".yml";
}
f = new File(fileName);
if (f.exists()) {
param.setName(sub.topology);
byte[] bytes = Files.readAllBytes(Paths.get(f.getAbsolutePath()));
param.setValue(new String(bytes, charset));
responseParameters.add(param);
} else {
param.setName(sub.topology);
param.setValue("ERROR::There is no output for topology " + sub.topology);
responseParameters.add(param);
}
}
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_user_key");
byte[] bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + userPublicKeyName));
param.setValue(new String(bytes, charset));
Map<String, String> attributes = new HashMap<>();
attributes.put("name", userPublicKeyName);
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_user_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + userPrivateName));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", userPrivateName);
// attributes.put("username", sub.userName);
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_deployer_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + "clusterKeyPair" + File.separator + "id_rsa"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa");
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_deployer_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + "clusterKeyPair" + File.separator + "id_rsa.pub"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa.pub");
param.setAttributes(attributes);
responseParameters.add(param);
File dir = new File(tempInputDirPath);
for (File d : dir.listFiles()) {
if (d.isDirectory() && !d.getName().equals("clusterKeyPair")) {
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_cloud_key");
File publicKey = new File(d.getAbsolutePath() + File.separator + "name.pub");
if (!publicKey.exists()) {
publicKey = new File(d.getAbsolutePath() + File.separator + "id_rsa.pub");
}
bytes = Files.readAllBytes(Paths.get(publicKey.getAbsolutePath()));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", publicKey.getName());
attributes.put("key_pair_id", d.getName());
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_cloud_key");
bytes = Files.readAllBytes(Paths.get(d.getAbsolutePath() + File.separator + "id_rsa"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa");
attributes.put("key_pair_id", d.getName());
param.setAttributes(attributes);
responseParameters.add(param);
}
}
param = new MessageParameter();
param.setEncoding(charset);
param.setName("deploy_parameters");
String paramValue = "";
for (SubTopologyInfo sub : tam.wholeTopology.topologies) {
ArrayList<VM> vms = sub.subTopology.getVMsinSubClass();
for (VM vm : vms) {
if (vm != null) {
paramValue += vm.publicAddress + " ";
paramValue += sub.userName + " ";
// paramValue += tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa";
paramValue += vm.role + "\n";
}
}
// String accessKeyPath = tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa";
// System.err.println("accessKeyPath: " + accessKeyPath);
}
param.setValue(paramValue);
responseParameters.add(param);
Message response = new Message();
response.setCreationDate(System.currentTimeMillis());
response.setParameters(responseParameters);
return response;
} catch (Throwable ex) {
if (tam != null) {
tEngine.deleteAll(tam.wholeTopology, userCredential, userDatabase);
......@@ -466,10 +311,6 @@ public class Consumer extends DefaultConsumer {
String topTopologyLoadingPath = mainTopologyFile.getAbsolutePath();
List<File> topologyFiles = MessageParsing.getTopologies(parameters, tempInputDirPath, 1);
// for (File lowLevelTopologyFile : topologyFiles) {
// File secondaryTopologyFile = new File(tempInputDirPath + File.separator + lowLevelTopologyFile.getName() + ".yml");
// FileUtils.moveFile(lowLevelTopologyFile, secondaryTopologyFile);
// }
File clusterDir = new File(tempInputDirPath + File.separator + "clusterKeyPair");
clusterDir.mkdir();
......@@ -506,16 +347,23 @@ public class Consumer extends DefaultConsumer {
throw new IOException("ssh key pair initilaziation error");
}
Message response = new Message();
MessageParameter scaleInfo = MessageParsing.getScaleInfo(parameters);
String nameOfScalingTopology = scaleInfo.getValue();
String cloudProvider = scaleInfo.getAttributes().get("cloud_provider");
String cloudDomain = scaleInfo.getAttributes().get("domain");
Integer numOfInst = Integer.valueOf(scaleInfo.getAttributes().get("number_of_instances"));
try {
ScalingRequest scalReq = new ScalingRequest();
scalReq.cloudProvider = "ec2";
scalReq.domain = "Ohio";
scalReq.satisfied = false;
ArrayList<ScalingRequest> scalDCs = new ArrayList<>();
scalDCs.add(scalReq);
tEngine.autoScal(tam.wholeTopology, userCredential, userDatabase, "ec2_zh_b", true, scalDCs);
for (int i = 0; i < numOfInst; i++) {
ScalingRequest scalReq = new ScalingRequest();
scalReq.cloudProvider = cloudProvider;
scalReq.domain = cloudDomain;
scalReq.satisfied = false;
scalDCs.add(scalReq);
}
tEngine.autoScal(tam.wholeTopology, userCredential, userDatabase, nameOfScalingTopology, true, scalDCs);
return buildTopologuResponse(tam, tempInputDirPath, userPublicKeyName, userPrivateName);
} catch (Throwable ex) {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
......@@ -523,14 +371,6 @@ public class Consumer extends DefaultConsumer {
return mapper.readValue(generateExeptionResponse(ex), Message.class
);
}
MessageParameter param = new MessageParameter();
param.setName("topology_scaled");
param.setValue("true");
List<MessageParameter> messageParameters = new ArrayList<>();
messageParameters.add(param);
response.setParameters(messageParameters);
response.setCreationDate(System.currentTimeMillis());
return response;
}
......@@ -566,4 +406,148 @@ public class Consumer extends DefaultConsumer {
}
return userCredential;
}
private Message buildTopologuResponse(TopologyAnalysisMain tam, String tempInputDirPath, String userPublicKeyName, String userPrivateName) throws IOException {
String topologyUserName = tam.wholeTopology.userName;
String charset = "UTF-8";
List<MessageParameter> responseParameters = new ArrayList<>();
MessageParameter param = new MessageParameter();
param.setEncoding(charset);
String fileName = tam.wholeTopology.loadingPath;
if (!fileName.endsWith(".yml")) {
fileName += ".yml";
}
File f = new File(fileName);
if (f.exists()) {
param.setName(FilenameUtils.removeExtension(FilenameUtils.getBaseName(fileName)));
byte[] bytes = Files.readAllBytes(Paths.get(f.getAbsolutePath()));
param.setValue(new String(bytes, charset));
responseParameters.add(param);
} else {
param.setName(FilenameUtils.removeExtension(FilenameUtils.getBaseName(fileName)));
param.setValue("ERROR::There is no output for topology topology_main");
responseParameters.add(param);
}
for (SubTopologyInfo sub : tam.wholeTopology.topologies) {
param = new MessageParameter();
param.setEncoding(charset);
fileName = tempInputDirPath + File.separator + sub.topology;
if (!fileName.endsWith(".yml")) {
fileName += ".yml";
}
f = new File(fileName);
if (f.exists()) {
param.setName(sub.topology);
byte[] bytes = Files.readAllBytes(Paths.get(f.getAbsolutePath()));
param.setValue(new String(bytes, charset));
responseParameters.add(param);
} else {
param.setName(sub.topology);
param.setValue("ERROR::There is no output for topology " + sub.topology);
responseParameters.add(param);
}
}
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_user_key");
byte[] bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + userPublicKeyName));
param.setValue(new String(bytes, charset));
Map<String, String> attributes = new HashMap<>();
attributes.put("name", userPublicKeyName);
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_user_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + userPrivateName));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", userPrivateName);
// attributes.put("username", sub.userName);
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_deployer_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + "clusterKeyPair" + File.separator + "id_rsa"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa");
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_deployer_key");
bytes = Files.readAllBytes(Paths.get(tempInputDirPath + File.separator + "clusterKeyPair" + File.separator + "id_rsa.pub"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa.pub");
param.setAttributes(attributes);
responseParameters.add(param);
File dir = new File(tempInputDirPath);
for (File d : dir.listFiles()) {
if (d.isDirectory() && !d.getName().equals("clusterKeyPair")) {
param = new MessageParameter();
param.setEncoding(charset);
param.setName("public_cloud_key");
File publicKey = new File(d.getAbsolutePath() + File.separator + "name.pub");
if (!publicKey.exists()) {
publicKey = new File(d.getAbsolutePath() + File.separator + "id_rsa.pub");
}
bytes = Files.readAllBytes(Paths.get(publicKey.getAbsolutePath()));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", publicKey.getName());
attributes.put("key_pair_id", d.getName());
param.setAttributes(attributes);
responseParameters.add(param);
param = new MessageParameter();
param.setEncoding(charset);
param.setName("private_cloud_key");
bytes = Files.readAllBytes(Paths.get(d.getAbsolutePath() + File.separator + "id_rsa"));
param.setValue(new String(bytes, charset));
attributes = new HashMap<>();
attributes.put("name", "id_rsa");
attributes.put("key_pair_id", d.getName());
param.setAttributes(attributes);
responseParameters.add(param);
}
}
param = new MessageParameter();
param.setEncoding(charset);
param.setName("deploy_parameters");
String paramValue = "";
for (SubTopologyInfo sub : tam.wholeTopology.topologies) {
ArrayList<VM> vms = sub.subTopology.getVMsinSubClass();
for (VM vm : vms) {
if (vm != null) {
paramValue += vm.publicAddress + " ";
paramValue += sub.userName + " ";
// paramValue += tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa";
paramValue += vm.role + "\n";
}
}
// String accessKeyPath = tempInputDirPath + File.separator + sub.subTopology.accessKeyPair.SSHKeyPairId + File.separator + "id_rsa";
// System.err.println("accessKeyPath: " + accessKeyPath);
}
param.setValue(paramValue);
responseParameters.add(param);
Message response = new Message();
response.setCreationDate(System.currentTimeMillis());
response.setParameters(responseParameters);
return response;
}
}
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