github.com/jghiloni/cli@v6.28.1-0.20170628223758-0ce05fe032a2+incompatible/api/cloudcontroller/ccv3/droplet.go (about)

     1  package ccv3
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller"
     5  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal"
     6  )
     7  
     8  type Droplet struct {
     9  	GUID       string      `json:"guid"`
    10  	Stack      string      `json:"stack,omitempty"`
    11  	Buildpacks []Buildpack `json:"buildpacks,omitempty"`
    12  }
    13  
    14  type Buildpack struct {
    15  	Name         string `json:"name"`
    16  	DetectOutput string `json:"detect_output"`
    17  }
    18  
    19  // GetApplicationCurrentDroplet returns the Current Droplet for a given app
    20  func (client *Client) GetApplicationCurrentDroplet(appGUID string) (Droplet, Warnings, error) {
    21  	request, err := client.newHTTPRequest(requestOptions{
    22  		RequestName: internal.GetAppDropletCurrent,
    23  		URIParams:   map[string]string{"guid": appGUID},
    24  	})
    25  
    26  	var responseDroplet Droplet
    27  	response := cloudcontroller.Response{
    28  		Result: &responseDroplet,
    29  	}
    30  	err = client.connection.Make(request, &response)
    31  
    32  	return responseDroplet, response.Warnings, err
    33  }