Open fabioDMFerreira opened 3 years ago
Hi @fabioDMFerreira ,
You can filter storages by type using Type
field in request.GetStoragesRequest
.
For example list only templates:
service.GetStorages(&request.GetStoragesRequest{
Type: upcloud.StorageTypeTemplate,
})
You can use that with Access
field to get your private templates:
service.GetStorages(&request.GetStoragesRequest{
Type: upcloud.StorageTypeTemplate,
Access: upcloud.StorageAccessPrivate,
})
The list storages method seems to don't filter storages by type.
GetStorages
should read the storage type of the request and append the storage type to the URL used to get storages.https://github.com/UpCloudLtd/upcloud-go-api/blob/af59376c7bf914854e0ef3b13ad4ee9435ea2919/upcloud/service/storage.go#L41
https://developers.upcloud.com/1.3/9-storages/#list-storages
I don't mind to open a PR if nobody is working on this.