Update a Project

Use this REST request to update an already running ESP project. This request stops and removes the running project, and compiles, deploys, and runs the new project with the same project name. There is no downtime for this process. This REST request is a POST type request.

Header

http://serverDetails/espws/restservice/project/<projectName>?action=update&workspace=<workspaceName>

Body

Connection Details
Element Description
connectionDetails

(Required) Element containing cluster, port, and authentication details below.

clusterName

Type: string

(Required) The name of the cluster on which the project that you wish to update is running.

port

Type: integer

(Required) Specify the port on which the cluster is running.

authentication

(Required) Element containing authentication details.

type

Type: string

(Required) Specify the type of authentication the ESP Server is using. Valid values are user, rsa, and kerberos.

data

Type: string

(Required) Specify a value based on the type of authentication you specified in the type element. For example,
  • for user, specify username:password valued
  • for rsa, specify keystore:user:password values. For the keystore value, enter the full path to the keystore file. If you are using Windows, surround the file path in single quotation marks.
  • for kerberos, specify user:service:cache values. For the cache value, enter the full path to the Kerberos cache file. If you are using Windows, surround the file path in single quotation marks.
sslEnabled

Type: boolean

(Required) Specify whether SSL is enabled on the cluster on which the project is running. The default value is false.

Content Elements
Element Description
content

(Required) Element containing content details for the REST request.

cclContent (Required) Include the CCL for your project. This is the same content specified in your project CCL file. For example, the format is
"cclContent":"CREATE INPUT WINDOW <windowname> 
SCHEMA ( <yourwindowschema>);"
.
ccrContent (Optional) Include the content of your CCR project configuration file. For example, the format is
"ccrContent": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Configuration xmlns=\"<autogenerateurl>
<Deployment>
    <Project ha=\"<value>">
    <Options><Option name=\"ws-enabled\" value=\"<value>\"/></Options>
    </Project>
    </Deployment>
</Configuration>"
.

Example

Header
http://localhost:9091/espws/restservice/project/myproject?action=update&workspace=default 
Body
{
  "conectionDetails": {
        "clusterName ": "iltlvl231",
        "port": "19011",
        "authentication": {
            "type": "user",
            "data": "lroot:<password>",
            "sslEnabled": "true"
        }
    },  
   "content": {
         "cclContent": "CREATE INPUT STREAM
                                    generationDetails SCHEMA
                                    (cclContent string , esp_url 
                                    string, esp_username string,
                                    esp_password string, projectName    
                                    string,  command string) 
                                    (cclContent);
                                    ATTACH OUTPUT ADAPTER  
                                    custom_out  TYPE custom_out
                            TO generationDetails;"
          "ccrContent": "<?xml version…>"
}