php-opencloud / openstack

PHP SDK for OpenStack clouds
Apache License 2.0
222 stars 152 forks source link

getVolumesAttached to server #399

Closed mshannaq closed 4 months ago

mshannaq commented 4 months ago

Hello,

is there any method to get the attached volumes into server?

for example:

compute = $openstack->computeV2();
$server = $compute->getServer(['id' => 'server-id']);

// Get attached volumes
$volumes = $server->getVolumesAttached();

or how can I see if there is any volumes attached to the server?

Thanks

k0ka commented 4 months ago

Hello,

We have corresponding examples (and tests), but it is not covered in the documentation yet

https://github.com/php-opencloud/openstack/blob/2335c75e59b5bc6817b169c63bf74d9d7f8fc04d/samples/Compute/v2/servers/list_volume_attachments.php

k0ka commented 4 months ago

https://php-openstack-sdk.readthedocs.io/en/latest/services/compute/v2/volume-attachments.html