How to use the heroku-cli-util.action function in heroku-cli-util

To help you get started, we’ve selected a few heroku-cli-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heroku / cli / packages / oauth-v5 / lib / commands / authorizations / rotate.js View on Github external
function * run (context, heroku) {
  let auth = yield cli.action('Rotating OAuth Authorization', heroku.request({
    method: 'POST',
    path: `/oauth/authorizations/${encodeURIComponent(context.args.id)}/actions/regenerate-tokens`
  }))

  authorizations.display(auth)
}
github heroku / cli / packages / certs-v5 / commands / certs / info.js View on Github external
function * run (context, heroku) {
  let endpoint = yield flags(context, heroku)

  let cert = yield cli.action(`Fetching SSL certificate ${endpoint.name} info for ${cli.color.app(context.app)}`, {}, heroku.request({
    path: endpoint._meta.path,
    headers: { 'Accept': `application/vnd.heroku+json; version=3.${endpoint._meta.variant}` }
  }))

  certificateDetails(cert)
}
github heroku / cli / packages / oauth-v5 / lib / commands / authorizations / revoke.js View on Github external
function * run (context, heroku) {
  let auth = yield cli.action('Revoking OAuth Authorization', {success: false}, heroku.request({
    method: 'DELETE',
    path: `/oauth/authorizations/${encodeURIComponent(context.args.id)}`
  }))
  cli.log(`done, revoked authorization from ${cli.color.cyan(auth.description)}`)
}
github heroku / cli / packages / apps-v5 / src / commands / ps / restart.js View on Github external
function * run (context, heroku) {
  let app = context.app
  let dyno = context.args.dyno

  let msg = 'Restarting'
  if (dyno) msg += ` ${cli.color.cyan(dyno)}`
  msg += (dyno && dyno.indexOf('.') !== -1) ? ' dyno' : ' dynos'
  msg += ` on ${cli.color.app(app)}`

  yield cli.action(msg, co(function * () {
    yield heroku.delete(dyno ? `/apps/${app}/dynos/${encodeURIComponent(dyno)}` : `/apps/${app}/dynos`)
  }))
}
github heroku / heroku-apps / src / commands / ps / restart.js View on Github external
function * run (context, heroku) {
  let app = context.app
  let dyno = context.args.dyno

  let msg = 'Restarting'
  if (dyno) msg += ` ${cli.color.cyan(dyno)}`
  msg += (dyno && dyno.indexOf('.') !== -1) ? ' dyno' : ' dynos'
  msg += ` on ${cli.color.app(app)}`

  yield cli.action(msg, co(function * () {
    yield heroku.delete(dyno ? `/apps/${app}/dynos/${encodeURIComponent(dyno)}` : `/apps/${app}/dynos`)
  }))
}