通过 API 进行 Couchbase 压缩设置
Couchbase compaction settings via API
我正在尝试通过 API 更改 Couchbase 服务器压缩设置。具体来说,我想设置压缩可以 运行 的时间 window。通过 Web 控制台执行此操作很简单,但我需要通过脚本来执行此操作,但我无法弄清楚语法。我可以更改其他值,例如清除间隔:
curl -u <adminuser>:<password> -d 'parallelDBAndViewCompaction=false&purgeInterval=3' <IP>:8091/controller/setAutoCompaction
但是 allowedTimePeriod 的值被忽略了。有没有人能让这个工作?
编辑
成功了,谢谢!
您必须提供所有五个值和 parallelDBandView 值:
curl -u admin:password -d 'parallelDBAndViewCompaction=false&allowedTimePeriod[fromHour]=0&allowedTimePeriod[fromMinute]=0&allowedTimePeriod[toHour]=2&allowedTimePeriod[toMinute]=0&allowedTimePeriod[abortOutside]=false' ip:8091/controller/setAutoCompaction
我查看了Compaction API documentation but the syntax looks out of date - from the source我可以看到你需要的四个参数是:
allowedTimePeriod[fromHour]
allowedTimePeriod[fromMinute]
allowedTimePeriod[toHour]
allowedTimePeriod[toMinute]
我正在尝试通过 API 更改 Couchbase 服务器压缩设置。具体来说,我想设置压缩可以 运行 的时间 window。通过 Web 控制台执行此操作很简单,但我需要通过脚本来执行此操作,但我无法弄清楚语法。我可以更改其他值,例如清除间隔:
curl -u <adminuser>:<password> -d 'parallelDBAndViewCompaction=false&purgeInterval=3' <IP>:8091/controller/setAutoCompaction
但是 allowedTimePeriod 的值被忽略了。有没有人能让这个工作?
编辑
成功了,谢谢!
您必须提供所有五个值和 parallelDBandView 值:
curl -u admin:password -d 'parallelDBAndViewCompaction=false&allowedTimePeriod[fromHour]=0&allowedTimePeriod[fromMinute]=0&allowedTimePeriod[toHour]=2&allowedTimePeriod[toMinute]=0&allowedTimePeriod[abortOutside]=false' ip:8091/controller/setAutoCompaction
我查看了Compaction API documentation but the syntax looks out of date - from the source我可以看到你需要的四个参数是:
allowedTimePeriod[fromHour]
allowedTimePeriod[fromMinute]
allowedTimePeriod[toHour]
allowedTimePeriod[toMinute]