Skip to main content

feature_flag_variants

Creates, updates, deletes, gets or lists a feature_flag_variants resource.

Overview

Namefeature_flag_variants
TypeResource
Iddatadog.software_delivery.feature_flag_variants

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
create_variant_for_feature_flaginsertfeature_flag_id, key, name, valueAdds a single new variant to an existing feature flag. This endpoint is<br />additive-only: it never modifies existing variants. A request whose key<br />already exists on the flag is rejected with 409 Conflict; a value<br />whose type does not match the flag's value_type is rejected with 400.<br />The server generates the variant UUID and returns it in the response body;<br />callers (for example, the flag-migration tool) need this UUID to reference<br />the new variant in subsequent allocation syncs.
update_variant_for_feature_flagreplacefeature_flag_id, variant_idUpdates the name and value of an existing variant on a feature flag.<br /><br />When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a FlagSuggestion with 201 Created instead of applying the change immediately. Use the returned suggestion id to approve or reject the change. If a pending suggestion already exists for this flag's variant property, the endpoint returns 409 Conflict.
delete_variant_from_feature_flagdeletefeature_flag_id, variant_idDeletes a variant from a feature flag.<br /><br />When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a FlagSuggestion with 201 Created instead of deleting the variant immediately. If a pending suggestion already exists for this flag's variant property, the endpoint returns 409 Conflict.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
feature_flag_idstring (uuid)The ID of the feature flag.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
variant_idstring (uuid)The ID of the variant.

INSERT examples

Adds a single new variant to an existing feature flag. This endpoint is<br />additive-only: it never modifies existing variants. A request whose key<br />already exists on the flag is rejected with 409 Conflict; a value<br />whose type does not match the flag's value_type is rejected with 400.<br />The server generates the variant UUID and returns it in the response body;<br />callers (for example, the flag-migration tool) need this UUID to reference<br />the new variant in subsequent allocation syncs.

INSERT INTO datadog.software_delivery.feature_flag_variants (
key,
name,
value,
feature_flag_id
)
SELECT
'{{ key }}' /* required */,
'{{ name }}' /* required */,
'{{ value }}' /* required */,
'{{ feature_flag_id }}'
RETURNING
id,
name,
created_at,
key,
updated_at,
value
;

REPLACE examples

Updates the name and value of an existing variant on a feature flag.<br /><br />When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a FlagSuggestion with 201 Created instead of applying the change immediately. Use the returned suggestion id to approve or reject the change. If a pending suggestion already exists for this flag's variant property, the endpoint returns 409 Conflict.

REPLACE datadog.software_delivery.feature_flag_variants
SET
name = '{{ name }}',
value = '{{ value }}'
WHERE
feature_flag_id = '{{ feature_flag_id }}' --required
AND variant_id = '{{ variant_id }}' --required
RETURNING
id,
name,
created_at,
key,
updated_at,
value;

DELETE examples

Deletes a variant from a feature flag.<br /><br />When backend approvals are enabled and the flag requires approval, this endpoint creates and returns a FlagSuggestion with 201 Created instead of deleting the variant immediately. If a pending suggestion already exists for this flag's variant property, the endpoint returns 409 Conflict.

DELETE FROM datadog.software_delivery.feature_flag_variants
WHERE feature_flag_id = '{{ feature_flag_id }}' --required
AND variant_id = '{{ variant_id }}' --required
;