Carte APIs Carte Server
Provides web service calls related to servers, such as allocating sockets and ports, getting the list of slaves and registering them, and displaying the initial Carte page.
Allocates port to use by client. Allows any client to ask for a port number to use. This is necessary several slaves can be run on the same host. The method ensures the port number is unique for host name provided and makes sure the slaves are using valid port numbers. Data communication across a cluster of Carte servers happens through TCP/IP sockets. Slave transformations sometimes open (or listen to) tens to hundreds of sockets. When you want to allocate the port numbers for data communication between slave transformation in a kettle clustering run, you need unique combinations of all the parameters below.
Example Request:
GET /kettle/allocateSocket/?xml=Y&rangeStart=100&host=locahost&id=clust&trans=my_trans&sourceSlave=slave_1&sourceStep=200&sourceCopy=1&targetSlave=slave_2&targetStep=50&targetCopy=1Return XML format when Y, HTML otherwise
NPossible values: Port number to start looking from
Port's host
Carte container id
Running transformation id
Name of the source slave server
Port number step used on source slave server
Number of copies of the step on source server
Name of the target slave server
Port number step used on target slave server
Number of copies of the step on target server
Socket allocated successfully
Socket allocation result
Internal server error
GET /kettle/allocateSocket HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<port>100</port>
Gets list of ports for specified host. Method is used for listing all or just open ports for specified host. Response contains port number, which transformation it is (was) used for, current status of the port and last date time used.
Example Request:
GET /kettle/listSocket/?host=127.0.0.1Host to get ports for
127.0.0.1Boolean flag that indicates whether all or only open ports should be returned. Set it to Y to get the list of only currently open ports.
Socket list retrieved successfully
HTML document listing the ports requested
Internal server error
GET /kettle/listSocket?host=text HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<HTML>
<HEAD><TITLE>List of server sockets on server '127.0.0.1'</TITLE></HEAD>
<BODY>
<H1>Ports for host '127.0.0.1'</H1>
Found 5 ports for host '127.0.0.1'<p>
8088 : Transformation=dummy-trans, crt/Dummy (do nothing) 2.0
--> sll/Dummy (do nothing).0
id=b20bcd03-9682-4327-8c42-b129faabbfe1, allocated=false
time=Mon Nov 17 09:31:15 BRT 2014
<br>
8089 : Transformation=dummy-trans, crt/Dummy (do nothing) 2.0
--> sll/Dummy (do nothing).1
id=b20bcd03-9682-4327-8c42-b129faabbfe1, allocated=false
time=Mon Nov 17 09:31:15 BRT 2014
<br>
8090 : Transformation=dummy-trans, crt/Dummy (do nothing) 2.0
--> sll/Dummy (do nothing).2
id=b20bcd03-9682-4327-8c42-b129faabbfe1, allocated=false
time=Mon Nov 17 09:31:15 BRT 2014
<br>
8091 : Transformation=dummy-trans, crt/Dummy (do nothing) 2.0
--> sll/Dummy (do nothing).3
id=b20bcd03-9682-4327-8c42-b129faabbfe1, allocated=false
time=Mon Nov 17 09:31:15 BRT 2014
<br>
8092 : Transformation=dummy-trans, crt/Dummy (do nothing) 2.0
--> sll/Dummy (do nothing).4
id=b20bcd03-9682-4327-8c42-b129faabbfe1, allocated=false
time=Mon Nov 17 09:31:15 BRT 2014
<br>
</BODY>
</HTML>
Increments specified pre-configured sequence. Method is used for reserving a number of IDs and incrementing a sequence pre-configured in Carte server configuration by specified amount. If no increment value provided 10000 is used by default.
Example Request:
GET /kettle/nextSequence?name=test_seqName of the sequence specified in Carte configuration file
test_seqParameter used for incrementing sequence. If no parameter specified 10000 is used by default.
10000Next sequence value retrieved
XML containing sequence value and the increment value used
Internal server error
GET /kettle/nextSequence?name=text HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<seq><value>570000</value><increment>10000</increment></seq>
Registers slave server in the master. The method is used to add or update information of slave server.
Example Request:
POST /kettle/registerSlave/Request body should contain xml containing slave server description.
SlaveServerDetection XML
Slave server registered successfully
Internal server error
POST /kettle/registerSlave HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: application/xml
Accept: */*
Content-Length: 6
"text"<?xml version="1.0" encoding="UTF-8"?>
<webresult>
<result>OK</result>
<message>Slave server detection 'Dynamic slave [localhost:901]' was replaced in the list.</message>
<id/>
</webresult>
Gets list of slave servers. Retrieves list of slave servers which are known to specific server.
Example Request:
GET /kettle/getSlavesReturn XML format when Y, HTML otherwise
NPossible values: Slave servers list retrieved successfully
List of registered slave servers
Internal server error
GET /kettle/getSlaves HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<SlaveServerDetections>
<SlaveServerDetection>
<slaveserver>
<name>Dynamic slave [localhost:909]</name>
<hostname>localhost</hostname>
<port>909</port>
<webAppName/>
<username>cluster</username>
<password>Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8</password>
<proxy_hostname/>
<proxy_port/>
<non_proxy_hosts/>
<master>N</master>
</slaveserver>
<active>Y</active>
<last_active_date>2014/11/17 06:42:28.043</last_active_date>
<last_inactive_date>2014/11/17 06:42:27.372</last_inactive_date>
</SlaveServerDetection>
</SlaveServerDetections>
Retrieve server status. The status contains information about the server itself (OS, memory, etc) and information about jobs and transformations present on the server.
Example Request:
GET /kettle/status/?xml=YReturn XML format when Y, HTML otherwise
NPossible values: Server status retrieved successfully
Server status in XML format including memory, CPU, OS info and running transformations/jobs
Internal server error
GET /kettle/status HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<serverstatus>
<statusdesc>Online</statusdesc>
<memory_free>229093440</memory_free>
<memory_total>285736960</memory_total>
<cpu_cores>4</cpu_cores>
<cpu_process_time>7534848300</cpu_process_time>
<uptime>68818403</uptime>
<thread_count>45</thread_count>
<load_avg>-1.0</load_avg>
<os_name>Windows 7</os_name>
<os_version>6.1</os_version>
<os_arch>amd64</os_arch>
<transstatuslist>
<transstatus>
<transname>dummy-trans</transname>
<id>c56961b2-c848-49b8-abde-76c8015e29b0</id>
<status_desc>Stopped</status_desc>
<error_desc/>
<paused>N</paused>
<stepstatuslist>
</stepstatuslist>
<first_log_line_nr>0</first_log_line_nr>
<last_log_line_nr>0</last_log_line_nr>
</transstatus>
</transstatuslist>
<jobstatuslist>
</jobstatuslist>
</serverstatus>
Stops the Carte server. This method must be set up initially through the CLI and is used for stopping the Carte server.
Example Request:
GET http://localhost:8080/pentaho/kettle/stopCarteReturn XML format when Y, HTML otherwise
NPossible values: Request was processed
Internal server error occurs during request processing
GET /kettle/stopCarte HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?xml version="1.0" encoding="UTF-8"?>
<request_accepted>true</request_accepted>
Was this helpful?

