Is there a way to remove a certain value from constraint using admin api? #10707
Unanswered
Hanan-Argov
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @Hanan-Argov, usually you'd send a PUT with your desired state (you can check this command from the UI on the right-side panel). curl --location --request PUT '<unleash>/api/admin/projects/api/features/<feature>/environments/development/strategies/45295735-0d97-43e2-a9fb-976ed71c9288' \
--header 'Authorization: INSERT_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "flexibleRollout",
"constraints": [
{
"contextName": "a",
"operator": "IN",
"values": [
"100", "200", "400", "500" # without 300
],
"caseInsensitive": false,
"inverted": false
}
],
"parameters": {
"rollout": "100",
"stickiness": "default",
"groupId": "api-access"
},
"variants": [],
"segments": [
122
],
"disabled": false
}' If you're removing 300 just ignore the 300 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
i'm looking for a way to remove a certain value from a constraint in a feature flag.
example:
i've got a feature flag that has the following constraint values: 100, 200, 300, 400, 500
I want to remove the value "300".
from what I understand, I need to do the following:
is there an easier solution with just 1 call that removes the value by its actual value?
EDIT:
I'm asking this due to the chance that if i've got 2 places, that want to update the same FF, this method, and the PUT method, can cause race conditions, which can accidentally remove/add a value
Beta Was this translation helpful? Give feedback.
All reactions