MCPcopy Index your code
hub / github.com/cortexlabs/cortex / GetAPIByID

Function GetAPIByID

cli/cluster/get.go:68–80  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, apiName string, apiID string)

Source from the content-addressed store, hash-verified

66}
67
68func GetAPIByID(operatorConfig OperatorConfig, apiName string, apiID string) ([]schema.APIResponse, error) {
69 httpRes, err := HTTPGet(operatorConfig, "/get/"+apiName+"/"+apiID)
70 if err != nil {
71 return nil, err
72 }
73
74 var apiRes []schema.APIResponse
75 if err = json.Unmarshal(httpRes, &apiRes); err != nil {
76 return nil, errors.Wrap(err, "/get/"+apiName+"/"+apiID, string(httpRes))
77 }
78
79 return apiRes, nil
80}
81
82func GetBatchJob(operatorConfig OperatorConfig, apiName string, jobID string) (schema.BatchJobResponse, error) {
83 endpoint := path.Join("/batch", apiName)

Callers

nothing calls this directly

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected