Skip to content

Commit

Permalink
add enterprise search indexing endpoint (#381)
Browse files Browse the repository at this point in the history
resolves #375
  • Loading branch information
kaizensoze committed Jun 26, 2016
1 parent 1f68401 commit cf76302
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,17 @@ github.enterprise.createOrg({ ... });
github.enterprise.getLicense({ ... });
*/

/**
* @api {post} /staff/indexing_jobs queueIndexingJob
* @apiName queueIndexingJob
* @apiDescription Queue an indexing job
* @apiGroup enterprise
*
* @apiParam {String} target A string representing the item to index.
* @apiExample {js} ex:
github.enterprise.queueIndexingJob({ ... });
*/

/**
* @api {get} /enterprise/stats/:type stats
* @apiName stats
Expand Down
15 changes: 15 additions & 0 deletions lib/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5737,6 +5737,21 @@
"params": {},
"description": "Get license information"
},

"queue-indexing-job": {
"url": "/staff/indexing_jobs",
"method": "POST",
"params": {
"target": {
"type": "String",
"required": true,
"validation": "",
"invalidmsg": "",
"description": "A string representing the item to index."
}
},
"description": "Queue an indexing job"
},

"create-org": {
"url": "/admin/organizations",
Expand Down
13 changes: 13 additions & 0 deletions test/enterpriseTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ describe("[enterprise]", function() {
);
});

it("should successfully execute POST /staff/indexing_jobs (queueIndexingJob)", function(next) {
client.enterprise.queueIndexingJob(
{
target: "String"
},
function(err, res) {
Assert.equal(err, null);
// other assertions go here
next();
}
);
});

it("should successfully execute GET /enterprise/stats/:type (stats)", function(next) {
client.enterprise.stats(
{
Expand Down

0 comments on commit cf76302

Please sign in to comment.