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 -X GET https://api.box.com/2.0/storage_policies \
-H 'Authorization: Bearer <ACCESS_TOKEN>'
BoxCollectionMarkerBased<BoxStoragePolicy> policies = await client.StoragePoliciesManager
.GetListStoragePoliciesAsync();
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('The storage policy id is {0} and name is {1}'.format(storage_policy.id, storage_policy.name)))
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' } ] }
*/
});
client.storagePolicies.list() { results in
switch results {
case let .success(iterator):
for i in 1 ... 10 {
iterator.next { result in
switch result {
case let .success(policy):
print("Storage policy \(policy.id)")
case let .failure(error):
print(error)
}
}
}
case let .failure(error):
print(error)
}
}