rbflagr 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -7
  3. data/docs/CreateFlagRequest.md +1 -0
  4. data/docs/Distribution.md +0 -1
  5. data/docs/EvalContext.md +3 -2
  6. data/docs/EvalResult.md +1 -0
  7. data/docs/EvaluationBatchRequest.md +2 -1
  8. data/docs/EvaluationEntity.md +1 -1
  9. data/docs/ExportApi.md +49 -0
  10. data/docs/Flag.md +5 -0
  11. data/docs/FlagApi.md +41 -0
  12. data/docs/HealthApi.md +7 -5
  13. data/docs/PutFlagRequest.md +4 -1
  14. data/docs/PutVariantRequest.md +1 -1
  15. data/lib/rbflagr.rb +3 -2
  16. data/lib/rbflagr/api/constraint_api.rb +2 -2
  17. data/lib/rbflagr/api/distribution_api.rb +2 -2
  18. data/lib/rbflagr/api/evaluation_api.rb +2 -2
  19. data/lib/rbflagr/api/export_api.rb +69 -0
  20. data/lib/rbflagr/api/flag_api.rb +49 -2
  21. data/lib/rbflagr/api/health_api.rb +9 -7
  22. data/lib/rbflagr/api/segment_api.rb +2 -2
  23. data/lib/rbflagr/api/variant_api.rb +2 -2
  24. data/lib/rbflagr/api_client.rb +2 -2
  25. data/lib/rbflagr/api_error.rb +2 -2
  26. data/lib/rbflagr/configuration.rb +2 -2
  27. data/lib/rbflagr/models/constraint.rb +2 -2
  28. data/lib/rbflagr/models/create_constraint_request.rb +2 -2
  29. data/lib/rbflagr/models/create_flag_request.rb +16 -6
  30. data/lib/rbflagr/models/create_segment_request.rb +2 -2
  31. data/lib/rbflagr/models/create_variant_request.rb +2 -2
  32. data/lib/rbflagr/models/distribution.rb +3 -27
  33. data/lib/rbflagr/models/error.rb +2 -2
  34. data/lib/rbflagr/models/eval_context.rb +20 -42
  35. data/lib/rbflagr/models/eval_debug_log.rb +2 -2
  36. data/lib/rbflagr/models/eval_result.rb +17 -3
  37. data/lib/rbflagr/models/evaluation_batch_request.rb +19 -11
  38. data/lib/rbflagr/models/evaluation_batch_response.rb +2 -2
  39. data/lib/rbflagr/models/evaluation_entity.rb +2 -26
  40. data/lib/rbflagr/models/flag.rb +68 -6
  41. data/lib/rbflagr/models/flag_snapshot.rb +2 -2
  42. data/lib/rbflagr/models/put_distributions_request.rb +2 -2
  43. data/lib/rbflagr/models/put_flag_request.rb +37 -18
  44. data/lib/rbflagr/models/put_segment_reorder_request.rb +2 -2
  45. data/lib/rbflagr/models/put_segment_request.rb +2 -2
  46. data/lib/rbflagr/models/put_variant_request.rb +2 -7
  47. data/lib/rbflagr/models/segment.rb +2 -2
  48. data/lib/rbflagr/models/segment_debug_log.rb +2 -2
  49. data/lib/rbflagr/models/set_flag_enabled_request.rb +2 -2
  50. data/lib/rbflagr/models/variant.rb +2 -2
  51. data/lib/rbflagr/version.rb +3 -3
  52. data/rbflagr.gemspec +3 -3
  53. data/spec/api/export_api_spec.rb +45 -0
  54. data/swagger.yaml +115 -35
  55. data/swagger_ruby.json +1 -1
  56. metadata +8 -3
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -63,10 +63,6 @@ module Flagr
63
63
  invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
64
64
  end
65
65
 
66
- if @attachment.nil?
67
- invalid_properties.push('invalid value for "attachment", attachment cannot be nil.')
68
- end
69
-
70
66
  invalid_properties
71
67
  end
72
68
 
@@ -75,7 +71,6 @@ module Flagr
75
71
  def valid?
