CLOUDWATCH

package
v1.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxCwAlarmListCmd = &cobra.Command{
	Use:   "getCwAlarmList",
	Short: "getCwAlarmList command gets list of cloudwatch alarm rest api instances of an aws account",
	Long:  `getCwAlarmList command gets list of cloudwatch alarm rest api instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getCwAlarmList 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 {
			instanceId, _ := cmd.Flags().GetString("instanceId")
			if instanceId == "" {
				log.Printf("instance-id missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}
			if instanceId != "" {
				instances, err := ListCwAlarms(instanceId, clientAuth, nil)
				if err != nil {
					log.Println("error getting getCwAlarmList: ", err)
					return
				}
				fmt.Println(instances)
			}

		}

	},
}

Functions

func ListCwAlarms

func ListCwAlarms(instanceId string, clientAuth *model.Auth, client *cloudwatch.CloudWatch) ([]*cloudwatch.MetricAlarm, error)

func ListCwEvent added in v1.0.8

func ListCwEvent(instanceId string, clientAuth *model.Auth, client *cloudtrail.CloudTrail) (string, error)

func ListCwLogsGorup added in v1.0.6

func ListCwLogsGorup(clientAuth *model.Auth, client *cloudwatchlogs.CloudWatchLogs) ([]string, error)

func ListCwLogsStream added in v1.0.6

func ListCwLogsStream(logGroupName string, clientAuth *model.Auth, client *cloudwatchlogs.CloudWatchLogs) ([]*string, error)

Types

type FilteredLogEvent added in v1.0.6

type FilteredLogEvent struct {
	Timestamp int64
	Message   string
}

Jump to

Keyboard shortcuts

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