Show TOC

Deploy and Start a ProjectLocate this document in the navigation structure

Use this REST request to deploy and start ESP projects from a specific ESP Server and workspace. The workspace you specify in the request must exist and the cluster to which you are deploying the project must be running. This REST request is a POST type request.

Header
http://serverDetails/espws/restservice/project/<projectName>?action=deployAndStart&workspace=<workspaceName>
Body
Table 1: Connection Details
Element Description
defaultCluster

(Optional) Specify a default cluster for the REST server to which you are connecting. This element contains the credentialselement below. If you specify this element, the workspace name specified in the URI is ignored.

Specify either this element or the connectionDetails element. If you specify both elements, you will receive an error.

credentials (Optional) Specify a value based on the type of authentication the ESP Server is using.
  • for username and password authentication, specify username:password values.
  • for RSA authentication, specify keystore:user:password values. For the keystore value, only specify the keystore file name. Do not specify a file path. If you are using Windows, surround the file name in single quotation marks.
  • for Kerberos authentication, specify user:service:cache values. For the cache value, only specify the Kerberos cache file name. Do not specify a file path. If you are using Windows, surround the file name in single quotation marks.
connectionDetails

(Required only if defaultCluster is not specified) Element containing clusterName, port, and authentication details below.

Specify either this element or the defaultCluster element. If you specify both elements, you will receive an error.

clusterName

Type: string

(Required if no default is specified) 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, data, and sslEnabled).

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 values
  • for rsa, specify keystore:user:password values. For the keystore value, enter the keystore file name. Do not specify a file path. If you are using Windows, surround the file name in single quotation marks.
  • for kerberos, specify user:service:cache values. For the cache value, enter the Kerberos cache file name. Do not specify a file path. If you are using Windows, surround the file name 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.

Table 2: Content Elements
Element Description
content

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

cclContent

(Required only if you do not have ccxContent specified) 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>);"

Specify either this element or ccxContent but not both. If you specify both cclContent and ccxContent, you will receive an error.

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>"
ccxContent

(Optional) Include the CCX (compiled CCL file) for your project instead of specifying CCL. For example, the format is

"ccxContent":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  <Platform version=\"5.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" compiled=\"true\">
    <Program>
      <Section id=\"$~ID\">
        <Types>
          <RecordType name=\"name\">
            <Column datatype=\"integer\" key=\"false\" name=\"bekey\" />
          </RecordType>
        </Types>
      </Section>
    </Program>
    <CompiledSourceStream id=\"id\" section=\"$~section\" visibility=\"input\" >
      <Column datatype=\"integer\" key=\"false\" name=\"bekey\" />
      <StatelessInsert name=\"name\" recordType=\"recordtype\" result=\"true\" />
      <PassLogic name=\"name\" priority=\"0\" itype=\"classic\" from=\"value\" to=\"value\" />
      <SourceNode name=\"name\" recordType=\"recordtype\" />
    </CompiledSourceStream>
  </Platform>
,

Specify either this element or cclContent but not both. If you specify both ccxContent and cclContent, you will receive an error.

additionalCclContent

(Optional) Specify additional CCL files and content that the main CCL file references. Do not specify absolute paths or use directory traversal for this element.

Example
Header
http://<server>:<port>/espws/restservice/project/<projectName>?action=deployAndStart&workspace=<workspaceName>
Body
{ 
 "defaultCluster" : { "credentials" : "<username>:<password>" }
}
 },
                "content":{
                                "cclContent":"IMPORT 'file1.ccl'; IMPORT 'dir/file2.ccl'; CREATE INPUT WINDOW InWindow1 SCHEMA ( pkey INTEGER ) PRIMARY KEY (pkey);",
                                "ccrContent":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Configuration xmlns=\"http://www.myserver.com/esp/project_config/2010/08/\"></Configuration>",
                                "additionalContent":{
                                                "file1.ccl":"CREATE SCHEMA Schema1 (pkey INTEGER);",
                                                "dir/file2.ccl":"CREATE SCHEMA Schema2 (pkey INTEGER);"
                                }
                }
}
or
"connectionDetails":{ 
                                "clusterName":"localhost", 
                                "port":"9786", 
                                "authentication":{ 
                                                "type":"user", 
                                                "data":"<username:password>", 
                                                "sslEnabled":"false" 
                                }
                },
                "content":{
                                "cclContent":"IMPORT 'file1.ccl'; IMPORT 'dir/file2.ccl'; CREATE INPUT WINDOW InWindow1 SCHEMA ( pkey INTEGER ) PRIMARY KEY (pkey);",
                                "ccrContent":"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Configuration xmlns=\"http://www.myserver.com/esp/project_config/2010/08/\"></Configuration>",
                                "additionalContent":{
                                                "file1.ccl":"CREATE SCHEMA Schema1 (pkey INTEGER);",
                                                "dir/file2.ccl":"CREATE SCHEMA Schema2 (pkey INTEGER);"
                                }
                }
}