Skip to content

Commit ad01858

Browse files
authored
Merge pull request #282 from HewlettPackard/morph-12456-storage-vol-owner-put
[MORPH-12456]: document storage volume tenant-transfer endpoint
2 parents b5dfec4 + 41cfbb0 commit ad01858

2 files changed

Lines changed: 97 additions & 28 deletions

File tree

paths/api@clusters@id@updates@updateId.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ get:
1717
- type: object
1818
properties:
1919
update:
20-
type: array
21-
items:
22-
$ref: ../components/schemas/clusterUpdateOperation.yaml
20+
$ref: ../components/schemas/clusterUpdateOperation.yaml
2321
examples:
2422
Clusters Response:
2523
value:

paths/api@storage-volumes@id.yaml

Lines changed: 96 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,33 @@ get:
2626
'5XX':
2727
$ref: ../components/responses/5xx.yaml
2828
put:
29-
summary: Updates a Storage Volume
29+
summary: Transfers Storage Volume Ownership
3030
description: |
31-
Updates a storage volume.
32-
operationId: updateStorageVolumes
31+
Transfers ownership of an **unattached** storage volume to a target tenant.
32+
33+
This operation requires the caller to be a **master-tenant** user holding the
34+
`admin-accounts` permission with **Full** access. Lacking this is the most common
35+
cause of a `403 Access Denied`.
36+
37+
The target tenant may be specified using any one of the equivalent fields
38+
`tenant.id`, `account.id`, `owner.id`, or `accountId`. The `tenant.id` form is
39+
the canonical/preferred representation.
40+
41+
Behavior and constraints:
42+
- The volume must be unattached (`status: "unattached"` and not attached to any
43+
host or instance).
44+
- The volume's backing datastore must be accessible to the target tenant.
45+
- Transferring to the volume's current tenant is a no-op and returns success.
46+
47+
Related tenant-awareness changes apply to the storage volume list
48+
(MORPH-12454) and get (MORPH-12455) endpoints.
49+
operationId: transferStorageVolumeOwnership
3350
tags:
3451
- Storage
3552
parameters:
3653
- $ref: ../components/parameters/storage-volume-id-path.yaml
3754
requestBody:
55+
required: true
3856
content:
3957
application/json:
4058
schema:
@@ -44,48 +62,101 @@ put:
4462
properties:
4563
storageVolume:
4664
type: object
65+
description: |
66+
Provide the target tenant using exactly one of the equivalent
67+
fields below. `tenant.id` is the preferred form.
4768
properties:
48-
name:
49-
type: string
50-
description: A unique name scoped to your account for the storage volume
51-
type:
52-
type: string
53-
description: Storage Type Code or ID
54-
config:
69+
tenant:
5570
type: object
56-
description: Configuration object with parameters that vary by `type`.
57-
storageServer:
71+
description: Target tenant (preferred form).
72+
properties:
73+
id:
74+
type: integer
75+
format: int64
76+
description: Target tenant ID
77+
account:
5878
type: object
59-
required:
60-
- id
79+
description: Alias for the target tenant.
6180
properties:
6281
id:
6382
type: integer
6483
format: int64
65-
storageGroup:
84+
description: Alias for target tenant ID
85+
owner:
6686
type: object
67-
required:
68-
- id
87+
description: Alias for the target tenant.
6988
properties:
7089
id:
7190
type: integer
7291
format: int64
92+
description: Alias for target tenant ID
93+
accountId:
94+
type: integer
95+
format: int64
96+
description: Alias for target tenant ID
97+
examples:
98+
Transfer to Tenant:
99+
value:
100+
storageVolume:
101+
tenant:
102+
id: 2
73103
responses:
74104
'200':
75-
description: Successful Request
105+
description: |
106+
Successful Request. Returns the updated storage volume (same schema as
107+
`GET /api/storage-volumes/{id}`), reflecting the new `account`/`owner`.
76108
content:
77109
application/json:
78110
schema:
79-
allOf:
80-
- type: object
81-
properties:
82-
storageVolume:
83-
$ref: ../components/schemas/storageVolume.yaml
84-
- $ref: ../components/schemas/200-success.yaml
111+
type: object
112+
properties:
113+
storageVolume:
114+
$ref: ../components/schemas/storageVolume.yaml
85115
examples:
86116
Storage Volume Response:
87117
value:
88-
$ref: ../components/examples/storageVolumeSuccess.json
118+
$ref: ../components/examples/storageVolume.json
119+
'400':
120+
description: |
121+
The request body did not contain a valid target tenant, or the volume
122+
cannot be transferred in its current state.
123+
content:
124+
application/json:
125+
schema:
126+
$ref: ../components/schemas/Error.yaml
127+
examples:
128+
Missing Target Tenant:
129+
value:
130+
success: false
131+
msg: A valid target tenant is required
132+
Volume Attached:
133+
value:
134+
success: false
135+
msg: Storage volume is currently attached and cannot be transferred
136+
Datastore Not Accessible:
137+
value:
138+
success: false
139+
msg: Backing datastore is not accessible to the target tenant
140+
'403':
141+
description: |
142+
The caller is not a master-tenant user with the `admin-accounts`
143+
permission at Full access.
144+
content:
145+
application/json:
146+
schema:
147+
$ref: ../components/schemas/Error.yaml
148+
example:
149+
success: false
150+
msg: Access Denied
151+
'404':
152+
description: The target tenant does not exist or is not accessible to the caller.
153+
content:
154+
application/json:
155+
schema:
156+
$ref: ../components/schemas/Error.yaml
157+
example:
158+
success: false
159+
msg: Tenant not found or insufficient access
89160
'4XX':
90161
$ref: ../components/responses/4xx.yaml
91162
'5XX':

0 commit comments

Comments
 (0)