cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2020 Pawel Dudzinski <paweldudzinski@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeCluster

func DescribeCluster(svc *ecs.ECS, clusterName string) *ecs.Cluster

DescribeCluster returns cluster details

func DescribeContainerInstances

func DescribeContainerInstances(svc *ecs.ECS, uuid string, clusterName string) *ecs.ContainerInstance

DescribeContainerInstances returns description of a container instance by uuid

func DescribeEC2Instance

func DescribeEC2Instance(session *session.Session, id string) (*ec2.Instance, error)

DescribeEC2Instance desc

func DescribeService

func DescribeService(svc *ecs.ECS, serviceName string, clusterName string) *ecs.Service

DescribeService returns service details

func DescribeTask

func DescribeTask(svc *ecs.ECS, name string) *ecs.TaskDefinition

DescribeTask returns task definition details

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetEC2Metrics

func GetEC2Metrics(session *session.Session, id string) float64

GetEC2Metrics gets CloundWatch metrics for a given instance

func PrintClusterInfo

func PrintClusterInfo(c []Cluster)

PrintClusterInfo pretty prints clusters informantion

func PrintEvents

func PrintEvents(events []*ecs.ServiceEvent)

PrintEvents pretty print service events

func PrintInstancesInfo

func PrintInstancesInfo(i []ContainerInstance)

PrintInstancesInfo pretty prints container instance description

func PrintServicesInfo

func PrintServicesInfo(s []Service)

PrintServicesInfo pretty prints services informantion

func PrintTasksInfo

func PrintTasksInfo(t []Task)

PrintTasksInfo pretty print task information

Types

type AWSCredentials

type AWSCredentials struct {
	SecretAccessKey string
	AccessKeyID     string
	DefaultRegion   string
}

AWSCredentials is a collection of AWS credentials

func (*AWSCredentials) GetSession

func (c *AWSCredentials) GetSession() (*session.Session, error)

GetSession returns AWS session identifier

func (*AWSCredentials) InitAWS

func (c *AWSCredentials) InitAWS(cmd *cobra.Command)

InitAWS collects AWS credentials from cmd line or env variables.

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster struct gathers information about ECS cluster.

func ListClusters

func ListClusters(session *session.Session) ([]Cluster, error)

ListClusters lists ECS clusters

type ContainerInstance

type ContainerInstance struct {
	CPUUtilization float64
	// contains filtered or unexported fields
}

ContainerInstance contains information about EC2 instances

func ListInstances

func ListInstances(session *session.Session, cluster string) ([]ContainerInstance, error)

ListInstances lists cluster container instances

type Resource

type Resource struct {
	CPU int64
	// contains filtered or unexported fields
}

Resource contains information about CPU and memory resources

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct gathers information about ECS service.

func ListServices

func ListServices(session *session.Session, cluster string) ([]Service, error)

ListServices list ECS services within a cluster

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task struct gathers information about task

func ListTasks

func ListTasks(session *session.Session, family string) ([]Task, error)

ListTasks lists tasks definitions

Jump to

Keyboard shortcuts

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