mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-01 04:40:38 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+6385
File diff suppressed because it is too large
Load Diff
+188
@@ -0,0 +1,188 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
// Package elbiface provides an interface to enable mocking the Elastic Load Balancing service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package elbiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/elb"
|
||||
)
|
||||
|
||||
// ELBAPI provides an interface to enable mocking the
|
||||
// elb.ELB service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Elastic Load Balancing.
|
||||
// func myFunc(svc elbiface.ELBAPI) bool {
|
||||
// // Make svc.AddTags request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := elb.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockELBClient struct {
|
||||
// elbiface.ELBAPI
|
||||
// }
|
||||
// func (m *mockELBClient) AddTags(input *elb.AddTagsInput) (*elb.AddTagsOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockELBClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type ELBAPI interface {
|
||||
AddTags(*elb.AddTagsInput) (*elb.AddTagsOutput, error)
|
||||
AddTagsWithContext(aws.Context, *elb.AddTagsInput, ...request.Option) (*elb.AddTagsOutput, error)
|
||||
AddTagsRequest(*elb.AddTagsInput) (*request.Request, *elb.AddTagsOutput)
|
||||
|
||||
ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error)
|
||||
ApplySecurityGroupsToLoadBalancerWithContext(aws.Context, *elb.ApplySecurityGroupsToLoadBalancerInput, ...request.Option) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error)
|
||||
ApplySecurityGroupsToLoadBalancerRequest(*elb.ApplySecurityGroupsToLoadBalancerInput) (*request.Request, *elb.ApplySecurityGroupsToLoadBalancerOutput)
|
||||
|
||||
AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error)
|
||||
AttachLoadBalancerToSubnetsWithContext(aws.Context, *elb.AttachLoadBalancerToSubnetsInput, ...request.Option) (*elb.AttachLoadBalancerToSubnetsOutput, error)
|
||||
AttachLoadBalancerToSubnetsRequest(*elb.AttachLoadBalancerToSubnetsInput) (*request.Request, *elb.AttachLoadBalancerToSubnetsOutput)
|
||||
|
||||
ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error)
|
||||
ConfigureHealthCheckWithContext(aws.Context, *elb.ConfigureHealthCheckInput, ...request.Option) (*elb.ConfigureHealthCheckOutput, error)
|
||||
ConfigureHealthCheckRequest(*elb.ConfigureHealthCheckInput) (*request.Request, *elb.ConfigureHealthCheckOutput)
|
||||
|
||||
CreateAppCookieStickinessPolicy(*elb.CreateAppCookieStickinessPolicyInput) (*elb.CreateAppCookieStickinessPolicyOutput, error)
|
||||
CreateAppCookieStickinessPolicyWithContext(aws.Context, *elb.CreateAppCookieStickinessPolicyInput, ...request.Option) (*elb.CreateAppCookieStickinessPolicyOutput, error)
|
||||
CreateAppCookieStickinessPolicyRequest(*elb.CreateAppCookieStickinessPolicyInput) (*request.Request, *elb.CreateAppCookieStickinessPolicyOutput)
|
||||
|
||||
CreateLBCookieStickinessPolicy(*elb.CreateLBCookieStickinessPolicyInput) (*elb.CreateLBCookieStickinessPolicyOutput, error)
|
||||
CreateLBCookieStickinessPolicyWithContext(aws.Context, *elb.CreateLBCookieStickinessPolicyInput, ...request.Option) (*elb.CreateLBCookieStickinessPolicyOutput, error)
|
||||
CreateLBCookieStickinessPolicyRequest(*elb.CreateLBCookieStickinessPolicyInput) (*request.Request, *elb.CreateLBCookieStickinessPolicyOutput)
|
||||
|
||||
CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error)
|
||||
CreateLoadBalancerWithContext(aws.Context, *elb.CreateLoadBalancerInput, ...request.Option) (*elb.CreateLoadBalancerOutput, error)
|
||||
CreateLoadBalancerRequest(*elb.CreateLoadBalancerInput) (*request.Request, *elb.CreateLoadBalancerOutput)
|
||||
|
||||
CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error)
|
||||
CreateLoadBalancerListenersWithContext(aws.Context, *elb.CreateLoadBalancerListenersInput, ...request.Option) (*elb.CreateLoadBalancerListenersOutput, error)
|
||||
CreateLoadBalancerListenersRequest(*elb.CreateLoadBalancerListenersInput) (*request.Request, *elb.CreateLoadBalancerListenersOutput)
|
||||
|
||||
CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error)
|
||||
CreateLoadBalancerPolicyWithContext(aws.Context, *elb.CreateLoadBalancerPolicyInput, ...request.Option) (*elb.CreateLoadBalancerPolicyOutput, error)
|
||||
CreateLoadBalancerPolicyRequest(*elb.CreateLoadBalancerPolicyInput) (*request.Request, *elb.CreateLoadBalancerPolicyOutput)
|
||||
|
||||
DeleteLoadBalancer(*elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error)
|
||||
DeleteLoadBalancerWithContext(aws.Context, *elb.DeleteLoadBalancerInput, ...request.Option) (*elb.DeleteLoadBalancerOutput, error)
|
||||
DeleteLoadBalancerRequest(*elb.DeleteLoadBalancerInput) (*request.Request, *elb.DeleteLoadBalancerOutput)
|
||||
|
||||
DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error)
|
||||
DeleteLoadBalancerListenersWithContext(aws.Context, *elb.DeleteLoadBalancerListenersInput, ...request.Option) (*elb.DeleteLoadBalancerListenersOutput, error)
|
||||
DeleteLoadBalancerListenersRequest(*elb.DeleteLoadBalancerListenersInput) (*request.Request, *elb.DeleteLoadBalancerListenersOutput)
|
||||
|
||||
DeleteLoadBalancerPolicy(*elb.DeleteLoadBalancerPolicyInput) (*elb.DeleteLoadBalancerPolicyOutput, error)
|
||||
DeleteLoadBalancerPolicyWithContext(aws.Context, *elb.DeleteLoadBalancerPolicyInput, ...request.Option) (*elb.DeleteLoadBalancerPolicyOutput, error)
|
||||
DeleteLoadBalancerPolicyRequest(*elb.DeleteLoadBalancerPolicyInput) (*request.Request, *elb.DeleteLoadBalancerPolicyOutput)
|
||||
|
||||
DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error)
|
||||
DeregisterInstancesFromLoadBalancerWithContext(aws.Context, *elb.DeregisterInstancesFromLoadBalancerInput, ...request.Option) (*elb.DeregisterInstancesFromLoadBalancerOutput, error)
|
||||
DeregisterInstancesFromLoadBalancerRequest(*elb.DeregisterInstancesFromLoadBalancerInput) (*request.Request, *elb.DeregisterInstancesFromLoadBalancerOutput)
|
||||
|
||||
DescribeInstanceHealth(*elb.DescribeInstanceHealthInput) (*elb.DescribeInstanceHealthOutput, error)
|
||||
DescribeInstanceHealthWithContext(aws.Context, *elb.DescribeInstanceHealthInput, ...request.Option) (*elb.DescribeInstanceHealthOutput, error)
|
||||
DescribeInstanceHealthRequest(*elb.DescribeInstanceHealthInput) (*request.Request, *elb.DescribeInstanceHealthOutput)
|
||||
|
||||
DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error)
|
||||
DescribeLoadBalancerAttributesWithContext(aws.Context, *elb.DescribeLoadBalancerAttributesInput, ...request.Option) (*elb.DescribeLoadBalancerAttributesOutput, error)
|
||||
DescribeLoadBalancerAttributesRequest(*elb.DescribeLoadBalancerAttributesInput) (*request.Request, *elb.DescribeLoadBalancerAttributesOutput)
|
||||
|
||||
DescribeLoadBalancerPolicies(*elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error)
|
||||
DescribeLoadBalancerPoliciesWithContext(aws.Context, *elb.DescribeLoadBalancerPoliciesInput, ...request.Option) (*elb.DescribeLoadBalancerPoliciesOutput, error)
|
||||
DescribeLoadBalancerPoliciesRequest(*elb.DescribeLoadBalancerPoliciesInput) (*request.Request, *elb.DescribeLoadBalancerPoliciesOutput)
|
||||
|
||||
DescribeLoadBalancerPolicyTypes(*elb.DescribeLoadBalancerPolicyTypesInput) (*elb.DescribeLoadBalancerPolicyTypesOutput, error)
|
||||
DescribeLoadBalancerPolicyTypesWithContext(aws.Context, *elb.DescribeLoadBalancerPolicyTypesInput, ...request.Option) (*elb.DescribeLoadBalancerPolicyTypesOutput, error)
|
||||
DescribeLoadBalancerPolicyTypesRequest(*elb.DescribeLoadBalancerPolicyTypesInput) (*request.Request, *elb.DescribeLoadBalancerPolicyTypesOutput)
|
||||
|
||||
DescribeLoadBalancers(*elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error)
|
||||
DescribeLoadBalancersWithContext(aws.Context, *elb.DescribeLoadBalancersInput, ...request.Option) (*elb.DescribeLoadBalancersOutput, error)
|
||||
DescribeLoadBalancersRequest(*elb.DescribeLoadBalancersInput) (*request.Request, *elb.DescribeLoadBalancersOutput)
|
||||
|
||||
DescribeLoadBalancersPages(*elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool) error
|
||||
DescribeLoadBalancersPagesWithContext(aws.Context, *elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeTags(*elb.DescribeTagsInput) (*elb.DescribeTagsOutput, error)
|
||||
DescribeTagsWithContext(aws.Context, *elb.DescribeTagsInput, ...request.Option) (*elb.DescribeTagsOutput, error)
|
||||
DescribeTagsRequest(*elb.DescribeTagsInput) (*request.Request, *elb.DescribeTagsOutput)
|
||||
|
||||
DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error)
|
||||
DetachLoadBalancerFromSubnetsWithContext(aws.Context, *elb.DetachLoadBalancerFromSubnetsInput, ...request.Option) (*elb.DetachLoadBalancerFromSubnetsOutput, error)
|
||||
DetachLoadBalancerFromSubnetsRequest(*elb.DetachLoadBalancerFromSubnetsInput) (*request.Request, *elb.DetachLoadBalancerFromSubnetsOutput)
|
||||
|
||||
DisableAvailabilityZonesForLoadBalancer(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*elb.DisableAvailabilityZonesForLoadBalancerOutput, error)
|
||||
DisableAvailabilityZonesForLoadBalancerWithContext(aws.Context, *elb.DisableAvailabilityZonesForLoadBalancerInput, ...request.Option) (*elb.DisableAvailabilityZonesForLoadBalancerOutput, error)
|
||||
DisableAvailabilityZonesForLoadBalancerRequest(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.DisableAvailabilityZonesForLoadBalancerOutput)
|
||||
|
||||
EnableAvailabilityZonesForLoadBalancer(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*elb.EnableAvailabilityZonesForLoadBalancerOutput, error)
|
||||
EnableAvailabilityZonesForLoadBalancerWithContext(aws.Context, *elb.EnableAvailabilityZonesForLoadBalancerInput, ...request.Option) (*elb.EnableAvailabilityZonesForLoadBalancerOutput, error)
|
||||
EnableAvailabilityZonesForLoadBalancerRequest(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.EnableAvailabilityZonesForLoadBalancerOutput)
|
||||
|
||||
ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error)
|
||||
ModifyLoadBalancerAttributesWithContext(aws.Context, *elb.ModifyLoadBalancerAttributesInput, ...request.Option) (*elb.ModifyLoadBalancerAttributesOutput, error)
|
||||
ModifyLoadBalancerAttributesRequest(*elb.ModifyLoadBalancerAttributesInput) (*request.Request, *elb.ModifyLoadBalancerAttributesOutput)
|
||||
|
||||
RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error)
|
||||
RegisterInstancesWithLoadBalancerWithContext(aws.Context, *elb.RegisterInstancesWithLoadBalancerInput, ...request.Option) (*elb.RegisterInstancesWithLoadBalancerOutput, error)
|
||||
RegisterInstancesWithLoadBalancerRequest(*elb.RegisterInstancesWithLoadBalancerInput) (*request.Request, *elb.RegisterInstancesWithLoadBalancerOutput)
|
||||
|
||||
RemoveTags(*elb.RemoveTagsInput) (*elb.RemoveTagsOutput, error)
|
||||
RemoveTagsWithContext(aws.Context, *elb.RemoveTagsInput, ...request.Option) (*elb.RemoveTagsOutput, error)
|
||||
RemoveTagsRequest(*elb.RemoveTagsInput) (*request.Request, *elb.RemoveTagsOutput)
|
||||
|
||||
SetLoadBalancerListenerSSLCertificate(*elb.SetLoadBalancerListenerSSLCertificateInput) (*elb.SetLoadBalancerListenerSSLCertificateOutput, error)
|
||||
SetLoadBalancerListenerSSLCertificateWithContext(aws.Context, *elb.SetLoadBalancerListenerSSLCertificateInput, ...request.Option) (*elb.SetLoadBalancerListenerSSLCertificateOutput, error)
|
||||
SetLoadBalancerListenerSSLCertificateRequest(*elb.SetLoadBalancerListenerSSLCertificateInput) (*request.Request, *elb.SetLoadBalancerListenerSSLCertificateOutput)
|
||||
|
||||
SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error)
|
||||
SetLoadBalancerPoliciesForBackendServerWithContext(aws.Context, *elb.SetLoadBalancerPoliciesForBackendServerInput, ...request.Option) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error)
|
||||
SetLoadBalancerPoliciesForBackendServerRequest(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*request.Request, *elb.SetLoadBalancerPoliciesForBackendServerOutput)
|
||||
|
||||
SetLoadBalancerPoliciesOfListener(*elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error)
|
||||
SetLoadBalancerPoliciesOfListenerWithContext(aws.Context, *elb.SetLoadBalancerPoliciesOfListenerInput, ...request.Option) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error)
|
||||
SetLoadBalancerPoliciesOfListenerRequest(*elb.SetLoadBalancerPoliciesOfListenerInput) (*request.Request, *elb.SetLoadBalancerPoliciesOfListenerOutput)
|
||||
|
||||
WaitUntilAnyInstanceInService(*elb.DescribeInstanceHealthInput) error
|
||||
WaitUntilAnyInstanceInServiceWithContext(aws.Context, *elb.DescribeInstanceHealthInput, ...request.WaiterOption) error
|
||||
|
||||
WaitUntilInstanceDeregistered(*elb.DescribeInstanceHealthInput) error
|
||||
WaitUntilInstanceDeregisteredWithContext(aws.Context, *elb.DescribeInstanceHealthInput, ...request.WaiterOption) error
|
||||
|
||||
WaitUntilInstanceInService(*elb.DescribeInstanceHealthInput) error
|
||||
WaitUntilInstanceInServiceWithContext(aws.Context, *elb.DescribeInstanceHealthInput, ...request.WaiterOption) error
|
||||
}
|
||||
|
||||
var _ ELBAPI = (*elb.ELB)(nil)
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package elb
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeAccessPointNotFoundException for service response error code
|
||||
// "LoadBalancerNotFound".
|
||||
//
|
||||
// The specified load balancer does not exist.
|
||||
ErrCodeAccessPointNotFoundException = "LoadBalancerNotFound"
|
||||
|
||||
// ErrCodeCertificateNotFoundException for service response error code
|
||||
// "CertificateNotFound".
|
||||
//
|
||||
// The specified ARN does not refer to a valid SSL certificate in AWS Identity
|
||||
// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if
|
||||
// you recently uploaded the certificate to IAM, this error might indicate that
|
||||
// the certificate is not fully available yet.
|
||||
ErrCodeCertificateNotFoundException = "CertificateNotFound"
|
||||
|
||||
// ErrCodeDependencyThrottleException for service response error code
|
||||
// "DependencyThrottle".
|
||||
ErrCodeDependencyThrottleException = "DependencyThrottle"
|
||||
|
||||
// ErrCodeDuplicateAccessPointNameException for service response error code
|
||||
// "DuplicateLoadBalancerName".
|
||||
//
|
||||
// The specified load balancer name already exists for this account.
|
||||
ErrCodeDuplicateAccessPointNameException = "DuplicateLoadBalancerName"
|
||||
|
||||
// ErrCodeDuplicateListenerException for service response error code
|
||||
// "DuplicateListener".
|
||||
//
|
||||
// A listener already exists for the specified load balancer name and port,
|
||||
// but with a different instance port, protocol, or SSL certificate.
|
||||
ErrCodeDuplicateListenerException = "DuplicateListener"
|
||||
|
||||
// ErrCodeDuplicatePolicyNameException for service response error code
|
||||
// "DuplicatePolicyName".
|
||||
//
|
||||
// A policy with the specified name already exists for this load balancer.
|
||||
ErrCodeDuplicatePolicyNameException = "DuplicatePolicyName"
|
||||
|
||||
// ErrCodeDuplicateTagKeysException for service response error code
|
||||
// "DuplicateTagKeys".
|
||||
//
|
||||
// A tag key was specified more than once.
|
||||
ErrCodeDuplicateTagKeysException = "DuplicateTagKeys"
|
||||
|
||||
// ErrCodeInvalidConfigurationRequestException for service response error code
|
||||
// "InvalidConfigurationRequest".
|
||||
//
|
||||
// The requested configuration change is not valid.
|
||||
ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest"
|
||||
|
||||
// ErrCodeInvalidEndPointException for service response error code
|
||||
// "InvalidInstance".
|
||||
//
|
||||
// The specified endpoint is not valid.
|
||||
ErrCodeInvalidEndPointException = "InvalidInstance"
|
||||
|
||||
// ErrCodeInvalidSchemeException for service response error code
|
||||
// "InvalidScheme".
|
||||
//
|
||||
// The specified value for the schema is not valid. You can only specify a scheme
|
||||
// for load balancers in a VPC.
|
||||
ErrCodeInvalidSchemeException = "InvalidScheme"
|
||||
|
||||
// ErrCodeInvalidSecurityGroupException for service response error code
|
||||
// "InvalidSecurityGroup".
|
||||
//
|
||||
// One or more of the specified security groups do not exist.
|
||||
ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup"
|
||||
|
||||
// ErrCodeInvalidSubnetException for service response error code
|
||||
// "InvalidSubnet".
|
||||
//
|
||||
// The specified VPC has no associated Internet gateway.
|
||||
ErrCodeInvalidSubnetException = "InvalidSubnet"
|
||||
|
||||
// ErrCodeListenerNotFoundException for service response error code
|
||||
// "ListenerNotFound".
|
||||
//
|
||||
// The load balancer does not have a listener configured at the specified port.
|
||||
ErrCodeListenerNotFoundException = "ListenerNotFound"
|
||||
|
||||
// ErrCodeLoadBalancerAttributeNotFoundException for service response error code
|
||||
// "LoadBalancerAttributeNotFound".
|
||||
//
|
||||
// The specified load balancer attribute does not exist.
|
||||
ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound"
|
||||
|
||||
// ErrCodePolicyNotFoundException for service response error code
|
||||
// "PolicyNotFound".
|
||||
//
|
||||
// One or more of the specified policies do not exist.
|
||||
ErrCodePolicyNotFoundException = "PolicyNotFound"
|
||||
|
||||
// ErrCodePolicyTypeNotFoundException for service response error code
|
||||
// "PolicyTypeNotFound".
|
||||
//
|
||||
// One or more of the specified policy types do not exist.
|
||||
ErrCodePolicyTypeNotFoundException = "PolicyTypeNotFound"
|
||||
|
||||
// ErrCodeSubnetNotFoundException for service response error code
|
||||
// "SubnetNotFound".
|
||||
//
|
||||
// One or more of the specified subnets do not exist.
|
||||
ErrCodeSubnetNotFoundException = "SubnetNotFound"
|
||||
|
||||
// ErrCodeTooManyAccessPointsException for service response error code
|
||||
// "TooManyLoadBalancers".
|
||||
//
|
||||
// The quota for the number of load balancers has been reached.
|
||||
ErrCodeTooManyAccessPointsException = "TooManyLoadBalancers"
|
||||
|
||||
// ErrCodeTooManyPoliciesException for service response error code
|
||||
// "TooManyPolicies".
|
||||
//
|
||||
// The quota for the number of policies for this load balancer has been reached.
|
||||
ErrCodeTooManyPoliciesException = "TooManyPolicies"
|
||||
|
||||
// ErrCodeTooManyTagsException for service response error code
|
||||
// "TooManyTags".
|
||||
//
|
||||
// The quota for the number of tags that can be assigned to a load balancer
|
||||
// has been reached.
|
||||
ErrCodeTooManyTagsException = "TooManyTags"
|
||||
|
||||
// ErrCodeUnsupportedProtocolException for service response error code
|
||||
// "UnsupportedProtocol".
|
||||
ErrCodeUnsupportedProtocolException = "UnsupportedProtocol"
|
||||
)
|
||||
+778
@@ -0,0 +1,778 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package elb_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/elb"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleELB_AddTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.AddTagsInput{
|
||||
LoadBalancerNames: []*string{ // Required
|
||||
aws.String("AccessPointName"), // Required
|
||||
// More values...
|
||||
},
|
||||
Tags: []*elb.Tag{ // Required
|
||||
{ // Required
|
||||
Key: aws.String("TagKey"), // Required
|
||||
Value: aws.String("TagValue"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.AddTags(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_ApplySecurityGroupsToLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.ApplySecurityGroupsToLoadBalancerInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
SecurityGroups: []*string{ // Required
|
||||
aws.String("SecurityGroupId"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.ApplySecurityGroupsToLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_AttachLoadBalancerToSubnets() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.AttachLoadBalancerToSubnetsInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
Subnets: []*string{ // Required
|
||||
aws.String("SubnetId"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.AttachLoadBalancerToSubnets(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_ConfigureHealthCheck() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.ConfigureHealthCheckInput{
|
||||
HealthCheck: &elb.HealthCheck{ // Required
|
||||
HealthyThreshold: aws.Int64(1), // Required
|
||||
Interval: aws.Int64(1), // Required
|
||||
Target: aws.String("HealthCheckTarget"), // Required
|
||||
Timeout: aws.Int64(1), // Required
|
||||
UnhealthyThreshold: aws.Int64(1), // Required
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.ConfigureHealthCheck(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_CreateAppCookieStickinessPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.CreateAppCookieStickinessPolicyInput{
|
||||
CookieName: aws.String("CookieName"), // Required
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
PolicyName: aws.String("PolicyName"), // Required
|
||||
}
|
||||
resp, err := svc.CreateAppCookieStickinessPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_CreateLBCookieStickinessPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.CreateLBCookieStickinessPolicyInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
PolicyName: aws.String("PolicyName"), // Required
|
||||
CookieExpirationPeriod: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.CreateLBCookieStickinessPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_CreateLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.CreateLoadBalancerInput{
|
||||
Listeners: []*elb.Listener{ // Required
|
||||
{ // Required
|
||||
InstancePort: aws.Int64(1), // Required
|
||||
LoadBalancerPort: aws.Int64(1), // Required
|
||||
Protocol: aws.String("Protocol"), // Required
|
||||
InstanceProtocol: aws.String("Protocol"),
|
||||
SSLCertificateId: aws.String("SSLCertificateId"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
AvailabilityZones: []*string{
|
||||
aws.String("AvailabilityZone"), // Required
|
||||
// More values...
|
||||
},
|
||||
Scheme: aws.String("LoadBalancerScheme"),
|
||||
SecurityGroups: []*string{
|
||||
aws.String("SecurityGroupId"), // Required
|
||||
// More values...
|
||||
},
|
||||
Subnets: []*string{
|
||||
aws.String("SubnetId"), // Required
|
||||
// More values...
|
||||
},
|
||||
Tags: []*elb.Tag{
|
||||
{ // Required
|
||||
Key: aws.String("TagKey"), // Required
|
||||
Value: aws.String("TagValue"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_CreateLoadBalancerListeners() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.CreateLoadBalancerListenersInput{
|
||||
Listeners: []*elb.Listener{ // Required
|
||||
{ // Required
|
||||
InstancePort: aws.Int64(1), // Required
|
||||
LoadBalancerPort: aws.Int64(1), // Required
|
||||
Protocol: aws.String("Protocol"), // Required
|
||||
InstanceProtocol: aws.String("Protocol"),
|
||||
SSLCertificateId: aws.String("SSLCertificateId"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.CreateLoadBalancerListeners(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_CreateLoadBalancerPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.CreateLoadBalancerPolicyInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
PolicyName: aws.String("PolicyName"), // Required
|
||||
PolicyTypeName: aws.String("PolicyTypeName"), // Required
|
||||
PolicyAttributes: []*elb.PolicyAttribute{
|
||||
{ // Required
|
||||
AttributeName: aws.String("AttributeName"),
|
||||
AttributeValue: aws.String("AttributeValue"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateLoadBalancerPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DeleteLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DeleteLoadBalancerInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DeleteLoadBalancerListeners() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DeleteLoadBalancerListenersInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
LoadBalancerPorts: []*int64{ // Required
|
||||
aws.Int64(1), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DeleteLoadBalancerListeners(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DeleteLoadBalancerPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DeleteLoadBalancerPolicyInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
PolicyName: aws.String("PolicyName"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteLoadBalancerPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DeregisterInstancesFromLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DeregisterInstancesFromLoadBalancerInput{
|
||||
Instances: []*elb.Instance{ // Required
|
||||
{ // Required
|
||||
InstanceId: aws.String("InstanceId"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.DeregisterInstancesFromLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeInstanceHealth() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeInstanceHealthInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
Instances: []*elb.Instance{
|
||||
{ // Required
|
||||
InstanceId: aws.String("InstanceId"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DescribeInstanceHealth(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeLoadBalancerAttributes() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeLoadBalancerAttributesInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeLoadBalancerAttributes(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeLoadBalancerPolicies() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeLoadBalancerPoliciesInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"),
|
||||
PolicyNames: []*string{
|
||||
aws.String("PolicyName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DescribeLoadBalancerPolicies(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeLoadBalancerPolicyTypes() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeLoadBalancerPolicyTypesInput{
|
||||
PolicyTypeNames: []*string{
|
||||
aws.String("PolicyTypeName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DescribeLoadBalancerPolicyTypes(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeLoadBalancers() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeLoadBalancersInput{
|
||||
LoadBalancerNames: []*string{
|
||||
aws.String("AccessPointName"), // Required
|
||||
// More values...
|
||||
},
|
||||
Marker: aws.String("Marker"),
|
||||
PageSize: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.DescribeLoadBalancers(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DescribeTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DescribeTagsInput{
|
||||
LoadBalancerNames: []*string{ // Required
|
||||
aws.String("AccessPointName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DescribeTags(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DetachLoadBalancerFromSubnets() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DetachLoadBalancerFromSubnetsInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
Subnets: []*string{ // Required
|
||||
aws.String("SubnetId"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.DetachLoadBalancerFromSubnets(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_DisableAvailabilityZonesForLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.DisableAvailabilityZonesForLoadBalancerInput{
|
||||
AvailabilityZones: []*string{ // Required
|
||||
aws.String("AvailabilityZone"), // Required
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.DisableAvailabilityZonesForLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_EnableAvailabilityZonesForLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.EnableAvailabilityZonesForLoadBalancerInput{
|
||||
AvailabilityZones: []*string{ // Required
|
||||
aws.String("AvailabilityZone"), // Required
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.EnableAvailabilityZonesForLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_ModifyLoadBalancerAttributes() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.ModifyLoadBalancerAttributesInput{
|
||||
LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required
|
||||
AccessLog: &elb.AccessLog{
|
||||
Enabled: aws.Bool(true), // Required
|
||||
EmitInterval: aws.Int64(1),
|
||||
S3BucketName: aws.String("S3BucketName"),
|
||||
S3BucketPrefix: aws.String("AccessLogPrefix"),
|
||||
},
|
||||
AdditionalAttributes: []*elb.AdditionalAttribute{
|
||||
{ // Required
|
||||
Key: aws.String("AdditionalAttributeKey"),
|
||||
Value: aws.String("AdditionalAttributeValue"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
ConnectionDraining: &elb.ConnectionDraining{
|
||||
Enabled: aws.Bool(true), // Required
|
||||
Timeout: aws.Int64(1),
|
||||
},
|
||||
ConnectionSettings: &elb.ConnectionSettings{
|
||||
IdleTimeout: aws.Int64(1), // Required
|
||||
},
|
||||
CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{
|
||||
Enabled: aws.Bool(true), // Required
|
||||
},
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.ModifyLoadBalancerAttributes(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_RegisterInstancesWithLoadBalancer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.RegisterInstancesWithLoadBalancerInput{
|
||||
Instances: []*elb.Instance{ // Required
|
||||
{ // Required
|
||||
InstanceId: aws.String("InstanceId"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
}
|
||||
resp, err := svc.RegisterInstancesWithLoadBalancer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_RemoveTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.RemoveTagsInput{
|
||||
LoadBalancerNames: []*string{ // Required
|
||||
aws.String("AccessPointName"), // Required
|
||||
// More values...
|
||||
},
|
||||
Tags: []*elb.TagKeyOnly{ // Required
|
||||
{ // Required
|
||||
Key: aws.String("TagKey"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.RemoveTags(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_SetLoadBalancerListenerSSLCertificate() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.SetLoadBalancerListenerSSLCertificateInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
LoadBalancerPort: aws.Int64(1), // Required
|
||||
SSLCertificateId: aws.String("SSLCertificateId"), // Required
|
||||
}
|
||||
resp, err := svc.SetLoadBalancerListenerSSLCertificate(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_SetLoadBalancerPoliciesForBackendServer() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.SetLoadBalancerPoliciesForBackendServerInput{
|
||||
InstancePort: aws.Int64(1), // Required
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
PolicyNames: []*string{ // Required
|
||||
aws.String("PolicyName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.SetLoadBalancerPoliciesForBackendServer(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleELB_SetLoadBalancerPoliciesOfListener() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := elb.New(sess)
|
||||
|
||||
params := &elb.SetLoadBalancerPoliciesOfListenerInput{
|
||||
LoadBalancerName: aws.String("AccessPointName"), // Required
|
||||
LoadBalancerPort: aws.Int64(1), // Required
|
||||
PolicyNames: []*string{ // Required
|
||||
aws.String("PolicyName"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.SetLoadBalancerPoliciesOfListener(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package elb
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// A load balancer distributes incoming traffic across your EC2 instances. This
|
||||
// enables you to increase the availability of your application. The load balancer
|
||||
// also monitors the health of its registered instances and ensures that it
|
||||
// routes traffic only to healthy instances. You configure your load balancer
|
||||
// to accept incoming traffic by specifying one or more listeners, which are
|
||||
// configured with a protocol and port number for connections from clients to
|
||||
// the load balancer and a protocol and port number for connections from the
|
||||
// load balancer to the instances.
|
||||
//
|
||||
// Elastic Load Balancing supports two types of load balancers: Classic load
|
||||
// balancers and Application load balancers (new). A Classic load balancer makes
|
||||
// routing and load balancing decisions either at the transport layer (TCP/SSL)
|
||||
// or the application layer (HTTP/HTTPS), and supports either EC2-Classic or
|
||||
// a VPC. An Application load balancer makes routing and load balancing decisions
|
||||
// at the application layer (HTTP/HTTPS), supports path-based routing, and can
|
||||
// route requests to one or more ports on each EC2 instance or container instance
|
||||
// in your virtual private cloud (VPC). For more information, see the .
|
||||
//
|
||||
// This reference covers the 2012-06-01 API, which supports Classic load balancers.
|
||||
// The 2015-12-01 API supports Application load balancers.
|
||||
//
|
||||
// To get started, create a load balancer with one or more listeners using CreateLoadBalancer.
|
||||
// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer.
|
||||
//
|
||||
// All Elastic Load Balancing operations are idempotent, which means that they
|
||||
// complete at most one time. If you repeat an operation, it succeeds with a
|
||||
// 200 OK response code.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01
|
||||
type ELB struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "elasticloadbalancing" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ELB client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a ELB client from just a session.
|
||||
// svc := elb.New(mySession)
|
||||
//
|
||||
// // Create a ELB client with additional configuration
|
||||
// svc := elb.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELB {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ELB {
|
||||
svc := &ELB{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2012-06-01",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a ELB operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ELB) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package elb
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilAnyInstanceInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilAnyInstanceInServiceWithContext is an extended version of WaitUntilAnyInstanceInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilAnyInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilAnyInstanceInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAnyWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "InService",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
req, _ := c.DescribeInstanceHealthRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilInstanceDeregisteredWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceDeregisteredWithContext is an extended version of WaitUntilInstanceDeregistered.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilInstanceDeregisteredWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilInstanceDeregistered",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "OutOfService",
|
||||
},
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "InvalidInstance",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
req, _ := c.DescribeInstanceHealthRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceInService uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not meet within the max attempt window an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilInstanceInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceInServiceWithContext is an extended version of WaitUntilInstanceInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilInstanceInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "InService",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
req, _ := c.DescribeInstanceHealthRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user