-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0352c9e
commit 7069247
Showing
8 changed files
with
221 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
//http = require('http') | ||
request = require('request') | ||
|
||
|
||
function parseResponse(query, jsonContent) { | ||
|
||
let json2ts = require("json2ts"); | ||
let interfaces = json2ts.convert(jsonContent); | ||
console.log( interfaces ); | ||
} | ||
|
||
var server = 'nine.buildbot.net'; | ||
|
||
var queries = ['builds', 'changes', 'buildsets', 'workers', 'changesources', 'masters', 'sourcestamps', 'schedulers', 'forceschedulers'] | ||
|
||
queries.forEach( query => { | ||
var request = require('request'); | ||
var limit = 2; | ||
var url = 'http://'+server+'/api/v2/'+query+'?limit='+limit; | ||
var requestComplete = false; | ||
request(url, function (error, response, body) { | ||
if ( error != null ) { console.log('error:', error); } | ||
if ( response.statusCode != 200 ) { console.log('statusCode:', response && response.statusCode); } | ||
parseResponse(query, body); | ||
requestComplete = true; | ||
}); | ||
} ); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
|
||
// This is generated from Buildbot's JSON data using json2ts | ||
// (the GenerateTypings.ts script in the scripts directory is a wrapper for json2ts which requests | ||
// a bunch of buildbot JSON API url's and calls json2ts on them to output Typescript interface | ||
// definitions) | ||
|
||
export interface Property {} | ||
|
||
export interface Build { | ||
builderid: number; | ||
buildid: number; | ||
buildrequestid: number; | ||
complete: boolean; | ||
complete_at: number; | ||
masterid: number; | ||
number: number; | ||
properties: Property; | ||
results: number; | ||
started_at: number; | ||
state_string: string; | ||
workerid: number; | ||
} | ||
|
||
export interface Field { | ||
default: string; | ||
fullName: string; | ||
hide: boolean; | ||
label: string; | ||
maxsize?: any; | ||
multiple: boolean; | ||
name: string; | ||
need_email: boolean; | ||
regex?: any; | ||
required: boolean; | ||
size: number; | ||
tablabel: string; | ||
type: string; | ||
} | ||
|
||
export interface All_field { | ||
columns: number; | ||
default: string; | ||
fields: Field[]; | ||
fullName?: any; | ||
hide: boolean; | ||
label: string; | ||
layout: string; | ||
maxsize?: any; | ||
multiple: boolean; | ||
name: string; | ||
regex?: any; | ||
required: boolean; | ||
tablabel: string; | ||
type: string; | ||
} | ||
|
||
export interface Forcescheduler { | ||
all_fields: All_field[]; | ||
builder_names: string[]; | ||
button_name: string; | ||
enabled: boolean; | ||
label: string; | ||
name: string; | ||
} | ||
|
||
|
||
export interface Configured_on { | ||
builderid: number; | ||
masterid: number; | ||
} | ||
|
||
export interface Workerinfo { | ||
access_uri?: any; | ||
admin?: any; | ||
host?: any; | ||
version: string; | ||
} | ||
|
||
export interface Worker { | ||
configured_on: Configured_on[]; | ||
connected_to: any[]; | ||
graceful: boolean; | ||
name: string; | ||
paused: boolean; | ||
workerid: number; | ||
workerinfo: Workerinfo; | ||
} | ||
|
||
export interface Master { | ||
active: boolean; | ||
last_active: number; | ||
masterid: number; | ||
name: string; | ||
} | ||
|
||
export interface Sourcestamp { | ||
branch: string; | ||
codebase: string; | ||
created_at: number; | ||
patch?: any; | ||
project: string; | ||
repository: string; | ||
revision: string; | ||
ssid: number; | ||
} | ||
|
||
export interface Buildset { | ||
bsid: number; | ||
complete: boolean; | ||
complete_at: number; | ||
external_idstring?: any; | ||
parent_buildid?: any; | ||
parent_relationship?: any; | ||
reason: string; | ||
results: number; | ||
sourcestamps: Sourcestamp[]; | ||
submitted_at: number; | ||
} | ||
|
||
export interface Scheduler { | ||
enabled: boolean; | ||
master: Master; | ||
name: string; | ||
schedulerid: number; | ||
} | ||
|
||
export interface Property { | ||
event: string[]; | ||
github_distinct: any[]; | ||
} | ||
|
||
export interface Change { | ||
author: string; | ||
branch: string; | ||
category?: any; | ||
changeid: number; | ||
codebase: string; | ||
comments: string; | ||
files: string[]; | ||
parent_changeids: number[]; | ||
project: string; | ||
properties: Property; | ||
repository: string; | ||
revision: string; | ||
revlink: string; | ||
sourcestamp: Sourcestamp; | ||
when_timestamp: number; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters