Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env ruby
- require 'json'
- credentials = JSON.parse(
- <<~DATA
- Paste your Bluemix Object Storage credentials here. Pls+Thnx.
- DATA
- )
- body = JSON.dump({
- auth: {
- identity: {
- methods: ['password'],
- password: {
- user: {
- id: credentials['userId'],
- password: credentials['password']
- }
- }
- },
- scope: {
- project: {
- id: credentials['projectId']
- }
- }
- }
- })
- command = "curl -i -H 'Content-Type: application/json' -H 'Host: identity.open.softlayer.com:443' -X POST -d '#{body}' #{credentials['auth_url']}/v3/auth/tokens"
- puts command
- system(command)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement