Skip to content

samples(storagecontrol): Add anywhere cache samples #13988

Closed
nidhiii-27 wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
nidhiii-27:add-anywhere-cache-samples-storagecontrol-16032530739510550879
Closed

samples(storagecontrol): Add anywhere cache samples #13988
nidhiii-27 wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
nidhiii-27:add-anywhere-cache-samples-storagecontrol-16032530739510550879

Conversation

@nidhiii-27
Copy link
Copy Markdown
Contributor

Added the following samples:
storage_control_create_anywhere_cache
storage_control_get_anywhere_cache
storage_control_list_anywhere_caches
storage_control_update_anywhere_cache
storage_control_pause_anywhere_cache
storage_control_resume_anywhere_cache
storage_control_disable_anywhere_cache

google-labs-jules bot and others added 2 commits April 7, 2026 10:33
Generated Python SDK samples for Anywhere Cache features:
- create_anywhere_cache
- get_anywhere_cache
- list_anywhere_caches
- update_anywhere_cache
- pause_anywhere_cache
- resume_anywhere_cache
- disable_anywhere_cache

Updated storagecontrol/requirements.txt and storagecontrol/snippets_test.py.
Implemented LRO handling with .result() and mandatory commentary.
Used 2026 Google LLC copyright headers as requested.

Co-authored-by: nidhiii-27 <224584462+nidhiii-27@users.noreply.github.com>
Generated Python SDK samples for Anywhere Cache features:
- create_anywhere_cache
- get_anywhere_cache
- list_anywhere_caches
- update_anywhere_cache
- pause_anywhere_cache
- resume_anywhere_cache
- disable_anywhere_cache

Updated storagecontrol/snippets_test.py.
Implemented LRO handling with .result() and mandatory commentary.
Used 2026 Google LLC copyright headers as requested.

Co-authored-by: nidhiii-27 <224584462+nidhiii-27@users.noreply.github.com>
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Apr 7, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive set of Python snippets for managing Google Cloud Storage Anywhere Caches, including functionality for creating, disabling, retrieving, listing, pausing, resuming, and updating caches. It also adds a lifecycle test suite to verify these operations. The review feedback recommends utilizing the client library's built-in bucket_path helper method for more idiomatic and reliable resource path construction.

Comment on lines +31 to +32
project_path = storage_control_client.common_project_path("_")
bucket_path = f"{project_path}/buckets/{bucket_name}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of manually constructing the bucket path using string concatenation, use the client's built-in bucket_path helper method. This is more idiomatic and ensures the path is correctly formatted. To simplify the review process, please ensure this pull request is focused on a single change; related changes in other files should be deferred to subsequent pull requests.

Suggested change
project_path = storage_control_client.common_project_path("_")
bucket_path = f"{project_path}/buckets/{bucket_name}"
bucket_path = storage_control_client.bucket_path("_", bucket_name)
References
  1. Pull requests should be focused on a single change. It is acceptable to defer related changes in other files to subsequent pull requests.

@nidhiii-27 nidhiii-27 closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant