Hi Jorge,

Thanks for the response. it worked.

I am facing another issue. Kindly help to proceed.
When I post dmaap events, EVENT.CLEANUP is executed which means policy is
not avaliable.
1. How to check whether policy is loaded in casablanca?
2. How to set the log level to debug?

I am sending following request to push policy

policy@drools:/tmp/basex-controlloop$
*policy@drools:/tmp/basex-controlloop$ curl -k --silent --user
[email protected]:demo123456! -X PUT --header 'Content-Type:
text/plain' -d '{"closedLoopControlName":
"ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b","controlLoopYaml":
"controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity
Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+Reroute%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard","policyName":
"ccvpn","policyScope":"DCAE","policyVersion": "1.2.0"}'
"https://localhost:9696/policy/pdp/engine/topics/sources/dmaap/unauthenticated.DCAE_CL_OUTPUT/events
<https://localhost:9696/policy/pdp/engine/topics/sources/dmaap/unauthenticated.DCAE_CL_OUTPUT/events>"*
["{\"closedLoopControlName\":
\"ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b\",\"controlLoopYaml\":
\"controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-CCVPN-2179b738-fd36-4843-a71a-a8c24c70c66b%0D%0A++trigger_policy%3A+unique-policy-id-16-Reroute%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+false%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-16-Reroute%0D%0A++++name%3A+Connectivity
Reroute%0D%0A++++description%3A%0D%0A++++actor%3A+SDNC%0D%0A++++recipe%3A+Reroute%0D%0A++++target%3A%0D%0A++++++type%3A+VM%0D%0A++++retry%3A+3%0D%0A++++timeout%3A+1200%0D%0A++++success%3A+final_success%0D%0A++++failure%3A+final_failure%0D%0A++++failure_timeout%3A+final_failure_timeout%0D%0A++++failure_retries%3A+final_failure_retries%0D%0A++++failure_exception%3A+final_failure_exception%0D%0A++++failure_guard%3A+final_failure_guard\",\"policyName\":
\"ccvpn\",\"policyScope\":\"DCAE\",\"policyVersion\":
\"1.2.0\"}"]policy@drools:/tmp/basex-controlloop$
policy@drools:/tmp/basex-controlloop$

*Response for
http://localhost:9696/policy/pdp/engine/controllers/casablanca/drools/facts/casablanca
<http://localhost:9696/policy/pdp/engine/controllers/casablanca/drools/facts/casablanca>*

*https://localhost:9696/policy/pdp/engine
<https://localhost:9696/policy/pdp/engine>> get --auth
[email protected]:demo1*
*23456!
http://localhost:9696/policy/pdp/engine/controllers/casablanca/drools/fac
<http://localhost:9696/policy/pdp/engine/controllers/casablanca/drools/fac>*
*ts/casablanca*
HTTP/1.1 200 OK
Content-Length: 967
Content-Type: application/json
Date: Tue, 30 Oct 2018 08:54:15 GMT
Server: Jetty(9.4.12.v20180830)

{
    "alive": true,
    "controllers": [
        "casablanca"
    ],
    "features": [
        "org.onap.policy.drools.healthcheck.HealthCheckFeature",

"org.onap.policy.drools.apps.controlloop.feature.utils.ControlLoopUtilsFeature"
    ],
    "httpServers": [
        {
            "alive": true,
            "host": "0.0.0.0",
            "name": "SECURED-CONFIG",
            "port": 9696,
            "user": "[email protected]"
        }
    ],
    "locked": false,
    "sinks": [
        {
            "alive": true,
            "allowSelfSignedCerts": false,
            "apiKey": "",
            "apiSecret": "",
            "locked": false,
            "partitionKey": "96c420a9-265a-4a3f-8a1f-a12933e31c3d",
            "recentEvents": [],
            "servers": [
                "mr.api.simpledemo.onap.org"
            ],
            "topic": "PDPD-CONFIGURATION",
            "topicCommInfrastructure": "DMAAP",
            "useHttps": true
        }
    ],
    "sources": [
        {
            "alive": true,
            "allowSelfSignedCerts": false,
            "apiKey": "",
            "apiSecret": "",
            "consumerGroup": "92362421-1b86-4418-b1fe-c08bb2ac5ab4",
            "consumerInstance": "drools",
            "fetchLimit": 100,
            "fetchTimeout": 15000,
            "locked": false,
            "recentEvents": [],
            "servers": [
                "mr.api.simpledemo.onap.org"
            ],
            "topic": "PDPD-CONFIGURATION",
            "topicCommInfrastructure": "DMAAP",
            "useHttps": true
        }
    ]
}


