Retrieve Details of all Storage Attachments in a Container
/storage/attachment/{container}/
?parameter1=value1&parameter2=value2&parameterN=valueN
Required Role: To complete this task, you must have the Compute_Monitor
or Compute_Operations
role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.
Request
- application/oracle-compute-v3+json
-
container: string
/Compute-identity_domain/user
or/Compute-identity_domain
-
instance_name(optional): string
Multipart name of an instance.
-
name(optional): string
Multipart name of the object.
-
state(optional): string
Specify one of the following states of the storage attachment:
attaching
: The storage attachment is in the process of attaching to the instance.attached
: The storage attachment is attached to the instance.detaching
: The storage attachment is in the process of detaching from the instance.unavailable
: The storage attachment is unavailable.unknown
: The state of the storage attachment is not known. -
storage_volume_name(optional): string
Three part name (
/Compute-identity_domain/user/object_name
) of a storage volume.
-
Cookie: string
The Cookie: header must be included with every request to the service. It must be set to the value of the set-cookie header in the response received to the POST /authenticate/ call.
Response
- application/oracle-compute-v3+json
200 Response
-
set-cookie: string
The cookie value is returned if the session is extended
object
-
account(optional):
string
Shows the default account for your identity domain.
-
hypervisor(optional):
string
Hypervisor type to which this volume was attached to.
-
index(optional):
integer
Index number for the volume. The allowed range is 1-10. The index determines the device name by which the volume is exposed to the instance. Index 0 is allocated to the temporary boot disk, /dev/xvda. An attachment with index 1 is exposed to the instance as /dev/xvdb, an attachment with index 2 is exposed as /dev/xvdc, and so on.
-
instance_name(optional):
string
Multipart name of the instance attached to the storage volume.
-
name(optional):
string
Name of this attachment, generated by the server.
-
readonly(optional):
boolean
When set to
true
, it indicates that the volume is a read-only storage volume. -
state(optional):
string
Specify one of the following states of the storage attachment:
attaching
: The storage attachment is in the process of attaching to the instance.attached
: The storage attachment is attached to the instance.detaching
: The storage attachment is in the process of detaching from the instance.unavailable
: The storage attachment is unavailable.unknown
: The state of the storage attachment is not known. -
storage_volume_name(optional):
string
Three part name (
/Compute-identity_domain/user/object_name
) of the storage volume that is attached to the instance. -
uri(optional):
string
Uniform Resource Identifier
Examples
cURL Command
The following example shows how to retrieve details about all storage attachments in the /Compute-acme/jack.jones@example.com/
container by submitting a GET
request on the REST resource using cURL. For more information about cURL, see Use cURL.
Enter the command on a single line. Line breaks are used in this example for readability.
curl -X GET -H "Cookie: $COMPUTE_COOKIE" -H "Accept: application/oracle-compute-v3+json" https://api-z999.compute.us0.oraclecloud.com/storage/attachment/Compute-acme/jack.jones@example.com/
-
COMPUTE_COOKIE
is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication. -
api-z999.compute.us0.oraclecloud.com
is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests. -
acme
andjack.jones@example.com
are example values. Replaceacme
with the identity domain ID of your Compute Classic account, andjack.jones@example.com
with your user name.
Example of Response Body
The following example shows the response body in JSON format.
Some lines may be truncated with ellipses (...) for readability.
{ "result": [ { "index": 5, "account": null, "storage_volume_name": "/Compute-acme/jack.jones@example.com/data", "hypervisor": null, "uri": "https://api-z999.compute.us0.oraclecloud.com/storage/attachment/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d/10bf639f-bb78-462a-b5ac-eeb0474771a0", "instance_name": "/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d", "state": "attached", "readonly": false, "name": "/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d/10bf639f-bb78-462a..." }, { "index": 1, "account": null, "storage_volume_name": "/Compute-acme/jack.jones@example.com/boot", "hypervisor": null, "uri": "https://api-z999.compute.us0.oraclecloud.com/storage/attachment/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d/4aa33097-b085-4484-a909-a6a0a5955c05", "instance_name": "/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d", "state": "attached", "readonly": false, "name": "/Compute-acme/jack.jones@example.com/01fa297e-e7e1-4501-84d3-402ccc33e66d/4aa33097-b085-4484..." } ] }