xpanse
xpanse copied to clipboard
create getPendingConfigurationChangeRequest for agents to poll
- [ ] create new API getPendingConfigurationChangeRequest /xpanse/agent/poll/{serviceId}/{resourceName}
- [ ] No authentication.
- [ ] Mandatory query params – ServiceId and ResourceName
- [ ] Return the oldest request with status PENDING.
- [ ] If any polling request is in IN-PROGRESS for the specific serviceId and resourceName, then reject new request – ConfigUpdateInProgressAlreadyException
- [ ] Return – OrderId, config parameters as a map, ansibleScriptConfig (from OCL) and ansible inventory. - Define a data model for this.
- [ ] Build ansible Inventory as JSON with only group name, host name and IP.
- [ ] This API Controller must be activated only when a specific profile is provided. Profile name - 'agent-api'
Depends on https://github.com/eclipse-xpanse/xpanse/issues/1868
sample ansible inventory in JSON format
{
"zookeeper": {
"hosts": {
"zookeeper-dfdfd": {
"ansible_host": "192.168.11.2"
},
},
},
"kafka-broker": {
"hosts": {
"kafka-borker-dfdfdfd": {
"ansible_host": "192.168.11.3"
},
"kafka-borker-absdf": {
"ansible_host": "192.168.11.4"
},
},
}
}