Class: PlatformAPI::Dyno

Inherits:
Object
  • Object
show all
Defined in:
lib/platform-api/client.rb

Overview

Dynos encapsulate running processes of an app on Heroku. Detailed information about dyno sizes can be found at: https://devcenter.heroku.com/articles/dyno-types.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Dyno

Returns a new instance of Dyno.


1220
1221
1222
# File 'lib/platform-api/client.rb', line 1220

def initialize(client)
  @client = client
end

Instance Method Details

#create(app_id_or_app_name, body = {}) ⇒ Object

Create a new dyno.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • body:

    the object to pass as the request payload


1228
1229
1230
# File 'lib/platform-api/client.rb', line 1228

def create(app_id_or_app_name, body = {})
  @client.dyno.create(app_id_or_app_name, body)
end

#info(app_id_or_app_name, dyno_id_or_dyno_name) ⇒ Object

Info for existing dyno.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • dyno_id_or_dyno_name:

    unique identifier of this dyno or the name of this process on this dyno


1259
1260
1261
# File 'lib/platform-api/client.rb', line 1259

def info(app_id_or_app_name, dyno_id_or_dyno_name)
  @client.dyno.info(app_id_or_app_name, dyno_id_or_dyno_name)
end

#list(app_id_or_app_name) ⇒ Object

List existing dynos.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app


1266
1267
1268
# File 'lib/platform-api/client.rb', line 1266

def list(app_id_or_app_name)
  @client.dyno.list(app_id_or_app_name)
end

#restart(app_id_or_app_name, dyno_id_or_dyno_name) ⇒ Object

Restart dyno.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • dyno_id_or_dyno_name:

    unique identifier of this dyno or the name of this process on this dyno


1236
1237
1238
# File 'lib/platform-api/client.rb', line 1236

def restart(app_id_or_app_name, dyno_id_or_dyno_name)
  @client.dyno.restart(app_id_or_app_name, dyno_id_or_dyno_name)
end

#restart_all(app_id_or_app_name) ⇒ Object

Restart all dynos.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app


1243
1244
1245
# File 'lib/platform-api/client.rb', line 1243

def restart_all(app_id_or_app_name)
  @client.dyno.restart_all(app_id_or_app_name)
end

#stop(app_id_or_app_name, dyno_id_or_dyno_name) ⇒ Object

Stop dyno.

Parameters:

  • app_id_or_app_name:

    unique identifier of app or unique name of app

  • dyno_id_or_dyno_name:

    unique identifier of this dyno or the name of this process on this dyno


1251
1252
1253
# File 'lib/platform-api/client.rb', line 1251

def stop(app_id_or_app_name, dyno_id_or_dyno_name)
  @client.dyno.stop(app_id_or_app_name, dyno_id_or_dyno_name)
end