Project

rubyshift

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby client for OpenShift REST API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.10
~> 11.0
~> 3.4
~> 1.24

Runtime

~> 0.13
 Project Readme

RubyShift

RubyShift is a Ruby client for OpenShift's REST API

Installation

Installing from rubygems:

gem install rubyshift

Via Gemfile:

gem 'rubyshift', github: 'gnurag/rubyshift'

Usage

Configuration example:

require 'rubyshift'
RubyShift.configure do |config|
  config.endpoint = 'https://openshift.redhat.com/broker/rest'
  config.access_token = '<secret-access-token>'
  # Optional config options
  config.httparty = { timeout: 90 }
end                                                        

Alternatively, instantiate a Client object and use:

client = RubyShift.client(endpoint: 'https://openshift.redhat.com/broker/rest', access_token: '<secret-access-token>', httparty: { timeout: 90 })

Usage example:

RubyShift.applications
# => []

RubyShift.application_create('myapp', domain_name: 'rubyshift', cartridges: 'ruby-2.0', scale: true, gear_size: 'small')
# => #<OpenStruct aliases=[], app_url="http://myapp-rubyshift.rhcloud.com/", auto_deploy=true, 
  build_job_url=nil, building_app=nil, building_with=nil, creation_time="2016-04-13T21:00:01Z", 
  deployment_branch="master", deployment_type="git", domain_id="rubyshift", embedded={"haproxy-1.4"=>{}}, 
  framework="ruby-2.0", gear_count=1, gear_profile="small", git_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com/~/git/myapp.git/", 
  ha=false, health_check_path="health", id="500000000000000000000001", initial_git_url=nil, 
  keep_deployments=1, name="myapp", scalable=true, ssh_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com">

RubyShift.application('500000000000000000000001')
# => #<OpenStruct aliases=[], app_url="http://myapp-rubyshift.rhcloud.com/", auto_deploy=true, 
  build_job_url=nil, building_app=nil, building_with=nil, creation_time="2016-04-13T21:00:01Z", 
  deployment_branch="master", deployment_type="git", domain_id="rubyshift", embedded={"haproxy-1.4"=>{}}, 
  framework="ruby-2.0", gear_count=1, gear_profile="small", git_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com/~/git/myapp.git/", 
  ha=false, health_check_path="health", id="500000000000000000000001", initial_git_url=nil, 
  keep_deployments=1, name="myapp", scalable=true, ssh_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com">

RubyShift.application_restart('500000000000000000000001')
# => #<OpenStruct aliases=[], app_url="http://myapp-rubyshift.rhcloud.com/", auto_deploy=true, 
  build_job_url=nil, building_app=nil, building_with=nil, creation_time="2016-04-13T21:00:01Z", 
  deployment_branch="master", deployment_type="git", domain_id="rubyshift", embedded={"haproxy-1.4"=>{}}, 
  framework="ruby-2.0", gear_count=1, gear_profile="small", git_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com/~/git/myapp.git/", 
  ha=false, health_check_path="health", id="500000000000000000000001", initial_git_url=nil, 
  keep_deployments=1, name="myapp", scalable=true, ssh_url="ssh://500000000000000000000001@myapp-rubyshift.rhcloud.com">

RubyShift.application_delete('500000000000000000000001')
# => true

Acknowledgement

RubyShift is based on the excellent gitlab gem.