org.cdk8s.grafana.GrafanaProps Maven / Gradle / Ivy
Show all versions of cdk8s-grafana Show documentation
package org.cdk8s.grafana;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-27T12:17:25.543Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.grafana.$Module.class, fqn = "cdk8s-grafana.GrafanaProps")
@software.amazon.jsii.Jsii.Proxy(GrafanaProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface GrafanaProps extends software.amazon.jsii.JsiiSerializable {
/**
* Default admin password.
*
* Default: "secret"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getAdminPassword() {
return null;
}
/**
* Default admin username.
*
* Default: "root"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getAdminUser() {
return null;
}
/**
* Default data source - equivalent to calling grafana.addDataSource
.
*
* Default: - no data source added
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.grafana.DataSourceProps getDefaultDataSource() {
return null;
}
/**
* Specify a custom image for Grafana.
*
* Default: "public.ecr.aws/ubuntu/grafana:latest"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getImage() {
return null;
}
/**
* Create an ingress to provide external access to the Grafana cluster.
*
* Default: true
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getIngress() {
return null;
}
/**
* Labels to apply to all Grafana resources.
*
* Default: - { app: "grafana" }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.Map getLabels() {
return null;
}
/**
* Namespace to apply to all Grafana resources.
*
* The Grafana Operator must be
* installed in this namespace for resources to be recognized.
*
* Default: - undefined (will be assigned to the 'default' namespace)
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getNamespace() {
return null;
}
/**
* Require login in order to view or manage dashboards.
*
* Default: false
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getRequireLogin() {
return null;
}
/**
* Type of service to be created (NodePort, ClusterIP or LoadBalancer).
*
* Default: ClusterIP
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getServiceType() {
return null;
}
/**
* @return a {@link Builder} of {@link GrafanaProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GrafanaProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String adminPassword;
java.lang.String adminUser;
org.cdk8s.grafana.DataSourceProps defaultDataSource;
java.lang.String image;
java.lang.Boolean ingress;
java.util.Map labels;
java.lang.String namespace;
java.lang.Boolean requireLogin;
java.lang.String serviceType;
/**
* Sets the value of {@link GrafanaProps#getAdminPassword}
* @param adminPassword Default admin password.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder adminPassword(java.lang.String adminPassword) {
this.adminPassword = adminPassword;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getAdminUser}
* @param adminUser Default admin username.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder adminUser(java.lang.String adminUser) {
this.adminUser = adminUser;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getDefaultDataSource}
* @param defaultDataSource Default data source - equivalent to calling grafana.addDataSource
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder defaultDataSource(org.cdk8s.grafana.DataSourceProps defaultDataSource) {
this.defaultDataSource = defaultDataSource;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getImage}
* @param image Specify a custom image for Grafana.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder image(java.lang.String image) {
this.image = image;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getIngress}
* @param ingress Create an ingress to provide external access to the Grafana cluster.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder ingress(java.lang.Boolean ingress) {
this.ingress = ingress;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getLabels}
* @param labels Labels to apply to all Grafana resources.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder labels(java.util.Map labels) {
this.labels = labels;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getNamespace}
* @param namespace Namespace to apply to all Grafana resources.
* The Grafana Operator must be
* installed in this namespace for resources to be recognized.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder namespace(java.lang.String namespace) {
this.namespace = namespace;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getRequireLogin}
* @param requireLogin Require login in order to view or manage dashboards.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder requireLogin(java.lang.Boolean requireLogin) {
this.requireLogin = requireLogin;
return this;
}
/**
* Sets the value of {@link GrafanaProps#getServiceType}
* @param serviceType Type of service to be created (NodePort, ClusterIP or LoadBalancer).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder serviceType(java.lang.String serviceType) {
this.serviceType = serviceType;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GrafanaProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public GrafanaProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link GrafanaProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements GrafanaProps {
private final java.lang.String adminPassword;
private final java.lang.String adminUser;
private final org.cdk8s.grafana.DataSourceProps defaultDataSource;
private final java.lang.String image;
private final java.lang.Boolean ingress;
private final java.util.Map labels;
private final java.lang.String namespace;
private final java.lang.Boolean requireLogin;
private final java.lang.String serviceType;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.adminPassword = software.amazon.jsii.Kernel.get(this, "adminPassword", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.adminUser = software.amazon.jsii.Kernel.get(this, "adminUser", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.defaultDataSource = software.amazon.jsii.Kernel.get(this, "defaultDataSource", software.amazon.jsii.NativeType.forClass(org.cdk8s.grafana.DataSourceProps.class));
this.image = software.amazon.jsii.Kernel.get(this, "image", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.ingress = software.amazon.jsii.Kernel.get(this, "ingress", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.labels = software.amazon.jsii.Kernel.get(this, "labels", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.namespace = software.amazon.jsii.Kernel.get(this, "namespace", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.requireLogin = software.amazon.jsii.Kernel.get(this, "requireLogin", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.serviceType = software.amazon.jsii.Kernel.get(this, "serviceType", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.adminPassword = builder.adminPassword;
this.adminUser = builder.adminUser;
this.defaultDataSource = builder.defaultDataSource;
this.image = builder.image;
this.ingress = builder.ingress;
this.labels = builder.labels;
this.namespace = builder.namespace;
this.requireLogin = builder.requireLogin;
this.serviceType = builder.serviceType;
}
@Override
public final java.lang.String getAdminPassword() {
return this.adminPassword;
}
@Override
public final java.lang.String getAdminUser() {
return this.adminUser;
}
@Override
public final org.cdk8s.grafana.DataSourceProps getDefaultDataSource() {
return this.defaultDataSource;
}
@Override
public final java.lang.String getImage() {
return this.image;
}
@Override
public final java.lang.Boolean getIngress() {
return this.ingress;
}
@Override
public final java.util.Map getLabels() {
return this.labels;
}
@Override
public final java.lang.String getNamespace() {
return this.namespace;
}
@Override
public final java.lang.Boolean getRequireLogin() {
return this.requireLogin;
}
@Override
public final java.lang.String getServiceType() {
return this.serviceType;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getAdminPassword() != null) {
data.set("adminPassword", om.valueToTree(this.getAdminPassword()));
}
if (this.getAdminUser() != null) {
data.set("adminUser", om.valueToTree(this.getAdminUser()));
}
if (this.getDefaultDataSource() != null) {
data.set("defaultDataSource", om.valueToTree(this.getDefaultDataSource()));
}
if (this.getImage() != null) {
data.set("image", om.valueToTree(this.getImage()));
}
if (this.getIngress() != null) {
data.set("ingress", om.valueToTree(this.getIngress()));
}
if (this.getLabels() != null) {
data.set("labels", om.valueToTree(this.getLabels()));
}
if (this.getNamespace() != null) {
data.set("namespace", om.valueToTree(this.getNamespace()));
}
if (this.getRequireLogin() != null) {
data.set("requireLogin", om.valueToTree(this.getRequireLogin()));
}
if (this.getServiceType() != null) {
data.set("serviceType", om.valueToTree(this.getServiceType()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-grafana.GrafanaProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GrafanaProps.Jsii$Proxy that = (GrafanaProps.Jsii$Proxy) o;
if (this.adminPassword != null ? !this.adminPassword.equals(that.adminPassword) : that.adminPassword != null) return false;
if (this.adminUser != null ? !this.adminUser.equals(that.adminUser) : that.adminUser != null) return false;
if (this.defaultDataSource != null ? !this.defaultDataSource.equals(that.defaultDataSource) : that.defaultDataSource != null) return false;
if (this.image != null ? !this.image.equals(that.image) : that.image != null) return false;
if (this.ingress != null ? !this.ingress.equals(that.ingress) : that.ingress != null) return false;
if (this.labels != null ? !this.labels.equals(that.labels) : that.labels != null) return false;
if (this.namespace != null ? !this.namespace.equals(that.namespace) : that.namespace != null) return false;
if (this.requireLogin != null ? !this.requireLogin.equals(that.requireLogin) : that.requireLogin != null) return false;
return this.serviceType != null ? this.serviceType.equals(that.serviceType) : that.serviceType == null;
}
@Override
public final int hashCode() {
int result = this.adminPassword != null ? this.adminPassword.hashCode() : 0;
result = 31 * result + (this.adminUser != null ? this.adminUser.hashCode() : 0);
result = 31 * result + (this.defaultDataSource != null ? this.defaultDataSource.hashCode() : 0);
result = 31 * result + (this.image != null ? this.image.hashCode() : 0);
result = 31 * result + (this.ingress != null ? this.ingress.hashCode() : 0);
result = 31 * result + (this.labels != null ? this.labels.hashCode() : 0);
result = 31 * result + (this.namespace != null ? this.namespace.hashCode() : 0);
result = 31 * result + (this.requireLogin != null ? this.requireLogin.hashCode() : 0);
result = 31 * result + (this.serviceType != null ? this.serviceType.hashCode() : 0);
return result;
}
}
}