Aplikasi ini memungkinkan membatasi jumlah unduhan untuk berbagi tautan eksternal.
Contoh di bawah ini dapat dijalankan menggunakan hurl.
Tip
Untuk mengabaikan pernyataan, berikan tanda --ignore-asserts
.
Batas pembagian eksternal dapat ditanyakan berdasarkan tokennya.
hurl get.hurl --variable token='2Nyq27RKT7Jw9q3'
dapatkan.hurl
GET https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
HTTP 200
[Asserts]
jsonpath "$.ocs.data.limit" exists
jsonpath "$.ocs.data.count" exists
hurl propfind.hurl --variable owner=admin --variable path=/welcome.txt
propfind.hurl
PROPFIND https://nextcloud.local/remote.php/dav/files/{{owner}}/{{path}}
[BasicAuth]
{{owner}}: {{owner}}
```xml
```
HTTP 207
[Asserts]
xpath "//nc:share-download-limits" isCollection
hurl set.hurl --variable token='2Nyq27RKT7Jw9q3' --variable limit=5
set.hurl
PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
{
"limit": {{limit}}
}
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
hurl hapus.hurl --variable token='2Nyq27RKT7Jw9q3'
hapus.hurl
DELETE https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/{{token}}/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
alice: alice
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
Admin dapat menetapkan batas default.
hurl set-default.hurl --batas variabel=1
set-default.hurl
PUT https://nextcloud.local/ocs/v2.php/apps/files_downloadlimit/api/v1/limit
OCS-APIRequest: true
Accept: application/json
[BasicAuth]
admin: admin
{
"limit": {{limit}}
}
HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty