rbflagr 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/Makefile +9 -0
  4. data/README.md +143 -0
  5. data/Rakefile +8 -0
  6. data/docs/Constraint.md +11 -0
  7. data/docs/ConstraintApi.md +211 -0
  8. data/docs/CreateConstraintRequest.md +10 -0
  9. data/docs/CreateFlagRequest.md +8 -0
  10. data/docs/CreateSegmentRequest.md +9 -0
  11. data/docs/CreateVariantRequest.md +9 -0
  12. data/docs/Distribution.md +12 -0
  13. data/docs/DistributionApi.md +109 -0
  14. data/docs/Error.md +8 -0
  15. data/docs/EvalContext.md +12 -0
  16. data/docs/EvalDebugLog.md +9 -0
  17. data/docs/EvalResult.md +16 -0
  18. data/docs/EvaluationApi.md +98 -0
  19. data/docs/EvaluationBatchRequest.md +10 -0
  20. data/docs/EvaluationBatchResponse.md +8 -0
  21. data/docs/EvaluationEntity.md +10 -0
  22. data/docs/Flag.md +13 -0
  23. data/docs/FlagApi.md +337 -0
  24. data/docs/FlagSnapshot.md +11 -0
  25. data/docs/HealthApi.md +46 -0
  26. data/docs/PutDistributionsRequest.md +8 -0
  27. data/docs/PutFlagRequest.md +9 -0
  28. data/docs/PutSegmentReorderRequest.md +8 -0
  29. data/docs/PutSegmentRequest.md +9 -0
  30. data/docs/PutVariantRequest.md +9 -0
  31. data/docs/Segment.md +13 -0
  32. data/docs/SegmentApi.md +246 -0
  33. data/docs/SegmentDebugLog.md +9 -0
  34. data/docs/SetFlagEnabledRequest.md +8 -0
  35. data/docs/Variant.md +10 -0
  36. data/docs/VariantApi.md +199 -0
  37. data/git_push.sh +55 -0
  38. data/lib/rbflagr.rb +70 -0
  39. data/lib/rbflagr/api/constraint_api.rb +310 -0
  40. data/lib/rbflagr/api/distribution_api.rb +159 -0
  41. data/lib/rbflagr/api/evaluation_api.rb +123 -0
  42. data/lib/rbflagr/api/flag_api.rb +413 -0
  43. data/lib/rbflagr/api/health_api.rb +66 -0
  44. data/lib/rbflagr/api/segment_api.rb +329 -0
  45. data/lib/rbflagr/api/variant_api.rb +270 -0
  46. data/lib/rbflagr/api_client.rb +388 -0
  47. data/lib/rbflagr/api_error.rb +38 -0
  48. data/lib/rbflagr/configuration.rb +202 -0
  49. data/lib/rbflagr/models/constraint.rb +317 -0
  50. data/lib/rbflagr/models/create_constraint_request.rb +273 -0
  51. data/lib/rbflagr/models/create_flag_request.rb +207 -0
  52. data/lib/rbflagr/models/create_segment_request.rb +249 -0
  53. data/lib/rbflagr/models/create_variant_request.rb +216 -0
  54. data/lib/rbflagr/models/distribution.rb +330 -0
  55. data/lib/rbflagr/models/error.rb +207 -0
  56. data/lib/rbflagr/models/eval_context.rb +268 -0
  57. data/lib/rbflagr/models/eval_debug_log.rb +194 -0
  58. data/lib/rbflagr/models/eval_result.rb +385 -0
  59. data/lib/rbflagr/models/evaluation_batch_request.rb +215 -0
  60. data/lib/rbflagr/models/evaluation_batch_response.rb +190 -0
  61. data/lib/rbflagr/models/evaluation_entity.rb +225 -0
  62. data/lib/rbflagr/models/flag.rb +282 -0
  63. data/lib/rbflagr/models/flag_snapshot.rb +263 -0
  64. data/lib/rbflagr/models/put_distributions_request.rb +190 -0
  65. data/lib/rbflagr/models/put_flag_request.rb +217 -0
  66. data/lib/rbflagr/models/put_segment_reorder_request.rb +190 -0
  67. data/lib/rbflagr/models/put_segment_request.rb +249 -0
  68. data/lib/rbflagr/models/put_variant_request.rb +221 -0
  69. data/lib/rbflagr/models/segment.rb +328 -0
  70. data/lib/rbflagr/models/segment_debug_log.rb +207 -0
  71. data/lib/rbflagr/models/set_flag_enabled_request.rb +188 -0
  72. data/lib/rbflagr/models/variant.rb +240 -0
  73. data/lib/rbflagr/version.rb +15 -0
  74. data/rbflagr.gemspec +45 -0
  75. data/spec/api/constraint_api_spec.rb +91 -0
  76. data/spec/api/distribution_api_spec.rb +62 -0
  77. data/spec/api/evaluation_api_spec.rb +47 -0
  78. data/spec/api/flag_api_spec.rb +108 -0
  79. data/spec/api/health_api_spec.rb +44 -0
  80. data/spec/api/segment_api_spec.rb +87 -0
  81. data/spec/api/variant_api_spec.rb +87 -0
  82. data/spec/api_client_spec.rb +226 -0
  83. data/spec/configuration_spec.rb +42 -0
  84. data/spec/models/constraint_spec.rb +64 -0
  85. data/spec/models/create_constraint_request_spec.rb +54 -0
  86. data/spec/models/create_flag_request_spec.rb +42 -0
  87. data/spec/models/create_segment_request_spec.rb +48 -0
  88. data/spec/models/create_variant_request_spec.rb +48 -0
  89. data/spec/models/distribution_spec.rb +66 -0
  90. data/spec/models/error_spec.rb +42 -0
  91. data/spec/models/eval_context_spec.rb +66 -0
  92. data/spec/models/eval_debug_log_spec.rb +48 -0
  93. data/spec/models/eval_result_spec.rb +78 -0
  94. data/spec/models/evaluation_batch_request_spec.rb +54 -0
  95. data/spec/models/evaluation_batch_response_spec.rb +42 -0
  96. data/spec/models/evaluation_entity_spec.rb +54 -0
  97. data/spec/models/flag_snapshot_spec.rb +60 -0
  98. data/spec/models/flag_spec.rb +66 -0
  99. data/spec/models/put_distributions_request_spec.rb +42 -0
  100. data/spec/models/put_flag_request_spec.rb +42 -0
  101. data/spec/models/put_segment_reorder_request_spec.rb +42 -0
  102. data/spec/models/put_segment_request_spec.rb +48 -0
  103. data/spec/models/put_variant_request_spec.rb +48 -0
  104. data/spec/models/segment_debug_log_spec.rb +48 -0
  105. data/spec/models/segment_spec.rb +72 -0
  106. data/spec/models/set_flag_enabled_request_spec.rb +42 -0
  107. data/spec/models/variant_spec.rb +54 -0
  108. data/spec/spec_helper.rb +111 -0
  109. data/swagger.yaml +1135 -0
  110. data/swagger_ruby.json +6 -0
  111. data/tags +618 -0
  112. metadata +362 -0
@@ -0,0 +1,72 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Flagr::Segment
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'Segment' do
21
+ before do
22
+ # run before each test
23
+ @instance = Flagr::Segment.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of Segment' do
31
+ it 'should create an instance of Segment' do
32
+ expect(@instance).to be_instance_of(Flagr::Segment)
33
+ end
34
+ end
35
+ describe 'test attribute "id"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "description"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "constraints"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "distributions"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "rank"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "rollout_percent"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ end
72
+
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Flagr::SetFlagEnabledRequest
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'SetFlagEnabledRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = Flagr::SetFlagEnabledRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of SetFlagEnabledRequest' do
31
+ it 'should create an instance of SetFlagEnabledRequest' do
32
+ expect(@instance).to be_instance_of(Flagr::SetFlagEnabledRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "enabled"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ end
42
+
@@ -0,0 +1,54 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Flagr::Variant
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'Variant' do
21
+ before do
22
+ # run before each test
23
+ @instance = Flagr::Variant.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of Variant' do
31
+ it 'should create an instance of Variant' do
32
+ expect(@instance).to be_instance_of(Flagr::Variant)
33
+ end
34
+ end
35
+ describe 'test attribute "id"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "key"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "attachment"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end
54
+
@@ -0,0 +1,111 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ # load the gem
14
+ require 'rbflagr'
15
+
16
+ # The following was generated by the `rspec --init` command. Conventionally, all
17
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
18
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
19
+ # this file to always be loaded, without a need to explicitly require it in any
20
+ # files.
21
+ #
22
+ # Given that it is always loaded, you are encouraged to keep this file as
23
+ # light-weight as possible. Requiring heavyweight dependencies from this file
24
+ # will add to the boot time of your test suite on EVERY test run, even for an
25
+ # individual file that may not need all of that loaded. Instead, consider making
26
+ # a separate helper file that requires the additional dependencies and performs
27
+ # the additional setup, and require it from the spec files that actually need
28
+ # it.
29
+ #
30
+ # The `.rspec` file also contains a few flags that are not defaults but that
31
+ # users commonly want.
32
+ #
33
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
34
+ RSpec.configure do |config|
35
+ # rspec-expectations config goes here. You can use an alternate
36
+ # assertion/expectation library such as wrong or the stdlib/minitest
37
+ # assertions if you prefer.
38
+ config.expect_with :rspec do |expectations|
39
+ # This option will default to `true` in RSpec 4. It makes the `description`
40
+ # and `failure_message` of custom matchers include text for helper methods
41
+ # defined using `chain`, e.g.:
42
+ # be_bigger_than(2).and_smaller_than(4).description
43
+ # # => "be bigger than 2 and smaller than 4"
44
+ # ...rather than:
45
+ # # => "be bigger than 2"
46
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
47
+ end
48
+
49
+ # rspec-mocks config goes here. You can use an alternate test double
50
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
51
+ config.mock_with :rspec do |mocks|
52
+ # Prevents you from mocking or stubbing a method that does not exist on
53
+ # a real object. This is generally recommended, and will default to
54
+ # `true` in RSpec 4.
55
+ mocks.verify_partial_doubles = true
56
+ end
57
+
58
+ # The settings below are suggested to provide a good initial experience
59
+ # with RSpec, but feel free to customize to your heart's content.
60
+ =begin
61
+ # These two settings work together to allow you to limit a spec run
62
+ # to individual examples or groups you care about by tagging them with
63
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
64
+ # get run.
65
+ config.filter_run :focus
66
+ config.run_all_when_everything_filtered = true
67
+
68
+ # Allows RSpec to persist some state between runs in order to support
69
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
70
+ # you configure your source control system to ignore this file.
71
+ config.example_status_persistence_file_path = "spec/examples.txt"
72
+
73
+ # Limits the available syntax to the non-monkey patched syntax that is
74
+ # recommended. For more details, see:
75
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
76
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
77
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
78
+ config.disable_monkey_patching!
79
+
80
+ # This setting enables warnings. It's recommended, but in some cases may
81
+ # be too noisy due to issues in dependencies.
82
+ config.warnings = true
83
+
84
+ # Many RSpec users commonly either run the entire suite or an individual
85
+ # file, and it's useful to allow more verbose output when running an
86
+ # individual spec file.
87
+ if config.files_to_run.one?
88
+ # Use the documentation formatter for detailed output,
89
+ # unless a formatter has already been configured
90
+ # (e.g. via a command-line flag).
91
+ config.default_formatter = 'doc'
92
+ end
93
+
94
+ # Print the 10 slowest examples and example groups at the
95
+ # end of the spec run, to help surface which specs are running
96
+ # particularly slow.
97
+ config.profile_examples = 10
98
+
99
+ # Run specs in random order to surface order dependencies. If you find an
100
+ # order dependency and want to debug it, you can fix the order by providing
101
+ # the seed, which is printed after each run.
102
+ # --seed 1234
103
+ config.order = :random
104
+
105
+ # Seed global randomization in this process using the `--seed` CLI option.
106
+ # Setting this allows you to use `--seed` to deterministically reproduce
107
+ # test failures related to randomization by passing the same `--seed` value
108
+ # as the one that triggered the failure.
109
+ Kernel.srand config.seed
110
+ =end
111
+ end
@@ -0,0 +1,1135 @@
1
+ swagger: '2.0'
2
+ info:
3
+ description: >-
4
+ Flagr is a feature flagging, A/B testing and dynamic configuration
5
+ microservice
6
+ title: Flagr
7
+ version: 1.0.8
8
+ tags:
9
+ - name: flag
10
+ description: Everything about the flag
11
+ - name: segment
12
+ description: 'Segment defines the audience of the flag, it''s the user segmentation'
13
+ - name: constraint
14
+ description: Constraint is the unit of defining a small subset of users
15
+ - name: distribution
16
+ description: Distribution is the percent distribution of variants within that segment
17
+ - name: variant
18
+ description: Variants are the possible outcomes of flag evaluation
19
+ - name: evaluation
20
+ description: Evaluation is the process of evaluating a flag given the entity context
21
+ - name: health
22
+ description: Check if Flagr is healthy
23
+ x-tagGroups:
24
+ - name: Flag Management
25
+ tags:
26
+ - flag
27
+ - segment
28
+ - constraint
29
+ - distribution
30
+ - variant
31
+ - name: Flag Evaluation
32
+ tags:
33
+ - evaluation
34
+ - name: Health Check
35
+ tags:
36
+ - health
37
+ consumes:
38
+ - application/json
39
+ produces:
40
+ - application/json
41
+ schemes:
42
+ - http
43
+ basePath: /api/v1
44
+ paths:
45
+ /flags:
46
+ get:
47
+ tags:
48
+ - flag
49
+ operationId: findFlags
50
+ parameters:
51
+ - in: query
52
+ name: limit
53
+ type: integer
54
+ format: int64
55
+ description: the numbers of flags to return
56
+ - in: query
57
+ name: enabled
58
+ type: boolean
59
+ description: return flags having given enabled status
60
+ - in: query
61
+ name: description
62
+ type: string
63
+ description: return flags exactly matching given description
64
+ - in: query
65
+ name: description_like
66
+ type: string
67
+ description: return flags partially matching given description
68
+ - in: query
69
+ name: offset
70
+ type: integer
71
+ format: int64
72
+ description: >-
73
+ return flags given the offset, it should usually set together with
74
+ limit
75
+ responses:
76
+ '200':
77
+ description: list all the flags
78
+ schema:
79
+ type: array
80
+ items:
81
+ $ref: '#/definitions/flag'
82
+ default:
83
+ description: generic error response
84
+ schema:
85
+ $ref: '#/definitions/error'
86
+ post:
87
+ tags:
88
+ - flag
89
+ operationId: createFlag
90
+ parameters:
91
+ - in: body
92
+ name: body
93
+ description: create a flag
94
+ required: true
95
+ schema:
96
+ $ref: '#/definitions/createFlagRequest'
97
+ responses:
98
+ '200':
99
+ description: returns the created flag
100
+ schema:
101
+ $ref: '#/definitions/flag'
102
+ default:
103
+ description: generic error response
104
+ schema:
105
+ $ref: '#/definitions/error'
106
+ '/flags/{flagID}':
107
+ get:
108
+ tags:
109
+ - flag
110
+ operationId: getFlag
111
+ parameters:
112
+ - in: path
113
+ name: flagID
114
+ description: numeric ID of the flag to get
115
+ required: true
116
+ type: integer
117
+ format: int64
118
+ minimum: 1
119
+ responses:
120
+ '200':
121
+ description: returns the flag
122
+ schema:
123
+ $ref: '#/definitions/flag'
124
+ default:
125
+ description: generic error response
126
+ schema:
127
+ $ref: '#/definitions/error'
128
+ put:
129
+ tags:
130
+ - flag
131
+ operationId: putFlag
132
+ parameters:
133
+ - in: path
134
+ name: flagID
135
+ description: numeric ID of the flag to get
136
+ required: true
137
+ type: integer
138
+ format: int64
139
+ minimum: 1
140
+ - in: body
141
+ name: body
142
+ description: update a flag
143
+ required: true
144
+ schema:
145
+ $ref: '#/definitions/putFlagRequest'
146
+ responses:
147
+ '200':
148
+ description: returns the flag
149
+ schema:
150
+ $ref: '#/definitions/flag'
151
+ default:
152
+ description: generic error response
153
+ schema:
154
+ $ref: '#/definitions/error'
155
+ delete:
156
+ tags:
157
+ - flag
158
+ operationId: deleteFlag
159
+ parameters:
160
+ - in: path
161
+ name: flagID
162
+ description: numeric ID of the flag
163
+ required: true
164
+ type: integer
165
+ format: int64
166
+ minimum: 1
167
+ responses:
168
+ '200':
169
+ description: OK deleted
170
+ default:
171
+ description: generic error response
172
+ schema:
173
+ $ref: '#/definitions/error'
174
+ '/flags/{flagID}/enabled':
175
+ put:
176
+ tags:
177
+ - flag
178
+ operationId: setFlagEnabled
179
+ parameters:
180
+ - in: path
181
+ name: flagID
182
+ description: numeric ID of the flag to get
183
+ required: true
184
+ type: integer
185
+ format: int64
186
+ minimum: 1
187
+ - in: body
188
+ name: body
189
+ description: set flag enabled state
190
+ required: true
191
+ schema:
192
+ $ref: '#/definitions/setFlagEnabledRequest'
193
+ responses:
194
+ '200':
195
+ description: returns the flag
196
+ schema:
197
+ $ref: '#/definitions/flag'
198
+ default:
199
+ description: generic error response
200
+ schema:
201
+ $ref: '#/definitions/error'
202
+ '/flags/{flagID}/variants':
203
+ get:
204
+ tags:
205
+ - variant
206
+ operationId: findVariants
207
+ parameters:
208
+ - in: path
209
+ name: flagID
210
+ description: numeric ID of the flag
211
+ required: true
212
+ type: integer
213
+ format: int64
214
+ minimum: 1
215
+ responses:
216
+ '200':
217
+ description: variant ordered by variantID
218
+ schema:
219
+ type: array
220
+ items:
221
+ $ref: '#/definitions/variant'
222
+ default:
223
+ description: generic error response
224
+ schema:
225
+ $ref: '#/definitions/error'
226
+ post:
227
+ tags:
228
+ - variant
229
+ operationId: createVariant
230
+ parameters:
231
+ - in: path
232
+ name: flagID
233
+ description: numeric ID of the flag
234
+ required: true
235
+ type: integer
236
+ format: int64
237
+ minimum: 1
238
+ - in: body
239
+ name: body
240
+ description: create a variant
241
+ required: true
242
+ schema:
243
+ $ref: '#/definitions/createVariantRequest'
244
+ responses:
245
+ '200':
246
+ description: variant just created
247
+ schema:
248
+ $ref: '#/definitions/variant'
249
+ default:
250
+ description: generic error response
251
+ schema:
252
+ $ref: '#/definitions/error'
253
+ '/flags/{flagID}/variants/{variantID}':
254
+ put:
255
+ tags:
256
+ - variant
257
+ operationId: putVariant
258
+ parameters:
259
+ - in: path
260
+ name: flagID
261
+ description: numeric ID of the flag
262
+ required: true
263
+ type: integer
264
+ format: int64
265
+ minimum: 1
266
+ - in: path
267
+ name: variantID
268
+ description: numeric ID of the variant
269
+ required: true
270
+ type: integer
271
+ format: int64
272
+ minimum: 1
273
+ - in: body
274
+ name: body
275
+ description: update a variant
276
+ required: true
277
+ schema:
278
+ $ref: '#/definitions/putVariantRequest'
279
+ responses:
280
+ '200':
281
+ description: variant just updated
282
+ schema:
283
+ $ref: '#/definitions/variant'
284
+ default:
285
+ description: generic error response
286
+ schema:
287
+ $ref: '#/definitions/error'
288
+ delete:
289
+ tags:
290
+ - variant
291
+ operationId: deleteVariant
292
+ parameters:
293
+ - in: path
294
+ name: flagID
295
+ description: numeric ID of the flag
296
+ required: true
297
+ type: integer
298
+ format: int64
299
+ minimum: 1
300
+ - in: path
301
+ name: variantID
302
+ description: numeric ID of the variant
303
+ required: true
304
+ type: integer
305
+ format: int64
306
+ minimum: 1
307
+ responses:
308
+ '200':
309
+ description: deleted
310
+ default:
311
+ description: generic error response
312
+ schema:
313
+ $ref: '#/definitions/error'
314
+ '/flags/{flagID}/segments':
315
+ get:
316
+ tags:
317
+ - segment
318
+ operationId: findSegments
319
+ parameters:
320
+ - in: path
321
+ name: flagID
322
+ description: numeric ID of the flag to get
323
+ required: true
324
+ type: integer
325
+ format: int64
326
+ minimum: 1
327
+ responses:
328
+ '200':
329
+ description: segments ordered by rank of the flag
330
+ schema:
331
+ type: array
332
+ items:
333
+ $ref: '#/definitions/segment'
334
+ default:
335
+ description: generic error response
336
+ schema:
337
+ $ref: '#/definitions/error'
338
+ post:
339
+ tags:
340
+ - segment
341
+ operationId: createSegment
342
+ parameters:
343
+ - in: path
344
+ name: flagID
345
+ description: numeric ID of the flag to get
346
+ required: true
347
+ type: integer
348
+ format: int64
349
+ minimum: 1
350
+ - in: body
351
+ name: body
352
+ description: create a segment under a flag
353
+ required: true
354
+ schema:
355
+ $ref: '#/definitions/createSegmentRequest'
356
+ responses:
357
+ '200':
358
+ description: segment created
359
+ schema:
360
+ $ref: '#/definitions/segment'
361
+ default:
362
+ description: generic error response
363
+ schema:
364
+ $ref: '#/definitions/error'
365
+ '/flags/{flagID}/segments/reorder':
366
+ put:
367
+ tags:
368
+ - segment
369
+ operationId: putSegmentsReorder
370
+ parameters:
371
+ - in: path
372
+ name: flagID
373
+ description: numeric ID of the flag
374
+ required: true
375
+ type: integer
376
+ format: int64
377
+ minimum: 1
378
+ - in: body
379
+ name: body
380
+ description: reorder segments
381
+ required: true
382
+ schema:
383
+ $ref: '#/definitions/putSegmentReorderRequest'
384
+ responses:
385
+ '200':
386
+ description: segments reordered
387
+ default:
388
+ description: generic error response
389
+ schema:
390
+ $ref: '#/definitions/error'
391
+ '/flags/{flagID}/segments/{segmentID}':
392
+ put:
393
+ tags:
394
+ - segment
395
+ operationId: putSegment
396
+ parameters:
397
+ - in: path
398
+ name: flagID
399
+ description: numeric ID of the flag
400
+ required: true
401
+ type: integer
402
+ format: int64
403
+ minimum: 1
404
+ - in: path
405
+ name: segmentID
406
+ description: numeric ID of the segment
407
+ required: true
408
+ type: integer
409
+ format: int64
410
+ minimum: 1
411
+ - in: body
412
+ name: body
413
+ description: update a segment
414
+ required: true
415
+ schema:
416
+ $ref: '#/definitions/putSegmentRequest'
417
+ responses:
418
+ '200':
419
+ description: segment updated
420
+ schema:
421
+ $ref: '#/definitions/segment'
422
+ default:
423
+ description: generic error response
424
+ schema:
425
+ $ref: '#/definitions/error'
426
+ delete:
427
+ tags:
428
+ - segment
429
+ operationId: deleteSegment
430
+ parameters:
431
+ - in: path
432
+ name: flagID
433
+ description: numeric ID of the flag
434
+ required: true
435
+ type: integer
436
+ format: int64
437
+ minimum: 1
438
+ - in: path
439
+ name: segmentID
440
+ description: numeric ID of the segment
441
+ required: true
442
+ type: integer
443
+ format: int64
444
+ minimum: 1
445
+ responses:
446
+ '200':
447
+ description: deleted
448
+ default:
449
+ description: generic error response
450
+ schema:
451
+ $ref: '#/definitions/error'
452
+ '/flags/{flagID}/segments/{segmentID}/constraints':
453
+ get:
454
+ tags:
455
+ - constraint
456
+ operationId: findConstraints
457
+ parameters:
458
+ - in: path
459
+ name: flagID
460
+ description: numeric ID of the flag
461
+ required: true
462
+ type: integer
463
+ format: int64
464
+ minimum: 1
465
+ - in: path
466
+ name: segmentID
467
+ description: numeric ID of the segment
468
+ required: true
469
+ type: integer
470
+ format: int64
471
+ minimum: 1
472
+ responses:
473
+ '200':
474
+ description: constraints under the segment
475
+ schema:
476
+ type: array
477
+ items:
478
+ $ref: '#/definitions/constraint'
479
+ default:
480
+ description: generic error response
481
+ schema:
482
+ $ref: '#/definitions/error'
483
+ post:
484
+ tags:
485
+ - constraint
486
+ operationId: createConstraint
487
+ parameters:
488
+ - in: path
489
+ name: flagID
490
+ description: numeric ID of the flag
491
+ required: true
492
+ type: integer
493
+ format: int64
494
+ minimum: 1
495
+ - in: path
496
+ name: segmentID
497
+ description: numeric ID of the segment
498
+ required: true
499
+ type: integer
500
+ format: int64
501
+ minimum: 1
502
+ - in: body
503
+ name: body
504
+ description: create a constraint
505
+ required: true
506
+ schema:
507
+ $ref: '#/definitions/createConstraintRequest'
508
+ responses:
509
+ '200':
510
+ description: the constraint created
511
+ schema:
512
+ $ref: '#/definitions/constraint'
513
+ default:
514
+ description: generic error response
515
+ schema:
516
+ $ref: '#/definitions/error'
517
+ '/flags/{flagID}/segments/{segmentID}/constraints/{constraintID}':
518
+ put:
519
+ tags:
520
+ - constraint
521
+ operationId: putConstraint
522
+ parameters:
523
+ - in: path
524
+ name: flagID
525
+ description: numeric ID of the flag
526
+ required: true
527
+ type: integer
528
+ format: int64
529
+ minimum: 1
530
+ - in: path
531
+ name: segmentID
532
+ description: numeric ID of the segment
533
+ required: true
534
+ type: integer
535
+ format: int64
536
+ minimum: 1
537
+ - in: path
538
+ name: constraintID
539
+ description: numeric ID of the constraint
540
+ required: true
541
+ type: integer
542
+ format: int64
543
+ minimum: 1
544
+ - in: body
545
+ name: body
546
+ description: create a constraint
547
+ required: true
548
+ schema:
549
+ $ref: '#/definitions/createConstraintRequest'
550
+ responses:
551
+ '200':
552
+ description: constraint just updated
553
+ schema:
554
+ $ref: '#/definitions/constraint'
555
+ default:
556
+ description: generic error response
557
+ schema:
558
+ $ref: '#/definitions/error'
559
+ delete:
560
+ tags:
561
+ - constraint
562
+ operationId: deleteConstraint
563
+ parameters:
564
+ - in: path
565
+ name: flagID
566
+ description: numeric ID of the flag
567
+ required: true
568
+ type: integer
569
+ format: int64
570
+ minimum: 1
571
+ - in: path
572
+ name: segmentID
573
+ description: numeric ID of the segment
574
+ required: true
575
+ type: integer
576
+ format: int64
577
+ minimum: 1
578
+ - in: path
579
+ name: constraintID
580
+ description: numeric ID of the constraint
581
+ required: true
582
+ type: integer
583
+ format: int64
584
+ minimum: 1
585
+ responses:
586
+ '200':
587
+ description: deleted
588
+ default:
589
+ description: generic error response
590
+ schema:
591
+ $ref: '#/definitions/error'
592
+ '/flags/{flagID}/segments/{segmentID}/distributions':
593
+ get:
594
+ tags:
595
+ - distribution
596
+ operationId: findDistributions
597
+ parameters:
598
+ - in: path
599
+ name: flagID
600
+ description: numeric ID of the flag
601
+ required: true
602
+ type: integer
603
+ format: int64
604
+ minimum: 1
605
+ - in: path
606
+ name: segmentID
607
+ description: numeric ID of the segment
608
+ required: true
609
+ type: integer
610
+ format: int64
611
+ minimum: 1
612
+ responses:
613
+ '200':
614
+ description: distribution under the segment
615
+ schema:
616
+ type: array
617
+ items:
618
+ $ref: '#/definitions/distribution'
619
+ default:
620
+ description: generic error response
621
+ schema:
622
+ $ref: '#/definitions/error'
623
+ put:
624
+ tags:
625
+ - distribution
626
+ operationId: putDistributions
627
+ description: replace the distribution with the new setting
628
+ parameters:
629
+ - in: path
630
+ name: flagID
631
+ description: numeric ID of the flag
632
+ required: true
633
+ type: integer
634
+ format: int64
635
+ minimum: 1
636
+ - in: path
637
+ name: segmentID
638
+ description: numeric ID of the segment
639
+ required: true
640
+ type: integer
641
+ format: int64
642
+ minimum: 1
643
+ - in: body
644
+ name: body
645
+ description: array of distributions
646
+ required: true
647
+ schema:
648
+ $ref: '#/definitions/putDistributionsRequest'
649
+ responses:
650
+ '200':
651
+ description: distribution under the segment
652
+ schema:
653
+ type: array
654
+ items:
655
+ $ref: '#/definitions/distribution'
656
+ default:
657
+ description: generic error response
658
+ schema:
659
+ $ref: '#/definitions/error'
660
+ '/flags/{flagID}/snapshots':
661
+ get:
662
+ tags:
663
+ - flag
664
+ operationId: getFlagSnapshots
665
+ parameters:
666
+ - in: path
667
+ name: flagID
668
+ description: numeric ID of the flag to get
669
+ required: true
670
+ type: integer
671
+ format: int64
672
+ minimum: 1
673
+ responses:
674
+ '200':
675
+ description: returns the flag snapshots
676
+ schema:
677
+ type: array
678
+ items:
679
+ $ref: '#/definitions/flagSnapshot'
680
+ default:
681
+ description: generic error response
682
+ schema:
683
+ $ref: '#/definitions/error'
684
+ /evaluation:
685
+ post:
686
+ tags:
687
+ - evaluation
688
+ operationId: postEvaluation
689
+ parameters:
690
+ - in: body
691
+ name: body
692
+ description: evalution context
693
+ required: true
694
+ schema:
695
+ $ref: '#/definitions/evalContext'
696
+ responses:
697
+ '200':
698
+ description: evaluation result
699
+ schema:
700
+ $ref: '#/definitions/evalResult'
701
+ default:
702
+ description: generic error response
703
+ schema:
704
+ $ref: '#/definitions/error'
705
+ /evaluation/batch:
706
+ post:
707
+ tags:
708
+ - evaluation
709
+ operationId: postEvaluationBatch
710
+ parameters:
711
+ - in: body
712
+ name: body
713
+ description: evalution batch request
714
+ required: true
715
+ schema:
716
+ $ref: '#/definitions/evaluationBatchRequest'
717
+ responses:
718
+ '200':
719
+ description: evaluation batch result
720
+ schema:
721
+ $ref: '#/definitions/evaluationBatchResponse'
722
+ default:
723
+ description: generic error response
724
+ schema:
725
+ $ref: '#/definitions/error'
726
+ /health:
727
+ get:
728
+ tags:
729
+ - health
730
+ responses:
731
+ '200':
732
+ description: Flagr is healthy
733
+ default:
734
+ description: generic error response
735
+ schema:
736
+ $ref: '#/definitions/error'
737
+ definitions:
738
+ flag:
739
+ type: object
740
+ required:
741
+ - description
742
+ - enabled
743
+ - dataRecordsEnabled
744
+ properties:
745
+ id:
746
+ type: integer
747
+ format: int64
748
+ minimum: 1
749
+ readOnly: true
750
+ description:
751
+ type: string
752
+ minLength: 1
753
+ enabled:
754
+ type: boolean
755
+ segments:
756
+ type: array
757
+ items:
758
+ $ref: '#/definitions/segment'
759
+ variants:
760
+ type: array
761
+ items:
762
+ $ref: '#/definitions/variant'
763
+ dataRecordsEnabled:
764
+ description: >-
765
+ enabled data records will get data logging in the metrics pipeline,
766
+ for example, kafka.
767
+ type: boolean
768
+ createFlagRequest:
769
+ type: object
770
+ required:
771
+ - description
772
+ properties:
773
+ description:
774
+ type: string
775
+ minLength: 1
776
+ putFlagRequest:
777
+ type: object
778
+ required:
779
+ - description
780
+ properties:
781
+ description:
782
+ type: string
783
+ minLength: 1
784
+ dataRecordsEnabled:
785
+ type: boolean
786
+ description: >-
787
+ enabled data records will get data logging in the metrics pipeline,
788
+ for example, kafka.
789
+ x-nullable: true
790
+ setFlagEnabledRequest:
791
+ type: object
792
+ required:
793
+ - enabled
794
+ properties:
795
+ enabled:
796
+ type: boolean
797
+ flagSnapshot:
798
+ type: object
799
+ required:
800
+ - id
801
+ - flag
802
+ - updatedAt
803
+ properties:
804
+ id:
805
+ type: integer
806
+ format: int64
807
+ minimum: 1
808
+ updatedBy:
809
+ type: string
810
+ flag:
811
+ $ref: '#/definitions/flag'
812
+ updatedAt:
813
+ type: string
814
+ minLength: 1
815
+ segment:
816
+ type: object
817
+ required:
818
+ - description
819
+ - rank
820
+ - rolloutPercent
821
+ properties:
822
+ id:
823
+ type: integer
824
+ format: int64
825
+ minimum: 1
826
+ readOnly: true
827
+ description:
828
+ type: string
829
+ minLength: 1
830
+ constraints:
831
+ type: array
832
+ items:
833
+ $ref: '#/definitions/constraint'
834
+ distributions:
835
+ type: array
836
+ items:
837
+ $ref: '#/definitions/distribution'
838
+ rank:
839
+ type: integer
840
+ format: int64
841
+ minimum: 0
842
+ rolloutPercent:
843
+ type: integer
844
+ format: int64
845
+ minimum: 0
846
+ maximum: 100
847
+ createSegmentRequest:
848
+ type: object
849
+ required:
850
+ - description
851
+ - rolloutPercent
852
+ properties:
853
+ description:
854
+ type: string
855
+ minLength: 1
856
+ rolloutPercent:
857
+ type: integer
858
+ format: int64
859
+ minimum: 0
860
+ maximum: 100
861
+ putSegmentRequest:
862
+ type: object
863
+ required:
864
+ - description
865
+ - rolloutPercent
866
+ properties:
867
+ description:
868
+ type: string
869
+ minLength: 1
870
+ rolloutPercent:
871
+ type: integer
872
+ format: int64
873
+ minimum: 0
874
+ maximum: 100
875
+ putSegmentReorderRequest:
876
+ type: object
877
+ required:
878
+ - segmentIDs
879
+ properties:
880
+ segmentIDs:
881
+ type: array
882
+ minItems: 1
883
+ items:
884
+ type: integer
885
+ format: int64
886
+ minimum: 1
887
+ variant:
888
+ type: object
889
+ required:
890
+ - key
891
+ properties:
892
+ id:
893
+ type: integer
894
+ format: int64
895
+ minimum: 1
896
+ readOnly: true
897
+ key:
898
+ type: string
899
+ minLength: 1
900
+ attachment:
901
+ type: object
902
+ createVariantRequest:
903
+ type: object
904
+ required:
905
+ - key
906
+ properties:
907
+ key:
908
+ type: string
909
+ minLength: 1
910
+ attachment:
911
+ type: object
912
+ putVariantRequest:
913
+ type: object
914
+ required:
915
+ - key
916
+ - attachment
917
+ properties:
918
+ key:
919
+ type: string
920
+ minLength: 1
921
+ attachment:
922
+ type: object
923
+ constraint:
924
+ type: object
925
+ required:
926
+ - property
927
+ - operator
928
+ - value
929
+ properties:
930
+ id:
931
+ type: integer
932
+ format: int64
933
+ minimum: 1
934
+ readOnly: true
935
+ property:
936
+ type: string
937
+ minLength: 1
938
+ operator:
939
+ type: string
940
+ minLength: 1
941
+ enum:
942
+ - EQ
943
+ - NEQ
944
+ - LT
945
+ - LTE
946
+ - GT
947
+ - GTE
948
+ - EREG
949
+ - NEREG
950
+ - IN
951
+ - NOTIN
952
+ - CONTAINS
953
+ - NOTCONTAINS
954
+ value:
955
+ type: string
956
+ minLength: 1
957
+ createConstraintRequest:
958
+ type: object
959
+ required:
960
+ - property
961
+ - operator
962
+ - value
963
+ properties:
964
+ property:
965
+ type: string
966
+ minLength: 1
967
+ operator:
968
+ type: string
969
+ minLength: 1
970
+ value:
971
+ type: string
972
+ minLength: 1
973
+ distribution:
974
+ type: object
975
+ required:
976
+ - percent
977
+ - variantID
978
+ - variantKey
979
+ properties:
980
+ id:
981
+ type: integer
982
+ format: int64
983
+ minimum: 1
984
+ readOnly: true
985
+ percent:
986
+ type: integer
987
+ format: int64
988
+ minimum: 0
989
+ maximum: 100
990
+ bitmap:
991
+ type: string
992
+ minLength: 1
993
+ variantKey:
994
+ type: string
995
+ minLength: 1
996
+ variantID:
997
+ type: integer
998
+ format: int64
999
+ minimum: 1
1000
+ putDistributionsRequest:
1001
+ type: object
1002
+ required:
1003
+ - distributions
1004
+ properties:
1005
+ distributions:
1006
+ type: array
1007
+ items:
1008
+ $ref: '#/definitions/distribution'
1009
+ evalContext:
1010
+ type: object
1011
+ required:
1012
+ - entityType
1013
+ - flagID
1014
+ properties:
1015
+ entityID:
1016
+ type: string
1017
+ description: >-
1018
+ entityID is used to deterministically at random to evaluate the flag
1019
+ result. If it's empty, flagr will randomly generate one.
1020
+ entityType:
1021
+ type: string
1022
+ minLength: 1
1023
+ entityContext:
1024
+ type: object
1025
+ enableDebug:
1026
+ type: boolean
1027
+ flagID:
1028
+ type: integer
1029
+ format: int64
1030
+ minimum: 1
1031
+ evalResult:
1032
+ type: object
1033
+ required:
1034
+ - flagID
1035
+ - segmentID
1036
+ - variantID
1037
+ - variantKey
1038
+ - variantAttachment
1039
+ - evalContext
1040
+ - timestamp
1041
+ properties:
1042
+ flagID:
1043
+ type: integer
1044
+ format: int64
1045
+ minimum: 1
1046
+ flagSnapshotID:
1047
+ type: integer
1048
+ format: int64
1049
+ segmentID:
1050
+ type: integer
1051
+ format: int64
1052
+ minimum: 1
1053
+ variantID:
1054
+ type: integer
1055
+ format: int64
1056
+ minimum: 1
1057
+ variantKey:
1058
+ type: string
1059
+ minLength: 1
1060
+ variantAttachment:
1061
+ type: object
1062
+ evalContext:
1063
+ $ref: '#/definitions/evalContext'
1064
+ timestamp:
1065
+ type: string
1066
+ minLength: 1
1067
+ evalDebugLog:
1068
+ $ref: '#/definitions/evalDebugLog'
1069
+ evalDebugLog:
1070
+ type: object
1071
+ properties:
1072
+ segmentDebugLogs:
1073
+ type: array
1074
+ items:
1075
+ $ref: '#/definitions/segmentDebugLog'
1076
+ msg:
1077
+ type: string
1078
+ segmentDebugLog:
1079
+ type: object
1080
+ properties:
1081
+ segmentID:
1082
+ type: integer
1083
+ format: int64
1084
+ minimum: 1
1085
+ msg:
1086
+ type: string
1087
+ evaluationEntity:
1088
+ type: object
1089
+ required:
1090
+ - entityType
1091
+ properties:
1092
+ entityID:
1093
+ type: string
1094
+ entityType:
1095
+ type: string
1096
+ minLength: 1
1097
+ entityContext:
1098
+ type: object
1099
+ evaluationBatchRequest:
1100
+ type: object
1101
+ required:
1102
+ - entities
1103
+ - flagIDs
1104
+ properties:
1105
+ entities:
1106
+ type: array
1107
+ items:
1108
+ $ref: '#/definitions/evaluationEntity'
1109
+ minItems: 1
1110
+ enableDebug:
1111
+ type: boolean
1112
+ flagIDs:
1113
+ type: array
1114
+ items:
1115
+ type: integer
1116
+ format: int64
1117
+ minimum: 1
1118
+ minItems: 1
1119
+ evaluationBatchResponse:
1120
+ type: object
1121
+ required:
1122
+ - evaluationResults
1123
+ properties:
1124
+ evaluationResults:
1125
+ type: array
1126
+ items:
1127
+ $ref: '#/definitions/evalResult'
1128
+ error:
1129
+ type: object
1130
+ required:
1131
+ - message
1132
+ properties:
1133
+ message:
1134
+ type: string
1135
+ minLength: 1