76
72
  return false if @key.nil?
77
73
  return false if @key.to_s.length < 1
78
- return false if @attachment.nil?
79
74
  true
80
75
  end
81
76
 
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #Flagr
3
3
 
4
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
5
 
6
- OpenAPI spec version: 1.0.8
6
+ OpenAPI spec version: 1.0.13
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module Flagr
14
- VERSION = '0.1.2'
14
+ VERSION = '0.2.0'
15
15
  end
@@ -3,9 +3,9 @@
3
3
  =begin
4
4
  #Flagr
5
5
 
6
- #Flagr is a feature flagging, A/B testing and dynamic configuration microservice
6
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
7
7
 
8
- OpenAPI spec version: 1.0.8
8
+ OpenAPI spec version: 1.0.13
9
9
 
10
10
  Generated by: https://github.com/swagger-api/swagger-codegen.git
11
11
  Swagger Codegen version: 2.4.0-SNAPSHOT
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.email = [""]
24
24
  s.homepage = "https://github.com/swagger-api/swagger-codegen"
25
25
  s.summary = "Flagr Ruby Gem"
26
- s.description = "Flagr is a feature flagging, A/B testing and dynamic configuration microservice"
26
+ s.description = "Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\". "
27
27
  s.license = 'Apache 2.0'
28
28
  s.required_ruby_version = ">= 1.9"
29
29
 
@@ -0,0 +1,45 @@
1
+ =begin
2
+ #Flagr
3
+
4
+ #Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is \"/api/v1\".
5
+
6
+ OpenAPI spec version: 1.0.13
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for Flagr::ExportApi
17
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
18
+ # Please update as you see appropriate
19
+ describe 'ExportApi' do
20
+ before do
21
+ # run before each test
22
+ @instance = Flagr::ExportApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of ExportApi' do
30
+ it 'should create an instance of ExportApi' do
31
+ expect(@instance).to be_instance_of(Flagr::ExportApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for get_export_sq_lite
36
+ # Export sqlite3 format of the db dump, which is converted from the main database.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [File]
39
+ describe 'get_export_sq_lite test' do
40
+ it 'should work' do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ end
@@ -1,10 +1,10 @@
1
1
  swagger: '2.0'
2
2
  info:
3
- description: >-
3
+ description: >
4
4
  Flagr is a feature flagging, A/B testing and dynamic configuration
5
- microservice
5
+ microservice. The base path for all the APIs is "/api/v1".
6
6
  title: Flagr
7
- version: 1.0.8
7
+ version: 1.0.13
8
8
  tags:
9
9
  - name: flag
10
10
  description: Everything about the flag
@@ -34,6 +34,9 @@ x-tagGroups:
34
34
  - name: Health Check
35
35
  tags:
36
36
  - health
37
+ - name: Export
38
+ tags:
39
+ - export
37
40
  consumes:
38
41
  - application/json
39
42
  produces:
@@ -65,6 +68,10 @@ paths:
65
68
  name: description_like
66
69
  type: string
67
70
  description: return flags partially matching given description
71
+ - in: query
72
+ name: key
73
+ type: string
74
+ description: return flags matching given key
68
75
  - in: query
69
76
  name: offset
70
77
  type: integer
@@ -125,48 +132,48 @@ paths:
125
132
  description: generic error response
126
133
  schema:
127
134
  $ref: '#/definitions/error'
128
- put:
135
+ delete:
129
136
  tags:
130
137
  - flag
131
- operationId: putFlag
138
+ operationId: deleteFlag
132
139
  parameters:
133
140
  - in: path
134
141
  name: flagID
135
- description: numeric ID of the flag to get
142
+ description: numeric ID of the flag
136
143
  required: true
137
144
  type: integer
138
145
  format: int64
139
146
  minimum: 1
140
- - in: body
141
- name: body
142
- description: update a flag
143
- required: true
144
- schema:
145
- $ref: '#/definitions/putFlagRequest'
146
147
  responses:
147
148
  '200':
148
- description: returns the flag
149
- schema:
150
- $ref: '#/definitions/flag'
149
+ description: OK deleted
151
150
  default:
152
151
  description: generic error response
153
152
  schema:
154
153
  $ref: '#/definitions/error'
155
- delete:
154
+ put:
156
155
  tags:
157
156
  - flag
158
- operationId: deleteFlag
157
+ operationId: putFlag
159
158
  parameters:
160
159
  - in: path
161
160
  name: flagID
162
- description: numeric ID of the flag
161
+ description: numeric ID of the flag to get
163
162
  required: true
164
163
  type: integer
165
164
  format: int64
166
165
  minimum: 1
166
+ - in: body
167
+ name: body
168
+ description: update a flag
169
+ required: true
170
+ schema:
171
+ $ref: '#/definitions/putFlagRequest'
167
172
  responses:
168
173
  '200':
169
- description: OK deleted
174
+ description: returns the flag
175
+ schema:
176
+ $ref: '#/definitions/flag'
170
177
  default:
171
178
  description: generic error response
172
179
  schema:
@@ -681,6 +688,23 @@ paths:
681
688
  description: generic error response
682
689
  schema:
683
690
  $ref: '#/definitions/error'
691
+ /flags/entity_types:
692
+ get:
693
+ tags:
694
+ - flag
695
+ operationId: getFlagEntityTypes
696
+ responses:
697
+ '200':
698
+ description: returns all the FlagEntityTypes
699
+ schema:
700
+ type: array
701
+ items:
702
+ type: string
703
+ minLength: 1
704
+ default:
705
+ description: generic error response
706
+ schema:
707
+ $ref: '#/definitions/error'
684
708
  /evaluation:
685
709
  post:
686
710
  tags:
@@ -727,9 +751,30 @@ paths:
727
751
  get:
728
752
  tags:
729
753
  - health
754
+ operationId: getHealth
755
+ description: Check if Flagr is healthy
730
756
  responses:
731
757
  '200':
732
- description: Flagr is healthy
758
+ description: OK
759
+ default:
760
+ description: generic error response
761
+ schema:
762
+ $ref: '#/definitions/error'
763
+ /export/sqlite:
764
+ get:
765
+ tags:
766
+ - export
767
+ operationId: getExportSQLite
768
+ description: >-
769
+ Export sqlite3 format of the db dump, which is converted from the main
770
+ database.
771
+ produces:
772
+ - application/octet-stream
773
+ responses:
774
+ '200':
775
+ description: OK
776
+ schema:
777
+ type: file
733
778
  default:
734
779
  description: generic error response
735
780
  schema:
@@ -747,6 +792,10 @@ definitions:
747
792
  format: int64
748
793
  minimum: 1
749
794
  readOnly: true
795
+ key:
796
+ description: unique key representation of the flag
797
+ type: string
798
+ minLength: 1
750
799
  description:
751
800
  type: string
752
801
  minLength: 1
@@ -765,6 +814,18 @@ definitions:
765
814
  enabled data records will get data logging in the metrics pipeline,
766
815
  for example, kafka.
767
816
  type: boolean
817
+ entityType:
818
+ description: >-
819
+ it will override the entityType in the evaluation logs if it's not
820
+ empty
821
+ type: string
822
+ createdBy:
823
+ type: string
824
+ updatedBy:
825
+ type: string
826
+ updatedAt:
827
+ type: string
828
+ format: date-time
768
829
  createFlagRequest:
769
830
  type: object
770
831
  required:
@@ -773,20 +834,32 @@ definitions:
773
834
  description:
774
835
  type: string
775
836
  minLength: 1
837
+ key:
838
+ description: unique key representation of the flag
839
+ type: string
776
840
  putFlagRequest:
777
841
  type: object
778
- required:
779
- - description
780
842
  properties:
781
843
  description:
782
844
  type: string
783
845
  minLength: 1
846
+ x-nullable: true
784
847
  dataRecordsEnabled:
785
848
  type: boolean
786
849
  description: >-
787
850
  enabled data records will get data logging in the metrics pipeline,
788
851
  for example, kafka.
789
852
  x-nullable: true
853
+ entityType:
854
+ description: it will overwrite entityType into evaluation logs if it's not empty
855
+ type: string
856
+ x-nullable: true
857
+ enabled:
858
+ type: boolean
859
+ x-nullable: true
860
+ key:
861
+ type: string
862
+ x-nullable: true
790
863
  setFlagEnabledRequest:
791
864
  type: object
792
865
  required:
@@ -913,7 +986,6 @@ definitions:
913
986
  type: object
914
987
  required:
915
988
  - key
916
- - attachment
917
989
  properties:
918
990
  key:
919
991
  type: string
@@ -987,9 +1059,6 @@ definitions:
987
1059
  format: int64
988
1060
  minimum: 0
989
1061
  maximum: 100
990
- bitmap:
991
- type: string
992
- minLength: 1
993
1062
  variantKey:
994
1063
  type: string
995
1064
  minLength: 1
@@ -1008,9 +1077,6 @@ definitions:
1008
1077
  $ref: '#/definitions/distribution'
1009
1078
  evalContext:
1010
1079
  type: object
1011
- required:
1012
- - entityType
1013
- - flagID
1014
1080
  properties:
1015
1081
  entityID:
1016
1082
  type: string
@@ -1019,19 +1085,25 @@ definitions:
1019
1085
  result. If it's empty, flagr will randomly generate one.
1020
1086
  entityType:
1021
1087
  type: string
1022
- minLength: 1
1023
1088
  entityContext:
1024
1089
  type: object
1025
1090
  enableDebug:
1026
1091
  type: boolean
1027
1092
  flagID:
1093
+ description: flagID
1028
1094
  type: integer
1029
1095
  format: int64
1030
1096
  minimum: 1
1097
+ flagKey:
1098
+ description: >-
1099
+ flagKey. flagID or flagKey will resolve to the same flag. Either
1100
+ works.
1101
+ type: string
1031
1102
  evalResult:
1032
1103
  type: object
1033
1104
  required:
1034
1105
  - flagID
1106
+ - flagKey
1035
1107
  - segmentID
1036
1108
  - variantID
1037
1109
  - variantKey
@@ -1043,6 +1115,8 @@ definitions:
1043
1115
  type: integer
1044
1116
  format: int64
1045
1117
  minimum: 1
1118
+ flagKey:
1119
+ type: string
1046
1120
  flagSnapshotID:
1047
1121
  type: integer
1048
1122
  format: int64
@@ -1086,21 +1160,17 @@ definitions:
1086
1160
  type: string
1087
1161
  evaluationEntity:
1088
1162
  type: object
1089
- required:
1090
- - entityType
1091
1163
  properties:
1092
1164
  entityID:
1093
1165
  type: string
1094
1166
  entityType:
1095
1167
  type: string
1096
- minLength: 1
1097
1168
  entityContext:
1098
1169
  type: object
1099
1170
  evaluationBatchRequest:
1100
1171
  type: object
1101
1172
  required:
1102
1173
  - entities
1103
- - flagIDs
1104
1174
  properties:
1105
1175
  entities:
1106
1176
  type: array
@@ -1110,12 +1180,22 @@ definitions:
1110
1180
  enableDebug:
1111
1181
  type: boolean
1112
1182
  flagIDs:
1183
+ description: flagIDs
1113
1184
  type: array
1114
1185
  items:
1115
1186
  type: integer
1116
1187
  format: int64
1117
1188
  minimum: 1
1118
1189
  minItems: 1
1190
+ flagKeys:
1191
+ description: >-
1192
+ flagKeys. Either flagIDs or flagKeys works. If pass in both, Flagr may
1193
+ return duplicate results.
1194
+ type: array
1195
+ items:
1196
+ type: string
1197
+ minLength: 1
1198
+ minItems: 1
1119
1199
  evaluationBatchResponse:
1120
1200
  type: object
1121
1201
  required:
@@ -1132,4 +1212,4 @@ definitions:
1132
1212
  properties:
1133
1213
  message:
1134
1214
  type: string
1135
- minLength: 1
1215
+ minLength: 1