MCPcopy
hub / github.com/uber/aresdb / GetAssignment

Method GetAssignment

controller/client/controller.go:184–195  ·  view source on GitHub ↗

GetAssignment gets the job assignment of the ares-subscriber

(jobNamespace, instance string)

Source from the content-addressed store, hash-verified

182
183// GetAssignment gets the job assignment of the ares-subscriber
184func (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
198func (c *ControllerHTTPClient) SetNamespace(namespace string) {

Callers

nothing calls this directly

Calls 4

buildRequestMethod · 0.95
getJSONResponseMethod · 0.95
StackErrorFunction · 0.92
AddMethod · 0.65

Tested by

no test coverage detected