...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
ACCEPT response
{
"Status": {
"Value": "ACCEPTED",
"Code": "100"
},
"Payload": {
"pg-streams": "{\\\"pg-streams\\\": {\\\"pg-stream\\\":[{\\\"id\\\":\\\"fw_udp1\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp2\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp3\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp4\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp5\\\", \\\"is-enabled\\\":\\\"true\\\"}]}}",
"generic-vnf.vnf-id": "fw0001vm001fw001"
},
"CommonHeader": {
"TimeStamp": "1493841850199",
"APIver": "1.01",
"RequestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
"SubrequestID": null,
"OriginatorID": null
}
}
SUCCESS response
{
"Status": {
"Value": "SUCCESS",
"Code": "400"
},
"Payload": {
"pg-streams": "{\\\"pg-streams\\\": {\\\"pg-stream\\\":[{\\\"id\\\":\\\"fw_udp1\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp2\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp3\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp4\\\", \\\"is-enabled\\\":\\\"true\\\"},{\\\"id\\\":\\\"fw_udp5\\\", \\\"is-enabled\\\":\\\"true\\\"}]}}",
"generic-vnf.vnf-id": "fw0001vm001fw001"
},
"CommonHeader": {
"TimeStamp": "1493841850199",
"APIver": "1.01",
"RequestID": "664be3d2-6c12-4f4b-a3e7-c349acced200",
"SubrequestID": null,
"OriginatorID": null
}
}
TODO FAILED response
|
vCPE
Policy Creation and Pushing
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
tca_policy: "{ "domain": "measurementsForVfScaling", "metricsPerEventName": [{ "eventName": "Measurement_vGMUX", "controlLoopSchemaType": "VNF", "policyScope": "DCAE", "policyName": "DCAE.Config_tca-hi-lo", "policyVersion": "v0.0.1", "thresholds": [{ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "version": "1.0.2", "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", "thresholdValue": 0, "direction": "EQUAL", "severity": "MAJOR", "closedLoopEventStatus": "ABATED" }, { "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "version": "1.0.2", "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", "thresholdValue": 0, "direction": "GREATER", "severity": "CRITICAL", "closedLoopEventStatus": "ONSET" }] }] }" |
Code Block | ||||||
---|---|---|---|---|---|---|
Code Block | ||||||
| ||||||
controlLoop:curl -v version: 2.0.0 controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e trigger_policy: unique-policy-id-1-restart timeout: 3600 abatement: true policies: - id: unique-policy-id-1-restart name: Restart the VM description: actor: APPC recipe: Restart target: type: VM retry: 3 timeout: 1200 success: final_success failure: final_failure failure_timeout: final_failure_timeout failure_retries: final_failure_retries failure_exception: final_failure_exception failure_guard: final_failure_guard--silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"Measurement_vGMUX\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ABATED\" }, { \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"GREATER\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", "policyConfigType": "MicroService", "policyName": "com.MicroServicevCPE", "onapName": "DCAE" }' 'http://pdp:8081/pdp/api/createPolicy' |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
controlLoop:
version: 2.0.0
controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
trigger_policy: unique-policy-id-1-restart
timeout: 3600
abatement: true
policies:
- id: unique-policy-id-1-restart
name: Restart the VM
description:
actor: APPC
recipe: Restart
target:
type: VM
retry: 3
timeout: 1200
success: final_success
failure: final_failure
failure_timeout: final_failure_timeout
failure_retries: final_failure_retries
failure_exception: final_failure_exception
failure_guard: final_failure_guard |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/html' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
"policyConfigType": "BRMS_PARAM",
"policyName": "com.BRMSParamvCPE",
"policyDescription": "BRMS Param vCPE policy",
"policyScope": "com",
"attributes": {
"MATCHING": {
"controller" : "amsterdam"
},
"RULE": {
"templateName": "ClosedLoopControlName",
"closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
"controlLoopYaml": "controlLoop%3A%0D%0A++version%3A+2.0.0%0D%0A++controlLoopName%3A+ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0D%0A++trigger_policy%3A+unique-policy-id-1-restart%0D%0A++timeout%3A+3600%0D%0A++abatement%3A+true%0D%0A+%0D%0Apolicies%3A%0D%0A++-+id%3A+unique-policy-id-1-restart%0D%0A++++name%3A+Restart+the+VM%0D%0A++++description%3A%0D%0A++++actor%3A+APPC%0D%0A++++recipe%3A+Restart%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"
}
}
}' 'http://pdp:8081/pdp/api/createPolicy'
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
"pdpGroup": "default",
"policyName": "com.BRMSParamvCPE",
"policyType": "BRMS_Param"
}' 'http://pdp:8081/pdp/api/pushPolicy'
curl -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{
"pdpGroup": "default",
"policyName": "com.MicroServicevCPE",
"policyType": "MicroService"
}' 'http://pdp:8081/pdp/api/pushPolicy'
|
DCAE Events and A&AI Enrichment (if necessary)
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "body": { "output": { "common-header": { "timestamp": "2017-08-25T21:06:23.037Z", "api-ver": "2.00", "originator-id": "a20e2073-30b1-4357-893b-f5ed57b66ef0", "request-id": "a20e2073-30b1-4357-893b-f5ed57b66ef0", "sub-request-id": "1", "flags": {} }, "status": { "code": 400, "message": "Restart Successful" } } }, "version": "2.00", "rpc-name": "restart", "correlation-id": "a20e2073-30b1-4357-893b-f5ed57b66ef0-1", "type": "response" } |
VOLTE
Policy Creation
...