diff --git a/gorp/client.go b/gorp/client.go index 59e5146..1a9fb1c 100644 --- a/gorp/client.go +++ b/gorp/client.go @@ -114,6 +114,19 @@ func (c *Client) FinishTest(id string, launch *FinishTestRQ) (*MsgRS, error) { return &rs, err } +//SaveLog attaches log in RP +func (c *Client) SaveLog(log *SaveLogRQ) (*EntryCreatedRS, error) { + var rs EntryCreatedRS + _, err := c.http.R(). + SetPathParams(map[string]string{ + "project": c.project, + }). + SetBody(log). + SetResult(&rs). + Post("/api/v1/{project}/log") + return &rs, err +} + //GetLaunches retrieves latest launches func (c *Client) GetLaunches() (*LaunchPage, error) { var launches LaunchPage diff --git a/gorp/model.go b/gorp/model.go index fce3d88..922f202 100644 --- a/gorp/model.go +++ b/gorp/model.go @@ -135,6 +135,14 @@ type ( Retry bool `json:"retry,omitempty"` } + //SaveLogRQ payload representation. Without attaches. + SaveLogRQ struct { + ItemID string `json:"item_id,omitempty"` + LogTime Timestamp `json:"time,omitempty"` + Message string `json:"message,omitempty"` + Level string `json:"level,omitempty"` + } + //StartTestRQ payload representation StartTestRQ struct { StartRQ