You can materialize data feed results in Terracotta DB 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
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"}]"
Authentication using basic credentials, see below.
The data feed results are calculated and materialized using the configured Terracotta DB connection.
After the feed calculation and the subsequent materialization of results is completed, you can access the feed results using the Terracotta DB source operator.
Tip
Additional information like duration or potential execution errors are available in the MashZone NextGen log file.
Authentication using basic credentials
For authentication using basic credentials, you must use the REST API method to login 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 logout 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