Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List storages by type #87

Open
fabioDMFerreira opened this issue Feb 2, 2021 · 1 comment
Open

List storages by type #87

fabioDMFerreira opened this issue Feb 2, 2021 · 1 comment

Comments

@fabioDMFerreira
Copy link

fabioDMFerreira commented Feb 2, 2021

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.

response, err := s.basicGetRequest(r.RequestURL())

https://developers.upcloud.com/1.3/9-storages/#list-storages

I don't mind to open a PR if nobody is working on this.

@peknur
Copy link
Contributor

peknur commented Jan 20, 2022

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,
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants