diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3d872f628da12898f872b41465d9794dfc5c0684..3f669e27a7079fdd5a208bcb1fa754ba00491cc4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,7 +21,7 @@ include:
- ci-templates/default.yml
- ci-templates/build.yml
rules:
- - if: '$CI_COMMIT_REF_PROTECTED && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'
+ - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"'
- project: osl/code/org.etsi.osl.main
ref: develop
@@ -29,7 +29,7 @@ include:
- ci-templates/default.yml
- ci-templates/build_unprotected.yml
rules:
- - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && !$CI_COMMIT_REF_PROTECTED'
+ - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && $CI_COMMIT_REF_PROTECTED == "false"'
maven_build:
extends: .maven_build
diff --git a/pom.xml b/pom.xml
index 6e5f80ab7c186f8b0cd7ee020e743801e1cb83a4..3be3531f6abae49242365a55004314b34eef04e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,12 +5,13 @@
org.etsi.osl
org.etsi.osl.main
- 1.0.0
+ 2024Q4
../org.etsi.osl.main
org.etsi.osl.model.k8s
+ ${org.etsi.osl.model.k8s.version}
diff --git a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java
index c550be833d14a3d6276b1d33a51f44cf88fc4847..d634df07d59c1a30a125fc9b99c4605f705e44bb 100644
--- a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java
+++ b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java
@@ -115,7 +115,7 @@ public class KubernetesCRV1 extends DomainModelDefinition
rsc.addResourceSpecificationCharacteristicItemShort( "UID", "", EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort( "namespace", "", EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort( "metadata", "", EValueType.TEXT.getValue(), "", false);
- rsc.addResourceSpecificationCharacteristicItemShort( "yaml", "", EValueType.TEXT.getValue(), "", false);
+// rsc.addResourceSpecificationCharacteristicItemShort( "yaml", "", EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort( "json", "", EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort( "_CR_SPEC", "", EValueType.TEXT.getValue(), "Used for providing the json Custom Resource description to apply", false);
@@ -179,7 +179,7 @@ public class KubernetesCRV1 extends DomainModelDefinition
rs.addResourceCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("namespace", this.namespace, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("metadata", this.metadata, EValueType.TEXT.getValue());
- rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
+// rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue());
diff --git a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesConfigMap.java b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesConfigMap.java
new file mode 100644
index 0000000000000000000000000000000000000000..2e4457ac7ee6af1f93aa467106a3bce6ff4aa699
--- /dev/null
+++ b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesConfigMap.java
@@ -0,0 +1,219 @@
+package org.etsi.osl.domain.model.kubernetes;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+import org.etsi.osl.domain.model.DomainModelDefinition;
+import org.etsi.osl.domain.model.ITMFRCM634_ModelTransformer;
+import org.etsi.osl.domain.model.ITMFRI639_ModelTransformer;
+import org.etsi.osl.tmf.common.model.ELifecycle;
+import org.etsi.osl.tmf.common.model.EValueType;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecification;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationCreate;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationUpdate;
+import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.ri639.model.ResourceOperationalStateType;
+import org.etsi.osl.tmf.ri639.model.ResourceStatusType;
+import org.etsi.osl.tmf.ri639.model.ResourceUpdate;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author ctranoris
+ */
+@Getter
+@Setter
+public class KubernetesConfigMap extends DomainModelDefinition
+ implements ITMFRCM634_ModelTransformer, ITMFRI639_ModelTransformer {
+
+ public static final String OSL_KUBCMAP_RSPEC_NAME = "kubernetes-configmap.openslice.io";
+ public static final String OSL_KUBCMAP_RSPEC_VERSION = "0.0.1";
+ public static final String OSL_KUBCMAP_RSPEC_CATEGORY = "ConfigMap/Kubernetes/v1";
+ public static final String OSL_KUBCMAP_RESOURCE_CATEGORY = "ConfigMap/Kubernetes/v1";
+ public static final String OSL_KUBCMAP_RSPEC_TYPE = "LogicalResourceSpecification";
+ public static final String OSL_KUBCMAP_RSPEC_DESCRIPTION = "This Specification is used to describe a generic Kubernetes Service";
+
+ private String osl_KUBCRD_RSPEC_UUID = null; //this is assigned by the system through the DB for a specific instance
+
+ private String clusterMasterURL;
+ private String currentContextCluster;
+ private String fullResourceName;
+ private String kind;
+ private String apiGroup;
+ private String UID;
+ private String metadata;
+ private String yaml;
+ private String json;
+ private String namespace;
+
+
+ private Map data;
+ private String dataObj;
+ private Map properties;
+
+
+ @Builder
+ public KubernetesConfigMap(String osl_KUBCRD_RSPEC_UUID, String uuid, String name, String version, String description, String category,
+ String clusterMasterURL, String currentContextCluster, String fullResourceName, String namespace,
+ String kind, String apiGroup, String uID,
+ String metadata,
+ String yaml,
+ String json) {
+ super(uuid, name, version, description, category);
+ this.osl_KUBCRD_RSPEC_UUID = osl_KUBCRD_RSPEC_UUID;
+ this.clusterMasterURL = clusterMasterURL;
+ this.currentContextCluster = currentContextCluster;
+ this.fullResourceName = fullResourceName;
+ this.kind = kind;
+ this.apiGroup = apiGroup;
+ this.namespace = namespace;
+ this.UID = uID;
+ this.metadata = metadata;
+ this.yaml = yaml;
+ this.json = json;
+ this.properties = new HashMap<>();
+ this.data = new HashMap<>();
+ this.category = OSL_KUBCMAP_RSPEC_CATEGORY;
+ }
+
+
+
+ @Override
+ public ResourceSpecificationCreate toRSpecCreate_InitRepo() {
+
+ ResourceSpecificationCreate rsc = this.toRSpecCreate();
+ rsc.setName( OSL_KUBCMAP_RSPEC_NAME );
+ rsc.setCategory( OSL_KUBCMAP_RSPEC_CATEGORY );
+ rsc.setVersion(OSL_KUBCMAP_RSPEC_VERSION);
+ rsc.setDescription( OSL_KUBCMAP_RSPEC_DESCRIPTION );
+ rsc.setType( OSL_KUBCMAP_RSPEC_TYPE );
+
+
+
+ return rsc;
+ }
+
+ @Override
+ public ResourceSpecificationCreate toRSpecCreate() {
+
+ ResourceSpecificationCreate rsc = new ResourceSpecificationCreate();
+ rsc.setName( this.name );
+ rsc.setCategory( OSL_KUBCMAP_RSPEC_CATEGORY );
+ rsc.setVersion( this.version );
+ rsc.setDescription( this.version );
+ rsc.setType( OSL_KUBCMAP_RSPEC_TYPE );
+
+ rsc.setLifecycleStatus( ELifecycle.ACTIVE.getValue() );
+ rsc.addResourceSpecificationCharacteristicItemShort("clusterMasterURL", this.clusterMasterURL, EValueType.TEXT.getValue(), "URL of cluster", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("currentContextCluster", this.currentContextCluster, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("fullResourceName", this.fullResourceName, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("Kind", this.kind, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue(), "", false);
+// rsc.addResourceSpecificationCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("data", this.dataObj, EValueType.OBJECT.getValue(), "", false);
+
+ if (this.properties != null)
+ this.properties.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rsc.addResourceSpecificationCharacteristicItemShort(kPropName , vProVal, etype.getValue(), "", false);
+
+ });
+ if (this.data != null)
+ this.data.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rsc.addResourceSpecificationCharacteristicItemShort(kPropName , vProVal, etype.getValue(), "", false);
+
+ });
+
+
+
+ return rsc;
+ }
+
+ @Override
+ public ResourceSpecificationUpdate toRSpecUpdate() {
+ return this.toRSpecCreate();
+ }
+
+ @Override
+ public KubernetesConfigMap fromRSpec(ResourceSpecification rSpec) {
+ this.osl_KUBCRD_RSPEC_UUID = rSpec.getUuid();
+ return this;
+ }
+
+ @Override
+ public ResourceCreate toResourceCreate() {
+
+ if (osl_KUBCRD_RSPEC_UUID == null) {
+ return null;
+ }
+
+ ResourceSpecificationRef rSpecRef = new ResourceSpecificationRef();
+ rSpecRef.setId( osl_KUBCRD_RSPEC_UUID );
+ rSpecRef.setName( OSL_KUBCMAP_RSPEC_NAME );
+ rSpecRef.setVersion( OSL_KUBCMAP_RSPEC_VERSION );
+
+ ResourceCreate rs = new ResourceCreate();
+ rs.name( this.name )
+ .category( OSL_KUBCMAP_RESOURCE_CATEGORY )
+ .description( this.description )
+ .resourceStatus( ResourceStatusType.AVAILABLE )
+ .operationalState( ResourceOperationalStateType.ENABLE )
+ .resourceSpecification( rSpecRef )
+ .resourceVersion( this.version);
+
+ String cprefix = "";
+ if ( this.name.indexOf('@')>0) {
+ String firstToken = this.name.substring( 0, this.name.indexOf('@') );
+ cprefix = this.kind + "." + firstToken + ".";
+ }
+
+
+ rs.addResourceCharacteristicItemShort("clusterMasterURL", this.clusterMasterURL, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("currentContextCluster", this.currentContextCluster, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("fullResourceName", this.fullResourceName, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("Kind", this.kind, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue());
+// //rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("data", this.dataObj, EValueType.OBJECT.getValue());
+
+
+ if (this.properties != null)
+ this.properties.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
+
+ });
+ if (this.data != null)
+ this.data.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
+
+ });
+
+
+
+
+ return rs;
+ }
+
+ @Override
+ public ResourceUpdate toResourceUpdate() {
+
+ return this.toResourceCreate();
+ }
+
+}
diff --git a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java
index 820c777f39fcc275e8d3eea9d6b822313cd057cc..275dcebdfa24d42e747bcd80a1f4830072724f91 100644
--- a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java
+++ b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java
@@ -2,6 +2,7 @@ package org.etsi.osl.domain.model.kubernetes;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
import org.etsi.osl.domain.model.DomainModelDefinition;
import org.etsi.osl.domain.model.ITMFRCM634_ModelTransformer;
import org.etsi.osl.domain.model.ITMFRI639_ModelTransformer;
@@ -112,7 +113,7 @@ public class KubernetesSecret extends DomainModelDefinition
rsc.addResourceSpecificationCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue(), "", false);
- rsc.addResourceSpecificationCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue(), "", false);
+// rsc.addResourceSpecificationCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue(), "", false);
rsc.addResourceSpecificationCharacteristicItemShort("data", this.dataObj, EValueType.OBJECT.getValue(), "", false);
@@ -168,6 +169,13 @@ public class KubernetesSecret extends DomainModelDefinition
.resourceSpecification( rSpecRef )
.resourceVersion( this.version);
+ String cprefix = "";
+ if ( this.name.indexOf('@')>0) {
+ String firstToken = this.name.substring( 0, this.name.indexOf('@') );
+ cprefix = this.kind + "." + firstToken + ".";
+ }
+
+
rs.addResourceCharacteristicItemShort("clusterMasterURL", this.clusterMasterURL, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("currentContextCluster", this.currentContextCluster, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("fullResourceName", this.fullResourceName, EValueType.TEXT.getValue());
@@ -175,26 +183,24 @@ public class KubernetesSecret extends DomainModelDefinition
rs.addResourceCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue());
- rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
+// //rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue());
rs.addResourceCharacteristicItemShort("data", this.dataObj, EValueType.OBJECT.getValue());
-
-
if (this.properties != null)
this.properties.forEach((kPropName, vProVal) -> {
EValueType etype;
etype = EValueType.TEXT;
- rs.addResourceCharacteristicItemShort(kPropName , vProVal, etype.getValue());
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
});
if (this.data != null)
this.data.forEach((kPropName, vProVal) -> {
EValueType etype;
etype = EValueType.TEXT;
- rs.addResourceCharacteristicItemShort(kPropName , vProVal, etype.getValue());
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
});
diff --git a/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesService.java b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesService.java
new file mode 100644
index 0000000000000000000000000000000000000000..38fa5cead4d89a431c9976281e900c23d22e0284
--- /dev/null
+++ b/src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesService.java
@@ -0,0 +1,242 @@
+package org.etsi.osl.domain.model.kubernetes;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+import org.etsi.osl.domain.model.DomainModelDefinition;
+import org.etsi.osl.domain.model.ITMFRCM634_ModelTransformer;
+import org.etsi.osl.domain.model.ITMFRI639_ModelTransformer;
+import org.etsi.osl.tmf.common.model.ELifecycle;
+import org.etsi.osl.tmf.common.model.EValueType;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecification;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationCreate;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationRef;
+import org.etsi.osl.tmf.rcm634.model.ResourceSpecificationUpdate;
+import org.etsi.osl.tmf.ri639.model.ResourceCreate;
+import org.etsi.osl.tmf.ri639.model.ResourceOperationalStateType;
+import org.etsi.osl.tmf.ri639.model.ResourceStatusType;
+import org.etsi.osl.tmf.ri639.model.ResourceUpdate;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author ctranoris
+ */
+@Getter
+@Setter
+public class KubernetesService extends DomainModelDefinition
+ implements ITMFRCM634_ModelTransformer, ITMFRI639_ModelTransformer {
+
+ public static final String OSL_KUBSERVICE_RSPEC_NAME = "kubernetes-service.openslice.io";
+ public static final String OSL_KUBSERVICE_RSPEC_VERSION = "0.0.1";
+ public static final String OSL_KUBSERVICE_RSPEC_CATEGORY = "Service/Kubernetes/v1";
+ public static final String OSL_KUBSERVICE_RESOURCE_CATEGORY = "Service/Kubernetes/v1";
+ public static final String OSL_KUBSERVICE_RSPEC_TYPE = "LogicalResourceSpecification";
+ public static final String OSL_KUBSERVICE_RSPEC_DESCRIPTION = "This Specification is used to describe a generic Kubernetes Service";
+
+ private String osl_KUBCRD_RSPEC_UUID = null; //this is assigned by the system through the DB for a specific instance
+
+ private String clusterMasterURL;
+ private String currentContextCluster;
+ private String fullResourceName;
+ private String kind;
+ private String apiGroup;
+ private String UID;
+ private String metadata;
+ private String yaml;
+ private String json;
+ private String namespace;
+
+
+ private Map spec;
+ private String specObj;
+ private Map status;
+ private String statusObj;
+ private Map properties;
+
+
+ @Builder
+ public KubernetesService(String osl_KUBCRD_RSPEC_UUID, String uuid, String name, String version, String description, String category,
+ String clusterMasterURL, String currentContextCluster, String fullResourceName, String namespace,
+ String kind, String apiGroup, String uID,
+ String metadata,
+ String yaml,
+ String json) {
+ super(uuid, name, version, description, category);
+ this.osl_KUBCRD_RSPEC_UUID = osl_KUBCRD_RSPEC_UUID;
+ this.clusterMasterURL = clusterMasterURL;
+ this.currentContextCluster = currentContextCluster;
+ this.fullResourceName = fullResourceName;
+ this.kind = kind;
+ this.apiGroup = apiGroup;
+ this.namespace = namespace;
+ this.UID = uID;
+ this.metadata = metadata;
+ this.yaml = yaml;
+ this.json = json;
+ this.spec = new HashMap<>();
+ this.status = new HashMap<>();
+ this.properties = new HashMap<>();
+ this.category = OSL_KUBSERVICE_RSPEC_CATEGORY;
+ }
+
+
+
+ @Override
+ public ResourceSpecificationCreate toRSpecCreate_InitRepo() {
+
+ ResourceSpecificationCreate rsc = this.toRSpecCreate();
+ rsc.setName( OSL_KUBSERVICE_RSPEC_NAME );
+ rsc.setCategory( OSL_KUBSERVICE_RSPEC_CATEGORY );
+ rsc.setVersion(OSL_KUBSERVICE_RSPEC_VERSION);
+ rsc.setDescription( OSL_KUBSERVICE_RSPEC_DESCRIPTION );
+ rsc.setType( OSL_KUBSERVICE_RSPEC_TYPE );
+
+
+
+ return rsc;
+ }
+
+ @Override
+ public ResourceSpecificationCreate toRSpecCreate() {
+
+ ResourceSpecificationCreate rsc = new ResourceSpecificationCreate();
+ rsc.setName( this.name );
+ rsc.setCategory( OSL_KUBSERVICE_RSPEC_CATEGORY );
+ rsc.setVersion( this.version );
+ rsc.setDescription( this.version );
+ rsc.setType( OSL_KUBSERVICE_RSPEC_TYPE );
+
+ rsc.setLifecycleStatus( ELifecycle.ACTIVE.getValue() );
+ rsc.addResourceSpecificationCharacteristicItemShort("clusterMasterURL", this.clusterMasterURL, EValueType.TEXT.getValue(), "URL of cluster", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("currentContextCluster", this.currentContextCluster, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("fullResourceName", this.fullResourceName, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("Kind", this.kind, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue(), "", false);
+// rsc.addResourceSpecificationCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("spec", this.specObj, EValueType.OBJECT.getValue(), "", false);
+ rsc.addResourceSpecificationCharacteristicItemShort("status", this.statusObj, EValueType.OBJECT.getValue(), "", false);
+
+
+
+
+
+ if (this.status != null)
+ this.status.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rsc.addResourceSpecificationCharacteristicItemShort( kPropName , vProVal, etype.getValue(), "", false);
+
+ });
+ if (this.spec != null)
+ this.spec.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rsc.addResourceSpecificationCharacteristicItemShort( kPropName , vProVal, etype.getValue(), "", false);
+
+ });
+ if (this.properties != null)
+ this.properties.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rsc.addResourceSpecificationCharacteristicItemShort( kPropName , vProVal, etype.getValue(), "", false);
+
+ });
+
+
+
+ return rsc;
+ }
+
+ @Override
+ public ResourceSpecificationUpdate toRSpecUpdate() {
+ return this.toRSpecCreate();
+ }
+
+ @Override
+ public KubernetesService fromRSpec(ResourceSpecification rSpec) {
+ this.osl_KUBCRD_RSPEC_UUID = rSpec.getUuid();
+ return this;
+ }
+
+ @Override
+ public ResourceCreate toResourceCreate() {
+
+ if (osl_KUBCRD_RSPEC_UUID == null) {
+ return null;
+ }
+
+ ResourceSpecificationRef rSpecRef = new ResourceSpecificationRef();
+ rSpecRef.setId( osl_KUBCRD_RSPEC_UUID );
+ rSpecRef.setName( OSL_KUBSERVICE_RSPEC_NAME );
+ rSpecRef.setVersion( OSL_KUBSERVICE_RSPEC_VERSION );
+
+ ResourceCreate rs = new ResourceCreate();
+ rs.name( this.name )
+ .category( OSL_KUBSERVICE_RESOURCE_CATEGORY )
+ .description( this.description )
+ .resourceStatus( ResourceStatusType.AVAILABLE )
+ .operationalState( ResourceOperationalStateType.ENABLE )
+ .resourceSpecification( rSpecRef )
+ .resourceVersion( this.version);
+
+ String cprefix = "";
+ if ( this.name.indexOf('@')>0) {
+ String firstToken = this.name.substring( 0, this.name.indexOf('@') );
+ cprefix = this.kind + "." + firstToken + ".";
+ }
+
+ rs.addResourceCharacteristicItemShort("clusterMasterURL", this.clusterMasterURL, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("currentContextCluster", this.currentContextCluster, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("fullResourceName", this.fullResourceName, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("Kind", this.kind, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("apiGroup", this.apiGroup, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("UID", this.UID, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("metadata", this.metadata, EValueType.OBJECT.getValue());
+// //rs.addResourceCharacteristicItemShort("yaml", this.yaml, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("json", this.json, EValueType.TEXT.getValue());
+ rs.addResourceCharacteristicItemShort("spec", this.specObj, EValueType.OBJECT.getValue());
+ rs.addResourceCharacteristicItemShort("status", this.statusObj, EValueType.OBJECT.getValue());
+
+
+
+ if (this.status != null)
+ this.status.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
+
+ });
+ if (this.spec != null)
+ this.spec.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
+
+ });
+ if (this.properties != null)
+ this.properties.forEach((kPropName, vProVal) -> {
+ EValueType etype;
+ etype = EValueType.TEXT;
+
+ rs.addResourceCharacteristicItemShort( kPropName , vProVal, etype.getValue());
+
+ });
+
+
+
+ return rs;
+ }
+
+ @Override
+ public ResourceUpdate toResourceUpdate() {
+
+ return this.toResourceCreate();
+ }
+
+}