psu/client/stackFile_inspect.go

27 lines
596 B
Go
Raw Normal View History

package client
import (
"fmt"
"net/http"
portainer "github.com/portainer/portainer/api"
)
// StackFileInspectResponse represents the body of a response for a request to GET /stack/{id}/file
type StackFileInspectResponse struct {
StackFileContent string
}
func (n *portainerClientImp) StackFileInspect(stackID portainer.StackID) (content string, err error) {
var respBody StackFileInspectResponse
2019-09-10 23:03:39 +00:00
err = n.DoJSONWithToken(fmt.Sprintf("stacks/%v/file", stackID), http.MethodGet, http.Header{}, nil, &respBody)
if err != nil {
return
}
content = respBody.StackFileContent
return
}