API_GW

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxApiGwConfigCmd = &cobra.Command{
	Use:   "getApiGwConfig",
	Short: "getApiGwConfig command gets apigw configuration",
	Long:  `getApiGwConfig command gets apigw configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getApiGwRestApiConfig command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			apiKey, _ := cmd.Flags().GetString("apiKey")
			if apiKey == "" {
				log.Printf("api key missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}

			instances, err := GetApiGwById(apiKey, clientAuth, nil)
			if err != nil {
				log.Println("error getting getApiGwConfig by api key: ", err)
				return
			}
			fmt.Println(instances)
		}
	},
}
View Source
var AwsxApiGwListCmd = &cobra.Command{
	Use:   "getApiGwList",
	Short: "getApiGwList command gets list of apigw rest api instances of an aws account",
	Long:  `getApiGwList command gets list of apigw rest api instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getApiGwList command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			instances, err := ListApiGwInstances(clientAuth, nil)
			if err != nil {
				log.Println("error getting getApiGwList: ", err)
				return
			}
			fmt.Println(instances)
		}

	},
}

Functions

func GetApiGwById

func GetApiGwById(apiKey string, clientAuth *model.Auth, client *apigateway.APIGateway) (*apigateway.RestApi, error)

func ListApiGwInstances

func ListApiGwInstances(clientAuth *model.Auth, client *apigateway.APIGateway) (*apigateway.GetRestApisOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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