launchdarkly_api 25.1.1 → 25.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/docs/AIConfigTargetingEnvironmentRule.md +2 -0
- data/docs/AgentControlApi.md +3 -1
- data/docs/AssignmentDataSourceInput.md +24 -0
- data/docs/AuditLogApi.md +2 -0
- data/docs/Experiment.md +2 -0
- data/docs/ExperimentsApi.md +1 -1
- data/docs/IntegrationDeliveryConfiguration.md +3 -1
- data/docs/IntegrationDeliveryConfigurationStatus.md +26 -0
- data/docs/IntegrationsBetaApi.md +4 -4
- data/docs/IterationAssignmentDataSourceRep.md +26 -0
- data/docs/IterationInput.md +3 -1
- data/docs/IterationRep.md +4 -2
- data/docs/PatchSegmentScheduledChangeInput.md +20 -0
- data/docs/PostSegmentScheduledChangeInput.md +22 -0
- data/docs/SegmentScheduledChange.md +34 -0
- data/docs/SegmentScheduledChangeStatus.md +15 -0
- data/docs/SegmentScheduledChanges.md +20 -0
- data/docs/SegmentScheduledChangesLink.md +20 -0
- data/docs/SegmentsApi.md +389 -0
- data/docs/TreatmentInput.md +3 -1
- data/docs/TreatmentRep.md +3 -1
- data/docs/Webhook.md +2 -0
- data/docs/WebhookPost.md +2 -0
- data/lib/launchdarkly_api/api/agent_control_api.rb +3 -0
- data/lib/launchdarkly_api/api/audit_log_api.rb +3 -0
- data/lib/launchdarkly_api/api/experiments_api.rb +2 -2
- data/lib/launchdarkly_api/api/integrations_beta_api.rb +8 -8
- data/lib/launchdarkly_api/api/segments_api.rb +415 -0
- data/lib/launchdarkly_api/models/ai_config_targeting_environment_rule.rb +28 -1
- data/lib/launchdarkly_api/models/assignment_data_source_input.rb +193 -0
- data/lib/launchdarkly_api/models/experiment.rb +23 -1
- data/lib/launchdarkly_api/models/integration_delivery_configuration.rb +13 -4
- data/lib/launchdarkly_api/models/integration_delivery_configuration_status.rb +222 -0
- data/lib/launchdarkly_api/models/iteration_assignment_data_source_rep.rb +237 -0
- data/lib/launchdarkly_api/models/iteration_input.rb +11 -2
- data/lib/launchdarkly_api/models/iteration_rep.rb +14 -5
- data/lib/launchdarkly_api/models/patch_segment_scheduled_change_input.rb +157 -0
- data/lib/launchdarkly_api/models/post_segment_scheduled_change_input.rb +203 -0
- data/lib/launchdarkly_api/models/segment_scheduled_change.rb +353 -0
- data/lib/launchdarkly_api/models/segment_scheduled_change_status.rb +41 -0
- data/lib/launchdarkly_api/models/segment_scheduled_changes.rb +196 -0
- data/lib/launchdarkly_api/models/segment_scheduled_changes_link.rb +156 -0
- data/lib/launchdarkly_api/models/treatment_input.rb +14 -4
- data/lib/launchdarkly_api/models/treatment_rep.rb +14 -4
- data/lib/launchdarkly_api/models/webhook.rb +11 -1
- data/lib/launchdarkly_api/models/webhook_post.rb +11 -1
- data/lib/launchdarkly_api/version.rb +1 -1
- data/lib/launchdarkly_api.rb +9 -0
- data/spec/api/agent_control_api_spec.rb +1 -0
- data/spec/api/audit_log_api_spec.rb +1 -0
- data/spec/api/experiments_api_spec.rb +1 -1
- data/spec/api/integrations_beta_api_spec.rb +4 -4
- data/spec/api/segments_api_spec.rb +75 -0
- data/spec/models/ai_config_targeting_environment_rule_spec.rb +6 -0
- data/spec/models/assignment_data_source_input_spec.rb +54 -0
- data/spec/models/experiment_spec.rb +10 -0
- data/spec/models/integration_delivery_configuration_spec.rb +6 -0
- data/spec/models/integration_delivery_configuration_status_spec.rb +60 -0
- data/spec/models/iteration_assignment_data_source_rep_spec.rb +60 -0
- data/spec/models/iteration_input_spec.rb +6 -0
- data/spec/models/iteration_rep_spec.rb +6 -0
- data/spec/models/patch_segment_scheduled_change_input_spec.rb +42 -0
- data/spec/models/post_segment_scheduled_change_input_spec.rb +48 -0
- data/spec/models/segment_scheduled_change_spec.rb +84 -0
- data/spec/models/segment_scheduled_change_status_spec.rb +30 -0
- data/spec/models/segment_scheduled_changes_link_spec.rb +42 -0
- data/spec/models/segment_scheduled_changes_spec.rb +42 -0
- data/spec/models/treatment_input_spec.rb +6 -0
- data/spec/models/treatment_rep_spec.rb +6 -0
- data/spec/models/webhook_post_spec.rb +6 -0
- data/spec/models/webhook_spec.rb +6 -0
- metadata +758 -725
data/docs/SegmentsApi.md
CHANGED
|
@@ -7,6 +7,7 @@ All URIs are relative to *https://app.launchdarkly.com*
|
|
|
7
7
|
| [**create_big_segment_export**](SegmentsApi.md#create_big_segment_export) | **POST** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports | Create big segment export |
|
|
8
8
|
| [**create_big_segment_import**](SegmentsApi.md#create_big_segment_import) | **POST** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports | Create big segment import |
|
|
9
9
|
| [**delete_segment**](SegmentsApi.md#delete_segment) | **DELETE** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Delete segment |
|
|
10
|
+
| [**delete_segment_scheduled_change**](SegmentsApi.md#delete_segment_scheduled_change) | **DELETE** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id} | Delete a scheduled change for a segment |
|
|
10
11
|
| [**get_big_segment_export**](SegmentsApi.md#get_big_segment_export) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/exports/{exportID} | Get big segment export |
|
|
11
12
|
| [**get_big_segment_import**](SegmentsApi.md#get_big_segment_import) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID} | Get big segment import |
|
|
12
13
|
| [**get_context_instance_segments_membership_by_env**](SegmentsApi.md#get_context_instance_segments_membership_by_env) | **POST** /api/v2/projects/{projectKey}/environments/{environmentKey}/segments/evaluate | List segment memberships for context instance |
|
|
@@ -15,11 +16,15 @@ All URIs are relative to *https://app.launchdarkly.com*
|
|
|
15
16
|
| [**get_segment**](SegmentsApi.md#get_segment) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Get segment |
|
|
16
17
|
| [**get_segment_membership_for_context**](SegmentsApi.md#get_segment_membership_for_context) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts/{contextKey} | Get big segment membership for context |
|
|
17
18
|
| [**get_segment_membership_for_user**](SegmentsApi.md#get_segment_membership_for_user) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users/{userKey} | Get big segment membership for user |
|
|
19
|
+
| [**get_segment_scheduled_change**](SegmentsApi.md#get_segment_scheduled_change) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id} | Get a scheduled change for a segment |
|
|
20
|
+
| [**get_segment_scheduled_changes**](SegmentsApi.md#get_segment_scheduled_changes) | **GET** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes | List scheduled changes for a segment |
|
|
18
21
|
| [**get_segments**](SegmentsApi.md#get_segments) | **GET** /api/v2/segments/{projectKey}/{environmentKey} | List segments |
|
|
19
22
|
| [**patch_expiring_targets_for_segment**](SegmentsApi.md#patch_expiring_targets_for_segment) | **PATCH** /api/v2/segments/{projectKey}/{segmentKey}/expiring-targets/{environmentKey} | Update expiring targets for segment |
|
|
20
23
|
| [**patch_expiring_user_targets_for_segment**](SegmentsApi.md#patch_expiring_user_targets_for_segment) | **PATCH** /api/v2/segments/{projectKey}/{segmentKey}/expiring-user-targets/{environmentKey} | Update expiring user targets for segment |
|
|
21
24
|
| [**patch_segment**](SegmentsApi.md#patch_segment) | **PATCH** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey} | Patch segment |
|
|
25
|
+
| [**patch_segment_scheduled_change**](SegmentsApi.md#patch_segment_scheduled_change) | **PATCH** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes/{id} | Update a scheduled change for a segment |
|
|
22
26
|
| [**post_segment**](SegmentsApi.md#post_segment) | **POST** /api/v2/segments/{projectKey}/{environmentKey} | Create segment |
|
|
27
|
+
| [**post_segment_scheduled_change**](SegmentsApi.md#post_segment_scheduled_change) | **POST** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes | Create a scheduled change for a segment |
|
|
23
28
|
| [**update_big_segment_context_targets**](SegmentsApi.md#update_big_segment_context_targets) | **POST** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/contexts | Update context targets on a big segment |
|
|
24
29
|
| [**update_big_segment_targets**](SegmentsApi.md#update_big_segment_targets) | **POST** /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/users | Update user context targets on a big segment |
|
|
25
30
|
|
|
@@ -254,6 +259,82 @@ nil (empty response body)
|
|
|
254
259
|
- **Accept**: application/json
|
|
255
260
|
|
|
256
261
|
|
|
262
|
+
## delete_segment_scheduled_change
|
|
263
|
+
|
|
264
|
+
> delete_segment_scheduled_change(project_key, environment_key, segment_key, id)
|
|
265
|
+
|
|
266
|
+
Delete a scheduled change for a segment
|
|
267
|
+
|
|
268
|
+
Delete a scheduled change before its execution date, so that its instructions are never applied to the segment. Deleting a change with a `failed` status removes it from the segment's scheduled changes. Its instructions were not applied. The caller must be allowed to update scheduled changes on the segment. If an approval request scheduled the change, deleting the change also terminates that request, so it cannot be applied again. Declining the request is only an option while it is still awaiting review. Once it is applied, its instructions belong to a scheduled change, and this endpoint is how to stop them. Returns 409 if the scheduled change is already being applied or has already run.
|
|
269
|
+
|
|
270
|
+
### Examples
|
|
271
|
+
|
|
272
|
+
```ruby
|
|
273
|
+
require 'time'
|
|
274
|
+
require 'launchdarkly_api'
|
|
275
|
+
# setup authorization
|
|
276
|
+
LaunchDarklyApi.configure do |config|
|
|
277
|
+
# Configure API key authorization: ApiKey
|
|
278
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
279
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
280
|
+
# config.api_key_prefix['Authorization'] = 'Bearer'
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
api_instance = LaunchDarklyApi::SegmentsApi.new
|
|
284
|
+
project_key = 'project_key_example' # String |
|
|
285
|
+
environment_key = 'environment_key_example' # String |
|
|
286
|
+
segment_key = 'segment_key_example' # String |
|
|
287
|
+
id = 'id_example' # String | The ID of the scheduled change
|
|
288
|
+
|
|
289
|
+
begin
|
|
290
|
+
# Delete a scheduled change for a segment
|
|
291
|
+
api_instance.delete_segment_scheduled_change(project_key, environment_key, segment_key, id)
|
|
292
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
293
|
+
puts "Error when calling SegmentsApi->delete_segment_scheduled_change: #{e}"
|
|
294
|
+
end
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### Using the delete_segment_scheduled_change_with_http_info variant
|
|
298
|
+
|
|
299
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
300
|
+
|
|
301
|
+
> <Array(nil, Integer, Hash)> delete_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id)
|
|
302
|
+
|
|
303
|
+
```ruby
|
|
304
|
+
begin
|
|
305
|
+
# Delete a scheduled change for a segment
|
|
306
|
+
data, status_code, headers = api_instance.delete_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id)
|
|
307
|
+
p status_code # => 2xx
|
|
308
|
+
p headers # => { ... }
|
|
309
|
+
p data # => nil
|
|
310
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
311
|
+
puts "Error when calling SegmentsApi->delete_segment_scheduled_change_with_http_info: #{e}"
|
|
312
|
+
end
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Parameters
|
|
316
|
+
|
|
317
|
+
| Name | Type | Description | Notes |
|
|
318
|
+
| ---- | ---- | ----------- | ----- |
|
|
319
|
+
| **project_key** | **String** | | |
|
|
320
|
+
| **environment_key** | **String** | | |
|
|
321
|
+
| **segment_key** | **String** | | |
|
|
322
|
+
| **id** | **String** | The ID of the scheduled change | |
|
|
323
|
+
|
|
324
|
+
### Return type
|
|
325
|
+
|
|
326
|
+
nil (empty response body)
|
|
327
|
+
|
|
328
|
+
### Authorization
|
|
329
|
+
|
|
330
|
+
[ApiKey](../README.md#ApiKey)
|
|
331
|
+
|
|
332
|
+
### HTTP request headers
|
|
333
|
+
|
|
334
|
+
- **Content-Type**: Not defined
|
|
335
|
+
- **Accept**: application/json
|
|
336
|
+
|
|
337
|
+
|
|
257
338
|
## get_big_segment_export
|
|
258
339
|
|
|
259
340
|
> <Export> get_big_segment_export(project_key, environment_key, segment_key, export_id)
|
|
@@ -862,6 +943,158 @@ end
|
|
|
862
943
|
- **Accept**: application/json
|
|
863
944
|
|
|
864
945
|
|
|
946
|
+
## get_segment_scheduled_change
|
|
947
|
+
|
|
948
|
+
> <SegmentScheduledChange> get_segment_scheduled_change(project_key, environment_key, segment_key, id)
|
|
949
|
+
|
|
950
|
+
Get a scheduled change for a segment
|
|
951
|
+
|
|
952
|
+
Get one scheduled change that has not been applied yet, or that failed to apply. Returns 404 if the ID is not a scheduled change for the segment in the path. The caller must be allowed to view the segment's project.
|
|
953
|
+
|
|
954
|
+
### Examples
|
|
955
|
+
|
|
956
|
+
```ruby
|
|
957
|
+
require 'time'
|
|
958
|
+
require 'launchdarkly_api'
|
|
959
|
+
# setup authorization
|
|
960
|
+
LaunchDarklyApi.configure do |config|
|
|
961
|
+
# Configure API key authorization: ApiKey
|
|
962
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
963
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
964
|
+
# config.api_key_prefix['Authorization'] = 'Bearer'
|
|
965
|
+
end
|
|
966
|
+
|
|
967
|
+
api_instance = LaunchDarklyApi::SegmentsApi.new
|
|
968
|
+
project_key = 'project_key_example' # String |
|
|
969
|
+
environment_key = 'environment_key_example' # String |
|
|
970
|
+
segment_key = 'segment_key_example' # String |
|
|
971
|
+
id = 'id_example' # String | The ID of the scheduled change
|
|
972
|
+
|
|
973
|
+
begin
|
|
974
|
+
# Get a scheduled change for a segment
|
|
975
|
+
result = api_instance.get_segment_scheduled_change(project_key, environment_key, segment_key, id)
|
|
976
|
+
p result
|
|
977
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
978
|
+
puts "Error when calling SegmentsApi->get_segment_scheduled_change: #{e}"
|
|
979
|
+
end
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
#### Using the get_segment_scheduled_change_with_http_info variant
|
|
983
|
+
|
|
984
|
+
This returns an Array which contains the response data, status code and headers.
|
|
985
|
+
|
|
986
|
+
> <Array(<SegmentScheduledChange>, Integer, Hash)> get_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id)
|
|
987
|
+
|
|
988
|
+
```ruby
|
|
989
|
+
begin
|
|
990
|
+
# Get a scheduled change for a segment
|
|
991
|
+
data, status_code, headers = api_instance.get_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id)
|
|
992
|
+
p status_code # => 2xx
|
|
993
|
+
p headers # => { ... }
|
|
994
|
+
p data # => <SegmentScheduledChange>
|
|
995
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
996
|
+
puts "Error when calling SegmentsApi->get_segment_scheduled_change_with_http_info: #{e}"
|
|
997
|
+
end
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
### Parameters
|
|
1001
|
+
|
|
1002
|
+
| Name | Type | Description | Notes |
|
|
1003
|
+
| ---- | ---- | ----------- | ----- |
|
|
1004
|
+
| **project_key** | **String** | | |
|
|
1005
|
+
| **environment_key** | **String** | | |
|
|
1006
|
+
| **segment_key** | **String** | | |
|
|
1007
|
+
| **id** | **String** | The ID of the scheduled change | |
|
|
1008
|
+
|
|
1009
|
+
### Return type
|
|
1010
|
+
|
|
1011
|
+
[**SegmentScheduledChange**](SegmentScheduledChange.md)
|
|
1012
|
+
|
|
1013
|
+
### Authorization
|
|
1014
|
+
|
|
1015
|
+
[ApiKey](../README.md#ApiKey)
|
|
1016
|
+
|
|
1017
|
+
### HTTP request headers
|
|
1018
|
+
|
|
1019
|
+
- **Content-Type**: Not defined
|
|
1020
|
+
- **Accept**: application/json
|
|
1021
|
+
|
|
1022
|
+
|
|
1023
|
+
## get_segment_scheduled_changes
|
|
1024
|
+
|
|
1025
|
+
> <SegmentScheduledChanges> get_segment_scheduled_changes(project_key, environment_key, segment_key)
|
|
1026
|
+
|
|
1027
|
+
List scheduled changes for a segment
|
|
1028
|
+
|
|
1029
|
+
Get every scheduled change for a segment that has not been applied yet, plus any that failed to apply, soonest first. Use the `status` of each change to tell them apart. The caller must be allowed to view the segment's project.
|
|
1030
|
+
|
|
1031
|
+
### Examples
|
|
1032
|
+
|
|
1033
|
+
```ruby
|
|
1034
|
+
require 'time'
|
|
1035
|
+
require 'launchdarkly_api'
|
|
1036
|
+
# setup authorization
|
|
1037
|
+
LaunchDarklyApi.configure do |config|
|
|
1038
|
+
# Configure API key authorization: ApiKey
|
|
1039
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
1040
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1041
|
+
# config.api_key_prefix['Authorization'] = 'Bearer'
|
|
1042
|
+
end
|
|
1043
|
+
|
|
1044
|
+
api_instance = LaunchDarklyApi::SegmentsApi.new
|
|
1045
|
+
project_key = 'project_key_example' # String |
|
|
1046
|
+
environment_key = 'environment_key_example' # String |
|
|
1047
|
+
segment_key = 'segment_key_example' # String |
|
|
1048
|
+
|
|
1049
|
+
begin
|
|
1050
|
+
# List scheduled changes for a segment
|
|
1051
|
+
result = api_instance.get_segment_scheduled_changes(project_key, environment_key, segment_key)
|
|
1052
|
+
p result
|
|
1053
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1054
|
+
puts "Error when calling SegmentsApi->get_segment_scheduled_changes: #{e}"
|
|
1055
|
+
end
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
#### Using the get_segment_scheduled_changes_with_http_info variant
|
|
1059
|
+
|
|
1060
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1061
|
+
|
|
1062
|
+
> <Array(<SegmentScheduledChanges>, Integer, Hash)> get_segment_scheduled_changes_with_http_info(project_key, environment_key, segment_key)
|
|
1063
|
+
|
|
1064
|
+
```ruby
|
|
1065
|
+
begin
|
|
1066
|
+
# List scheduled changes for a segment
|
|
1067
|
+
data, status_code, headers = api_instance.get_segment_scheduled_changes_with_http_info(project_key, environment_key, segment_key)
|
|
1068
|
+
p status_code # => 2xx
|
|
1069
|
+
p headers # => { ... }
|
|
1070
|
+
p data # => <SegmentScheduledChanges>
|
|
1071
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1072
|
+
puts "Error when calling SegmentsApi->get_segment_scheduled_changes_with_http_info: #{e}"
|
|
1073
|
+
end
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
### Parameters
|
|
1077
|
+
|
|
1078
|
+
| Name | Type | Description | Notes |
|
|
1079
|
+
| ---- | ---- | ----------- | ----- |
|
|
1080
|
+
| **project_key** | **String** | | |
|
|
1081
|
+
| **environment_key** | **String** | | |
|
|
1082
|
+
| **segment_key** | **String** | | |
|
|
1083
|
+
|
|
1084
|
+
### Return type
|
|
1085
|
+
|
|
1086
|
+
[**SegmentScheduledChanges**](SegmentScheduledChanges.md)
|
|
1087
|
+
|
|
1088
|
+
### Authorization
|
|
1089
|
+
|
|
1090
|
+
[ApiKey](../README.md#ApiKey)
|
|
1091
|
+
|
|
1092
|
+
### HTTP request headers
|
|
1093
|
+
|
|
1094
|
+
- **Content-Type**: Not defined
|
|
1095
|
+
- **Accept**: application/json
|
|
1096
|
+
|
|
1097
|
+
|
|
865
1098
|
## get_segments
|
|
866
1099
|
|
|
867
1100
|
> <UserSegments> get_segments(project_key, environment_key, opts)
|
|
@@ -1180,6 +1413,85 @@ end
|
|
|
1180
1413
|
- **Accept**: application/json
|
|
1181
1414
|
|
|
1182
1415
|
|
|
1416
|
+
## patch_segment_scheduled_change
|
|
1417
|
+
|
|
1418
|
+
> <SegmentScheduledChange> patch_segment_scheduled_change(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input)
|
|
1419
|
+
|
|
1420
|
+
Update a scheduled change for a segment
|
|
1421
|
+
|
|
1422
|
+
Edit the execution date and/or the comment of a scheduled change that has not been applied yet. A field you leave out is unchanged, and an empty comment clears the comment. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make the change's instructions directly. If the segment requires approvals, the caller must also be allowed to bypass them. Returns 409 if the scheduled change is already being applied or was changed by someone else in the meantime.
|
|
1423
|
+
|
|
1424
|
+
### Examples
|
|
1425
|
+
|
|
1426
|
+
```ruby
|
|
1427
|
+
require 'time'
|
|
1428
|
+
require 'launchdarkly_api'
|
|
1429
|
+
# setup authorization
|
|
1430
|
+
LaunchDarklyApi.configure do |config|
|
|
1431
|
+
# Configure API key authorization: ApiKey
|
|
1432
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
1433
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1434
|
+
# config.api_key_prefix['Authorization'] = 'Bearer'
|
|
1435
|
+
end
|
|
1436
|
+
|
|
1437
|
+
api_instance = LaunchDarklyApi::SegmentsApi.new
|
|
1438
|
+
project_key = 'project_key_example' # String |
|
|
1439
|
+
environment_key = 'environment_key_example' # String |
|
|
1440
|
+
segment_key = 'segment_key_example' # String |
|
|
1441
|
+
id = 'id_example' # String | The ID of the scheduled change
|
|
1442
|
+
patch_segment_scheduled_change_input = LaunchDarklyApi::PatchSegmentScheduledChangeInput.new # PatchSegmentScheduledChangeInput |
|
|
1443
|
+
|
|
1444
|
+
begin
|
|
1445
|
+
# Update a scheduled change for a segment
|
|
1446
|
+
result = api_instance.patch_segment_scheduled_change(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input)
|
|
1447
|
+
p result
|
|
1448
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1449
|
+
puts "Error when calling SegmentsApi->patch_segment_scheduled_change: #{e}"
|
|
1450
|
+
end
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
#### Using the patch_segment_scheduled_change_with_http_info variant
|
|
1454
|
+
|
|
1455
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1456
|
+
|
|
1457
|
+
> <Array(<SegmentScheduledChange>, Integer, Hash)> patch_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input)
|
|
1458
|
+
|
|
1459
|
+
```ruby
|
|
1460
|
+
begin
|
|
1461
|
+
# Update a scheduled change for a segment
|
|
1462
|
+
data, status_code, headers = api_instance.patch_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, id, patch_segment_scheduled_change_input)
|
|
1463
|
+
p status_code # => 2xx
|
|
1464
|
+
p headers # => { ... }
|
|
1465
|
+
p data # => <SegmentScheduledChange>
|
|
1466
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1467
|
+
puts "Error when calling SegmentsApi->patch_segment_scheduled_change_with_http_info: #{e}"
|
|
1468
|
+
end
|
|
1469
|
+
```
|
|
1470
|
+
|
|
1471
|
+
### Parameters
|
|
1472
|
+
|
|
1473
|
+
| Name | Type | Description | Notes |
|
|
1474
|
+
| ---- | ---- | ----------- | ----- |
|
|
1475
|
+
| **project_key** | **String** | | |
|
|
1476
|
+
| **environment_key** | **String** | | |
|
|
1477
|
+
| **segment_key** | **String** | | |
|
|
1478
|
+
| **id** | **String** | The ID of the scheduled change | |
|
|
1479
|
+
| **patch_segment_scheduled_change_input** | [**PatchSegmentScheduledChangeInput**](PatchSegmentScheduledChangeInput.md) | | |
|
|
1480
|
+
|
|
1481
|
+
### Return type
|
|
1482
|
+
|
|
1483
|
+
[**SegmentScheduledChange**](SegmentScheduledChange.md)
|
|
1484
|
+
|
|
1485
|
+
### Authorization
|
|
1486
|
+
|
|
1487
|
+
[ApiKey](../README.md#ApiKey)
|
|
1488
|
+
|
|
1489
|
+
### HTTP request headers
|
|
1490
|
+
|
|
1491
|
+
- **Content-Type**: application/json
|
|
1492
|
+
- **Accept**: application/json
|
|
1493
|
+
|
|
1494
|
+
|
|
1183
1495
|
## post_segment
|
|
1184
1496
|
|
|
1185
1497
|
> <UserSegment> post_segment(project_key, environment_key, segment_body)
|
|
@@ -1255,6 +1567,83 @@ end
|
|
|
1255
1567
|
- **Accept**: application/json
|
|
1256
1568
|
|
|
1257
1569
|
|
|
1570
|
+
## post_segment_scheduled_change
|
|
1571
|
+
|
|
1572
|
+
> <SegmentScheduledChange> post_segment_scheduled_change(project_key, environment_key, segment_key, post_segment_scheduled_change_input)
|
|
1573
|
+
|
|
1574
|
+
Create a scheduled change for a segment
|
|
1575
|
+
|
|
1576
|
+
Schedule semantic patch instructions to be applied to a segment at a future time. Each instruction uses the same format as an instruction in a semantic patch request to update a segment. Send between 1 and 100 instructions. LaunchDarkly rejects the request with a 400 if an instruction has an unknown `kind` or is malformed. The caller must be allowed to update scheduled changes on the segment, and must also be allowed to make each instruction's change directly. If the segment requires approvals for an instruction, the caller must also be allowed to bypass them. Otherwise, request the change through an approval request instead. To learn more about semantic patches, read [Updates](/reference#updates-using-semantic-patch).
|
|
1577
|
+
|
|
1578
|
+
### Examples
|
|
1579
|
+
|
|
1580
|
+
```ruby
|
|
1581
|
+
require 'time'
|
|
1582
|
+
require 'launchdarkly_api'
|
|
1583
|
+
# setup authorization
|
|
1584
|
+
LaunchDarklyApi.configure do |config|
|
|
1585
|
+
# Configure API key authorization: ApiKey
|
|
1586
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
1587
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
1588
|
+
# config.api_key_prefix['Authorization'] = 'Bearer'
|
|
1589
|
+
end
|
|
1590
|
+
|
|
1591
|
+
api_instance = LaunchDarklyApi::SegmentsApi.new
|
|
1592
|
+
project_key = 'project_key_example' # String |
|
|
1593
|
+
environment_key = 'environment_key_example' # String |
|
|
1594
|
+
segment_key = 'segment_key_example' # String |
|
|
1595
|
+
post_segment_scheduled_change_input = LaunchDarklyApi::PostSegmentScheduledChangeInput.new({execution_date: 3.56, instructions: [{ key: 3.56}]}) # PostSegmentScheduledChangeInput |
|
|
1596
|
+
|
|
1597
|
+
begin
|
|
1598
|
+
# Create a scheduled change for a segment
|
|
1599
|
+
result = api_instance.post_segment_scheduled_change(project_key, environment_key, segment_key, post_segment_scheduled_change_input)
|
|
1600
|
+
p result
|
|
1601
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1602
|
+
puts "Error when calling SegmentsApi->post_segment_scheduled_change: #{e}"
|
|
1603
|
+
end
|
|
1604
|
+
```
|
|
1605
|
+
|
|
1606
|
+
#### Using the post_segment_scheduled_change_with_http_info variant
|
|
1607
|
+
|
|
1608
|
+
This returns an Array which contains the response data, status code and headers.
|
|
1609
|
+
|
|
1610
|
+
> <Array(<SegmentScheduledChange>, Integer, Hash)> post_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, post_segment_scheduled_change_input)
|
|
1611
|
+
|
|
1612
|
+
```ruby
|
|
1613
|
+
begin
|
|
1614
|
+
# Create a scheduled change for a segment
|
|
1615
|
+
data, status_code, headers = api_instance.post_segment_scheduled_change_with_http_info(project_key, environment_key, segment_key, post_segment_scheduled_change_input)
|
|
1616
|
+
p status_code # => 2xx
|
|
1617
|
+
p headers # => { ... }
|
|
1618
|
+
p data # => <SegmentScheduledChange>
|
|
1619
|
+
rescue LaunchDarklyApi::ApiError => e
|
|
1620
|
+
puts "Error when calling SegmentsApi->post_segment_scheduled_change_with_http_info: #{e}"
|
|
1621
|
+
end
|
|
1622
|
+
```
|
|
1623
|
+
|
|
1624
|
+
### Parameters
|
|
1625
|
+
|
|
1626
|
+
| Name | Type | Description | Notes |
|
|
1627
|
+
| ---- | ---- | ----------- | ----- |
|
|
1628
|
+
| **project_key** | **String** | | |
|
|
1629
|
+
| **environment_key** | **String** | | |
|
|
1630
|
+
| **segment_key** | **String** | | |
|
|
1631
|
+
| **post_segment_scheduled_change_input** | [**PostSegmentScheduledChangeInput**](PostSegmentScheduledChangeInput.md) | | |
|
|
1632
|
+
|
|
1633
|
+
### Return type
|
|
1634
|
+
|
|
1635
|
+
[**SegmentScheduledChange**](SegmentScheduledChange.md)
|
|
1636
|
+
|
|
1637
|
+
### Authorization
|
|
1638
|
+
|
|
1639
|
+
[ApiKey](../README.md#ApiKey)
|
|
1640
|
+
|
|
1641
|
+
### HTTP request headers
|
|
1642
|
+
|
|
1643
|
+
- **Content-Type**: application/json
|
|
1644
|
+
- **Accept**: application/json
|
|
1645
|
+
|
|
1646
|
+
|
|
1258
1647
|
## update_big_segment_context_targets
|
|
1259
1648
|
|
|
1260
1649
|
> update_big_segment_context_targets(project_key, environment_key, segment_key, segment_user_state)
|
data/docs/TreatmentInput.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
| **baseline** | **Boolean** | Whether this treatment is the baseline to compare other treatments against | |
|
|
9
9
|
| **allocation_percent** | **String** | The percentage of traffic allocated to this treatment during the iteration | |
|
|
10
10
|
| **parameters** | [**Array<TreatmentParameterInput>**](TreatmentParameterInput.md) | Details on the flag and variation to use for this treatment | |
|
|
11
|
+
| **assignment_variant_id** | **String** | The variant identifier in the warehouse-native assignment source that maps to this treatment | [optional] |
|
|
11
12
|
|
|
12
13
|
## Example
|
|
13
14
|
|
|
@@ -18,7 +19,8 @@ instance = LaunchDarklyApi::TreatmentInput.new(
|
|
|
18
19
|
name: Treatment 1,
|
|
19
20
|
baseline: true,
|
|
20
21
|
allocation_percent: 10,
|
|
21
|
-
parameters: null
|
|
22
|
+
parameters: null,
|
|
23
|
+
assignment_variant_id: treatment-1
|
|
22
24
|
)
|
|
23
25
|
```
|
|
24
26
|
|
data/docs/TreatmentRep.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
| **allocation_percent** | **String** | The percentage of traffic allocated to this treatment during the iteration | |
|
|
10
10
|
| **baseline** | **Boolean** | Whether this treatment is the baseline to compare other treatments against | [optional] |
|
|
11
11
|
| **parameters** | [**Array<ParameterRep>**](ParameterRep.md) | Details on the flag and variation used for this treatment | [optional] |
|
|
12
|
+
| **assignment_variant_id** | **String** | The variant identifier in the warehouse-native assignment source that maps to this treatment | [optional] |
|
|
12
13
|
|
|
13
14
|
## Example
|
|
14
15
|
|
|
@@ -20,7 +21,8 @@ instance = LaunchDarklyApi::TreatmentRep.new(
|
|
|
20
21
|
name: Treatment 1,
|
|
21
22
|
allocation_percent: 10,
|
|
22
23
|
baseline: true,
|
|
23
|
-
parameters: null
|
|
24
|
+
parameters: null,
|
|
25
|
+
assignment_variant_id: treatment_a
|
|
24
26
|
)
|
|
25
27
|
```
|
|
26
28
|
|
data/docs/Webhook.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
| **name** | **String** | A human-readable name for this webhook | [optional] |
|
|
10
10
|
| **url** | **String** | The URL to which LaunchDarkly sends an HTTP POST payload for this webhook | |
|
|
11
11
|
| **secret** | **String** | The secret for this webhook | [optional] |
|
|
12
|
+
| **has_bearer_token** | **Boolean** | Whether this webhook sends a bearer token. The token itself is never returned. | [optional] |
|
|
12
13
|
| **statements** | [**Array<Statement>**](Statement.md) | Represents a Custom role policy, defining a resource kinds filter the webhook responds to. | [optional] |
|
|
13
14
|
| **on** | **Boolean** | Whether or not this webhook is enabled | |
|
|
14
15
|
| **tags** | **Array<String>** | List of tags for this webhook | |
|
|
@@ -25,6 +26,7 @@ instance = LaunchDarklyApi::Webhook.new(
|
|
|
25
26
|
name: Example hook,
|
|
26
27
|
url: http://www.example.com,
|
|
27
28
|
secret: frobozz,
|
|
29
|
+
has_bearer_token: true,
|
|
28
30
|
statements: null,
|
|
29
31
|
on: true,
|
|
30
32
|
tags: ["examples"],
|
data/docs/WebhookPost.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **name** | **String** | A human-readable name for your webhook | [optional] |
|
|
8
8
|
| **url** | **String** | The URL of the remote webhook | |
|
|
9
9
|
| **secret** | **String** | If sign is true, and the secret attribute is omitted, LaunchDarkly automatically generates a secret for you. | [optional] |
|
|
10
|
+
| **bearer_token** | **String** | An optional token. If set, LaunchDarkly sends it in an Authorization: Bearer header with each request. It is write-only and is never returned. | [optional] |
|
|
10
11
|
| **statements** | [**Array<StatementPost>**](StatementPost.md) | | [optional] |
|
|
11
12
|
| **sign** | **Boolean** | If sign is false, the webhook does not include a signature header, and the secret can be omitted. | |
|
|
12
13
|
| **on** | **Boolean** | Whether or not this webhook is enabled. | |
|
|
@@ -21,6 +22,7 @@ instance = LaunchDarklyApi::WebhookPost.new(
|
|
|
21
22
|
name: Example hook,
|
|
22
23
|
url: http://www.example.com,
|
|
23
24
|
secret: frobozz,
|
|
25
|
+
bearer_token: example-token,
|
|
24
26
|
statements: null,
|
|
25
27
|
sign: true,
|
|
26
28
|
on: true,
|
|
@@ -2271,6 +2271,7 @@ module LaunchDarklyApi
|
|
|
2271
2271
|
# @option opts [Integer] :limit The number of resources to return.
|
|
2272
2272
|
# @option opts [Integer] :offset Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
|
|
2273
2273
|
# @option opts [String] :filter A filter to apply to the list.
|
|
2274
|
+
# @option opts [String] :sort A sort to apply to the list of agent skills. Use `usedIn` to sort by the number of AgentControl configs that use each skill, fewest first, or `-usedIn` for most first. Without a sort, skills are ordered by creation date, newest first.
|
|
2274
2275
|
# @return [AgentSkills]
|
|
2275
2276
|
def list_agent_skills(project_key, opts = {})
|
|
2276
2277
|
data, _status_code, _headers = list_agent_skills_with_http_info(project_key, opts)
|
|
@@ -2284,6 +2285,7 @@ module LaunchDarklyApi
|
|
|
2284
2285
|
# @option opts [Integer] :limit The number of resources to return.
|
|
2285
2286
|
# @option opts [Integer] :offset Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`.
|
|
2286
2287
|
# @option opts [String] :filter A filter to apply to the list.
|
|
2288
|
+
# @option opts [String] :sort A sort to apply to the list of agent skills. Use `usedIn` to sort by the number of AgentControl configs that use each skill, fewest first, or `-usedIn` for most first. Without a sort, skills are ordered by creation date, newest first.
|
|
2287
2289
|
# @return [Array<(AgentSkills, Integer, Hash)>] AgentSkills data, response status code and response headers
|
|
2288
2290
|
def list_agent_skills_with_http_info(project_key, opts = {})
|
|
2289
2291
|
if @api_client.config.debugging
|
|
@@ -2301,6 +2303,7 @@ module LaunchDarklyApi
|
|
|
2301
2303
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
2302
2304
|
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
2303
2305
|
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
2306
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
2304
2307
|
|
|
2305
2308
|
# header parameters
|
|
2306
2309
|
header_params = opts[:header_params] || {}
|
|
@@ -169,6 +169,7 @@ module LaunchDarklyApi
|
|
|
169
169
|
# @option opts [Integer] :limit A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.
|
|
170
170
|
# @option opts [String] :member A member ID that lets you filter audit log listings by the member who made the change. Repeat the parameter to filter by multiple members.
|
|
171
171
|
# @option opts [String] :token An access token ID that lets you filter audit log listings by the token that made the change. Repeat the parameter to filter by multiple tokens.
|
|
172
|
+
# @option opts [Integer] :rollup Set to 1 to return rolled-up audit log entries, which group related changes into one entry. By default, entries aren't rolled up.
|
|
172
173
|
# @option opts [Array<StatementPost>] :statement_post
|
|
173
174
|
# @return [AuditLogEntryListingRepCollection]
|
|
174
175
|
def post_audit_log_entries(opts = {})
|
|
@@ -185,6 +186,7 @@ module LaunchDarklyApi
|
|
|
185
186
|
# @option opts [Integer] :limit A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10.
|
|
186
187
|
# @option opts [String] :member A member ID that lets you filter audit log listings by the member who made the change. Repeat the parameter to filter by multiple members.
|
|
187
188
|
# @option opts [String] :token An access token ID that lets you filter audit log listings by the token that made the change. Repeat the parameter to filter by multiple tokens.
|
|
189
|
+
# @option opts [Integer] :rollup Set to 1 to return rolled-up audit log entries, which group related changes into one entry. By default, entries aren't rolled up.
|
|
188
190
|
# @option opts [Array<StatementPost>] :statement_post
|
|
189
191
|
# @return [Array<(AuditLogEntryListingRepCollection, Integer, Hash)>] AuditLogEntryListingRepCollection data, response status code and response headers
|
|
190
192
|
def post_audit_log_entries_with_http_info(opts = {})
|
|
@@ -202,6 +204,7 @@ module LaunchDarklyApi
|
|
|
202
204
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
203
205
|
query_params[:'member'] = opts[:'member'] if !opts[:'member'].nil?
|
|
204
206
|
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
207
|
+
query_params[:'rollup'] = opts[:'rollup'] if !opts[:'rollup'].nil?
|
|
205
208
|
|
|
206
209
|
# header parameters
|
|
207
210
|
header_params = opts[:header_params] || {}
|
|
@@ -489,7 +489,7 @@ module LaunchDarklyApi
|
|
|
489
489
|
end
|
|
490
490
|
|
|
491
491
|
# Patch experiment
|
|
492
|
-
# Update an experiment. Updating an experiment uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating experiments. #### updateName > **Deprecated**: `updateName` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateName\", \"value\": \"Example updated experiment name\" }] } ``` #### updateDescription > **Deprecated**: `updateDescription` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateDescription\", \"value\": \"Example updated description\" }] } ``` #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (`add`, `update`, or `remove`) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - `value`: An object mapping field names to field updates. Each field update has the following properties: - `operation`: The operation to perform. One of `add`, `update`, or `remove`. - `value`: The new value for the field. Required for `add` and `update` operations. To find which fields are supported and which operations are allowed for each iteration status, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"name\": { \"operation\": \"update\", \"value\": \"Updated experiment name\" }, \"tags\": { \"operation\": \"add\", \"value\": [\"tag1\", \"tag2\"] } } }] } ``` #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - `changeJustification`: (Optional) The reason for stopping and starting a new iteration. - `value`: (Optional) An object mapping field names to field updates, using the same format as `updateExperimentFields`. These updates are applied to the new iteration before it is started. Here's an example: ```json { \"instructions\": [{ \"kind\": \"saveAndStartNewIteration\", \"changeJustification\": \"Adjusting hypothesis based on early results\", \"value\": { \"hypothesis\": { \"operation\": \"update\", \"value\": \"Updated hypothesis text\" } } }] } ``` #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its `randomizationUnit` is set * At least one of its `treatments` has a non-zero `allocationPercent` ##### Parameters - `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional. Here's an example: ```json { \"instructions\": [{ \"kind\": \"startIteration\", \"changeJustification\": \"It's time to start a new iteration\" }] } ``` #### stopIteration Stops the current iteration for this experiment. ##### Parameters - `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the `_id` of each element in the `treatments` array. - `winningReason`: The reason for the winner Here's an example: ```json { \"instructions\": [{ \"kind\": \"stopIteration\", \"winningTreatmentId\": \"3a548ec2-72ac-4e59-8518-5c24f5609ccf\", \"winningReason\": \"Example reason to stop the iteration\" }] } ``` #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here's an example: ```json { \"instructions\": [{ \"kind\": \"archiveExperiment\" }] } ``` #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here's an example: ```json { \"instructions\": [{ \"kind\": \"restoreExperiment\" }] } ```
|
|
492
|
+
# Update an experiment. Updating an experiment uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating experiments. #### updateName > **Deprecated**: `updateName` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateName\", \"value\": \"Example updated experiment name\" }] } ``` #### updateDescription > **Deprecated**: `updateDescription` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateDescription\", \"value\": \"Example updated description\" }] } ``` #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (`add`, `update`, or `remove`) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - `value`: An object mapping field names to field updates. Each field update has the following properties: - `operation`: The operation to perform. One of `add`, `update`, or `remove`. - `value`: The new value for the field. Required for `add` and `update` operations. To find which fields are supported and which operations are allowed for each iteration status, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"name\": { \"operation\": \"update\", \"value\": \"Updated experiment name\" }, \"tags\": { \"operation\": \"add\", \"value\": [\"tag1\", \"tag2\"] } } }] } ``` ##### Custom assignment source fields If your experiment reads its assignment data from your data warehouse, two additional fields control the assignment source it uses. Use `assignmentDataSource` to attach an assignment source to an iteration, change which source it points at, or detach it. Its value is an object with the following properties: - `key`: (Required) The key of the assignment data source. - `experimentId`: The experiment identifier in the assignment data source. You can omit this while the experiment is a draft, but you must set it before you start the experiment. - `startTime`: (Optional) The start of the assignment data window, in Unix milliseconds. - `endTime`: (Optional) The end of the assignment data window, in Unix milliseconds. This must be later than `startTime`. To detach the assignment source, send `null` as the value. You can only change this field while the iteration is still a draft. Use `assignmentDataSourceWindow` to change only the dates on an assignment source that is already attached. Its value is an object with the same `startTime` and `endTime` properties. The iteration must already have an assignment source. This is how you adjust the dates after an iteration has run, because the source itself is fixed at that point. Multi-armed bandits use flags for assignment, so they support neither field. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"assignmentDataSource\": { \"operation\": \"update\", \"value\": { \"key\": \"my-assignment-data-source\", \"experimentId\": \"experiment-123\", \"startTime\": 1690000000000, \"endTime\": 1690600000000 } } } }] } ``` #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - `changeJustification`: (Optional) The reason for stopping and starting a new iteration. - `value`: (Optional) An object mapping field names to field updates, using the same format as `updateExperimentFields`. These updates are applied to the new iteration before it is started. Here's an example: ```json { \"instructions\": [{ \"kind\": \"saveAndStartNewIteration\", \"changeJustification\": \"Adjusting hypothesis based on early results\", \"value\": { \"hypothesis\": { \"operation\": \"update\", \"value\": \"Updated hypothesis text\" } } }] } ``` #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its `randomizationUnit` is set * At least one of its `treatments` has a non-zero `allocationPercent` ##### Parameters - `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional. Here's an example: ```json { \"instructions\": [{ \"kind\": \"startIteration\", \"changeJustification\": \"It's time to start a new iteration\" }] } ``` #### stopIteration Stops the current iteration for this experiment. ##### Parameters - `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the `_id` of each element in the `treatments` array. - `winningReason`: The reason for the winner Here's an example: ```json { \"instructions\": [{ \"kind\": \"stopIteration\", \"winningTreatmentId\": \"3a548ec2-72ac-4e59-8518-5c24f5609ccf\", \"winningReason\": \"Example reason to stop the iteration\" }] } ``` #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here's an example: ```json { \"instructions\": [{ \"kind\": \"archiveExperiment\" }] } ``` #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here's an example: ```json { \"instructions\": [{ \"kind\": \"restoreExperiment\" }] } ```
|
|
493
493
|
# @param project_key [String] The project key
|
|
494
494
|
# @param environment_key [String] The environment key
|
|
495
495
|
# @param experiment_key [String] The experiment key
|
|
@@ -502,7 +502,7 @@ module LaunchDarklyApi
|
|
|
502
502
|
end
|
|
503
503
|
|
|
504
504
|
# Patch experiment
|
|
505
|
-
# Update an experiment. Updating an experiment uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating experiments. #### updateName > **Deprecated**: `updateName` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateName\", \"value\": \"Example updated experiment name\" }] } ``` #### updateDescription > **Deprecated**: `updateDescription` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateDescription\", \"value\": \"Example updated description\" }] } ``` #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (`add`, `update`, or `remove`) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - `value`: An object mapping field names to field updates. Each field update has the following properties: - `operation`: The operation to perform. One of `add`, `update`, or `remove`. - `value`: The new value for the field. Required for `add` and `update` operations. To find which fields are supported and which operations are allowed for each iteration status, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"name\": { \"operation\": \"update\", \"value\": \"Updated experiment name\" }, \"tags\": { \"operation\": \"add\", \"value\": [\"tag1\", \"tag2\"] } } }] } ``` #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - `changeJustification`: (Optional) The reason for stopping and starting a new iteration. - `value`: (Optional) An object mapping field names to field updates, using the same format as `updateExperimentFields`. These updates are applied to the new iteration before it is started. Here's an example: ```json { \"instructions\": [{ \"kind\": \"saveAndStartNewIteration\", \"changeJustification\": \"Adjusting hypothesis based on early results\", \"value\": { \"hypothesis\": { \"operation\": \"update\", \"value\": \"Updated hypothesis text\" } } }] } ``` #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its `randomizationUnit` is set * At least one of its `treatments` has a non-zero `allocationPercent` ##### Parameters - `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional. Here's an example: ```json { \"instructions\": [{ \"kind\": \"startIteration\", \"changeJustification\": \"It's time to start a new iteration\" }] } ``` #### stopIteration Stops the current iteration for this experiment. ##### Parameters - `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the `_id` of each element in the `treatments` array. - `winningReason`: The reason for the winner Here's an example: ```json { \"instructions\": [{ \"kind\": \"stopIteration\", \"winningTreatmentId\": \"3a548ec2-72ac-4e59-8518-5c24f5609ccf\", \"winningReason\": \"Example reason to stop the iteration\" }] } ``` #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here's an example: ```json { \"instructions\": [{ \"kind\": \"archiveExperiment\" }] } ``` #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here's an example: ```json { \"instructions\": [{ \"kind\": \"restoreExperiment\" }] } ```
|
|
505
|
+
# Update an experiment. Updating an experiment uses the semantic patch format. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating experiments. #### updateName > **Deprecated**: `updateName` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment name. ##### Parameters - `value`: The new name. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateName\", \"value\": \"Example updated experiment name\" }] } ``` #### updateDescription > **Deprecated**: `updateDescription` will be removed in a future version. Use `updateExperimentFields` instead. Updates the experiment description. ##### Parameters - `value`: The new description. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateDescription\", \"value\": \"Example updated description\" }] } ``` #### updateExperimentFields Updates one or more fields on an experiment or its current iteration. Each field update specifies an operation (`add`, `update`, or `remove`) and an optional value. Which fields are mutable depends on the current iteration status. To discover which fields and operations are allowed, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. ##### Parameters - `value`: An object mapping field names to field updates. Each field update has the following properties: - `operation`: The operation to perform. One of `add`, `update`, or `remove`. - `value`: The new value for the field. Required for `add` and `update` operations. To find which fields are supported and which operations are allowed for each iteration status, expand `mutableFieldsByStatus` on the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"name\": { \"operation\": \"update\", \"value\": \"Updated experiment name\" }, \"tags\": { \"operation\": \"add\", \"value\": [\"tag1\", \"tag2\"] } } }] } ``` ##### Custom assignment source fields If your experiment reads its assignment data from your data warehouse, two additional fields control the assignment source it uses. Use `assignmentDataSource` to attach an assignment source to an iteration, change which source it points at, or detach it. Its value is an object with the following properties: - `key`: (Required) The key of the assignment data source. - `experimentId`: The experiment identifier in the assignment data source. You can omit this while the experiment is a draft, but you must set it before you start the experiment. - `startTime`: (Optional) The start of the assignment data window, in Unix milliseconds. - `endTime`: (Optional) The end of the assignment data window, in Unix milliseconds. This must be later than `startTime`. To detach the assignment source, send `null` as the value. You can only change this field while the iteration is still a draft. Use `assignmentDataSourceWindow` to change only the dates on an assignment source that is already attached. Its value is an object with the same `startTime` and `endTime` properties. The iteration must already have an assignment source. This is how you adjust the dates after an iteration has run, because the source itself is fixed at that point. Multi-armed bandits use flags for assignment, so they support neither field. Here's an example: ```json { \"instructions\": [{ \"kind\": \"updateExperimentFields\", \"value\": { \"assignmentDataSource\": { \"operation\": \"update\", \"value\": { \"key\": \"my-assignment-data-source\", \"experimentId\": \"experiment-123\", \"startTime\": 1690000000000, \"endTime\": 1690600000000 } } } }] } ``` #### saveAndStartNewIteration Stops the current running iteration, creates a new iteration from it, optionally applies field updates, and starts the new iteration. This is a convenience instruction that combines stopping, updating, and starting in a single operation. ##### Parameters - `changeJustification`: (Optional) The reason for stopping and starting a new iteration. - `value`: (Optional) An object mapping field names to field updates, using the same format as `updateExperimentFields`. These updates are applied to the new iteration before it is started. Here's an example: ```json { \"instructions\": [{ \"kind\": \"saveAndStartNewIteration\", \"changeJustification\": \"Adjusting hypothesis based on early results\", \"value\": { \"hypothesis\": { \"operation\": \"update\", \"value\": \"Updated hypothesis text\" } } }] } ``` #### startIteration Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction. An iteration may not be started until it meets the following criteria: * Its associated flag is toggled on and is not archived * Its `randomizationUnit` is set * At least one of its `treatments` has a non-zero `allocationPercent` ##### Parameters - `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional. Here's an example: ```json { \"instructions\": [{ \"kind\": \"startIteration\", \"changeJustification\": \"It's time to start a new iteration\" }] } ``` #### stopIteration Stops the current iteration for this experiment. ##### Parameters - `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the `_id` of each element in the `treatments` array. - `winningReason`: The reason for the winner Here's an example: ```json { \"instructions\": [{ \"kind\": \"stopIteration\", \"winningTreatmentId\": \"3a548ec2-72ac-4e59-8518-5c24f5609ccf\", \"winningReason\": \"Example reason to stop the iteration\" }] } ``` #### archiveExperiment Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments. Here's an example: ```json { \"instructions\": [{ \"kind\": \"archiveExperiment\" }] } ``` #### restoreExperiment Restores an archived experiment. After restoring an experiment, you can start new iterations for it again. Here's an example: ```json { \"instructions\": [{ \"kind\": \"restoreExperiment\" }] } ```
|
|
506
506
|
# @param project_key [String] The project key
|
|
507
507
|
# @param environment_key [String] The environment key
|
|
508
508
|
# @param experiment_key [String] The experiment key
|