Documentation ¶
Index ¶
- Variables
- func ListAWSObjectsByName[ListOutput any, DescribeInput any, DescribeOutput any, NamedItem any](ctx context.Context, objectName string, paginator AWSPaginator[ListOutput], ...) (map[arn]string, error)
- func NewUsageError(err error) error
- func RunAddWorkflow() error
- func UsageErrorf(f string, args ...interface{}) error
- type AWSPaginator
- type AddWorkflow
- type AddWorkflowState
- type UnauthorizedOperationError
- type UsageError
Constants ¶
This section is empty.
Variables ¶
var AddToECSCmd = &cobra.Command{ Use: "add", Short: Cmd.Short, Long: Cmd.Long, SilenceUsage: true, RunE: addAgentToECS, }
'postman-insights-agent ecs' should default to 'postman-insights-agent ecs add'
var Cmd = &cobra.Command{ Use: "ecs", Short: "Add the Postman Insights Agent to AWS ECS.", Long: "The agent will collect information from you and add the Postman Insights Agent container to an ECS Task.", SilenceUsage: true, RunE: addAgentToECS, }
var NoSuchClusterError = errors.New("No such cluster")
var NoSuchProfileError = errors.New("No such profile")
Error indicating profile is absent. TODO: stop mixing error.Is and error.As usage?
var PrintCloudFormationFragmentCmd = &cobra.Command{
Use: "cf-fragment",
Short: "Print an AWS CloudFormation fragment for adding the Postman Insights Agent to AWS ECS.",
Long: "Print a code fragment that can be inserted into a CloudFormation template to add the Postman Insights Agent as a sidecar container.",
RunE: printCloudFormationFragment,
}
var PrintECSTaskDefinitionCmd = &cobra.Command{
Use: "task-def",
Short: "Print an AWS ECS task definition for running the Postman Insights Agent in daemon mode.",
Long: "Print a task definition that can be added to an ECS cluster to run the Postman Insights Agent as a daemon in host-networking mode on every EC2 instance in the cluster.",
RunE: printECSTaskDefinition,
}
var RemoveFromECSCmd = &cobra.Command{ Use: "remove", Short: "Remove the Postman Insights Agent from AWS ECS.", Long: "Remove a previously installed Postman Insights Agent container from an ECS Task.", SilenceUsage: true, RunE: removeAgentFromECS, Hidden: true, }
Functions ¶
func ListAWSObjectsByName ¶
func ListAWSObjectsByName[ ListOutput any, DescribeInput any, DescribeOutput any, NamedItem any, ]( ctx context.Context, objectName string, paginator AWSPaginator[ListOutput], getArns func(ListOutput) []arn, inputFactory func([]arn) DescribeInput, describe func(context.Context, DescribeInput) (DescribeOutput, error), extract func(DescribeOutput) []NamedItem, convert func(NamedItem) (arn, string), ) (map[arn]string, error)
func NewUsageError ¶
func RunAddWorkflow ¶
func RunAddWorkflow() error
Run the "add to ECS" workflow until we complete or get an error. Errors that are UsageErrors should be returned as-is; other errors should be wrapped to avoid showing usage. (This is reversed from the other command conventions, but there are relatively few usage errors here.)
func UsageErrorf ¶
Types ¶
type AWSPaginator ¶
type AWSPaginator[ListOutput any] interface { HasMorePages() bool NextPage(context.Context, ...func(*ecs.Options)) (ListOutput, error) }
Interface of the Paginator returned by the ECS package. TODO: should we make this take the Options type as an extra parameter, so it can be used with other packages?
type AddWorkflow ¶
type AddWorkflow struct {
// contains filtered or unexported fields
}
func (*AddWorkflow) GetDeploymentByID ¶
func (wf *AddWorkflow) GetDeploymentByID(serviceARN arn, deploymentID string) (types.Deployment, error)
func (*AddWorkflow) GetDeploymentMatchingTask ¶
func (wf *AddWorkflow) GetDeploymentMatchingTask(serviceARN arn) (string, types.Deployment, error)
Returns the deployment of the given service that matches the ECS task definition configured in the workflow. For convenience, the deployment ID is also returned as a string.
type AddWorkflowState ¶
type AddWorkflowState func(*AddWorkflow) (next optionals.Optional[AddWorkflowState], err error)
A function which executes the next part of the workflow, and picks a next state (Some) or exits (None), or signals an eror.
type UnauthorizedOperationError ¶
type UnauthorizedOperationError struct {}
Error indicating the user was unauthorized.
func (UnauthorizedOperationError) Error ¶
func (e UnauthorizedOperationError) Error() string
type UsageError ¶
type UsageError struct {
// contains filtered or unexported fields
}
func (UsageError) Error ¶
func (ue UsageError) Error() string