Skip to content

Latest commit

 

History

History
201 lines (173 loc) · 4.71 KB

File metadata and controls

201 lines (173 loc) · 4.71 KB

Example HTTP Requests

Example 1. Update global function settings

This example updates the worker_count setting.

curl request
curl -X POST -d '{
  "deployment_status": false,
  "processing_status": false,
  "worker_count": 6
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"
Example 2. Update scoped function settings

This example updates the worker_count setting.

curl request
curl -X POST -d '{
  "deployment_status": false,
  "processing_status": false,
  "worker_count": 6
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"
Example 3. Update undeployed global function settings

This example updates the app_log_max_files and app_log_max_size settings. The function is currently undeployed.

curl request
curl -X POST -d '{
  "deployment_status": false,
  "processing_status": false,
  "app_log_max_files": 5
  "app_log_max_size":10485760
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"
Example 4. Update undeployed scoped function settings

This example updates the app_log_max_files and app_log_max_size settings. The function is currently undeployed.

curl request
curl -X POST -d '{
  "deployment_status": false,
  "processing_status": false,
  "app_log_max_files": 5,
  "app_log_max_size": 10485760
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"
Example 5. Update paused global function settings

This example updates the timer_context_size setting. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": false,
  "timer_context_size": 2048
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"
Example 6. Update paused scoped function settings

This example updates the timer_context_size setting. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": false,
  "timer_context_size": 2048
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"
Example 7. Update paused global function settings and resume

This example updates the worker_count setting and resumes. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": true,
  "worker_count": 8
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"
Example 8. Update paused scoped function settings and resume

This example updates the worker_count setting and resumes. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": true,
  "worker_count": 8
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"
Example 9. Enable Sync Gateway compatibility for a global function

Couchbase Server 7.6.4

This example sets allow_sync_documents to false, to enable compatibility with Sync Gateway. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": false,
  "allow_sync_documents": false
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"

For details, see sync-gateway::server-compatibility-eventing.adoc.

Example 10. Enable Sync Gateway compatibility for a scoped function

Couchbase Server 7.6.4

This example sets allow_sync_documents to false, to enable compatibility with Sync Gateway. The function is currently paused.

curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": false,
  "allow_sync_documents": false
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"

For details, see sync-gateway::server-compatibility-eventing.adoc.

Example 11. Deploy an undeployed global function — deprecated
curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": true
}' "http://$ADMIN:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings"

Deprecated. See [basic_deploy] for the preferred invocation.

Example 12. Deploy an undeployed scoped function — deprecated
curl request
curl -X POST -d '{
  "deployment_status": true,
  "processing_status": true
}' "http://$USER:$PASSWORD@$HOST:8096/api/v1/functions/my_function/settings?bucket=bulk&scope=data"

Deprecated. See [basic_deploy] for the preferred invocation.