Loading .gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 pom.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,13 @@ <parent> <groupId>org.etsi.osl</groupId> <artifactId>org.etsi.osl.main</artifactId> <version>1.0.0</version> <version>2024Q4</version> <relativePath>../org.etsi.osl.main</relativePath> </parent> <artifactId>org.etsi.osl.model.k8s</artifactId> <version>${org.etsi.osl.model.k8s.version}</version> <properties> Loading src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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()); Loading src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesConfigMap.java 0 → 100644 +219 −0 Original line number Diff line number Diff line 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<String, String> data; private String dataObj; private Map<String, String> 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(); } } src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java +12 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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()); Loading @@ -175,13 +183,11 @@ 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; Loading Loading
.gitlab-ci.yml +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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
pom.xml +2 −1 Original line number Diff line number Diff line Loading @@ -5,12 +5,13 @@ <parent> <groupId>org.etsi.osl</groupId> <artifactId>org.etsi.osl.main</artifactId> <version>1.0.0</version> <version>2024Q4</version> <relativePath>../org.etsi.osl.main</relativePath> </parent> <artifactId>org.etsi.osl.model.k8s</artifactId> <version>${org.etsi.osl.model.k8s.version}</version> <properties> Loading
src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesCRV1.java +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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()); Loading
src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesConfigMap.java 0 → 100644 +219 −0 Original line number Diff line number Diff line 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<String, String> data; private String dataObj; private Map<String, String> 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(); } }
src/main/java/org/etsi/osl/domain/model/kubernetes/KubernetesSecret.java +12 −6 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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()); Loading @@ -175,13 +183,11 @@ 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; Loading