GetAssignment gets the job assignment of the ares-subscriber
(jobNamespace, instance string)
| 182 | |
| 183 | // GetAssignment gets the job assignment of the ares-subscriber |
| 184 | func (c *ControllerHTTPClient) GetAssignment(jobNamespace, instance string) (assignment *models.IngestionAssignment, err error) { |
| 185 | request, err := c.buildRequest(http.MethodGet, fmt.Sprintf("assignment/%s/assignments/%s", jobNamespace, instance), nil) |
| 186 | if err != nil { |
| 187 | err = utils.StackError(err, "Failed to buildRequest") |
| 188 | return |
| 189 | } |
| 190 | |
| 191 | request.Header.Add(utils.HTTPContentTypeHeaderKey, utils.HTTPContentTypeApplicationJson) |
| 192 | assignment = &models.IngestionAssignment{} |
| 193 | err = c.getJSONResponse(request, assignment) |
| 194 | return assignment, err |
| 195 | } |
| 196 | |
| 197 | // SetNamespace sets the namespace which the ControllerHTTPClient connects to |
| 198 | func (c *ControllerHTTPClient) SetNamespace(namespace string) { |
nothing calls this directly
no test coverage detected