Skip to content

openflagr/rbflagr

Repository files navigation

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:

  • API version: 1.1.10
  • Package version: 1.1.10
  • Build package: io.swagger.codegen.languages.RubyClientCodegen

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

Class Method HTTP request Description
Flagr::ConstraintApi create_constraint POST /flags/{flagID}/segments/{segmentID}/constraints
Flagr::ConstraintApi delete_constraint DELETE /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
Flagr::ConstraintApi find_constraints GET /flags/{flagID}/segments/{segmentID}/constraints
Flagr::ConstraintApi put_constraint PUT /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
Flagr::DistributionApi find_distributions GET /flags/{flagID}/segments/{segmentID}/distributions
Flagr::DistributionApi put_distributions PUT /flags/{flagID}/segments/{segmentID}/distributions
Flagr::EvaluationApi post_evaluation POST /evaluation
Flagr::EvaluationApi post_evaluation_batch POST /evaluation/batch
Flagr::ExportApi get_export_eval_cache_json GET /export/eval_cache/json
Flagr::ExportApi get_export_sqlite GET /export/sqlite
Flagr::FlagApi create_flag POST /flags
Flagr::FlagApi delete_flag DELETE /flags/{flagID}
Flagr::FlagApi find_flags GET /flags
Flagr::FlagApi get_flag GET /flags/{flagID}
Flagr::FlagApi get_flag_entity_types GET /flags/entity_types
Flagr::FlagApi get_flag_snapshots GET /flags/{flagID}/snapshots
Flagr::FlagApi put_flag PUT /flags/{flagID}
Flagr::FlagApi set_flag_enabled PUT /flags/{flagID}/enabled
Flagr::HealthApi get_health GET /health
Flagr::SegmentApi create_segment POST /flags/{flagID}/segments
Flagr::SegmentApi delete_segment DELETE /flags/{flagID}/segments/{segmentID}
Flagr::SegmentApi find_segments GET /flags/{flagID}/segments
Flagr::SegmentApi put_segment PUT /flags/{flagID}/segments/{segmentID}
Flagr::SegmentApi put_segments_reorder PUT /flags/{flagID}/segments/reorder
Flagr::TagApi create_tag POST /flags/{flagID}/tags
Flagr::TagApi delete_tag DELETE /flags/{flagID}/tags/{tagID}
Flagr::TagApi find_all_tags GET /tags
Flagr::TagApi find_tags GET /flags/{flagID}/tags
Flagr::VariantApi create_variant POST /flags/{flagID}/variants
Flagr::VariantApi delete_variant DELETE /flags/{flagID}/variants/{variantID}
Flagr::VariantApi find_variants GET /flags/{flagID}/variants
Flagr::VariantApi put_variant PUT /flags/{flagID}/variants/{variantID}

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

Use Makefile

make gen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages