You can materialize data feed results in Terracotta using the MashZone NextGen server web services. You can use a public REST web service such as cUrl. In addition, you can combine those calls with an external scheduling tool, such as cron jobs, to schedule the executions.
Procedure
For Authentication using basic credentials, see below.
- Relative service URL: /mashzone/mzservices/tcstore/materializefeed
- Method: POST
- Parameter: name=materializedFeed, value="the name of the Materialized Feed alias to use"
- Parameter: name=inputParameters, value="[{"param1":"someValue", "param2":"anotherValue"}]"
For Authentication using basic credentials, see below.
The data feed results are calculated and materialized using the configured Terracotta connection.
After the feed calculation and the subsequent materialization of results is completed, you can access the feed results using the Terracotta source operator.
Tip
Additional information, such as duration or potential execution errors, is available in the MashZone NextGen log file.
Authentication using basic credentials
For authentication using basic credentials, you must use the REST API method to log in to create a MashZone NextGen session and authenticate the user. This adds a cookie with session information, which is then included in all subsequent requests. You can also use the REST API method to log out and end the session or simply let the session expire (based on MashZone NextGen timeout configuration).
http://app-server:port/mashzone/edge/api/rest/UserManagerService/login?presto_username=username&presto_password=pw
Both parameters must be in clear text.
Successful logins set a session cookie and return an XML response in the form:
<?xml version="1.0"?>
<ServiceResponseObject>
<version>2.0</version>
<appId></appId>
<sid>UserManagerService</sid>
<svcVersion>1.0</svcVersion>
<oid>login</oid>
<response>
<authToken>Token is set as HTTP cookie</authToken>
</response>
<errorCode></errorCode>
<invId></invId>
<header/>
<serviceHeaders/>
</ServiceResponseObject>
Unsuccessful logins return a simple text response: Authentication failed.Userid:someName.
http://app-server:port/mashzone/edge/api/rest/UserManagerService/logout