assertEquals(jsonNode.get("compositionId").asText(), String.valueOf(compositionId));
JsonNode overrideParamsNode = jsonNode.at("/elements").elements().next().at("/properties/chart/overrideParams");
System.out.println(overrideParamsNode);
- assertEquals(overrideParamsNode.get("appId").asText(), rappInstance.getRappInstanceId().toString());
- assertEquals(overrideParamsNode.get("smeDiscoveryEndpoint").asText(),
+ assertEquals(overrideParamsNode.get("environment.appId").asText(), rappInstance.getRappInstanceId().toString());
+ assertEquals(overrideParamsNode.get("environment.smeDiscoveryEndpoint").asText(),
rappsEnvironmentConfiguration.getSmeDiscoveryEndpoint());
}
void testFileListing() {
File file = new File(validCsarFileLocation + validRappFile);
Set<String> fileListFromCsar = rappCsarConfigurationHandler.getFileListFromCsar(file, "Files/Sme/serviceapis/");
- assertThat(fileListFromCsar).hasSize(2);
+ assertThat(fileListFromCsar).hasSize(3);
}
@Test
assertNotNull(rappResources.getAcm().getCompositionDefinitions());
assertThat(rappResources.getAcm().getCompositionInstances()).hasSize(4);
assertThat(rappResources.getSme().getProviderFunctions()).hasSize(3);
- assertThat(rappResources.getSme().getServiceApis()).hasSize(2);
+ assertThat(rappResources.getSme().getServiceApis()).hasSize(3);
assertThat(rappResources.getSme().getInvokers()).hasSize(2);
assertThat(rappResources.getDme().getProducerInfoTypes()).hasSize(2);
assertThat(rappResources.getDme().getConsumerInfoTypes()).hasSize(2);
Arguments.of(multipartFileNoTosca, "rApp package missing a file TOSCA-Metadata/TOSCA.meta"),
Arguments.of(multipartFileNoAsdYaml, "rApp package missing a file Definitions/asd.yaml"),
Arguments.of(multipartFileMissingArtifact,
- "rApp package missing a file Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz"),
+ "rApp package missing a file Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"),
Arguments.of(multipartFileNoComposition, errorMsgMissingAcmComposition));
}
application_name: rapp-all\r
application_version: 1.0\r
artifacts:\r
- ransliceassurance:\r
+ helloworld:\r
type: tosca.artifacts.asd.deploymentItem\r
- file: "Artifacts/Deployment/HELM/ransliceassurance-1.0.0.tgz"\r
+ file: "Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz"\r
properties:\r
artifact_type: "helm_chart"\r
target_server: "chartmuseum"\r
target_server_uri: "UPDATE_THIS_CHART_MUSEUM_POST_CHARTS_URI"\r
item_id: 1\r
- oru-app:\r
+ helloworld-sme-invoker:\r
type: tosca.artifacts.asd.deploymentItem\r
- file: "Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz"\r
+ file: "Artifacts/Deployment/HELM/hello-world-sme-invoker-0.1.0.tgz"\r
properties:\r
artifact_type: "helm_chart"\r
target_server: "chartmuseum"\r
]
}
},
- "709c62b3-8918-41b9-a747-d21eb79c6c21": {
- "id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
+ "d7be552e-bcc5-4478-b64d-797dbaec8f55": {
+ "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55",
"definition": {
"name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
"version": "1.2.3"
},
- "description": "Starter Automation Composition Element for the Demo",
+ "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": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+ },
+ "overrideParams": {
+ "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+ "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+ }
+ }
+ }
+ },
+ "d7be552e-bdd5-2233-b64d-797dbaec8f55": {
+ "id": "d7be552e-bdd5-2233-b64d-797dbaec8f55",
+ "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": "ransliceassurance",
- "version": "1.0.0"
+ "name": "hello-world-sme-invoker",
+ "version": "0.1.0"
},
"namespace": "nonrtric",
- "releaseName": "ransliceassurance",
- "podName": "ransliceassurance",
+ "releaseName": "hello-world-sme-invoker",
+ "podName": "hello-world-sme-invoker",
"repository": {
"repoName": "local",
"address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
},
"overrideParams": {
- "appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
- "smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+ "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+ "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
}
}
}
"compositionId": "DO_NOT_CHANGE_THIS_COMPOSITION_ID",
"description": "Demo automation composition instance 0",
"elements": {
- "709c62b3-8918-41b9-a747-d21eb79c6c21": {
- "id": "709c62b3-8918-41b9-a747-d21eb79c6c21",
+ "d7be552e-bcc5-4478-b64d-797dbaec8f55": {
+ "id": "d7be552e-bcc5-4478-b64d-797dbaec8f55",
"definition": {
"name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement",
"version": "1.2.3"
},
- "description": "Starter Automation Composition Element for the Demo",
+ "description": "Starter Automation Composition Element for the Hello World",
"properties": {
"chart": {
"chartId": {
- "name": "ransliceassurance",
- "version": "1.0.0"
+ "name": "hello-world-chart",
+ "version": "0.1.0"
},
"namespace": "nonrtric",
- "releaseName": "ransliceassurance",
- "podName": "ransliceassurance",
+ "releaseName": "hello-world-chart",
+ "podName": "hello-world-chart",
"repository": {
"repoName": "local",
"address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
},
"overrideParams": {
- "appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
- "smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+ "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+ "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
+ }
+ }
+ }
+ },
+ "d7be552e-bdd5-2233-b64d-797dbaec8f55": {
+ "id": "d7be552e-bdd5-2233-b64d-797dbaec8f55",
+ "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-sme-invoker",
+ "version": "0.1.0"
+ },
+ "namespace": "nonrtric",
+ "releaseName": "hello-world-sme-invoker",
+ "podName": "hello-world-sme-invoker",
+ "repository": {
+ "repoName": "local",
+ "address": "UPDATE_THIS_CHART_MUSEUM_GET_CHARTS_URI"
+ },
+ "overrideParams": {
+ "environment.appId": "DO_NOT_CHANGE_THIS_RAPP_INSTANCE_ID",
+ "environment.smeDiscoveryEndpoint": "DO_NOT_CHANGE_THIS_SME_DISCOVERY_ENDPOINT"
}
}
}
}
}
],
- "regSec": "PSK"
+ "regSec": "plain"
}
\ No newline at end of file
}
}
],
- "regSec": "PSK"
+ "regSec": "plain"
}
\ No newline at end of file
}
}
],
- "regSec": "PSK"
+ "regSec": "plain
}
\ No newline at end of file
"description": "Example A API of rApp",
"aefProfiles": [
{
- "aefId": "rApp as AEF",
- "description": "Example A rApp as AEF",
+ "aefId": "Hello World as AEF",
+ "description": "Simple Hello World API",
"versions": [
{
- "apiVersion": "v1",
+ "apiVersion": "",
"resources": [
{
- "resourceName": "exampleA",
+ "resourceName": "helloworld",
"commType": "REQUEST_RESPONSE",
- "uri": "/exampleA/subscription/subscription_id_1",
+ "uri": "/helloworld/v1",
"operations": [
"GET"
]
}
],
"protocol": "HTTP_1_1",
- "securityMethods": [
- "PSK"
- ],
"interfaceDescriptions": [
{
- "ipv4Addr": "string",
- "port": 65535,
- "securityMethods": [
- "PKI"
- ]
- },
- {
- "ipv4Addr": "string",
- "port": 65535,
- "securityMethods": [
- "PKI"
- ]
+ "ipv4Addr": "hello-world-chart-service.nonrtric.svc.cluster.local",
+ "port": 8080
}
]
}
"description": "Example B API of rApp",
"aefProfiles": [
{
- "aefId": "rApp as AEF",
- "description": "Example B rApp as AEF",
+ "aefId": "sklearn-iris as AEF",
+ "description": "sklearn-iris API",
"versions": [
{
"apiVersion": "v1",
"resources": [
{
- "resourceName": "exampleA",
+ "resourceName": "sklearn",
"commType": "REQUEST_RESPONSE",
- "uri": "/exampleA/subscription/subscription_id_1",
+ "uri": "/models/sklearn-iris:predict",
"operations": [
- "GET"
+ "POST"
]
}
]
}
],
"protocol": "HTTP_1_1",
- "securityMethods": [
- "PSK"
- ],
"interfaceDescriptions": [
{
- "ipv4Addr": "string",
- "port": 65535,
- "securityMethods": [
- "PKI"
- ]
- },
- {
- "ipv4Addr": "string",
- "port": 65535,
- "securityMethods": [
- "PKI"
- ]
+ "ipv4Addr": "sklearn-iris-predictor-default.kserve-test.svc.cluster.local",
+ "port": 80
}
]
}
--- /dev/null
+{
+ "apiName": "Rapp API Set 3",
+ "description": "Example C API of rApp",
+ "aefProfiles": [
+ {
+ "aefId": "Hello World subpath as AEF",
+ "description": "Simple Hello World API for Subpath",
+ "versions": [
+ {
+ "apiVersion": "",
+ "resources": [
+ {
+ "resourceName": "helloworld",
+ "commType": "REQUEST_RESPONSE",
+ "uri": "/helloworld/v1/subpath1",
+ "operations": [
+ "GET"
+ ]
+ }
+ ]
+ }
+ ],
+ "protocol": "HTTP_1_1",
+ "interfaceDescriptions": [
+ {
+ "ipv4Addr": "hello-world-chart-service.nonrtric.svc.cluster.local",
+ "port": 8080
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
fmt.Println("Generating invalid rApp package without Artifacts...")
INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME := "invalid-rapp-package-missing-artifact"
cp.Copy(RAPP_BASE_PACKAGE, INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME)
- os.Remove(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME + "/Artifacts/Deployment/HELM/orufhrecovery-1.0.0.tgz")
+ os.Remove(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME + "/Artifacts/Deployment/HELM/hello-world-chart-0.1.0.tgz")
createCsarAndCopy(INVALID_RAPP_PACKAGE_MISSING_ARTIFACT_FOLDER_NAME, MODELS_TEST_RESOURCES, APPLICATION_TEST_RESOURCES)
fmt.Println("Generating invalid rApp package with empty asd yaml...")