Add support for resource lock#624
Merged
zliang-akamai merged 15 commits intolinode:devfrom Jan 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for resource lock functionality to the Linode API client, enabling users to prevent deletion or modification of resources (currently Linode instances).
Key Changes:
- Introduced
LockandLockEntitydata models with support for two lock types:cannot_deleteandcannot_delete_with_subresources - Added
LockGroupwith methods to list, create, and delete resource locks - Integrated lock support into the
LinodeClientand added alocksproperty to Linode instances
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| linode_api4/objects/lock.py | Defines Lock, LockEntity, and LockType models for representing resource locks |
| linode_api4/groups/lock.py | Implements LockGroup with create and list operations for resource locks |
| linode_api4/objects/init.py | Exports lock-related classes for public API access |
| linode_api4/groups/init.py | Exports LockGroup for public API access |
| linode_api4/linode_client.py | Integrates LockGroup into LinodeClient |
| linode_api4/objects/linode.py | Adds locks property to Instance model |
| test/unit/objects/lock_test.py | Unit tests for Lock object methods (get, delete) |
| test/unit/groups/lock_test.py | Unit tests for LockGroup methods (list, create with variations) |
| test/integration/models/lock/test_lock.py | End-to-end integration tests for lock functionality |
| test/integration/models/lock/init.py | Package initialization for lock integration tests |
| test/fixtures/locks_1.json | Mock response fixture for single lock retrieval |
| test/fixtures/locks.json | Mock response fixture for listing multiple locks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
17b9b45 to
ef5066f
Compare
lgarber-akamai
approved these changes
Jan 8, 2026
Contributor
lgarber-akamai
left a comment
There was a problem hiding this comment.
Looks good and tests are passing on my end. Nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add support for resource lock API changes.
✔️ How to Test