Skip to content

Commit

Permalink
move migration-related endpoints to separate section (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizensoze committed Jun 26, 2016
1 parent ec45fd4 commit 4e79fb5
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 248 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ github.authorization.create({

Some endpoints are in a preview period and require a custom `Accept` header. See [examples/getReactionsForIssue.js](https://github.com/mikedeboer/node-github/blob/master/examples/getReactionsForIssue.js) for an example. For updates on endpoints under preview, see https://developer.github.com/changes/.

Relatedly, the Migrations api requires an `Accept` header value of `application/vnd.github.wyandotte-preview+json`.

## Update docs/tests

When updating routes.json, you'll want to update/generate docs/tests:
Expand Down
152 changes: 76 additions & 76 deletions doc/apidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,82 @@ github.issues.updateLabel({ ... });
github.issues.updateMilestone({ ... });
*/

/**
* @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive
* @apiName deleteMigrationArchive
* @apiDescription Delete a migration archive
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.migrations.deleteMigrationArchive({ ... });
*/

/**
* @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink
* @apiName getMigrationArchiveLink
* @apiDescription Get the URL to a migration archive.
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.migrations.getMigrationArchiveLink({ ... });
*/

/**
* @api {get} /orgs/:org/migrations/:id getMigrationStatus
* @apiName getMigrationStatus
* @apiDescription Get the status of a migration
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.migrations.getMigrationStatus({ ... });
*/

/**
* @api {get} /orgs/:org/migrations getMigrations
* @apiName getMigrations
* @apiDescription Get a list of migrations
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {Number} [page] Page number of the results to fetch.
* @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30.
* @apiExample {js} ex:
github.migrations.getMigrations({ ... });
*/

/**
* @api {post} /orgs/:org/migrations startMigration
* @apiName startMigration
* @apiDescription Start a migration.
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated.
* @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false.
* @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false.
* @apiExample {js} ex:
github.migrations.startMigration({ ... });
*/

/**
* @api {delete} /orgs/:org/migrations/:id/repos/:repo/lock unlockRepoLockedForMigration
* @apiName unlockRepoLockedForMigration
* @apiDescription Unlock a repository that was locked for migration.
* @apiGroup migrations
*
* @apiParam {String} org
* @apiParam {String} id
* @apiParam {String} repo
* @apiExample {js} ex:
github.migrations.unlockRepoLockedForMigration({ ... });
*/

/**
* @api {get} /emojis getEmojis
* @apiName getEmojis
Expand Down Expand Up @@ -1877,18 +1953,6 @@ github.orgs.createTeam({ ... });
github.orgs.deleteHook({ ... });
*/

/**
* @api {delete} /orgs/:org/migrations/:id/archive deleteMigrationArchive
* @apiName deleteMigrationArchive
* @apiDescription Delete a migration archive
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.orgs.deleteMigrationArchive({ ... });
*/

/**
* @api {delete} /teams/:id deleteTeam
* @apiName deleteTeam
Expand Down Expand Up @@ -2021,43 +2085,6 @@ github.orgs.getHooks({ ... });
github.orgs.getMembers({ ... });
*/

/**
* @api {get} /orgs/:org/migrations/:id/archive getMigrationArchiveLink
* @apiName getMigrationArchiveLink
* @apiDescription Get the URL to a migration archive.
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.orgs.getMigrationArchiveLink({ ... });
*/

/**
* @api {get} /orgs/:org/migrations/:id getMigrationStatus
* @apiName getMigrationStatus
* @apiDescription Get the status of a migration
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {String} id
* @apiExample {js} ex:
github.orgs.getMigrationStatus({ ... });
*/

/**
* @api {get} /orgs/:org/migrations getMigrations
* @apiName getMigrations
* @apiDescription Get a list of migrations
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {Number} [page] Page number of the results to fetch.
* @apiParam {Number} [per_page=30] A custom page size up to 100. Default is 30.
* @apiExample {js} ex:
github.orgs.getMigrations({ ... });
*/

/**
* @api {get} /orgs/:org/memberships/:user getOrganizationMembership
* @apiName getOrganizationMembership
Expand Down Expand Up @@ -2215,33 +2242,6 @@ github.orgs.removeOrganizationMembership({ ... });
github.orgs.removeTeamMembership({ ... });
*/

/**
* @api {post} /orgs/:org/migrations startMigration
* @apiName startMigration
* @apiDescription Start a migration
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {Array} repositories A list of arrays indicating which repositories should be migrated.
* @apiParam {Boolean} [lock_repositories=false] Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false.
* @apiParam {Boolean} [exclude_attachments=false] Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false.
* @apiExample {js} ex:
github.orgs.startMigration({ ... });
*/

/**
* @api {delete} /orgs/:org/migrations/:id/repos/:repo/lock unlockRepoLockedForMigration
* @apiName unlockRepoLockedForMigration
* @apiDescription Unlock a repository that was locked for migration.
* @apiGroup orgs
*
* @apiParam {String} org
* @apiParam {String} id
* @apiParam {String} repo
* @apiExample {js} ex:
github.orgs.unlockRepoLockedForMigration({ ... });
*/

/**
* @api {patch} /orgs/:org update
* @apiName update
Expand Down
170 changes: 86 additions & 84 deletions lib/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2250,6 +2250,92 @@
}
},

"migrations": {
"start-migration": {
"url": "/orgs/:org/migrations",
"method": "POST",
"params": {
"$org": null,
"repositories": {
"type": "Array",
"required": true,
"validation": "",
"invalidmsg": "",
"description": "A list of arrays indicating which repositories should be migrated."
},
"lock_repositories": {
"type": "Boolean",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false.",
"default": "false"
},
"exclude_attachments": {
"type": "Boolean",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false.",
"default": "false"
}
},
"description": "Start a migration."
},

"get-migrations": {
"url": "/orgs/:org/migrations",
"method": "GET",
"params": {
"$org": null,
"$page": null,
"$per_page": null
},
"description": "Get a list of migrations"
},

"get-migration-status": {
"url": "/orgs/:org/migrations/:id",
"method": "GET",
"params": {
"$org": null,
"$id": null
},
"description": "Get the status of a migration"
},

"get-migration-archive-link": {
"url": "/orgs/:org/migrations/:id/archive",
"method": "GET",
"params": {
"$org": null,
"$id": null
},
"description": "Get the URL to a migration archive."
},

"delete-migration-archive": {
"url": "/orgs/:org/migrations/:id/archive",
"method": "DELETE",
"params": {
"$org": null,
"$id": null
},
"description": "Delete a migration archive"
},

"unlock-repo-locked-for-migration": {
"url": "/orgs/:org/migrations/:id/repos/:repo/lock",
"method": "DELETE",
"params": {
"$org": null,
"$id": null,
"$repo": null
},
"description": "Unlock a repository that was locked for migration."
}
},

"misc": {
"get-emojis": {
"url": "/emojis",
Expand Down Expand Up @@ -2595,90 +2681,6 @@
"description": "List your organization memberships"
},

"start-migration": {
"url": "/orgs/:org/migrations",
"method": "POST",
"params": {
"$org": null,
"repositories": {
"type": "Array",
"required": true,
"validation": "",
"invalidmsg": "",
"description": "A list of arrays indicating which repositories should be migrated."
},
"lock_repositories": {
"type": "Boolean",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default: false.",
"default": "false"
},
"exclude_attachments": {
"type": "Boolean",
"required": false,
"validation": "",
"invalidmsg": "",
"description": "Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). Default: false.",
"default": "false"
}
},
"description": "Start a migration"
},

"get-migrations": {
"url": "/orgs/:org/migrations",
"method": "GET",
"params": {
"$org": null,
"$page": null,
"$per_page": null
},
"description": "Get a list of migrations"
},

"get-migration-status": {
"url": "/orgs/:org/migrations/:id",
"method": "GET",
"params": {
"$org": null,
"$id": null
},
"description": "Get the status of a migration"
},

"get-migration-archive-link": {
"url": "/orgs/:org/migrations/:id/archive",
"method": "GET",
"params": {
"$org": null,
"$id": null
},
"description": "Get the URL to a migration archive."
},

"delete-migration-archive": {
"url": "/orgs/:org/migrations/:id/archive",
"method": "DELETE",
"params": {
"$org": null,
"$id": null
},
"description": "Delete a migration archive"
},

"unlock-repo-locked-for-migration": {
"url": "/orgs/:org/migrations/:id/repos/:repo/lock",
"method": "DELETE",
"params": {
"$org": null,
"$id": null,
"$repo": null
},
"description": "Unlock a repository that was locked for migration."
},

"get-teams": {
"url": "/orgs/:org/teams",
"method": "GET",
Expand Down

0 comments on commit 4e79fb5

Please sign in to comment.