Update documentation for Accounting API (#9909)

This commit is contained in:
Anis Elleuch 2020-06-30 16:34:08 +01:00 committed by GitHub
parent 91817d0d1a
commit 90f36c1389
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 7 deletions

View file

@ -43,11 +43,11 @@ func main() {
```
| Service operations | Info operations | Healing operations | Config operations |
|:------------------------------------|:------------------------------|:-------------------|:--------------------------|
| [`ServiceTrace`](#ServiceTrace) | [`ServerInfo`](#ServerInfo) | [`Heal`](#Heal) | [`GetConfig`](#GetConfig) |
| [`ServiceStop`](#ServiceStop) | [`StorageInfo`](#StorageInfo) | | [`SetConfig`](#SetConfig) |
| [`ServiceRestart`](#ServiceRestart) | | | |
| Service operations | Info operations | Healing operations | Config operations |
|:------------------------------------|:-----------------------------------------|:-------------------|:--------------------------|
| [`ServiceTrace`](#ServiceTrace) | [`ServerInfo`](#ServerInfo) | [`Heal`](#Heal) | [`GetConfig`](#GetConfig) |
| [`ServiceStop`](#ServiceStop) | [`StorageInfo`](#StorageInfo) | | [`SetConfig`](#SetConfig) |
| [`ServiceRestart`](#ServiceRestart) | [`AccountUsageInfo`](#AccountUsageInfo) | | |
@ -251,6 +251,47 @@ __Example__
```
<a name="AccountUsageInfo"></a>
### AccountUsageInfo(ctx context.Context) (AccountUsageInfo, error)
Fetches accounting usage information for the current authenticated user
| Param | Type | Description |
|--------------------------------|----------------------|-------------------------|
| `AccountUsageInfo.AccountName` | _string_ | Account name. |
| `AccountUsageInfo.Buckets` | _[]BucketUsageInfo_ | Bucket usage info. |
| Param | Type | Description |
|----------------------------|-----------------|-----------------------------------------|
| `BucketUsageInfo.Name` | _string_ | The name of the current bucket
| `BucketUsageInfo.Size` | _uint64_ | The total size of the current bucket
| `BucketUsageInfo.Created` | _time.Time_ | Bucket creation time
| `BucketUsageInfo.Access` | _AccountAccess_ | Type of access of the current account
| Param | Type | Description |
|------------------------|---------|------------------------------------------------------------------|
| `AccountAccess.Read` | _bool_ | Indicate if the bucket is readable by the current account name. |
| `AccountAccess.Write` | _bool_ | Indocate if the bucket is writable by the current account name. |
__Example__
```go
accountUsageInfo, err := madmClnt.AccountUsageInfo(context.Background())
if err != nil {
log.Fatalln(err)
}
log.Println(accountUsageInfo)
```
## 5. Heal operations
<a name="Heal"></a>

View file

@ -37,10 +37,10 @@ func main() {
log.Fatalln(err)
}
accountingUsageInfo, err := madmClnt.AccountingUsageInfo(context.Background())
accountUsageInfo, err := madmClnt.AccountUsageInfo(context.Background())
if err != nil {
log.Fatalln(err)
}
log.Println(accountingUsageInfo)
log.Println(accountUsageInfo)
}