Description
Eventing started supporting same name under different function scope. With this all the life cycle operation needs to include "bucket" and "scope" name in uri(by default its value is * for backward compatibility)
Rest api:
/api/v1/functions/<function name>/<lifecycle operation>?bucket=<function_scope.bucket>&scope=<function_scope.scope>
Example:
/api/v1/functions/test/deploy?bucket=b1&scope=s1
Example schema: https://github.com/couchbase/eventing/blob/master/parser/handler_schema.json
status api will include "function_scope" value to differentiate between different name
curl -X GET -u Administrator:password http://localhost:9300/api/v1/status
|
{
|
"apps": [
|
{
|
"composite_status": "undeployed",
|
"name": "test",
|
"function_scope": {
|
"bucket": "src_bucket",
|
"scope": "_default"
|
},
|
"num_bootstrapping_nodes": 0,
|
"num_deployed_nodes": 0,
|
"deployment_status": false,
|
"processing_status": false,
|
"redeploy_required": false
|
}
|
],
|
"num_eventing_nodes": 1
|
}%
|
Export also contains "function_scope" field to differentiate between different scope.
curl -X GET -u Administrator:password http://localhost:9300/api/v1/export
|
[
|
{
|
"appcode": "function OnUpdate(doc, meta) {\n log(\"Doc created/updated\", meta.id);\n}\n\nfunction OnDelete(meta, options) {\n log(\"Doc deleted/expired\", meta.id);\n}",
|
"depcfg": {
|
"source_bucket": "dst_bucket",
|
"source_scope": "_default",
|
"source_collection": "_default",
|
"metadata_bucket": "metadata",
|
"metadata_scope": "_default",
|
"metadata_collection": "_default"
|
},
|
"version": "evt-7.1.0-0000-ee",
|
"enforce_schema": false,
|
"handleruuid": 154221883,
|
"function_instance_id": "xgRSH",
|
"appname": "test",
|
"settings": {
|
"dcp_stream_boundary": "everything",
|
"deployment_status": false,
|
"description": "",
|
"execution_timeout": 60,
|
"language_compatibility": "6.6.2",
|
"log_level": "INFO",
|
"n1ql_consistency": "none",
|
"num_timer_partitions": 128,
|
"processing_status": false,
|
"timer_context_size": 1024,
|
"user_prefix": "eventing",
|
"worker_count": 1
|
},
|
"function_scope": {
|
"bucket": "src_bucket",
|
"scope": "_default"
|
}
|
}
|
]%
|
Attachments
Issue Links
- relates to
-
MB-51264 Couchbase-cli: Add bucket and scope options to command used for exporting single eventing function
- Closed