Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the addition of instance-specific capability constants.
No open issues 🎉
What changed in this PR
Adds InstanceCapability to the SDK, providing named constants for instance capabilities while preserving plain-string responses. Region capabilities remain covered by the existing Capability enum.
Changes:
- Defines four instance capability values in a new
StrEnum. - Adds fixture data and unit assertions for capability membership.
- Updates the block storage encryption integration test to use the instance-specific enum.
| File | Description |
|---|---|
test/unit/objects/linode_test.py |
Checks enum membership against instance capability strings. |
test/integration/models/linode/test_linode.py |
Uses InstanceCapability for the encryption assertion. |
test/fixtures/linode_instances.json |
Adds sample instance capabilities. |
linode_api4/objects/linode.py |
Defines the InstanceCapability enum. |
Review effort: Balanced
| blockstorage_encryption = "Block Storage Encryption" | ||
| blockstorage_perf_b1 = "Block Storage Performance B1" | ||
| maintenance_policy = "Maintenance Policy" | ||
| smtp_enabled = "SMTP Enabled" |
There was a problem hiding this comment.
Hmm, I'm wondering if it's really necessary to extract Linode's capabilities into a separate object (and then maintain both), especially that the values here seem to be the same as in the Capability class
There was a problem hiding this comment.
The current Capability class belongs to regions and reusing Capability for instances would suggest values that an instance doesn't have. Also account/region/instance could potentially have different sets of capabilities 🤔
📝 Description
Adds an
InstanceCapabilityenum for the values returned inInstance.capabilities(
Block Storage Encryption,Block Storage Performance B1,Maintenance Policy,SMTP Enabled).Region capabilities are already covered by the existing
Capabilityenum (#644), so no changes were needed there.Instance.capabilitiesstill returns plain strings, so this change is not breaking.✔️ How to Test