mirror of
https://github.com/minio/minio.git
synced 2025-11-10 14:09:48 -05:00
Change query param name to duration in list/clear locks API (#3664)
Following is a sample list lock API request schematic, /?lock&bucket=mybucket&prefix=myprefix&duration=holdDuration x-minio-operation: list The response would contain the list of locks held on mybucket matching myprefix for a duration longer than holdDuration.
This commit is contained in:
committed by
Harshavardhana
parent
6a6c930f5b
commit
0472e5c1e1
@@ -120,8 +120,8 @@ If successful restarts the running minio service, for distributed setup restarts
|
||||
|
||||
```
|
||||
<a name="ListLocks"></a>
|
||||
### ListLocks(bucket, prefix string, olderThan time.Duration) ([]VolumeLockInfo, error)
|
||||
If successful returns information on the list of locks held on ``bucket`` matching ``prefix`` older than ``olderThan`` seconds.
|
||||
### ListLocks(bucket, prefix string, duration time.Duration) ([]VolumeLockInfo, error)
|
||||
If successful returns information on the list of locks held on ``bucket`` matching ``prefix`` for longer than ``duration`` seconds.
|
||||
|
||||
__Example__
|
||||
|
||||
@@ -135,8 +135,8 @@ __Example__
|
||||
```
|
||||
|
||||
<a name="ClearLocks"></a>
|
||||
### ClearLocks(bucket, prefix string, olderThan time.Duration) ([]VolumeLockInfo, error)
|
||||
If successful returns information on the list of locks cleared on ``bucket`` matching ``prefix`` older than ``olderThan`` seconds.
|
||||
### ClearLocks(bucket, prefix string, duration time.Duration) ([]VolumeLockInfo, error)
|
||||
If successful returns information on the list of locks cleared on ``bucket`` matching ``prefix`` for longer than ``duration`` seconds.
|
||||
|
||||
__Example__
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ func main() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// Clear locks held on mybucket/myprefix older than olderThan seconds.
|
||||
// Clear locks held on mybucket/myprefix for longer than 30s.
|
||||
olderThan := time.Duration(30 * time.Second)
|
||||
locksCleared, err := madmClnt.ClearLocks("mybucket", "myprefix", olderThan)
|
||||
if err != nil {
|
||||
|
||||
@@ -37,7 +37,7 @@ func main() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// List locks held on mybucket/myprefix older than 30s.
|
||||
// List locks held on mybucket/myprefix for longer than 30s.
|
||||
locksHeld, err := madmClnt.ListLocks("mybucket", "myprefix", time.Duration(30*time.Second))
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
|
||||
Reference in New Issue
Block a user