Perfomatic:API: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 38: Line 38:
** Example response:
** Example response:
  {
  {
    'stat':'ok',
  'stat':'ok',
    'test_runs': [
  'test_runs': [
         {
         [98, {23, '2007072704', '572a00c0e251', 'Vista'}, 1208830929, 92.4, [['Something happened here', 988740]]],
            'id':98,
         [99, {23, '2007072704', '572a00c0e251', 'Vista'}, 1208834503, 87.3]
            'build': {
    ]
                'id':23,
                'build_id':'2007072704',
                'changeset':'572a00c0e251',
                'os':'Vista',
            },
            'date_run':1208830929,
            'average':92.4,
            'annotations': [
                {
                    'note':'Something happened here',
                    'bug_id':988740
                }
            ]
        },
         {
            'id':99,
            'build': {
                'id':23,
                'build_id':'2007072704',
                'changeset':'572a00c0e251',
                'os':'Vista',
            },
            'date_run':1208834503,
            'average':87.3
        }                 
    ]
  }
  }
* '''/api/testrun/''testRunId''''' - returns test run information for a specific testRunId
* '''/api/testrun/''testRunId''''' - returns test run information for a specific testRunId

Revision as of 18:37, 8 October 2008

The graph server API is a REST API with a JSON only response format.

Documented endpoints

  • /api/tests - returns list of all tests
    • Example response:
{
   'stat':'ok',
   'test': [
            {
                'id':123,
                'name':'Tp3',
                'branch':'1.9',
                'os':'WinXP',
                'machine':'qm-pxp03-cycles-5',
            },
            {
                'id':23,
                'name':'Ts',
                'branch:'1.8',
                'os':'Vista'
                'machine':'qm-pxp03-cycles-20',
            }
   ]
}
  • /api/test/testId - returns information for a specific testId
    • Example response:
{
   'stat':'ok',
   'test': {
       'id':123,
       'name':'Tp3',
       'branch':'1.9',
       'os':'WinXP'
   }
}
                
  • /api/test/testId/runs/ - returns test runs for a specific testId, default date limit is 4 weeks, sorted by date descending
    • Example response:
{
  'stat':'ok',
  'test_runs': [
       [98, {23, '2007072704', '572a00c0e251', 'Vista'}, 1208830929, 92.4, 'Something happened here', 988740],
       [99, {23, '2007072704', '572a00c0e251', 'Vista'}, 1208834503, 87.3]
   ]
}
  • /api/testrun/testRunId - returns test run information for a specific testRunId
    • Example response
{
   'stat':'ok',
   'testrun': {
       'id':98,
       'build': {
           'id':23,
           'build_id':'2007072704',
           'changeset':'572a00c0e251',
           'os':'Vista',
       },
       'date_run':1208830929,
       'average':92.4,
       'annotations': [
           {
              'note':'Something happened here',
              'bug_id':988740
           }
       ]
    }
}
  • /api/testrun/testRunId/values - returns test run results for a specific testRunId
    • Example response
{
   'stat':'ok',
   'annotations': [
       {
           'note':'Something happened here',
           'bug_id':988740
       }
   ],
   'values':[
       {
           'id':1,
           'value':22.3,
           'page':'www.yahoo.com'
       },
       {
           'id':3,
           'value':29.1,
           'page':'www.myspace.com'
       },
       {
           'id':1,
           'value':39.3,
           'page':'www.facebook.com'
       }
   ]
}

Error codes

  • Default error responses are as follows:
{
   'stat':'fail',
   'code':100,
   'message':'Test does not exist'
}