Skip to content

Commit

Permalink
add source import endpoints (#380)
Browse files Browse the repository at this point in the history
resolves #362
  • Loading branch information
kaizensoze committed Jun 26, 2016
1 parent 4e79fb5 commit 1f68401
Show file tree
Hide file tree
Showing 3 changed files with 383 additions and 0 deletions.
105 changes: 105 additions & 0 deletions doc/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,18 @@ github.issues.updateLabel({ ... });
github.issues.updateMilestone({ ... });
*/

/**
* @api {delete} /repos/:user/:repo/import cancelImport
* @apiName cancelImport
* @apiDescription Cancel an import. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiExample {js} ex:
github.migrations.cancelImport({ ... });
*/

/**
* @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive
* @apiName deleteMigrationArchive
Expand All @@ -1650,6 +1662,43 @@ github.issues.updateMilestone({ ... });
github.migrations.deleteMigrationArchive({ ... });
*/

/**
* @api {get} /repos/:user/:repo/import/authors getImportCommitAuthors
* @apiName getImportCommitAuthors
* @apiDescription Get import commit authors. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiParam {String} [since] Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step.
* @apiExample {js} ex:
github.migrations.getImportCommitAuthors({ ... });
*/

/**
* @api {get} /repos/:user/:repo/import getImportProgress
* @apiName getImportProgress
* @apiDescription Get import progress. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiExample {js} ex:
github.migrations.getImportProgress({ ... });
*/

/**
* @api {get} /:user/:name/import/large_files getLargeImportFiles
* @apiName getLargeImportFiles
* @apiDescription List files larger than 100MB found during the import. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} name
* @apiExample {js} ex:
github.migrations.getLargeImportFiles({ ... });
*/

/**
* @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink
* @apiName getMigrationArchiveLink
Expand Down Expand Up @@ -1687,6 +1736,50 @@ github.migrations.getMigrationStatus({ ... });
github.migrations.getMigrations({ ... });
*/

/**
* @api {patch} /repos/:user/:repo/import/authors/:author_id mapImportCommitAuthor
* @apiName mapImportCommitAuthor
* @apiDescription Map a commit author. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiParam {String} author_id The commit author id.
* @apiParam {String} [email] The new Git author email.
* @apiParam {String} [name] The new Git author name.
* @apiExample {js} ex:
github.migrations.mapImportCommitAuthor({ ... });
*/

/**
* @api {patch} /:user/:name/import/lfs setImportLfsPreference
* @apiName setImportLfsPreference
* @apiDescription Set import LFS preference. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} name
* @apiExample {js} ex:
github.migrations.setImportLfsPreference({ ... });
*/

/**
* @api {put} /repos/:user/:repo/import startImport
* @apiName startImport
* @apiDescription Start an import. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiParam {String} vcs_url The URL of the originating repository.
* @apiParam {String} [vcs] The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response.
* @apiParam {String} [vcs_username] If authentication is required, the username to provide to vcs_url.
* @apiParam {String} [vcs_password] If authentication is required, the password to provide to vcs_url.
* @apiParam {String} [tfvc_project] For a tfvc import, the name of the project that is being imported.
* @apiExample {js} ex:
github.migrations.startImport({ ... });
*/

/**
* @api {post} /orgs/:org/migrations startMigration
* @apiName startMigration
Expand Down Expand Up @@ -1714,6 +1807,18 @@ github.migrations.startMigration({ ... });
github.migrations.unlockRepoLockedForMigration({ ... });
*/

/**
* @api {patch} /repos/:user/:repo/import updateImport
* @apiName updateImport
* @apiDescription Update existing import. (In preview period. See README.)
* @apiGroup migrations
*
* @apiParam {String} user
* @apiParam {String} repo
* @apiExample {js} ex:
github.migrations.updateImport({ ... });
*/

/**
* @api {get} /emojis getEmojis
* @apiName getEmojis
Expand Down
157 changes: 157 additions & 0 deletions lib/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,163 @@
"$repo": null
},
"description": "Unlock a repository that was locked for migration."
},

"start-import": {
"url": "/repos/:user/:repo/import",
"method": "PUT",
"params": {
"$user": null,
"$repo": null,
"vcs_url": {
"type": "String",
"required": true,
"validation": "",
"invalidmsg": "",
"description": "The URL of the originating repository."
},
"vcs": {
"type": "String",
"required": false,
"validation": "^(subversion|git|mercurial|tfvc)$",
"invalidmsg": "subversion, git, mercurial, tfvc",
"description": "The originating VCS type. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response."
},
"vcs_username": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "If authentication is required, the username to provide to vcs_url."
},
"vcs_password": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "If authentication is required, the password to provide to vcs_url."
},
"tfvc_project": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "For a tfvc import, the name of the project that is being imported."
}
},
"description": "Start an import. (In preview period. See README.)"
},

"get-import-progress": {
"url": "/repos/:user/:repo/import",
"method": "GET",
"params": {
"$user": null,
"$repo": null
},
"description": "Get import progress. (In preview period. See README.)"
},

"update-import": {
"url": "/repos/:user/:repo/import",
"method": "PATCH",
"params": {
"$user": null,
"$repo": null
},
"vcs_username": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "The username to provide to the originating repository."
},
"vcs_password": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "The password to provide to the originating repository."
},
"description": "Update existing import. (In preview period. See README.)"
},

"get-import-commit-authors": {
"url": "/repos/:user/:repo/import/authors",
"method": "GET",
"params": {
"$user": null,
"$repo": null,
"since": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "Only authors found after this id are returned. Provide the highest author ID you've seen so far. New authors may be added to the list at any point while the importer is performing the raw step."
}
},
"description": "Get import commit authors. (In preview period. See README.)"
},

"map-import-commit-author": {
"url": "/repos/:user/:repo/import/authors/:author_id",
"method": "PATCH",
"params": {
"$user": null,
"$repo": null,
"author_id": {
"type": "String",
"required": true,
"validation": "",
"invalidmsg": "",
"description": "The commit author id."
},
"email": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "The new Git author email."
},
"name": {
"type": "String",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "The new Git author name."
}
},
"description": "Map a commit author. (In preview period. See README.)"
},

"set-import-lfs-preference": {
"url": "/:user/:name/import/lfs",
"method": "PATCH",
"params": {
"$user": null,
"$name": null
},
"description": "Set import LFS preference. (In preview period. See README.)"
},

"get-large-import-files": {
"url": "/:user/:name/import/large_files",
"method": "GET",
"params": {
"$user": null,
"$name": null
},
"description": "List files larger than 100MB found during the import. (In preview period. See README.)"
},

"cancel-import": {
"url": "/repos/:user/:repo/import",
"method": "DELETE",
"params": {
"$user": null,
"$repo": null
},
"description": "Cancel an import. (In preview period. See README.)"
}
},

Expand Down

0 comments on commit 1f68401

Please sign in to comment.