MCPcopy
hub / github.com/cortexlabs/cortex / DescribeAPI

Function DescribeAPI

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

Source from the content-addressed store, hash-verified

52}
53
54func DescribeAPI(operatorConfig OperatorConfig, apiName string) ([]schema.APIResponse, error) {
55 httpRes, err := HTTPGet(operatorConfig, "/describe/"+apiName)
56 if err != nil {
57 return nil, err
58 }
59
60 var apiRes []schema.APIResponse
61 if err = json.Unmarshal(httpRes, &apiRes); err != nil {
62 return nil, errors.Wrap(err, "/describe/"+apiName, string(httpRes))
63 }
64
65 return apiRes, nil
66}
67
68func GetAPIByID(operatorConfig OperatorConfig, apiName string, apiID string) ([]schema.APIResponse, error) {
69 httpRes, err := HTTPGet(operatorConfig, "/get/"+apiName+"/"+apiID)

Callers 1

describeAPIFunction · 0.92

Calls 3

UnmarshalFunction · 0.92
WrapFunction · 0.92
HTTPGetFunction · 0.85

Tested by

no test coverage detected