This is an automated email from the ASF dual-hosted git repository. gfournier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2c26cc37015bb8a87aae8649bcd05f22e1cc9248 Author: Gaelle Fournier <gaelle.fournier.w...@gmail.com> AuthorDate: Mon Sep 23 15:37:13 2024 +0200 CAMEL-21152: Create Trait Model --- .../commands/kubernetes/traits/model/Addons.java | 55 ++++ .../commands/kubernetes/traits/model/Builder.java | 364 +++++++++++++++++++++ .../commands/kubernetes/traits/model/Camel.java | 88 +++++ .../kubernetes/traits/model/Configuration.java | 51 +++ .../kubernetes/traits/model/Container.java | 350 ++++++++++++++++++++ .../kubernetes/traits/model/Environment.java | 100 ++++++ .../commands/kubernetes/traits/model/Ingress.java | 175 ++++++++++ .../commands/kubernetes/traits/model/Knative.java | 232 +++++++++++++ .../kubernetes/traits/model/KnativeService.java | 228 +++++++++++++ .../commands/kubernetes/traits/model/Mount.java | 141 ++++++++ .../commands/kubernetes/traits/model/Openapi.java | 74 +++++ .../commands/kubernetes/traits/model/Route.java | 261 +++++++++++++++ .../commands/kubernetes/traits/model/Service.java | 119 +++++++ .../kubernetes/traits/model/ServiceBinding.java | 74 +++++ .../commands/kubernetes/traits/model/Traits.java | 215 ++++++++++++ 15 files changed, 2527 insertions(+) diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Addons.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Addons.java new file mode 100644 index 00000000000..64dc2dd1e4d --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Addons.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Addons { + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + public Addons() { + + } + + public Addons(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Builder.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Builder.java new file mode 100644 index 00000000000..376c0c4db7e --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Builder.java @@ -0,0 +1,364 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "annotations", "baseImage", "configuration", "enabled", "incrementalImageBuild", "limitCPU", "limitMemory", + "mavenProfiles", "nodeSelector", "orderStrategy", "platforms", "properties", "requestCPU", "requestMemory", "strategy", + "tasks", "tasksFilter", "tasksLimitCPU", "tasksLimitMemory", "tasksRequestCPU", "tasksRequestMemory", "verbose" }) +public class Builder { + @JsonProperty("annotations") + @JsonPropertyDescription("When using `pod` strategy, annotation to use for the builder pod.") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, String> annotations; + @JsonProperty("baseImage") + @JsonPropertyDescription("Specify a base image. In order to have the application working properly it must be a container image which has a Java JDK installed and ready to use on path (ie `/usr/bin/java`).") + @JsonSetter( + nulls = Nulls.SKIP) + private String baseImage; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("incrementalImageBuild") + @JsonPropertyDescription("Use the incremental image build option, to reuse existing containers (default `true`)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean incrementalImageBuild; + @JsonProperty("limitCPU") + @JsonPropertyDescription("When using `pod` strategy, the maximum amount of CPU required by the pod builder. Deprecated: use TasksRequestCPU instead with task name `builder`.") + @JsonSetter( + nulls = Nulls.SKIP) + private String limitCPU; + @JsonProperty("limitMemory") + @JsonPropertyDescription("When using `pod` strategy, the maximum amount of memory required by the pod builder. Deprecated: use TasksRequestCPU instead with task name `builder`.") + @JsonSetter( + nulls = Nulls.SKIP) + private String limitMemory; + @JsonProperty("mavenProfiles") + @JsonPropertyDescription("A list of references pointing to configmaps/secrets that contains a maven profile. This configmap/secret is a resource of the IntegrationKit created, therefore it needs to be present in the namespace where the operator is going to create the IntegrationKit. The content of the maven profile is expected to be a text containing a valid maven profile starting with `<profile>` and ending with `</profile>` that will be integrated as an inline profile in the POM. S [...] + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> mavenProfiles; + @JsonProperty("nodeSelector") + @JsonPropertyDescription("Defines a set of nodes the builder pod is eligible to be scheduled on, based on labels on the node.") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, String> nodeSelector; + @JsonProperty("orderStrategy") + @JsonPropertyDescription("The build order strategy to use, either `dependencies`, `fifo` or `sequential` (default is the platform default)") + @JsonSetter( + nulls = Nulls.SKIP) + private OrderStrategy orderStrategy; + @JsonProperty("platforms") + @JsonPropertyDescription("The list of manifest platforms to use to build a container image (default `linux/amd64`).") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> platforms; + @JsonProperty("properties") + @JsonPropertyDescription("A list of properties to be provided to the build task") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> properties; + @JsonProperty("requestCPU") + @JsonPropertyDescription("When using `pod` strategy, the minimum amount of CPU required by the pod builder. Deprecated: use TasksRequestCPU instead with task name `builder`.") + @JsonSetter( + nulls = Nulls.SKIP) + private String requestCPU; + @JsonProperty("requestMemory") + @JsonPropertyDescription("When using `pod` strategy, the minimum amount of memory required by the pod builder. Deprecated: use TasksRequestCPU instead with task name `builder`.") + @JsonSetter( + nulls = Nulls.SKIP) + private String requestMemory; + @JsonProperty("strategy") + @JsonPropertyDescription("The strategy to use, either `pod` or `routine` (default `routine`)") + @JsonSetter( + nulls = Nulls.SKIP) + private Strategy strategy; + @JsonProperty("tasks") + @JsonPropertyDescription("A list of tasks to be executed (available only when using `pod` strategy) with format `<name>;<container-image>;<container-command>`.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tasks; + @JsonProperty("tasksFilter") + @JsonPropertyDescription("A list of tasks sorted by the order of execution in a csv format, ie, `<taskName1>,<taskName2>,...`. Mind that you must include also the operator tasks (`builder`, `quarkus-native`, `package`, `jib`, `s2i`) if you need to execute them. Useful only with `pod` strategy.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tasksFilter; + @JsonProperty("tasksLimitCPU") + @JsonPropertyDescription("A list of limit cpu configuration for the specific task with format `<task-name>:<limit-cpu-conf>`.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tasksLimitCPU; + @JsonProperty("tasksLimitMemory") + @JsonPropertyDescription("A list of limit memory configuration for the specific task with format `<task-name>:<limit-memory-conf>`.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tasksLimitMemory; + @JsonProperty("tasksRequestCPU") + @JsonPropertyDescription("A list of request cpu configuration for the specific task with format `<task-name>:<request-cpu-conf>`.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tasksRequestCPU; + @JsonProperty("tasksRequestMemory") + @JsonPropertyDescription("A list of request memory configuration for the specific task with format `<task-name>:<request-memory-conf>`.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tasksRequestMemory; + @JsonProperty("verbose") + @JsonPropertyDescription("Enable verbose logging on build components that support it (e.g. Kaniko build pod). Deprecated no longer in use") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean verbose; + + public Builder() { + } + + public Map<String, String> getAnnotations() { + return this.annotations; + } + + public void setAnnotations(Map<String, String> annotations) { + this.annotations = annotations; + } + + public String getBaseImage() { + return this.baseImage; + } + + public void setBaseImage(String baseImage) { + this.baseImage = baseImage; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean getIncrementalImageBuild() { + return this.incrementalImageBuild; + } + + public void setIncrementalImageBuild(Boolean incrementalImageBuild) { + this.incrementalImageBuild = incrementalImageBuild; + } + + public String getLimitCPU() { + return this.limitCPU; + } + + public void setLimitCPU(String limitCPU) { + this.limitCPU = limitCPU; + } + + public String getLimitMemory() { + return this.limitMemory; + } + + public void setLimitMemory(String limitMemory) { + this.limitMemory = limitMemory; + } + + public List<String> getMavenProfiles() { + return this.mavenProfiles; + } + + public void setMavenProfiles(List<String> mavenProfiles) { + this.mavenProfiles = mavenProfiles; + } + + public Map<String, String> getNodeSelector() { + return this.nodeSelector; + } + + public void setNodeSelector(Map<String, String> nodeSelector) { + this.nodeSelector = nodeSelector; + } + + public OrderStrategy getOrderStrategy() { + return this.orderStrategy; + } + + public void setOrderStrategy(OrderStrategy orderStrategy) { + this.orderStrategy = orderStrategy; + } + + public List<String> getPlatforms() { + return this.platforms; + } + + public void setPlatforms(List<String> platforms) { + this.platforms = platforms; + } + + public List<String> getProperties() { + return this.properties; + } + + public void setProperties(List<String> properties) { + this.properties = properties; + } + + public String getRequestCPU() { + return this.requestCPU; + } + + public void setRequestCPU(String requestCPU) { + this.requestCPU = requestCPU; + } + + public String getRequestMemory() { + return this.requestMemory; + } + + public void setRequestMemory(String requestMemory) { + this.requestMemory = requestMemory; + } + + public Strategy getStrategy() { + return this.strategy; + } + + public void setStrategy(Strategy strategy) { + this.strategy = strategy; + } + + public List<String> getTasks() { + return this.tasks; + } + + public void setTasks(List<String> tasks) { + this.tasks = tasks; + } + + public String getTasksFilter() { + return this.tasksFilter; + } + + public void setTasksFilter(String tasksFilter) { + this.tasksFilter = tasksFilter; + } + + public List<String> getTasksLimitCPU() { + return this.tasksLimitCPU; + } + + public void setTasksLimitCPU(List<String> tasksLimitCPU) { + this.tasksLimitCPU = tasksLimitCPU; + } + + public List<String> getTasksLimitMemory() { + return this.tasksLimitMemory; + } + + public void setTasksLimitMemory(List<String> tasksLimitMemory) { + this.tasksLimitMemory = tasksLimitMemory; + } + + public List<String> getTasksRequestCPU() { + return this.tasksRequestCPU; + } + + public void setTasksRequestCPU(List<String> tasksRequestCPU) { + this.tasksRequestCPU = tasksRequestCPU; + } + + public List<String> getTasksRequestMemory() { + return this.tasksRequestMemory; + } + + public void setTasksRequestMemory(List<String> tasksRequestMemory) { + this.tasksRequestMemory = tasksRequestMemory; + } + + public Boolean getVerbose() { + return this.verbose; + } + + public void setVerbose(Boolean verbose) { + this.verbose = verbose; + } + + public enum OrderStrategy { + @JsonProperty("dependencies") + DEPENDENCIES("dependencies"), + @JsonProperty("fifo") + FIFO("fifo"), + @JsonProperty("sequential") + SEQUENTIAL("sequential"); + + private final String value; + + OrderStrategy(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } + + public enum Strategy { + @JsonProperty("pod") + POD("pod"), + @JsonProperty("routine") + ROUTINE("routine"); + + private final String value; + + Strategy(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Camel.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Camel.java new file mode 100644 index 00000000000..271f8001f84 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Camel.java @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "configuration", "enabled", "properties", "runtimeVersion" }) +public class Camel { + + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("properties") + @JsonPropertyDescription("A list of properties to be provided to the Integration runtime") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> properties; + @JsonProperty("runtimeVersion") + @JsonPropertyDescription("The camel-k-runtime version to use for the integration. It overrides the default version set in the Integration Platform. You can use a fixed version (for example \"3.2.3\") or a semantic version (for example \"3.x\") which will try to resolve to the best matching Catalog existing on the cluster.") + @JsonSetter( + nulls = Nulls.SKIP) + private String runtimeVersion; + + public Camel() { + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public List<String> getProperties() { + return this.properties; + } + + public void setProperties(List<String> properties) { + this.properties = properties; + } + + public String getRuntimeVersion() { + return this.runtimeVersion; + } + + public void setRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Configuration.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Configuration.java new file mode 100644 index 00000000000..ac0a0df2033 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Configuration.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Configuration { + + public Configuration() { + } + + @JsonIgnore + private Map<String, Object> additionalProperties = new HashMap<>(); + + @JsonAnyGetter + public Map<String, Object> getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperties(Map<String, Object> additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Container.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Container.java new file mode 100644 index 00000000000..1010b991887 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Container.java @@ -0,0 +1,350 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "allowPrivilegeEscalation", "auto", "capabilitiesAdd", "capabilitiesDrop", "configuration", "enabled", "expose", + "image", "imagePullPolicy", "limitCPU", "limitMemory", "name", "port", "portName", "requestCPU", "requestMemory", + "runAsNonRoot", "runAsUser", "seccompProfileType", "servicePort", "servicePortName" }) +public class Container { + @JsonProperty("allowPrivilegeEscalation") + @JsonPropertyDescription("Security Context AllowPrivilegeEscalation configuration (default false).") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean allowPrivilegeEscalation; + @JsonProperty("auto") + @JsonPropertyDescription("To automatically enable the trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean auto; + @JsonProperty("capabilitiesAdd") + @JsonPropertyDescription("Security Context Capabilities Add configuration (default none).") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> capabilitiesAdd; + @JsonProperty("capabilitiesDrop") + @JsonPropertyDescription("Security Context Capabilities Drop configuration (default ALL).") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> capabilitiesDrop; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("expose") + @JsonPropertyDescription("Can be used to enable/disable exposure via kubernetes Service.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean expose; + @JsonProperty("image") + @JsonPropertyDescription("The main container image to use for the Integration. When using this parameter the operator will create a synthetic IntegrationKit which won't be able to execute traits requiring CamelCatalog. If the container image you're using is coming from an IntegrationKit, use instead Integration `.spec.integrationKit` parameter. If you're moving the Integration across environments, you will also need to create an \"external\" IntegrationKit.") + @JsonSetter( + nulls = Nulls.SKIP) + private String image; + @JsonProperty("imagePullPolicy") + @JsonPropertyDescription("The pull policy: Always|Never|IfNotPresent") + @JsonSetter( + nulls = Nulls.SKIP) + private ImagePullPolicy imagePullPolicy; + @JsonProperty("limitCPU") + @JsonPropertyDescription("The maximum amount of CPU to be provided (default 500 millicores).") + @JsonSetter( + nulls = Nulls.SKIP) + private String limitCPU; + @JsonProperty("limitMemory") + @JsonPropertyDescription("The maximum amount of memory to be provided (default 512 Mi).") + @JsonSetter( + nulls = Nulls.SKIP) + private String limitMemory; + @JsonProperty("name") + @JsonPropertyDescription("The main container name. It's named `integration` by default.") + @JsonSetter( + nulls = Nulls.SKIP) + private String name; + @JsonProperty("port") + @JsonPropertyDescription("To configure a different port exposed by the container (default `8080`).") + @JsonSetter( + nulls = Nulls.SKIP) + private Long port; + @JsonProperty("portName") + @JsonPropertyDescription("To configure a different port name for the port exposed by the container. It defaults to `http` only when the `expose` parameter is true.") + @JsonSetter( + nulls = Nulls.SKIP) + private String portName; + @JsonProperty("requestCPU") + @JsonPropertyDescription("The minimum amount of CPU required (default 125 millicores).") + @JsonSetter( + nulls = Nulls.SKIP) + private String requestCPU; + @JsonProperty("requestMemory") + @JsonPropertyDescription("The minimum amount of memory required (default 128 Mi).") + @JsonSetter( + nulls = Nulls.SKIP) + private String requestMemory; + @JsonProperty("runAsNonRoot") + @JsonPropertyDescription("Security Context RunAsNonRoot configuration (default false).") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean runAsNonRoot; + @JsonProperty("runAsUser") + @JsonPropertyDescription("Security Context RunAsUser configuration (default none): this value is automatically retrieved in Openshift clusters when not explicitly set.") + @JsonSetter( + nulls = Nulls.SKIP) + private Long runAsUser; + @JsonProperty("seccompProfileType") + @JsonPropertyDescription("Security Context SeccompProfileType configuration (default RuntimeDefault).") + @JsonSetter( + nulls = Nulls.SKIP) + private SeccompProfileType seccompProfileType; + @JsonProperty("servicePort") + @JsonPropertyDescription("To configure under which service port the container port is to be exposed (default `80`).") + @JsonSetter( + nulls = Nulls.SKIP) + private Long servicePort; + @JsonProperty("servicePortName") + @JsonPropertyDescription("To configure under which service port name the container port is to be exposed (default `http`).") + @JsonSetter( + nulls = Nulls.SKIP) + private String servicePortName; + + public Container() { + } + + public Boolean getAllowPrivilegeEscalation() { + return this.allowPrivilegeEscalation; + } + + public void setAllowPrivilegeEscalation(Boolean allowPrivilegeEscalation) { + this.allowPrivilegeEscalation = allowPrivilegeEscalation; + } + + public Boolean getAuto() { + return this.auto; + } + + public void setAuto(Boolean auto) { + this.auto = auto; + } + + public List<String> getCapabilitiesAdd() { + return this.capabilitiesAdd; + } + + public void setCapabilitiesAdd(List<String> capabilitiesAdd) { + this.capabilitiesAdd = capabilitiesAdd; + } + + public List<String> getCapabilitiesDrop() { + return this.capabilitiesDrop; + } + + public void setCapabilitiesDrop(List<String> capabilitiesDrop) { + this.capabilitiesDrop = capabilitiesDrop; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean getExpose() { + return this.expose; + } + + public void setExpose(Boolean expose) { + this.expose = expose; + } + + public String getImage() { + return this.image; + } + + public void setImage(String image) { + this.image = image; + } + + public ImagePullPolicy getImagePullPolicy() { + return this.imagePullPolicy; + } + + public void setImagePullPolicy(ImagePullPolicy imagePullPolicy) { + this.imagePullPolicy = imagePullPolicy; + } + + public String getLimitCPU() { + return this.limitCPU; + } + + public void setLimitCPU(String limitCPU) { + this.limitCPU = limitCPU; + } + + public String getLimitMemory() { + return this.limitMemory; + } + + public void setLimitMemory(String limitMemory) { + this.limitMemory = limitMemory; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getPort() { + return this.port; + } + + public void setPort(Long port) { + this.port = port; + } + + public String getPortName() { + return this.portName; + } + + public void setPortName(String portName) { + this.portName = portName; + } + + public String getRequestCPU() { + return this.requestCPU; + } + + public void setRequestCPU(String requestCPU) { + this.requestCPU = requestCPU; + } + + public String getRequestMemory() { + return this.requestMemory; + } + + public void setRequestMemory(String requestMemory) { + this.requestMemory = requestMemory; + } + + public Boolean getRunAsNonRoot() { + return this.runAsNonRoot; + } + + public void setRunAsNonRoot(Boolean runAsNonRoot) { + this.runAsNonRoot = runAsNonRoot; + } + + public Long getRunAsUser() { + return this.runAsUser; + } + + public void setRunAsUser(Long runAsUser) { + this.runAsUser = runAsUser; + } + + public SeccompProfileType getSeccompProfileType() { + return this.seccompProfileType; + } + + public void setSeccompProfileType(SeccompProfileType seccompProfileType) { + this.seccompProfileType = seccompProfileType; + } + + public Long getServicePort() { + return this.servicePort; + } + + public void setServicePort(Long servicePort) { + this.servicePort = servicePort; + } + + public String getServicePortName() { + return this.servicePortName; + } + + public void setServicePortName(String servicePortName) { + this.servicePortName = servicePortName; + } + + public enum ImagePullPolicy { + @JsonProperty("Always") + ALWAYS("Always"), + @JsonProperty("Never") + NEVER("Never"), + @JsonProperty("IfNotPresent") + IFNOTPRESENT("IfNotPresent"); + + private final String value; + + ImagePullPolicy(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } + + public enum SeccompProfileType { + @JsonProperty("Unconfined") + UNCONFINED("Unconfined"), + @JsonProperty("RuntimeDefault") + RUNTIMEDEFAULT("RuntimeDefault"); + + private final String value; + + SeccompProfileType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Environment.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Environment.java new file mode 100644 index 00000000000..75fd8344e9a --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Environment.java @@ -0,0 +1,100 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "configuration", "containerMeta", "enabled", "httpProxy", "vars" }) +public class Environment { + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("containerMeta") + @JsonPropertyDescription("Enables injection of `NAMESPACE` and `POD_NAME` environment variables (default `true`)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean containerMeta; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("httpProxy") + @JsonPropertyDescription("Propagates the `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` environment variables (default `true`)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean httpProxy; + @JsonProperty("vars") + @JsonPropertyDescription("A list of environment variables to be added to the integration container. The syntax is KEY=VALUE, e.g., `MY_VAR=\"my value\"`. These take precedence over the previously defined environment variables.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> vars; + + public Environment() { + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getContainerMeta() { + return this.containerMeta; + } + + public void setContainerMeta(Boolean containerMeta) { + this.containerMeta = containerMeta; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean getHttpProxy() { + return this.httpProxy; + } + + public void setHttpProxy(Boolean httpProxy) { + this.httpProxy = httpProxy; + } + + public List<String> getVars() { + return this.vars; + } + + public void setVars(List<String> vars) { + this.vars = vars; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Ingress.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Ingress.java new file mode 100644 index 00000000000..df9174418ef --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Ingress.java @@ -0,0 +1,175 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "annotations", "auto", "configuration", "enabled", "host", "path", "pathType", "tlsHosts", "tlsSecretName" }) +public class Ingress { + @JsonProperty("annotations") + @JsonPropertyDescription("The annotations added to the ingress. This can be used to set controller specific annotations, e.g., when using the NGINX Ingress controller: See https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, String> annotations; + @JsonProperty("auto") + @JsonPropertyDescription("To automatically add an ingress whenever the integration uses an HTTP endpoint consumer.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean auto; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("host") + @JsonPropertyDescription("To configure the host exposed by the ingress.") + @JsonSetter( + nulls = Nulls.SKIP) + private String host; + @JsonProperty("path") + @JsonPropertyDescription("To configure the path exposed by the ingress (default `/`).") + @JsonSetter( + nulls = Nulls.SKIP) + private String path; + @JsonProperty("pathType") + @JsonPropertyDescription("To configure the path type exposed by the ingress. One of `Exact`, `Prefix`, `ImplementationSpecific` (default to `Prefix`).") + @JsonSetter( + nulls = Nulls.SKIP) + private PathType pathType; + @JsonProperty("tlsHosts") + @JsonPropertyDescription("To configure tls hosts") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> tlsHosts; + @JsonProperty("tlsSecretName") + @JsonPropertyDescription("To configure tls secret name") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsSecretName; + + public Ingress() { + } + + public Map<String, String> getAnnotations() { + return this.annotations; + } + + public void setAnnotations(Map<String, String> annotations) { + this.annotations = annotations; + } + + public Boolean getAuto() { + return this.auto; + } + + public void setAuto(Boolean auto) { + this.auto = auto; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getHost() { + return this.host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getPath() { + return this.path; + } + + public void setPath(String path) { + this.path = path; + } + + public PathType getPathType() { + return this.pathType; + } + + public void setPathType(PathType pathType) { + this.pathType = pathType; + } + + public List<String> getTlsHosts() { + return this.tlsHosts; + } + + public void setTlsHosts(List<String> tlsHosts) { + this.tlsHosts = tlsHosts; + } + + public String getTlsSecretName() { + return this.tlsSecretName; + } + + public void setTlsSecretName(String tlsSecretName) { + this.tlsSecretName = tlsSecretName; + } + + public enum PathType { + @JsonProperty("Exact") + EXACT("Exact"), + @JsonProperty("Prefix") + PREFIX("Prefix"), + @JsonProperty("ImplementationSpecific") + IMPLEMENTATIONSPECIFIC("ImplementationSpecific"); + + private final String value; + + PathType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Knative.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Knative.java new file mode 100644 index 00000000000..87ed7ba3ffd --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Knative.java @@ -0,0 +1,232 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "auto", "channelSinks", "channelSources", "config", "configuration", "enabled", "endpointSinks", "endpointSources", + "eventSinks", "eventSources", "filterEventType", "filterSourceChannels", "filters", "namespaceLabel", "sinkBinding" }) +public class Knative { + @JsonProperty("auto") + @JsonPropertyDescription("Enable automatic discovery of all trait properties.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean auto; + @JsonProperty("channelSinks") + @JsonPropertyDescription("List of channels used as destination of integration routes. Can contain simple channel names or full Camel URIs.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> channelSinks; + @JsonProperty("channelSources") + @JsonPropertyDescription("List of channels used as source of integration routes. Can contain simple channel names or full Camel URIs.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> channelSources; + @JsonProperty("config") + @JsonPropertyDescription("Can be used to inject a Knative complete configuration in JSON format.") + @JsonSetter( + nulls = Nulls.SKIP) + private String config; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("endpointSinks") + @JsonPropertyDescription("List of endpoints used as destination of integration routes. Can contain simple endpoint names or full Camel URIs.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> endpointSinks; + @JsonProperty("endpointSources") + @JsonPropertyDescription("List of channels used as source of integration routes.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> endpointSources; + @JsonProperty("eventSinks") + @JsonPropertyDescription("List of event types that the integration will produce. Can contain simple event types or full Camel URIs (to use a specific broker).") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> eventSinks; + @JsonProperty("eventSources") + @JsonPropertyDescription("List of event types that the integration will be subscribed to. Can contain simple event types or full Camel URIs (to use a specific broker different from \"default\").") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> eventSources; + @JsonProperty("filterEventType") + @JsonPropertyDescription("Enables the default filtering for the Knative trigger using the event type If this is true, the created Knative trigger uses the event type as a filter on the event stream when no other filter criteria is given. (default: true)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean filterEventType; + @JsonProperty("filterSourceChannels") + @JsonPropertyDescription("Enables filtering on events based on the header \"ce-knativehistory\". Since this header has been removed in newer versions of Knative, filtering is disabled by default.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean filterSourceChannels; + @JsonProperty("filters") + @JsonPropertyDescription("Sets filter attributes on the event stream (such as event type, source, subject and so on). A list of key-value pairs that represent filter attributes and its values. The syntax is KEY=VALUE, e.g., `source=\"my.source\"`. Filter attributes get set on the Knative trigger that is being created as part of this integration.") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> filters; + @JsonProperty("namespaceLabel") + @JsonPropertyDescription("Enables the camel-k-operator to set the \"bindings.knative.dev/include=true\" label to the namespace As Knative requires this label to perform injection of K_SINK URL into the service. If this is false, the integration pod may start and fail, read the SinkBinding Knative documentation. (default: true)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean namespaceLabel; + @JsonProperty("sinkBinding") + @JsonPropertyDescription("Allows binding the integration to a sink via a Knative SinkBinding resource. This can be used when the integration targets a single sink. It's enabled by default when the integration targets a single sink (except when the integration is owned by a Knative source).") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean sinkBinding; + + public Knative() { + } + + public Boolean getAuto() { + return this.auto; + } + + public void setAuto(Boolean auto) { + this.auto = auto; + } + + public List<String> getChannelSinks() { + return this.channelSinks; + } + + public void setChannelSinks(List<String> channelSinks) { + this.channelSinks = channelSinks; + } + + public List<String> getChannelSources() { + return this.channelSources; + } + + public void setChannelSources(List<String> channelSources) { + this.channelSources = channelSources; + } + + public String getConfig() { + return this.config; + } + + public void setConfig(String config) { + this.config = config; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public List<String> getEndpointSinks() { + return this.endpointSinks; + } + + public void setEndpointSinks(List<String> endpointSinks) { + this.endpointSinks = endpointSinks; + } + + public List<String> getEndpointSources() { + return this.endpointSources; + } + + public void setEndpointSources(List<String> endpointSources) { + this.endpointSources = endpointSources; + } + + public List<String> getEventSinks() { + return this.eventSinks; + } + + public void setEventSinks(List<String> eventSinks) { + this.eventSinks = eventSinks; + } + + public List<String> getEventSources() { + return this.eventSources; + } + + public void setEventSources(List<String> eventSources) { + this.eventSources = eventSources; + } + + public Boolean getFilterEventType() { + return this.filterEventType; + } + + public void setFilterEventType(Boolean filterEventType) { + this.filterEventType = filterEventType; + } + + public Boolean getFilterSourceChannels() { + return this.filterSourceChannels; + } + + public void setFilterSourceChannels(Boolean filterSourceChannels) { + this.filterSourceChannels = filterSourceChannels; + } + + public List<String> getFilters() { + return this.filters; + } + + public void setFilters(List<String> filters) { + this.filters = filters; + } + + public Boolean getNamespaceLabel() { + return this.namespaceLabel; + } + + public void setNamespaceLabel(Boolean namespaceLabel) { + this.namespaceLabel = namespaceLabel; + } + + public Boolean getSinkBinding() { + return this.sinkBinding; + } + + public void setSinkBinding(Boolean sinkBinding) { + this.sinkBinding = sinkBinding; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/KnativeService.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/KnativeService.java new file mode 100644 index 00000000000..21129e1f6a6 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/KnativeService.java @@ -0,0 +1,228 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "annotations", "auto", "autoscalingMetric", "autoscalingTarget", "class", "configuration", "enabled", "maxScale", + "minScale", "rolloutDuration", "timeoutSeconds", "visibility" }) +public class KnativeService { + @JsonProperty("annotations") + @JsonPropertyDescription("The annotations added to route. This can be used to set knative service specific annotations CLI usage example: -t \"knative-service.annotations.'haproxy.router.openshift.io/balance'=true\"") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, String> annotations; + @JsonProperty("auto") + @JsonPropertyDescription("Automatically deploy the integration as Knative service when all conditions hold: \n * Integration is using the Knative profile * All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean auto; + @JsonProperty("autoscalingMetric") + @JsonPropertyDescription("Configures the Knative autoscaling metric property (e.g. to set `concurrency` based or `cpu` based autoscaling). \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String autoscalingMetric; + @JsonProperty("autoscalingTarget") + @JsonPropertyDescription("Sets the allowed concurrency level or CPU percentage (depending on the autoscaling metric) for each Pod. \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Long autoscalingTarget; + @JsonProperty("class") + @JsonPropertyDescription("Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling). \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Class _class; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("maxScale") + @JsonPropertyDescription("An upper bound for the number of Pods that can be running in parallel for the integration. Knative has its own cap value that depends on the installation. \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Long maxScale; + @JsonProperty("minScale") + @JsonPropertyDescription("The minimum number of Pods that should be running at any time for the integration. It's **zero** by default, meaning that the integration is scaled down to zero when not used for a configured amount of time. \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Long minScale; + @JsonProperty("rolloutDuration") + @JsonPropertyDescription("Enables to gradually shift traffic to the latest Revision and sets the rollout duration. It's disabled by default and must be expressed as a Golang `time.Duration` string representation, rounded to a second precision.") + @JsonSetter( + nulls = Nulls.SKIP) + private String rolloutDuration; + @JsonProperty("timeoutSeconds") + @JsonPropertyDescription("The maximum duration in seconds that the request instance is allowed to respond to a request. This field propagates to the integration pod's terminationGracePeriodSeconds \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Long timeoutSeconds; + @JsonProperty("visibility") + @JsonPropertyDescription("Setting `cluster-local`, Knative service becomes a private service. Specifically, this option applies the `networking.knative.dev/visibility` label to Knative service. \n Refer to the Knative documentation for more information.") + @JsonSetter( + nulls = Nulls.SKIP) + private Visibility visibility; + + public KnativeService() { + } + + public Map<String, String> getAnnotations() { + return this.annotations; + } + + public void setAnnotations(Map<String, String> annotations) { + this.annotations = annotations; + } + + public Boolean getAuto() { + return this.auto; + } + + public void setAuto(Boolean auto) { + this.auto = auto; + } + + public String getAutoscalingMetric() { + return this.autoscalingMetric; + } + + public void setAutoscalingMetric(String autoscalingMetric) { + this.autoscalingMetric = autoscalingMetric; + } + + public Long getAutoscalingTarget() { + return this.autoscalingTarget; + } + + public void setAutoscalingTarget(Long autoscalingTarget) { + this.autoscalingTarget = autoscalingTarget; + } + + public Class get_class() { + return this._class; + } + + public void set_class(Class _class) { + this._class = _class; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Long getMaxScale() { + return this.maxScale; + } + + public void setMaxScale(Long maxScale) { + this.maxScale = maxScale; + } + + public Long getMinScale() { + return this.minScale; + } + + public void setMinScale(Long minScale) { + this.minScale = minScale; + } + + public String getRolloutDuration() { + return this.rolloutDuration; + } + + public void setRolloutDuration(String rolloutDuration) { + this.rolloutDuration = rolloutDuration; + } + + public Long getTimeoutSeconds() { + return this.timeoutSeconds; + } + + public void setTimeoutSeconds(Long timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + } + + public Visibility getVisibility() { + return this.visibility; + } + + public void setVisibility(Visibility visibility) { + this.visibility = visibility; + } + + public enum Class { + @JsonProperty("kpa.autoscaling.knative.dev") + KPA_AUTOSCALING_KNATIVE_DEV("kpa.autoscaling.knative.dev"), + @JsonProperty("hpa.autoscaling.knative.dev") + HPA_AUTOSCALING_KNATIVE_DEV("hpa.autoscaling.knative.dev"); + + private final String value; + + Class(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } + + public enum Visibility { + @JsonProperty("cluster-local") + CLUSTERLOCAL("cluster-local"); + + private final String value; + + Visibility(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Mount.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Mount.java new file mode 100644 index 00000000000..ad638075acb --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Mount.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "configs", "configuration", "emptyDirs", "enabled", "hotReload", "resources", "scanKameletsImplicitLabelSecrets", + "volumes" }) +public class Mount { + @JsonProperty("configs") + @JsonPropertyDescription("A list of configuration pointing to configmap/secret. The configuration are expected to be UTF-8 resources as they are processed by runtime Camel Context and tried to be parsed as property files. They are also made available on the classpath in order to ease their usage directly from the Route. Syntax: [configmap|secret]:name[/key], where name represents the resource name and key optionally represents the resource key to be filtered") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> configs; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("emptyDirs") + @JsonPropertyDescription("A list of EmptyDir volumes to be mounted. Syntax: [name:/container/path]") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> emptyDirs; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("hotReload") + @JsonPropertyDescription("Enable \"hot reload\" when a secret/configmap mounted is edited (default `false`). The configmap/secret must be marked with `camel.apache.org/integration` label to be taken in account. The resource will be watched for any kind change, also for changes in metadata.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean hotReload; + @JsonProperty("resources") + @JsonPropertyDescription("A list of resources (text or binary content) pointing to configmap/secret. The resources are expected to be any resource type (text or binary content). The destination path can be either a default location or any path specified by the user. Syntax: [configmap|secret]:name[/key][@path], where name represents the resource name, key optionally represents the resource key to be filtered and path represents the destination path") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> resources; + @JsonProperty("scanKameletsImplicitLabelSecrets") + @JsonPropertyDescription("Deprecated: include your properties in an explicit property file backed by a secret. Let the operator to scan for secret labeled with `camel.apache.org/kamelet` and `camel.apache.org/kamelet.configuration`. These secrets are mounted to the application and treated as plain properties file with their key/value list (ie .spec.data[\"camel.my-property\"] = my-value) (default `true`).") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean scanKameletsImplicitLabelSecrets; + @JsonProperty("volumes") + @JsonPropertyDescription("A list of Persistent Volume Claims to be mounted. Syntax: [pvcname:/container/path]") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> volumes; + + public Mount() { + } + + public List<String> getConfigs() { + return this.configs; + } + + public void setConfigs(List<String> configs) { + this.configs = configs; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public List<String> getEmptyDirs() { + return this.emptyDirs; + } + + public void setEmptyDirs(List<String> emptyDirs) { + this.emptyDirs = emptyDirs; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean getHotReload() { + return this.hotReload; + } + + public void setHotReload(Boolean hotReload) { + this.hotReload = hotReload; + } + + public List<String> getResources() { + return this.resources; + } + + public void setResources(List<String> resources) { + this.resources = resources; + } + + public Boolean getScanKameletsImplicitLabelSecrets() { + return this.scanKameletsImplicitLabelSecrets; + } + + public void setScanKameletsImplicitLabelSecrets(Boolean scanKameletsImplicitLabelSecrets) { + this.scanKameletsImplicitLabelSecrets = scanKameletsImplicitLabelSecrets; + } + + public List<String> getVolumes() { + return this.volumes; + } + + public void setVolumes(List<String> volumes) { + this.volumes = volumes; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Openapi.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Openapi.java new file mode 100644 index 00000000000..2283863e0cf --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Openapi.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "configmaps", "configuration", "enabled" }) +public class Openapi { + @JsonProperty("configmaps") + @JsonPropertyDescription("The configmaps holding the spec of the OpenAPI") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> configmaps; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Deprecated: no longer in use.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + + public Openapi() { + } + + public List<String> getConfigmaps() { + return this.configmaps; + } + + public void setConfigmaps(List<String> configmaps) { + this.configmaps = configmaps; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Route.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Route.java new file mode 100644 index 00000000000..107783b88a0 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Route.java @@ -0,0 +1,261 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "annotations", "configuration", "enabled", "host", "tlsCACertificate", "tlsCACertificateSecret", "tlsCertificate", + "tlsCertificateSecret", "tlsDestinationCACertificate", "tlsDestinationCACertificateSecret", + "tlsInsecureEdgeTerminationPolicy", "tlsKey", "tlsKeySecret", "tlsTermination" }) +public class Route { + @JsonProperty("annotations") + @JsonPropertyDescription("The annotations added to route. This can be used to set route specific annotations For annotations options see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations CLI usage example: -t \"route.annotations.'haproxy.router.openshift.io/balance'=true\"") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, String> annotations; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("host") + @JsonPropertyDescription("To configure the host exposed by the route.") + @JsonSetter( + nulls = Nulls.SKIP) + private String host; + @JsonProperty("tlsCACertificate") + @JsonPropertyDescription("The TLS CA certificate contents. \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsCACertificate; + @JsonProperty("tlsCACertificateSecret") + @JsonPropertyDescription("The secret name and key reference to the TLS CA certificate. The format is \"secret-name[/key-name]\", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a \"/\". \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsCACertificateSecret; + @JsonProperty("tlsCertificate") + @JsonPropertyDescription("The TLS certificate contents. \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsCertificate; + @JsonProperty("tlsCertificateSecret") + @JsonPropertyDescription("The secret name and key reference to the TLS certificate. The format is \"secret-name[/key-name]\", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a \"/\". \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsCertificateSecret; + @JsonProperty("tlsDestinationCACertificate") + @JsonPropertyDescription("The destination CA certificate provides the contents of the ca certificate of the final destination. When using reencrypt termination this file should be provided in order to have routers use it for health checks on the secure connection. If this field is not specified, the router may provide its own destination CA and perform hostname validation using the short service name (service.namespace.svc), which allows infrastructure generated certificates to auto [...] + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsDestinationCACertificate; + @JsonProperty("tlsDestinationCACertificateSecret") + @JsonPropertyDescription("The secret name and key reference to the destination CA certificate. The format is \"secret-name[/key-name]\", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a \"/\". \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsDestinationCACertificateSecret; + @JsonProperty("tlsInsecureEdgeTerminationPolicy") + @JsonPropertyDescription("To configure how to deal with insecure traffic, e.g. `Allow`, `Disable` or `Redirect` traffic. \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private TlsInsecureEdgeTerminationPolicy tlsInsecureEdgeTerminationPolicy; + @JsonProperty("tlsKey") + @JsonPropertyDescription("The TLS certificate key contents. \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsKey; + @JsonProperty("tlsKeySecret") + @JsonPropertyDescription("The secret name and key reference to the TLS certificate key. The format is \"secret-name[/key-name]\", the value represents the secret name, if there is only one key in the secret it will be read, otherwise you can set a key name separated with a \"/\". \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private String tlsKeySecret; + @JsonProperty("tlsTermination") + @JsonPropertyDescription("The TLS termination type, like `edge`, `passthrough` or `reencrypt`. \n Refer to the OpenShift route documentation for additional information.") + @JsonSetter( + nulls = Nulls.SKIP) + private TlsTermination tlsTermination; + + public Route() { + } + + public Map<String, String> getAnnotations() { + return this.annotations; + } + + public void setAnnotations(Map<String, String> annotations) { + this.annotations = annotations; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getHost() { + return this.host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getTlsCACertificate() { + return this.tlsCACertificate; + } + + public void setTlsCACertificate(String tlsCACertificate) { + this.tlsCACertificate = tlsCACertificate; + } + + public String getTlsCACertificateSecret() { + return this.tlsCACertificateSecret; + } + + public void setTlsCACertificateSecret(String tlsCACertificateSecret) { + this.tlsCACertificateSecret = tlsCACertificateSecret; + } + + public String getTlsCertificate() { + return this.tlsCertificate; + } + + public void setTlsCertificate(String tlsCertificate) { + this.tlsCertificate = tlsCertificate; + } + + public String getTlsCertificateSecret() { + return this.tlsCertificateSecret; + } + + public void setTlsCertificateSecret(String tlsCertificateSecret) { + this.tlsCertificateSecret = tlsCertificateSecret; + } + + public String getTlsDestinationCACertificate() { + return this.tlsDestinationCACertificate; + } + + public void setTlsDestinationCACertificate(String tlsDestinationCACertificate) { + this.tlsDestinationCACertificate = tlsDestinationCACertificate; + } + + public String getTlsDestinationCACertificateSecret() { + return this.tlsDestinationCACertificateSecret; + } + + public void setTlsDestinationCACertificateSecret(String tlsDestinationCACertificateSecret) { + this.tlsDestinationCACertificateSecret = tlsDestinationCACertificateSecret; + } + + public TlsInsecureEdgeTerminationPolicy getTlsInsecureEdgeTerminationPolicy() { + return this.tlsInsecureEdgeTerminationPolicy; + } + + public void setTlsInsecureEdgeTerminationPolicy(TlsInsecureEdgeTerminationPolicy tlsInsecureEdgeTerminationPolicy) { + this.tlsInsecureEdgeTerminationPolicy = tlsInsecureEdgeTerminationPolicy; + } + + public String getTlsKey() { + return this.tlsKey; + } + + public void setTlsKey(String tlsKey) { + this.tlsKey = tlsKey; + } + + public String getTlsKeySecret() { + return this.tlsKeySecret; + } + + public void setTlsKeySecret(String tlsKeySecret) { + this.tlsKeySecret = tlsKeySecret; + } + + public TlsTermination getTlsTermination() { + return this.tlsTermination; + } + + public void setTlsTermination(TlsTermination tlsTermination) { + this.tlsTermination = tlsTermination; + } + + public enum TlsInsecureEdgeTerminationPolicy { + @JsonProperty("None") + NONE("None"), + @JsonProperty("Allow") + ALLOW("Allow"), + @JsonProperty("Redirect") + REDIRECT("Redirect"); + + private final String value; + + TlsInsecureEdgeTerminationPolicy(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } + + public enum TlsTermination { + @JsonProperty("edge") + EDGE("edge"), + @JsonProperty("reencrypt") + REENCRYPT("reencrypt"), + @JsonProperty("passthrough") + PASSTHROUGH("passthrough"); + + private final String value; + + TlsTermination(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Service.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Service.java new file mode 100644 index 00000000000..356d8eea642 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Service.java @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "auto", "configuration", "enabled", "nodePort", "type" }) +public class Service { + @JsonProperty("auto") + @JsonPropertyDescription("To automatically detect from the code if a Service needs to be created.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean auto; + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("nodePort") + @JsonPropertyDescription("Enable Service to be exposed as NodePort (default `false`). Deprecated: Use service type instead.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean nodePort; + @JsonProperty("type") + @JsonPropertyDescription("The type of service to be used, either 'ClusterIP', 'NodePort' or 'LoadBalancer'.") + @JsonSetter( + nulls = Nulls.SKIP) + private Type type; + + public Service() { + } + + public Boolean getAuto() { + return this.auto; + } + + public void setAuto(Boolean auto) { + this.auto = auto; + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean getNodePort() { + return this.nodePort; + } + + public void setNodePort(Boolean nodePort) { + this.nodePort = nodePort; + } + + public Type getType() { + return this.type; + } + + public void setType(Type type) { + this.type = type; + } + + public enum Type { + @JsonProperty("ClusterIP") + CLUSTERIP("ClusterIP"), + @JsonProperty("NodePort") + NODEPORT("NodePort"), + @JsonProperty("LoadBalancer") + LOADBALANCER("LoadBalancer"); + + private final String value; + + Type(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return this.value; + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/ServiceBinding.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/ServiceBinding.java new file mode 100644 index 00000000000..735991d9429 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/ServiceBinding.java @@ -0,0 +1,74 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "configuration", "enabled", "services" }) +public class ServiceBinding { + @JsonProperty("configuration") + @JsonPropertyDescription("Legacy trait configuration parameters. Deprecated: for backward compatibility.") + @JsonSetter( + nulls = Nulls.SKIP) + private Configuration configuration; + @JsonProperty("enabled") + @JsonPropertyDescription("Can be used to enable or disable a trait. All traits share this common property.") + @JsonSetter( + nulls = Nulls.SKIP) + private Boolean enabled; + @JsonProperty("services") + @JsonPropertyDescription("List of Services in the form [[apigroup/]version:]kind:[namespace/]name") + @JsonSetter( + nulls = Nulls.SKIP) + private List<String> services; + + public ServiceBinding() { + } + + public Configuration getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } + + public Boolean getEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public List<String> getServices() { + return this.services; + } + + public void setServices(List<String> services) { + this.services = services; + } +} diff --git a/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Traits.java b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Traits.java new file mode 100644 index 00000000000..a2261676d5b --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-plugin-kubernetes/src/main/java/org/apache/camel/dsl/jbang/core/commands/kubernetes/traits/model/Traits.java @@ -0,0 +1,215 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.camel.dsl.jbang.core.commands.kubernetes.traits.model; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "camel", "container", "environment", "ingress", "knative", "knative-service", "mount", "openapi", "pod", "route", + "service", "service-binding" }) +public class Traits { + + @JsonProperty("addons") + @JsonPropertyDescription("The extension point with addon traits") + @JsonSetter( + nulls = Nulls.SKIP) + private Map<String, Addons> addons; + + @JsonProperty("builder") + @JsonPropertyDescription("The configuration of Builder trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Builder builder; + + @JsonProperty("camel") + @JsonPropertyDescription("The configuration of Camel trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Camel camel; + + @JsonProperty("container") + @JsonPropertyDescription("The configuration of Container trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Container container; + + @JsonProperty("environment") + @JsonPropertyDescription("The configuration of Environment trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Environment environment; + + @JsonProperty("ingress") + @JsonPropertyDescription("The configuration of Ingress trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Ingress ingress; + + @JsonProperty("knative") + @JsonPropertyDescription("The configuration of Knative trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Knative knative; + + @JsonProperty("knative-service") + @JsonPropertyDescription("The configuration of Knative Service trait") + @JsonSetter( + nulls = Nulls.SKIP) + private KnativeService knativeService; + + @JsonProperty("mount") + @JsonPropertyDescription("The configuration of Mount trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Mount mount; + + @JsonProperty("openapi") + @JsonPropertyDescription("The configuration of OpenAPI trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Openapi openapi; + + @JsonProperty("route") + @JsonPropertyDescription("The configuration of Route trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Route route; + + @JsonProperty("service") + @JsonPropertyDescription("The configuration of Service trait") + @JsonSetter( + nulls = Nulls.SKIP) + private Service service; + @JsonProperty("service-binding") + @JsonPropertyDescription("The configuration of Service Binding trait") + @JsonSetter( + nulls = Nulls.SKIP) + private ServiceBinding serviceBinding; + + public Map<String, Addons> getAddons() { + return this.addons; + } + + public void setAddons(Map<String, Addons> addons) { + this.addons = addons; + } + + public Builder getBuilder() { + return this.builder; + } + + public void setBuilder(Builder builder) { + this.builder = builder; + } + + public Camel getCamel() { + return camel; + } + + public void setCamel(Camel camel) { + this.camel = camel; + } + + public Container getContainer() { + return container; + } + + public void setContainer(Container container) { + this.container = container; + } + + public Environment getEnvironment() { + return environment; + } + + public void setEnvironment(Environment environment) { + this.environment = environment; + } + + public Ingress getIngress() { + return ingress; + } + + public void setIngress(Ingress ingress) { + this.ingress = ingress; + } + + public Knative getKnative() { + return knative; + } + + public void setKnative(Knative knative) { + this.knative = knative; + } + + public KnativeService getKnativeService() { + return knativeService; + } + + public void setKnativeService(KnativeService knativeService) { + this.knativeService = knativeService; + } + + public Mount getMount() { + return mount; + } + + public void setMount(Mount mount) { + this.mount = mount; + } + + public Openapi getOpenapi() { + return openapi; + } + + public void setOpenapi(Openapi openapi) { + this.openapi = openapi; + } + + public Route getRoute() { + return route; + } + + public void setRoute(Route route) { + this.route = route; + } + + public Service getService() { + return service; + } + + public void setService(Service service) { + this.service = service; + } + + public ServiceBinding getServiceBinding() { + return serviceBinding; + } + + public void setServiceBinding(ServiceBinding serviceBinding) { + this.serviceBinding = serviceBinding; + } +}