RDS

package
v1.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxRdsConfigCmd = &cobra.Command{
	Use:   "getRdsConfig",
	Short: "getRdsConfig command gets rds configuration",
	Long:  `getRdsConfig command gets rds configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getRdsConfig 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 {
			arn, _ := cmd.Flags().GetString("arn")
			if arn == "" {
				log.Printf("rds arn missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}

			instances, err := GetRdsInstanceByArn(arn, clientAuth, nil)
			if err != nil {
				log.Println("error getting getRdsConfig by function name: ", err)
				return
			}
			fmt.Println(instances)

		}
	},
}
View Source
var AwsxRdsListCmd = &cobra.Command{
	Use:   "getRdsList",
	Short: "getRdsList command gets list of rds instances of an aws account",
	Long:  `getRdsList command gets list of rds instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getRdsList 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 {
			resp, err := ListRdsInstances(clientAuth, nil)
			if err != nil {
				log.Println("error getting getRdsList: ", err)
				return
			}
			fmt.Println(resp)
		}
	},
}

Functions

func GetRdsInstanceByArn

func GetRdsInstanceByArn(arn string, clientAuth *model.Auth, client *rds.RDS) (*rds.DescribeDBInstancesOutput, error)

func ListRdsInstances

func ListRdsInstances(clientAuth *model.Auth, client *rds.RDS) ([]*rds.DescribeDBInstancesOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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