godo.Apps.GetDeployment()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Apps.GetDeployment(ctx context.Context, appID string, deploymentID string) (*godo.Deployment, *godo.Response, error)

Description

GetDeployment gets an app deployment.

This method sends a GET request to /v2/apps/{}/deployments/{}.

Parameters

appID string required
deploymentID string required

Returns

*godo.Deployment
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.Deployment

Deployment struct for Deployment

ID string

Omitted from JSON when empty. JSON key: id

Spec *godo.AppSpec

Omitted from JSON when empty. JSON key: spec

Services []*godo.DeploymentService

Omitted from JSON when empty. JSON key: services

StaticSites []*godo.DeploymentStaticSite

Omitted from JSON when empty. JSON key: static_sites

Workers []*godo.DeploymentWorker

Omitted from JSON when empty. JSON key: workers

Jobs []*godo.DeploymentJob

Omitted from JSON when empty. JSON key: jobs

Functions []*godo.DeploymentFunctions

Omitted from JSON when empty. JSON key: functions

PhaseLastUpdatedAt time.Time

Omitted from JSON when empty. JSON key: phase_last_updated_at

CreatedAt time.Time

Omitted from JSON when empty. JSON key: created_at

UpdatedAt time.Time

Omitted from JSON when empty. JSON key: updated_at

Cause string

Omitted from JSON when empty. JSON key: cause

ClonedFrom string

Omitted from JSON when empty. JSON key: cloned_from

Progress *godo.DeploymentProgress

Omitted from JSON when empty. JSON key: progress

Phase godo.DeploymentPhase

Omitted from JSON when empty. JSON key: phase

TierSlug string

Omitted from JSON when empty. JSON key: tier_slug

PreviousDeploymentID string

Omitted from JSON when empty. JSON key: previous_deployment_id

CauseDetails *godo.DeploymentCauseDetails

Omitted from JSON when empty. JSON key: cause_details

LoadBalancerID string

Omitted from JSON when empty. JSON key: load_balancer_id

Timing *godo.DeploymentTiming

Omitted from JSON when empty. JSON key: timing

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Apps.GetDeployment(ctx, "<your-app-id>", "<your-deployment-id>")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "deployment": {
    "id": "b6bdf840-2854-4f87-a36c-5f231c617c84",
    "spec": {
      "name": "sample-golang",
      "disable_edge_cache": true,
      "disable_email_obfuscation": true,
      "enhanced_threat_control_enabled": true,
      "services": [
        {
          "name": "web",
          "github": {
            "repo": "digitalocean/sample-golang",
            "branch": "branch"
          },
          "run_command": "bin/sample-golang",
          "environment_slug": "go",
          "instance_size_slug": "apps-s-1vcpu-0.5gb",
          "instance_count": 2,
          "routes": [
            {
              "path": "/"
            }
          ]
        }
      ],
      "region": "ams"
    },
    "services": [
      {
        "name": "web",
        "source_commit_hash": "9a4df0b8e161e323bc3cdf1dc71878080fe144fa"
      }
    ],
    "phase_last_updated_at": "0001-01-01T00:00:00Z",
    "created_at": "2020-07-28T18:00:00Z",
    "updated_at": "2020-07-28T18:00:00Z",
    "cause": "commit 9a4df0b pushed to github/digitalocean/sample-golang",
    "progress": {
      "pending_steps": 6,
      "total_steps": 6,
      "steps": [
        {
          "name": "build",
          "status": "PENDING",
          "steps": [
            {
              "name": "initialize",
              "status": "PENDING"
            },
            {
              "name": "components",
              "status": "PENDING",
              "steps": [
                {
                  "name": "web",
                  "status": "PENDING",
                  "component_name": "web",
                  "message_base": "Building service"
                }
              ]
            }
          ]
        },
        {
          "name": "deploy",
          "status": "PENDING",
          "steps": [
            {
              "name": "initialize",
              "status": "PENDING"
            },
            {
              "name": "components",
              "status": "PENDING",
              "steps": [
                {
                  "name": "web",
                  "status": "PENDING",
                  "steps": [
                    {
                      "name": "deploy",
                      "status": "PENDING",
                      "component_name": "web",
                      "message_base": "Deploying service"
                    },
                    {
                      "name": "wait",
                      "status": "PENDING",
                      "component_name": "web",
                      "message_base": "Waiting for service"
                    }
                  ],
                  "component_name": "web"
                }
              ]
            },
            {
              "name": "finalize",
              "status": "PENDING"
            }
          ]
        }
      ]
    },
    "phase": "PENDING_BUILD",
    "tier_slug": "basic"
  }
}

More Information

See GET /v2/apps/{}/deployments/{} in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.