Home

Awesome

rbflagr

Flagr - the Ruby gem for the Flagr

Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is "/api/v1".

This SDK is automatically generated by the Swagger Codegen project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build rbflagr.gemspec

Then either install the gem locally:

gem install ./rbflagr-1.1.10.gem

(for development, run gem install --dev ./rbflagr-1.1.10.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'rbflagr', '~> 1.1.10'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'rbflagr', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'rbflagr'

api_instance = Flagr::ConstraintApi.new

flag_id = 789 # Integer | numeric ID of the flag

segment_id = 789 # Integer | numeric ID of the segment

body = Flagr::CreateConstraintRequest.new # CreateConstraintRequest | create a constraint


begin
  result = api_instance.create_constraint(flag_id, segment_id, body)
  p result
rescue Flagr::ApiError => e
  puts "Exception when calling ConstraintApi->create_constraint: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost/api/v1

ClassMethodHTTP requestDescription
Flagr::ConstraintApicreate_constraintPOST /flags/{flagID}/segments/{segmentID}/constraints
Flagr::ConstraintApidelete_constraintDELETE /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
Flagr::ConstraintApifind_constraintsGET /flags/{flagID}/segments/{segmentID}/constraints
Flagr::ConstraintApiput_constraintPUT /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
Flagr::DistributionApifind_distributionsGET /flags/{flagID}/segments/{segmentID}/distributions
Flagr::DistributionApiput_distributionsPUT /flags/{flagID}/segments/{segmentID}/distributions
Flagr::EvaluationApipost_evaluationPOST /evaluation
Flagr::EvaluationApipost_evaluation_batchPOST /evaluation/batch
Flagr::ExportApiget_export_eval_cache_jsonGET /export/eval_cache/json
Flagr::ExportApiget_export_sqliteGET /export/sqlite
Flagr::FlagApicreate_flagPOST /flags
Flagr::FlagApidelete_flagDELETE /flags/{flagID}
Flagr::FlagApifind_flagsGET /flags
Flagr::FlagApiget_flagGET /flags/{flagID}
Flagr::FlagApiget_flag_entity_typesGET /flags/entity_types
Flagr::FlagApiget_flag_snapshotsGET /flags/{flagID}/snapshots
Flagr::FlagApiput_flagPUT /flags/{flagID}
Flagr::FlagApiset_flag_enabledPUT /flags/{flagID}/enabled
Flagr::HealthApiget_healthGET /health
Flagr::SegmentApicreate_segmentPOST /flags/{flagID}/segments
Flagr::SegmentApidelete_segmentDELETE /flags/{flagID}/segments/{segmentID}
Flagr::SegmentApifind_segmentsGET /flags/{flagID}/segments
Flagr::SegmentApiput_segmentPUT /flags/{flagID}/segments/{segmentID}
Flagr::SegmentApiput_segments_reorderPUT /flags/{flagID}/segments/reorder
Flagr::TagApicreate_tagPOST /flags/{flagID}/tags
Flagr::TagApidelete_tagDELETE /flags/{flagID}/tags/{tagID}
Flagr::TagApifind_all_tagsGET /tags
Flagr::TagApifind_tagsGET /flags/{flagID}/tags
Flagr::VariantApicreate_variantPOST /flags/{flagID}/variants
Flagr::VariantApidelete_variantDELETE /flags/{flagID}/variants/{variantID}
Flagr::VariantApifind_variantsGET /flags/{flagID}/variants
Flagr::VariantApiput_variantPUT /flags/{flagID}/variants/{variantID}

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

Use Makefile

make gen