apigateway

package
v0.77.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

APIGateway Service

This service is github.com/aws/aws-sdk-go/service/apigateway.APIGateway proxy

To check all supported method run

    endly -s="aws/apigateway"

To check method contract run endly -s="aws/apigateway" -a=methodName

    endly -s="aws/apigateway" -a='getRestApis'

On top of that service implements the following helper methods:

  • setupResetAPI
Usage:
Setting Rest API
endly -r=setup

@setup.yaml

pipeline:
  createAPI:
    action: aws/apigateway:deployAPI
    credentials: aws
    '@name': ipLookupAPI
    resources:
      - path: /ip
        methods:
          - httpMethod: ANY
            functionName: lookupIp

  info:
    action: print
    message: $AsJSON(${createAPI})

Documentation

Index

Constants

View Source
const (
	//ServiceID aws api gateway service id.
	ServiceID = "aws/apigateway"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient(context *endly.Context) (*apigateway.APIGateway, error)

GetClient returns apigateway client from context

func New

func New() endly.Service

New creates a new AWS API Gateway service.

func SetAPIInfo

func SetAPIInfo(restAPI *apigateway.RestApi, aMap data.Map)

Types

type CreateAuthorizerInput

type CreateAuthorizerInput struct {
	apigateway.CreateAuthorizerInput
	FunctionName string
}

func (CreateAuthorizerInput) Diff

Diff computes patches

func (*CreateAuthorizerInput) Init

func (i *CreateAuthorizerInput) Init() error

type GetRestAPIInput

type GetRestAPIInput struct {
	Name      *string `json:",inline"`
	StageName *string ` json:",inline"`
}

GetRestAPIInput endpoint URL inpit

func (*GetRestAPIInput) Init

func (i *GetRestAPIInput) Init() error

func (*GetRestAPIInput) Validate

func (i *GetRestAPIInput) Validate() error

type GetRestAPIOutput

type GetRestAPIOutput struct {
	*apigateway.RestApi
	EndpointURL string ` json:",inline"`
}

GetRestAPIInput endpoint URL output

type PutIntegrationInput

type PutIntegrationInput apigateway.PutIntegrationInput

func (PutIntegrationInput) Diff

Diff computes patches

type RemoveRestAPIInput

type RemoveRestAPIInput struct {
	Name *string
}

RemoveRestAPI removes API for supplied name

func (*RemoveRestAPIInput) Validate

func (i *RemoveRestAPIInput) Validate() error

type ResetAPIEvent

type ResetAPIEvent struct {
	Name      string
	ID        string
	Endpoint  string
	Resources []*RestResourceInfo
}

ResetAPIEvent represents rest API event

func NewResetAPIEvent

func NewResetAPIEvent(output *SetupRestAPIOutput) *ResetAPIEvent

func (*ResetAPIEvent) Messages

func (e *ResetAPIEvent) Messages() []*msg.Message

type ResourceMethod

type ResourceMethod struct {
	FunctionName string
	Authorizer   string
	HttpMethod   string
	*apigateway.PutMethodInput
	*apigateway.PutIntegrationInput
	*lambda.AddPermissionInput
}

ResourceMethod represents resource method

func (*ResourceMethod) Init

func (i *ResourceMethod) Init() error

Initialise resource with the following defaults

<ul>

<li>AuthorizationType: NONE</li>
<li>HttpMethod: ANY</li>
<li>ApiKeyRequired: false</li>
<li>IntegrationHttpMethod: POST</li>
<li>Type: AWS_PROXY</li>
<li>Uri: arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/${function.arn}/invocations</li>

</ul>

It supports data substitution on uri attribute i.e. - $function.arn - $function.region - $function.accountID - $restAPI.SessionID - $uuid.next

func (*ResourceMethod) Validate

func (i *ResourceMethod) Validate() error

type RestMethodInfo

type RestMethodInfo struct {
	HTTPMethod        string
	URI               *string
	Type              *string
	AuthorizationType *string
	AuthorizerID      *string
}

Represents reset method event part

type RestResourceInfo

type RestResourceInfo struct {
	Path    string
	ID      string
	Methods []*RestMethodInfo
	TestCLI string
}

Represents reset resource event part

type SetupDeploymentInput

type SetupDeploymentInput apigateway.CreateDeploymentInput

func (*SetupDeploymentInput) Diff

type SetupMethodInput

type SetupMethodInput apigateway.PutMethodInput

SetupMethodInput setups method input

func (SetupMethodInput) Diff

Diff computes patches

type SetupResourceInput

type SetupResourceInput struct {
	Path                           string
	apigateway.CreateResourceInput `json:",inline"`
	Methods                        []*ResourceMethod
}

SetupResourceInput represents resource input

func (*SetupResourceInput) Init

func (i *SetupResourceInput) Init() error

Init initialize input

func (*SetupResourceInput) ParentPath

func (i *SetupResourceInput) ParentPath() string

ParentPath returns parent path

func (*SetupResourceInput) Validate

func (i *SetupResourceInput) Validate() error

type SetupResourceOutput

type SetupResourceOutput struct {
	*apigateway.Resource `json:",inline"`
	ResourceMethods      map[string]*apigateway.Method
}

SetupResourceOutput represents setup resource output

type SetupRestAPIInput

type SetupRestAPIInput struct {
	apigateway.CreateRestApiInput    ` json:",inline"`
	Resources                        []*SetupResourceInput
	apigateway.CreateDeploymentInput ` json:",inline"`

	Authorizers     []*CreateAuthorizerInput
	GatewayResponse []*apigateway.PutGatewayResponseInput
	Redeploy        bool
}

SetupRestAPIInput represent a request to setup API with specified resources

func (*SetupRestAPIInput) Init

func (i *SetupRestAPIInput) Init() error

func (*SetupRestAPIInput) Validate

func (i *SetupRestAPIInput) Validate() error

Validate checks is input is valud

type SetupRestAPIOutput

type SetupRestAPIOutput struct {
	*apigateway.RestApi
	Resources   []*SetupResourceOutput
	Authorizers []*apigateway.Authorizer
	Stage       *apigateway.Stage
	EndpointURL string
	Region      string
}

SetupRestAPIInput represent setup API response

func (*SetupRestAPIOutput) Messages

func (o *SetupRestAPIOutput) Messages() []*msg.Message

Messages returns messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL