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

Method CreateHTTPIntegration

pkg/lib/aws/apigateway.go:329–341  ·  view source on GitHub ↗

CreateHTTPIntegration creates new HTTP integration for API Gateway, returns integration ID

(apiGatewayID string, targetEndpoint string)

Source from the content-addressed store, hash-verified

327
328// CreateHTTPIntegration creates new HTTP integration for API Gateway, returns integration ID
329func (c *Client) CreateHTTPIntegration(apiGatewayID string, targetEndpoint string) (string, error) {
330 integrationResponse, err := c.APIGatewayV2().CreateIntegration(&apigatewayv2.CreateIntegrationInput{
331 ApiId: &apiGatewayID,
332 IntegrationType: aws.String("HTTP_PROXY"),
333 IntegrationUri: &targetEndpoint,
334 PayloadFormatVersion: aws.String("1.0"),
335 IntegrationMethod: aws.String("ANY"),
336 })
337 if err != nil {
338 return "", errors.Wrap(err, fmt.Sprintf("failed to create api gateway integration for endpoint %s in api gateway %s", targetEndpoint, apiGatewayID))
339 }
340 return *integrationResponse.IntegrationId, nil
341}
342
343// DeleteIntegration deletes an integration from API Gateway
344func (c *Client) DeleteIntegration(apiGatewayID string, integrationID string) error {

Callers

nothing calls this directly

Calls 3

APIGatewayV2Method · 0.95
WrapFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected