Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit f6e9323

Browse files
committed
Added recursive block, removed bug notice, added defaults
1 parent 12fa5cd commit f6e9323

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

apiary.apib

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,11 +1708,9 @@ Remove a file.
17081708

17091709
### Bugs
17101710

1711-
- Recursive seems to default to true. CF: https://github.com/ipfs/go-ipfs/issues/2378
1712-
17131711
+ Parameters
17141712
+ arg (string, required) - File to remove.
1715-
+ recursive (boolean, optional) - Recursively remove directories. Alias: r.
1713+
+ recursive (boolean, optional) - Recursively remove directories. Default: false. Alias: r.
17161714
+ flush (boolean, optional) - Flush target and ancestors after write. Default: true. Alias: f.
17171715

17181716
+ Request Without Arguments
@@ -1861,18 +1859,60 @@ Remove a file.
18611859
```
18621860
```
18631861

1862+
+ Request With Argument For Directory Without Recursive
1863+
1864+
'/test' here must be a directory, not a file.
1865+
1866+
#### curl
1867+
1868+
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test"
1869+
1870+
+ Body
1871+
1872+
```
1873+
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test"
1874+
```
1875+
1876+
+ Response 500
1877+
1878+
+ Headers
1879+
1880+
```
1881+
Access-Control-Allow-Headers: X-Stream-Output, X-Chunked-Output
1882+
Access-Control-Expose-Headers: X-Stream-Output, X-Chunked-Output
1883+
Content-Type: application/json
1884+
Server: go-ipfs/0.4.0-dev
1885+
Trailer: X-Stream-Error
1886+
Transfer-Encoding: chunked
1887+
Date: Thu, 03 Mar 2016 15:53:27 GMT
1888+
Transfer-Encoding: chunked
1889+
```
1890+
1891+
+ Attributes (Error)
1892+
- Message: "/test is a directory, use -r to remove directories"
1893+
- Code: 0
1894+
1895+
+ Body
1896+
1897+
```
1898+
{
1899+
"Code": 0,
1900+
"Message": "/test is a directory, use -r to remove directories"
1901+
}
1902+
```
1903+
18641904
+ Request With Argument And Recursive Option
18651905

18661906
This request is dependent on there being a 'test' folder in your Files API folder.
18671907

18681908
#### curl
18691909

1870-
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true"
1910+
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive"
18711911

18721912
+ Body
18731913

18741914
```
1875-
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive=true"
1915+
curl -i -X POST "http://localhost:5001/api/v0/files/rm?arg=/test&recursive"
18761916
```
18771917

18781918
+ Response 200

0 commit comments

Comments
 (0)