...
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.