psu/client/stackFile_inspect.go
Juan Carlos Mejías Rodríguez 63c82efd33 Export doJSONWithToken
2019-11-26 23:27:15 -05:00

27 lines
596 B
Go

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
err = n.DoJSONWithToken(fmt.Sprintf("stacks/%v/file", stackID), http.MethodGet, http.Header{}, nil, &respBody)
if err != nil {
return
}
content = respBody.StackFileContent
return
}