Skip to content

Instantly share code, notes, and snippets.

@fancyremarker
Created February 18, 2015 20:56
Show Gist options
  • Save fancyremarker/531ee9423c56cd4bf278 to your computer and use it in GitHub Desktop.
Save fancyremarker/531ee9423c56cd4bf278 to your computer and use it in GitHub Desktop.
[:octopus:] Grab an app container's internal host and port from the Aptible API
require 'aptible/auth'
require 'aptible/api'
HANDLE = 'your-app'
EMAIL = 'you@example.com'
PASSWORD = ''
token = Aptible::Auth::Token.create(email: EMAIL, password: PASSWORD)
app = Aptible::Api::App.all(token: token).find do |app|
app.handle == HANDLE
end
container = app.services.first.current_release.containers.find do |container|
container.layer == 'app'
end
puts container.host
puts container.port
@fancyremarker
Copy link
Author

Thanks @tobalsgithub !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment