会社のすべてのストレージポリシーを取得します。
id,type,name
応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。
1000
1000
返す項目の1ページあたりの最大数。
JV9IRGZmieiBasejOG9yDCRNgd2ymoZIbjsxbJMjIs3kioVii
結果が返される開始位置のマーカー。マーカーベースのページ割りを使用している場合に使用されます。
これを使用するには、usemarker
をtrue
に設定する必要があります。
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)
}
}