Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit bdbdf22

Browse files
committed
Manager: add legacy optional param to get_capacity
The `legacy` param will be passed directly to the underlying /capacity call. This will instruct the api to return capacity status for legacy server types (baremetal_*) and/or new *.*.$arch "class" based types. The current default is `only` which returns only the `baremetal_*`. In the not-so-distant-future the default will change to `exclude`, so only *.*.$arch types will be returned. This functionality was incorrectly merged in Feb, woops. Well at least there was no release.
1 parent f9294fc commit bdbdf22

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packet/Manager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,16 @@ def get_volume(self, volume_id):
168168
return Volume(data, self)
169169

170170
def get_capacity(self, legacy=None):
171+
"""Get capacity of all facilities.
172+
173+
:param legacy: Indicate set of server types to include in response
174+
175+
Validation of `legacy` is left to the packet api to avoid going out of date if any new value is introduced.
176+
The currently known values are:
177+
- only (current default, will be switched "soon")
178+
- include
179+
- exclude (soon to be default)
180+
"""
171181
params = None
172182
if legacy:
173183
params = {'legacy': legacy}

0 commit comments

Comments
 (0)