Update Project Web Service

This web service updates a RapidDeploy project on the framework server.

Example request

PUT http://localhost:8090/MidVision/ws/project/update?createDirectories=false HTTP/1.1
Accept-Encoding: gzip,deflate
Authorization: ********************
Content-Type: application/xml
Content-Length: 10979
Host: localhost:8090
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<Project>
   <classpath>
      <classpathentry path="C:\midvision_4.0\lib\rapiddeploy-core-plugins-prd-generic-scripts.jar"/>
      <classpathentry path="C:\midvision_4.0\lib\rapiddeploy-core-plugins-prd-generic-environment-filesystem.jar"/>
      <classpathentry path="C:\midvision_4.0\lib\rapiddeploy-orchestration.jar"/>
      <classpathentry path="C:\midvision_4.0\lib\rapiddeploy-core-plugins-prd-docker-docker.jar"/>
   </classpath>
   <createDate>2016-05-13T10:55:13.474-03:00</createDate>
   <description>Run a script on a target server. Change the input environment variables and command line parameters per environment.</description>
   <enabled>true</enabled>
   <logDirectory>C:/midvision_4.0/logs</logDirectory>
   <name>SCRIPT_DEMO_40</name>
   <optlock>4</optlock>
   <orchestration>
      <batchDefinition>
         <DEFAULT_XML_FILE>mv-batch-definition.xml</DEFAULT_XML_FILE>
         <KEY_ELEMENT_XML_ROOT>mv-orchestration</KEY_ELEMENT_XML_ROOT>
         <KEY_ELEMENT_XML_PARAMETERS>mv-parameters</KEY_ELEMENT_XML_PARAMETERS>
         <KEY_ELEMENT_XML_EMAIL>mv-email</KEY_ELEMENT_XML_EMAIL>
         <KEY_ELEMENT_XML_TASKS>mv-tasks</KEY_ELEMENT_XML_TASKS>
         <KEY_ELEMENT_XML_LOGS>mv-logs</KEY_ELEMENT_XML_LOGS>
         <mvEmail>
            <notifications>
               <email attachments="N">support@midvision.com</email>
            </notifications>
            <email-host>auth.smtp.1and1.co.uk</email-host>
            <email-port>587</email-port>
            <email-sender>no-reply@midvision.com</email-sender>
            <email-credentials>1poultry</email-credentials>
         </mvEmail>
         <mvParameters>
            <enable-email>Y</enable-email>
         </mvParameters>
         <mvTasks>
            <task active="true" order="1" name="InitialisationTask">
               <class>com.midvision.rapiddeploy.orchestration.tasks.InitialisationTask</class>
               <category>REQUIRED</category>
               <resource type="useAntCompression">false</resource>
               <resource type="filesetIncludes"/>
               <resource type="filesetExcludes"/>
               <resource type="checkTmpSize">true</resource>
               <resource type="tmpSizeMultiplier">2</resource>
               <resource type="cleanOnFail">true</resource>
               <resource type="defaultUser"/>
               <resource type="sourceVariables">true</resource>
               <resource type="searchReplaceFilesetExcludes">**/*.jar,**/*.rar,**/*.war,**/*.zip,**/*.gzip,**/*.tar,**/*.bar,**/*.cab,**/*.iso,**/*.rpm,**/*.dll,**/*.mpeg,**/*.mpg,**/*.jpeg,**/*.jpg,**/*.png,**/*.tif,**/*.gif,**/*.bmp</resource>
            </task>
            <task active="true" order="2" name="EchoTask-Show-Inbuilt-Variable-Expansion">
               <class>com.midvision.rapiddeploy.orchestration.tasks.utils.EchoTask</class>
               <category>IO</category>
               <resource type="failOnError">true</resource>
               <resource type="skipOnFailure">Previous Task Name</resource>
               <resource editionMode="text/x-sh" type="message">ARCHIVE_ROOT_VAL is  ${ARCHIVE_ROOT}, 
MV_UUID is ${MV_UUID}, 
MV_DATE_MILLIS is ${MV_DATE_MILLIS}</resource>
               <resource type="level">debug</resource>
               <resource type="file"/>
               <resource type="append">true</resource>
            </task>
            <task active="true" order="3" name="EchoTask-Show-Server-environment-Variable-Expansion">
               <class>com.midvision.rapiddeploy.orchestration.tasks.utils.EchoTask</class>
               <category>IO</category>
               <resource type="failOnError">true</resource>
               <resource type="skipOnFailure">Previous Task Name</resource>
               <resource type="message">Shows setting environment variables from shell: 
HOME=${HOME} and from Dictionary: HOME= @@HOME@@</resource>
               <resource type="level">debug</resource>
               <resource type="file"/>
               <resource type="append">true</resource>
            </task>
            <task active="true" order="4" name="CopyTask-Copy-From-Archive-To-Temp">
               <class>com.midvision.rapiddeploy.orchestration.tasks.CopyTask</class>
               <category>FILE</category>
               <resource type="failOnError">true</resource>
               <resource type="skipOnFailure">Previous Task Name</resource>
               <resource type="onlyIfNewer">false</resource>
               <resource type="sourceRelativeToOperationDir">false</resource>
               <resource type="targetRelativeToOperationDir">false</resource>
               <resource type="copySource">${ARCHIVE_ROOT}/scripts/bin/helloWorld.@@SCRIPT_EXT@@</resource>
               <resource type="copyTarget">/tmp</resource>
            </task>
            <task active="false" order="5" name="Manual Job Step">
               <class>com.midvision.rapiddeploy.orchestration.tasks.utils.HaltTask</class>
               <category>IO</category>
               <resource type="failOnError">true</resource>
               <resource type="timeout">20</resource>
               <resource type="continueExecution">false</resource>
            </task>
            <task active="true" order="6" name="Sleep Task">
               <class>com.midvision.rapiddeploy.orchestration.tasks.utils.SleepTask</class>
               <category>IO</category>
               <resource type="failOnError">true</resource>
               <resource type="seconds">10</resource>
               <resource type="hours">0</resource>
               <resource type="minutes">0</resource>
               <resource type="milliseconds">0</resource>
            </task>
            <task active="true" order="7" name="ScriptRunnerTask">
               <class>com.midvision.rapiddeploy.orchestration.tasks.LocalScriptRunnerTask</class>
               <category>EXECUTE</category>
               <resource type="failOnError">true</resource>
               <resource type="skipOnFailure">Previous Task Name</resource>
               <resource type="scriptToRunPath">/tmp/helloWorld.@@SCRIPT_EXT@@</resource>
               <resource type="scriptArgs">@@SCRIPT_ARGS@@</resource>
               <resource type="successCode">0</resource>
               <entry type="variable" name="MV_SHAPE">@@MV_SHAPE@@</entry>
               <entry type="variable" name="MV_SIDES">@@MV_SIDES@@</entry>
               <entry type="variable" name="MV_COLOUR">@@MV_COLOUR@@</entry>
            </task>
            <task active="true" order="8" name="FinalisationTask">
               <class>com.midvision.rapiddeploy.orchestration.tasks.FinalisationTask</class>
               <category>REQUIRED</category>
               <resource type="retainExpandedArchive">false</resource>
            </task>
         </mvTasks>
      </batchDefinition>
   </orchestration>
   <orchestrationFileName>midvision-deploy-orchestration.xml</orchestrationFileName>
   <owner>
      <description>This is the default MidVision Administrator</description>
      <email>support@midvision.com</email>
      <enabled>true</enabled>
      <firstname>MidVision</firstname>
      <lastname>Administrator</lastname>
      <optlock>245</optlock>
      <sourceType>1</sourceType>
      <username>mvadmin</username>
   </owner>
   <pluginDataSet>
      <id>177</id>
      <pluginData><![CDATA[<?xml version="1.0" encoding="UTF-8"?><projectPlugins><projectPlugins><active>true</active><data><name>FilesystemFiles</name><displayName>Generic Filesystem</displayName><version>4.0.0</version><description>These settings define where the project configurations and shell or batch script files are defined within this project. All paths are relative to the project root directory.</description><fields><headerTitle>Project Settings</headerTitle><fieldKey>configurationDirectoryRelativePath</fieldKey><fieldValue>scripts/config</fieldValue><label>Configuration Relative Path</label><type>TEXT</type><mandatory>true</mandatory><helpText>The configuration directory, relative to the project root directory. This is the root location of the projects environment specific configuration files.
                For this plugin this will primarily cnsist of dictionary files that contain environment specific search/replace tokens used
                to replace tempate tokens.</helpText><toolTipText>The configuration directory, relative to the project root directory.
                </toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><fields><headerTitle>Project Settings</headerTitle><fieldKey>templateDirectoryRelativePath</fieldKey><fieldValue>scripts/bin</fieldValue><label>Template directory Relative Path</label><type>TEXT</type><mandatory>true</mandatory><helpText>Relative path to the top level directory containing the filesystem templates.
                FileSystem templates may be whole filesystems or just some filtered files. use th FilesystemEnvironment plugin
                on the environment panel to determine which filter criteria should be used to take a snapshot that
                will be used as the basis for the template.</helpText><toolTipText>Relative path to the directory containing filesystem templates.</toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><panelTitle>Generic Filesystem</panelTitle></data><pluginName>Filesystem (v4.0.0)</pluginName><pluginType>unknown</pluginType><pluginVersion>4.0.0</pluginVersion></projectPlugins><projectPlugins><active>true</active><data><name>FileSystem</name><displayName>File System</displayName><version>4.1.0</version><description/><fields><headerTitle>File System Scm Repository</headerTitle><fieldKey>rootDirectory</fieldKey><fieldValue>C:\midvision_4.0/projects/SCRIPT_DEMO_40</fieldValue><label>Project root directory</label><type>DIRECTORY</type><mandatory>true</mandatory><helpText>The location on the RapidDeploy server where project artifacts will be written to. All configuration files, 
                deployable components (such as ear files), templates etc will be stored under this root directory.
                Sub-directories will be determined by the collection type chosen for this project.</helpText><toolTipText>The location on the RapidDeploy server where project artifacts will be written to.
                </toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><fields><headerTitle>File System Scm Repository</headerTitle><fieldKey>deleteProjectFiles</fieldKey><fieldValue>true</fieldValue><label>Delete Project Files</label><listOfChoices>true,false</listOfChoices><type>CHECKONE</type><mandatory>false</mandatory><helpText>Project Files removal after project deletion.&lt;br/&gt;
                Generally, leave this as the default (false).&lt;/br&gt;
                When this is set in false, after project deletion, the files keep in the FS.&lt;/br&gt;
                Otherwise the project files are removed from the FS.
                </helpText><toolTipText>Enable/Disable Project Files removal after project deletion.</toolTipText><style/><classType>java.lang.Boolean</classType></fields><panelTitle>File System Scm Repository</panelTitle></data><pluginName>FileSystem (No SCM) (v4.2.0)</pluginName><pluginType>scm</pluginType><pluginVersion>4.2.0</pluginVersion></projectPlugins><projectPlugins><active>true</active><data><name>LocalFile</name><displayName>Local File</displayName><version>4.1.0</version><description>This is a file based aritfact respository&lt;br/&gt;
                        Please specify where the deployment artifacts are located in the build and promotion stores and the search string to use to locate the artifacts.&lt;br/&gt;</description><fields><headerTitle>File Based Repository</headerTitle><fieldKey>buildStore</fieldKey><fieldValue>C:\midvision_4.0/buildstore</fieldValue><label>Build Store</label><type>DIRECTORY</type><mandatory>true</mandatory><helpText>The location on the RapidDeploy server where project deployment packages will be written to. This location may be shared with other projects.</helpText><toolTipText>The location on the RapidDeploy server where project deployment packages will be written to. This location may be shared with other projects.</toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><fields><headerTitle>File Based Repository</headerTitle><fieldKey>promotionStore</fieldKey><fieldValue>C:\midvision_4.0/promotionstore</fieldValue><label>Promotion Store</label><type>DIRECTORY</type><mandatory>true</mandatory><helpText>The location on the RapidDeploy server where project deployment packages will be written to via promotion for deployment to controlled environments. This location may be shared with other projects.</helpText><toolTipText>The location on the RapidDeploy server where project deployment packages will be written to via promotion for deployment to controlled environments. This location may be shared with other projects.</toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><fields><headerTitle>File Based Repository</headerTitle><fieldKey>deploymentPackageSearchString</fieldKey><fieldValue>SCRIPT_DEMO_40</fieldValue><label>Deployment Package Search String</label><type>TEXT</type><mandatory>true</mandatory><helpText>The string selector present in each deployment package to identify packages belonging to this project.</helpText><toolTipText>The string selector present in each deployment package to identify packages belonging to this project.</toolTipText><style>width: 50em;</style><classType>java.lang.String</classType></fields><fields><headerTitle>File Based Repository</headerTitle><fieldKey>supportLargeFiles</fieldKey><fieldValue>false</fieldValue><label>Support Large Files</label><listOfChoices>true,false</listOfChoices><type>CHECKONE</type><mandatory>false</mandatory><helpText>Set this option to TRUE if you expect to have packages greater than 4Gb. Notice that setting this option might make the file incompatible with other ZIP utilities and you NEED to set useAntCompression in the Initialisation Task.</helpText><toolTipText>Set this option to TRUE if you expect to have packages greater than 4Gb. Notice that setting this option might make the file incompatible with other ZIP utilities and you NEED to set useAntCompression in the Initialisation Task</toolTipText><style/><classType>java.lang.Boolean</classType></fields><panelTitle>File Based Repository</panelTitle></data><pluginName>Local FileSystem (v4.2.0)</pluginName><pluginType>artifact</pluginType><pluginVersion>4.2.0</pluginVersion></projectPlugins></projectPlugins>]]></pluginData>
   </pluginDataSet>
   <resourceList/>
</Project>

Example Response

<html>
   <head>
      <meta content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" name="generator"/>
      <title>updateProject</title>
      <link type="text/css" rel="stylesheet" href="http://localhost:8090/MidVision/ui/javax.faces.resource/components.css?ln=primefaces"/>
   </head>
   <body>
      <div>
         <div style="border-bottom: 0.1em solid black; display: block; height: 30px; margin-bottom: 1em; margin-top: 0.5em; position: relative; width: 100%;">
            <h2>updateProject</h2>
         </div>
         <div aria-live="polite" class="ui-messages ui-widget">
            <div class="ui-messages-info ui-corner-all">
               <ul>
                  <li>
                     <span class="ui-messages-info-summary">Save Orchestration File</span>
                     <br/>
                     <span class="ui-messages-info-detail">Successfully saved orchestration file: C:/temp/rd_webservice_data/projects/wsProject01/midvision-deploy-orchestration.xml</span>
                  </li>
                  <li>
                     <span class="ui-messages-info-summary">Update Project</span>
                     <br/>
                     <span class="ui-messages-info-detail">SUCCESS: The target project [wsProject01] has been updated.</span>
                  </li>
               </ul>
            </div>
         </div>
      </div>
   </body>
</html>