Raas::Client::Rails
Adding client to access Raas. This client allows you to call Raas API.
Usage
Set your Credentials
landscape
, application
, token
are mandatory to interact with RaaS.
Basically, these variables can be assigned externally with files or hard-code.
Following is the example of how you set these variables on your code.
These credentials would be provided by SuTech. Please, ask SuTech adminisators for further information.
Raas::Client::Rails::Engine.config.raas_client_rails.landscape = 'LANDSCAPE'
Raas::Client::Rails::Engine.config.raas_client_rails.application = 'APP'
Raas::Client::Rails::Engine.config.raas_client_rails.token = 'TOKEN VALUE'
This condifuration is mandatory please, do not forget before you start interacting with APIs below.
APIs
Once you install gem and set it up, your application has several extra endpoints to interact with RaaS.
/raas/report/session
: Generate external session by using your credentials for report/raas/datatraveler/session
: Generate external session by using your credentials for datatraveler
Installation
The client is provided as RubyGem, and this provided as Rails Engine. you should follow the steps below to make the API work
- Update your gem file
gem "raas-client-rails"
- install gem
$ bundle install
- implement raas_controller.rb
class RaasController < Raas::Client::Rails::RaasController
skip_before_action :verify_authenticity_token
def prepare_tenant_and_sub
super
@tenant = "xxxxx"
@sub = "xxxx"
end
end
- add endPoint on
config/routes.rb
post '/raas/datatraveler/session', to: 'raas#datatraveler_session'
post '/raas/report/session', to: 'raas#report_session'
Launch your rails server
then you can use this with...
/raas/datatraveler/session
/raas/report/session
License
All the patents belong to SuTech