DRAFT
Introduction
...
Code Block |
---|
|
java.lang.NullPointerException: Cannot invoke "org.onap.policy.clamp.models.acm.concepts.AutomationComposition.getElements()" because "automationComposition" is null
at com.oransc.rappmanager.models.AcmInterceptor.injectAutomationComposition(AcmInterceptor.java:84) ~[rapp-manager-models-0.0.1.jar!/:0.0.1]
at com.oransc.rappmanager.acm.service.AcmDeployer.deployRappInstance(AcmDeployer.java:141) ~[rapp-manager-acm-0.0.1.jar!/:0.0.1]
at com.oransc.rappmanager.service.RappService.deployRappInstance(RappService.java:106) ~[!/:0.0.1]
at com.oransc.rappmanager.rest.RappInstanceController.lambda$deployRappInstance$10(RappInstanceController.java:95) ~[!/:0.0.1]
at java.base/java.util.Optional.map(Unknown Source) ~[na:na]
at com.oransc.rappmanager.rest.RappInstanceController.lambda$deployRappInstance$12(RappInstanceController.java:95) ~[!/:0.0.1]
at java.base/java.util.Optional.map(Unknown Source) ~[na:na]
at com.oransc.rappmanager.rest.RappInstanceController.deployRappInstance(RappInstanceController.java:93) ~[!/:0.0.1]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na] |
ACM Instance for Kubernetes Deployment
The following example showcases an ACM instance designed for Kubernetes deployment:
Code Block |
---|
|
{
"name": "DemoInstance0",
"version": "1.0.1",
"compositionId": "COMPOSITIONID",
"description": "Demo automation composition instance 0",
"elements": {
"709c62b3-8918-41b9-a747-d21eb79c6c21": {
"id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
"definition": {
"name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
"version": "1.2.3"
},
"description": "Starter Automation Composition Element for the Hello World",
"properties": {
"chart": {
"chartId": {
"name": "hello-world-chart",
"version": "0.1.0"
},
"namespace": "nonrtric",
"releaseName": "hello-world-chart",
"podName": "hello-world-chart",
"repository": {
"repoName": "local",
"address": "http://10.101.1.90:8879/charts"
}
}
}
}
}
} |
In this instance, "DemoInstance0" is specified with a version of "1.0.1," associated with a composition ID "COMPOSITIONID," and described as a demo automation composition. The instance contains a single element with the ID "709c62b3-8918-41b9-a747-d21eb79c6c21." This element is defined as the "K8S_StarterAutomationCompositionElement" with version "1.2.3." It represents the starter automation composition element for the Hello World service.
The element's properties include a reference to the Helm chart named "hello-world-chart" with version "0.1.0." The chart is intended for deployment in the "nonrtric" namespace with a release name, pod name, and repository details pointing to the local repository at "http://10.101.1.90:8879/charts."
This structured representation provides a clear overview of the ACM instance designed for deploying the Hello World service on Kubernetes.
SME service exposure for "Hello World" REST endpoints
To expose "Hello World" microservice endpoints through the Service Management and Exposure (SME), you need to create SME configurations and package them within the same rApp package that contains the Kubernetes participant.
SME Configuration Structure
The SME configuration consists of three directories: providers
, serviceapis
, and invokers
, each containing specific JSON files.
providers/provider-function-1.json
Code Block |
---|
|
{
"apiProvDomInfo": "Provider domain",
"apiProvFuncs": [
{
"apiProvFuncInfo": "Hello World as APF",
"apiProvFuncRole": "APF",
"regInfo": {
"apiProvPubKey": "APF-PublicKey"
}
},
{
"apiProvFuncInfo": "Hello World as AEF",
"apiProvFuncRole": "AEF",
"regInfo": {
"apiProvPubKey": "AEF-PublicKey"
}
}
],
"regSec": "PSK"
} |
serviceapis/api-set-1.json
Code Block |
---|
|
{
"apiName": "Hello World API Set 1",
"description": "Simple Hello World API",
"aefProfiles": [
{
"aefId": "Hello World as AEF",
"description": "Simple Hello World API",
"versions": [
{
"apiVersion": "v1",
"resources": [
{
"resourceName": "helloworld",
"commType": "REQUEST_RESPONSE",
"uri": "/helloworld/v1",
"operations": [
"GET"
]
}
]
}
],
"protocol": "HTTP_1_1",
"securityMethods": [
"PSK"
],
"interfaceDescriptions": [
{
"ipv4Addr": "string",
"port": 30951,
"securityMethods": [
"PKI"
]
},
{
"ipv4Addr": "string",
"port": 30951,
"securityMethods": [
"PKI"
]
}
]
}
]
} |
invokers/invoker-app1.json
Code Block |
---|
|
[
{
"apiInvokerInformation": "Invoker App 1",
"apiList": [
{}
],
"notificationDestination": "http://invoker-app1:8086/callback",
"onboardingInformation": {
"apiInvokerPublicKey": "{PUBLIC_KEY_INVOKER_1}",
"apiInvokerCertificate": "apiInvokerCertificate"
},
"requestTestNotification": true
}
] |
Querying Available APIs
After configuring SME, you can query the available APIs exposed by SME. Replace <NAMESPACE>
with your Kubernetes namespace.
Code Block |
---|
|
CAPIF_HOST=http://$(kubectl get service capifcore -n nonrtric -o jsonpath='{.spec.clusterIP}'):8090
curl -sS --location "$CAPIF_HOST/service-apis/v1/allServiceAPIs?api-invoker-id=api_invoker_id_Invoker_App_1" --header 'Accept: application/json' | jq |
This command queries the SME to retrieve information about all available service APIs for the specified API invoker.