*Beijing verison logs: *

policy@drools:/tmp/basex-controlloop/bin$
policy@drools:/tmp/basex-controlloop/bin$ curl --silent --user
@1b3rt:31nst31n -X GET
http://localhost:9696/policy/pdp/engine/controllers/beijing/drools/facts/beijing
| python -m json.tool
{
    "org.onap.policy.controlloop.params.ControlLoopParams": 2
}
policy@drools:/tmp/basex-controlloop/bin$

Thanks,
Vidya


On Sun, Oct 28, 2018 at 8:28 AM HERNANDEZ-HERRERO, JORGE <[email protected]>
wrote:

> Hello Vidya,
>
>
>
> Switch the url to https, and correct the credentials.
>
>
>
> Check the credentials within the drools container by “echo
> $ENGINE_MANAGEMENT_USER” and $ENGINE_MANAGEMENT_PASSWORD” in a bash
> shell.
>
>
>
> Remove the last piped command (python) to see curl’s output.
>
>
>
> I also encourage you to use the telemetry shell within the drools
> container to get this info easier.   Type “telemetry” in the drools
> container, “cd controllers/casablanca” and  then “get”.
>
>
>
> Best regards,
>
> Jorge
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Vidyashree Rama
> *Sent:* Saturday, October 27, 2018 1:22 AM
> *To:* [email protected]
> *Cc:* [email protected]; Gaurav agrawal <[email protected]>;
> Rama SubbaReddy <[email protected]>
> *Subject:* [onap-discuss][policy] please help to resolve this issue - No
> JSON object could be decoded
>
>
>
> Hi All,
>
>
>
> Please help to resolve this issue "No JSON object could be decoded".
>
> I am getting "No JSON object could be decoded" for "
> http://localhost:9696/policy/pdp/engine/controllers/casablanca"; request
>
>
>
> root@onap-policy:~#
>
> root@onap-policy:~#
>
> root@onap-policy:~# curl --silent --user @1b3rt:31nst31n -X GET
> http://localhost:9696/policy/pdp/engine/controllers/amsterdam | python -m
> json.tool
>
> No JSON object could be decoded
>
> root@onap-policy:~#
>
> root@onap-policy:~#
>
> root@onap-policy:~# curl --silent --user @1b3rt:31nst31n -X GET
> http://localhost:9696/policy/pdp/engine/controllers/casablanca | python
> -m json.tool
>
> No JSON object could be decoded
>
> root@onap-policy:~#
>
> root@onap-policy:~#
>
> root@onap-policy:~#
>
> root@onap-policy:~# python --version
>
> Python 2.7.6
>
> root@onap-policy:~#
>
> root@onap-policy:~#
>
> root@onap-policy:~# docker exec -it drools bash
>
> policy@drools:/tmp/policy-install$ features status
>
> name                      version         status
>
> ----                      -------         ------
>
> state-management          1.3.0-SNAPSHOT  disabled
>
> controlloop-amsterdam     1.3.1           disabled
>
> session-persistence       1.3.0-SNAPSHOT  disabled
>
> distributed-locking       1.3.0-SNAPSHOT  disabled
>
> controlloop-utils         1.3.1           enabled
>
> eelf                      1.3.0-SNAPSHOT  disabled
>
> *controlloop-casablanca    1.3.1           enabled*
>
> active-standby-management 1.3.0-SNAPSHOT  disabled
>
> test-transaction          1.3.0-SNAPSHOT  disabled
>
> controlloop-trans         1.3.1           enabled
>
> pooling-dmaap             1.3.0-SNAPSHOT  disabled
>
> healthcheck               1.3.0-SNAPSHOT  enabled
>
>
>
> policy@drools:/tmp/policy-install$
>
>
>
> Thanks,
>
> Vidya
>
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13375): https://lists.onap.org/g/onap-discuss/message/13375
Mute This Topic: https://lists.onap.org/mt/27747206/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to