Skip to content

Commit ae75944

Browse files
committed
Add documentation for accepting image account transfers
1 parent 665cb21 commit ae75944

4 files changed

Lines changed: 99 additions & 2 deletions

File tree

specification/DigitalOcean-public.v2.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,14 +1409,18 @@ paths:
14091409
post:
14101410
$ref: "resources/images/images_post_account_transfer_create.yml"
14111411

1412-
/v2/images/{image_id}/account_transfer/decline:
1412+
/v2/images/{image_id}/account_transfer/accept:
14131413
post:
1414-
$ref: "resources/images/images_post_account_transfer_decline.yml"
1414+
$ref: "resources/images/images_post_account_transfer_accept.yml"
14151415

14161416
/v2/images/{image_id}/account_transfer/cancel:
14171417
post:
14181418
$ref: "resources/images/images_post_account_transfer_cancel.yml"
14191419

1420+
/v2/images/{image_id}/account_transfer/decline:
1421+
post:
1422+
$ref: "resources/images/images_post_account_transfer_decline.yml"
1423+
14201424
/v2/images/{image_id}/actions:
14211425
get:
14221426
$ref: "resources/images/imageActions_list.yml"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
lang: cURL
2+
source: |-
3+
curl -X POST \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
-d '{"transfer_id": 3164444, "recipient_uuid": "4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf"}' \
7+
"https://api.digitalocean.com/v2/images/9375231/account_transfer/accept"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
operationId: images_post_account_transfer_accept
2+
3+
summary: Accept an Image Account Transfer
4+
5+
description: |
6+
To accept an account transfer for an image, send a POST request to
7+
`/v2/images/$IMAGE_ID/account_transfer/accept`.
8+
9+
Only snapshot images may be transferred by this endpoint to another account.
10+
11+
An image account transfer always has exactly one recipient, specified in the request body.
12+
The recipient can be one of the following:
13+
14+
* A DigitalOcean account, denoted by `recipient_email` in the request body.
15+
The recipient will receive an email with instructions to accept the transfer.
16+
Once the recipient accepts the transfer, the image will be moved to their
17+
account.
18+
19+
* A DigitalOcean team, denoted by `recipient_uuid` in the request body. If the
20+
user has sufficient permissions in the recipient team, the transfer will be
21+
automatically accepted and the image will be moved to the recipient team's
22+
account. Otherwise, the transfer will be pending until a user with sufficient
23+
permissions in the recipient team accepts the transfer.
24+
tags:
25+
- Images
26+
27+
parameters:
28+
- $ref: 'parameters.yml#/image_id'
29+
30+
requestBody:
31+
required: true
32+
33+
content:
34+
application/json:
35+
schema:
36+
$ref: 'models/images_post_account_transfer_accept.yml'
37+
38+
responses:
39+
'201':
40+
$ref: '../../shared/responses/no_content.yml'
41+
42+
'400':
43+
$ref: '../../shared/responses/bad_request.yml'
44+
45+
'401':
46+
$ref: '../../shared/responses/unauthorized.yml'
47+
48+
'404':
49+
$ref: '../../shared/responses/not_found.yml'
50+
51+
'429':
52+
$ref: '../../shared/responses/too_many_requests.yml'
53+
54+
'500':
55+
$ref: '../../shared/responses/server_error.yml'
56+
57+
default:
58+
$ref: '../../shared/responses/unexpected_error.yml'
59+
60+
x-codeSamples:
61+
- $ref: 'examples/curl/images_post_account_transfer_accept.yml'
62+
63+
security:
64+
- bearer_auth:
65+
- 'image:create'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allOf:
2+
- title: Transfer ID
3+
type: object
4+
properties:
5+
transfer_id:
6+
type: integer
7+
description: >-
8+
A unique number that used to identify and reference an image account transfer.
9+
example: 3164444
10+
required:
11+
- transfer_id
12+
13+
- title: Recipient Team UUID
14+
type: object
15+
properties:
16+
recipient_uuid:
17+
type: string
18+
description: The UUID of the team that the image will be transferred to.
19+
example: 4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf
20+
required:
21+
- recipient_uuid

0 commit comments

Comments
 (0)