Simple Ruby wrapper library for Keboola GoodData Writer REST API.
Add this line to your application's Gemfile:
gem 'keboola-gooddata-writer'
And then execute:
$ bundle
Or install it yourself as:
$ gem install keboola-gooddata-writer
Obtain your Keboola Storage API token and use to initialize client.
api = Keboola::GoodDataWriter::API.new(token: '123-abcdefghjklmnopqrstuvxyz')
# get details of specific writer
api.writer('MyWriter') # {"bucket"=>"sys.c-wr-gooddata-writer1", "writer"=>"gooddata", "writerId"=>"writer1", …, "status"=>"ready"}
# create GoodData project
api.create_project('MyWriter', optionals: { name: 'KBC - MyProject - MyWriter' }) # <Keboola::GoodDataWriter::Job url="https://syrup.keboola.com/queue/jobs/123456", id="123456">
# create user
api.create_user('MyWriter', '[email protected]', 't0pS3cr3t', 'Jon', 'Snow') # <Keboola::GoodDataWriter::Job url="https://syrup.keboola.com/queue/jobs/123456", id="123456">
# assign user to existing GoodData project
api.add_project_users('MyWriter', 'xjywplmhejceb6j3ezzlxiganmjavqio', '[email protected]', 'editor') #<Keboola::GoodDataWriter::Job url="https://syrup.keboola.com/queue/jobs/123456", id="123456">
# getretreive GoodData SSO link
api.sso('MyWriter', 'xjywplmhejceb6j3ezzlxiganmjavqio', '[email protected]') # "https://secure.gooddata.com/gdc/account/customerlogin?sessionId=-----BEGIN+PGP+MESSAGE-----s0m3_l0000n6_h4sh"
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
Tests are runned against mock API server. If you want to run tests against production API server you must provide valid Keboola Storage API token and set it as environment variable called KEBOOLA_STORAGE_API_TOKEN
.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Get familiar with Github Flow and stick with it on this project. We're using Github Issues as an issue tracker. All related tasks are there.
It's simple!
- Fork it ( https://github.com/romansklenar/keboola-gooddata-writer/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request