Repository navigation
[PRODCRE-1483] obs without ctf bin #2314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import ( | |
| "net/http" | ||
| "os" | ||
| "regexp" | ||
| "strconv" | ||
| "strings" | ||
| "sync" | ||
| "time" | ||
|
|
@@ -1431,3 +1432,38 @@ func ImportP2PKeys(cl []*ChainlinkClient, keys [][]byte) error { | |
| } | ||
| return eg.Wait() | ||
| } | ||
|
|
||
| func (c *ChainlinkClient) ReadWorkflowEvents(workflowID string, sequence int64, limit int) (*WorkflowDebugEvents, *http.Response, error) { | ||
| specObj := &WorkflowDebugEvents{} | ||
| framework.L.Info().Str(NodeURL, c.Config.URL).Str("ID", workflowID).Int64("sequence", sequence).Int("limit", limit).Msg("Reading Workflow Events") | ||
| resp, err := c.APIClient.R(). | ||
| SetResult(&specObj). | ||
| SetPathParams(map[string]string{ | ||
| "id": workflowID, | ||
| }). | ||
| SetQueryParams(map[string]string{ | ||
| "sequence": strconv.FormatInt(sequence, 10), | ||
| "limit": strconv.Itoa(limit), | ||
| }). | ||
| Get("/v2/debug/workflow/{id}/events?sequence={sequence}&limit={limit}") | ||
| if err != nil { | ||
| return nil, nil, err | ||
| } | ||
| return specObj, resp.RawResponse, err | ||
| } | ||
|
|
||
| func (c *ChainlinkClient) ReadOrphanEvents(sequence int64, limit int) (*WorkflowOrphanEvents, *http.Response, error) { | ||
| specObj := &WorkflowOrphanEvents{} | ||
| framework.L.Info().Str(NodeURL, c.Config.URL).Int64("sequence", sequence).Int("limit", limit).Msg("Reading Workflow Orphan Events") | ||
| resp, err := c.APIClient.R(). | ||
| SetResult(&specObj). | ||
| SetQueryParams(map[string]string{ | ||
| "sequence": strconv.FormatInt(sequence, 10), | ||
| "limit": strconv.Itoa(limit), | ||
| }). | ||
| Get("/v2/debug/workflow/orphan_events?sequence={sequence}&limit={limit}") | ||
|
||
| if err != nil { | ||
| return nil, nil, err | ||
| } | ||
| return specObj, resp.RawResponse, err | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1419,3 +1419,45 @@ type ForwarderAttributes struct { | |||||||||||||
| CreatedAt time.Time `json:"createdAt"` | ||||||||||||||
| UpdatedAt time.Time `json:"updatedAt"` | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowDebugEvents struct { | ||||||||||||||
| Data WorkflowDebugEventsData `json:"data"` | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowDebugEventsData struct { | ||||||||||||||
| Type string `json:"type"` | ||||||||||||||
| ID string `json:"id"` | ||||||||||||||
| Attributes WorkflowDebugEventsAttributes `json:"attributes"` | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowDebugEventsAttributes struct { | ||||||||||||||
| Events []WorkflowDebugEvent `json:"events"` | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowDebugEvent struct { | ||||||||||||||
| Timestamp time.Time `json:"timestamp"` | ||||||||||||||
| Sequence int64 `json:"sequence"` | ||||||||||||||
| Message []byte `json:"message"` // protobuf encoded | ||||||||||||||
| Type string `json:"type"` // protobuf type name | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowOrphanEvents struct { | ||||||||||||||
| Data WorkflowOrphanEventsData `json:"data"` | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| type WorkflowOrphanEventsData struct { | ||||||||||||||
| Type string `json:"type"` | ||||||||||||||
| ID string `json:"id"` | ||||||||||||||
| Attributes WorkflowDebugEventsAttributes `json:"attributes"` | ||||||||||||||
|
Comment on lines
+1449
to
+1451
|
||||||||||||||
| Type string `json:"type"` | |
| ID string `json:"id"` | |
| Attributes WorkflowDebugEventsAttributes `json:"attributes"` | |
| Type string `json:"type"` | |
| ID string `json:"id"` | |
| Attributes WorkflowOrphanEventsAttributes `json:"attributes"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query parameters should not be included in the URL path when using SetQueryParams. The query string should be just '/v2/debug/workflow/{id}/events' as SetQueryParams already adds the query parameters.