Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with the Play Framework
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Extending Heroku
  • Building Add-ons
  • Add-on Development Tasks
  • Inspecting Heroku Pipelines as an Add-on Partner

Inspecting Heroku Pipelines as an Add-on Partner

English — 日本語に切り替える

Last updated July 13, 2020

Table of Contents

  • Prerequisites
  • Get the provisioning app’s id
  • Getting most pipeline details
  • Getting a pipeline’s name
  • Summary

Heroku Pipelines let developers specify a collection of Heroku apps to represent the different deployment stages of a single codebase. Every app in a pipeline represents one of the following deployment stages:

  • Development
  • Review
  • Staging
  • Production

As an add-on partner, you can access some of an app’s pipeline information with the Platform API for Partners. Common use cases for this information include the following:

  • When you create a unified dashboard for your customers, you can visually group content that corresponds to different apps in the same pipeline.

  • You can track developer pipeline details in your add-on’s metrics to better understand how developers are using your add-on.

Prerequisites

Inspecting pipeline information requires access to the Platform API for Partners. If your add-on doesn’t already use it, see Platform API for Partners to get started.

Additionally, if you want to use this information during provisioning, you should take advantage of Asynchronous Provisioning. Otherwise you run the risk of hitting the 30 second timeout from the original request.

Get the provisioning app’s id

To obtain an app’s pipeline details, you must first obtain the id of the app that provisioned your add-on.

When a developer provisions your add-on, your add-on receives a POST request at /heroku/resources with a JSON body like the following:

{
  "heroku_id": "app1234@heroku.com",
  "plan": "basic",
  "region": "amazon-web-services::us-east-1",
  "callback_url": "https://api.heroku.com/vendor/apps/app1234@heroku.com",
  "options": {},
  "uuid": "01234567-89ab-cdef-0123-456789abcdef"
}

Provide the value of the included uuid field in a GET request to the Add-on Info endpoint:

GET /addons/{resource-uuid}

Content-Type: application/json
Accept: application/vnd.heroku+json; version=3
Authorization: Bearer {access-token}

The endpoint responds with a JSON body like the following:

{
  "actions": {
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "label": "Example",
    "action": "example",
    "url": "http://example.com?resource_id=:resource_id",
    "requires_owner": true
  },
  "addon_service": {
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "name": "heroku-postgresql"
  },
  "app": {
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "name": "example"
  },
  "config_vars": [
    "FOO",
    "BAZ"
  ],
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "acme-inc-primary-database",
  "plan": {
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "name": "heroku-postgresql:dev"
  },
  "provider_id": "abcd1234",
  "state": "provisioned",
  "updated_at": "2012-01-01T12:00:00Z",
  "web_url": "https://postgres.heroku.com/databases/01234567-89ab-cdef-0123-456789abcdef"
}

The app object in the response body includes the unique id of the app that provisioned your add-on. You can use this id to look up the app’s associated pipeline details.

Getting most pipeline details

Now that you have the primary app’s id, provide it in a request to the Pipeline Coupling Info endpoint to obtain the id of its associated pipeline:

GET /apps/{app-id}/pipeline-couplings

Content-Type: application/json
Accept: application/vnd.heroku+json; version=3
Authorization: Bearer {token}

The endpoint responds with a JSON body like the following:

[
  {
    "app": {
      "id": "01234567-89ab-cdef-0123-456789abcdef"
    },
    "created_at": "2012-01-01T12:00:00Z",
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "pipeline": {
      "id": "01234567-89ab-cdef-0123-456789abcdef"
    },
    "stage": "production",
    "updated_at": "2012-01-01T12:00:00Z"
  }
]

The id field of the returned pipeline object uniquely identifies the pipeline. The stage field indicates which deployment stage this app corresponds to.

This endpoint returns an array for consistency with other endpoints, but an app can be a member of only one pipeline (so the array contains at most one item).

Getting a pipeline’s name

You can look up a pipeline’s name with the id you obtained in the previous step:

GET /pipelines/{pipeline-uuid}

Content-Type: application/json
Accept: application/vnd.heroku+json; version=3
Authorization: Bearer {token}
{
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "example",
  "updated_at": "2012-01-01T12:00:00Z"
}

Summary

Gathering pipeline and stage information for apps associated with resources provides opportunities to improve user experiences for customers and improve metrics for partners. Please contact the Heroku Ecosystem team (ecosystem@heroku.com) with any questions or comments.

Keep reading

  • Add-on Development Tasks

Feedback

Log in to submit feedback.

Writing to Application Logs as an Add-on Partner Making Your Add-on Shareable

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences