From bdeeab56253f22367f1f13a406fba9671ddbf357 Mon Sep 17 00:00:00 2001 From: Teoh Han Hui Date: Thu, 24 May 2018 16:38:03 +0200 Subject: [PATCH] Add docs on how to retrieve account details --- doc/services/object-store/v1/account.rst | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/services/object-store/v1/account.rst b/doc/services/object-store/v1/account.rst index fe59788e..db232ba7 100644 --- a/doc/services/object-store/v1/account.rst +++ b/doc/services/object-store/v1/account.rst @@ -9,6 +9,21 @@ To work with an Object Store account, you must first retrieve an account object .. sample:: object_store/v1/account/get.php .. refdoc:: OpenStack/ObjectStore/v1/Service.html#method_getAccount +At this point, the object returned is *empty* because we did not execute a HTTP request to receive the state of the +account from the API. This is in accordance with one of the SDK's general policies of not assuming too much at the +expense of performance. + +To synchronize the local object's state with the remote API, you can run: + +.. code-block:: php + + $account->retrieve(); + + printf("Account has %d objects and %d bytes in %d containers", + $account->objectCount, $account->bytesUsed, $account->containerCount); + +and all of the local properties will match those of the remote resource. + Get account metadata -------------------- @@ -76,4 +91,4 @@ the metadata of the account will now be: To reset metadata, you must run: .. sample:: object_store/v1/account/merge_metadata.php -.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_mergeMetadata \ No newline at end of file +.. refdoc:: OpenStack/ObjectStore/v1/Models/Account.html#method_mergeMetadata