Applications

Attributes

id (read-only) Unique ID for the application in our system.
created (read-only) The time the application was created.
name (read-only) The name for this application.
servers (read-only) The servers associated with this application.
template (read-only) The template used for this application.
url (read-only) The URL to get more information about this item.

Available APIs

/api/applications/

Lists all available applications. See above for the attributes each application has.

GET

Returns the list of applications.

Arguments

  • limit (optional, default:2500, max:2500) – Sets the page size to a limit set by the user.
  • page (optional, default:0) – Retrieve the specific page of data of size limit.

Argument Examples

  • limit=10 – will get the first page of the first 10 items.
  • limit=25&page=3 – will get the 4th page of size 25 items.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/
 
{
    "pagination": {
        "count": 63, 
        "next": null, 
        "previous": null
    }, 
    "data": [
        {
            "id": 10433, 
            "name": "service0_Sendmail", 
            "created": 0, 
            "servers": [
                11980, 
                11979, 
                245378, 
                9706, 
                9843, 
                9941, 
                9942, 
                12605, 
                12606, 
                12607, 
                248833, 
                248834, 
                248835, 
                9869, 
                9870, 
                9708, 
                10304, 
                10519, 
                9711, 
                9710, 
                9713, 
                9712, 
                9900, 
                226622
            ], 
            "template": 2240, 
            "url": "/api/v5/applications/10433/"
        }, 
        {
            "id": 10434, 
            "name": "service0_Postgresql", 
            "created": 0, 
            "servers": [
                9869, 
                9870, 
                10519, 
                9713
            ], 
            "template": 2228, 
            "url": "/api/v5/applications/10434/"
        }, 
}

/api/applications/{application_id}/

View an application.

GET

Get info about a specific process, given by the process_id in the URL. It takes no additional parameters.

curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/1/
{
    "id": 10434, 
    "name": "service0_Postgresql", 
    "created": 0, 
    "servers": [
        9869, 
        9870, 
        10519, 
        9713
    ], 
    "template": 2228, 
    "url": "/api/v5/applications/10434/"
}

/api/applications/{application_id}/data/

Retrieves historical data for the given application. Each piece of application data may have the following attributes (if some data isn’t given it means the values don’t exist for this application for that minute):

time The minute this data is for.
cpu The CPU value in percent.
memory The memory usage in bytes.
page_faults The number of page faults.
thread_num The number of threads.
socket_write Outbound network traffic in bytes.
socket_read Inbound network traffic in bytes.
socket_num The number of network connections.
cpu_core_count The total number of cpu cores.
process_num The number of the process.
file_read Data read to files in bytes.
file_write Data written from files in bytes.
file_num The number of files accesses.
registry_num The number of registries accessed.
net_transact_num The number of net transactions.
response_num The number of socket responses sent (you can have multiple responses on a single network/socket connection).

GET

Gets data for the given application. It gets up to “num” points starting from “end” and going back “start.”

Arguments

  • num (optional, default:1) – Retrieve up to this many number of points. Note that there can be gaps in the data if the server this process is on has an outage.
  • end (optional, default:most recent point) – Retrieve data from this timestamp backwards. If not given, it gets the most recent data.
  • start (optional) – Don’t retrieve any points before this date, if given. From V3, If both start and num are given, end will be assigned to start + time_step_in_epoch (default to be 60) * num.
  • time_step (optional, default:Minute) – Time step for the points, can be: Minute, Hour, Day.

Argument Examples

  • num=3 – will get the three most recent minutes of data.
  • num=1440&start=<12:00am today> – will get the all of today’s data (which will probably be less than 1440 points).
  • num=3&end=1288584000 – will get the three minutes of data just before Nov. 11, 2010 UTC (which is 1288584000). If all the data exists, this will be 1288584000, 1288583940, and 1288583880. If the middle minute of data didn’t exist it would return 1288584000 and 1288583880.
  • num=30&end=1288584000&start=1288583940 – will get 2 minutes of data (if they exist) from 1288584000 and 1288583940.
  • num=3&time_step=Hour – will get the three most recent hours of data.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/1/data/?num=2 
 
{
    "pagination": {
        "count": 1, 
        "previous": null, 
        "next": null
    }, 
    "data": [
        {
            "thread_num": 25, 
            "socket_num": 21, 
            "page_faults": 0, 
            "socket_write": 4184306, 
            "socket_read": 489429, 
            "cpu_core_count": 53, 
            "memory": 2140409856, 
            "file_read": 562403, 
            "registry_num": 0, 
            "net_transact_num": 21, 
            "file_write": 1389448, 
            "process_num": 47, 
            "time": 1423858380, 
            "file_num": 1451, 
            "response_num": 0, 
            "cpu": 0.01
        }
    ]
}

/api/applications/{application_id}/detail/

Retrieves historical detail data for a given application. Each piece of detail data can have the following attributes, which are each an array of individual items. Each individual item is a mapping of title to value. Not all attributes will be included for all applications.

files A list of files accessed.
threads A list of threads in the processes in this application.
sockets A list of sockets.

GET

Gets data for the given application.

  • time (optional, default:latest) – Get detail data for this minute, if not given we return the most recent minute.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/1/detail/

{
    "pagination": {
        "count": 3, 
        "previous": null, 
        "next": null
    }, 
    "data": {
        "files": [
            "/var/lib/cloudera-scm-server-db/data/base/16385/16713", 
            "/var/lib/cloudera-scm-server-db/data/base/16385/16712", 
            "/var/lib/cloudera-scm-server-db/data/base/16385/16711", 
            "/var/lib/cloudera-scm-server-db/data/base/16385/2601", 
         ], 
        "threads": [
            {
                "TID": "2123", 
                "StackSize": "90112", 
                "CreateTime": "13010796309000000", 
                "KernelTime": "24160000", 
                "UserTime": "182250000"
            }, 
            {
                "TID": "1909", 
                "StackSize": "90112", 
                "CreateTime": "13010796257000000", 
                "KernelTime": "700000", 
                "UserTime": "150000"
            }, 
        ], 
        "sockets": [
            {
                "Status": "Closed", 
                "PeerIP": "10.80.144.197", 
                "TransRecv": "0", 
                "Socket": "Server", 
                "TransSent": "0", 
                "PeerPort": "39661", 
                "NumResponses": "0", 
                "ProcName": [
                    "9869,28183,13057053338000000", 
                    "postgres", 
                    "/usr/pgsql-9.0/bin/postmaster -p 5432 -D /var/lib/pgsql/9.0/data "
                ], 
                "TotalResponseTime": "0", 
                "TransAcceptTime": "1423859335.766601", 
                "ThreadId": "28183", 
                "SockPort": "5432", 
                "Type": "TCP", 
                "TransactTime": "0.00026899999999999998", 
                "SockIP": "10.80.91.228"
            }, 
        ]
    }
}

/api/applications/{application_id}/processes/

Returns the list of processes in an application. See the processes documentation for more information about process objects.

GET

Returns the list of processes in a given application. If no arguments are given, it returns the currently running processes. Otherwise it returns any processes that were running between the start and end date given. Please note that you may only request a max timespan of 1 hour. If you exceed 60 minutes then pagination will be incurred. An example is provided below.

  • num (optional, default:1) – Retrieve up to this many number of points.
  • start (optional) – Start date of range (in secs since epoch) to get processes for.
  • end (optional) – End date of range (in secs since epoch) to get processes for.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/1/processes/
 {
    "pagination": {
        "count": 47, 
        "previous": null, 
        "next": null
    }, 
    "data": [
        {
            "server_id": "10519", 
            "create_time": "12995747183000000", 
            "pid": "7108", 
            "name": "postgres", 
            "args": null
        }, 
        {
            "server_id": "10519", 
            "create_time": "12995747184000000", 
            "pid": "7119", 
            "name": "postgres", 
            "args": null
        }, 
    ]
}

/api/applications/{application_id}/processes/data/

Retrieves the process summary data for the application Each piece of process summary data may have the following attributes (if some data isn’t given it means the values don’t exist for this application for that minute):

cpu The CPU value in percent.
memory The memory usage in bytes.
page_faults The number of page faults.
thread_num The number of threads.
socket_write Outbound network traffic in bytes.
socket_read Inbound network traffic in bytes.
socket_num The number of network connections.
file_read Data read to files in bytes.
file_write Data written from files in bytes.
file_num The number of files accessed.
registry_num The number of registries accessed.
uid The identification of users within the kernel.
args The arguments within the process.
name The name of the process.
flags The number of flags set to that process.
time The time that process is reporting.
response_num The number of socket responses sent (you can have multiple responses on a single network/socket connection).

GET

Gets data for the given application. It gets up to “num” points starting from “end” and going back “start”.

Arguments

  • num (optional, default:1) – Retrieve up to this many number of points. Note that there can be gaps in the data if the server this process is on has an outage.
  • end (optional, default:most recent point) – Retrieve data from this timestamp backwards. If not given, it gets the most recent data.
  • start (optional) – Don’t retrieve any points before this date, if given.
  • time_step (optional, default:Minute) – Time step for the points, can be: Minute, Hour, Day.

Argument Examples

  • num=3 – will get the three most recent minutes of data.
  • num=1440&start=<12:00am today> – will get the all of today’s data (which will probably be less than 1440 points).
  • num=3&end=1288584000 – will get the three minutes of data just before Nov. 11, 2010 UTC (which is 1288584000). If all the data exists, this will be 1288584000, 1288583940, and 1288583880. If the middle minute of data didn’t exist it would return 1288584000 and 1288583880.
  • num=30&end=1288584000&start=1288583940 – will get 2 minutes of data (if they exist) from 1288584000 and 1288583940.
  • num=3&time_step=Hour – will get the three most recent hours of data.
curl --user {EMAIL}:{API_KEY} https://wwws.appfirst.com/api/applications/1/processes/data/
{
    "pagination": {
        "count": 47, 
        "previous": null, 
        "next": null
    }, 
    "data": [
        {
            "thread_num": 0, 
            "uid": "10519_7118_12995747184000000", 
            "socket_num": 0, 
            "page_faults": 0, 
            "socket_write": 0, 
            "socket_read": 0, 
            "memory": 1355776, 
            "file_read": 0, 
            "args": "None", 
            "registry_num": 0, 
            "name": "postgres", 
            "file_write": 0, 
            "flags": 0, 
            "time": 1423859820, 
            "file_num": 5, 
            "response_num": 0, 
            "cpu": 0.0
        }, 
    ]
}