-
Bug
-
Resolution: Done
-
Medium
-
Beijing Release
-
None
-
None
During latest researches in control loop scenario we've identified a problem with recipe names.
Generally the problem exists when configuring Closed Loop in clamp and choose in HealthCheck as action that should be performed after threshold is exceeded. Everything is fine until Policy is trying to perform action and then it fails with exception.
We've investigated it a bit deeper. Outcome is that when choosing action/recipe combined from 2 words (like HealthCheck) clamp creates yaml with this action and sends it to configure drools rule template. Then when drools tries to perform action using APPC it takes recipe from yaml and uses it to create lcm request. In request action name is used both in URL:
/restconf/operations/appc-provider-lcm:health-check
and in body:
{
...
"action": "HealthCheck"
...
}
In current solution for health check clamp sends 'healthCheck' as recipe in yaml file.
When policy creates request in function AppcLcmActorServiceProvider.constructRequest(...) to format URL it uses lowercase recipe and for body it capitalizes it.
That causes situation where we get URL:
/restconf/operations/appc-provider-lcm:healthcheck
and body
{
...
"action": "Healthcheck"
...
}
That causes an error in APPC:
Invalid value 'Healthcheck' for enum type. Allowed values are: [Restart, Rebuild, Migrate, Evacuate, Snapshot, Rollback, Sync, Audit, Stop, Start, Terminate, SoftwareUpload, HealthCheck, LiveUpgrade, Lock, Unlock, Test, CheckLock, Configure, ConfigModify, ConfigScaleOut, ConfigRestore, ConfigBackup, ConfigBackupDelete, ConfigExport, StopApplication, StartApplication, QuiesceTraffic, ResumeTraffic, UpgradePreCheck, UpgradeSoftware, UpgradePostCheck, UpgradeBackup, UpgradeBackout, ActionStatus, Query, Reboot, AttachVolume, DetachVolume]
This bug will also be observed when we try to use ConfigModify (not available by default but can be added in properties) in CLAMP and all other actions combined of two words.