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
83 changes: 82 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6897,6 +6897,14 @@ components:
items:
$ref: "#/components/schemas/AllocationExposureRolloutStep"
type: array
scheduled_start_time:
description: |-
The resolved UTC start time computed from `scheduled_start`. This field is
read-only and cannot be set directly.
example: "2025-06-13T12:00:00Z"
format: date-time
nullable: true
type: string
updated_at:
description: The timestamp when the schedule was last updated.
example: "2024-01-01T12:00:00Z"
Expand Down Expand Up @@ -36788,6 +36796,10 @@ components:
description: The name of the environment.
example: "env-search-term"
type: string
observe_full_evaluation_data:
description: Indicates whether full evaluation data is observed for this environment.
example: false
type: boolean
queries:
description: List of queries to define the environment scope.
example: ["staging", "test"]
Expand Down Expand Up @@ -39095,6 +39107,10 @@ components:
items:
$ref: "#/components/schemas/FeatureFlagEnvironment"
type: array
is_favorite:
description: Indicates whether the feature flag is marked as a favorite by the current user.
example: false
type: boolean
json_schema:
description: JSON schema for validation when value_type is JSON.
example: '{"type": "object", "properties": {"enabled": {"type": "boolean"}}}'
Expand All @@ -39117,6 +39133,8 @@ components:
description: Indicates whether this feature flag requires approval for changes.
example: false
type: boolean
staleness_details:
$ref: "#/components/schemas/FeatureFlagAttributesStalenessDetails"
staleness_status:
description: Indicates the whether a feature flag is stale or not.
example: "ACTIVE"
Expand Down Expand Up @@ -39147,6 +39165,48 @@ components:
- value_type
- variants
type: object
FeatureFlagAttributesStalenessDetails:
description: Details about the feature flag's staleness status.
nullable: true
properties:
code_references:
description: Code references associated with the feature flag.
items:
additionalProperties: {}
type: object
nullable: true
type: array
dismissed_by:
description: The ID of the user who dismissed the staleness notification.
format: uuid
nullable: true
type: string
id:
description: The unique identifier of the staleness details record.
example: "550e8400-e29b-41d4-a716-446655440020"
format: uuid
type: string
recommended_actions:
description: Recommended actions to address the feature flag's staleness.
items:
additionalProperties: {}
type: object
nullable: true
type: array
skip_state_check_until:
description: The timestamp until which staleness checks are skipped.
format: date-time
nullable: true
type: string
stale_reason:
description: The reason the feature flag is considered stale.
nullable: true
type: string
staleness_status:
description: The staleness status of the feature flag.
example: "ACTIVE"
type: string
type: object
FeatureFlagEnvironment:
description: Environment-specific settings for a feature flag.
properties:
Expand Down Expand Up @@ -39186,6 +39246,10 @@ components:
description: Indicates whether the environment is production.
example: false
type: boolean
observe_full_evaluation_data:
description: Indicates whether full evaluation data is observed for this environment.
example: false
type: boolean
override_allocation_key:
description: The allocation key used for the override variant.
example: "allocation-override-123abc"
Expand Down Expand Up @@ -91810,10 +91874,27 @@ components:
description: Rollout options request payload.
properties:
autostart:
description: Whether the schedule should begin automatically.
deprecated: true
description: |-
Whether the schedule should begin automatically. Deprecated in favor of
`scheduled_start`, which takes precedence when both are set.
example: false
nullable: true
type: boolean
scheduled_start:
description: |-
Controls when the schedule starts. Supersedes `autostart`. One of:

- `none`: create the schedule without starting it.
- `now`: start the schedule immediately.
- `relative:<duration>`: start after a duration (for example `relative:2h`).
- `absolute:<RFC3339 timestamp>`: start at a specific time (for example `absolute:2025-06-13T12:00:00Z`).

