diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/TimelineServer.apt.vm hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/TimelineServer.apt.vm index 3c1169b..d20a295 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/TimelineServer.apt.vm +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-site/src/site/apt/TimelineServer.apt.vm @@ -51,13 +51,14 @@ YARN Timeline Server * Current Status - Timeline sever is a work in progress. The basic storage and retrieval of - information, both generic and framework specific, are in place. Timeline - server doesn't work in secure mode yet. The generic information and the - per-framework information are today collected and presented separately and - thus are not integrated well together. Finally, the per-framework information - is only available via RESTful APIs, using JSON type content - ability to - install framework specific UIs in YARN isn't supported yet. + Timeline sever is a work in progress, and both the generic information + features and the per-framework information features are not production ready. + The basic storage and retrieval of information, both generic and framework + specific, are in place. Timeline server doesn't work in secure mode yet. + The generic information and the per-framework information are today collected + and presented separately and thus are not integrated well together. Finally, + the per-framework information is only available via REST APIs, using JSON type + content - ability to install framework specific UIs in YARN isn't supported yet. * Basic Configuration @@ -223,3 +224,1424 @@ YARN Timeline Server // Stop the Timeline client client.stop(); +---+ + +* Generic Data Web UI + + Users can access the generic historic information of applications via web UI: + ++---+ + http(s):///applicationhistory ++---+ + +* Generic Data REST APIs + + Users can access the generic historic information of applications via REST + APIs: + +** Application List + + With the Application List API, you can obtain a collection of resources, each + of which represents an application. When you run a GET operation on this + resource, you obtain a collection of application objects. + +*** URI: + ++---+ + http(s):///ws/v1/applicationhistory/apps ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + * states - applications matching the given application states, specified as a + comma-separated list + + * finalStatus - the final status of the application - reported by the + application itself + + * user - user name + + * queue - queue name + + * limit - total number of app objects to be returned + + * startedTimeBegin - applications with start time beginning with this time, + specified in ms since epoch + + * startedTimeEnd - applications with start time ending with this time, + specified in ms since epoch + + * finishedTimeBegin - applications with finish time beginning with this time, + specified in ms since epoch + + * finishedTimeEnd - applications with finish time ending with this time, + specified in ms since epoch + + * applicationTypes - applications matching the given application types, + specified as a comma-separated list + +*** Elements of the (Application List) Object + + When you make a request for the list of applications, the information will be + returned as a collection of application objects. See also {{Application}} for + syntax of the application object. + +*---------------+--------------+-------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+-------------------------------+ +| app | array of app objects(JSON)/zero or more application objects(XML) | The collection of application objects | +*---------------+--------------+-------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "app": [ + { + "finishedTime": 1395789655864, + "currentAppAttemptId": "appattempt_1395789200506_0002_000001", + "name": "QuasiMonteCarlo", + "diagnosticsInfo": "", + "appState": "FINISHED", + "originalTrackingUrl": "", + "elapsedTime": 15600, + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0002/jobhistory/job/job_1395789200506_0002", + "finalAppStatus": "SUCCEEDED", + "queue": "default", + "submittedTime": 1395789640264, + "host": "localhost", + "rpcPort": 62654, + "user": "user1", + "appId": "application_1395789200506_0002", + "progress": 100.0, + "startedTime": 1395789640264, + "type": "MAPREDUCE", + "allocatedVCores": 0, + "allocatedMB": 0 + }, + { + "finishedTime": 1395789621322, + "currentAppAttemptId": "appattempt_1395789200506_0001_000001", + "name": "QuasiMonteCarlo", + "diagnosticsInfo": "", + "appState": "FINISHED", + "originalTrackingUrl": "", + "elapsedTime": 16120, + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001", + "finalAppStatus": "SUCCEEDED", + "queue": "default", + "submittedTime": 1395789605202, + "host": "localhost", + "rpcPort": 62607, + "user": "user2", + "appId": "application_1395789200506_0001", + "progress": 100.0, + "startedTime": 1395789605202, + "type": "MAPREDUCE", + "allocatedVCores": 0, + "allocatedMB": 0 + } + ] +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 1710 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + + application_1395789200506_0002 + appattempt_1395789200506_0002_000001 + user1 + QuasiMonteCarlo + default + MAPREDUCE + localhost + 62654 + FINISHED + 100.0 + + + + http://localhost:8088/proxy/application_1395789200506_0002/jobhistory/job/job_1395789200506_0002 + + SUCCEEDED + 1395789640264 + 1395789640264 + 1395789655864 + 15600 + 0 + 0 + + + application_1395789200506_0001 + appattempt_1395789200506_0001_000001 + user2 + QuasiMonteCarlo + default + MAPREDUCE + localhost + 62607 + FINISHED + 100.0 + + + + http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001 + + SUCCEEDED + 1395789605202 + 1395789605202 + 1395789621322 + 16120 + 0 + 0 + + ++---+ + +** Application + + With the Application API, you can get an application resource contains + information about a particular application that was running on an YARN + cluster. + +*** URI: + + Use the following URI to obtain an application object identified by the {appid} value. + ++---+ + http(s):///ws/v1/applicationhistory/apps/{appid} ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + None + +*** Elements of the (Application) Object: + +*---------------+--------------+--------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+--------------------------------+ +| appId | string | The application id | +*---------------+--------------+--------------------------------+ +| user | string | The user who started the application | +*---------------+--------------+--------------------------------+ +| name | string | The application name | +*---------------+--------------+--------------------------------+ +| type | string | The application type | +*---------------+--------------+--------------------------------+ +| queue | string | The queue the application was submitted to | +*---------------+--------------+--------------------------------+ +| appState | string | The application state according to the ResourceManager - valid values are members of the YarnApplicationState enum: FINISHED, FAILED, KILLED | +*---------------+--------------+--------------------------------+ +| finalStatus | string | The final status of the application if finished - reported by the application itself - valid values are: UNDEFINED, SUCCEEDED, FAILED, KILLED | +*---------------+--------------+--------------------------------+ +| progress | float | The progress of the application as a percent | +*---------------+--------------+--------------------------------+ +| trackingUrl | string | The web URL that can be used to track the application | +*---------------+--------------+--------------------------------+ +| diagnosticsInfo | string | Detailed diagnostics information | +*---------------+--------------+--------------------------------+ +| startedTime | long | The time in which application started (in ms since epoch) | +*---------------+--------------+--------------------------------+ +| finishedTime | long | The time in which the application finished (in ms since epoch) | +*---------------+--------------+--------------------------------+ +| elapsedTime | long | The elapsed time since the application started (in ms) | +*---------------+--------------+--------------------------------+ +| allocatedMB | int | The sum of memory in MB allocated to the application's running containers | +*---------------+--------------+---------------------------------+ +| allocatedVCores | int | The sum of virtual cores allocated to the application's running containers | +*---------------+--------------+--------------------------------+ +| currentAppAttemptId | string | The latest application attempt Id | +*---------------+--------------+--------------------------------+ +| host | string | The host of the ApplicationMaster | +*---------------+--------------+--------------------------------+ +| rpcPort | int | The rpc port of the ApplicationMaster | +*---------------------------------------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "finishedTime": 1395789621322, + "currentAppAttemptId": "appattempt_1395789200506_0001_000001", + "name": "QuasiMonteCarlo", + "diagnosticsInfo": "", + "appState": "FINISHED", + "originalTrackingUrl": "", + "elapsedTime": 16120, + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001", + "finalAppStatus": "SUCCEEDED", + "queue": "default", + "submittedTime": 1395789605202, + "host": "localhost", + "rpcPort": 62607, + "user": "user2", + "appId": "application_1395789200506_0001", + "progress": 100.0, + "startedTime": 1395789605202, + "type": "MAPREDUCE", + "allocatedVCores": 0, + "allocatedMB": 0 +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 873 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + application_1395789200506_0001 + appattempt_1395789200506_0001_000001 + user2 + QuasiMonteCarlo + default + MAPREDUCE + localhost + 62607 + FINISHED + 100.0 + + + + http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001 + + SUCCEEDED + 1395789605202 + 1395789605202 + 1395789621322 + 16120 + 0 + 0 + ++---+ + +** Application Attempt List + + With the Application Attempt List API, you can obtain a collection of + resources, each of which represents an application attempt. When you run a + GET operation on this resource, you obtain a collection of application + attempt objects. + +*** URI: + + Use the following URI to obtain all the attempt objects of an application + identified by the {appid} value. + ++---+ + http(s):///ws/v1/applicationhistory/apps/{appid}/appattempts ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + None + +*** Elements of the (Application Attempt List) Object + + When you make a request for the list of application attempts, the information + will be returned as a collection of application attempt objects. See also + {{Application Attempt}} for syntax of the application object. + +*---------------+--------------+-------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+-------------------------------+ +| appattempt | array of appattempt objects(JSON)/zero or more application attempt objects(XML) | The collection of application attempt objects | +*---------------+--------------+-------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001/appattempts ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "appAttempt": [ + { + "appAttemptState": "FINISHED", + "diagnosticsInfo": "", + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001", + "host": "localhost", + "rpcPort": 62607, + "amContainerId": "container_1395789200506_0001_01_000001", + "appAttemptId": "appattempt_1395789200506_0001_000001" + }, + { + "appAttemptState": "FINISHED", + "diagnosticsInfo": "", + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001", + "host": "localhost", + "rpcPort": 62608, + "amContainerId": "container_1395789200506_0001_02_000001", + "appAttemptId": "appattempt_1395789200506_0001_000002" + } + ] +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001/appattempts + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 951 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + + appattempt_1395789200506_0001_000001 + localhost + 62607 + + http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001 + + + FINISHED + container_1395789200506_0001_01_000001 + + + appattempt_1395789200506_0001_000002 + localhost + 62608 + + http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001 + + + FINISHED + container_1395789200506_0001_02_000001 + + ++---+ + +** Application Attempt + + With the Application Attempt API, you can get an application attempt resource + contains information about a particular application attempt of an application + that was running on an YARN cluster. + +*** URI: + + Use the following URI to obtain an application attempt object identified by + the {appid} value and the {appattemptid} value. + ++---+ + http(s):///ws/v1/applicationhistory/apps/{appid} + /appattempts/{appattemptid} ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + None + +*** Elements of the (Application Attempt) Object: + +*---------------+--------------+--------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+--------------------------------+ +| appAttemptId | string | The application attempt Id | +*---------------+--------------+--------------------------------+ +| amContainerId | string | The ApplicationMaster container Id | +*---------------+--------------+--------------------------------+ +| appAttemptState | string | The application attempt state according to the ResourceManager - valid values are members of the YarnApplicationAttemptState enum: FINISHED, FAILED, KILLED | +*---------------+--------------+--------------------------------+ +| trackingUrl | string | The web URL that can be used to track the application | +*---------------+--------------+--------------------------------+ +| diagnosticsInfo | string | Detailed diagnostics information | +*---------------+--------------+--------------------------------+ +| host | string | The host of the ApplicationMaster | +*---------------+--------------+--------------------------------+ +| rpcPort | int | The rpc port of the ApplicationMaster | +*---------------------------------------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001 ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "appAttemptState": "FINISHED", + "diagnosticsInfo": "", + "trackingUrl": "http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001", + "host": "localhost", + "rpcPort": 62607, + "amContainerId": "container_1395789200506_0001_01_000001", + "appAttemptId": "appattempt_1395789200506_0001_000001" +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001 + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 488 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + appattempt_1395789200506_0001_000001 + localhost + 62607 + + http://localhost:8088/proxy/application_1395789200506_0001/jobhistory/job/job_1395789200506_0001 + + + FINISHED + container_1395789200506_0001_01_000001 + ++---+ + +** Container List + + With the Container List API, you can obtain a collection of resources, each + of which represents a container. When you run a GET operation on this + resource, you obtain a collection of container objects. + +*** URI: + + Use the following URI to obtain all the container objects of an application + attempt identified by the {appid} value and the {appattemptid} value. + ++---+ + http(s):///ws/v1/applicationhistory/apps/{appid} + /appattempts/{appattemptid}/containers ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + None + +*** Elements of the (Container List) Object + + When you make a request for the list of containers, the information will be + returned as a collection of container objects. See also {{Container}} for + syntax of the container object. + +*---------------+--------------+-------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+-------------------------------+ +| container | array of container objects(JSON)/zero or more container objects(XML) | The collection of container objects | +*---------------+--------------+-------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001/containers ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "container": [ + { + "finishedTime": 1395789628219, + "containerId": "container_1395789200506_0001_01_000001", + "diagnosticsInfo": "", + "allocatedVCores": 1, + "startedTime": 1395789605713, + "priority": 0, + "elapsedTime": 22506, + "allocatedMB": 2048, + "containerState": "COMPLETE", + "containerExitStatus": 0, + "assignedNodeId": "localhost:9105", + "logUrl": "http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000001/container_1395789200506_0001_01_000001/user1" + }, + { + "finishedTime": 1395789617068, + "containerId": "container_1395789200506_0001_01_000002", + "diagnosticsInfo": "Container killed by the ApplicationMaster.\nContainer killed on request. Exit code is 143\nContainer exited with a non-zero exit code 143\n", + "allocatedVCores": 1, + "startedTime": 1395789612743, + "priority": 20, + "elapsedTime": 4325, + "allocatedMB": 1024, + "containerState": "COMPLETE", + "containerExitStatus": 143, + "assignedNodeId": "localhost:9105", + "logUrl": "http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000002/container_1395789200506_0001_01_000002/user1" + } + ] +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001/containers + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 1428 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + + container_1395789200506_0001_01_000001 + 2048 + 1 + localhost:9105 + 0 + 1395789605713 + 1395789628219 + 22506 + + + http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000001/container_1395789200506_0001_01_000001/user1 + + 0 + COMPLETE + + + container_1395789200506_0001_01_000002 + 1024 + 1 + localhost:9105 + 20 + 1395789612743 + 1395789617068 + 4325 + + Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 + + + http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000002/container_1395789200506_0001_01_000002/user1 + + 143 + COMPLETE + + ++---+ + +** Container + + With the Container API, you can get a container resource contains information + about a particular container of an application attempt of an application that + was running on an YARN cluster. + +*** URI: + + Use the following URI to obtain a container object identified by the {appid} + value, the {appattemptid} value and the {containerid} value. + ++---+ + http(s):///ws/v1/applicationhistory/apps/{appid} + /appattempts/{appattemptid}/containers/{containerid} ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + None + +*** Elements of the (Container) Object: + +*---------------+--------------+--------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+--------------------------------+ +| containerId | string | The container Id | +*---------------+--------------+--------------------------------+ +| containerState | string | The container state according to the ResourceManager - valid values are members of the ContainerState enum: COMPLETE | +*---------------+--------------+--------------------------------+ +| containerExitStatus | int | The container exit status | +*---------------+--------------+--------------------------------+ +| logUrl | string | The log URL that can be used to access the container aggregated log | +*---------------+--------------+--------------------------------+ +| diagnosticsInfo | string | Detailed diagnostics information | +*---------------+--------------+--------------------------------+ +| startedTime | long | The time in which container started (in ms since epoch) | +*---------------+--------------+--------------------------------+ +| finishedTime | long | The time in which the container finished (in ms since epoch) | +*---------------+--------------+--------------------------------+ +| elapsedTime | long | The elapsed time since the container started (in ms) | +*---------------+--------------+--------------------------------+ +| allocatedMB | int | The memory in MB allocated to the container | +*---------------+--------------+--------------------------------+ +| allocatedVCores | int | The virtual cores allocated to the container | +*---------------+--------------+--------------------------------+ +| priority | int | The priority of the container | +*---------------+--------------+--------------------------------+ +| assignedNodeId | string | The assigned node host and port of the container | +*---------------------------------------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001/containers/container_1395789200506_0001_01_000001 ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "finishedTime": 1395789628219, + "containerId": "container_1395789200506_0001_01_000001", + "diagnosticsInfo": "", + "allocatedVCores": 1, + "startedTime": 1395789605713, + "priority": 0, + "elapsedTime": 22506, + "allocatedMB": 2048, + "containerState": "COMPLETE", + "containerExitStatus": 0, + "assignedNodeId": "localhost:9105", + "logUrl": "http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000001/container_1395789200506_0001_01_000001/user1" +} ++---+ + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/applicationhistory/apps/application_1395789200506_0001 + /appattempts/appattempt_1395789200506_0001_000001/containers/container_1395789200506_0001_01_000001 + Accept: application/xml ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/xml + Content-Length: 669 + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ + + + container_1395789200506_0001_01_000001 + 2048 + 1 + localhost:9105 + 0 + 1395789605713 + 1395789628219 + 22506 + + + http://localhost:8188/applicationhistory/logs/localhost:9105/container_1395789200506_0001_01_000001/container_1395789200506_0001_01_000001/user1 + + 0 + COMPLETE + ++---+ + +* Per-framework Data REST APIs + + Users can access the per-framework historic information of applications via + REST APIs: + +** Posting Timeline Entities + + With the Posting Entities API, you can post the entities and events, which + contain the per-framework information you want to record, to the timeline + server. + +*** URI: + ++---+ + http(s):///ws/v1/timeline ++---+ + +*** HTTP Operations Supported: + ++---+ + POST ++---+ + +*** Query Parameters Supported: + + None + +*** Request Examples: + + <> + + HTTP Request: + ++---+ + POST http:///ws/v1/timeline ++---+ + + Request Header: + ++---+ + POST /ws/v1/timeline HTTP/1.1 + Accept: application/json + Content-Type: application/json + Transfer-Encoding: chunked ++---+ + + Request Body: + ++---+ +{ + "entities" : [ { + "entity" : "entity id 0", + "entitytype" : "entity type 0", + "relatedentities" : { + "test ref type 2" : [ "test ref id 2" ], + "test ref type 1" : [ "test ref id 1" ] + }, + "events" : [ { + "timestamp" : 1395818851590, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851590, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ], + "primaryfilters" : { + "pkey2" : [ "pval2" ], + "pkey1" : [ "pval1" ] + }, + "otherinfo" : { + "okey2" : "oval2", + "okey1" : "oval1" + }, + "starttime" : 1395818851588 + }, { + "entity" : "entity id 1", + "entitytype" : "entity type 0", + "relatedentities" : { + "test ref type 2" : [ "test ref id 2" ], + "test ref type 1" : [ "test ref id 1" ] + }, + "events" : [ { + "timestamp" : 1395818851590, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851590, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ], + "primaryfilters" : { + "pkey2" : [ "pval2" ], + "pkey1" : [ "pval1" ] + }, + "otherinfo" : { + "okey2" : "oval2", + "okey1" : "oval1" + }, + "starttime" : 1395818851590 + } ] +} ++---+ + +** Timeline Entity List + + With the Timeline Entity List API, you can retrieve a list of entity object, + sorted by the starting timestamp for the entity, descending. The starting + timestamp of an entity can be a timestamp specified by the your application. + If it is not explicitly specified, it will be chosen by the store to be the + earliest timestamp of the events received in the first post for the entity. + +*** URI: + + Use the following URI to obtain all the entity objects of a given + {entityType}. + ++---+ + http(s):///ws/v1/timeline/{entityType} ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + * limit - A limit on the number of entities to return. If null, defaults to + 100. + + * windowStart - The earliest start timestamp to retrieve (exclusive). If + null, defaults to retrieving all entities until the limit is reached. + + * windowEnd - The latest start timestamp to retrieve (inclusive). If null, + defaults to the max value of Long. + + * fromId - If fromId is not null, retrieve entities earlier than and + including the specified ID. If no start time is found for the specified ID, + an empty list of entities will be returned. The windowEnd parameter will take + precedence if the start time of this entity falls later than windowEnd. + + * fromTs - If fromTs is not null, ignore entities that were inserted into the + store after the given timestamp. The entity's insert timestamp used for this + comparison is the store's system time when the first put for the entity was + received (not the entity's start time). + + * primaryFilter - Retrieves only entities that have the specified primary + filter. If null, retrieves all entities. This is an indexed retrieval, and no + entities that do not match the filter are scanned. + + * secondaryFilters - Retrieves only entities that have exact matches for all + the specified filters in their primary filters or other info. This is not an + indexed retrieval, so all entities are scanned but only those matching the + filters are returned. + + * fields - Specifies which fields of the entity object to retrieve: + EVENTS, RELATED_ENTITIES, PRIMARY_FILTERS, OTHER_INFO, LAST_EVENT_ONLY. If + the set of fields contains LAST_EVENT_ONLY and not EVENTS, the most recent + event for each entity is retrieved. If null, retrieves all fields. + +*** Elements of the (Timeline Entity List) Object + + When you make a request for the list of timeline entities, the information + will be returned as a collection of container objects. See also + {{Timeline Entity}} for syntax of the timeline entity object. + +*---------------+--------------+-------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+-------------------------------+ +| entities | array of timeline entity objects(JSON) | The collection of timeline entity objects | +*---------------+--------------+-------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/timeline/entity%20type%200 ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "entities" : [ { + "entity" : "entity id 0", + "entitytype" : "entity type 0", + "relatedentities" : { + "test ref type 2" : [ "test ref id 2" ], + "test ref type 1" : [ "test ref id 1" ] + }, + "events" : [ { + "timestamp" : 1395818851590, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851590, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ], + "primaryfilters" : { + "pkey2" : [ "pval2" ], + "pkey1" : [ "pval1" ] + }, + "otherinfo" : { + "okey2" : "oval2", + "okey1" : "oval1" + }, + "starttime" : 1395818851588 + }, { + "entity" : "entity id 1", + "entitytype" : "entity type 0", + "relatedentities" : { + "test ref type 2" : [ "test ref id 2" ], + "test ref type 1" : [ "test ref id 1" ] + }, + "events" : [ { + "timestamp" : 1395818851590, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851590, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ], + "primaryfilters" : { + "pkey2" : [ "pval2" ], + "pkey1" : [ "pval1" ] + }, + "otherinfo" : { + "okey2" : "oval2", + "okey1" : "oval1" + }, + "starttime" : 1395818851590 + } ] +} ++---+ + +** Timeline Entity + + With the Timeline Entity API, you can retrieve the entity information for a + given entity identifier. + +*** URI: + + Use the following URI to obtain the entity object identified by the + {entityType} value and the {entityId} value. + ++---+ + http(s):///ws/v1/timeline/{entityType}/{entityId} ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + * fields - Specifies which fields of the entity object to retrieve: + EVENTS, RELATED_ENTITIES, PRIMARY_FILTERS, OTHER_INFO, LAST_EVENT_ONLY. If + the set of fields contains LAST_EVENT_ONLY and not EVENTS, the most recent + event for each entity is retrieved. If null, retrieves all fields. + +*** Elements of the (Timeline Entity) Object: + + See also {{Timeline Event List}} for syntax of the timeline event object. + +*---------------+--------------+--------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+--------------------------------+ +| entity | string | The entity id | +*---------------+--------------+--------------------------------+ +| entitytype | string | The entity type | +*---------------+--------------+--------------------------------+ +| relatedentities | map | The related entities' identifiers, which are organized in a map of entityType : [entity1, entity2, ...] | +*---------------+--------------+--------------------------------+ +| events | list | The events of the entity | +*---------------+--------------+--------------------------------+ +| primaryfilters | map | The primary filters of the entity, which are orgainzied in a map of key : [value1, value2, ...] | +*---------------+--------------+--------------------------------+ +| otherinfo | map | The other information of the entity, which is orgainzied in a map of key : value | +*---------------+--------------+--------------------------------+ +| starttime | long | The start time of the entity | +*---------------------------------------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/timeline/entity%20type%200/entity%20id%200 ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "entity" : "entity id 0", + "entitytype" : "entity type 0", + "relatedentities" : { + "test ref type 2" : [ "test ref id 2" ], + "test ref type 1" : [ "test ref id 1" ] + }, + "events" : [ { + "timestamp" : 1395818851590, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851590, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ], + "primaryfilters" : { + "pkey2" : [ "pval2" ], + "pkey1" : [ "pval1" ] + }, + "otherinfo" : { + "okey2" : "oval2", + "okey1" : "oval1" + }, + "starttime" : 1395818851588 +} ++---+ + +** Timeline Event List + + With the Timeline Events API, you can retrieve the event objects for a list + of entities all of the same entity type. The events for each entity are + sorted in order of their timestamps, descending. + +*** URI: + + Use the following URI to obtain the event objects of the given {entityType}. + ++---+ + http(s):///ws/v1/timeline/{entityType}/events ++---+ + +*** HTTP Operations Supported: + ++---+ + GET ++---+ + +*** Query Parameters Supported: + + * entityIds - The entity IDs to retrieve events for. + + * limit - A limit on the number of events to return for each entity. If null, + defaults to 100 events per entity. + + * windowStart - If not null, retrieves only events later than the given time + (exclusive) + + * windowEnd - If not null, retrieves only events earlier than the given time + (inclusive) + + * eventTypes - Restricts the events returned to the given types. If null, + events of all types will be returned. + +*** Elements of the (Timeline Entity List) Object + + When you make a request for the list of timeline events, the information + will be returned as a collection of event objects. + +*---------------+--------------+-------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+-------------------------------+ +| events | array of timeline event objects(JSON) | The collection of timeline event objects | +*---------------+--------------+-------------------------------+ + + Bellow is the elements of a single event object. + +*---------------+--------------+--------------------------------+ +|| Item || Data Type || Description | +*---------------+--------------+--------------------------------+ +| eventtype | string | The event type | +*---------------+--------------+--------------------------------+ +| eventinfo | map | The information of the event, which is orgainzied in a map of key : value | +*---------------+--------------+--------------------------------+ +| timestamp | long | The timestamp of the event | +*---------------------------------------------------------------+ + +*** Response Examples: + + <> + + HTTP Request: + ++---+ + GET http:///ws/v1/timeline/entity%20type%200/events ++---+ + + Response Header: + ++---+ + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + Server: Jetty(6.1.26) ++---+ + + Response Body: + ++---+ +{ + "events" : [ { + "entity" : "entity id 0", + "entitytype" : "entity type 0", + "events" : [ { + "timestamp" : 1395818851826, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851826, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ] + }, { + "entity" : "entity id 1", + "entitytype" : "entity type 1", + "events" : [ { + "timestamp" : 1395818851826, + "eventtype" : "event type 0", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + }, { + "timestamp" : 1395818851826, + "eventtype" : "event type 1", + "eventinfo" : { + "key2" : "val2", + "key1" : "val1" + } + } ] + } ] +} ++---+ +