Sha256: 40be51b165beaed7e7bec4757f82cff7d824a0db78c0288d1e0a34d11a0a6a9a

Contents?: true

Size: 1.94 KB

Versions: 9

Compression:

Stored size: 1.94 KB

Contents

# Lock

## Example Lock Object

```
{
  "timeout": 43200,
  "depth": "infinity",
  "owner": "user",
  "path": "locked_file",
  "scope": "shared",
  "token": "17c54824e9931a4688ca032d03f6663c",
  "type": "write",
  "user_id": 1,
  "username": "username"
}
```

* `timeout` (int64): Lock timeout
* `depth` (string): Lock depth (0 or infinity)
* `owner` (string): Owner of lock.  This can be any arbitrary string.
* `path` (string): Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
* `scope` (string): Lock scope(shared or exclusive)
* `token` (string): Lock token.  Use to release lock.
* `type` (string): Lock type
* `user_id` (int64): Lock creator user ID
* `username` (string): Lock creator username


---

## List Locks by path

```
Files::Lock.list_for(path, 
  page: 1, 
  per_page: 1, 
  include_children: true
)
```

### Parameters

* `page` (int64): Current page number.
* `per_page` (int64): Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
* `path` (string): Required - Path to operate on.
* `include_children` (boolean): Include locks from children objects?


---

## Create Lock

```
Files::Lock.create(path, 
  timeout: 1
)
```

### Parameters

* `path` (string): Required - Path
* `timeout` (int64): Lock timeout length


---

## Delete Lock

```
Files::Lock.delete(path, 
  token: "token"
)
```

### Parameters

* `path` (string): Required - Path
* `token` (string): Required - Lock token


---

## Create Lock

```
lock = Files::Lock.find(1)
lock.create(
  timeout: 1
)
```

### Parameters

* `path` (string): Required - Path
* `timeout` (int64): Lock timeout length


---

## Delete Lock

```
lock = Files::Lock.find(1)
lock.delete(
  token: "token"
)
```

### Parameters

* `path` (string): Required - Path
* `token` (string): Required - Lock token

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
files.com-1.0.15 docs/lock.md
files.com-1.0.14 docs/lock.md
files.com-1.0.13 docs/lock.md
files.com-1.0.12 docs/lock.md
files.com-1.0.11 docs/lock.md
files.com-1.0.10 docs/lock.md
files.com-1.0.9 docs/lock.md
files.com-1.0.8 docs/lock.md
files.com-1.0.7 docs/lock.md