Sha256: f704e5b3182c35b00e8ef50011274979321f780c37bd20d43c3d3d7962dc8d88

Contents?: true

Size: 1.94 KB

Versions: 32

Compression:

Stored size: 1.94 KB

Contents

# Lock

## Example Lock Object

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

* `path` (string): Path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
* `timeout` (int64): Lock timeout
* `depth` (string): Lock depth (0 or infinity)
* `owner` (string): Owner of lock.  This can be any arbitrary string.
* `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

32 entries across 32 versions & 1 rubygems

Version Path
files.com-1.0.47 docs/lock.md
files.com-1.0.46 docs/lock.md
files.com-1.0.45 docs/lock.md
files.com-1.0.44 docs/lock.md
files.com-1.0.43 docs/lock.md
files.com-1.0.42 docs/lock.md
files.com-1.0.41 docs/lock.md
files.com-1.0.40 docs/lock.md
files.com-1.0.39 docs/lock.md
files.com-1.0.38 docs/lock.md
files.com-1.0.37 docs/lock.md
files.com-1.0.36 docs/lock.md
files.com-1.0.35 docs/lock.md
files.com-1.0.34 docs/lock.md
files.com-1.0.33 docs/lock.md
files.com-1.0.32 docs/lock.md
files.com-1.0.31 docs/lock.md
files.com-1.0.30 docs/lock.md
files.com-1.0.29 docs/lock.md
files.com-1.0.28 docs/lock.md