digitalocean / digitalocean/pydo

Filter snapshots by prefix name not working properly

Open
#441 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
140
Forks
68
Avg merge
9h 52m
Merged PRs (30d)
7

Description

Hell, I'm trying to use the filter snapshots by prefix and it's not working. Can you please support it?

```python
In [1]: client.snapshots.list(params={"name": "my-machine-sa6bnprz"})
Out[1]:
{'snapshots': [{'id': '184246254',
'name': 'my-machine-sa6bnprz',
'regions': ['nyc1'],
'created_at': '2025-04-15T08:30:45Z',
'resource_id': '489468876',
'resource_type': 'droplet',
'min_disk_size': 80,
'size_gigabytes': 2.46,
'tags': []}],
'links': {},
'meta': {'total': 1}}

# Getting empty results when the `name` is not exact same.
In [2]: client.snapshots.list(params={"name": "my-machine"})
Out[2]: {'snapshots': [], 'links': {}, 'meta': {'total': 0}}

In [3]: client.snapshots.list(params={"name": "my-machine-*"})
Out[3]: {'snapshots': [], 'links': {}, 'meta': {'total': 0}}

In [4]: client.snapshots.list(params={"name": "my-machine-"})
Out[4]: {'snapshots': [], 'links': {}, 'meta': {'total': 0}}
```

Right now, I'm using `pydo==0.9.2`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.