Fetches all the storage policies in the enterprise.
id,type,name
A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.
Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.
1000
1000
The maximum number of items to return per page.
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination.
This requires usemarker
to be set to true
.
Returns a collection of storage policies.
An unexpected client error.
curl -i -X GET "https://api.box.com/2.0/storage_policies" \
-H "authorization: Bearer <ACCESS_TOKEN>"
await client.storagePolicies.getStoragePolicies();
client.storage_policies.get_storage_policies()
await client.StoragePolicies.GetStoragePoliciesAsync();
Iterable<BoxStoragePolicy.Info> storagePolicies = BoxStoragePolicy.getAll(api);
for (BoxStoragePolicy.Info storagePolicyInfo : storagePolicies) {
//Do something with the storage policy.
}
storage_policies = client.get_storage_policies(limit=100)
for storage_policy in storage_policies:
print(f'The storage policy id is {storage_policy.id} and name is {storage_policy.name}')
BoxCollectionMarkerBased<BoxStoragePolicy> policies = await client.StoragePoliciesManager
.GetListStoragePoliciesAsync();
client.storagePolicies.getAll()
.then(policies => {
/* policies -> {
next_marker: null,
limit: 1000,
entries:
[ { type: 'storage_policy', id: '42', name: 'Montreal / Dublin' },
{ type: 'storage_policy', id: '126', name: 'Frankfurt / Dublin' },
{ type: 'storage_policy', id: '162', name: 'US' } ] }
*/
});
let iterator = client.storagePolicies.listForEnterprise()
iterator.next { results in
switch results {
case let .success(page):
for policy in page.entries {
print("Storage policy \(policy.id)")
}
case let .failure(error):
print(error)
}
}
{
"entries": [
{
"id": "11446498",
"type": "storage_policy",
"name": "Montreal / Dublin"
}
],
"limit": 1000,
"next_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii",
"prev_marker": "JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVih"
}