...
*** some sections/fields are optional, we need to mark these ***
...
width | 700 |
---|---|
height | 300 |
...
REDO
3.4.2 Decision API Queries
Decision API queries are implemented with a POST operation with a JSON body that specifies the filter for the policies to be returned. The JSON body must comply with the schema sepcified in Section 3.4.1.
https:{url}:{port}/decision/v1/ POST
Description of the JSON Payload for the decision API Call
Field | R/O | Type | Description |
---|---|---|---|
ONAPName | R | String | Name of the ONAP component that is making the request. |
ONAPInstance | O | String | Optional instance identification for that ONAP component. |
action | R | String | The action that the ONAP component is performing on a resource. eg. "configure" → DCAE uS onap.Monitoring policy Decisions to configure uS "naming" "placement" "guard" |
These sub metadata structures are used to refine which resource the ONAP component is performing an action upon. At least one is required in order for Policy to return a Decision. Multiple structures may be utilized to help refine a Decision. | |||
policy-type-name | String | The policy type name. This may be a regular expression. | |
policy-id | String | The policy id. This may be a regular expression or an exact value. | |
This example below shows the JSON body of a query for a specify policy-id
Code Block | ||||
---|---|---|---|---|
| ||||
{ "ONAPName": "DCAE", "ONAPInstance": "policy-handler-0", "action": "configure", "resource": { "$refpolicy-id": "#/definitions/Peponap.scaleout" } }, "action} |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "onap.scaleout.tca": { "type": "string" }onap.policies.monitoring.cdap.tca.hi.lo.app", "resourceversion": { "type": "array"1.0.0", "itemsmetadata": { "$refpolicy-id": "#/definitions/Resource"onap.scaleout.tca", } } }, "required"policy-version": [1 "action"}, "pepproperties",: { "resource" ] }, "Pepdomain": { "type": "object","measurementsForVfScaling" "properties": { "name": { "type": "string" }, "instance": { "type": "string" } }, "required": [ "name" ], "title": "Pep" }, "Resource": { "type": "object", "additionalProperties": false, "properties": { "policy-metadata": { "$ref": "#/definitions/PolicyMetadata" }, "service-metadata": { "$ref": "#/definitions/aaiMetadata" }, "resource-metadata": { "$ref": "#/definitions/aaiMetadata" }, "closedLoopControlName": { "type": "array", "items": { "type": "string" } } }, "required": [], "title": "Resource" }, "PolicyMetadata": { "type": "object", "additionalProperties": false, "properties": { "policy-id": { "type": "string" }, "policy-type": { "type": "string" } }, "required": [], "title": "PolicyMetadata" }, "aaiMetadata": { "type": "object", "additionalProperties": false, "properties": { "model-invariant-id": { "type": "string", "format": "uuid" }, "model-version-id": { "type": "string", "format": "uuid" }, "name": { "type": "string" } }, "required": [], "title": "Service and Resource A&AI metadata" } } } |
3.4.2 Decision API Queries
Decision API queries are implemented with a POST operation with a JSON body that specifies the filter for the policies to be returned. The JSON body must comply with the schema sepcified in Section 3.4.1.
https:{url}:{port}/decision/v1/ POST
...
The action that the ONAP component is performing on a resource.
eg. "configure" → DCAE uS onap.Monitoring policy Decisions to configure uS
"naming"
"placement"
"guard"
...
These sub metadata structures are used to refine which resource the ONAP component is performing an action upon.
At least one is required in order for Policy to return a Decision.
Multiple structures may be utilized to help refine a Decision.
...
policy-type-name
...
}
}
} |
This example below shows the JSON body of a query for a specify multiple policy-id's
Code Block | ||||
---|---|---|---|---|
| ||||
{ "ONAPName": "DCAE", "ONAPInstance": "policy-handler-0", "action": "configure", "resource": { "policy-id": [ "onap.scaleout", "onap.modifyconfig", "onap.restart" ] } } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "policies": [ { "onap.scaleout.tca": { "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", "version": "1.0.0", "metadata": { "policy-id": "onap.scaleout.tca", "policy-version": 1 }, "properties": { "domain": "measurementsForVfScaling" } } } |
This example below shows the JSON body of a query for a multiple policy-id's
Code Block | ||||
---|---|---|---|---|
| ||||
{
"ONAPName": "DCAE",
"ONAPInstance": "policy-handler-0",
"action": "configure",
"resource": {
"policy-id": [
"onap.scaleout",
"onap.modifyconfig",
"onap.restart"
]
}
} |
...
language | js |
---|---|
title | Decision Response - Single Policy ID query |
linenumbers | true |
...
"policy-version": 1 }, "properties": { "domain": "measurementsForVfScaling" <OMITTED FOR BREVITY> } } }, { "onap.firewall.tca": { "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", "version": "1.0.0", "metadata": { "policy-id": "onap. |
...
firewall.tca", "policy-version": 1 }, "properties": { "domain": "measurementsForVfScaling" <OMITTED FOR BREVITY> } } |
...
}
]
} |
The simple draft example below shows the JSON body of a query in which all the deployed policies for a specific policy type are returned.
...
Code Block | ||
---|---|---|
| ||
{ "policies": [ { "onap.scaleout.tca": { "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", "version": "1.0.0", "metadata": { "policy-id": "onap.scaleout.tca", "policy-version": 1 }, "properties": { "domain": "measurementsForVfScaling" <OMITTED FOR BREVITY> } } }, { "onap.firewall.tca": { "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", "version": "1.0.0", "metadata": { "policy-id": "onap.firewall.tca", "policy-version": 1 }, "properties": { "domain": "measurementsForVfScaling" <OMITTED FOR BREVITY> } } } ] } |
...
4. Policy Framework Internal APIs
...