Update Multiple Records in Windows

Use this REST request to update multiple records on one or more ESP windows. Records can be from different windows but all windows must be on the same ESP project and ESP Server. This REST request is a POST type request.

Header

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

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
   
content

(Required) Element containing content details for the JSON request. You can list elements for one or more streams or windows.

<stream/windowname> (Required) Specify the name of the stream or window to which you wish to publish data.
<primaryKey>

(Required for windows only) Specify the window's PRIMARY KEY and a unique value. The format is "<primarykeyname>":<uniquevalue>. For example, "pKey":"1". If you do not specify a unique value, the request returns an error unless you are performing an update.

The PRIMARY KEY is specified in the CCL of the project.

<columnname>

(Optional) Specify a column to which you wish to publish data. The format is "<columnname>":"<value>". For example, "amount":"10".

If a column is specified in the request content but does not exist in the stream or window schema, the column is ignored. If you do not specify existing column schema in the request content, these columns are filled with a NULL value by default.

Example

Header
http://<server>:<port>/espws/restservice/stream/bulk?action=update&workspace=<workspaceName>&project=<projectName>
Body
{ 
	"connectionDetails": { 
		"clusterName":"<cluster name>", 
		"port":"<port>", 
		"authentication": { 
			"type":"user", 
			"data":"<username>:<password>", 
			"sslEnabled":"false"
		}
	}, 
	"content": [
	{ 
		"<first window/stream name>": {
			"C_KEY":"5",
			"C_TIMESTAMP":"2013-06-06 00:00:00.000"
		}
	}, {
		"<second window/stream name>": {
			"C_KEY":"4",
			"C_TIMESTAMP":"3000-06-06 12:34:56.000"
		}
	}
	]
}