X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fblueprintsprocessor%2Ffunctions%2Fk8s-connection-plugin%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fblueprintsprocessor%2Ffunctions%2Fk8s%2Finstance%2FK8sPluginInstanceApi.kt;h=b58a7eaf4c1a27b275ba30feef33827d2df50018;hb=97c07491d6dfb1fca6e4aeebaf7318324c1d3eb4;hp=a991795991187c0adb9059849b568da79b34bd87;hpb=a07209f3327340cbbd4ddf8051ec7775153e1121;p=ccsdk%2Fcds.git diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt index a99179599..b58a7eaf4 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/instance/K8sPluginInstanceApi.kt @@ -22,6 +22,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.fasterxml.jackson.module.kotlin.readValue import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.K8sConnectionPluginConfiguration +import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.K8sRbInstanceRestClient.Companion.getK8sRbInstanceRestClient import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheck import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckList import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.instance.healthcheck.K8sRbInstanceHealthCheckSimple @@ -40,7 +41,7 @@ class K8sPluginInstanceApi( private val log = LoggerFactory.getLogger(K8sPluginInstanceApi::class.java)!! fun getInstanceList(): List? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -63,7 +64,7 @@ class K8sPluginInstanceApi( } fun getInstanceById(instanceId: String): K8sRbInstance? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -85,7 +86,7 @@ class K8sPluginInstanceApi( } fun getFullInstanceById(instanceId: String): K8sRbInstanceFull? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -122,7 +123,7 @@ class K8sPluginInstanceApi( } fun getInstanceStatus(instanceId: String): K8sRbInstanceStatus? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -152,7 +153,7 @@ class K8sPluginInstanceApi( name: String? = null, labels: Map? = null ): K8sRbInstanceStatus? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { var path: String = "/query?ApiVersion=$apiVersion&Kind=$kind" if (name != null) @@ -185,7 +186,7 @@ class K8sPluginInstanceApi( } fun getInstanceHealthCheckList(instanceId: String): K8sRbInstanceHealthCheckList? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -210,7 +211,7 @@ class K8sPluginInstanceApi( } fun getInstanceHealthCheck(instanceId: String, healthCheckId: String): K8sRbInstanceHealthCheck? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -235,7 +236,7 @@ class K8sPluginInstanceApi( } fun startInstanceHealthCheck(instanceId: String): K8sRbInstanceHealthCheckSimple? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( POST.name, @@ -260,7 +261,7 @@ class K8sPluginInstanceApi( } fun createConfigurationValues(configValues: K8sConfigValueRequest, instanceId: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( POST.name, @@ -282,7 +283,7 @@ class K8sPluginInstanceApi( } fun editConfigurationValues(configValues: K8sConfigValueRequest, instanceId: String, configName: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( PUT.name, @@ -304,7 +305,7 @@ class K8sPluginInstanceApi( } fun editConfigurationValuesByDelete(instanceId: String, configName: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( POST.name, @@ -326,7 +327,7 @@ class K8sPluginInstanceApi( } fun hasConfigurationValues(instanceId: String, configName: String): Boolean { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -342,7 +343,7 @@ class K8sPluginInstanceApi( } fun hasConfigurationValuesVersion(instanceId: String, configName: String, version: String): Boolean { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -358,7 +359,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValues(instanceId: String, configName: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -380,7 +381,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValuesVersion(instanceId: String, configName: String, version: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -402,7 +403,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValuesVersionByTag(instanceId: String, configName: String, tag: String): K8sConfigValueResponse? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -424,7 +425,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValuesList(instanceId: String): List? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -447,7 +448,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValuesVersionList(instanceId: String, configName: String): List? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -470,7 +471,7 @@ class K8sPluginInstanceApi( } fun getConfigurationValuesTagList(instanceId: String, configName: String): List? { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( GET.name, @@ -493,7 +494,7 @@ class K8sPluginInstanceApi( } fun deleteConfigurationValues(instanceId: String, configName: String, deleteConfigOnly: Boolean) { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { var path: String = "/config/$configName" if (deleteConfigOnly) @@ -513,7 +514,7 @@ class K8sPluginInstanceApi( } fun rollbackConfigurationValues(instanceId: String, configName: String, configVersion: String?, configTag: String?) { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val configValues = hashMapOf() if (configVersion != null) @@ -535,7 +536,7 @@ class K8sPluginInstanceApi( } fun tagConfigurationValues(instanceId: String, configName: String, tagName: String) { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val configValues = hashMapOf() configValues["tag-name"] = tagName @@ -554,7 +555,7 @@ class K8sPluginInstanceApi( } fun deleteInstanceHealthCheck(instanceId: String, healthCheckId: String) { - val rbInstanceService = K8sRbInstanceRestClient(k8sConfiguration, instanceId) + val rbInstanceService = getK8sRbInstanceRestClient(k8sConfiguration, instanceId) try { val result: BlueprintWebClientService.WebClientResponse = rbInstanceService.exchangeResource( DELETE.name,