An `absolute` timestamp in the past or present is treated as `now`. A future start time
is not supported for allocations linked to a standard experiment.
example: "absolute:2025-06-13T12:00:00Z"
pattern: ^(none|now|relative:([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+|absolute:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2}))$
type: string
selection_interval_ms:
description: Interval in milliseconds for uniform interval strategies.
example: 3600000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static void main(String[] args) {
.rolloutOptions(
new RolloutOptionsRequest()
.autostart(false)
.scheduledStart("absolute:2025-06-13T12:00:00Z")
.selectionIntervalMs(3600000L)
.strategy(RolloutStrategy.UNIFORM_INTERVALS))
.rolloutSteps(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static void main(String[] args) {
.rolloutOptions(
new RolloutOptionsRequest()
.autostart(false)
.scheduledStart("absolute:2025-06-13T12:00:00Z")
.selectionIntervalMs(3600000L)
.strategy(RolloutStrategy.UNIFORM_INTERVALS))
.rolloutSteps(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Update targeting rules for a flag in an environment with a scheduled start returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.FeatureFlagsApi;
import com.datadog.api.client.v2.model.AllocationDataRequest;
import com.datadog.api.client.v2.model.AllocationDataType;
import com.datadog.api.client.v2.model.AllocationType;
import com.datadog.api.client.v2.model.ExposureRolloutStepRequest;
import com.datadog.api.client.v2.model.ExposureScheduleRequest;
import com.datadog.api.client.v2.model.ListAllocationsResponse;
import com.datadog.api.client.v2.model.OverwriteAllocationsRequest;
import com.datadog.api.client.v2.model.RolloutOptionsRequest;
import com.datadog.api.client.v2.model.RolloutStrategy;
import com.datadog.api.client.v2.model.UpsertAllocationRequest;
import com.datadog.api.client.v2.model.VariantWeightRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
FeatureFlagsApi apiInstance = new FeatureFlagsApi(defaultClient);

// there is a valid "feature_flag" in the system
UUID FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID = null;
try {
FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID =
UUID.fromString(System.getenv("FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID"));
} catch (IllegalArgumentException e) {
System.err.println("Error parsing UUID: " + e.getMessage());
}
UUID FEATURE_FLAG_DATA_ID = null;
try {
FEATURE_FLAG_DATA_ID = UUID.fromString(System.getenv("FEATURE_FLAG_DATA_ID"));
} catch (IllegalArgumentException e) {
System.err.println("Error parsing UUID: " + e.getMessage());
}

// there is a valid "environment" in the system
UUID ENVIRONMENT_DATA_ID = null;
try {
ENVIRONMENT_DATA_ID = UUID.fromString(System.getenv("ENVIRONMENT_DATA_ID"));
} catch (IllegalArgumentException e) {
System.err.println("Error parsing UUID: " + e.getMessage());
}

OverwriteAllocationsRequest body =
new OverwriteAllocationsRequest()
.data(
Collections.singletonList(
new AllocationDataRequest()
.type(AllocationDataType.ALLOCATIONS)
.attributes(
new UpsertAllocationRequest()
.key("scheduled-start-allocation-example-feature-flag")
.name("New targeting rule Example-Feature-Flag")
.variantWeights(
Collections.singletonList(
new VariantWeightRequest()
.variantId(FEATURE_FLAG_DATA_ATTRIBUTES_VARIANTS_0_ID)
.value(100.0)))
.exposureSchedule(
new ExposureScheduleRequest()
.rolloutOptions(
new RolloutOptionsRequest()
.strategy(RolloutStrategy.UNIFORM_INTERVALS)
.scheduledStart(
"absolute:2021-11-12T11:11:11+00:00")
.selectionIntervalMs(86400000L))
.rolloutSteps(
Arrays.asList(
new ExposureRolloutStepRequest()
.exposureRatio(0.05)
.intervalMs(null)
.isPauseRecord(false)
.groupedStepIndex(0L),
new ExposureRolloutStepRequest()
.exposureRatio(0.25)
.intervalMs(null)
.isPauseRecord(false)
.groupedStepIndex(1L),
new ExposureRolloutStepRequest()
.exposureRatio(1.0)
.intervalMs(null)
.isPauseRecord(false)
.groupedStepIndex(2L))))
.type(AllocationType.CANARY))));

try {
ListAllocationsResponse result =
apiInstance.updateAllocationsForFeatureFlagInEnvironment(
FEATURE_FLAG_DATA_ID, ENVIRONMENT_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling FeatureFlagsApi#updateAllocationsForFeatureFlagInEnvironment");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
AllocationExposureSchedule.JSON_PROPERTY_ID,
AllocationExposureSchedule.JSON_PROPERTY_ROLLOUT_OPTIONS,
AllocationExposureSchedule.JSON_PROPERTY_ROLLOUT_STEPS,
AllocationExposureSchedule.JSON_PROPERTY_SCHEDULED_START_TIME,
AllocationExposureSchedule.JSON_PROPERTY_UPDATED_AT
})
@jakarta.annotation.Generated(
Expand Down Expand Up @@ -67,6 +68,10 @@ public class AllocationExposureSchedule {
public static final String JSON_PROPERTY_ROLLOUT_STEPS = "rollout_steps";
private List<AllocationExposureRolloutStep> rolloutSteps = new ArrayList<>();

public static final String JSON_PROPERTY_SCHEDULED_START_TIME = "scheduled_start_time";
private JsonNullable<OffsetDateTime> scheduledStartTime =
JsonNullable.<OffsetDateTime>undefined();

public static final String JSON_PROPERTY_UPDATED_AT = "updated_at";
private OffsetDateTime updatedAt;

Expand Down Expand Up @@ -348,6 +353,38 @@ public void setRolloutSteps(List<AllocationExposureRolloutStep> rolloutSteps) {
}
}

public AllocationExposureSchedule scheduledStartTime(OffsetDateTime scheduledStartTime) {
this.scheduledStartTime = JsonNullable.<OffsetDateTime>of(scheduledStartTime);
return this;
}

/**
* The resolved UTC start time computed from <code>scheduled_start</code>. This field is read-only
* and cannot be set directly.
*
* @return scheduledStartTime
*/
@jakarta.annotation.Nullable
@JsonIgnore
public OffsetDateTime getScheduledStartTime() {
return scheduledStartTime.orElse(null);
}

@JsonProperty(JSON_PROPERTY_SCHEDULED_START_TIME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable<OffsetDateTime> getScheduledStartTime_JsonNullable() {
return scheduledStartTime;
}

@JsonProperty(JSON_PROPERTY_SCHEDULED_START_TIME)
public void setScheduledStartTime_JsonNullable(JsonNullable<OffsetDateTime> scheduledStartTime) {
this.scheduledStartTime = scheduledStartTime;
}

public void setScheduledStartTime(OffsetDateTime scheduledStartTime) {
this.scheduledStartTime = JsonNullable.<OffsetDateTime>of(scheduledStartTime);
}

public AllocationExposureSchedule updatedAt(OffsetDateTime updatedAt) {
this.updatedAt = updatedAt;
return this;
Expand Down Expand Up @@ -434,6 +471,7 @@ public boolean equals(Object o) {
&& Objects.equals(this.id, allocationExposureSchedule.id)
&& Objects.equals(this.rolloutOptions, allocationExposureSchedule.rolloutOptions)
&& Objects.equals(this.rolloutSteps, allocationExposureSchedule.rolloutSteps)
&& Objects.equals(this.scheduledStartTime, allocationExposureSchedule.scheduledStartTime)
&& Objects.equals(this.updatedAt, allocationExposureSchedule.updatedAt)
&& Objects.equals(
this.additionalProperties, allocationExposureSchedule.additionalProperties);
Expand All @@ -451,6 +489,7 @@ public int hashCode() {
id,
rolloutOptions,
rolloutSteps,
scheduledStartTime,
updatedAt,
additionalProperties);
}
Expand All @@ -470,6 +509,7 @@ public String toString() {
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" rolloutOptions: ").append(toIndentedString(rolloutOptions)).append("\n");
sb.append(" rolloutSteps: ").append(toIndentedString(rolloutSteps)).append("\n");
sb.append(" scheduledStartTime: ").append(toIndentedString(scheduledStartTime)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
Expand Down
Loading
Loading