Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61219,6 +61219,31 @@ components:
- CLOUD_FUNCTION
- CLOUD_RUN_REVISION
- GCE_INSTANCE
GCPProjectFilterConfig:
description: Configuration for filtering the GCP projects that Datadog monitors, by project ID or by project label.
properties:
filters:
description: |-
List of filters matched against the project field set by `type`. Filters support the `*` and `?` wildcards, and a leading `!` makes a filter an exclusion.
A project is skipped if it matches any exclusion filter. When inclusion filters are set, a project must also match at least one of them.
For `project_id`, each filter is a project ID pattern, such as `prod-*`, with up to 15,000 filters.
For `project_label`, each filter is a label in the form `key:value`, such as `env:prod*`, with up to 100 filters. Keys are matched exactly and wildcards apply only to values, so `key:*` matches any value.
example: ["prod-*", "!prod-legacy"]
items:
description: A project filter
type: string
type: array
type:
$ref: "#/components/schemas/GCPProjectFilterConfigType"
type: object
GCPProjectFilterConfigType:
description: The GCP project field that the filters are matched against.
enum: ["project_id", "project_label"]
example: "project_id"
type: string
x-enum-varnames:
- PROJECT_ID
- PROJECT_LABEL
GCPSTSDelegateAccount:
description: Datadog principal service account info.
properties:
Expand Down Expand Up @@ -61353,6 +61378,14 @@ components:
items:
$ref: "#/components/schemas/GCPMonitoredResourceConfig"
type: array
project_filter_configs:
description: |-
Configurations for limiting which of the GCP projects this service account can access are monitored by Datadog, with at most one configuration per type. A project is monitored only if it passes the filters of every configured type. By default, Datadog monitors every project the service account can access.
When updating a service account, omit this field to keep the current filters, or send an empty list to remove them.
example: [{"filters": ["prod-*", "!prod-legacy"], "type": "project_id"}, {"filters": ["env:prod*"], "type": "project_label"}]
items:
$ref: "#/components/schemas/GCPProjectFilterConfig"
type: array
region_filter_configs:
description: Configurations for GCP location filtering, such as region, multi-region, or zone. Only monitored resources that match the specified regions are imported into Datadog. By default, Datadog collects from all locations.
example: ["nam4", "europe-north1"]
Expand Down Expand Up @@ -200108,6 +200141,14 @@ paths:
- filters:
- $KEY:$VALUE
type: gce_instance
project_filter_configs:
- filters:
- prod-*
- "!prod-legacy"
type: project_id
- filters:
- "env:prod*"
type: project_label
region_filter_configs:
- nam4
- europe-north1
Expand Down Expand Up @@ -200206,6 +200247,14 @@ paths:
- filters:
- $KEY:$VALUE
type: gce_instance
project_filter_configs:
- filters:
- prod-*
- "!prod-legacy"
type: project_id
- filters:
- "env:prod*"
type: project_label
region_filter_configs:
- nam4
- europe-north1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

package com.datadog.api.client.v2.model;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
* Configuration for filtering the GCP projects that Datadog monitors, by project ID or by project
* label.
*/
@JsonPropertyOrder({
GCPProjectFilterConfig.JSON_PROPERTY_FILTERS,
GCPProjectFilterConfig.JSON_PROPERTY_TYPE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class GCPProjectFilterConfig {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_FILTERS = "filters";
private List<String> filters = null;

public static final String JSON_PROPERTY_TYPE = "type";
private GCPProjectFilterConfigType type;

public GCPProjectFilterConfig filters(List<String> filters) {
this.filters = filters;
return this;
}

public GCPProjectFilterConfig addFiltersItem(String filtersItem) {
if (this.filters == null) {
this.filters = new ArrayList<>();
}
this.filters.add(filtersItem);
return this;
}

/**
* List of filters matched against the project field set by <code>type</code>. Filters support the
* <code>*</code> and <code>?</code> wildcards, and a leading <code>!</code> makes a filter an
* exclusion. A project is skipped if it matches any exclusion filter. When inclusion filters are
* set, a project must also match at least one of them. For <code>project_id</code>, each filter
* is a project ID pattern, such as <code>prod-*</code>, with up to 15,000 filters. For <code>
* project_label</code>, each filter is a label in the form <code>key:value</code>, such as <code>
* env:prod*</code>, with up to 100 filters. Keys are matched exactly and wildcards apply only to
* values, so <code>key:*</code> matches any value.
*
* @return filters
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_FILTERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<String> getFilters() {
return filters;
}

public void setFilters(List<String> filters) {
this.filters = filters;
}

public GCPProjectFilterConfig type(GCPProjectFilterConfigType type) {
this.type = type;
this.unparsed |= !type.isValid();
return this;
}

/**
* The GCP project field that the filters are matched against.
*
* @return type
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public GCPProjectFilterConfigType getType() {
return type;
}

public void setType(GCPProjectFilterConfigType type) {
if (!type.isValid()) {
this.unparsed = true;
}
this.type = type;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
*/
private Map<String, Object> additionalProperties;

/**
* Set the additional (undeclared) property with the specified name and value. If the property
* does not already exist, create it otherwise replace it.
*
* @param key The arbitrary key to set
* @param value The associated value
* @return GCPProjectFilterConfig
*/
@JsonAnySetter
public GCPProjectFilterConfig putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
}

/**
* Return the additional (undeclared) property with the specified name.
*
* @param key The arbitrary key to get
* @return The specific additional property for the given key
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
return null;
}
return this.additionalProperties.get(key);
}

/** Return true if this GCPProjectFilterConfig object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GCPProjectFilterConfig gcpProjectFilterConfig = (GCPProjectFilterConfig) o;
return Objects.equals(this.filters, gcpProjectFilterConfig.filters)
&& Objects.equals(this.type, gcpProjectFilterConfig.type)
&& Objects.equals(this.additionalProperties, gcpProjectFilterConfig.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(filters, type, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GCPProjectFilterConfig {\n");
sb.append(" filters: ").append(toIndentedString(filters)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
sb.append('}');
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2019-Present Datadog, Inc.
*/

package com.datadog.api.client.v2.model;

import com.datadog.api.client.ModelEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/** The GCP project field that the filters are matched against. */
@JsonSerialize(using = GCPProjectFilterConfigType.GCPProjectFilterConfigTypeSerializer.class)
public class GCPProjectFilterConfigType extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("project_id", "project_label"));

public static final GCPProjectFilterConfigType PROJECT_ID =
new GCPProjectFilterConfigType("project_id");
public static final GCPProjectFilterConfigType PROJECT_LABEL =
new GCPProjectFilterConfigType("project_label");

GCPProjectFilterConfigType(String value) {
super(value, allowedValues);
}

public static class GCPProjectFilterConfigTypeSerializer
extends StdSerializer<GCPProjectFilterConfigType> {
public GCPProjectFilterConfigTypeSerializer(Class<GCPProjectFilterConfigType> t) {
super(t);
}

public GCPProjectFilterConfigTypeSerializer() {
this(null);
}

@Override
public void serialize(
GCPProjectFilterConfigType value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static GCPProjectFilterConfigType fromValue(String value) {
return new GCPProjectFilterConfigType(value);
}
}
Loading
Loading