ECS

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxEcsConfigCmd = &cobra.Command{
	Use:   "getEcsConfig",
	Short: "getEcsConfig command gets ecs configuration",
	Long:  `getEcsConfig command gets ecs configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getEcsConfig 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 {
			clusterName, _ := cmd.Flags().GetString("clusterName")
			if clusterName == "" {
				log.Printf("ecs cluster name missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}
			instances, err := GetEcsInstanceByClusterName(clusterName, clientAuth, nil)
			if err != nil {
				log.Println("error getting getEcsConfig by instance id: ", err)
				return
			}
			fmt.Println(instances)
		}
	},
}
View Source
var AwsxEcsListCmd = &cobra.Command{
	Use:   "getEcsList",
	Short: "getEcsList command gets list of ecs instances of an aws account",
	Long:  `getEcsList command gets list of ecs instances of an aws account`,

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

Functions

func GetEcsInstanceByClusterName

func GetEcsInstanceByClusterName(clusterName string, clientAuth *model.Auth, client *ecs.ECS) (*ecs.DescribeClustersOutput, error)

func ListEcsInstances

func ListEcsInstances(clientAuth *model.Auth, client *ecs.ECS) ([]*ecs.DescribeClustersOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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