Skip to content

Commit

Permalink
Merge pull request digitalocean#346 from digitalocean/apps-fix-get-logs
Browse files Browse the repository at this point in the history
apps: fix get logs endpoint not passing in log type
  • Loading branch information
nanzhong authored Jul 11, 2020
2 parents 1dc3c09 + 5dda20e commit e4e119f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ type AppLogType string

const (
// AppLogTypeBuild represents build logs.
AppLogTypeBuild AppLogType = "build"
AppLogTypeBuild AppLogType = "BUILD"
// AppLogTypeDeploy represents deploy logs.
AppLogTypeDeploy AppLogType = "deploy"
AppLogTypeDeploy AppLogType = "DEPLOY"
// AppLogTypeRun represents run logs.
AppLogTypeRun AppLogType = "run"
AppLogTypeRun AppLogType = "RUN"
)

// AppsService is an interface for interfacing with the App Platform endpoints
Expand Down Expand Up @@ -264,8 +264,8 @@ func (s *AppsServiceOp) CreateDeployment(ctx context.Context, appID string) (*De

// GetLogs retrieves app logs.
func (s *AppsServiceOp) GetLogs(ctx context.Context, appID, deploymentID, component string, logType AppLogType) (*AppLogs, *Response, error) {
path := fmt.Sprintf("%s/%s/deployments/%s/components/%s/logs", appsBasePath, appID, deploymentID, component)
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
url := fmt.Sprintf("%s/%s/deployments/%s/components/%s/logs?type=%s", appsBasePath, appID, deploymentID, component, logType)
req, err := s.client.NewRequest(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit e4e119f

Please sign in to comment.