-
Bug
-
Resolution: Done
-
Medium
-
Beijing Release
-
None
-
DCAE R2 Sprint RC1
There seems to be a bug in cloudify 4.x that contradicts their own docs at http://docs.getcloudify.org/api/v2.1/?shell#pagination
- _size (default: 10000) the max size of the result subset to receive.
- _offset (default: 0) the number of resources to skip, i.e. _offset=1 means you skip the first resource.
both parameters are optional.
the http request from deployment-handler to cloudify (4.x) returns no items on GET
request: {"method":"GET","uri":"http://10.0.4.1:80/api/v2.1/node-instances?_include=id,deployment_id,runtime_properties&_offset=0","auth":"admin:admin","headers":{"Tenant":"default_tenant"}}
response: 200 - {"items": [], "metadata": {"pagination": {"total": 3, "offset": 0, "size": 0}}}
================
The same curl does not return items either (this works fine with cloudify 3.4)
curl -v --header "Tenant:default_tenant" --user "admin:admin" "http://10.0.4.1:80/api/v2.1/node-instances?_include=id,deployment_id,runtime_properties&_offset=0"
{"items": [], "metadata": {"pagination": {"total": 3, "offset": 0, "size": 0}}}
================
The curl without _offset=0 returns all the 3 items as expected
curl -v --header "Tenant:default_tenant" --user "admin:admin" "http://10.0.4.1:80/api/v2.1/node-instances?_include=id,deployment_id,runtime_properties"
{"items": [{"runtime_properties": {"service_component_name": "dcaegen2-analytics_tca_clampinstance_373", "name": "dcaegen2-analytics_tca_clampinstance_373", "envs": {"SERVICE_CHECK_HTTP": "/", "CONSUL_HOST": "10.12.5.130", "SERVICE_11015_IGNORE": "true", "DMAAPSUBTOPIC": "unauthenticated.SEC_MEASUREMENT_OUTPUT", "AAIHOST": "aai", "SERVICE_11011_NAME": "dcaegen2-analytics_tca_clampinstance_373", "CONFIG_BINDING_SERVICE": "config_binding_service", "CBS_HOST": "config-binding-service", "DMAAPPORT": "30227", "SERVICE_TAGS": "closedLoop_770bb2a2-e493-40ef-8751-fb8875dfb00e_deploymentId", "CBS_PORT": "10000", "DMAAPPUBTOPIC": "unauthenticated.DCAE_CL_OUTPUT", "SERVICE_CHECK_TIMEOUT": "1s", "SERVICE_CHECK_INTERVAL": "15s",
...
], "metadata": {"pagination": {"total": 3, "offset": 0, "size": 0}}}
==================
to use the offset, it now requires _size to be specified (max 1000)
curl -v --header "Tenant:default_tenant" --user "admin:admin" "http://10.0.4.1:80/api/v2.1/node-instances?_include=id,deployment_id,runtime_properties&_offset=0&_size=1000"
returns
{"items": [{"runtime_properties": {"service_component_name": "dcaegen2-analytics_tca_clampinstance_373", "name": "dcaegen2-analytics_tca_clampinstance_373", "envs": {"SERVICE_CHECK_HTTP": "/", "CONSUL_HOST": "10.12.5.130", "SERVICE_11015_IGNORE": "true", "DMAAPSUBTOPIC": "unauthenticated.SEC_MEASUREMENT_OUTPUT", "AAIHOST": "aai", "SERVICE_11011_NAME": "dcaegen2-analytics_tca_clampinstance_373", "CONFIG_BINDING_SERVICE": "config_binding_service", "CBS_HOST": "config-binding-service", "DMAAPPORT": "30227", "SERVICE_TAGS": "closedLoop_770bb2a2-e493-40ef-8751-fb8875dfb00e_deploymentId", "CBS_PORT": "10000", "DMAAPPUBTOPIC": "unauthenticated.DCAE_CL_OUTPUT", "SERVICE_CHECK_TIMEOUT": "1s", "SERVICE_CHECK_INTERVAL": "15s",
...
], "metadata": {"pagination": {"total": 3, "offset": 0, "size": 1000}}}
====
This prevents delivery of the policy-updates to cloudify and further to consul-kv for TCA