Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commitcac7725

Browse files
committed
Merge pull request#609 from github/migration-apis
Add Migration APIs
2 parentsf2fbef1 +d7d29e4 commitcac7725

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

‎content/v3/orgs/migrations.md‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
title:Migrations | GitHub API
3+
---
4+
5+
#Migrations
6+
7+
* TOC
8+
{:toc}
9+
10+
{{#tip}}
11+
12+
To access the Migrations API, you must provide a custom[media type](/v3/media) in the`Accept` header:
13+
14+
application/vnd.github.wyandotte-preview+json
15+
16+
{{/tip}}
17+
18+
##Start a migration
19+
20+
Initiates the generation of a migration archive.
21+
22+
POST /orgs/:org/migrations
23+
24+
###Parameters
25+
26+
Name | Type | Description
27+
--------|---------|--------------
28+
`repositories` |`array` of`strings` |**Required**. A list of arrays indicating which repositories should be migrated.
29+
`lock_repositories`|`boolean` | Indicates whether repositories should be locked (to prevent manipulation) while migrating data. Default:`false`.
30+
31+
###Example
32+
33+
<%= json\
34+
:repositories =>["octocat/Hello-World"],
35+
:lock_repositories => true
36+
%>
37+
38+
###Response
39+
40+
<%= headers 201 %>
41+
<%= json(:migrations) %>
42+
43+
##Get a list of migrations
44+
45+
Lists the most recent migrations.
46+
47+
GET /orgs/:org/migrations
48+
49+
###Response
50+
51+
<%= headers 200,:pagination => default_pagination_rels %>
52+
<%= json(:migrations) { |h|[h] } %>
53+
54+
##Get the status of a migration
55+
56+
Fetches the status of a migration.
57+
58+
GET /orgs/:org/migrations/:id
59+
60+
###Response
61+
62+
The`state` of a migration can be one of the following values:
63+
64+
*`pending`, which means the migration hasn't started yet.
65+
*`exporting`, which means the migration is in progress.
66+
*`exported`, which means the migration finished successfully.
67+
*`failed`, which means the migration failed.
68+
69+
<%= headers 200 %>
70+
<%= json(:migrations) { |h| h['state'] = 'exported'; h } %>
71+
72+
##Download a migration archive
73+
74+
Fetches the URL to a migration archive.
75+
76+
GET /orgs/:org/migrations/:id/archive
77+
78+
###Response
79+
80+
<%= headers 302 %>
81+
<preclass="body-response"><code>
82+
https://s3.amazonaws.com/github-cloud/migration/79/67?response-content-disposition=filename%3D0b989ba4-242f-11e5-81e1.tar.gz&response-content-type=application/x-gzip
83+
</code></pre>
84+
85+
##Delete a migration archive
86+
87+
Deletes a previous migration archive. Migration archives are automatically deleted after seven days.
88+
89+
DELETE /orgs/:org/migrations/:id/archive
90+
91+
###Response
92+
93+
<%= headers 204 %>

‎layouts/sidebar.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ <h3><a href="#" class="js-expand-btn collapsed arrow-btn" data-proofer-ignore></
6464
<h3><ahref="#"class="js-expand-btn collapsed arrow-btn"data-proofer-ignore></a><ahref="/v3/orgs/">Organizations</a></h3>
6565
<ulclass="js-guides">
6666
<li><ahref="/v3/orgs/members/">Members</a></li>
67+
<li><ahref="/v3/orgs/migrations/">Migrations</a></li>
6768
<li><ahref="/v3/orgs/teams/">Teams</a></li>
6869
<li><ahref="/v3/orgs/hooks/">Webhooks</a></li>
6970
</ul>

‎lib/resources.rb‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,17 @@ def fetch_content(key)
883883
ACTIVE_ORG_MEMBERSHIPS ||=[ACTIVE_ADMIN_ORG_MEMBERSHIP]
884884
PENDING_ORG_MEMBERSHIPS ||=[PENDING_ADMIN_ORG_MEMBERSHIP]
885885

886+
MIGRATIONS ||={
887+
"id"=>79,
888+
"guid"=>"0b989ba4-242f-11e5-81e1-c7b6966d2516",
889+
"state"=>"pending",
890+
"lock_repositories"=>true,
891+
"url"=>"https://api.github.com/orgs/octo-org/migrations/79",
892+
"created_at"=>"2015-07-06T15:33:38-07:00",
893+
"updated_at"=>"2015-07-06T15:33:38-07:00",
894+
"repositories"=>[REPO]
895+
}
896+
886897
LABEL ||={
887898
"url"=>"https://api.github.com/repos/octocat/Hello-World/labels/bug",
888899
"name"=>"bug",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp