This page describes how to determine the storage layout of your bucket. Storage
layout refers to how objects are organized within a bucket, either in a flat
namespace or a hierarchical namespace. The layout is important for
applications that interact with the bucket, as object access and manipulation
methods vary depending on the layout. Storage layout also includes information
about the bucket's location.
By using the getStorageLayout API, your application can adapt its
behavior based on whether a bucket uses hierarchical namespace or not, ensuring
optimal compatibility and leveraging the appropriate features based on the
bucket configuration.
Roles required
In order to get the required permissions for getting the storage layout of a Cloud Storage bucket , ask your administrator to grant you the Storage Object User (roles/storage.objectUser) role on the bucket.
The role contains the storage.objects.list permission, which is
required to get the storage layout of the bucket.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[],[]]