From 7cdf57301519101ab6adbe1543dd37305b6c4a6e Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Wed, 3 Jun 2015 22:54:59 -0700 Subject: [PATCH 1/3] Update aws-sdk-go dependency from awslabs to aws. --- pkg/cloudprovider/aws/aws.go | 13 +++++++------ pkg/cloudprovider/aws/aws_test.go | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index 4d311faeb1..a68cc548d0 100644 --- a/pkg/cloudprovider/aws/aws.go +++ b/pkg/cloudprovider/aws/aws.go @@ -30,10 +30,11 @@ import ( "time" "code.google.com/p/gcfg" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/aws/credentials" - "github.com/awslabs/aws-sdk-go/service/ec2" - "github.com/awslabs/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/elb" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource" @@ -1294,8 +1295,8 @@ func (s *AWSCloud) describeLoadBalancer(region, name string) (*elb.LoadBalancerD response, err := elbClient.DescribeLoadBalancers(request) if err != nil { - if awsError := aws.Error(err); awsError != nil { - if awsError.Code == "LoadBalancerNotFound" { + if awsError := err.(awserr.Error); awsError != nil { + if awsError.Code() == "LoadBalancerNotFound" { return nil, nil } } diff --git a/pkg/cloudprovider/aws/aws_test.go b/pkg/cloudprovider/aws/aws_test.go index 35ef5b4d7a..7b3ccd6266 100644 --- a/pkg/cloudprovider/aws/aws_test.go +++ b/pkg/cloudprovider/aws/aws_test.go @@ -22,9 +22,9 @@ import ( "strings" "testing" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/service/ec2" - "github.com/awslabs/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/elb" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource" From 05d6294b1ea9575565d4c0ccb271fe77c1e22973 Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Wed, 3 Jun 2015 22:55:12 -0700 Subject: [PATCH 2/3] Update Godeps. --- Godeps/Godeps.json | 50 +- .../aws/aws-sdk-go/aws/awserr/error.go | 88 + .../aws/aws-sdk-go/aws/awsutil/copy.go | 95 + .../aws-sdk-go/aws/awsutil/copy_test.go | 65 +- .../aws-sdk-go/aws/awsutil/path_value.go | 43 +- .../aws-sdk-go/aws/awsutil/path_value_test.go | 13 +- .../aws-sdk-go/aws/awsutil/string_value.go | 2 +- .../{awslabs => aws}/aws-sdk-go/aws/config.go | 9 +- .../aws/credentials/chain_provider.go | 4 +- .../aws/credentials/chain_provider_test.go | 15 +- .../aws-sdk-go/aws/credentials/credentials.go | 0 .../aws/credentials/credentials_test.go | 10 +- .../aws/credentials/ec2_role_provider.go | 16 +- .../aws/credentials/ec2_role_provider_test.go | 0 .../aws/credentials/env_provider.go | 7 +- .../aws/credentials/env_provider_test.go | 4 +- .../aws-sdk-go/aws/credentials/example.ini | 0 .../shared_credentials_provider.go | 14 +- .../shared_credentials_provider_test.go | 0 .../aws/credentials/static_provider.go | 4 +- .../aws/credentials/static_provider_test.go | 0 .../aws-sdk-go/aws/handler_functions.go | 43 +- .../aws-sdk-go/aws/handler_functions_test.go | 7 +- .../aws-sdk-go/aws/handlers.go | 0 .../aws-sdk-go/aws/handlers_test.go | 0 .../aws-sdk-go/aws/param_validator.go | 6 +- .../aws-sdk-go/aws/param_validator_test.go | 27 +- .../aws-sdk-go/aws/request.go | 101 +- .../aws-sdk-go/aws/request_pagination_test.go | 305 + .../aws-sdk-go/aws/request_test.go | 58 +- .../aws-sdk-go/aws/service.go | 37 +- .../{awslabs => aws}/aws-sdk-go/aws/types.go | 0 .../aws-sdk-go/aws/version.go | 2 +- .../aws/aws-sdk-go/internal/apierr/error.go | 139 + .../internal/endpoints/endpoints.go | 1 + .../internal/endpoints/endpoints.json | 0 .../internal/endpoints/endpoints_map.go | 0 .../internal/endpoints/endpoints_test.go | 0 .../internal/protocol/ec2query/build.go | 9 +- .../internal/protocol/ec2query/build_test.go | 102 +- .../internal/protocol/ec2query/unmarshal.go | 19 +- .../protocol/ec2query/unmarshal_test.go | 120 +- .../internal/protocol/query/build.go | 8 +- .../internal/protocol/query/build_test.go | 183 +- .../protocol/query/queryutil/queryutil.go | 0 .../internal/protocol/query/unmarshal.go | 7 +- .../protocol/query/unmarshal_error.go | 15 +- .../internal/protocol/query/unmarshal_test.go | 190 +- .../internal/protocol/rest/build.go | 212 + .../internal/protocol/rest/payload.go | 45 + .../internal/protocol/rest/unmarshal.go | 174 + .../internal/protocol/xml/xmlutil/build.go | 1 + .../protocol/xml/xmlutil/unmarshal.go | 11 +- .../protocol/xml/xmlutil/xml_to_struct.go | 0 .../internal/signer/v4/functional_test.go | 8 +- .../aws-sdk-go/internal/signer/v4/v4.go | 10 +- .../aws-sdk-go/internal/signer/v4/v4_test.go | 8 +- .../aws-sdk-go/service/ec2/api.go | 3960 +++++++--- .../aws-sdk-go/service/ec2/customizations.go | 4 +- .../service/ec2/customizations_test.go | 8 +- .../service/ec2/ec2iface/interface.go | 34 +- .../service/ec2/ec2iface/interface_test.go | 15 + .../aws-sdk-go/service/ec2/examples_test.go | 6511 +++++++++++++++++ .../aws-sdk-go/service/ec2/service.go | 14 +- .../aws-sdk-go/service/elb/api.go | 211 +- .../service/elb/elbiface/interface.go | 6 +- .../service/elb/elbiface/interface_test.go | 15 + .../aws-sdk-go/service/elb/examples_test.go | 947 +++ .../aws-sdk-go/service/elb/service.go | 12 +- .../awslabs/aws-sdk-go/aws/awsutil/copy.go | 69 - .../awslabs/aws-sdk-go/aws/error.go | 26 - .../aws-sdk-go/service/ec2/examples_test.go | 4774 ------------ .../service/ec2/integration_test.go | 45 - .../aws-sdk-go/service/elb/examples_test.go | 748 -- 74 files changed, 12320 insertions(+), 7366 deletions(-) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/awsutil/copy_test.go (63%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/awsutil/path_value.go (71%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/awsutil/path_value_test.go (87%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/awsutil/string_value.go (95%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/config.go (96%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/chain_provider.go (94%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/chain_provider_test.go (78%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/credentials.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/credentials_test.go (82%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/ec2_role_provider.go (89%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/ec2_role_provider_test.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/env_provider.go (83%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/env_provider_test.go (95%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/example.ini (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/shared_credentials_provider.go (84%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/static_provider.go (87%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/credentials/static_provider_test.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/handler_functions.go (73%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/handler_functions_test.go (90%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/handlers.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/handlers_test.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/param_validator.go (93%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/param_validator_test.go (73%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/request.go (65%) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/request_test.go (83%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/service.go (80%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/types.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/aws/version.go (88%) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/endpoints/endpoints.go (92%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/endpoints/endpoints.json (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/endpoints/endpoints_map.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/endpoints/endpoints_test.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/ec2query/build.go (70%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/ec2query/build_test.go (93%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/ec2query/unmarshal.go (71%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go (93%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/build.go (71%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/build_test.go (92%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/queryutil/queryutil.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/unmarshal.go (74%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/unmarshal_error.go (63%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/query/unmarshal_test.go (94%) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/payload.go create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/xml/xmlutil/build.go (98%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go (97%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/protocol/xml/xmlutil/xml_to_struct.go (100%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/signer/v4/functional_test.go (87%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/signer/v4/v4.go (96%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/internal/signer/v4/v4_test.go (94%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/ec2/api.go (80%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/ec2/customizations.go (94%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/ec2/customizations_test.go (83%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/ec2/ec2iface/interface.go (90%) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/ec2/service.go (84%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/elb/api.go (95%) rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/elb/elbiface/interface.go (93%) create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface_test.go create mode 100644 Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go rename Godeps/_workspace/src/github.com/{awslabs => aws}/aws-sdk-go/service/elb/service.go (86%) delete mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy.go delete mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/error.go delete mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/examples_test.go delete mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/integration_test.go delete mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/examples_test.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index cd01be6ba5..cfc31c06cb 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -49,36 +49,54 @@ "Rev": "87808a37061a4a2e6204ccea5fd2fc930576db94" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/aws", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/aws", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/internal/endpoints", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/apierr", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/internal/protocol/ec2query", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/endpoints", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/internal/protocol/query", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/ec2query", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/query", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/internal/signer/v4", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/rest", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/service/ec2", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { - "ImportPath": "github.com/awslabs/aws-sdk-go/service/elb", - "Rev": "c0a38f106248742920a2b786dcae81457af003d3" + "ImportPath": "github.com/aws/aws-sdk-go/internal/signer/v4", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/service/elb", + "Comment": "v0.6.0-7-gcea3a42", + "Rev": "cea3a425fc2d887d102e406ec2f8b37a57abd82f" }, { "ImportPath": "github.com/beorn7/perks/quantile", diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go new file mode 100644 index 0000000000..cf54d89d1e --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/error.go @@ -0,0 +1,88 @@ +// Package awserr represents API error interface accessors for the SDK. +package awserr + +// An Error wraps lower level errors with code, message and an original error. +// The underlying concrete error type may also satisfy other interfaces which +// can be to used to obtain more specific information about the error. +// +// Calling Error() or String() will always include the full information about +// an error based on its underlying type. +// +// Example: +// +// output, err := s3manage.Upload(svc, input, opts) +// if err != nil { +// if awsErr, ok := err.(awserr.Error); ok { +// // Get error details +// log.Println("Error:", err.Code(), err.Message()) +// +// Prints out full error message, including original error if there was one. +// log.Println("Error:", err.Error()) +// +// // Get original error +// if origErr := err.Err(); origErr != nil { +// // operate on original error. +// } +// } else { +// fmt.Println(err.Error()) +// } +// } +// +type Error interface { + // Satisfy the generic error interface. + error + + // Returns the short phrase depicting the classification of the error. + Code() string + + // Returns the error details message. + Message() string + + // Returns the original error if one was set. Nil is returned if not set. + OrigErr() error +} + +// A RequestFailure is an interface to extract request failure information from +// an Error such as the request ID of the failed request returned by a service. +// RequestFailures may not always have a requestID value if the request failed +// prior to reaching the service such as a connection error. +// +// Example: +// +// output, err := s3manage.Upload(svc, input, opts) +// if err != nil { +// if reqerr, ok := err.(RequestFailure); ok { +// log.Printf("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID()) +// } else { +// log.Printf("Error:", err.Error() +// } +// } +// +// Combined with awserr.Error: +// +// output, err := s3manage.Upload(svc, input, opts) +// if err != nil { +// if awsErr, ok := err.(awserr.Error); ok { +// // Generic AWS Error with Code, Message, and original error (if any) +// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) +// +// if reqErr, ok := err.(awserr.RequestFailure); ok { +// // A service error occurred +// fmt.Println(reqErr.StatusCode(), reqErr.RequestID()) +// } +// } else { +// fmt.Println(err.Error()) +// } +// } +// +type RequestFailure interface { + Error + + // The status code of the HTTP response. + StatusCode() int + + // The request ID returned by the service for a request failure. This will + // be empty if no request ID is available such as the request failed due + // to a connection error. + RequestID() string +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go new file mode 100644 index 0000000000..99a11567f5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy.go @@ -0,0 +1,95 @@ +package awsutil + +import ( + "io" + "reflect" +) + +// Copy deeply copies a src structure to dst. Useful for copying request and +// response structures. +// +// Can copy between structs of different type, but will only copy fields which +// are assignable, and exist in both structs. Fields which are not assignable, +// or do not exist in both structs are ignored. +func Copy(dst, src interface{}) { + dstval := reflect.ValueOf(dst) + if !dstval.IsValid() { + panic("Copy dst cannot be nil") + } + + rcopy(dstval, reflect.ValueOf(src), true) +} + +// CopyOf returns a copy of src while also allocating the memory for dst. +// src must be a pointer type or this operation will fail. +func CopyOf(src interface{}) (dst interface{}) { + dsti := reflect.New(reflect.TypeOf(src).Elem()) + dst = dsti.Interface() + rcopy(dsti, reflect.ValueOf(src), true) + return +} + +// rcopy performs a recursive copy of values from the source to destination. +// +// root is used to skip certain aspects of the copy which are not valid +// for the root node of a object. +func rcopy(dst, src reflect.Value, root bool) { + if !src.IsValid() { + return + } + + switch src.Kind() { + case reflect.Ptr: + if _, ok := src.Interface().(io.Reader); ok { + if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() { + dst.Elem().Set(src) + } else if dst.CanSet() { + dst.Set(src) + } + } else { + e := src.Type().Elem() + if dst.CanSet() && !src.IsNil() { + dst.Set(reflect.New(e)) + } + if src.Elem().IsValid() { + // Keep the current root state since the depth hasn't changed + rcopy(dst.Elem(), src.Elem(), root) + } + } + case reflect.Struct: + if !root { + dst.Set(reflect.New(src.Type()).Elem()) + } + + t := dst.Type() + for i := 0; i < t.NumField(); i++ { + name := t.Field(i).Name + srcval := src.FieldByName(name) + if srcval.IsValid() { + rcopy(dst.FieldByName(name), srcval, false) + } + } + case reflect.Slice: + s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) + dst.Set(s) + for i := 0; i < src.Len(); i++ { + rcopy(dst.Index(i), src.Index(i), false) + } + case reflect.Map: + s := reflect.MakeMap(src.Type()) + dst.Set(s) + for _, k := range src.MapKeys() { + v := src.MapIndex(k) + v2 := reflect.New(v.Type()).Elem() + rcopy(v2, v, false) + dst.SetMapIndex(k, v2) + } + default: + // Assign the value if possible. If its not assignable, the value would + // need to be converted and the impact of that may be unexpected, or is + // not compatible with the dst type. + if src.Type().AssignableTo(dst.Type()) { + dst.Set(src) + } + } +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go similarity index 63% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go index 15b7929e3e..4ae04ac1dd 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go @@ -7,7 +7,7 @@ import ( "io/ioutil" "testing" - "github.com/awslabs/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/stretchr/testify/assert" ) @@ -77,6 +77,23 @@ func TestCopy(t *testing.T) { assert.NotEqual(t, f2.C, f1.C) } +func TestCopyIgnoreNilMembers(t *testing.T) { + type Foo struct { + A *string + } + + f := &Foo{} + assert.Nil(t, f.A) + + var f2 Foo + awsutil.Copy(&f2, f) + assert.Nil(t, f2.A) + + fcopy := awsutil.CopyOf(f) + f3 := fcopy.(*Foo) + assert.Nil(t, f3.A) +} + func TestCopyPrimitive(t *testing.T) { str := "hello" var s string @@ -104,6 +121,52 @@ func TestCopyReader(t *testing.T) { assert.Equal(t, []byte(""), b) } +func TestCopyDifferentStructs(t *testing.T) { + type SrcFoo struct { + A int + B []*string + C map[string]*int + SrcUnique string + SameNameDiffType int + } + type DstFoo struct { + A int + B []*string + C map[string]*int + DstUnique int + SameNameDiffType string + } + + // Create the initial value + str1 := "hello" + str2 := "bye bye" + int1 := 1 + int2 := 2 + f1 := &SrcFoo{ + A: 1, + B: []*string{&str1, &str2}, + C: map[string]*int{ + "A": &int1, + "B": &int2, + }, + SrcUnique: "unique", + SameNameDiffType: 1, + } + + // Do the copy + var f2 DstFoo + awsutil.Copy(&f2, f1) + + // Values are equal + assert.Equal(t, f2.A, f1.A) + assert.Equal(t, f2.B, f1.B) + assert.Equal(t, f2.C, f1.C) + assert.Equal(t, "unique", f1.SrcUnique) + assert.Equal(t, 1, f1.SameNameDiffType) + assert.Equal(t, 0, f2.DstUnique) + assert.Equal(t, "", f2.SameNameDiffType) +} + func ExampleCopyOf() { type Foo struct { A int diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go similarity index 71% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index c98e93ea0b..7ae01efe42 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -11,11 +11,11 @@ var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) // rValuesAtPath returns a slice of values found in value v. The values // in v are explored recursively so all nested values are collected. -func rValuesAtPath(v interface{}, path string, create bool) []reflect.Value { +func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) []reflect.Value { pathparts := strings.Split(path, "||") if len(pathparts) > 1 { for _, pathpart := range pathparts { - vals := rValuesAtPath(v, pathpart, create) + vals := rValuesAtPath(v, pathpart, create, caseSensitive) if vals != nil && len(vals) > 0 { return vals } @@ -31,7 +31,7 @@ func rValuesAtPath(v interface{}, path string, create bool) []reflect.Value { c := strings.TrimSpace(components[0]) if c == "" { // no actual component, illegal syntax return nil - } else if c != "*" && strings.ToLower(c[0:1]) == c[0:1] { + } else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] { // TODO normalize case for user return nil // don't support unexported fields } @@ -65,7 +65,15 @@ func rValuesAtPath(v interface{}, path string, create bool) []reflect.Value { continue } - value = value.FieldByName(c) + value = value.FieldByNameFunc(func(name string) bool { + if c == name { + return true + } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { + return true + } + return false + }) + if create && value.Kind() == reflect.Ptr && value.IsNil() { value.Set(reflect.New(value.Type().Elem())) value = value.Elem() @@ -124,7 +132,20 @@ func rValuesAtPath(v interface{}, path string, create bool) []reflect.Value { // ValuesAtPath returns a list of objects at the lexical path inside of a structure func ValuesAtPath(i interface{}, path string) []interface{} { - if rvals := rValuesAtPath(i, path, false); rvals != nil { + if rvals := rValuesAtPath(i, path, false, true); rvals != nil { + vals := make([]interface{}, len(rvals)) + for i, rval := range rvals { + vals[i] = rval.Interface() + } + return vals + } + return nil +} + +// ValuesAtAnyPath returns a list of objects at the case-insensitive lexical +// path inside of a structure +func ValuesAtAnyPath(i interface{}, path string) []interface{} { + if rvals := rValuesAtPath(i, path, false, false); rvals != nil { vals := make([]interface{}, len(rvals)) for i, rval := range rvals { vals[i] = rval.Interface() @@ -136,7 +157,17 @@ func ValuesAtPath(i interface{}, path string) []interface{} { // SetValueAtPath sets an object at the lexical path inside of a structure func SetValueAtPath(i interface{}, path string, v interface{}) { - if rvals := rValuesAtPath(i, path, true); rvals != nil { + if rvals := rValuesAtPath(i, path, true, true); rvals != nil { + for _, rval := range rvals { + rval.Set(reflect.ValueOf(v)) + } + } +} + +// SetValueAtAnyPath sets an object at the case insensitive lexical path inside +// of a structure +func SetValueAtAnyPath(i interface{}, path string, v interface{}) { + if rvals := rValuesAtPath(i, path, true, false); rvals != nil { for _, rval := range rvals { rval.Set(reflect.ValueOf(v)) } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go similarity index 87% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go index 8819273650..1262cf6bef 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/path_value_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go @@ -3,13 +3,13 @@ package awsutil_test import ( "testing" - "github.com/awslabs/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/stretchr/testify/assert" ) type Struct struct { A []Struct - a []Struct + z []Struct B *Struct D *Struct C string @@ -17,7 +17,7 @@ type Struct struct { var data = Struct{ A: []Struct{Struct{C: "value1"}, Struct{C: "value2"}, Struct{C: "value3"}}, - a: []Struct{Struct{C: "value1"}, Struct{C: "value2"}, Struct{C: "value3"}}, + z: []Struct{Struct{C: "value1"}, Struct{C: "value2"}, Struct{C: "value3"}}, B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}}, C: "initial", } @@ -27,6 +27,7 @@ func TestValueAtPathSuccess(t *testing.T) { assert.Equal(t, []interface{}{"value1"}, awsutil.ValuesAtPath(data, "A[0].C")) assert.Equal(t, []interface{}{"value2"}, awsutil.ValuesAtPath(data, "A[1].C")) assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtPath(data, "A[2].C")) + assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtAnyPath(data, "a[2].c")) assert.Equal(t, []interface{}{"value3"}, awsutil.ValuesAtPath(data, "A[-1].C")) assert.Equal(t, []interface{}{"value1", "value2", "value3"}, awsutil.ValuesAtPath(data, "A[].C")) assert.Equal(t, []interface{}{"terminal"}, awsutil.ValuesAtPath(data, "B . B . C")) @@ -41,7 +42,7 @@ func TestValueAtPathFailure(t *testing.T) { assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "A[100].C")) assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "A[3].C")) assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "B.B.C.Z")) - assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "a[-1].C")) + assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "z[-1].C")) assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(nil, "A.B.C")) } @@ -57,4 +58,8 @@ func TestSetValueAtPathSuccess(t *testing.T) { awsutil.SetValueAtPath(&s, "B.*.C", "test0") assert.Equal(t, "test0", s.B.B.C) assert.Equal(t, "test0", s.B.D.C) + + var s2 Struct + awsutil.SetValueAtAnyPath(&s2, "b.b.c", "test0") + assert.Equal(t, "test0", s2.B.B.C) } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/string_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go similarity index 95% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/string_value.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go index 4c859e2154..09673a12ed 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/string_value.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go @@ -42,7 +42,7 @@ func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { if name[0:1] == strings.ToLower(name[0:1]) { continue // ignore unexported fields } - if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() { + if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { continue // ignore unset fields } names = append(names, name) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/config.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go similarity index 96% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/config.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go index 044fea7f02..bd805f36b8 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/config.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go @@ -4,8 +4,9 @@ import ( "io" "net/http" "os" + "time" - "github.com/awslabs/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials" ) // DefaultChainCredentials is a Credentials which will find the first available @@ -17,7 +18,7 @@ var DefaultChainCredentials = credentials.NewChainCredentials( []credentials.Provider{ &credentials.EnvProvider{}, &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - &credentials.EC2RoleProvider{}, + &credentials.EC2RoleProvider{ExpiryWindow: 5 * time.Minute}, }) // The default number of retries for a service. The value of -1 indicates that @@ -83,6 +84,10 @@ func (c Config) Copy() Config { // example bool attributes cannot be cleared using Merge, and must be explicitly // set on the Config structure. func (c Config) Merge(newcfg *Config) *Config { + if newcfg == nil { + return &c + } + cfg := Config{} if newcfg != nil && newcfg.Credentials != nil { diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go similarity index 94% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go index 67e36055e2..196be7c172 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go @@ -1,13 +1,13 @@ package credentials import ( - "fmt" + "github.com/aws/aws-sdk-go/internal/apierr" ) var ( // ErrNoValidProvidersFoundInChain Is returned when there are no valid // providers in the ChainProvider. - ErrNoValidProvidersFoundInChain = fmt.Errorf("no valid providers in chain") + ErrNoValidProvidersFoundInChain = apierr.New("NoCredentialProviders", "no valid providers in chain", nil) ) // A ChainProvider will search for a provider which returns credentials diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go similarity index 78% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go index 9c0a765fa8..1a275fcac2 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/chain_provider_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go @@ -1,16 +1,17 @@ package credentials import ( - "errors" - "github.com/stretchr/testify/assert" "testing" + + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/stretchr/testify/assert" ) func TestChainProviderGet(t *testing.T) { p := &ChainProvider{ Providers: []Provider{ - &stubProvider{err: errors.New("first provider error")}, - &stubProvider{err: errors.New("second provider error")}, + &stubProvider{err: apierr.New("FirstError", "first provider error", nil)}, + &stubProvider{err: apierr.New("SecondError", "second provider error", nil)}, &stubProvider{ creds: Value{ AccessKeyID: "AKID", @@ -61,12 +62,12 @@ func TestChainProviderWithNoProvider(t *testing.T) { func TestChainProviderWithNoValidProvider(t *testing.T) { p := &ChainProvider{ Providers: []Provider{ - &stubProvider{err: errors.New("first provider error")}, - &stubProvider{err: errors.New("second provider error")}, + &stubProvider{err: apierr.New("FirstError", "first provider error", nil)}, + &stubProvider{err: apierr.New("SecondError", "second provider error", nil)}, }, } assert.True(t, p.IsExpired(), "Expect expired with no providers") _, err := p.Retrieve() - assert.Contains(t, "no valid providers in chain", err.Error(), "Expect no providers error returned") + assert.Equal(t, ErrNoValidProvidersFoundInChain, err, "Expect no providers error returned") } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/credentials.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/credentials.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/credentials_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go similarity index 82% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/credentials_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go index 96961bf165..779bb0da4a 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/credentials_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go @@ -1,9 +1,11 @@ package credentials import ( - "errors" - "github.com/stretchr/testify/assert" "testing" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/stretchr/testify/assert" ) type stubProvider struct { @@ -38,10 +40,10 @@ func TestCredentialsGet(t *testing.T) { } func TestCredentialsGetWithError(t *testing.T) { - c := NewCredentials(&stubProvider{err: errors.New("provider error"), expired: true}) + c := NewCredentials(&stubProvider{err: apierr.New("provider error", "", nil), expired: true}) _, err := c.Get() - assert.Equal(t, "provider error", err.Error(), "Expected provider error") + assert.Equal(t, "provider error", err.(awserr.Error).Code(), "Expected provider error") } func TestCredentialsExpire(t *testing.T) { diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/ec2_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go similarity index 89% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/ec2_role_provider.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go index cd9c34165c..ed0c8ba9cd 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/ec2_role_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go @@ -6,6 +6,8 @@ import ( "fmt" "net/http" "time" + + "github.com/aws/aws-sdk-go/internal/apierr" ) const metadataCredentialsEndpoint = "http://169.254.169.254/latest/meta-data/iam/security-credentials/" @@ -89,7 +91,7 @@ func (m *EC2RoleProvider) Retrieve() (Value, error) { } if len(credsList) == 0 { - return Value{}, fmt.Errorf("empty MetadataService credentials list") + return Value{}, apierr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) } credsName := credsList[0] @@ -130,7 +132,7 @@ type ec2RoleCredRespBody struct { func requestCredList(client *http.Client, endpoint string) ([]string, error) { resp, err := client.Get(endpoint) if err != nil { - return nil, fmt.Errorf("%s listing MetadataService credentials", err) + return nil, apierr.New("ListEC2Role", "failed to list EC2 Roles", err) } defer resp.Body.Close() @@ -141,7 +143,7 @@ func requestCredList(client *http.Client, endpoint string) ([]string, error) { } if err := s.Err(); err != nil { - return nil, fmt.Errorf("%s reading list of MetadataService credentials", err) + return nil, apierr.New("ReadEC2Role", "failed to read list of EC2 Roles", err) } return credsList, nil @@ -154,13 +156,17 @@ func requestCredList(client *http.Client, endpoint string) ([]string, error) { func requestCred(client *http.Client, endpoint, credsName string) (*ec2RoleCredRespBody, error) { resp, err := client.Get(endpoint + credsName) if err != nil { - return nil, fmt.Errorf("getting %s MetadataService credentials", credsName) + return nil, apierr.New("GetEC2RoleCredentials", + fmt.Sprintf("failed to get %s EC2 Role credentials", credsName), + err) } defer resp.Body.Close() respCreds := &ec2RoleCredRespBody{} if err := json.NewDecoder(resp.Body).Decode(respCreds); err != nil { - return nil, fmt.Errorf("decoding %s MetadataService credentials", credsName) + return nil, apierr.New("DecodeEC2RoleCredentials", + fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName), + err) } return respCreds, nil diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/ec2_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/ec2_role_provider_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go similarity index 83% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go index 0b4e81160d..e9c575292e 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go @@ -1,17 +1,18 @@ package credentials import ( - "fmt" "os" + + "github.com/aws/aws-sdk-go/internal/apierr" ) var ( // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // found in the process's environment. - ErrAccessKeyIDNotFound = fmt.Errorf("AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment") + ErrAccessKeyIDNotFound = apierr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key // can't be found in the process's environment. - ErrSecretAccessKeyNotFound = fmt.Errorf("AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment") + ErrSecretAccessKeyNotFound = apierr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) ) // A EnvProvider retrieves credentials from the environment variables of the diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go similarity index 95% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go index 32317faef6..53f6ce256e 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/env_provider_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go @@ -14,7 +14,7 @@ func TestEnvProviderRetrieve(t *testing.T) { e := EnvProvider{} creds, err := e.Retrieve() - assert.Nil(t, err, "Expect no error", err) + assert.Nil(t, err, "Expect no error") assert.Equal(t, "access", creds.AccessKeyID, "Expect access key ID to match") assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") @@ -32,7 +32,7 @@ func TestEnvProviderIsExpired(t *testing.T) { assert.True(t, e.IsExpired(), "Expect creds to be expired before retrieve.") _, err := e.Retrieve() - assert.Nil(t, err, "Expect no error", err) + assert.Nil(t, err, "Expect no error") assert.False(t, e.IsExpired(), "Expect creds to not be expired after retrieve.") } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/example.ini b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/example.ini rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go similarity index 84% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/shared_credentials_provider.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go index e6867947e2..d61b140be4 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/shared_credentials_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go @@ -6,11 +6,13 @@ import ( "path/filepath" "github.com/vaughan0/go-ini" + + "github.com/aws/aws-sdk-go/internal/apierr" ) var ( // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. - ErrSharedCredentialsHomeNotFound = fmt.Errorf("User home directory not found.") + ErrSharedCredentialsHomeNotFound = apierr.New("UserHomeNotFound", "user home directory not found.", nil) ) // A SharedCredentialsProvider retrieves credentials from the current user's home @@ -70,18 +72,22 @@ func (p *SharedCredentialsProvider) IsExpired() bool { func loadProfile(filename, profile string) (Value, error) { config, err := ini.LoadFile(filename) if err != nil { - return Value{}, err + return Value{}, apierr.New("SharedCredsLoad", "failed to load shared credentials file", err) } iniProfile := config.Section(profile) id, ok := iniProfile["aws_access_key_id"] if !ok { - return Value{}, fmt.Errorf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename) + return Value{}, apierr.New("SharedCredsAccessKey", + fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), + nil) } secret, ok := iniProfile["aws_secret_access_key"] if !ok { - return Value{}, fmt.Errorf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename) + return Value{}, apierr.New("SharedCredsSecret", + fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), + nil) } token := iniProfile["aws_session_token"] diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/static_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go similarity index 87% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/static_provider.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go index 5ea6cc12a9..4466cd263c 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/static_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go @@ -1,12 +1,12 @@ package credentials import ( - "fmt" + "github.com/aws/aws-sdk-go/internal/apierr" ) var ( // ErrStaticCredentialsEmpty is emitted when static credentials are empty. - ErrStaticCredentialsEmpty = fmt.Errorf("static credentials are empty") + ErrStaticCredentialsEmpty = apierr.New("EmptyStaticCreds", "static credentials are empty", nil) ) // A StaticProvider is a set of credentials which are set pragmatically, diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/static_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/credentials/static_provider_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go similarity index 73% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go index 64d50643b5..e15ab8291f 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go @@ -10,6 +10,9 @@ import ( "regexp" "strconv" "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/internal/apierr" ) var sleepDelay = func(delay time.Duration) { @@ -59,19 +62,27 @@ var reStatusCode = regexp.MustCompile(`^(\d+)`) // SendHandler is a request handler to send service request using HTTP client. func SendHandler(r *Request) { - r.HTTPResponse, r.Error = r.Service.Config.HTTPClient.Do(r.HTTPRequest) - if r.Error != nil { - if e, ok := r.Error.(*url.Error); ok { - if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { + var err error + r.HTTPResponse, err = r.Service.Config.HTTPClient.Do(r.HTTPRequest) + if err != nil { + // Capture the case where url.Error is returned for error processing + // response. e.g. 301 without location header comes back as string + // error and r.HTTPResponse is nil. Other url redirect errors will + // comeback in a similar method. + if e, ok := err.(*url.Error); ok { + if s := reStatusCode.FindStringSubmatch(e.Error()); s != nil { code, _ := strconv.ParseInt(s[1], 10, 64) - r.Error = nil r.HTTPResponse = &http.Response{ StatusCode: int(code), Status: http.StatusText(int(code)), Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } + return } } + // Catch all other request errors. + r.Error = apierr.New("RequestError", "send request failed", err) + r.Retryable.Set(true) // network errors are retryable } } @@ -79,11 +90,7 @@ func SendHandler(r *Request) { func ValidateResponseHandler(r *Request) { if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { // this may be replaced by an UnmarshalError handler - r.Error = &APIError{ - StatusCode: r.HTTPResponse.StatusCode, - Code: "UnknownError", - Message: "unknown error", - } + r.Error = apierr.New("UnknownError", "unknown error", nil) } } @@ -103,10 +110,14 @@ func AfterRetryHandler(r *Request) { // when the expired token exception occurs the credentials // need to be expired locally so that the next request to // get credentials will trigger a credentials refresh. - if err := Error(r.Error); err != nil && err.Code == "ExpiredTokenException" { - r.Config.Credentials.Expire() - // The credentials will need to be resigned with new credentials - r.signed = false + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + if isCodeExpiredCreds(err.Code()) { + r.Config.Credentials.Expire() + // The credentials will need to be resigned with new credentials + r.signed = false + } + } } r.RetryCount++ @@ -117,11 +128,11 @@ func AfterRetryHandler(r *Request) { var ( // ErrMissingRegion is an error that is returned if region configuration is // not found. - ErrMissingRegion = fmt.Errorf("could not find region configuration") + ErrMissingRegion error = apierr.New("MissingRegion", "could not find region configuration", nil) // ErrMissingEndpoint is an error that is returned if an endpoint cannot be // resolved for a service. - ErrMissingEndpoint = fmt.Errorf("`Endpoint' configuration is required for this service") + ErrMissingEndpoint error = apierr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) ) // ValidateEndpointHandler is a request handler to validate a request had the diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go similarity index 90% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go index b8a6d4b234..822db9fe20 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handler_functions_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go @@ -5,7 +5,8 @@ import ( "os" "testing" - "github.com/awslabs/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/apierr" "github.com/stretchr/testify/assert" ) @@ -55,11 +56,11 @@ func TestAfterRetryRefreshCreds(t *testing.T) { svc.Handlers.Clear() svc.Handlers.ValidateResponse.PushBack(func(r *Request) { - r.Error = &APIError{Code: "UnknownError"} + r.Error = apierr.New("UnknownError", "", nil) r.HTTPResponse = &http.Response{StatusCode: 400} }) svc.Handlers.UnmarshalError.PushBack(func(r *Request) { - r.Error = &APIError{Code: "ExpiredTokenException"} + r.Error = apierr.New("ExpiredTokenException", "", nil) }) svc.Handlers.AfterRetry.PushBack(func(r *Request) { AfterRetryHandler(r) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handlers.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/handlers_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go similarity index 93% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go index 00efc8add2..7c1377281d 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go @@ -4,6 +4,8 @@ import ( "fmt" "reflect" "strings" + + "github.com/aws/aws-sdk-go/internal/apierr" ) // ValidateParameters is a request handler to validate the input parameters. @@ -16,7 +18,7 @@ func ValidateParameters(r *Request) { if count := len(v.errors); count > 0 { format := "%d validation errors:\n- %s" msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- ")) - r.Error = APIError{Code: "InvalidParameter", Message: msg} + r.Error = apierr.New("InvalidParameter", msg, nil) } } } @@ -66,7 +68,7 @@ func (v *validator) validateStruct(value reflect.Value, path string) { notset := false if f.Tag.Get("required") != "" { switch fvalue.Kind() { - case reflect.Ptr, reflect.Slice: + case reflect.Ptr, reflect.Slice, reflect.Map: if fvalue.IsNil() { notset = true } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go similarity index 73% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go index 08deca15a1..6651567307 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/param_validator_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go @@ -3,7 +3,8 @@ package aws_test import ( "testing" - "github.com/awslabs/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" "github.com/stretchr/testify/assert" ) @@ -17,9 +18,9 @@ var service = func() *aws.Service { }() type StructShape struct { - RequiredList []*ConditionalStructShape `required:"true"` - RequiredMap *map[string]*ConditionalStructShape `required:"true"` - RequiredBool *bool `required:"true"` + RequiredList []*ConditionalStructShape `required:"true"` + RequiredMap map[string]*ConditionalStructShape `required:"true"` + RequiredBool *bool `required:"true"` OptionalStruct *ConditionalStructShape hiddenParameter *string @@ -39,7 +40,7 @@ type ConditionalStructShape struct { func TestNoErrors(t *testing.T) { input := &StructShape{ RequiredList: []*ConditionalStructShape{}, - RequiredMap: &map[string]*ConditionalStructShape{ + RequiredMap: map[string]*ConditionalStructShape{ "key1": &ConditionalStructShape{Name: aws.String("Name")}, "key2": &ConditionalStructShape{Name: aws.String("Name")}, }, @@ -56,17 +57,16 @@ func TestMissingRequiredParameters(t *testing.T) { input := &StructShape{} req := aws.NewRequest(service, &aws.Operation{}, input, nil) aws.ValidateParameters(req) - err := aws.Error(req.Error) - assert.Error(t, err) - assert.Equal(t, "InvalidParameter", err.Code) - assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList\n- missing required parameter: RequiredMap\n- missing required parameter: RequiredBool", err.Message) + assert.Error(t, req.Error) + assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) + assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList\n- missing required parameter: RequiredMap\n- missing required parameter: RequiredBool", req.Error.(awserr.Error).Message()) } func TestNestedMissingRequiredParameters(t *testing.T) { input := &StructShape{ RequiredList: []*ConditionalStructShape{&ConditionalStructShape{}}, - RequiredMap: &map[string]*ConditionalStructShape{ + RequiredMap: map[string]*ConditionalStructShape{ "key1": &ConditionalStructShape{Name: aws.String("Name")}, "key2": &ConditionalStructShape{}, }, @@ -76,10 +76,9 @@ func TestNestedMissingRequiredParameters(t *testing.T) { req := aws.NewRequest(service, &aws.Operation{}, input, nil) aws.ValidateParameters(req) - err := aws.Error(req.Error) - assert.Error(t, err) - assert.Equal(t, "InvalidParameter", err.Code) - assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList[0].Name\n- missing required parameter: RequiredMap[\"key2\"].Name\n- missing required parameter: OptionalStruct.Name", err.Message) + assert.Error(t, req.Error) + assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) + assert.Equal(t, "3 validation errors:\n- missing required parameter: RequiredList[0].Name\n- missing required parameter: RequiredMap[\"key2\"].Name\n- missing required parameter: OptionalStruct.Name", req.Error.(awserr.Error).Message()) } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go similarity index 65% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go index 95e944d76f..df5885fcb4 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go @@ -9,6 +9,8 @@ import ( "reflect" "strings" "time" + + "github.com/aws/aws-sdk-go/aws/awsutil" ) // A Request is the service request to be made. @@ -39,6 +41,15 @@ type Operation struct { Name string HTTPMethod string HTTPPath string + *Paginator +} + +// Paginator keeps track of pagination configuration for an API operation. +type Paginator struct { + InputTokens []string + OutputTokens []string + LimitToken string + TruncationToken string } // NewRequest returns a new Request pointer for the service API @@ -187,7 +198,12 @@ func (r *Request) Send() error { r.Handlers.Send.Run(r) if r.Error != nil { - return r.Error + r.Handlers.Retry.Run(r) + r.Handlers.AfterRetry.Run(r) + if r.Error != nil { + return r.Error + } + continue } r.Handlers.UnmarshalMeta.Run(r) @@ -217,3 +233,86 @@ func (r *Request) Send() error { return nil } + +// HasNextPage returns true if this request has more pages of data available. +func (r *Request) HasNextPage() bool { + return r.nextPageTokens() != nil +} + +// nextPageTokens returns the tokens to use when asking for the next page of +// data. +func (r *Request) nextPageTokens() []interface{} { + if r.Operation.Paginator == nil { + return nil + } + + if r.Operation.TruncationToken != "" { + tr := awsutil.ValuesAtAnyPath(r.Data, r.Operation.TruncationToken) + if tr == nil || len(tr) == 0 { + return nil + } + switch v := tr[0].(type) { + case bool: + if v == false { + return nil + } + } + } + + found := false + tokens := make([]interface{}, len(r.Operation.OutputTokens)) + + for i, outtok := range r.Operation.OutputTokens { + v := awsutil.ValuesAtAnyPath(r.Data, outtok) + if v != nil && len(v) > 0 { + found = true + tokens[i] = v[0] + } + } + + if found { + return tokens + } + return nil +} + +// NextPage returns a new Request that can be executed to return the next +// page of result data. Call .Send() on this request to execute it. +func (r *Request) NextPage() *Request { + tokens := r.nextPageTokens() + if tokens == nil { + return nil + } + + data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() + nr := NewRequest(r.Service, r.Operation, awsutil.CopyOf(r.Params), data) + for i, intok := range nr.Operation.InputTokens { + awsutil.SetValueAtAnyPath(nr.Params, intok, tokens[i]) + } + return nr +} + +// EachPage iterates over each page of a paginated request object. The fn +// parameter should be a function with the following sample signature: +// +// func(page *T, lastPage bool) bool { +// return true // return false to stop iterating +// } +// +// Where "T" is the structure type matching the output structure of the given +// operation. For example, a request object generated by +// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput +// as the structure "T". The lastPage value represents whether the page is +// the last page of data or not. The return value of this function should +// return true to keep iterating or false to stop. +func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { + for page := r; page != nil; page = page.NextPage() { + page.Send() + shouldContinue := fn(page.Data, !page.HasNextPage()) + if page.Error != nil || !shouldContinue { + return page.Error + } + } + + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go new file mode 100644 index 0000000000..eabd9aea7a --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go @@ -0,0 +1,305 @@ +package aws_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/stretchr/testify/assert" +) + +var _ = unit.Imported + +// Use DynamoDB methods for simplicity +func TestPagination(t *testing.T) { + db := dynamodb.New(nil) + tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Build.PushBack(func(r *aws.Request) { + in := r.Params.(*dynamodb.ListTablesInput) + if in == nil { + tokens = append(tokens, "") + } else if in.ExclusiveStartTableName != nil { + tokens = append(tokens, *in.ExclusiveStartTableName) + } + }) + db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} + err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { + numPages++ + for _, t := range p.TableNames { + pages = append(pages, *t) + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + return true + }) + + assert.Equal(t, []string{"Table2", "Table4"}, tokens) + assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) + assert.Equal(t, 3, numPages) + assert.True(t, gotToEnd) + assert.Nil(t, err) + assert.Nil(t, params.ExclusiveStartTableName) +} + +// Use DynamoDB methods for simplicity +func TestPaginationEachPage(t *testing.T) { + db := dynamodb.New(nil) + tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Build.PushBack(func(r *aws.Request) { + in := r.Params.(*dynamodb.ListTablesInput) + if in == nil { + tokens = append(tokens, "") + } else if in.ExclusiveStartTableName != nil { + tokens = append(tokens, *in.ExclusiveStartTableName) + } + }) + db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} + req, _ := db.ListTablesRequest(params) + err := req.EachPage(func(p interface{}, last bool) bool { + numPages++ + for _, t := range p.(*dynamodb.ListTablesOutput).TableNames { + pages = append(pages, *t) + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + + return true + }) + + assert.Equal(t, []string{"Table2", "Table4"}, tokens) + assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) + assert.Equal(t, 3, numPages) + assert.True(t, gotToEnd) + assert.Nil(t, err) +} + +// Use DynamoDB methods for simplicity +func TestPaginationEarlyExit(t *testing.T) { + db := dynamodb.New(nil) + numPages, gotToEnd := 0, false + + reqNum := 0 + resps := []*dynamodb.ListTablesOutput{ + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table1"), aws.String("Table2")}, LastEvaluatedTableName: aws.String("Table2")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table3"), aws.String("Table4")}, LastEvaluatedTableName: aws.String("Table4")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("Table5")}}, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.ListTablesInput{Limit: aws.Long(2)} + err := db.ListTablesPages(params, func(p *dynamodb.ListTablesOutput, last bool) bool { + numPages++ + if numPages == 2 { + return false + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + return true + }) + + assert.Equal(t, 2, numPages) + assert.False(t, gotToEnd) + assert.Nil(t, err) +} + +func TestSkipPagination(t *testing.T) { + client := s3.New(nil) + client.Handlers.Send.Clear() // mock sending + client.Handlers.Unmarshal.Clear() + client.Handlers.UnmarshalMeta.Clear() + client.Handlers.ValidateResponse.Clear() + client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = &s3.HeadBucketOutput{} + }) + + req, _ := client.HeadBucketRequest(&s3.HeadBucketInput{Bucket: aws.String("bucket")}) + + numPages, gotToEnd := 0, false + req.EachPage(func(p interface{}, last bool) bool { + numPages++ + if last { + gotToEnd = true + } + return true + }) + assert.Equal(t, 1, numPages) + assert.True(t, gotToEnd) +} + +// Use S3 for simplicity +func TestPaginationTruncation(t *testing.T) { + count := 0 + client := s3.New(nil) + + reqNum := &count + resps := []*s3.ListObjectsOutput{ + &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key1")}}}, + &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key2")}}}, + &s3.ListObjectsOutput{IsTruncated: aws.Boolean(false), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key3")}}}, + &s3.ListObjectsOutput{IsTruncated: aws.Boolean(true), Contents: []*s3.Object{&s3.Object{Key: aws.String("Key4")}}}, + } + + client.Handlers.Send.Clear() // mock sending + client.Handlers.Unmarshal.Clear() + client.Handlers.UnmarshalMeta.Clear() + client.Handlers.ValidateResponse.Clear() + client.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = resps[*reqNum] + *reqNum++ + }) + + params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} + + results := []string{} + err := client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { + results = append(results, *p.Contents[0].Key) + return true + }) + + assert.Equal(t, []string{"Key1", "Key2", "Key3"}, results) + assert.Nil(t, err) + + // Try again without truncation token at all + count = 0 + resps[1].IsTruncated = nil + resps[2].IsTruncated = aws.Boolean(true) + results = []string{} + err = client.ListObjectsPages(params, func(p *s3.ListObjectsOutput, last bool) bool { + results = append(results, *p.Contents[0].Key) + return true + }) + + assert.Equal(t, []string{"Key1", "Key2"}, results) + assert.Nil(t, err) + +} + +// Benchmarks +var benchResps = []*dynamodb.ListTablesOutput{ + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE"), aws.String("NXT")}, LastEvaluatedTableName: aws.String("NXT")}, + &dynamodb.ListTablesOutput{TableNames: []*string{aws.String("TABLE")}}, +} + +var benchDb = func() *dynamodb.DynamoDB { + db := dynamodb.New(nil) + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + return db +} + +func BenchmarkCodegenIterator(b *testing.B) { + reqNum := 0 + db := benchDb() + db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = benchResps[reqNum] + reqNum++ + }) + + input := &dynamodb.ListTablesInput{Limit: aws.Long(2)} + iter := func(fn func(*dynamodb.ListTablesOutput, bool) bool) error { + page, _ := db.ListTablesRequest(input) + for ; page != nil; page = page.NextPage() { + page.Send() + out := page.Data.(*dynamodb.ListTablesOutput) + if result := fn(out, !page.HasNextPage()); page.Error != nil || !result { + return page.Error + } + } + return nil + } + + for i := 0; i < b.N; i++ { + reqNum = 0 + iter(func(p *dynamodb.ListTablesOutput, last bool) bool { + return true + }) + } +} + +func BenchmarkEachPageIterator(b *testing.B) { + reqNum := 0 + db := benchDb() + db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + r.Data = benchResps[reqNum] + reqNum++ + }) + + input := &dynamodb.ListTablesInput{Limit: aws.Long(2)} + for i := 0; i < b.N; i++ { + reqNum = 0 + req, _ := db.ListTablesRequest(input) + req.EachPage(func(p interface{}, last bool) bool { + return true + }) + } +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go similarity index 83% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go index bc398dabb9..27507f039d 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/request_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go @@ -3,6 +3,7 @@ package aws import ( "bytes" "encoding/json" + "fmt" "io" "io/ioutil" "net/http" @@ -10,7 +11,9 @@ import ( "testing" "time" - "github.com/awslabs/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/apierr" "github.com/stretchr/testify/assert" ) @@ -33,26 +36,27 @@ func unmarshal(req *Request) { func unmarshalError(req *Request) { bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) if err != nil { - req.Error = err + req.Error = apierr.New("UnmarshaleError", req.HTTPResponse.Status, err) return } if len(bodyBytes) == 0 { - req.Error = APIError{ - StatusCode: req.HTTPResponse.StatusCode, - Message: req.HTTPResponse.Status, - } + req.Error = apierr.NewRequestError( + apierr.New("UnmarshaleError", req.HTTPResponse.Status, fmt.Errorf("empty body")), + req.HTTPResponse.StatusCode, + "", + ) return } var jsonErr jsonErrorResponse if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { - req.Error = err + req.Error = apierr.New("UnmarshaleError", "JSON unmarshal", err) return } - req.Error = APIError{ - StatusCode: req.HTTPResponse.StatusCode, - Code: jsonErr.Code, - Message: jsonErr.Message, - } + req.Error = apierr.NewRequestError( + apierr.New(jsonErr.Code, jsonErr.Message, nil), + req.HTTPResponse.StatusCode, + "", + ) } type jsonErrorResponse struct { @@ -125,12 +129,14 @@ func TestRequest4xxUnretryable(t *testing.T) { out := &testData{} r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) err := r.Send() - apiErr := Error(err) assert.NotNil(t, err) - assert.NotNil(t, apiErr) - assert.Equal(t, 401, apiErr.StatusCode) - assert.Equal(t, "SignatureDoesNotMatch", apiErr.Code) - assert.Equal(t, "Signature does not match.", apiErr.Message) + if e, ok := err.(awserr.RequestFailure); ok { + assert.Equal(t, 401, e.StatusCode()) + } else { + assert.Fail(t, "Expected error to be a service failure") + } + assert.Equal(t, "SignatureDoesNotMatch", err.(awserr.Error).Code()) + assert.Equal(t, "Signature does not match.", err.(awserr.Error).Message()) assert.Equal(t, 0, int(r.RetryCount)) } @@ -159,12 +165,14 @@ func TestRequestExhaustRetries(t *testing.T) { }) r := NewRequest(s, &Operation{Name: "Operation"}, nil, nil) err := r.Send() - apiErr := Error(err) assert.NotNil(t, err) - assert.NotNil(t, apiErr) - assert.Equal(t, 500, apiErr.StatusCode) - assert.Equal(t, "UnknownError", apiErr.Code) - assert.Equal(t, "An error occurred.", apiErr.Message) + if e, ok := err.(awserr.RequestFailure); ok { + assert.Equal(t, 500, e.StatusCode()) + } else { + assert.Fail(t, "Expected error to be a service failure") + } + assert.Equal(t, "UnknownError", err.(awserr.Error).Code()) + assert.Equal(t, "An error occurred.", err.(awserr.Error).Message()) assert.Equal(t, 3, int(r.RetryCount)) assert.True(t, reflect.DeepEqual([]time.Duration{30 * time.Millisecond, 60 * time.Millisecond, 120 * time.Millisecond}, delays)) } @@ -185,12 +193,6 @@ func TestRequestRecoverExpiredCreds(t *testing.T) { credExpiredBeforeRetry := false credExpiredAfterRetry := false - s.Handlers.Retry.PushBack(func(r *Request) { - if err := Error(r.Error); err != nil && err.Code == "ExpiredTokenException" { - credExpiredBeforeRetry = r.Config.Credentials.IsExpired() - } - }) - s.Handlers.AfterRetry.PushBack(func(r *Request) { credExpiredAfterRetry = r.Config.Credentials.IsExpired() }) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go similarity index 80% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/service.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go index 8dfc32e8bf..7e8e229ba4 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go @@ -8,7 +8,8 @@ import ( "regexp" "time" - "github.com/awslabs/aws-sdk-go/internal/endpoints" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/internal/endpoints" ) // A Service implements the base service request and response handling @@ -132,22 +133,44 @@ func retryRules(r *Request) time.Duration { return delay * time.Millisecond } -// Collection of service response codes which are generically -// retryable for all services. +// retryableCodes is a collection of service response codes which are retry-able +// without any further action. var retryableCodes = map[string]struct{}{ - "ExpiredTokenException": struct{}{}, + "RequestError": struct{}{}, "ProvisionedThroughputExceededException": struct{}{}, "Throttling": struct{}{}, } +// credsExpiredCodes is a collection of error codes which signify the credentials +// need to be refreshed. Expired tokens require refreshing of credentials, and +// resigning before the request can be retried. +var credsExpiredCodes = map[string]struct{}{ + "ExpiredToken": struct{}{}, + "ExpiredTokenException": struct{}{}, + "RequestExpired": struct{}{}, // EC2 Only +} + +func isCodeRetryable(code string) bool { + if _, ok := retryableCodes[code]; ok { + return true + } + + return isCodeExpiredCreds(code) +} + +func isCodeExpiredCreds(code string) bool { + _, ok := credsExpiredCodes[code] + return ok +} + // shouldRetry returns if the request should be retried. func shouldRetry(r *Request) bool { if r.HTTPResponse.StatusCode >= 500 { return true } - if err := Error(r.Error); err != nil { - if _, ok := retryableCodes[err.Code]; ok { - return true + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + return isCodeRetryable(err.Code()) } } return false diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/types.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go similarity index 88% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/version.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go index f644ae0c20..7c156dbe2a 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/version.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "0.5.0" +const SDKVersion = "0.6.0" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go new file mode 100644 index 0000000000..c45555a9f0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/apierr/error.go @@ -0,0 +1,139 @@ +// Package apierr represents API error types. +package apierr + +import "fmt" + +// A BaseError wraps the code and message which defines an error. It also +// can be used to wrap an original error object. +// +// Should be used as the root for errors satisfying the awserr.Error. Also +// for any error which does not fit into a specific error wrapper type. +type BaseError struct { + // Classification of error + code string + + // Detailed information about error + message string + + // Optional original error this error is based off of. Allows building + // chained errors. + origErr error +} + +// New returns an error object for the code, message, and err. +// +// code is a short no whitespace phrase depicting the classification of +// the error that is being created. +// +// message is the free flow string containing detailed information about the error. +// +// origErr is the error object which will be nested under the new error to be returned. +func New(code, message string, origErr error) *BaseError { + return &BaseError{ + code: code, + message: message, + origErr: origErr, + } +} + +// Error returns the string representation of the error. +// +// See ErrorWithExtra for formatting. +// +// Satisfies the error interface. +func (b *BaseError) Error() string { + return b.ErrorWithExtra("") +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (b *BaseError) String() string { + return b.Error() +} + +// Code returns the short phrase depicting the classification of the error. +func (b *BaseError) Code() string { + return b.code +} + +// Message returns the error details message. +func (b *BaseError) Message() string { + return b.message +} + +// OrigErr returns the original error if one was set. Nil is returned if no error +// was set. +func (b *BaseError) OrigErr() error { + return b.origErr +} + +// ErrorWithExtra is a helper method to add an extra string to the stratified +// error message. The extra message will be added on the next line below the +// error message like the following: +// +// : +// +// +// If there is a original error the error will be included on a new line. +// +// : +// +// caused by: +func (b *BaseError) ErrorWithExtra(extra string) string { + msg := fmt.Sprintf("%s: %s", b.code, b.message) + if extra != "" { + msg = fmt.Sprintf("%s\n\t%s", msg, extra) + } + if b.origErr != nil { + msg = fmt.Sprintf("%s\ncaused by: %s", msg, b.origErr.Error()) + } + return msg +} + +// A RequestError wraps a request or service error. +// +// Composed of BaseError for code, message, and original error. +type RequestError struct { + *BaseError + statusCode int + requestID string +} + +// NewRequestError returns a wrapped error with additional information for request +// status code, and service requestID. +// +// Should be used to wrap all request which involve service requests. Even if +// the request failed without a service response, but had an HTTP status code +// that may be meaningful. +// +// Also wraps original errors via the BaseError. +func NewRequestError(base *BaseError, statusCode int, requestID string) *RequestError { + return &RequestError{ + BaseError: base, + statusCode: statusCode, + requestID: requestID, + } +} + +// Error returns the string representation of the error. +// Satisfies the error interface. +func (r *RequestError) Error() string { + return r.ErrorWithExtra(fmt.Sprintf("status code: %d, request id: [%s]", + r.statusCode, r.requestID)) +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (r *RequestError) String() string { + return r.Error() +} + +// StatusCode returns the wrapped status code for the error +func (r *RequestError) StatusCode() int { + return r.statusCode +} + +// RequestID returns the wrapped requestID +func (r *RequestError) RequestID() string { + return r.requestID +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go similarity index 92% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go index 8298a5b20b..32e87c8a4a 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.go @@ -1,3 +1,4 @@ +// Package endpoints validates regional endpoints for services. package endpoints //go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.json b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.json similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.json rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints.json diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints_map.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints_map.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_map.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_test.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/endpoints/endpoints_test.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go similarity index 70% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go index 89b334b66d..bdf2bc4f82 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build.go @@ -1,3 +1,4 @@ +// Package ec2query provides serialisation of AWS EC2 requests and responses. package ec2query //go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/input/ec2.json build_test.go @@ -5,8 +6,9 @@ package ec2query import ( "net/url" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/query/queryutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/internal/protocol/query/queryutil" ) // Build builds a request for the EC2 protocol. @@ -16,8 +18,7 @@ func Build(r *aws.Request) { "Version": {r.Service.APIVersion}, } if err := queryutil.Parse(body, r.Params, true); err != nil { - r.Error = err - return + r.Error = apierr.New("Marshal", "failed encoding EC2 Query request", err) } if r.ExpireTime == 0 { diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go similarity index 93% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go index 61f1854fe2..f267f02158 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/build_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/build_test.go @@ -1,22 +1,23 @@ package ec2query_test import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/ec2query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/ec2query" + "github.com/aws/aws-sdk-go/internal/signer/v4" "bytes" "encoding/json" "encoding/xml" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" - "github.com/awslabs/aws-sdk-go/internal/util" - "github.com/stretchr/testify/assert" "io" "io/ioutil" "net/http" "net/url" "testing" "time" + + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/util" + "github.com/stretchr/testify/assert" ) var _ bytes.Buffer // always import bytes @@ -37,10 +38,6 @@ type InputService1ProtocolTest struct { // New returns a new InputService1ProtocolTest client. func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice1protocoltest", @@ -85,11 +82,10 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input return } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (output *InputService1TestShapeInputService1TestCaseOperation1Output, err error) { +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { req, out := c.InputService1TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService1TestCaseOperation1 *aws.Operation @@ -121,10 +117,6 @@ type InputService2ProtocolTest struct { // New returns a new InputService2ProtocolTest client. func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice2protocoltest", @@ -169,11 +161,10 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input return } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (output *InputService2TestShapeInputService2TestCaseOperation1Output, err error) { +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { req, out := c.InputService2TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService2TestCaseOperation1 *aws.Operation @@ -207,10 +198,6 @@ type InputService3ProtocolTest struct { // New returns a new InputService3ProtocolTest client. func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice3protocoltest", @@ -255,11 +242,10 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input return } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (output *InputService3TestShapeInputService3TestCaseOperation1Output, err error) { +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { req, out := c.InputService3TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService3TestCaseOperation1 *aws.Operation @@ -299,10 +285,6 @@ type InputService4ProtocolTest struct { // New returns a new InputService4ProtocolTest client. func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice4protocoltest", @@ -347,11 +329,10 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input return } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (output *InputService4TestShapeInputService4TestCaseOperation1Output, err error) { +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { req, out := c.InputService4TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService4TestCaseOperation1 *aws.Operation @@ -381,10 +362,6 @@ type InputService5ProtocolTest struct { // New returns a new InputService5ProtocolTest client. func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice5protocoltest", @@ -429,11 +406,10 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input return } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (output *InputService5TestShapeInputService5TestCaseOperation1Output, err error) { +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { req, out := c.InputService5TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService5TestCaseOperation1 *aws.Operation @@ -463,10 +439,6 @@ type InputService6ProtocolTest struct { // New returns a new InputService6ProtocolTest client. func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice6protocoltest", @@ -511,11 +483,10 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input return } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (output *InputService6TestShapeInputService6TestCaseOperation1Output, err error) { +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { req, out := c.InputService6TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService6TestCaseOperation1 *aws.Operation @@ -545,10 +516,6 @@ type InputService7ProtocolTest struct { // New returns a new InputService7ProtocolTest client. func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice7protocoltest", @@ -593,11 +560,10 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input return } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (output *InputService7TestShapeInputService7TestCaseOperation1Output, err error) { +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { req, out := c.InputService7TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService7TestCaseOperation1 *aws.Operation @@ -627,10 +593,6 @@ type InputService8ProtocolTest struct { // New returns a new InputService8ProtocolTest client. func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice8protocoltest", @@ -675,11 +637,10 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input return } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (output *InputService8TestShapeInputService8TestCaseOperation1Output, err error) { +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { req, out := c.InputService8TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService8TestCaseOperation1 *aws.Operation @@ -930,4 +891,3 @@ func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { // assert headers } - diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go similarity index 71% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go index aa13622aee..b25ece116f 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal.go @@ -6,8 +6,9 @@ import ( "encoding/xml" "io" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" ) // Unmarshal unmarshals a response body for the EC2 protocol. @@ -17,7 +18,7 @@ func Unmarshal(r *aws.Request) { decoder := xml.NewDecoder(r.HTTPResponse.Body) err := xmlutil.UnmarshalXML(r.Data, decoder, "") if err != nil { - r.Error = err + r.Error = apierr.New("Unmarshal", "failed decoding EC2 Query response", err) return } } @@ -42,12 +43,12 @@ func UnmarshalError(r *aws.Request) { resp := &xmlErrorResponse{} err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) if err != nil && err != io.EOF { - r.Error = err + r.Error = apierr.New("Unmarshal", "failed decoding EC2 Query error response", err) } else { - r.Error = aws.APIError{ - StatusCode: r.HTTPResponse.StatusCode, - Code: resp.Code, - Message: resp.Message, - } + r.Error = apierr.NewRequestError( + apierr.New(resp.Code, resp.Message, nil), + r.HTTPResponse.StatusCode, + resp.RequestID, + ) } } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go similarity index 93% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go index cc9c283d7e..058f47801c 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/ec2query/unmarshal_test.go @@ -1,22 +1,23 @@ package ec2query_test import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/ec2query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/ec2query" + "github.com/aws/aws-sdk-go/internal/signer/v4" "bytes" "encoding/json" "encoding/xml" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" - "github.com/awslabs/aws-sdk-go/internal/util" - "github.com/stretchr/testify/assert" "io" "io/ioutil" "net/http" "net/url" "testing" "time" + + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/util" + "github.com/stretchr/testify/assert" ) var _ bytes.Buffer // always import bytes @@ -37,10 +38,6 @@ type OutputService1ProtocolTest struct { // New returns a new OutputService1ProtocolTest client. func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice1protocoltest", @@ -85,11 +82,10 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp return } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (output *OutputService1TestShapeOutputShape, err error) { +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) { req, out := c.OutputService1TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService1TestCaseOperation1 *aws.Operation @@ -133,10 +129,6 @@ type OutputService2ProtocolTest struct { // New returns a new OutputService2ProtocolTest client. func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice2protocoltest", @@ -181,11 +173,10 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp return } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (output *OutputService2TestShapeOutputShape, err error) { +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputShape, error) { req, out := c.OutputService2TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService2TestCaseOperation1 *aws.Operation @@ -215,10 +206,6 @@ type OutputService3ProtocolTest struct { // New returns a new OutputService3ProtocolTest client. func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice3protocoltest", @@ -263,11 +250,10 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp return } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (output *OutputService3TestShapeOutputShape, err error) { +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputShape, error) { req, out := c.OutputService3TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService3TestCaseOperation1 *aws.Operation @@ -297,10 +283,6 @@ type OutputService4ProtocolTest struct { // New returns a new OutputService4ProtocolTest client. func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice4protocoltest", @@ -345,11 +327,10 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp return } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (output *OutputService4TestShapeOutputShape, err error) { +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputShape, error) { req, out := c.OutputService4TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService4TestCaseOperation1 *aws.Operation @@ -379,10 +360,6 @@ type OutputService5ProtocolTest struct { // New returns a new OutputService5ProtocolTest client. func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice5protocoltest", @@ -427,11 +404,10 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp return } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (output *OutputService5TestShapeOutputShape, err error) { +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputShape, error) { req, out := c.OutputService5TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService5TestCaseOperation1 *aws.Operation @@ -461,10 +437,6 @@ type OutputService6ProtocolTest struct { // New returns a new OutputService6ProtocolTest client. func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice6protocoltest", @@ -509,11 +481,10 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp return } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (output *OutputService6TestShapeOutputShape, err error) { +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputShape, error) { req, out := c.OutputService6TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService6TestCaseOperation1 *aws.Operation @@ -527,7 +498,7 @@ type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct } type OutputService6TestShapeOutputShape struct { - Map *map[string]*OutputService6TestShapeStructureType `type:"map"` + Map map[string]*OutputService6TestShapeStructureType `type:"map"` metadataOutputService6TestShapeOutputShape `json:"-" xml:"-"` } @@ -553,10 +524,6 @@ type OutputService7ProtocolTest struct { // New returns a new OutputService7ProtocolTest client. func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice7protocoltest", @@ -601,11 +568,10 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp return } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (output *OutputService7TestShapeOutputShape, err error) { +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputShape, error) { req, out := c.OutputService7TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService7TestCaseOperation1 *aws.Operation @@ -619,7 +585,7 @@ type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct } type OutputService7TestShapeOutputShape struct { - Map *map[string]*string `type:"map" flattened:"true"` + Map map[string]*string `type:"map" flattened:"true"` metadataOutputService7TestShapeOutputShape `json:"-" xml:"-"` } @@ -635,10 +601,6 @@ type OutputService8ProtocolTest struct { // New returns a new OutputService8ProtocolTest client. func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice8protocoltest", @@ -683,11 +645,10 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp return } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (output *OutputService8TestShapeOutputShape, err error) { +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputShape, error) { req, out := c.OutputService8TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService8TestCaseOperation1 *aws.Operation @@ -701,7 +662,7 @@ type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct } type OutputService8TestShapeOutputShape struct { - Map *map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` + Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` metadataOutputService8TestShapeOutputShape `json:"-" xml:"-"` } @@ -840,8 +801,8 @@ func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"].Foo) - assert.Equal(t, "bar", *(*out.Map)["qux"].Foo) + assert.Equal(t, "bam", *out.Map["baz"].Foo) + assert.Equal(t, "bar", *out.Map["qux"].Foo) } @@ -861,8 +822,8 @@ func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"]) - assert.Equal(t, "bar", *(*out.Map)["qux"]) + assert.Equal(t, "bam", *out.Map["baz"]) + assert.Equal(t, "bar", *out.Map["qux"]) } @@ -882,8 +843,7 @@ func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"]) - assert.Equal(t, "bar", *(*out.Map)["qux"]) + assert.Equal(t, "bam", *out.Map["baz"]) + assert.Equal(t, "bar", *out.Map["qux"]) } - diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go similarity index 71% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go index 36a473c38b..0f17031a0d 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build.go @@ -1,3 +1,4 @@ +// Package query provides serialisation of AWS query requests, and responses. package query //go:generate go run ../../fixtures/protocol/generate.go ../../fixtures/protocol/input/query.json build_test.go @@ -5,8 +6,9 @@ package query import ( "net/url" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/query/queryutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/internal/protocol/query/queryutil" ) // Build builds a request for an AWS Query service. @@ -16,7 +18,7 @@ func Build(r *aws.Request) { "Version": {r.Service.APIVersion}, } if err := queryutil.Parse(body, r.Params, false); err != nil { - r.Error = err + r.Error = apierr.New("Marshal", "failed encoding Query request", err) return } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go similarity index 92% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go index 284b96134c..da266758b4 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/build_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/build_test.go @@ -1,22 +1,23 @@ package query_test import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/query" + "github.com/aws/aws-sdk-go/internal/signer/v4" "bytes" "encoding/json" "encoding/xml" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" - "github.com/awslabs/aws-sdk-go/internal/util" - "github.com/stretchr/testify/assert" "io" "io/ioutil" "net/http" "net/url" "testing" "time" + + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/util" + "github.com/stretchr/testify/assert" ) var _ bytes.Buffer // always import bytes @@ -37,10 +38,6 @@ type InputService1ProtocolTest struct { // New returns a new InputService1ProtocolTest client. func NewInputService1ProtocolTest(config *aws.Config) *InputService1ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice1protocoltest", @@ -85,11 +82,10 @@ func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input return } -func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (output *InputService1TestShapeInputService1TestCaseOperation1Output, err error) { +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { req, out := c.InputService1TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService1TestCaseOperation1 *aws.Operation @@ -121,10 +117,6 @@ type InputService2ProtocolTest struct { // New returns a new InputService2ProtocolTest client. func NewInputService2ProtocolTest(config *aws.Config) *InputService2ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice2protocoltest", @@ -169,11 +161,10 @@ func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input return } -func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (output *InputService2TestShapeInputService2TestCaseOperation1Output, err error) { +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputShape) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { req, out := c.InputService2TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService2TestCaseOperation1 *aws.Operation @@ -213,10 +204,6 @@ type InputService3ProtocolTest struct { // New returns a new InputService3ProtocolTest client. func NewInputService3ProtocolTest(config *aws.Config) *InputService3ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice3protocoltest", @@ -261,11 +248,10 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input return } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (output *InputService3TestShapeInputService3TestCaseOperation1Output, err error) { +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { req, out := c.InputService3TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService3TestCaseOperation1 *aws.Operation @@ -289,11 +275,10 @@ func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input return } -func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (output *InputService3TestShapeInputService3TestCaseOperation2Output, err error) { +func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { req, out := c.InputService3TestCaseOperation2Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService3TestCaseOperation2 *aws.Operation @@ -331,10 +316,6 @@ type InputService4ProtocolTest struct { // New returns a new InputService4ProtocolTest client. func NewInputService4ProtocolTest(config *aws.Config) *InputService4ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice4protocoltest", @@ -379,11 +360,10 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input return } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (output *InputService4TestShapeInputService4TestCaseOperation1Output, err error) { +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { req, out := c.InputService4TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService4TestCaseOperation1 *aws.Operation @@ -407,11 +387,10 @@ func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input return } -func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputShape) (output *InputService4TestShapeInputService4TestCaseOperation2Output, err error) { +func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) { req, out := c.InputService4TestCaseOperation2Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService4TestCaseOperation2 *aws.Operation @@ -451,10 +430,6 @@ type InputService5ProtocolTest struct { // New returns a new InputService5ProtocolTest client. func NewInputService5ProtocolTest(config *aws.Config) *InputService5ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice5protocoltest", @@ -499,11 +474,10 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input return } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (output *InputService5TestShapeInputService5TestCaseOperation1Output, err error) { +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { req, out := c.InputService5TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService5TestCaseOperation1 *aws.Operation @@ -527,11 +501,10 @@ func (c *InputService5ProtocolTest) InputService5TestCaseOperation2Request(input return } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation2(input *InputService5TestShapeInputShape) (output *InputService5TestShapeInputService5TestCaseOperation2Output, err error) { +func (c *InputService5ProtocolTest) InputService5TestCaseOperation2(input *InputService5TestShapeInputShape) (*InputService5TestShapeInputService5TestCaseOperation2Output, error) { req, out := c.InputService5TestCaseOperation2Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService5TestCaseOperation2 *aws.Operation @@ -553,7 +526,7 @@ type metadataInputService5TestShapeInputService5TestCaseOperation2Output struct } type InputService5TestShapeInputShape struct { - MapArg *map[string]*string `type:"map"` + MapArg map[string]*string `type:"map"` metadataInputService5TestShapeInputShape `json:"-" xml:"-"` } @@ -569,10 +542,6 @@ type InputService6ProtocolTest struct { // New returns a new InputService6ProtocolTest client. func NewInputService6ProtocolTest(config *aws.Config) *InputService6ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice6protocoltest", @@ -617,11 +586,10 @@ func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input return } -func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (output *InputService6TestShapeInputService6TestCaseOperation1Output, err error) { +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputShape) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { req, out := c.InputService6TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService6TestCaseOperation1 *aws.Operation @@ -635,7 +603,7 @@ type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct } type InputService6TestShapeInputShape struct { - MapArg *map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"` + MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"` metadataInputService6TestShapeInputShape `json:"-" xml:"-"` } @@ -651,10 +619,6 @@ type InputService7ProtocolTest struct { // New returns a new InputService7ProtocolTest client. func NewInputService7ProtocolTest(config *aws.Config) *InputService7ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice7protocoltest", @@ -699,11 +663,10 @@ func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input return } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (output *InputService7TestShapeInputService7TestCaseOperation1Output, err error) { +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputShape) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { req, out := c.InputService7TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService7TestCaseOperation1 *aws.Operation @@ -733,10 +696,6 @@ type InputService8ProtocolTest struct { // New returns a new InputService8ProtocolTest client. func NewInputService8ProtocolTest(config *aws.Config) *InputService8ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice8protocoltest", @@ -781,11 +740,10 @@ func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input return } -func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (output *InputService8TestShapeInputService8TestCaseOperation1Output, err error) { +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputShape) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { req, out := c.InputService8TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService8TestCaseOperation1 *aws.Operation @@ -815,10 +773,6 @@ type InputService9ProtocolTest struct { // New returns a new InputService9ProtocolTest client. func NewInputService9ProtocolTest(config *aws.Config) *InputService9ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "inputservice9protocoltest", @@ -863,11 +817,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation1Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { req, out := c.InputService9TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation1 *aws.Operation @@ -891,11 +844,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation2(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation2Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation2(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation2Output, error) { req, out := c.InputService9TestCaseOperation2Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation2 *aws.Operation @@ -919,11 +871,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation3Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation3(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation3Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation3(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation3Output, error) { req, out := c.InputService9TestCaseOperation3Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation3 *aws.Operation @@ -947,11 +898,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation4Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation4(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation4Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation4(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation4Output, error) { req, out := c.InputService9TestCaseOperation4Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation4 *aws.Operation @@ -975,11 +925,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation5Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation5(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation5Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation5(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation5Output, error) { req, out := c.InputService9TestCaseOperation5Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation5 *aws.Operation @@ -1003,11 +952,10 @@ func (c *InputService9ProtocolTest) InputService9TestCaseOperation6Request(input return } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation6(input *InputService9TestShapeInputShape) (output *InputService9TestShapeInputService9TestCaseOperation6Output, err error) { +func (c *InputService9ProtocolTest) InputService9TestCaseOperation6(input *InputService9TestShapeInputShape) (*InputService9TestShapeInputService9TestCaseOperation6Output, error) { req, out := c.InputService9TestCaseOperation6Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opInputService9TestCaseOperation6 *aws.Operation @@ -1075,7 +1023,7 @@ type InputService9TestShapeRecursiveStructType struct { RecursiveList []*InputService9TestShapeRecursiveStructType `type:"list"` - RecursiveMap *map[string]*InputService9TestShapeRecursiveStructType `type:"map"` + RecursiveMap map[string]*InputService9TestShapeRecursiveStructType `type:"map"` RecursiveStruct *InputService9TestShapeRecursiveStructType `type:"structure"` @@ -1264,7 +1212,7 @@ func TestInputService5ProtocolTestSerializeMapTypeCase1(t *testing.T) { svc.Endpoint = "https://test" input := &InputService5TestShapeInputShape{ - MapArg: &map[string]*string{ + MapArg: map[string]*string{ "key1": aws.String("val1"), "key2": aws.String("val2"), }, @@ -1293,7 +1241,7 @@ func TestInputService5ProtocolTestSerializeMapTypeCase2(t *testing.T) { svc.Endpoint = "https://test" input := &InputService5TestShapeInputShape{ - MapArg: &map[string]*string{}, + MapArg: map[string]*string{}, } req, _ := svc.InputService5TestCaseOperation2Request(input) r := req.HTTPRequest @@ -1319,7 +1267,7 @@ func TestInputService6ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testi svc.Endpoint = "https://test" input := &InputService6TestShapeInputShape{ - MapArg: &map[string]*string{ + MapArg: map[string]*string{ "key1": aws.String("val1"), "key2": aws.String("val2"), }, @@ -1565,7 +1513,7 @@ func TestInputService9ProtocolTestRecursiveShapesCase6(t *testing.T) { input := &InputService9TestShapeInputShape{ RecursiveStruct: &InputService9TestShapeRecursiveStructType{ - RecursiveMap: &map[string]*InputService9TestShapeRecursiveStructType{ + RecursiveMap: map[string]*InputService9TestShapeRecursiveStructType{ "bar": &InputService9TestShapeRecursiveStructType{ NoRecurse: aws.String("bar"), }, @@ -1593,4 +1541,3 @@ func TestInputService9ProtocolTestRecursiveShapesCase6(t *testing.T) { // assert headers } - diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/queryutil/queryutil.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/queryutil/queryutil.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/queryutil/queryutil.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/queryutil/queryutil.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go similarity index 74% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go index fde5e131ae..8acdd2274c 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal.go @@ -5,8 +5,9 @@ package query import ( "encoding/xml" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" ) // Unmarshal unmarshals a response for an AWS Query service. @@ -16,7 +17,7 @@ func Unmarshal(r *aws.Request) { decoder := xml.NewDecoder(r.HTTPResponse.Body) err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") if err != nil { - r.Error = err + r.Error = apierr.New("Unmarshal", "failed decoding Query response", err) return } } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go similarity index 63% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_error.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go index caa4b9c02c..deb529524a 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_error.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_error.go @@ -4,7 +4,8 @@ import ( "encoding/xml" "io" - "github.com/awslabs/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" ) type xmlErrorResponse struct { @@ -21,12 +22,12 @@ func UnmarshalError(r *aws.Request) { resp := &xmlErrorResponse{} err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) if err != nil && err != io.EOF { - r.Error = err + r.Error = apierr.New("Unmarshal", "failed to decode query XML error response", err) } else { - r.Error = aws.APIError{ - StatusCode: r.HTTPResponse.StatusCode, - Code: resp.Code, - Message: resp.Message, - } + r.Error = apierr.NewRequestError( + apierr.New(resp.Code, resp.Message, nil), + r.HTTPResponse.StatusCode, + resp.RequestID, + ) } } diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go similarity index 94% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go index a0f82c662f..a17f56ccd5 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/query/unmarshal_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/query/unmarshal_test.go @@ -1,22 +1,23 @@ package query_test import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/query" + "github.com/aws/aws-sdk-go/internal/signer/v4" "bytes" "encoding/json" "encoding/xml" - "github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil" - "github.com/awslabs/aws-sdk-go/internal/util" - "github.com/stretchr/testify/assert" "io" "io/ioutil" "net/http" "net/url" "testing" "time" + + "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/internal/util" + "github.com/stretchr/testify/assert" ) var _ bytes.Buffer // always import bytes @@ -37,10 +38,6 @@ type OutputService1ProtocolTest struct { // New returns a new OutputService1ProtocolTest client. func NewOutputService1ProtocolTest(config *aws.Config) *OutputService1ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice1protocoltest", @@ -85,11 +82,10 @@ func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(inp return } -func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (output *OutputService1TestShapeOutputShape, err error) { +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputShape, error) { req, out := c.OutputService1TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService1TestCaseOperation1 *aws.Operation @@ -135,10 +131,6 @@ type OutputService2ProtocolTest struct { // New returns a new OutputService2ProtocolTest client. func NewOutputService2ProtocolTest(config *aws.Config) *OutputService2ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice2protocoltest", @@ -183,11 +175,10 @@ func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(inp return } -func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (output *OutputService2TestShapeOutputShape, err error) { +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputShape, error) { req, out := c.OutputService2TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService2TestCaseOperation1 *aws.Operation @@ -219,10 +210,6 @@ type OutputService3ProtocolTest struct { // New returns a new OutputService3ProtocolTest client. func NewOutputService3ProtocolTest(config *aws.Config) *OutputService3ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice3protocoltest", @@ -267,11 +254,10 @@ func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(inp return } -func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (output *OutputService3TestShapeOutputShape, err error) { +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputShape, error) { req, out := c.OutputService3TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService3TestCaseOperation1 *aws.Operation @@ -301,10 +287,6 @@ type OutputService4ProtocolTest struct { // New returns a new OutputService4ProtocolTest client. func NewOutputService4ProtocolTest(config *aws.Config) *OutputService4ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice4protocoltest", @@ -349,11 +331,10 @@ func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(inp return } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (output *OutputService4TestShapeOutputShape, err error) { +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputShape, error) { req, out := c.OutputService4TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService4TestCaseOperation1 *aws.Operation @@ -383,10 +364,6 @@ type OutputService5ProtocolTest struct { // New returns a new OutputService5ProtocolTest client. func NewOutputService5ProtocolTest(config *aws.Config) *OutputService5ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice5protocoltest", @@ -431,11 +408,10 @@ func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(inp return } -func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (output *OutputService5TestShapeOutputShape, err error) { +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputShape, error) { req, out := c.OutputService5TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService5TestCaseOperation1 *aws.Operation @@ -465,10 +441,6 @@ type OutputService6ProtocolTest struct { // New returns a new OutputService6ProtocolTest client. func NewOutputService6ProtocolTest(config *aws.Config) *OutputService6ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice6protocoltest", @@ -513,11 +485,10 @@ func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(inp return } -func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (output *OutputService6TestShapeOutputShape, err error) { +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputShape, error) { req, out := c.OutputService6TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService6TestCaseOperation1 *aws.Operation @@ -547,10 +518,6 @@ type OutputService7ProtocolTest struct { // New returns a new OutputService7ProtocolTest client. func NewOutputService7ProtocolTest(config *aws.Config) *OutputService7ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice7protocoltest", @@ -595,11 +562,10 @@ func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(inp return } -func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (output *OutputService7TestShapeOutputShape, err error) { +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputShape, error) { req, out := c.OutputService7TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService7TestCaseOperation1 *aws.Operation @@ -629,10 +595,6 @@ type OutputService8ProtocolTest struct { // New returns a new OutputService8ProtocolTest client. func NewOutputService8ProtocolTest(config *aws.Config) *OutputService8ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice8protocoltest", @@ -677,11 +639,10 @@ func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(inp return } -func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (output *OutputService8TestShapeOutputShape, err error) { +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputShape, error) { req, out := c.OutputService8TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService8TestCaseOperation1 *aws.Operation @@ -725,10 +686,6 @@ type OutputService9ProtocolTest struct { // New returns a new OutputService9ProtocolTest client. func NewOutputService9ProtocolTest(config *aws.Config) *OutputService9ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice9protocoltest", @@ -773,11 +730,10 @@ func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(inp return } -func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (output *OutputService9TestShapeOutputShape, err error) { +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputShape, error) { req, out := c.OutputService9TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService9TestCaseOperation1 *aws.Operation @@ -821,10 +777,6 @@ type OutputService10ProtocolTest struct { // New returns a new OutputService10ProtocolTest client. func NewOutputService10ProtocolTest(config *aws.Config) *OutputService10ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice10protocoltest", @@ -869,11 +821,10 @@ func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(i return } -func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (output *OutputService10TestShapeOutputShape, err error) { +func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputShape, error) { req, out := c.OutputService10TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService10TestCaseOperation1 *aws.Operation @@ -903,10 +854,6 @@ type OutputService11ProtocolTest struct { // New returns a new OutputService11ProtocolTest client. func NewOutputService11ProtocolTest(config *aws.Config) *OutputService11ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice11protocoltest", @@ -951,11 +898,10 @@ func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(i return } -func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (output *OutputService11TestShapeOutputShape, err error) { +func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputShape, error) { req, out := c.OutputService11TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService11TestCaseOperation1 *aws.Operation @@ -969,7 +915,7 @@ type metadataOutputService11TestShapeOutputService11TestCaseOperation1Input stru } type OutputService11TestShapeOutputShape struct { - Map *map[string]*OutputService11TestShapeStructType `type:"map"` + Map map[string]*OutputService11TestShapeStructType `type:"map"` metadataOutputService11TestShapeOutputShape `json:"-" xml:"-"` } @@ -995,10 +941,6 @@ type OutputService12ProtocolTest struct { // New returns a new OutputService12ProtocolTest client. func NewOutputService12ProtocolTest(config *aws.Config) *OutputService12ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice12protocoltest", @@ -1043,11 +985,10 @@ func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(i return } -func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (output *OutputService12TestShapeOutputShape, err error) { +func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputShape, error) { req, out := c.OutputService12TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService12TestCaseOperation1 *aws.Operation @@ -1061,7 +1002,7 @@ type metadataOutputService12TestShapeOutputService12TestCaseOperation1Input stru } type OutputService12TestShapeOutputShape struct { - Map *map[string]*string `type:"map" flattened:"true"` + Map map[string]*string `type:"map" flattened:"true"` metadataOutputService12TestShapeOutputShape `json:"-" xml:"-"` } @@ -1077,10 +1018,6 @@ type OutputService13ProtocolTest struct { // New returns a new OutputService13ProtocolTest client. func NewOutputService13ProtocolTest(config *aws.Config) *OutputService13ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice13protocoltest", @@ -1125,11 +1062,10 @@ func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(i return } -func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (output *OutputService13TestShapeOutputShape, err error) { +func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputShape, error) { req, out := c.OutputService13TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService13TestCaseOperation1 *aws.Operation @@ -1143,7 +1079,7 @@ type metadataOutputService13TestShapeOutputService13TestCaseOperation1Input stru } type OutputService13TestShapeOutputShape struct { - Map *map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + Map map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` metadataOutputService13TestShapeOutputShape `json:"-" xml:"-"` } @@ -1159,10 +1095,6 @@ type OutputService14ProtocolTest struct { // New returns a new OutputService14ProtocolTest client. func NewOutputService14ProtocolTest(config *aws.Config) *OutputService14ProtocolTest { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "outputservice14protocoltest", @@ -1207,11 +1139,10 @@ func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(i return } -func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (output *OutputService14TestShapeOutputShape, err error) { +func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputShape, error) { req, out := c.OutputService14TestCaseOperation1Request(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opOutputService14TestCaseOperation1 *aws.Operation @@ -1225,7 +1156,7 @@ type metadataOutputService14TestShapeOutputService14TestCaseOperation1Input stru } type OutputService14TestShapeOutputShape struct { - Map *map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` + Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` metadataOutputService14TestShapeOutputShape `json:"-" xml:"-"` } @@ -1476,8 +1407,8 @@ func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"].Foo) - assert.Equal(t, "bar", *(*out.Map)["qux"].Foo) + assert.Equal(t, "bam", *out.Map["baz"].Foo) + assert.Equal(t, "bar", *out.Map["qux"].Foo) } @@ -1497,8 +1428,8 @@ func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"]) - assert.Equal(t, "bar", *(*out.Map)["qux"]) + assert.Equal(t, "bam", *out.Map["baz"]) + assert.Equal(t, "bar", *out.Map["qux"]) } @@ -1518,7 +1449,7 @@ func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testin // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bar", *(*out.Map)["qux"]) + assert.Equal(t, "bar", *out.Map["qux"]) } @@ -1538,8 +1469,7 @@ func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) { // assert response assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *(*out.Map)["baz"]) - assert.Equal(t, "bar", *(*out.Map)["qux"]) + assert.Equal(t, "bam", *out.Map["baz"]) + assert.Equal(t, "bar", *out.Map["qux"]) } - diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go new file mode 100644 index 0000000000..38c4512bea --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/build.go @@ -0,0 +1,212 @@ +// Package rest provides RESTful serialisation of AWS requests and responses. +package rest + +import ( + "bytes" + "encoding/base64" + "fmt" + "io" + "net/url" + "path" + "reflect" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" +) + +// RFC822 returns an RFC822 formatted timestamp for AWS protocols +const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT" + +// Whether the byte value can be sent without escaping in AWS URLs +var noEscape [256]bool + +func init() { + for i := 0; i < len(noEscape); i++ { + // AWS expects every character except these to be escaped + noEscape[i] = (i >= 'A' && i <= 'Z') || + (i >= 'a' && i <= 'z') || + (i >= '0' && i <= '9') || + i == '-' || + i == '.' || + i == '_' || + i == '~' + } +} + +// Build builds the REST component of a service request. +func Build(r *aws.Request) { + if r.ParamsFilled() { + v := reflect.ValueOf(r.Params).Elem() + buildLocationElements(r, v) + buildBody(r, v) + } +} + +func buildLocationElements(r *aws.Request, v reflect.Value) { + query := r.HTTPRequest.URL.Query() + + for i := 0; i < v.NumField(); i++ { + m := v.Field(i) + if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) { + continue + } + + if m.IsValid() { + field := v.Type().Field(i) + name := field.Tag.Get("locationName") + if name == "" { + name = field.Name + } + if m.Kind() == reflect.Ptr { + m = m.Elem() + } + if !m.IsValid() { + continue + } + + switch field.Tag.Get("location") { + case "headers": // header maps + buildHeaderMap(r, m, field.Tag.Get("locationName")) + case "header": + buildHeader(r, m, name) + case "uri": + buildURI(r, m, name) + case "querystring": + buildQueryString(r, m, name, query) + } + } + if r.Error != nil { + return + } + } + + r.HTTPRequest.URL.RawQuery = query.Encode() + updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path) +} + +func buildBody(r *aws.Request, v reflect.Value) { + if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { + if payloadName := field.Tag.Get("payload"); payloadName != "" { + pfield, _ := v.Type().FieldByName(payloadName) + if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { + payload := reflect.Indirect(v.FieldByName(payloadName)) + if payload.IsValid() && payload.Interface() != nil { + switch reader := payload.Interface().(type) { + case io.ReadSeeker: + r.SetReaderBody(reader) + case []byte: + r.SetBufferBody(reader) + case string: + r.SetStringBody(reader) + default: + r.Error = apierr.New("Marshal", + "failed to encode REST request", + fmt.Errorf("unknown payload type %s", payload.Type())) + } + } + } + } + } +} + +func buildHeader(r *aws.Request, v reflect.Value, name string) { + str, err := convertType(v) + if err != nil { + r.Error = apierr.New("Marshal", "failed to encode REST request", err) + } else if str != nil { + r.HTTPRequest.Header.Add(name, *str) + } +} + +func buildHeaderMap(r *aws.Request, v reflect.Value, prefix string) { + for _, key := range v.MapKeys() { + str, err := convertType(v.MapIndex(key)) + if err != nil { + r.Error = apierr.New("Marshal", "failed to encode REST request", err) + } else if str != nil { + r.HTTPRequest.Header.Add(prefix+key.String(), *str) + } + } +} + +func buildURI(r *aws.Request, v reflect.Value, name string) { + value, err := convertType(v) + if err != nil { + r.Error = apierr.New("Marshal", "failed to encode REST request", err) + } else if value != nil { + uri := r.HTTPRequest.URL.Path + uri = strings.Replace(uri, "{"+name+"}", EscapePath(*value, true), -1) + uri = strings.Replace(uri, "{"+name+"+}", EscapePath(*value, false), -1) + r.HTTPRequest.URL.Path = uri + } +} + +func buildQueryString(r *aws.Request, v reflect.Value, name string, query url.Values) { + str, err := convertType(v) + if err != nil { + r.Error = apierr.New("Marshal", "failed to encode REST request", err) + } else if str != nil { + query.Set(name, *str) + } +} + +func updatePath(url *url.URL, urlPath string) { + scheme, query := url.Scheme, url.RawQuery + + // clean up path + urlPath = path.Clean(urlPath) + + // get formatted URL minus scheme so we can build this into Opaque + url.Scheme, url.Path, url.RawQuery = "", "", "" + s := url.String() + url.Scheme = scheme + url.RawQuery = query + + // build opaque URI + url.Opaque = s + urlPath +} + +// EscapePath escapes part of a URL path in Amazon style +func EscapePath(path string, encodeSep bool) string { + var buf bytes.Buffer + for i := 0; i < len(path); i++ { + c := path[i] + if noEscape[c] || (c == '/' && !encodeSep) { + buf.WriteByte(c) + } else { + buf.WriteByte('%') + buf.WriteString(strings.ToUpper(strconv.FormatUint(uint64(c), 16))) + } + } + return buf.String() +} + +func convertType(v reflect.Value) (*string, error) { + v = reflect.Indirect(v) + if !v.IsValid() { + return nil, nil + } + + var str string + switch value := v.Interface().(type) { + case string: + str = value + case []byte: + str = base64.StdEncoding.EncodeToString(value) + case bool: + str = strconv.FormatBool(value) + case int64: + str = strconv.FormatInt(value, 10) + case float64: + str = strconv.FormatFloat(value, 'f', -1, 64) + case time.Time: + str = value.UTC().Format(RFC822) + default: + err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) + return nil, err + } + return &str, nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/payload.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/payload.go new file mode 100644 index 0000000000..1f603bb719 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/payload.go @@ -0,0 +1,45 @@ +package rest + +import "reflect" + +// PayloadMember returns the payload field member of i if there is one, or nil. +func PayloadMember(i interface{}) interface{} { + if i == nil { + return nil + } + + v := reflect.ValueOf(i).Elem() + if !v.IsValid() { + return nil + } + if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { + if payloadName := field.Tag.Get("payload"); payloadName != "" { + field, _ := v.Type().FieldByName(payloadName) + if field.Tag.Get("type") != "structure" { + return nil + } + + payload := v.FieldByName(payloadName) + if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { + return payload.Interface() + } + } + } + return nil +} + +// PayloadType returns the type of a payload field member of i if there is one, or "". +func PayloadType(i interface{}) string { + v := reflect.Indirect(reflect.ValueOf(i)) + if !v.IsValid() { + return "" + } + if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { + if payloadName := field.Tag.Get("payload"); payloadName != "" { + if member, ok := v.Type().FieldByName(payloadName); ok { + return member.Tag.Get("type") + } + } + } + return "" +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go new file mode 100644 index 0000000000..009c5c9509 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/rest/unmarshal.go @@ -0,0 +1,174 @@ +package rest + +import ( + "encoding/base64" + "fmt" + "io/ioutil" + "net/http" + "reflect" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/apierr" +) + +// Unmarshal unmarshals the REST component of a response in a REST service. +func Unmarshal(r *aws.Request) { + if r.DataFilled() { + v := reflect.Indirect(reflect.ValueOf(r.Data)) + unmarshalBody(r, v) + unmarshalLocationElements(r, v) + } +} + +func unmarshalBody(r *aws.Request, v reflect.Value) { + if field, ok := v.Type().FieldByName("SDKShapeTraits"); ok { + if payloadName := field.Tag.Get("payload"); payloadName != "" { + pfield, _ := v.Type().FieldByName(payloadName) + if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { + payload := v.FieldByName(payloadName) + if payload.IsValid() { + switch payload.Interface().(type) { + case []byte: + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + } else { + payload.Set(reflect.ValueOf(b)) + } + case *string: + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + } else { + str := string(b) + payload.Set(reflect.ValueOf(&str)) + } + default: + switch payload.Type().String() { + case "io.ReadSeeker": + payload.Set(reflect.ValueOf(aws.ReadSeekCloser(r.HTTPResponse.Body))) + case "aws.ReadSeekCloser", "io.ReadCloser": + payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) + default: + r.Error = apierr.New("Unmarshal", + "failed to decode REST response", + fmt.Errorf("unknown payload type %s", payload.Type())) + } + } + } + } + } + } +} + +func unmarshalLocationElements(r *aws.Request, v reflect.Value) { + for i := 0; i < v.NumField(); i++ { + m, field := v.Field(i), v.Type().Field(i) + if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { + continue + } + + if m.IsValid() { + name := field.Tag.Get("locationName") + if name == "" { + name = field.Name + } + + switch field.Tag.Get("location") { + case "statusCode": + unmarshalStatusCode(m, r.HTTPResponse.StatusCode) + case "header": + err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name)) + if err != nil { + r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + break + } + case "headers": + prefix := field.Tag.Get("locationName") + err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) + if err != nil { + r.Error = apierr.New("Unmarshal", "failed to decode REST response", err) + break + } + } + } + if r.Error != nil { + return + } + } +} + +func unmarshalStatusCode(v reflect.Value, statusCode int) { + if !v.IsValid() { + return + } + + switch v.Interface().(type) { + case *int64: + s := int64(statusCode) + v.Set(reflect.ValueOf(&s)) + } +} + +func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { + switch r.Interface().(type) { + case map[string]*string: // we only support string map value types + out := map[string]*string{} + for k, v := range headers { + k = http.CanonicalHeaderKey(k) + if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) { + out[k[len(prefix):]] = &v[0] + } + } + r.Set(reflect.ValueOf(out)) + } + return nil +} + +func unmarshalHeader(v reflect.Value, header string) error { + if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { + return nil + } + + switch v.Interface().(type) { + case *string: + v.Set(reflect.ValueOf(&header)) + case []byte: + b, err := base64.StdEncoding.DecodeString(header) + if err != nil { + return err + } + v.Set(reflect.ValueOf(&b)) + case *bool: + b, err := strconv.ParseBool(header) + if err != nil { + return err + } + v.Set(reflect.ValueOf(&b)) + case *int64: + i, err := strconv.ParseInt(header, 10, 64) + if err != nil { + return err + } + v.Set(reflect.ValueOf(&i)) + case *float64: + f, err := strconv.ParseFloat(header, 64) + if err != nil { + return err + } + v.Set(reflect.ValueOf(&f)) + case *time.Time: + t, err := time.Parse(RFC822, header) + if err != nil { + return err + } + v.Set(reflect.ValueOf(&t)) + default: + err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) + return err + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/build.go similarity index 98% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/build.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/build.go index 8791bfdabf..d3db250231 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/build.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/build.go @@ -1,3 +1,4 @@ +// Package xmlutil provides XML serialisation of AWS requests and responses. package xmlutil import ( diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go similarity index 97% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go index a84b269a46..a7b7a60b2e 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/unmarshal.go @@ -172,15 +172,8 @@ func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { // parseMap deserializes a map from an XMLNode. The direct children of the XMLNode // will also be deserialized as map entries. func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - t := r.Type() - if r.Kind() == reflect.Ptr { - t = t.Elem() - if r.IsNil() { - r.Set(reflect.New(t)) - r.Elem().Set(reflect.MakeMap(t)) - } - - r = r.Elem() + if r.IsNil() { + r.Set(reflect.MakeMap(r.Type())) } if tag.Get("flattened") == "" { // look at all child entries diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/xml_to_struct.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/xml_to_struct.go similarity index 100% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/protocol/xml/xmlutil/xml_to_struct.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil/xml_to_struct.go diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/functional_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/functional_test.go similarity index 87% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/functional_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/functional_test.go index 1d51135162..fbb0e41cdc 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/functional_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/functional_test.go @@ -1,5 +1,3 @@ -// +build !integration - package v4_test import ( @@ -7,9 +5,9 @@ import ( "testing" "time" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/test/unit" - "github.com/awslabs/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/service/s3" "github.com/stretchr/testify/assert" ) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go similarity index 96% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go index 673b19dfed..8efda14209 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4.go @@ -1,3 +1,4 @@ +// Package v4 implements signing for AWS V4 signer package v4 import ( @@ -13,9 +14,10 @@ import ( "strings" "time" - "github.com/awslabs/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/protocol/rest" - "github.com/awslabs/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws" ) const ( @@ -243,6 +245,10 @@ func (v4 *signer) buildCanonicalString() { uri = "/" } + if v4.ServiceName != "s3" { + uri = rest.EscapePath(uri, false) + } + v4.canonicalString = strings.Join([]string{ v4.Request.Method, uri, diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go similarity index 94% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go index 5e53702660..20f655ac6c 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/signer/v4/v4_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/internal/signer/v4/v4_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" "github.com/stretchr/testify/assert" ) @@ -54,7 +54,7 @@ func TestPresignRequest(t *testing.T) { expectedDate := "19700101T000000Z" expectedHeaders := "host;x-amz-meta-other-header;x-amz-target" - expectedSig := "4c86bacebb78e458e8e898e93547513079d67ab95d3d5c02236889e21ea0df2b" + expectedSig := "5eeedebf6f995145ce56daa02902d10485246d3defb34f97b973c1f40ab82d36" expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" q := signer.Request.URL.Query() @@ -69,7 +69,7 @@ func TestSignRequest(t *testing.T) { signer.sign() expectedDate := "19700101T000000Z" - expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-meta-other-header;x-amz-security-token;x-amz-target, Signature=d4df864b291252d2c9206be75963db54db09ca70265622cc787cbe50ca0efcc8" + expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=host;x-amz-date;x-amz-meta-other-header;x-amz-security-token;x-amz-target, Signature=69ada33fec48180dab153576e4dd80c4e04124f80dda3eccfed8a67c2b91ed5e" q := signer.Request.Header assert.Equal(t, expectedSig, q.Get("Authorization")) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go similarity index 80% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/api.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go index 6ee46a98ae..9255ab75c8 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/awslabs/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws" ) var oprw sync.Mutex @@ -39,11 +39,10 @@ func (c *EC2) AcceptVPCPeeringConnectionRequest(input *AcceptVPCPeeringConnectio // connection must be in the pending-acceptance state, and you must be the owner // of the peer VPC. Use the DescribeVpcPeeringConnections request to view your // outstanding VPC peering connection requests. -func (c *EC2) AcceptVPCPeeringConnection(input *AcceptVPCPeeringConnectionInput) (output *AcceptVPCPeeringConnectionOutput, err error) { +func (c *EC2) AcceptVPCPeeringConnection(input *AcceptVPCPeeringConnectionInput) (*AcceptVPCPeeringConnectionOutput, error) { req, out := c.AcceptVPCPeeringConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAcceptVPCPeeringConnection *aws.Operation @@ -76,11 +75,10 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *aws.Requ // An Elastic IP address is for use either in the EC2-Classic platform or in // a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) AllocateAddress(input *AllocateAddressInput) (output *AllocateAddressOutput, err error) { +func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutput, error) { req, out := c.AllocateAddressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAllocateAddress *aws.Operation @@ -119,11 +117,10 @@ func (c *EC2) AssignPrivateIPAddressesRequest(input *AssignPrivateIPAddressesInp // in the Amazon Elastic Compute Cloud User Guide. // // AssignPrivateIpAddresses is available only in EC2-VPC. -func (c *EC2) AssignPrivateIPAddresses(input *AssignPrivateIPAddressesInput) (output *AssignPrivateIPAddressesOutput, err error) { +func (c *EC2) AssignPrivateIPAddresses(input *AssignPrivateIPAddressesInput) (*AssignPrivateIPAddressesOutput, error) { req, out := c.AssignPrivateIPAddressesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAssignPrivateIPAddresses *aws.Operation @@ -168,11 +165,10 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *aws.Re // // This is an idempotent operation. If you perform the operation more than // once, Amazon EC2 doesn't return an error. -func (c *EC2) AssociateAddress(input *AssociateAddressInput) (output *AssociateAddressOutput, err error) { +func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressOutput, error) { req, out := c.AssociateAddressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAssociateAddress *aws.Operation @@ -212,11 +208,10 @@ func (c *EC2) AssociateDHCPOptionsRequest(input *AssociateDHCPOptionsInput) (req // // For more information, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) AssociateDHCPOptions(input *AssociateDHCPOptionsInput) (output *AssociateDHCPOptionsOutput, err error) { +func (c *EC2) AssociateDHCPOptions(input *AssociateDHCPOptionsInput) (*AssociateDHCPOptionsOutput, error) { req, out := c.AssociateDHCPOptionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAssociateDHCPOptions *aws.Operation @@ -252,11 +247,10 @@ func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req * // // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (output *AssociateRouteTableOutput, err error) { +func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRouteTableOutput, error) { req, out := c.AssociateRouteTableRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAssociateRouteTable *aws.Operation @@ -296,11 +290,10 @@ func (c *EC2) AttachClassicLinkVPCRequest(input *AttachClassicLinkVPCInput) (req // // Linking your instance to a VPC is sometimes referred to as attaching your // instance. -func (c *EC2) AttachClassicLinkVPC(input *AttachClassicLinkVPCInput) (output *AttachClassicLinkVPCOutput, err error) { +func (c *EC2) AttachClassicLinkVPC(input *AttachClassicLinkVPCInput) (*AttachClassicLinkVPCOutput, error) { req, out := c.AttachClassicLinkVPCRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachClassicLinkVPC *aws.Operation @@ -331,11 +324,10 @@ func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (r // Attaches an Internet gateway to a VPC, enabling connectivity between the // Internet and the VPC. For more information about your VPC and Internet gateway, // see the Amazon Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (output *AttachInternetGatewayOutput, err error) { +func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachInternetGatewayOutput, error) { req, out := c.AttachInternetGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachInternetGateway *aws.Operation @@ -364,11 +356,10 @@ func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) } // Attaches a network interface to an instance. -func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (output *AttachNetworkInterfaceOutput, err error) { +func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*AttachNetworkInterfaceOutput, error) { req, out := c.AttachNetworkInterfaceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachNetworkInterface *aws.Operation @@ -399,11 +390,10 @@ func (c *EC2) AttachVPNGatewayRequest(input *AttachVPNGatewayInput) (req *aws.Re // Attaches a virtual private gateway to a VPC. For more information, see Adding // a Hardware Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) AttachVPNGateway(input *AttachVPNGatewayInput) (output *AttachVPNGatewayOutput, err error) { +func (c *EC2) AttachVPNGateway(input *AttachVPNGatewayInput) (*AttachVPNGatewayOutput, error) { req, out := c.AttachVPNGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachVPNGateway *aws.Operation @@ -431,18 +421,17 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *aws.Request, o return } -// Attaches an Amazon EBS volume to a running or stopped instance and exposes -// it to the instance with the specified device name. +// Attaches an EBS volume to a running or stopped instance and exposes it to +// the instance with the specified device name. // -// Encrypted Amazon EBS volumes may only be attached to instances that support -// Amazon EBS encryption. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// Encrypted EBS volumes may only be attached to instances that support Amazon +// EBS encryption. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. // -// For a list of supported device names, see Attaching an Amazon EBS Volume -// to an Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html). +// For a list of supported device names, see Attaching an EBS Volume to an +// Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html). // Any device names that aren't reserved for instance store volumes can be used -// for Amazon EBS volumes. For more information, see Amazon EC2 Instance Store -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) +// for EBS volumes. For more information, see Amazon EC2 Instance Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) // in the Amazon Elastic Compute Cloud User Guide. // // If a volume has an AWS Marketplace product code: @@ -454,14 +443,13 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *aws.Request, o // instance and attach it to a Linux instance. For an overview of the AWS Marketplace, // see Introducing AWS Marketplace (https://aws.amazon.com/marketplace/help/200900000). // -// For more information about Amazon EBS volumes, see Attaching Amazon EBS -// Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) +// For more information about EBS volumes, see Attaching Amazon EBS Volumes +// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) AttachVolume(input *AttachVolumeInput) (output *VolumeAttachment, err error) { +func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) { req, out := c.AttachVolumeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachVolume *aws.Operation @@ -510,11 +498,10 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE // // Rule changes are propagated to affected instances as quickly as possible. // However, a small delay might occur. -func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (output *AuthorizeSecurityGroupEgressOutput, err error) { +func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (*AuthorizeSecurityGroupEgressOutput, error) { req, out := c.AuthorizeSecurityGroupEgressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAuthorizeSecurityGroupEgress *aws.Operation @@ -561,11 +548,10 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup // to access a security group in your VPC, or gives one or more other security // groups (called the source groups) permission to access a security group for // your VPC. The security groups must all be for the same VPC. -func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (output *AuthorizeSecurityGroupIngressOutput, err error) { +func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (*AuthorizeSecurityGroupIngressOutput, error) { req, out := c.AuthorizeSecurityGroupIngressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAuthorizeSecurityGroupIngress *aws.Operation @@ -603,11 +589,10 @@ func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *aws.Reques // // For more information, see Creating an Instance Store-Backed Windows AMI // (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html). -func (c *EC2) BundleInstance(input *BundleInstanceInput) (output *BundleInstanceOutput, err error) { +func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, error) { req, out := c.BundleInstanceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opBundleInstance *aws.Operation @@ -636,11 +621,10 @@ func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *aws.Re } // Cancels a bundling operation for an instance store-backed Windows instance. -func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (output *CancelBundleTaskOutput, err error) { +func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskOutput, error) { req, out := c.CancelBundleTaskRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelBundleTask *aws.Operation @@ -677,11 +661,10 @@ func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req // For more information, see Using the Command Line Tools to Import Your Virtual // Machine to Amazon EC2 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (output *CancelConversionTaskOutput, err error) { +func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelConversionTaskOutput, error) { req, out := c.CancelConversionTaskRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelConversionTask *aws.Operation @@ -713,11 +696,10 @@ func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *aws.Re // including any partially-created Amazon S3 objects. If the export task is // complete or is in the process of transferring the final disk image, the command // fails and returns an error. -func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (output *CancelExportTaskOutput, err error) { +func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { req, out := c.CancelExportTaskRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelExportTask *aws.Operation @@ -746,11 +728,10 @@ func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *aws.Re } // Cancels an in-process import virtual machine or import snapshot task. -func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (output *CancelImportTaskOutput, err error) { +func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskOutput, error) { req, out := c.CancelImportTaskRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelImportTask *aws.Operation @@ -783,15 +764,46 @@ func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstanc // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (output *CancelReservedInstancesListingOutput, err error) { +func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (*CancelReservedInstancesListingOutput, error) { req, out := c.CancelReservedInstancesListingRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelReservedInstancesListing *aws.Operation +// CancelSpotFleetRequestsRequest generates a request for the CancelSpotFleetRequests operation. +func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *aws.Request, output *CancelSpotFleetRequestsOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opCancelSpotFleetRequests == nil { + opCancelSpotFleetRequests = &aws.Operation{ + Name: "CancelSpotFleetRequests", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &CancelSpotFleetRequestsInput{} + } + + req = c.newRequest(opCancelSpotFleetRequests, input, output) + output = &CancelSpotFleetRequestsOutput{} + req.Data = output + return +} + +// Cancels the specified Spot fleet requests. +func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error) { + req, out := c.CancelSpotFleetRequestsRequest(input) + err := req.Send() + return out, err +} + +var opCancelSpotFleetRequests *aws.Operation + // CancelSpotInstanceRequestsRequest generates a request for the CancelSpotInstanceRequests operation. func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *aws.Request, output *CancelSpotInstanceRequestsOutput) { oprw.Lock() @@ -824,11 +836,10 @@ func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequest // // Canceling a Spot Instance request does not terminate running Spot Instances // associated with the request. -func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (output *CancelSpotInstanceRequestsOutput, err error) { +func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { req, out := c.CancelSpotInstanceRequestsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCancelSpotInstanceRequests *aws.Operation @@ -860,11 +871,10 @@ func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) // can only be used by the owner of the product code. It is useful when a product // code owner needs to verify whether another user's instance is eligible for // support. -func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (output *ConfirmProductInstanceOutput, err error) { +func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*ConfirmProductInstanceOutput, error) { req, out := c.ConfirmProductInstanceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opConfirmProductInstance *aws.Operation @@ -894,16 +904,15 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *aws.Request, output // Initiates the copy of an AMI from the specified source region to the current // region. You specify the destination region by using its endpoint when making -// the request. AMIs that use encrypted Amazon EBS snapshots cannot be copied -// with this method. +// the request. AMIs that use encrypted EBS snapshots cannot be copied with +// this method. // // For more information, see Copying AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CopyImage(input *CopyImageInput) (output *CopyImageOutput, err error) { +func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { req, out := c.CopyImageRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCopyImage *aws.Operation @@ -931,13 +940,13 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *aws.Request, o return } -// Copies a point-in-time snapshot of an Amazon EBS volume and stores it in -// Amazon S3. You can copy the snapshot within the same region or from one region -// to another. You can use the snapshot to create Amazon EBS volumes or Amazon -// Machine Images (AMIs). The snapshot is copied to the regional endpoint that -// you send the HTTP request to. +// Copies a point-in-time snapshot of an EBS volume and stores it in Amazon +// S3. You can copy the snapshot within the same region or from one region to +// another. You can use the snapshot to create EBS volumes or Amazon Machine +// Images (AMIs). The snapshot is copied to the regional endpoint that you send +// the HTTP request to. // -// Copies of encrypted Amazon EBS snapshots remain encrypted. Copies of unencrypted +// Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted // snapshots remain unencrypted. // // Copying snapshots that were encrypted with non-default AWS Key Management @@ -945,11 +954,10 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *aws.Request, o // // For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CopySnapshot(input *CopySnapshotInput) (output *CopySnapshotOutput, err error) { +func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { req, out := c.CopySnapshotRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCopySnapshot *aws.Operation @@ -1002,11 +1010,10 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // more than one time, the first request creates the customer gateway, and subsequent // requests return information about the existing customer gateway. The subsequent // requests do not create new customer gateway resources. -func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (output *CreateCustomerGatewayOutput, err error) { +func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateCustomerGatewayOutput, error) { req, out := c.CreateCustomerGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateCustomerGateway *aws.Operation @@ -1063,11 +1070,10 @@ func (c *EC2) CreateDHCPOptionsRequest(input *CreateDHCPOptionsInput) (req *aws. // either to AmazonProvidedDNS or to a domain name server of your choice. For // more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateDHCPOptions(input *CreateDHCPOptionsInput) (output *CreateDHCPOptionsOutput, err error) { +func (c *EC2) CreateDHCPOptions(input *CreateDHCPOptionsInput) (*CreateDHCPOptionsOutput, error) { req, out := c.CreateDHCPOptionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateDHCPOptions *aws.Operation @@ -1105,11 +1111,10 @@ func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *aws.Request, out // // For more information, see Creating Amazon EBS-Backed Linux AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateImage(input *CreateImageInput) (output *CreateImageOutput, err error) { +func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { req, out := c.CreateImageRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateImage *aws.Operation @@ -1137,17 +1142,16 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp return } -// Exports a running or stopped instance to an Amazon S3 bucket. +// Exports a running or stopped instance to an S3 bucket. // // For information about the supported operating systems, image formats, and // known limitations for the types of instances you can export, see Exporting // EC2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ExportingEC2Instances.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (output *CreateInstanceExportTaskOutput, err error) { +func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*CreateInstanceExportTaskOutput, error) { req, out := c.CreateInstanceExportTaskRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateInstanceExportTask *aws.Operation @@ -1180,11 +1184,10 @@ func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (r // // For more information about your VPC and Internet gateway, see the Amazon // Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (output *CreateInternetGatewayOutput, err error) { +func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateInternetGatewayOutput, error) { req, out := c.CreateInternetGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateInternetGateway *aws.Operation @@ -1224,11 +1227,10 @@ func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *aws.Request, // // For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (output *CreateKeyPairOutput, err error) { +func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { req, out := c.CreateKeyPairRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateKeyPair *aws.Operation @@ -1261,11 +1263,10 @@ func (c *EC2) CreateNetworkACLRequest(input *CreateNetworkACLInput) (req *aws.Re // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateNetworkACL(input *CreateNetworkACLInput) (output *CreateNetworkACLOutput, err error) { +func (c *EC2) CreateNetworkACL(input *CreateNetworkACLInput) (*CreateNetworkACLOutput, error) { req, out := c.CreateNetworkACLRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateNetworkACL *aws.Operation @@ -1310,11 +1311,10 @@ func (c *EC2) CreateNetworkACLEntryRequest(input *CreateNetworkACLEntryInput) (r // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateNetworkACLEntry(input *CreateNetworkACLEntryInput) (output *CreateNetworkACLEntryOutput, err error) { +func (c *EC2) CreateNetworkACLEntry(input *CreateNetworkACLEntryInput) (*CreateNetworkACLEntryOutput, error) { req, out := c.CreateNetworkACLEntryRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateNetworkACLEntry *aws.Operation @@ -1347,11 +1347,10 @@ func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) // For more information about network interfaces, see Elastic Network Interfaces // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the // Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (output *CreateNetworkInterfaceOutput, err error) { +func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*CreateNetworkInterfaceOutput, error) { req, out := c.CreateNetworkInterfaceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateNetworkInterface *aws.Operation @@ -1385,11 +1384,10 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req // For more information about placement groups and cluster instances, see Cluster // Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (output *CreatePlacementGroupOutput, err error) { +func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePlacementGroupOutput, error) { req, out := c.CreatePlacementGroupRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreatePlacementGroup *aws.Operation @@ -1437,11 +1435,10 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (output *CreateReservedInstancesListingOutput, err error) { +func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (*CreateReservedInstancesListingOutput, error) { req, out := c.CreateReservedInstancesListingRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateReservedInstancesListing *aws.Operation @@ -1488,11 +1485,10 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *aws.Request, out // // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateRoute(input *CreateRouteInput) (output *CreateRouteOutput, err error) { +func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { req, out := c.CreateRouteRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateRoute *aws.Operation @@ -1525,11 +1521,10 @@ func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *aws.Re // // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (output *CreateRouteTableOutput, err error) { +func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableOutput, error) { req, out := c.CreateRouteTableRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateRouteTable *aws.Operation @@ -1584,11 +1579,10 @@ func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req * // // You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, // AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress. -func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (output *CreateSecurityGroupOutput, err error) { +func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) { req, out := c.CreateSecurityGroupRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateSecurityGroup *aws.Operation @@ -1616,26 +1610,25 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *aws.Reques return } -// Creates a snapshot of an Amazon EBS volume and stores it in Amazon S3. You -// can use snapshots for backups, to make copies of Amazon EBS volumes, and -// to save data before shutting down an instance. +// Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use +// snapshots for backups, to make copies of EBS volumes, and to save data before +// shutting down an instance. // // When a snapshot is created, any AWS Marketplace product codes that are associated // with the source volume are propagated to the snapshot. // // You can take a snapshot of an attached volume that is in use. However, snapshots -// only capture data that has been written to your Amazon EBS volume at the -// time the snapshot command is issued; this may exclude any data that has been -// cached by any applications or the operating system. If you can pause any -// file systems on the volume long enough to take a snapshot, your snapshot -// should be complete. However, if you cannot pause all file writes to the volume, -// you should unmount the volume from within the instance, issue the snapshot -// command, and then remount the volume to ensure a consistent and complete -// snapshot. You may remount and use your volume while the snapshot status is -// pending. +// only capture data that has been written to your EBS volume at the time the +// snapshot command is issued; this may exclude any data that has been cached +// by any applications or the operating system. If you can pause any file systems +// on the volume long enough to take a snapshot, your snapshot should be complete. +// However, if you cannot pause all file writes to the volume, you should unmount +// the volume from within the instance, issue the snapshot command, and then +// remount the volume to ensure a consistent and complete snapshot. You may +// remount and use your volume while the snapshot status is pending. // -// To create a snapshot for Amazon EBS volumes that serve as root devices, -// you should stop the instance before taking the snapshot. +// To create a snapshot for EBS volumes that serve as root devices, you should +// stop the instance before taking the snapshot. // // Snapshots that are taken from encrypted volumes are automatically encrypted. // Volumes that are created from encrypted snapshots are also automatically @@ -1645,11 +1638,10 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *aws.Reques // For more information, see Amazon Elastic Block Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) // and Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (output *Snapshot, err error) { +func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { req, out := c.CreateSnapshotRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateSnapshot *aws.Operation @@ -1681,11 +1673,10 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub // usage logs. You can create one data feed per AWS account. For more information, // see Spot Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (output *CreateSpotDatafeedSubscriptionOutput, err error) { +func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (*CreateSpotDatafeedSubscriptionOutput, error) { req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateSpotDatafeedSubscription *aws.Operation @@ -1738,11 +1729,10 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *aws.Request, o // // For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateSubnet(input *CreateSubnetInput) (output *CreateSubnetOutput, err error) { +func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error) { req, out := c.CreateSubnetRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateSubnet *aws.Operation @@ -1776,11 +1766,10 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *aws.Request, outpu // // For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateTags(input *CreateTagsInput) (output *CreateTagsOutput, err error) { +func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateTags *aws.Operation @@ -1819,15 +1808,52 @@ func (c *EC2) CreateVPCRequest(input *CreateVPCInput) (req *aws.Request, output // which includes only a default DNS server that we provide (AmazonProvidedDNS). // For more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPC(input *CreateVPCInput) (output *CreateVPCOutput, err error) { +func (c *EC2) CreateVPC(input *CreateVPCInput) (*CreateVPCOutput, error) { req, out := c.CreateVPCRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVPC *aws.Operation +// CreateVPCEndpointRequest generates a request for the CreateVPCEndpoint operation. +func (c *EC2) CreateVPCEndpointRequest(input *CreateVPCEndpointInput) (req *aws.Request, output *CreateVPCEndpointOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opCreateVPCEndpoint == nil { + opCreateVPCEndpoint = &aws.Operation{ + Name: "CreateVpcEndpoint", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &CreateVPCEndpointInput{} + } + + req = c.newRequest(opCreateVPCEndpoint, input, output) + output = &CreateVPCEndpointOutput{} + req.Data = output + return +} + +// Creates a VPC endpoint for a specified AWS service. An endpoint enables you +// to create a private connection between your VPC and another AWS service in +// your account. You can specify an endpoint policy to attach to the endpoint +// that will control access to the service from your VPC. You can also specify +// the VPC route tables that use the endpoint. +// +// Currently, only endpoints to Amazon S3 are supported. +func (c *EC2) CreateVPCEndpoint(input *CreateVPCEndpointInput) (*CreateVPCEndpointOutput, error) { + req, out := c.CreateVPCEndpointRequest(input) + err := req.Send() + return out, err +} + +var opCreateVPCEndpoint *aws.Operation + // CreateVPCPeeringConnectionRequest generates a request for the CreateVPCPeeringConnection operation. func (c *EC2) CreateVPCPeeringConnectionRequest(input *CreateVPCPeeringConnectionInput) (req *aws.Request, output *CreateVPCPeeringConnectionOutput) { oprw.Lock() @@ -1862,11 +1888,10 @@ func (c *EC2) CreateVPCPeeringConnectionRequest(input *CreateVPCPeeringConnectio // // A CreateVpcPeeringConnection request between VPCs with overlapping CIDR // blocks results in the VPC peering connection having a status of failed. -func (c *EC2) CreateVPCPeeringConnection(input *CreateVPCPeeringConnectionInput) (output *CreateVPCPeeringConnectionOutput, err error) { +func (c *EC2) CreateVPCPeeringConnection(input *CreateVPCPeeringConnectionInput) (*CreateVPCPeeringConnectionOutput, error) { req, out := c.CreateVPCPeeringConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVPCPeeringConnection *aws.Operation @@ -1911,11 +1936,10 @@ func (c *EC2) CreateVPNConnectionRequest(input *CreateVPNConnectionInput) (req * // For more information about VPN connections, see Adding a Hardware Virtual // Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNConnection(input *CreateVPNConnectionInput) (output *CreateVPNConnectionOutput, err error) { +func (c *EC2) CreateVPNConnection(input *CreateVPNConnectionInput) (*CreateVPNConnectionOutput, error) { req, out := c.CreateVPNConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVPNConnection *aws.Operation @@ -1951,11 +1975,10 @@ func (c *EC2) CreateVPNConnectionRouteRequest(input *CreateVPNConnectionRouteInp // For more information about VPN connections, see Adding a Hardware Virtual // Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNConnectionRoute(input *CreateVPNConnectionRouteInput) (output *CreateVPNConnectionRouteOutput, err error) { +func (c *EC2) CreateVPNConnectionRoute(input *CreateVPNConnectionRouteInput) (*CreateVPNConnectionRouteOutput, error) { req, out := c.CreateVPNConnectionRouteRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVPNConnectionRoute *aws.Operation @@ -1990,11 +2013,10 @@ func (c *EC2) CreateVPNGatewayRequest(input *CreateVPNGatewayInput) (req *aws.Re // For more information about virtual private gateways, see Adding a Hardware // Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) CreateVPNGateway(input *CreateVPNGatewayInput) (output *CreateVPNGatewayOutput, err error) { +func (c *EC2) CreateVPNGateway(input *CreateVPNGatewayInput) (*CreateVPNGatewayOutput, error) { req, out := c.CreateVPNGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVPNGateway *aws.Operation @@ -2022,14 +2044,13 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *aws.Request, o return } -// Creates an Amazon EBS volume that can be attached to an instance in the same -// Availability Zone. The volume is created in the regional endpoint that you -// send the HTTP request to. For more information see Regions and Endpoints -// (http://docs.aws.amazon.com/general/latest/gr/rande.html). +// Creates an EBS volume that can be attached to an instance in the same Availability +// Zone. The volume is created in the regional endpoint that you send the HTTP +// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). // -// You can create a new empty volume or restore a volume from an Amazon EBS -// snapshot. Any AWS Marketplace product codes from the snapshot are propagated -// to the volume. +// You can create a new empty volume or restore a volume from an EBS snapshot. +// Any AWS Marketplace product codes from the snapshot are propagated to the +// volume. // // You can create encrypted volumes with the Encrypted parameter. Encrypted // volumes may only be attached to instances that support Amazon EBS encryption. @@ -2039,11 +2060,10 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *aws.Request, o // // For more information, see Creating or Restoring an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) CreateVolume(input *CreateVolumeInput) (output *Volume, err error) { +func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { req, out := c.CreateVolumeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateVolume *aws.Operation @@ -2073,11 +2093,10 @@ func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (r // Deletes the specified customer gateway. You must delete the VPN connection // before you can delete the customer gateway. -func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (output *DeleteCustomerGatewayOutput, err error) { +func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { req, out := c.DeleteCustomerGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteCustomerGateway *aws.Operation @@ -2109,11 +2128,10 @@ func (c *EC2) DeleteDHCPOptionsRequest(input *DeleteDHCPOptionsInput) (req *aws. // of DHCP options before you can delete it. You can disassociate the set of // DHCP options by associating either a new set of options or the default set // of options with the VPC. -func (c *EC2) DeleteDHCPOptions(input *DeleteDHCPOptionsInput) (output *DeleteDHCPOptionsOutput, err error) { +func (c *EC2) DeleteDHCPOptions(input *DeleteDHCPOptionsInput) (*DeleteDHCPOptionsOutput, error) { req, out := c.DeleteDHCPOptionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteDHCPOptions *aws.Operation @@ -2143,11 +2161,10 @@ func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (r // Deletes the specified Internet gateway. You must detach the Internet gateway // from the VPC before you can delete it. -func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (output *DeleteInternetGatewayOutput, err error) { +func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteInternetGatewayOutput, error) { req, out := c.DeleteInternetGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteInternetGateway *aws.Operation @@ -2176,11 +2193,10 @@ func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *aws.Request, } // Deletes the specified key pair, by removing the public key from Amazon EC2. -func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (output *DeleteKeyPairOutput, err error) { +func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { req, out := c.DeleteKeyPairRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteKeyPair *aws.Operation @@ -2210,11 +2226,10 @@ func (c *EC2) DeleteNetworkACLRequest(input *DeleteNetworkACLInput) (req *aws.Re // Deletes the specified network ACL. You can't delete the ACL if it's associated // with any subnets. You can't delete the default network ACL. -func (c *EC2) DeleteNetworkACL(input *DeleteNetworkACLInput) (output *DeleteNetworkACLOutput, err error) { +func (c *EC2) DeleteNetworkACL(input *DeleteNetworkACLInput) (*DeleteNetworkACLOutput, error) { req, out := c.DeleteNetworkACLRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteNetworkACL *aws.Operation @@ -2244,11 +2259,10 @@ func (c *EC2) DeleteNetworkACLEntryRequest(input *DeleteNetworkACLEntryInput) (r // Deletes the specified ingress or egress entry (rule) from the specified network // ACL. -func (c *EC2) DeleteNetworkACLEntry(input *DeleteNetworkACLEntryInput) (output *DeleteNetworkACLEntryOutput, err error) { +func (c *EC2) DeleteNetworkACLEntry(input *DeleteNetworkACLEntryInput) (*DeleteNetworkACLEntryOutput, error) { req, out := c.DeleteNetworkACLEntryRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteNetworkACLEntry *aws.Operation @@ -2278,11 +2292,10 @@ func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) // Deletes the specified network interface. You must detach the network interface // before you can delete it. -func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (output *DeleteNetworkInterfaceOutput, err error) { +func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*DeleteNetworkInterfaceOutput, error) { req, out := c.DeleteNetworkInterfaceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteNetworkInterface *aws.Operation @@ -2314,11 +2327,10 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req // the placement group before you can delete the placement group. For more information // about placement groups and cluster instances, see Cluster Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (output *DeletePlacementGroupOutput, err error) { +func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePlacementGroupOutput, error) { req, out := c.DeletePlacementGroupRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeletePlacementGroup *aws.Operation @@ -2347,11 +2359,10 @@ func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *aws.Request, out } // Deletes the specified route from the specified route table. -func (c *EC2) DeleteRoute(input *DeleteRouteInput) (output *DeleteRouteOutput, err error) { +func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { req, out := c.DeleteRouteRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteRoute *aws.Operation @@ -2382,11 +2393,10 @@ func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *aws.Re // Deletes the specified route table. You must disassociate the route table // from any subnets before you can delete it. You can't delete the main route // table. -func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (output *DeleteRouteTableOutput, err error) { +func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableOutput, error) { req, out := c.DeleteRouteTableRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteRouteTable *aws.Operation @@ -2419,11 +2429,10 @@ func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req * // If you attempt to delete a security group that is associated with an instance, // or is referenced by another security group, the operation fails with InvalidGroup.InUse // in EC2-Classic or DependencyViolation in EC2-VPC. -func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (output *DeleteSecurityGroupOutput, err error) { +func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecurityGroupOutput, error) { req, out := c.DeleteSecurityGroupRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteSecurityGroup *aws.Operation @@ -2460,17 +2469,16 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *aws.Reques // snapshots have been deleted, all active snapshots will have access to all // the information needed to restore the volume. // -// You cannot delete a snapshot of the root device of an Amazon EBS volume -// used by a registered AMI. You must first de-register the AMI before you can -// delete the snapshot. +// You cannot delete a snapshot of the root device of an EBS volume used by +// a registered AMI. You must first de-register the AMI before you can delete +// the snapshot. // // For more information, see Deleting an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (output *DeleteSnapshotOutput, err error) { +func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { req, out := c.DeleteSnapshotRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteSnapshot *aws.Operation @@ -2501,11 +2509,10 @@ func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSub // Deletes the data feed for Spot Instances. For more information, see Spot // Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (output *DeleteSpotDatafeedSubscriptionOutput, err error) { +func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteSpotDatafeedSubscription *aws.Operation @@ -2535,11 +2542,10 @@ func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *aws.Request, o // Deletes the specified subnet. You must terminate all running instances in // the subnet before you can delete the subnet. -func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (output *DeleteSubnetOutput, err error) { +func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error) { req, out := c.DeleteSubnetRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteSubnet *aws.Operation @@ -2572,11 +2578,10 @@ func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *aws.Request, outpu // // For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeleteTags(input *DeleteTagsInput) (output *DeleteTagsOutput, err error) { +func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteTags *aws.Operation @@ -2609,15 +2614,47 @@ func (c *EC2) DeleteVPCRequest(input *DeleteVPCInput) (req *aws.Request, output // must terminate all instances running in the VPC, delete all security groups // associated with the VPC (except the default one), delete all route tables // associated with the VPC (except the default one), and so on. -func (c *EC2) DeleteVPC(input *DeleteVPCInput) (output *DeleteVPCOutput, err error) { +func (c *EC2) DeleteVPC(input *DeleteVPCInput) (*DeleteVPCOutput, error) { req, out := c.DeleteVPCRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVPC *aws.Operation +// DeleteVPCEndpointsRequest generates a request for the DeleteVPCEndpoints operation. +func (c *EC2) DeleteVPCEndpointsRequest(input *DeleteVPCEndpointsInput) (req *aws.Request, output *DeleteVPCEndpointsOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDeleteVPCEndpoints == nil { + opDeleteVPCEndpoints = &aws.Operation{ + Name: "DeleteVpcEndpoints", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DeleteVPCEndpointsInput{} + } + + req = c.newRequest(opDeleteVPCEndpoints, input, output) + output = &DeleteVPCEndpointsOutput{} + req.Data = output + return +} + +// Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes +// the endpoint routes in the route tables that were associated with the endpoint. +func (c *EC2) DeleteVPCEndpoints(input *DeleteVPCEndpointsInput) (*DeleteVPCEndpointsOutput, error) { + req, out := c.DeleteVPCEndpointsRequest(input) + err := req.Send() + return out, err +} + +var opDeleteVPCEndpoints *aws.Operation + // DeleteVPCPeeringConnectionRequest generates a request for the DeleteVPCPeeringConnection operation. func (c *EC2) DeleteVPCPeeringConnectionRequest(input *DeleteVPCPeeringConnectionInput) (req *aws.Request, output *DeleteVPCPeeringConnectionOutput) { oprw.Lock() @@ -2645,11 +2682,10 @@ func (c *EC2) DeleteVPCPeeringConnectionRequest(input *DeleteVPCPeeringConnectio // the owner of the peer VPC can delete the VPC peering connection if it's in // the active state. The owner of the requester VPC can delete a VPC peering // connection in the pending-acceptance state. -func (c *EC2) DeleteVPCPeeringConnection(input *DeleteVPCPeeringConnectionInput) (output *DeleteVPCPeeringConnectionOutput, err error) { +func (c *EC2) DeleteVPCPeeringConnection(input *DeleteVPCPeeringConnectionInput) (*DeleteVPCPeeringConnectionOutput, error) { req, out := c.DeleteVPCPeeringConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVPCPeeringConnection *aws.Operation @@ -2687,11 +2723,10 @@ func (c *EC2) DeleteVPNConnectionRequest(input *DeleteVPNConnectionInput) (req * // or virtual private gateway. If you create a new VPN connection, you must // reconfigure the customer gateway using the new configuration information // returned with the new VPN connection ID. -func (c *EC2) DeleteVPNConnection(input *DeleteVPNConnectionInput) (output *DeleteVPNConnectionOutput, err error) { +func (c *EC2) DeleteVPNConnection(input *DeleteVPNConnectionInput) (*DeleteVPNConnectionOutput, error) { req, out := c.DeleteVPNConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVPNConnection *aws.Operation @@ -2723,11 +2758,10 @@ func (c *EC2) DeleteVPNConnectionRouteRequest(input *DeleteVPNConnectionRouteInp // an existing virtual private gateway and a VPN customer gateway. The static // route allows traffic to be routed from the virtual private gateway to the // VPN customer gateway. -func (c *EC2) DeleteVPNConnectionRoute(input *DeleteVPNConnectionRouteInput) (output *DeleteVPNConnectionRouteOutput, err error) { +func (c *EC2) DeleteVPNConnectionRoute(input *DeleteVPNConnectionRouteInput) (*DeleteVPNConnectionRouteOutput, error) { req, out := c.DeleteVPNConnectionRouteRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVPNConnectionRoute *aws.Operation @@ -2760,11 +2794,10 @@ func (c *EC2) DeleteVPNGatewayRequest(input *DeleteVPNGatewayInput) (req *aws.Re // VPN connection. Note that you don't need to delete the virtual private gateway // if you plan to delete and recreate the VPN connection between your VPC and // your network. -func (c *EC2) DeleteVPNGateway(input *DeleteVPNGatewayInput) (output *DeleteVPNGatewayOutput, err error) { +func (c *EC2) DeleteVPNGateway(input *DeleteVPNGatewayInput) (*DeleteVPNGatewayOutput, error) { req, out := c.DeleteVPNGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVPNGateway *aws.Operation @@ -2792,18 +2825,17 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *aws.Request, o return } -// Deletes the specified Amazon EBS volume. The volume must be in the available -// state (not attached to an instance). +// Deletes the specified EBS volume. The volume must be in the available state +// (not attached to an instance). // // The volume may remain in the deleting state for several minutes. // // For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (output *DeleteVolumeOutput, err error) { +func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { req, out := c.DeleteVolumeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteVolume *aws.Operation @@ -2835,11 +2867,10 @@ func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *aws.Requ // to launch new instances. // // This command does not delete the AMI. -func (c *EC2) DeregisterImage(input *DeregisterImageInput) (output *DeregisterImageOutput, err error) { +func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutput, error) { req, out := c.DeregisterImageRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeregisterImage *aws.Operation @@ -2886,11 +2917,10 @@ func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI // // vpc-max-elastic-ips: The maximum number of Elastic IP addresses that you // can allocate for use with EC2-VPC. -func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (output *DescribeAccountAttributesOutput, err error) { +func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { req, out := c.DescribeAccountAttributesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeAccountAttributes *aws.Operation @@ -2923,11 +2953,10 @@ func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *aws. // An Elastic IP address is for use in either the EC2-Classic platform or in // a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (output *DescribeAddressesOutput, err error) { +func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddressesOutput, error) { req, out := c.DescribeAddressesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeAddresses *aws.Operation @@ -2962,11 +2991,10 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI // // For more information, see Regions and Availability Zones (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (output *DescribeAvailabilityZonesOutput, err error) { +func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (*DescribeAvailabilityZonesOutput, error) { req, out := c.DescribeAvailabilityZonesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeAvailabilityZones *aws.Operation @@ -3000,11 +3028,10 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req * // task is no longer in the list, you can still register an AMI from it. Just // use RegisterImage with the Amazon S3 bucket name and image manifest name // you provided to the bundle task. -func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (output *DescribeBundleTasksOutput, err error) { +func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBundleTasksOutput, error) { req, out := c.DescribeBundleTasksRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeBundleTasks *aws.Operation @@ -3036,11 +3063,10 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst // only returns information about EC2-Classic instances linked to a VPC through // ClassicLink; you cannot use this request to return information about other // instances. -func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (output *DescribeClassicLinkInstancesOutput, err error) { +func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (*DescribeClassicLinkInstancesOutput, error) { req, out := c.DescribeClassicLinkInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeClassicLinkInstances *aws.Operation @@ -3072,11 +3098,10 @@ func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput // Using the Command Line Tools to Import Your Virtual Machine to Amazon EC2 // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (output *DescribeConversionTasksOutput, err error) { +func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*DescribeConversionTasksOutput, error) { req, out := c.DescribeConversionTasksRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeConversionTasks *aws.Operation @@ -3109,11 +3134,10 @@ func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInp // For more information about VPN customer gateways, see Adding a Hardware // Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (output *DescribeCustomerGatewaysOutput, err error) { +func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*DescribeCustomerGatewaysOutput, error) { req, out := c.DescribeCustomerGatewaysRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeCustomerGateways *aws.Operation @@ -3145,11 +3169,10 @@ func (c *EC2) DescribeDHCPOptionsRequest(input *DescribeDHCPOptionsInput) (req * // // For more information about DHCP options sets, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeDHCPOptions(input *DescribeDHCPOptionsInput) (output *DescribeDHCPOptionsOutput, err error) { +func (c *EC2) DescribeDHCPOptions(input *DescribeDHCPOptionsInput) (*DescribeDHCPOptionsOutput, error) { req, out := c.DescribeDHCPOptionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeDHCPOptions *aws.Operation @@ -3178,11 +3201,10 @@ func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req * } // Describes one or more of your export tasks. -func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (output *DescribeExportTasksOutput, err error) { +func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { req, out := c.DescribeExportTasksRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeExportTasks *aws.Operation @@ -3212,11 +3234,10 @@ func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) // Describes the specified attribute of the specified AMI. You can specify only // one attribute at a time. -func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (output *DescribeImageAttributeOutput, err error) { +func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*DescribeImageAttributeOutput, error) { req, out := c.DescribeImageAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeImageAttribute *aws.Operation @@ -3251,11 +3272,10 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *aws.Reques // // Deregistered images are included in the returned results for an unspecified // interval after deregistration. -func (c *EC2) DescribeImages(input *DescribeImagesInput) (output *DescribeImagesOutput, err error) { +func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { req, out := c.DescribeImagesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeImages *aws.Operation @@ -3285,11 +3305,10 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp // Displays details about an import virtual machine or import snapshot tasks // that are already created. -func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (output *DescribeImportImageTasksOutput, err error) { +func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*DescribeImportImageTasksOutput, error) { req, out := c.DescribeImportImageTasksRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeImportImageTasks *aws.Operation @@ -3317,12 +3336,11 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa return } -// Displays details about an import snapshot tasks that is already created. -func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInput) (output *DescribeImportSnapshotTasksOutput, err error) { +// Describes your import snapshot tasks. +func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInput) (*DescribeImportSnapshotTasksOutput, error) { req, out := c.DescribeImportSnapshotTasksRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeImportSnapshotTasks *aws.Operation @@ -3355,11 +3373,10 @@ func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeI // kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior // | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | // groupSet | ebsOptimized | sriovNetSupport -func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) (output *DescribeInstanceAttributeOutput, err error) { +func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) (*DescribeInstanceAttributeOutput, error) { req, out := c.DescribeInstanceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeInstanceAttribute *aws.Operation @@ -3374,6 +3391,12 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) Name: "DescribeInstanceStatus", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -3387,70 +3410,37 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) return } -// Describes the status of one or more instances, including any scheduled events. +// Describes the status of one or more instances. // -// Instance status has two main components: +// Instance status includes the following components: // -// System Status reports impaired functionality that stems from issues related -// to the systems that support an instance, such as such as hardware failures -// and network connectivity problems. This call reports such problems as impaired -// reachability. -// -// Instance Status reports impaired functionality that arises from problems -// internal to the instance. This call reports such problems as impaired reachability. -// -// Instance status provides information about four types of scheduled events -// for an instance that may require your attention: -// -// Scheduled Reboot: When Amazon EC2 determines that an instance must be -// rebooted, the instances status returns one of two event codes: system-reboot -// or instance-reboot. System reboot commonly occurs if certain maintenance -// or upgrade operations require a reboot of the underlying host that supports -// an instance. Instance reboot commonly occurs if the instance must be rebooted, -// rather than the underlying host. Rebooting events include a scheduled start -// and end time. -// -// System Maintenance: When Amazon EC2 determines that an instance requires -// maintenance that requires power or network impact, the instance status is -// the event code system-maintenance. System maintenance is either power maintenance -// or network maintenance. For power maintenance, your instance will be unavailable -// for a brief period of time and then rebooted. For network maintenance, your -// instance will experience a brief loss of network connectivity. System maintenance -// events include a scheduled start and end time. You will also be notified -// by email if one of your instances is set for system maintenance. The email -// message indicates when your instance is scheduled for maintenance. -// -// Scheduled Retirement: When Amazon EC2 determines that an instance must -// be shut down, the instance status is the event code instance-retirement. -// Retirement commonly occurs when the underlying host is degraded and must -// be replaced. Retirement events include a scheduled start and end time. You -// will also be notified by email if one of your instances is set to retiring. -// The email message indicates when your instance will be permanently retired. -// -// Scheduled Stop: When Amazon EC2 determines that an instance must be shut -// down, the instances status returns an event code called instance-stop. Stop -// events include a scheduled start and end time. You will also be notified -// by email if one of your instances is set to stop. The email message indicates -// when your instance will be stopped. -// -// When your instance is retired, it will either be terminated (if its root -// device type is the instance-store) or stopped (if its root device type is -// an EBS volume). Instances stopped due to retirement will not be restarted, -// but you can do so manually. You can also avoid retirement of EBS-backed instances -// by manually restarting your instance when its event code is instance-retirement. -// This ensures that your instance is started on a different underlying host. -// -// For more information about failed status checks, see Troubleshooting Instances -// with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) -// in the Amazon Elastic Compute Cloud User Guide. For more information about -// working with scheduled events, see Working with an Instance That Has a Scheduled -// Event (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html#schedevents_actions) +// Status checks - Amazon EC2 performs status checks on running EC2 instances +// to identify hardware and software issues. For more information, see Status +// Checks for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) +// and Troubleshooting Instances with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (output *DescribeInstanceStatusOutput, err error) { +// +// Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, +// or terminate) for your instances related to hardware issues, software updates, +// or system maintenance. For more information, see Scheduled Events for Your +// Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// Instance state - You can manage your instances from the moment you launch +// them through their termination. For more information, see Instance Lifecycle +// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*DescribeInstanceStatusOutput, error) { req, out := c.DescribeInstanceStatusRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(p *DescribeInstanceStatusOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeInstanceStatusRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeInstanceStatusOutput), lastPage) + }) } var opDescribeInstanceStatus *aws.Operation @@ -3465,6 +3455,12 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *aws. Name: "DescribeInstances", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -3488,11 +3484,17 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *aws. // // Recently terminated instances might appear in the returned results. This // interval is usually less than one hour. -func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (output *DescribeInstancesOutput, err error) { +func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { req, out := c.DescribeInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *DescribeInstancesOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeInstancesRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeInstancesOutput), lastPage) + }) } var opDescribeInstances *aws.Operation @@ -3521,11 +3523,10 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp } // Describes one or more of your Internet gateways. -func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (output *DescribeInternetGatewaysOutput, err error) { +func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*DescribeInternetGatewaysOutput, error) { req, out := c.DescribeInternetGatewaysRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeInternetGateways *aws.Operation @@ -3557,15 +3558,48 @@ func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *aws.Re // // For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (output *DescribeKeyPairsOutput, err error) { +func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) { req, out := c.DescribeKeyPairsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeKeyPairs *aws.Operation +// DescribeMovingAddressesRequest generates a request for the DescribeMovingAddresses operation. +func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *aws.Request, output *DescribeMovingAddressesOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeMovingAddresses == nil { + opDescribeMovingAddresses = &aws.Operation{ + Name: "DescribeMovingAddresses", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeMovingAddressesInput{} + } + + req = c.newRequest(opDescribeMovingAddresses, input, output) + output = &DescribeMovingAddressesOutput{} + req.Data = output + return +} + +// Describes your Elastic IP addresses that are being moved to the EC2-VPC platform, +// or that are being restored to the EC2-Classic platform. This request does +// not return information about any other Elastic IP addresses in your account. +func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*DescribeMovingAddressesOutput, error) { + req, out := c.DescribeMovingAddressesRequest(input) + err := req.Send() + return out, err +} + +var opDescribeMovingAddresses *aws.Operation + // DescribeNetworkACLsRequest generates a request for the DescribeNetworkACLs operation. func (c *EC2) DescribeNetworkACLsRequest(input *DescribeNetworkACLsInput) (req *aws.Request, output *DescribeNetworkACLsOutput) { oprw.Lock() @@ -3593,11 +3627,10 @@ func (c *EC2) DescribeNetworkACLsRequest(input *DescribeNetworkACLsInput) (req * // // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeNetworkACLs(input *DescribeNetworkACLsInput) (output *DescribeNetworkACLsOutput, err error) { +func (c *EC2) DescribeNetworkACLs(input *DescribeNetworkACLsInput) (*DescribeNetworkACLsOutput, error) { req, out := c.DescribeNetworkACLsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeNetworkACLs *aws.Operation @@ -3627,11 +3660,10 @@ func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInt // Describes a network interface attribute. You can specify only one attribute // at a time. -func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (output *DescribeNetworkInterfaceAttributeOutput, err error) { +func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (*DescribeNetworkInterfaceAttributeOutput, error) { req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeNetworkInterfaceAttribute *aws.Operation @@ -3660,11 +3692,10 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI } // Describes one or more of your network interfaces. -func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (output *DescribeNetworkInterfacesOutput, err error) { +func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (*DescribeNetworkInterfacesOutput, error) { req, out := c.DescribeNetworkInterfacesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeNetworkInterfaces *aws.Operation @@ -3695,15 +3726,50 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput // Describes one or more of your placement groups. For more information about // placement groups and cluster instances, see Cluster Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (output *DescribePlacementGroupsOutput, err error) { +func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*DescribePlacementGroupsOutput, error) { req, out := c.DescribePlacementGroupsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribePlacementGroups *aws.Operation +// DescribePrefixListsRequest generates a request for the DescribePrefixLists operation. +func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *aws.Request, output *DescribePrefixListsOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribePrefixLists == nil { + opDescribePrefixLists = &aws.Operation{ + Name: "DescribePrefixLists", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribePrefixListsInput{} + } + + req = c.newRequest(opDescribePrefixLists, input, output) + output = &DescribePrefixListsOutput{} + req.Data = output + return +} + +// Describes available AWS services in a prefix list format, which includes +// the prefix list name and prefix list ID of the service and the IP address +// range for the service. A prefix list ID is required for creating an outbound +// security group rule that allows traffic from a VPC to access an AWS service +// through a VPC endpoint. +func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePrefixListsOutput, error) { + req, out := c.DescribePrefixListsRequest(input) + err := req.Send() + return out, err +} + +var opDescribePrefixLists *aws.Operation + // DescribeRegionsRequest generates a request for the DescribeRegions operation. func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *aws.Request, output *DescribeRegionsOutput) { oprw.Lock() @@ -3731,11 +3797,10 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *aws.Requ // // For a list of the regions supported by Amazon EC2, see Regions and Endpoints // (http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). -func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (output *DescribeRegionsOutput, err error) { +func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutput, error) { req, out := c.DescribeRegionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeRegions *aws.Operation @@ -3767,11 +3832,10 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI // // For more information about Reserved Instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (output *DescribeReservedInstancesOutput, err error) { +func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { req, out := c.DescribeReservedInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeReservedInstances *aws.Operation @@ -3821,11 +3885,10 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (output *DescribeReservedInstancesListingsOutput, err error) { +func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (*DescribeReservedInstancesListingsOutput, error) { req, out := c.DescribeReservedInstancesListingsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeReservedInstancesListings *aws.Operation @@ -3840,6 +3903,12 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser Name: "DescribeReservedInstancesModifications", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } } @@ -3860,11 +3929,17 @@ func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReser // // For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (output *DescribeReservedInstancesModificationsOutput, err error) { +func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (*DescribeReservedInstancesModificationsOutput, error) { req, out := c.DescribeReservedInstancesModificationsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(p *DescribeReservedInstancesModificationsOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeReservedInstancesModificationsRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeReservedInstancesModificationsOutput), lastPage) + }) } var opDescribeReservedInstancesModifications *aws.Operation @@ -3879,6 +3954,12 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI Name: "DescribeReservedInstancesOfferings", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -3900,11 +3981,17 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI // // For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (output *DescribeReservedInstancesOfferingsOutput, err error) { +func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (*DescribeReservedInstancesOfferingsOutput, error) { req, out := c.DescribeReservedInstancesOfferingsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(p *DescribeReservedInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeReservedInstancesOfferingsRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeReservedInstancesOfferingsOutput), lastPage) + }) } var opDescribeReservedInstancesOfferings *aws.Operation @@ -3936,11 +4023,10 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req * // // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (output *DescribeRouteTablesOutput, err error) { +func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { req, out := c.DescribeRouteTablesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeRouteTables *aws.Operation @@ -3976,11 +4062,10 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) // in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your // VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (output *DescribeSecurityGroupsOutput, err error) { +func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*DescribeSecurityGroupsOutput, error) { req, out := c.DescribeSecurityGroupsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeSecurityGroups *aws.Operation @@ -4011,13 +4096,12 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI // Describes the specified attribute of the specified snapshot. You can specify // only one attribute at a time. // -// For more information about Amazon EBS snapshots, see Amazon EBS Snapshots -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (output *DescribeSnapshotAttributeOutput, err error) { +// For more information about EBS snapshots, see Amazon EBS Snapshots in the +// Amazon Elastic Compute Cloud User Guide. +func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (*DescribeSnapshotAttributeOutput, error) { req, out := c.DescribeSnapshotAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeSnapshotAttribute *aws.Operation @@ -4032,6 +4116,12 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *aws. Name: "DescribeSnapshots", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } } @@ -4045,10 +4135,10 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *aws. return } -// Describes one or more of the Amazon EBS snapshots available to you. Available -// snapshots include public snapshots available for any AWS account to launch, -// private snapshots that you own, and private snapshots owned by another AWS -// account but for which you've been given explicit create volume permissions. +// Describes one or more of the EBS snapshots available to you. Available snapshots +// include public snapshots available for any AWS account to launch, private +// snapshots that you own, and private snapshots owned by another AWS account +// but for which you've been given explicit create volume permissions. // // The create volume permissions fall into the following categories: // @@ -4083,13 +4173,19 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *aws. // a NextToken value that can be passed to a subsequent DescribeSnapshots request // to retrieve the remaining results. // -// For more information about Amazon EBS snapshots, see Amazon EBS Snapshots -// in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (output *DescribeSnapshotsOutput, err error) { +// For more information about EBS snapshots, see Amazon EBS Snapshots in the +// Amazon Elastic Compute Cloud User Guide. +func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { req, out := c.DescribeSnapshotsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeSnapshotsRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeSnapshotsOutput), lastPage) + }) } var opDescribeSnapshots *aws.Operation @@ -4120,15 +4216,115 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee // Describes the data feed for Spot Instances. For more information, see Spot // Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (output *DescribeSpotDatafeedSubscriptionOutput, err error) { +func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeSpotDatafeedSubscription *aws.Operation +// DescribeSpotFleetInstancesRequest generates a request for the DescribeSpotFleetInstances operation. +func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *aws.Request, output *DescribeSpotFleetInstancesOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeSpotFleetInstances == nil { + opDescribeSpotFleetInstances = &aws.Operation{ + Name: "DescribeSpotFleetInstances", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeSpotFleetInstancesInput{} + } + + req = c.newRequest(opDescribeSpotFleetInstances, input, output) + output = &DescribeSpotFleetInstancesOutput{} + req.Data = output + return +} + +// Describes the running instances for the specified Spot fleet. +func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) (*DescribeSpotFleetInstancesOutput, error) { + req, out := c.DescribeSpotFleetInstancesRequest(input) + err := req.Send() + return out, err +} + +var opDescribeSpotFleetInstances *aws.Operation + +// DescribeSpotFleetRequestHistoryRequest generates a request for the DescribeSpotFleetRequestHistory operation. +func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *aws.Request, output *DescribeSpotFleetRequestHistoryOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeSpotFleetRequestHistory == nil { + opDescribeSpotFleetRequestHistory = &aws.Operation{ + Name: "DescribeSpotFleetRequestHistory", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeSpotFleetRequestHistoryInput{} + } + + req = c.newRequest(opDescribeSpotFleetRequestHistory, input, output) + output = &DescribeSpotFleetRequestHistoryOutput{} + req.Data = output + return +} + +// Describes the events for the specified Spot fleet request during the specified +// time. +// +// Spot fleet events are delayed by up to 30 seconds before they can be described. +// This ensures that you can query by the last evaluated time and not miss a +// recorded event. +func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHistoryInput) (*DescribeSpotFleetRequestHistoryOutput, error) { + req, out := c.DescribeSpotFleetRequestHistoryRequest(input) + err := req.Send() + return out, err +} + +var opDescribeSpotFleetRequestHistory *aws.Operation + +// DescribeSpotFleetRequestsRequest generates a request for the DescribeSpotFleetRequests operation. +func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *aws.Request, output *DescribeSpotFleetRequestsOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeSpotFleetRequests == nil { + opDescribeSpotFleetRequests = &aws.Operation{ + Name: "DescribeSpotFleetRequests", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeSpotFleetRequestsInput{} + } + + req = c.newRequest(opDescribeSpotFleetRequests, input, output) + output = &DescribeSpotFleetRequestsOutput{} + req.Data = output + return +} + +// Describes your Spot fleet requests. +func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) (*DescribeSpotFleetRequestsOutput, error) { + req, out := c.DescribeSpotFleetRequestsRequest(input) + err := req.Send() + return out, err +} + +var opDescribeSpotFleetRequests *aws.Operation + // DescribeSpotInstanceRequestsRequest generates a request for the DescribeSpotInstanceRequests operation. func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *aws.Request, output *DescribeSpotInstanceRequestsOutput) { oprw.Lock() @@ -4164,11 +4360,10 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq // the instance ID appears in the response and contains the identifier of the // instance. Alternatively, you can use DescribeInstances with a filter to look // for instances where the instance lifecycle is spot. -func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (output *DescribeSpotInstanceRequestsOutput, err error) { +func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (*DescribeSpotInstanceRequestsOutput, error) { req, out := c.DescribeSpotInstanceRequestsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeSpotInstanceRequests *aws.Operation @@ -4183,6 +4378,12 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp Name: "DescribeSpotPriceHistory", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -4205,11 +4406,17 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp // of the instance types within the time range that you specified and the time // when the price changed. The price is valid within the time period that you // specified; the response merely indicates the last time that the price changed. -func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (output *DescribeSpotPriceHistoryOutput, err error) { +func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*DescribeSpotPriceHistoryOutput, error) { req, out := c.DescribeSpotPriceHistoryRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(p *DescribeSpotPriceHistoryOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeSpotPriceHistoryRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeSpotPriceHistoryOutput), lastPage) + }) } var opDescribeSpotPriceHistory *aws.Operation @@ -4241,11 +4448,10 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *aws.Requ // // For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (output *DescribeSubnetsOutput, err error) { +func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutput, error) { req, out := c.DescribeSubnetsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeSubnets *aws.Operation @@ -4277,11 +4483,10 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, o // // For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeTags(input *DescribeTagsInput) (output *DescribeTagsOutput, err error) { +func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeTags *aws.Operation @@ -4311,11 +4516,10 @@ func (c *EC2) DescribeVPCAttributeRequest(input *DescribeVPCAttributeInput) (req // Describes the specified attribute of the specified VPC. You can specify only // one attribute at a time. -func (c *EC2) DescribeVPCAttribute(input *DescribeVPCAttributeInput) (output *DescribeVPCAttributeOutput, err error) { +func (c *EC2) DescribeVPCAttribute(input *DescribeVPCAttributeInput) (*DescribeVPCAttributeOutput, error) { req, out := c.DescribeVPCAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPCAttribute *aws.Operation @@ -4344,15 +4548,79 @@ func (c *EC2) DescribeVPCClassicLinkRequest(input *DescribeVPCClassicLinkInput) } // Describes the ClassicLink status of one or more VPCs. -func (c *EC2) DescribeVPCClassicLink(input *DescribeVPCClassicLinkInput) (output *DescribeVPCClassicLinkOutput, err error) { +func (c *EC2) DescribeVPCClassicLink(input *DescribeVPCClassicLinkInput) (*DescribeVPCClassicLinkOutput, error) { req, out := c.DescribeVPCClassicLinkRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPCClassicLink *aws.Operation +// DescribeVPCEndpointServicesRequest generates a request for the DescribeVPCEndpointServices operation. +func (c *EC2) DescribeVPCEndpointServicesRequest(input *DescribeVPCEndpointServicesInput) (req *aws.Request, output *DescribeVPCEndpointServicesOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeVPCEndpointServices == nil { + opDescribeVPCEndpointServices = &aws.Operation{ + Name: "DescribeVpcEndpointServices", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeVPCEndpointServicesInput{} + } + + req = c.newRequest(opDescribeVPCEndpointServices, input, output) + output = &DescribeVPCEndpointServicesOutput{} + req.Data = output + return +} + +// Describes all supported AWS services that can be specified when creating +// a VPC endpoint. +func (c *EC2) DescribeVPCEndpointServices(input *DescribeVPCEndpointServicesInput) (*DescribeVPCEndpointServicesOutput, error) { + req, out := c.DescribeVPCEndpointServicesRequest(input) + err := req.Send() + return out, err +} + +var opDescribeVPCEndpointServices *aws.Operation + +// DescribeVPCEndpointsRequest generates a request for the DescribeVPCEndpoints operation. +func (c *EC2) DescribeVPCEndpointsRequest(input *DescribeVPCEndpointsInput) (req *aws.Request, output *DescribeVPCEndpointsOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opDescribeVPCEndpoints == nil { + opDescribeVPCEndpoints = &aws.Operation{ + Name: "DescribeVpcEndpoints", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &DescribeVPCEndpointsInput{} + } + + req = c.newRequest(opDescribeVPCEndpoints, input, output) + output = &DescribeVPCEndpointsOutput{} + req.Data = output + return +} + +// Describes one or more of your VPC endpoints. +func (c *EC2) DescribeVPCEndpoints(input *DescribeVPCEndpointsInput) (*DescribeVPCEndpointsOutput, error) { + req, out := c.DescribeVPCEndpointsRequest(input) + err := req.Send() + return out, err +} + +var opDescribeVPCEndpoints *aws.Operation + // DescribeVPCPeeringConnectionsRequest generates a request for the DescribeVPCPeeringConnections operation. func (c *EC2) DescribeVPCPeeringConnectionsRequest(input *DescribeVPCPeeringConnectionsInput) (req *aws.Request, output *DescribeVPCPeeringConnectionsOutput) { oprw.Lock() @@ -4377,11 +4645,10 @@ func (c *EC2) DescribeVPCPeeringConnectionsRequest(input *DescribeVPCPeeringConn } // Describes one or more of your VPC peering connections. -func (c *EC2) DescribeVPCPeeringConnections(input *DescribeVPCPeeringConnectionsInput) (output *DescribeVPCPeeringConnectionsOutput, err error) { +func (c *EC2) DescribeVPCPeeringConnections(input *DescribeVPCPeeringConnectionsInput) (*DescribeVPCPeeringConnectionsOutput, error) { req, out := c.DescribeVPCPeeringConnectionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPCPeeringConnections *aws.Operation @@ -4410,11 +4677,10 @@ func (c *EC2) DescribeVPCsRequest(input *DescribeVPCsInput) (req *aws.Request, o } // Describes one or more of your VPCs. -func (c *EC2) DescribeVPCs(input *DescribeVPCsInput) (output *DescribeVPCsOutput, err error) { +func (c *EC2) DescribeVPCs(input *DescribeVPCsInput) (*DescribeVPCsOutput, error) { req, out := c.DescribeVPCsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPCs *aws.Operation @@ -4447,11 +4713,10 @@ func (c *EC2) DescribeVPNConnectionsRequest(input *DescribeVPNConnectionsInput) // For more information about VPN connections, see Adding a Hardware Virtual // Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeVPNConnections(input *DescribeVPNConnectionsInput) (output *DescribeVPNConnectionsOutput, err error) { +func (c *EC2) DescribeVPNConnections(input *DescribeVPNConnectionsInput) (*DescribeVPNConnectionsOutput, error) { req, out := c.DescribeVPNConnectionsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPNConnections *aws.Operation @@ -4484,11 +4749,10 @@ func (c *EC2) DescribeVPNGatewaysRequest(input *DescribeVPNGatewaysInput) (req * // For more information about virtual private gateways, see Adding an IPsec // Hardware VPN to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DescribeVPNGateways(input *DescribeVPNGatewaysInput) (output *DescribeVPNGatewaysOutput, err error) { +func (c *EC2) DescribeVPNGateways(input *DescribeVPNGatewaysInput) (*DescribeVPNGatewaysOutput, error) { req, out := c.DescribeVPNGatewaysRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVPNGateways *aws.Operation @@ -4519,13 +4783,12 @@ func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput // Describes the specified attribute of the specified volume. You can specify // only one attribute at a time. // -// For more information about Amazon EBS volumes, see Amazon EBS Volumes in -// the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (output *DescribeVolumeAttributeOutput, err error) { +// For more information about EBS volumes, see Amazon EBS Volumes in the Amazon +// Elastic Compute Cloud User Guide. +func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*DescribeVolumeAttributeOutput, error) { req, out := c.DescribeVolumeAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeVolumeAttribute *aws.Operation @@ -4540,6 +4803,12 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req Name: "DescribeVolumeStatus", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -4588,11 +4857,17 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req // Volume status is based on the volume status checks, and does not reflect // the volume state. Therefore, volume status does not indicate volumes in the // error state (for example, when a volume is incapable of accepting I/O.) -func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (output *DescribeVolumeStatusOutput, err error) { +func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeVolumeStatusOutput, error) { req, out := c.DescribeVolumeStatusRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(p *DescribeVolumeStatusOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeVolumeStatusRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeVolumeStatusOutput), lastPage) + }) } var opDescribeVolumeStatus *aws.Operation @@ -4607,6 +4882,12 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *aws.Requ Name: "DescribeVolumes", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } } @@ -4620,7 +4901,7 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *aws.Requ return } -// Describes the specified Amazon EBS volumes. +// Describes the specified EBS volumes. // // If you are describing a long list of volumes, you can paginate the output // to make the list more manageable. The MaxResults parameter sets the maximum @@ -4629,13 +4910,19 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *aws.Requ // a NextToken value that can be passed to a subsequent DescribeVolumes request // to retrieve the remaining results. // -// For more information about Amazon EBS volumes, see Amazon EBS Volumes in -// the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (output *DescribeVolumesOutput, err error) { +// For more information about EBS volumes, see Amazon EBS Volumes in the Amazon +// Elastic Compute Cloud User Guide. +func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { req, out := c.DescribeVolumesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *DescribeVolumesOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeVolumesRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeVolumesOutput), lastPage) + }) } var opDescribeVolumes *aws.Operation @@ -4666,11 +4953,10 @@ func (c *EC2) DetachClassicLinkVPCRequest(input *DetachClassicLinkVPCInput) (req // Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance // has been unlinked, the VPC security groups are no longer associated with // it. An instance is automatically unlinked from a VPC when it's stopped. -func (c *EC2) DetachClassicLinkVPC(input *DetachClassicLinkVPCInput) (output *DetachClassicLinkVPCOutput, err error) { +func (c *EC2) DetachClassicLinkVPC(input *DetachClassicLinkVPCInput) (*DetachClassicLinkVPCOutput, error) { req, out := c.DetachClassicLinkVPCRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachClassicLinkVPC *aws.Operation @@ -4701,11 +4987,10 @@ func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (r // Detaches an Internet gateway from a VPC, disabling connectivity between the // Internet and the VPC. The VPC must not contain any running instances with // Elastic IP addresses. -func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (output *DetachInternetGatewayOutput, err error) { +func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { req, out := c.DetachInternetGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachInternetGateway *aws.Operation @@ -4734,11 +5019,10 @@ func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) } // Detaches a network interface from an instance. -func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (output *DetachNetworkInterfaceOutput, err error) { +func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { req, out := c.DetachNetworkInterfaceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachNetworkInterface *aws.Operation @@ -4774,11 +5058,10 @@ func (c *EC2) DetachVPNGatewayRequest(input *DetachVPNGatewayInput) (req *aws.Re // // You must wait for the attachment's state to switch to detached before you // can delete the VPC or attach a different VPC to the virtual private gateway. -func (c *EC2) DetachVPNGateway(input *DetachVPNGatewayInput) (output *DetachVPNGatewayOutput, err error) { +func (c *EC2) DetachVPNGateway(input *DetachVPNGatewayInput) (*DetachVPNGatewayOutput, error) { req, out := c.DetachVPNGatewayRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachVPNGateway *aws.Operation @@ -4806,10 +5089,9 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *aws.Request, o return } -// Detaches an Amazon EBS volume from an instance. Make sure to unmount any -// file systems on the device within your operating system before detaching -// the volume. Failure to do so results in the volume being stuck in a busy -// state while detaching. +// Detaches an EBS volume from an instance. Make sure to unmount any file systems +// on the device within your operating system before detaching the volume. Failure +// to do so results in the volume being stuck in a busy state while detaching. // // If an Amazon EBS volume is the root device of an instance, it can't be detached // while the instance is running. To detach the root volume, stop the instance @@ -4820,11 +5102,10 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *aws.Request, o // // For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) DetachVolume(input *DetachVolumeInput) (output *VolumeAttachment, err error) { +func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { req, out := c.DetachVolumeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachVolume *aws.Operation @@ -4854,11 +5135,10 @@ func (c *EC2) DisableVGWRoutePropagationRequest(input *DisableVGWRoutePropagatio // Disables a virtual private gateway (VGW) from propagating routes to a specified // route table of a VPC. -func (c *EC2) DisableVGWRoutePropagation(input *DisableVGWRoutePropagationInput) (output *DisableVGWRoutePropagationOutput, err error) { +func (c *EC2) DisableVGWRoutePropagation(input *DisableVGWRoutePropagationInput) (*DisableVGWRoutePropagationOutput, error) { req, out := c.DisableVGWRoutePropagationRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDisableVGWRoutePropagation *aws.Operation @@ -4888,11 +5168,10 @@ func (c *EC2) DisableVPCClassicLinkRequest(input *DisableVPCClassicLinkInput) (r // Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC // that has EC2-Classic instances linked to it. -func (c *EC2) DisableVPCClassicLink(input *DisableVPCClassicLinkInput) (output *DisableVPCClassicLinkOutput, err error) { +func (c *EC2) DisableVPCClassicLink(input *DisableVPCClassicLinkInput) (*DisableVPCClassicLinkOutput, error) { req, out := c.DisableVPCClassicLinkRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDisableVPCClassicLink *aws.Operation @@ -4929,11 +5208,10 @@ func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req * // // This is an idempotent operation. If you perform the operation more than // once, Amazon EC2 doesn't return an error. -func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (output *DisassociateAddressOutput, err error) { +func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*DisassociateAddressOutput, error) { req, out := c.DisassociateAddressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDisassociateAddress *aws.Operation @@ -4967,11 +5245,10 @@ func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) // route table. Instead, it uses the routes in the VPC's main route table. For // more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (output *DisassociateRouteTableOutput, err error) { +func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*DisassociateRouteTableOutput, error) { req, out := c.DisassociateRouteTableRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDisassociateRouteTable *aws.Operation @@ -5001,11 +5278,10 @@ func (c *EC2) EnableVGWRoutePropagationRequest(input *EnableVGWRoutePropagationI // Enables a virtual private gateway (VGW) to propagate routes to the specified // route table of a VPC. -func (c *EC2) EnableVGWRoutePropagation(input *EnableVGWRoutePropagationInput) (output *EnableVGWRoutePropagationOutput, err error) { +func (c *EC2) EnableVGWRoutePropagation(input *EnableVGWRoutePropagationInput) (*EnableVGWRoutePropagationOutput, error) { req, out := c.EnableVGWRoutePropagationRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opEnableVGWRoutePropagation *aws.Operation @@ -5040,11 +5316,10 @@ func (c *EC2) EnableVPCClassicLinkRequest(input *EnableVPCClassicLinkInput) (req // range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 // IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) EnableVPCClassicLink(input *EnableVPCClassicLinkInput) (output *EnableVPCClassicLinkOutput, err error) { +func (c *EC2) EnableVPCClassicLink(input *EnableVPCClassicLinkInput) (*EnableVPCClassicLinkOutput, error) { req, out := c.EnableVPCClassicLinkRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opEnableVPCClassicLink *aws.Operation @@ -5074,11 +5349,10 @@ func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *aws.Reques // Enables I/O operations for a volume that had I/O operations disabled because // the data on the volume was potentially inconsistent. -func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (output *EnableVolumeIOOutput, err error) { +func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { req, out := c.EnableVolumeIORequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opEnableVolumeIO *aws.Operation @@ -5124,11 +5398,10 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *aws.Re // // For Windows instances, the instance console output includes output from // the EC2Config service. -func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (output *GetConsoleOutputOutput, err error) { +func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputOutput, error) { req, out := c.GetConsoleOutputRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opGetConsoleOutput *aws.Operation @@ -5170,11 +5443,10 @@ func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *aws.Requ // Password generation and encryption takes a few moments. We recommend that // you wait up to 15 minutes after launching an instance before trying to retrieve // the generated password. -func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (output *GetPasswordDataOutput, err error) { +func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutput, error) { req, out := c.GetPasswordDataRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opGetPasswordData *aws.Operation @@ -5202,13 +5474,12 @@ func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *aws.Request, out return } -// Import single or multi-volume disk images or Amazon EBS snapshots into an -// Amazon Machine Image (AMI). -func (c *EC2) ImportImage(input *ImportImageInput) (output *ImportImageOutput, err error) { +// Import single or multi-volume disk images or EBS snapshots into an Amazon +// Machine Image (AMI). +func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { req, out := c.ImportImageRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opImportImage *aws.Operation @@ -5243,11 +5514,10 @@ func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *aws.Reques // see Using the Command Line Tools to Import Your Virtual Machine to Amazon // EC2 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ImportInstance(input *ImportInstanceInput) (output *ImportInstanceOutput, err error) { +func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, error) { req, out := c.ImportInstanceRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opImportInstance *aws.Operation @@ -5283,11 +5553,10 @@ func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *aws.Request, // // For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (output *ImportKeyPairOutput, err error) { +func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { req, out := c.ImportKeyPairRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opImportKeyPair *aws.Operation @@ -5315,12 +5584,11 @@ func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *aws.Reques return } -// Import a disk into an Amazon Elastic Block Store (Amazon EBS) snapshot. -func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (output *ImportSnapshotOutput, err error) { +// Imports a disk into an EBS snapshot. +func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, error) { req, out := c.ImportSnapshotRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opImportSnapshot *aws.Operation @@ -5354,11 +5622,10 @@ func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *aws.Request, o // see Using the Command Line Tools to Import Your Virtual Machine to Amazon // EC2 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UploadingYourInstancesandVolumes.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ImportVolume(input *ImportVolumeInput) (output *ImportVolumeOutput, err error) { +func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error) { req, out := c.ImportVolumeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opImportVolume *aws.Operation @@ -5391,11 +5658,10 @@ func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req // // AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace // product code cannot be made public. -func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (output *ModifyImageAttributeOutput, err error) { +func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { req, out := c.ModifyImageAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyImageAttribute *aws.Operation @@ -5429,11 +5695,10 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput // To modify some attributes, the instance must be stopped. For more information, // see Modifying Attributes of a Stopped Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (output *ModifyInstanceAttributeOutput, err error) { +func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { req, out := c.ModifyInstanceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyInstanceAttribute *aws.Operation @@ -5463,11 +5728,10 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa // Modifies the specified network interface attribute. You can specify only // one attribute at a time. -func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (output *ModifyNetworkInterfaceAttributeOutput, err error) { +func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (*ModifyNetworkInterfaceAttributeOutput, error) { req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyNetworkInterfaceAttribute *aws.Operation @@ -5502,11 +5766,10 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput // // For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (output *ModifyReservedInstancesOutput, err error) { +func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*ModifyReservedInstancesOutput, error) { req, out := c.ModifyReservedInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyReservedInstances *aws.Operation @@ -5545,11 +5808,10 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput // in the Amazon Elastic Compute Cloud User Guide. // // Snapshots with AWS Marketplace product codes cannot be made public. -func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (output *ModifySnapshotAttributeOutput, err error) { +func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*ModifySnapshotAttributeOutput, error) { req, out := c.ModifySnapshotAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifySnapshotAttribute *aws.Operation @@ -5578,11 +5840,10 @@ func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (r } // Modifies a subnet attribute. -func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (output *ModifySubnetAttributeOutput, err error) { +func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifySubnetAttributeOutput, error) { req, out := c.ModifySubnetAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifySubnetAttribute *aws.Operation @@ -5611,15 +5872,48 @@ func (c *EC2) ModifyVPCAttributeRequest(input *ModifyVPCAttributeInput) (req *aw } // Modifies the specified attribute of the specified VPC. -func (c *EC2) ModifyVPCAttribute(input *ModifyVPCAttributeInput) (output *ModifyVPCAttributeOutput, err error) { +func (c *EC2) ModifyVPCAttribute(input *ModifyVPCAttributeInput) (*ModifyVPCAttributeOutput, error) { req, out := c.ModifyVPCAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyVPCAttribute *aws.Operation +// ModifyVPCEndpointRequest generates a request for the ModifyVPCEndpoint operation. +func (c *EC2) ModifyVPCEndpointRequest(input *ModifyVPCEndpointInput) (req *aws.Request, output *ModifyVPCEndpointOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opModifyVPCEndpoint == nil { + opModifyVPCEndpoint = &aws.Operation{ + Name: "ModifyVpcEndpoint", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &ModifyVPCEndpointInput{} + } + + req = c.newRequest(opModifyVPCEndpoint, input, output) + output = &ModifyVPCEndpointOutput{} + req.Data = output + return +} + +// Modifies attributes of a specified VPC endpoint. You can modify the policy +// associated with the endpoint, and you can add and remove route tables associated +// with the endpoint. +func (c *EC2) ModifyVPCEndpoint(input *ModifyVPCEndpointInput) (*ModifyVPCEndpointOutput, error) { + req, out := c.ModifyVPCEndpointRequest(input) + err := req.Send() + return out, err +} + +var opModifyVPCEndpoint *aws.Operation + // ModifyVolumeAttributeRequest generates a request for the ModifyVolumeAttribute operation. func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *aws.Request, output *ModifyVolumeAttributeOutput) { oprw.Lock() @@ -5653,11 +5947,10 @@ func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (r // You can change the default behavior to resume I/O operations. We recommend // that you change this only for boot volumes or for volumes that are stateless // or disposable. -func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (output *ModifyVolumeAttributeOutput, err error) { +func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { req, out := c.ModifyVolumeAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyVolumeAttribute *aws.Operation @@ -5688,15 +5981,52 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *aws.Re // Enables monitoring for a running instance. For more information about monitoring // instances, see Monitoring Your Instances and Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (output *MonitorInstancesOutput, err error) { +func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesOutput, error) { req, out := c.MonitorInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opMonitorInstances *aws.Operation +// MoveAddressToVPCRequest generates a request for the MoveAddressToVPC operation. +func (c *EC2) MoveAddressToVPCRequest(input *MoveAddressToVPCInput) (req *aws.Request, output *MoveAddressToVPCOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opMoveAddressToVPC == nil { + opMoveAddressToVPC = &aws.Operation{ + Name: "MoveAddressToVpc", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &MoveAddressToVPCInput{} + } + + req = c.newRequest(opMoveAddressToVPC, input, output) + output = &MoveAddressToVPCOutput{} + req.Data = output + return +} + +// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC +// platform. The Elastic IP address must be allocated to your account, and it +// must not be associated with an instance. After the Elastic IP address is +// moved, it is no longer available for use in the EC2-Classic platform, unless +// you move it back using the RestoreAddressToClassic request. You cannot move +// an Elastic IP address that's allocated for use in the EC2-VPC platform to +// the EC2-Classic platform. +func (c *EC2) MoveAddressToVPC(input *MoveAddressToVPCInput) (*MoveAddressToVPCOutput, error) { + req, out := c.MoveAddressToVPCRequest(input) + err := req.Send() + return out, err +} + +var opMoveAddressToVPC *aws.Operation + // PurchaseReservedInstancesOfferingRequest generates a request for the PurchaseReservedInstancesOffering operation. func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *aws.Request, output *PurchaseReservedInstancesOfferingOutput) { oprw.Lock() @@ -5733,11 +6063,10 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn // For more information, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) // and Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (output *PurchaseReservedInstancesOfferingOutput, err error) { +func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (*PurchaseReservedInstancesOfferingOutput, error) { req, out := c.PurchaseReservedInstancesOfferingRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opPurchaseReservedInstancesOffering *aws.Operation @@ -5776,11 +6105,10 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *aws.Requ // For more information about troubleshooting, see Getting Console Output and // Rebooting Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) RebootInstances(input *RebootInstancesInput) (output *RebootInstancesOutput, err error) { +func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { req, out := c.RebootInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRebootInstances *aws.Operation @@ -5828,11 +6156,10 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *aws.Request, // // You can't register an image where a secondary (non-root) snapshot has AWS // Marketplace product codes. -func (c *EC2) RegisterImage(input *RegisterImageInput) (output *RegisterImageOutput, err error) { +func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, error) { req, out := c.RegisterImageRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRegisterImage *aws.Operation @@ -5865,11 +6192,10 @@ func (c *EC2) RejectVPCPeeringConnectionRequest(input *RejectVPCPeeringConnectio // request to view your outstanding VPC peering connection requests. To delete // an active VPC peering connection, or to delete a VPC peering connection request // that you initiated, use DeleteVpcPeeringConnection. -func (c *EC2) RejectVPCPeeringConnection(input *RejectVPCPeeringConnectionInput) (output *RejectVPCPeeringConnectionOutput, err error) { +func (c *EC2) RejectVPCPeeringConnection(input *RejectVPCPeeringConnectionInput) (*RejectVPCPeeringConnectionOutput, error) { req, out := c.RejectVPCPeeringConnectionRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRejectVPCPeeringConnection *aws.Operation @@ -5912,11 +6238,10 @@ func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *aws.Reques // [Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic // IP address before you try to release it. Otherwise, Amazon EC2 returns an // error (InvalidIPAddress.InUse). -func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (output *ReleaseAddressOutput, err error) { +func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, error) { req, out := c.ReleaseAddressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReleaseAddress *aws.Operation @@ -5948,11 +6273,10 @@ func (c *EC2) ReplaceNetworkACLAssociationRequest(input *ReplaceNetworkACLAssoci // create a subnet, it's automatically associated with the default network ACL. // For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ReplaceNetworkACLAssociation(input *ReplaceNetworkACLAssociationInput) (output *ReplaceNetworkACLAssociationOutput, err error) { +func (c *EC2) ReplaceNetworkACLAssociation(input *ReplaceNetworkACLAssociationInput) (*ReplaceNetworkACLAssociationOutput, error) { req, out := c.ReplaceNetworkACLAssociationRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReplaceNetworkACLAssociation *aws.Operation @@ -5983,11 +6307,10 @@ func (c *EC2) ReplaceNetworkACLEntryRequest(input *ReplaceNetworkACLEntryInput) // Replaces an entry (rule) in a network ACL. For more information about network // ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ReplaceNetworkACLEntry(input *ReplaceNetworkACLEntryInput) (output *ReplaceNetworkACLEntryOutput, err error) { +func (c *EC2) ReplaceNetworkACLEntry(input *ReplaceNetworkACLEntryInput) (*ReplaceNetworkACLEntryOutput, error) { req, out := c.ReplaceNetworkACLEntryRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReplaceNetworkACLEntry *aws.Operation @@ -6021,11 +6344,10 @@ func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *aws.Request, o // // For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (output *ReplaceRouteOutput, err error) { +func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error) { req, out := c.ReplaceRouteRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReplaceRoute *aws.Operation @@ -6062,11 +6384,10 @@ func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssoci // You can also use ReplaceRouteTableAssociation to change which table is the // main route table in the VPC. You just specify the main route table's association // ID and the route table to be the new main route table. -func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (output *ReplaceRouteTableAssociationOutput, err error) { +func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (*ReplaceRouteTableAssociationOutput, error) { req, out := c.ReplaceRouteTableAssociationRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReplaceRouteTableAssociation *aws.Operation @@ -6101,15 +6422,49 @@ func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req // to improve the accuracy of status checks. // // Use of this action does not change the value returned by DescribeInstanceStatus. -func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (output *ReportInstanceStatusOutput, err error) { +func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportInstanceStatusOutput, error) { req, out := c.ReportInstanceStatusRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opReportInstanceStatus *aws.Operation +// RequestSpotFleetRequest generates a request for the RequestSpotFleet operation. +func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *aws.Request, output *RequestSpotFleetOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opRequestSpotFleet == nil { + opRequestSpotFleet = &aws.Operation{ + Name: "RequestSpotFleet", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &RequestSpotFleetInput{} + } + + req = c.newRequest(opRequestSpotFleet, input, output) + output = &RequestSpotFleetOutput{} + req.Data = output + return +} + +// Creates a Spot fleet request. +// +// For more information, see Spot Fleets (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { + req, out := c.RequestSpotFleetRequest(input) + err := req.Send() + return out, err +} + +var opRequestSpotFleet *aws.Operation + // RequestSpotInstancesRequest generates a request for the RequestSpotInstances operation. func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *aws.Request, output *RequestSpotInstancesOutput) { oprw.Lock() @@ -6139,11 +6494,10 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req // Instance capacity and current Spot Instance requests. For more information, // see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (output *RequestSpotInstancesOutput, err error) { +func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { req, out := c.RequestSpotInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRequestSpotInstances *aws.Operation @@ -6174,11 +6528,10 @@ func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req * // Resets an attribute of an AMI to its default value. // // The productCodes attribute can't be reset. -func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (output *ResetImageAttributeOutput, err error) { +func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageAttributeOutput, error) { req, out := c.ResetImageAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opResetImageAttribute *aws.Operation @@ -6215,11 +6568,10 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) // value must be false for a NAT instance to perform NAT. For more information, // see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) // in the Amazon Virtual Private Cloud User Guide. -func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (output *ResetInstanceAttributeOutput, err error) { +func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*ResetInstanceAttributeOutput, error) { req, out := c.ResetInstanceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opResetInstanceAttribute *aws.Operation @@ -6249,11 +6601,10 @@ func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterface // Resets a network interface attribute. You can specify only one attribute // at a time. -func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (output *ResetNetworkInterfaceAttributeOutput, err error) { +func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (*ResetNetworkInterfaceAttributeOutput, error) { req, out := c.ResetNetworkInterfaceAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opResetNetworkInterfaceAttribute *aws.Operation @@ -6286,15 +6637,49 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) // For more information on modifying snapshot permissions, see Sharing Snapshots // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (output *ResetSnapshotAttributeOutput, err error) { +func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*ResetSnapshotAttributeOutput, error) { req, out := c.ResetSnapshotAttributeRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opResetSnapshotAttribute *aws.Operation +// RestoreAddressToClassicRequest generates a request for the RestoreAddressToClassic operation. +func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *aws.Request, output *RestoreAddressToClassicOutput) { + oprw.Lock() + defer oprw.Unlock() + + if opRestoreAddressToClassic == nil { + opRestoreAddressToClassic = &aws.Operation{ + Name: "RestoreAddressToClassic", + HTTPMethod: "POST", + HTTPPath: "/", + } + } + + if input == nil { + input = &RestoreAddressToClassicInput{} + } + + req = c.newRequest(opRestoreAddressToClassic, input, output) + output = &RestoreAddressToClassicOutput{} + req.Data = output + return +} + +// Restores an Elastic IP address that was previously moved to the EC2-VPC platform +// back to the EC2-Classic platform. You cannot move an Elastic IP address that +// was originally allocated for use in EC2-VPC. The Elastic IP address must +// not be associated with an instance or network interface. +func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*RestoreAddressToClassicOutput, error) { + req, out := c.RestoreAddressToClassicRequest(input) + err := req.Send() + return out, err +} + +var opRestoreAddressToClassic *aws.Operation + // RevokeSecurityGroupEgressRequest generates a request for the RevokeSecurityGroupEgress operation. func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *aws.Request, output *RevokeSecurityGroupEgressOutput) { oprw.Lock() @@ -6329,11 +6714,10 @@ func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressI // // Rule changes are propagated to instances within the security group as quickly // as possible. However, a small delay might occur. -func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (output *RevokeSecurityGroupEgressOutput, err error) { +func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (*RevokeSecurityGroupEgressOutput, error) { req, out := c.RevokeSecurityGroupEgressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRevokeSecurityGroupEgress *aws.Operation @@ -6372,11 +6756,10 @@ func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngres // // Rule changes are propagated to instances within the security group as quickly // as possible. However, a small delay might occur. -func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (output *RevokeSecurityGroupIngressOutput, err error) { +func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (*RevokeSecurityGroupIngressOutput, error) { req, out := c.RevokeSecurityGroupIngressRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRevokeSecurityGroupIngress *aws.Operation @@ -6437,11 +6820,10 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *aws.Request, o // Immediately Terminates (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), // and Troubleshooting Connecting to Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) RunInstances(input *RunInstancesInput) (output *Reservation, err error) { +func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { req, out := c.RunInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRunInstances *aws.Operation @@ -6488,11 +6870,10 @@ func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *aws.Reques // // For more information, see Stopping Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) StartInstances(input *StartInstancesInput) (output *StartInstancesOutput, err error) { +func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { req, out := c.StartInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opStartInstances *aws.Operation @@ -6551,11 +6932,10 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *aws.Request, // For more information about troubleshooting, see Troubleshooting Stopping // Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) StopInstances(input *StopInstancesInput) (output *StopInstancesOutput, err error) { +func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { req, out := c.StopInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opStopInstances *aws.Operation @@ -6589,9 +6969,8 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aw // Terminated instances remain visible after termination (for approximately // one hour). // -// By default, Amazon EC2 deletes all Amazon EBS volumes that were attached -// when the instance launched. Volumes attached after instance launch continue -// running. +// By default, Amazon EC2 deletes all EBS volumes that were attached when the +// instance launched. Volumes attached after instance launch continue running. // // You can stop, start, and terminate EBS-backed instances. You can only terminate // instance store-backed instances. What happens to an instance differs if you @@ -6605,11 +6984,10 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aw // For more information about troubleshooting, see Troubleshooting Terminating // Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (output *TerminateInstancesOutput, err error) { +func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInstancesOutput, error) { req, out := c.TerminateInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opTerminateInstances *aws.Operation @@ -6638,11 +7016,10 @@ func (c *EC2) UnassignPrivateIPAddressesRequest(input *UnassignPrivateIPAddresse } // Unassigns one or more secondary private IP addresses from a network interface. -func (c *EC2) UnassignPrivateIPAddresses(input *UnassignPrivateIPAddressesInput) (output *UnassignPrivateIPAddressesOutput, err error) { +func (c *EC2) UnassignPrivateIPAddresses(input *UnassignPrivateIPAddressesInput) (*UnassignPrivateIPAddressesOutput, error) { req, out := c.UnassignPrivateIPAddressesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opUnassignPrivateIPAddresses *aws.Operation @@ -6673,16 +7050,19 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *aw // Disables monitoring for a running instance. For more information about monitoring // instances, see Monitoring Your Instances and Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) // in the Amazon Elastic Compute Cloud User Guide. -func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (output *UnmonitorInstancesOutput, err error) { +func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInstancesOutput, error) { req, out := c.UnmonitorInstancesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opUnmonitorInstances *aws.Operation type AcceptVPCPeeringConnectionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. @@ -6733,6 +7113,24 @@ type metadataAccountAttributeValue struct { SDKShapeTraits bool `type:"structure"` } +// Describes a running instance in a Spot fleet. +type ActiveInstance struct { + // The ID of the instance. + InstanceID *string `locationName:"instanceId" type:"string"` + + // The instance type. + InstanceType *string `locationName:"instanceType" type:"string"` + + // The ID of the Spot Instance request. + SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + + metadataActiveInstance `json:"-" xml:"-"` +} + +type metadataActiveInstance struct { + SDKShapeTraits bool `type:"structure"` +} + // Describes an Elastic IP address. type Address struct { // The ID representing the allocation of the address for use with EC2-VPC. @@ -6746,7 +7144,7 @@ type Address struct { // (standard) or instances in a VPC (vpc). Domain *string `locationName:"domain" type:"string"` - // The ID of the instance the address is associated with (if any). + // The ID of the instance that the address is associated with (if any). InstanceID *string `locationName:"instanceId" type:"string"` // The ID of the network interface. @@ -6774,6 +7172,10 @@ type AllocateAddressInput struct { // Default: The address is for use with instances in EC2-Classic. Domain *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataAllocateAddressInput `json:"-" xml:"-"` @@ -6848,6 +7250,10 @@ type AssociateAddressInput struct { // Default: false AllowReassociation *bool `locationName:"allowReassociation" type:"boolean"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you @@ -6892,6 +7298,10 @@ type AssociateDHCPOptionsInput struct { // the VPC. DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -6913,6 +7323,10 @@ type metadataAssociateDHCPOptionsOutput struct { } type AssociateRouteTableInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. @@ -6940,6 +7354,10 @@ type metadataAssociateRouteTableOutput struct { } type AttachClassicLinkVPCInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of one or more of the VPC's security groups. You cannot specify security @@ -6971,6 +7389,10 @@ type metadataAttachClassicLinkVPCOutput struct { } type AttachInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. @@ -6998,6 +7420,10 @@ type AttachNetworkInterfaceInput struct { // The index of the device for the network interface attachment. DeviceIndex *int64 `locationName:"deviceIndex" type:"integer" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -7025,6 +7451,10 @@ type metadataAttachNetworkInterfaceOutput struct { } type AttachVPNGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -7055,13 +7485,17 @@ type AttachVolumeInput struct { // The device name to expose to the instance (for example, /dev/sdh or xvdh). Device *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` - // The ID of the Amazon EBS volume. The volume and instance must be within the - // same Availability Zone. + // The ID of the EBS volume. The volume and instance must be within the same + // Availability Zone. VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` metadataAttachVolumeInput `json:"-" xml:"-"` @@ -7100,6 +7534,10 @@ type AuthorizeSecurityGroupEgressInput struct { // a source security group. CIDRIP *string `locationName:"cidrIp" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The start of port range for the TCP and UDP protocols, or an ICMP type number. @@ -7149,6 +7587,10 @@ type AuthorizeSecurityGroupIngressInput struct { // a source security group. CIDRIP *string `locationName:"CidrIp" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The start of port range for the TCP and UDP protocols, or an ICMP type number. @@ -7244,8 +7686,8 @@ type BlockDeviceMapping struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). DeviceName *string `locationName:"deviceName" type:"string"` - // Parameters used to automatically set up Amazon EBS volumes when the instance - // is launched. + // Parameters used to automatically set up EBS volumes when the instance is + // launched. EBS *EBSBlockDevice `locationName:"ebs" type:"structure"` // Suppresses the specified device included in the block device mapping of the @@ -7272,6 +7714,10 @@ type metadataBlockDeviceMapping struct { } type BundleInstanceInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance to bundle. @@ -7358,6 +7804,10 @@ type CancelBundleTaskInput struct { // The ID of the bundle task. BundleID *string `locationName:"BundleId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataCancelBundleTaskInput `json:"-" xml:"-"` @@ -7368,7 +7818,7 @@ type metadataCancelBundleTaskInput struct { } type CancelBundleTaskOutput struct { - // The bundle task. + // Information about the bundle task. BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` metadataCancelBundleTaskOutput `json:"-" xml:"-"` @@ -7382,8 +7832,13 @@ type CancelConversionTaskInput struct { // The ID of the conversion task. ConversionTaskID *string `locationName:"conversionTaskId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The reason for canceling the conversion task. ReasonMessage *string `locationName:"reasonMessage" type:"string"` metadataCancelConversionTaskInput `json:"-" xml:"-"` @@ -7424,9 +7879,13 @@ type CancelImportTaskInput struct { // The reason for canceling the task. CancelReason *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The ID of the ImportImage or ImportSnapshot task to be cancelled. + // The ID of the import image or import snapshot task to be canceled. ImportTaskID *string `locationName:"ImportTaskId" type:"string"` metadataCancelImportTaskInput `json:"-" xml:"-"` @@ -7437,13 +7896,13 @@ type metadataCancelImportTaskInput struct { } type CancelImportTaskOutput struct { - // The task ID of the ImportImage or ImportSnapshot task being canceled. + // The ID of the task being canceled. ImportTaskID *string `locationName:"importTaskId" type:"string"` - // The current state of the ImportImage or ImportSnapshot task being canceled. + // The current state of the task being canceled. PreviousState *string `locationName:"previousState" type:"string"` - // The current state of the ImportImage or ImportSnapshot task being canceled. + // The current state of the task being canceled. State *string `locationName:"state" type:"string"` metadataCancelImportTaskOutput `json:"-" xml:"-"` @@ -7475,7 +7934,97 @@ type metadataCancelReservedInstancesListingOutput struct { SDKShapeTraits bool `type:"structure"` } +// Describes a Spot fleet error. +type CancelSpotFleetRequestsError struct { + // The error code. + Code *string `locationName:"code" type:"string" required:"true"` + + // The description for the error code. + Message *string `locationName:"message" type:"string" required:"true"` + + metadataCancelSpotFleetRequestsError `json:"-" xml:"-"` +} + +type metadataCancelSpotFleetRequestsError struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes a Spot fleet request that was not successfully canceled. +type CancelSpotFleetRequestsErrorItem struct { + // The error. + Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + metadataCancelSpotFleetRequestsErrorItem `json:"-" xml:"-"` +} + +type metadataCancelSpotFleetRequestsErrorItem struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for CancelSpotFleetRequests. +type CancelSpotFleetRequestsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The IDs of the Spot fleet requests. + SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` + + // Indicates whether to terminate instances for a Spot fleet request if it is + // canceled successfully. + TerminateInstances *bool `locationName:"terminateInstances" type:"boolean" required:"true"` + + metadataCancelSpotFleetRequestsInput `json:"-" xml:"-"` +} + +type metadataCancelSpotFleetRequestsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the output of CancelSpotFleetRequests. +type CancelSpotFleetRequestsOutput struct { + // Information about the Spot fleet requests that are successfully canceled. + SuccessfulFleetRequests []*CancelSpotFleetRequestsSuccessItem `locationName:"successfulFleetRequestSet" locationNameList:"item" type:"list"` + + // Information about the Spot fleet requests that are not successfully canceled. + UnsuccessfulFleetRequests []*CancelSpotFleetRequestsErrorItem `locationName:"unsuccessfulFleetRequestSet" locationNameList:"item" type:"list"` + + metadataCancelSpotFleetRequestsOutput `json:"-" xml:"-"` +} + +type metadataCancelSpotFleetRequestsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes a Spot fleet request that was successfully canceled. +type CancelSpotFleetRequestsSuccessItem struct { + // The current state of the Spot fleet request. + CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true"` + + // The previous state of the Spot fleet request. + PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + metadataCancelSpotFleetRequestsSuccessItem `json:"-" xml:"-"` +} + +type metadataCancelSpotFleetRequestsSuccessItem struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for CancelSpotInstanceRequests. type CancelSpotInstanceRequestsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more Spot Instance request IDs. @@ -7488,6 +8037,7 @@ type metadataCancelSpotInstanceRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of CancelSpotInstanceRequests. type CancelSpotInstanceRequestsOutput struct { // One or more Spot Instance requests. CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` @@ -7535,15 +8085,15 @@ type metadataClassicLinkInstance struct { SDKShapeTraits bool `type:"structure"` } -// Client-specific data. +// Describes the client-specific data. type ClientData struct { - // User-defined comment about the upload. + // A user-defined comment about the disk upload. Comment *string `type:"string"` // The time that the disk upload ends. UploadEnd *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // The size of the uploaded disk image. + // The size of the uploaded disk image, in GiB. UploadSize *float64 `type:"double"` // The time that the disk upload starts. @@ -7557,6 +8107,10 @@ type metadataClientData struct { } type ConfirmProductInstanceInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -7607,6 +8161,7 @@ type ConversionTask struct { // The status message related to the conversion task. StatusMessage *string `locationName:"statusMessage" type:"string"` + // Any tags assigned to the task. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` metadataConversionTask `json:"-" xml:"-"` @@ -7625,6 +8180,10 @@ type CopyImageInput struct { // A description for the new AMI in the destination region. Description *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The name of the new AMI in the destination region. @@ -7655,7 +8214,7 @@ type metadataCopyImageOutput struct { } type CopySnapshotInput struct { - // A description for the new Amazon EBS snapshot. + // A description for the EBS snapshot. Description *string `type:"string"` // The destination region to use in the PresignedUrl parameter of a snapshot @@ -7668,6 +8227,10 @@ type CopySnapshotInput struct { // in your AWS configuration file). DestinationRegion *string `locationName:"destinationRegion" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The pre-signed URL that facilitates copying an encrypted snapshot. This parameter @@ -7675,10 +8238,10 @@ type CopySnapshotInput struct { // API; it is available as an optional parameter in all other cases. The PresignedUrl // should use the snapshot source endpoint, the CopySnapshot action, and include // the SourceRegion, SourceSnapshotId, and DestinationRegion parameters. The - // PresignedUrl must be signed using AWS Signature Version 4. Because Amazon - // EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter - // uses the same logic that is described in Authenticating Requests by Using - // Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) + // PresignedUrl must be signed using AWS Signature Version 4. Because EBS snapshots + // are stored in Amazon S3, the signing algorithm for this parameter uses the + // same logic that is described in Authenticating Requests by Using Query Parameters + // (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // in the Amazon Simple Storage Service API Reference. An invalid or improperly // signed PresignedUrl will cause the copy operation to fail asynchronously, // and the snapshot will move to an error state. @@ -7687,7 +8250,7 @@ type CopySnapshotInput struct { // The ID of the region that contains the snapshot to be copied. SourceRegion *string `type:"string" required:"true"` - // The ID of the Amazon EBS snapshot to copy. + // The ID of the EBS snapshot to copy. SourceSnapshotID *string `locationName:"SourceSnapshotId" type:"string" required:"true"` metadataCopySnapshotInput `json:"-" xml:"-"` @@ -7714,6 +8277,10 @@ type CreateCustomerGatewayInput struct { // Default: 65000 BGPASN *int64 `locationName:"BgpAsn" type:"integer" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The Internet-routable IP address for the customer gateway's outside interface. @@ -7745,6 +8312,10 @@ type CreateDHCPOptionsInput struct { // A DHCP configuration option. DHCPConfigurations []*NewDHCPConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataCreateDHCPOptionsInput `json:"-" xml:"-"` @@ -7772,6 +8343,10 @@ type CreateImageInput struct { // A description for the new image. Description *string `locationName:"description" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -7814,6 +8389,7 @@ type CreateInstanceExportTaskInput struct { // maximum length is 255 bytes. Description *string `locationName:"description" type:"string"` + // The format and location for an instance export task. ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` // The ID of the instance. @@ -7830,7 +8406,7 @@ type metadataCreateInstanceExportTaskInput struct { } type CreateInstanceExportTaskOutput struct { - // Describes an export task. + // Information about the instance export task. ExportTask *ExportTask `locationName:"exportTask" type:"structure"` metadataCreateInstanceExportTaskOutput `json:"-" xml:"-"` @@ -7841,6 +8417,10 @@ type metadataCreateInstanceExportTaskOutput struct { } type CreateInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataCreateInternetGatewayInput `json:"-" xml:"-"` @@ -7862,6 +8442,10 @@ type metadataCreateInternetGatewayOutput struct { } type CreateKeyPairInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // A unique name for the key pair. @@ -7898,6 +8482,10 @@ type CreateNetworkACLEntryInput struct { // The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). CIDRBlock *string `locationName:"cidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Indicates whether this is an egress rule (rule is applied to traffic leaving @@ -7942,6 +8530,10 @@ type metadataCreateNetworkACLEntryOutput struct { } type CreateNetworkACLInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -7969,6 +8561,10 @@ type CreateNetworkInterfaceInput struct { // A description for the network interface. Description *string `locationName:"description" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The IDs of one or more security groups. @@ -8016,6 +8612,10 @@ type metadataCreateNetworkInterfaceOutput struct { } type CreatePlacementGroupInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // A name for the placement group. @@ -8079,10 +8679,18 @@ type metadataCreateReservedInstancesListingOutput struct { } type CreateRouteInput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + // The CIDR address block used for the destination match. Routing decisions // are based on the most specific match. DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of an Internet gateway or virtual private gateway attached to your @@ -8110,6 +8718,13 @@ type metadataCreateRouteInput struct { } type CreateRouteOutput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + metadataCreateRouteOutput `json:"-" xml:"-"` } @@ -8118,6 +8733,10 @@ type metadataCreateRouteOutput struct { } type CreateRouteTableInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -8151,6 +8770,10 @@ type CreateSecurityGroupInput struct { // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* Description *string `locationName:"GroupDescription" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The name of the security group. @@ -8187,9 +8810,13 @@ type CreateSnapshotInput struct { // A description for the snapshot. Description *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Amazon EBS volume. + // The ID of the EBS volume. VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` metadataCreateSnapshotInput `json:"-" xml:"-"` @@ -8199,10 +8826,15 @@ type metadataCreateSnapshotInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionInput struct { // The Amazon S3 bucket in which to store the Spot Instance data feed. Bucket *string `locationName:"bucket" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // A prefix for the data feed file names. @@ -8215,6 +8847,7 @@ type metadataCreateSpotDatafeedSubscriptionInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionOutput struct { // The Spot Instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` @@ -8235,6 +8868,10 @@ type CreateSubnetInput struct { // The network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. CIDRBlock *string `locationName:"CidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -8259,6 +8896,10 @@ type metadataCreateSubnetOutput struct { } type CreateTagsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The IDs of one or more resources to tag. For example, ami-1a2b3c4d. @@ -8284,10 +8925,62 @@ type metadataCreateTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +type CreateVPCEndpointInput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // A policy to attach to the endpoint that controls access to the service. The + // policy must be in valid JSON format. If this parameter is not specified, + // we attach a default policy that allows full access to the service. + PolicyDocument *string `type:"string"` + + // One or more route table IDs. + RouteTableIDs []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` + + // The AWS service name, in the form com.amazonaws... To get + // a list of available services, use the DescribeVpcEndpointServices request. + ServiceName *string `type:"string" required:"true"` + + // The ID of the VPC in which the endpoint will be used. + VPCID *string `locationName:"VpcId" type:"string" required:"true"` + + metadataCreateVPCEndpointInput `json:"-" xml:"-"` +} + +type metadataCreateVPCEndpointInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type CreateVPCEndpointOutput struct { + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the endpoint. + VPCEndpoint *VPCEndpoint `locationName:"vpcEndpoint" type:"structure"` + + metadataCreateVPCEndpointOutput `json:"-" xml:"-"` +} + +type metadataCreateVPCEndpointOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type CreateVPCInput struct { // The network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. CIDRBlock *string `locationName:"CidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The supported tenancy options for instances launched into the VPC. A value @@ -8318,6 +9011,10 @@ type metadataCreateVPCOutput struct { } type CreateVPCPeeringConnectionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The AWS account ID of the owner of the peer VPC. @@ -8353,6 +9050,10 @@ type CreateVPNConnectionInput struct { // The ID of the customer gateway. CustomerGatewayID *string `locationName:"CustomerGatewayId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Indicates whether the VPN connection requires static routes. If you are creating @@ -8412,6 +9113,10 @@ type CreateVPNGatewayInput struct { // The Availability Zone for the virtual private gateway. AvailabilityZone *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The type of VPN connection this virtual private gateway supports. @@ -8440,6 +9145,10 @@ type CreateVolumeInput struct { // to list the Availability Zones that are currently available to you. AvailabilityZone *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes @@ -8492,6 +9201,8 @@ type metadataCreateVolumeInput struct { SDKShapeTraits bool `type:"structure"` } +// Describes the user or group to be added or removed from the permissions for +// a volume. type CreateVolumePermission struct { // The specific group that is to be added or removed from a volume's list of // create volume permissions. @@ -8508,6 +9219,7 @@ type metadataCreateVolumePermission struct { SDKShapeTraits bool `type:"structure"` } +// Describes modifications to the permissions for a volume. type CreateVolumePermissionModifications struct { // Adds a specific AWS account ID or group to a volume's list of create volume // permissions. @@ -8590,6 +9302,10 @@ type DeleteCustomerGatewayInput struct { // The ID of the customer gateway. CustomerGatewayID *string `locationName:"CustomerGatewayId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDeleteCustomerGatewayInput `json:"-" xml:"-"` @@ -8611,6 +9327,10 @@ type DeleteDHCPOptionsInput struct { // The ID of the DHCP options set. DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDeleteDHCPOptionsInput `json:"-" xml:"-"` @@ -8629,6 +9349,10 @@ type metadataDeleteDHCPOptionsOutput struct { } type DeleteInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. @@ -8650,6 +9374,10 @@ type metadataDeleteInternetGatewayOutput struct { } type DeleteKeyPairInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The name of the key pair. @@ -8671,6 +9399,10 @@ type metadataDeleteKeyPairOutput struct { } type DeleteNetworkACLEntryInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Indicates whether the rule is an egress rule. @@ -8698,6 +9430,10 @@ type metadataDeleteNetworkACLEntryOutput struct { } type DeleteNetworkACLInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network ACL. @@ -8719,6 +9455,10 @@ type metadataDeleteNetworkACLOutput struct { } type DeleteNetworkInterfaceInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. @@ -8740,6 +9480,10 @@ type metadataDeleteNetworkInterfaceOutput struct { } type DeletePlacementGroupInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The name of the placement group. @@ -8765,6 +9509,10 @@ type DeleteRouteInput struct { // the route exactly. DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. @@ -8786,6 +9534,10 @@ type metadataDeleteRouteOutput struct { } type DeleteRouteTableInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. @@ -8807,6 +9559,10 @@ type metadataDeleteRouteTableOutput struct { } type DeleteSecurityGroupInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the security group. Required for a nondefault VPC. @@ -8832,9 +9588,13 @@ type metadataDeleteSecurityGroupOutput struct { } type DeleteSnapshotInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Amazon EBS snapshot. + // The ID of the EBS snapshot. SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` metadataDeleteSnapshotInput `json:"-" xml:"-"` @@ -8852,7 +9612,12 @@ type metadataDeleteSnapshotOutput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for DeleteSpotDatafeedSubscription. type DeleteSpotDatafeedSubscriptionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDeleteSpotDatafeedSubscriptionInput `json:"-" xml:"-"` @@ -8871,6 +9636,10 @@ type metadataDeleteSpotDatafeedSubscriptionOutput struct { } type DeleteSubnetInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the subnet. @@ -8892,6 +9661,10 @@ type metadataDeleteSubnetOutput struct { } type DeleteTagsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the resource. For example, ami-1a2b3c4d. You can specify more than @@ -8918,7 +9691,39 @@ type metadataDeleteTagsOutput struct { SDKShapeTraits bool `type:"structure"` } +type DeleteVPCEndpointsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more endpoint IDs. + VPCEndpointIDs []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` + + metadataDeleteVPCEndpointsInput `json:"-" xml:"-"` +} + +type metadataDeleteVPCEndpointsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DeleteVPCEndpointsOutput struct { + // Information about the endpoints that were not successfully deleted. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + + metadataDeleteVPCEndpointsOutput `json:"-" xml:"-"` +} + +type metadataDeleteVPCEndpointsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type DeleteVPCInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -8940,6 +9745,10 @@ type metadataDeleteVPCOutput struct { } type DeleteVPCPeeringConnectionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. @@ -8964,6 +9773,10 @@ type metadataDeleteVPCPeeringConnectionOutput struct { } type DeleteVPNConnectionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPN connection. @@ -9007,6 +9820,10 @@ type metadataDeleteVPNConnectionRouteOutput struct { } type DeleteVPNGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the virtual private gateway. @@ -9028,6 +9845,10 @@ type metadataDeleteVPNGatewayOutput struct { } type DeleteVolumeInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. @@ -9049,6 +9870,10 @@ type metadataDeleteVolumeOutput struct { } type DeregisterImageInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. @@ -9073,6 +9898,10 @@ type DescribeAccountAttributesInput struct { // One or more account attribute names. AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDescribeAccountAttributesInput `json:"-" xml:"-"` @@ -9099,6 +9928,10 @@ type DescribeAddressesInput struct { // Default: Describes all your Elastic IP addresses. AllocationIDs []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. Filter names and values are case-sensitive. @@ -9148,6 +9981,10 @@ type metadataDescribeAddressesOutput struct { } type DescribeAvailabilityZonesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9189,6 +10026,10 @@ type DescribeBundleTasksInput struct { // Default: Describes all your bundle tasks. BundleIDs []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9235,6 +10076,10 @@ type metadataDescribeBundleTasksOutput struct { } type DescribeClassicLinkInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9300,8 +10145,13 @@ type DescribeConversionTasksInput struct { // One or more conversion task IDs. ConversionTaskIDs []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // One or more filters. Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` metadataDescribeConversionTasksInput `json:"-" xml:"-"` @@ -9312,6 +10162,7 @@ type metadataDescribeConversionTasksInput struct { } type DescribeConversionTasksOutput struct { + // Information about the conversion tasks. ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` metadataDescribeConversionTasksOutput `json:"-" xml:"-"` @@ -9327,6 +10178,10 @@ type DescribeCustomerGatewaysInput struct { // Default: Describes all your customer gateways. CustomerGatewayIDs []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9382,6 +10237,10 @@ type DescribeDHCPOptionsInput struct { // Default: Describes all your DHCP options sets. DHCPOptionsIDs []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9435,6 +10294,7 @@ type metadataDescribeExportTasksInput struct { } type DescribeExportTasksOutput struct { + // Information about the export tasks. ExportTasks []*ExportTask `locationName:"exportTaskSet" locationNameList:"item" type:"list"` metadataDescribeExportTasksOutput `json:"-" xml:"-"` @@ -9452,6 +10312,10 @@ type DescribeImageAttributeInput struct { // to get information about the block device mapping for the AMI. Attribute *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. @@ -9498,6 +10362,10 @@ type metadataDescribeImageAttributeOutput struct { } type DescribeImagesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Scopes the images by users with explicit launch permissions. Specify an AWS @@ -9511,17 +10379,17 @@ type DescribeImagesInput struct { // block-device-mapping.delete-on-termination - A Boolean value that indicates // whether the Amazon EBS volume is deleted on instance termination. // - // block-device-mapping.device-name - The device name for the Amazon EBS - // volume (for example, /dev/sdh). + // block-device-mapping.device-name - The device name for the EBS volume + // (for example, /dev/sdh). // // block-device-mapping.snapshot-id - The ID of the snapshot used for the - // Amazon EBS volume. + // EBS volume. // - // block-device-mapping.volume-size - The volume size of the Amazon EBS volume, + // block-device-mapping.volume-size - The volume size of the EBS volume, // in GiB. // - // block-device-mapping.volume-type - The volume type of the Amazon EBS volume - // (gp2 | standard | io1). + // block-device-mapping.volume-type - The volume type of the EBS volume (gp2 + // | standard | io1). // // description - The description of the image (provided during image creation). // @@ -9606,18 +10474,22 @@ type metadataDescribeImagesOutput struct { } type DescribeImportImageTasksInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // Filters to be applied on a describe request. + // One or more filters. Filters []*Filter `locationNameList:"Filter" type:"list"` - // A list of ImportImage task IDs to describe. + // A list of import image task IDs. ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - // The maximum number of results in a page. + // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` - // The token to get the next page of paginated describe requests. + // A token that indicates the next page of results. NextToken *string `type:"string"` metadataDescribeImportImageTasksInput `json:"-" xml:"-"` @@ -9628,11 +10500,12 @@ type metadataDescribeImportImageTasksInput struct { } type DescribeImportImageTasksOutput struct { - // A list of zero or more ImportImage tasks that are currently active or completed/cancelled - // in the previous 7 days. + // A list of zero or more import image tasks that are currently active or were + // completed or canceled in the previous 7 days. ImportImageTasks []*ImportImageTask `locationName:"importImageTaskSet" locationNameList:"item" type:"list"` - // The token to get the next page of paginated describe requests. + // The token to use to get the next page of results. This value is null when + // there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` metadataDescribeImportImageTasksOutput `json:"-" xml:"-"` @@ -9643,18 +10516,22 @@ type metadataDescribeImportImageTasksOutput struct { } type DescribeImportSnapshotTasksInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The filters to be applied on a describe request. + // One or more filters. Filters []*Filter `locationNameList:"Filter" type:"list"` - // A list of IDs of the ImportSnapshot tasks to describe. + // A list of import snapshot task IDs. ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - // The maximum number of results in a page. + // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` - // The token to get to the next page of paginated describe requests. + // A token that indicates the next page of results. NextToken *string `type:"string"` metadataDescribeImportSnapshotTasksInput `json:"-" xml:"-"` @@ -9665,11 +10542,12 @@ type metadataDescribeImportSnapshotTasksInput struct { } type DescribeImportSnapshotTasksOutput struct { - // A list of zero or more ImportSnapshot tasks that are currently active or - // completed/cancelled in the previous 7 days. + // A list of zero or more import snapshot tasks that are currently active or + // were completed or canceled in the previous 7 days. ImportSnapshotTasks []*ImportSnapshotTask `locationName:"importSnapshotTaskSet" locationNameList:"item" type:"list"` - // The token to get to the next page of paginated describe requests. + // The token to use to get the next page of results. This value is null when + // there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` metadataDescribeImportSnapshotTasksOutput `json:"-" xml:"-"` @@ -9683,6 +10561,10 @@ type DescribeInstanceAttributeInput struct { // The instance attribute. Attribute *string `locationName:"attribute" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -9751,28 +10633,32 @@ type metadataDescribeInstanceAttributeOutput struct { } type DescribeInstanceStatusInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. // // availability-zone - The Availability Zone of the instance. // - // event.code - The code identifying the type of event (instance-reboot | - // system-reboot | system-maintenance | instance-retirement | instance-stop). + // event.code - The code for the scheduled event (instance-reboot | system-reboot + // | system-maintenance | instance-retirement | instance-stop). // // event.description - A description of the event. // - // event.not-after - The latest end time for the scheduled event, for example: - // 2010-09-15T17:15:20.000Z. + // event.not-after - The latest end time for the scheduled event (for example, + // 2014-09-15T17:15:20.000Z). // - // event.not-before - The earliest start time for the scheduled event, for - // example: 2010-09-15T17:15:20.000Z. + // event.not-before - The earliest start time for the scheduled event (for + // example, 2014-09-15T17:15:20.000Z). // - // instance-state-code - A code representing the state of the instance, as - // a 16-bit unsigned integer. The high byte is an opaque internal value and - // should be ignored. The low byte is set based on the state represented. The - // valid values are 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), - // 64 (stopping), and 80 (stopped). + // instance-state-code - The code for the instance state, as a 16-bit unsigned + // integer. The high byte is an opaque internal value and should be ignored. + // The low byte is set based on the state represented. The valid values are + // 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), + // and 80 (stopped). // // instance-state-name - The state of the instance (pending | running | shutting-down // | terminated | stopping | stopped). @@ -9837,6 +10723,10 @@ type metadataDescribeInstanceStatusOutput struct { } type DescribeInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -9845,19 +10735,19 @@ type DescribeInstancesInput struct { // // availability-zone - The Availability Zone of the instance. // - // block-device-mapping.attach-time - The attach time for an Amazon EBS volume - // mapped to the instance, for example, 2010-09-15T17:15:20.000Z. + // block-device-mapping.attach-time - The attach time for an EBS volume mapped + // to the instance, for example, 2010-09-15T17:15:20.000Z. // // block-device-mapping.delete-on-termination - A Boolean that indicates - // whether the Amazon EBS volume is deleted on instance termination. + // whether the EBS volume is deleted on instance termination. // - // block-device-mapping.device-name - The device name for the Amazon EBS - // volume (for example, /dev/sdh or xvdh). + // block-device-mapping.device-name - The device name for the EBS volume + // (for example, /dev/sdh or xvdh). // - // block-device-mapping.status - The status for the Amazon EBS volume (attaching + // block-device-mapping.status - The status for the EBS volume (attaching // | attached | detaching | detached). // - // block-device-mapping.volume-id - The volume ID of the Amazon EBS volume. + // block-device-mapping.volume-id - The volume ID of the EBS volume. // // client-token - The idempotency token you provided when you launched the // instance. @@ -10103,6 +10993,10 @@ type metadataDescribeInstancesOutput struct { } type DescribeInternetGatewaysInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10151,6 +11045,10 @@ type metadataDescribeInternetGatewaysOutput struct { } type DescribeKeyPairsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10183,7 +11081,59 @@ type metadataDescribeKeyPairsOutput struct { SDKShapeTraits bool `type:"structure"` } +type DescribeMovingAddressesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // One or more filters. + // + // moving-status - The status of the Elastic IP address (MovingToVpc | RestoringToClassic). + Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return for the request in a single page. + // The remaining results of the initial request can be seen by sending another + // request with the returned NextToken value. This value can be between 5 and + // 1000; if MaxResults is given a value outside of this range, an error is returned. + // + // Default: If no value is provided, the default is 1000. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The token to use to retrieve the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // One or more Elastic IP addresses. + PublicIPs []*string `locationName:"publicIp" locationNameList:"item" type:"list"` + + metadataDescribeMovingAddressesInput `json:"-" xml:"-"` +} + +type metadataDescribeMovingAddressesInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DescribeMovingAddressesOutput struct { + // The status for each Elastic IP address. + MovingAddressStatuses []*MovingAddressStatus `locationName:"movingAddressStatusSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + metadataDescribeMovingAddressesOutput `json:"-" xml:"-"` +} + +type metadataDescribeMovingAddressesOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type DescribeNetworkACLsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10262,6 +11212,10 @@ type DescribeNetworkInterfaceAttributeInput struct { // The attribute of the network interface. Attribute *string `locationName:"attribute" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. @@ -10298,6 +11252,10 @@ type metadataDescribeNetworkInterfaceAttributeOutput struct { } type DescribeNetworkInterfacesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10425,6 +11383,10 @@ type metadataDescribeNetworkInterfacesOutput struct { } type DescribePlacementGroupsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10460,7 +11422,62 @@ type metadataDescribePlacementGroupsOutput struct { SDKShapeTraits bool `type:"structure"` } +type DescribePrefixListsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. + // + // prefix-list-id: The ID of a prefix list. + // + // prefix-list-name: The name of a prefix list. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of items to return for this request. The request returns + // a token that you can specify in a subsequent call to get the next set of + // results. + // + // Constraint: If the value specified is greater than 1000, we return only + // 1000 items. + MaxResults *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a prior call.) + NextToken *string `type:"string"` + + // One or more prefix list IDs. + PrefixListIDs []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` + + metadataDescribePrefixListsInput `json:"-" xml:"-"` +} + +type metadataDescribePrefixListsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DescribePrefixListsOutput struct { + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. + NextToken *string `locationName:"nextToken" type:"string"` + + // All available prefix lists. + PrefixLists []*PrefixList `locationName:"prefixListSet" locationNameList:"item" type:"list"` + + metadataDescribePrefixListsOutput `json:"-" xml:"-"` +} + +type metadataDescribePrefixListsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type DescribeRegionsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10492,6 +11509,10 @@ type metadataDescribeRegionsOutput struct { } type DescribeReservedInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10518,7 +11539,7 @@ type DescribeReservedInstancesInput struct { // start - The time at which the Reserved Instance purchase request was placed // (for example, 2014-08-07T11:54:42.000Z). // - // state - The state of the Reserved Instance (pending-payment | active | + // state - The state of the Reserved Instance (payment-pending | active | // payment-failed | retired). // // tag:key=value - The key/value combination of a tag assigned to the resource. @@ -10661,6 +11682,10 @@ type DescribeReservedInstancesOfferingsInput struct { // The Availability Zone in which the Reserved Instance can be used. AvailabilityZone *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10776,6 +11801,10 @@ type metadataDescribeReservedInstancesOutput struct { } type DescribeRouteTablesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -10796,6 +11825,9 @@ type DescribeRouteTablesInput struct { // route.destination-cidr-block - The CIDR range specified in a route in // the table. // + // route.destination-prefix-list-id - The ID (prefix) of the AWS service + // specified in a route in the table. + // // route.gateway-id - The ID of a gateway specified in a route in the table. // // route.instance-id - The ID of an instance specified in a route in the @@ -10854,12 +11886,19 @@ type metadataDescribeRouteTablesOutput struct { } type DescribeSecurityGroupsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. // // description - The description of the security group. // + // egress.ip-permission.prefix-list-id - The ID (prefix) of the AWS service + // to which the security group allows access. + // // group-id - The ID of the security group. // // group-name - The name of the security group. @@ -10929,9 +11968,13 @@ type DescribeSnapshotAttributeInput struct { // The snapshot attribute you would like to view. Attribute *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Amazon EBS snapshot. + // The ID of the EBS snapshot. SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` metadataDescribeSnapshotAttributeInput `json:"-" xml:"-"` @@ -10948,7 +11991,7 @@ type DescribeSnapshotAttributeOutput struct { // A list of product codes. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - // The ID of the Amazon EBS snapshot. + // The ID of the EBS snapshot. SnapshotID *string `locationName:"snapshotId" type:"string"` metadataDescribeSnapshotAttributeOutput `json:"-" xml:"-"` @@ -10959,6 +12002,10 @@ type metadataDescribeSnapshotAttributeOutput struct { } type DescribeSnapshotsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11040,6 +12087,7 @@ type DescribeSnapshotsOutput struct { // there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` + // Information about the snapshots. Snapshots []*Snapshot `locationName:"snapshotSet" locationNameList:"item" type:"list"` metadataDescribeSnapshotsOutput `json:"-" xml:"-"` @@ -11049,7 +12097,12 @@ type metadataDescribeSnapshotsOutput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for DescribeSpotDatafeedSubscription. type DescribeSpotDatafeedSubscriptionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDescribeSpotDatafeedSubscriptionInput `json:"-" xml:"-"` @@ -11059,6 +12112,7 @@ type metadataDescribeSpotDatafeedSubscriptionInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of DescribeSpotDatafeedSubscription. type DescribeSpotDatafeedSubscriptionOutput struct { // The Spot Instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` @@ -11070,7 +12124,160 @@ type metadataDescribeSpotDatafeedSubscriptionOutput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for DescribeSpotFleetInstances. +type DescribeSpotFleetInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The token for the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + metadataDescribeSpotFleetInstancesInput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetInstancesInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the output of DescribeSpotFleetInstances. +type DescribeSpotFleetInstancesOutput struct { + // The running instances. Note that this list is refreshed periodically and + // might be out of date. + ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list" required:"true"` + + // The token required to retrieve the next set of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + metadataDescribeSpotFleetInstancesOutput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetInstancesOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for DescribeSpotFleetRequestHistory. +type DescribeSpotFleetRequestHistoryInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The type of events to describe. By default, all events are described. + EventType *string `locationName:"eventType" type:"string"` + + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The token for the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + metadataDescribeSpotFleetRequestHistoryInput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetRequestHistoryInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the output of DescribeSpotFleetRequestHistory. +type DescribeSpotFleetRequestHistoryOutput struct { + // Information about the events in the history of the Spot fleet request. + HistoryRecords []*HistoryRecord `locationName:"historyRecordSet" locationNameList:"item" type:"list" required:"true"` + + // The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // All records up to this time were retrieved. + // + // If nextToken indicates that there are more results, this value is not present. + LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The token required to retrieve the next set of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + metadataDescribeSpotFleetRequestHistoryOutput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetRequestHistoryOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for DescribeSpotFleetRequests. +type DescribeSpotFleetRequestsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // The token for the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The IDs of the Spot fleet requests. + SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` + + metadataDescribeSpotFleetRequestsInput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetRequestsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the output of DescribeSpotFleetRequests. +type DescribeSpotFleetRequestsOutput struct { + // The token required to retrieve the next set of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the configuration of your Spot fleet. + SpotFleetRequestConfigs []*SpotFleetRequestConfig `locationName:"spotFleetRequestConfigSet" locationNameList:"item" type:"list" required:"true"` + + metadataDescribeSpotFleetRequestsOutput `json:"-" xml:"-"` +} + +type metadataDescribeSpotFleetRequestsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for DescribeSpotInstanceRequests. type DescribeSpotInstanceRequestsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11193,6 +12400,7 @@ type metadataDescribeSpotInstanceRequestsInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of DescribeSpotInstanceRequests. type DescribeSpotInstanceRequestsOutput struct { // One or more Spot Instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` @@ -11204,14 +12412,19 @@ type metadataDescribeSpotInstanceRequestsOutput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for DescribeSpotPriceHistory. type DescribeSpotPriceHistoryInput struct { // Filters the results by the specified Availability Zone. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The date and time, up to the current date, from which to stop retrieving - // the price history data. + // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` // One or more filters. @@ -11227,29 +12440,27 @@ type DescribeSpotPriceHistoryInput struct { // spot-price - The Spot Price. The value must match exactly (or use wildcards; // greater than or less than comparison is not supported). // - // timestamp - The timestamp of the Spot Price history (for example, 2010-08-16T05:06:11.000Z). - // You can use wildcards (* and ?). Greater than or less than comparison is - // not supported. + // timestamp - The timestamp of the Spot Price history, in UTC format (for + // example, YYYY-MM-DDTHH:MM:SSZ). You can use wildcards (* and ?). Greater + // than or less than comparison is not supported. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // Filters the results by the specified instance types. InstanceTypes []*string `locationName:"InstanceType" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. MaxResults *int64 `locationName:"maxResults" type:"integer"` - // The token to retrieve the next page of results. + // The token for the next set of results. NextToken *string `locationName:"nextToken" type:"string"` // Filters the results by the specified basic product descriptions. ProductDescriptions []*string `locationName:"ProductDescription" type:"list"` // The date and time, up to the past 90 days, from which to start retrieving - // the price history data. + // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` metadataDescribeSpotPriceHistoryInput `json:"-" xml:"-"` @@ -11259,8 +12470,9 @@ type metadataDescribeSpotPriceHistoryInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of DescribeSpotPriceHistory. type DescribeSpotPriceHistoryOutput struct { - // The token to use to retrieve the next page of results. This value is null + // The token required to retrieve the next set of results. This value is null // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` @@ -11275,6 +12487,10 @@ type metadataDescribeSpotPriceHistoryOutput struct { } type DescribeSubnetsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11335,6 +12551,10 @@ type metadataDescribeSubnetsOutput struct { } type DescribeTagsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11387,6 +12607,10 @@ type DescribeVPCAttributeInput struct { // The VPC attribute. Attribute *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -11421,6 +12645,10 @@ type metadataDescribeVPCAttributeOutput struct { } type DescribeVPCClassicLinkInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11462,7 +12690,106 @@ type metadataDescribeVPCClassicLinkOutput struct { SDKShapeTraits bool `type:"structure"` } +type DescribeVPCEndpointServicesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // The maximum number of items to return for this request. The request returns + // a token that you can specify in a subsequent call to get the next set of + // results. + // + // Constraint: If the value is greater than 1000, we return only 1000 items. + MaxResults *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a prior call.) + NextToken *string `type:"string"` + + metadataDescribeVPCEndpointServicesInput `json:"-" xml:"-"` +} + +type metadataDescribeVPCEndpointServicesInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DescribeVPCEndpointServicesOutput struct { + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of supported AWS services. + ServiceNames []*string `locationName:"serviceNameSet" locationNameList:"item" type:"list"` + + metadataDescribeVPCEndpointServicesOutput `json:"-" xml:"-"` +} + +type metadataDescribeVPCEndpointServicesOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DescribeVPCEndpointsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. + // + // service-name: The name of the AWS service. + // + // vpc-id: The ID of the VPC in which the endpoint resides. + // + // vpc-endpoint-id: The ID of the endpoint. + // + // vpc-endpoint-state: The state of the endpoint. (pending | available | + // deleting | deleted) + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of items to return for this request. The request returns + // a token that you can specify in a subsequent call to get the next set of + // results. + // + // Constraint: If the value is greater than 1000, we return only 1000 items. + MaxResults *int64 `type:"integer"` + + // The token for the next set of items to return. (You received this token from + // a prior call.) + NextToken *string `type:"string"` + + // One or more endpoint IDs. + VPCEndpointIDs []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list"` + + metadataDescribeVPCEndpointsInput `json:"-" xml:"-"` +} + +type metadataDescribeVPCEndpointsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type DescribeVPCEndpointsOutput struct { + // The token to use when requesting the next set of items. If there are no additional + // items to return, the string is empty. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the endpoints. + VPCEndpoints []*VPCEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"` + + metadataDescribeVPCEndpointsOutput `json:"-" xml:"-"` +} + +type metadataDescribeVPCEndpointsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type DescribeVPCPeeringConnectionsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11528,6 +12855,10 @@ type metadataDescribeVPCPeeringConnectionsOutput struct { } type DescribeVPCsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11581,6 +12912,10 @@ type metadataDescribeVPCsOutput struct { } type DescribeVPNConnectionsInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11649,6 +12984,10 @@ type metadataDescribeVPNConnectionsOutput struct { } type DescribeVPNGatewaysInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11708,6 +13047,10 @@ type DescribeVolumeAttributeInput struct { // The instance attribute. Attribute *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. @@ -11738,6 +13081,10 @@ type metadataDescribeVolumeAttributeOutput struct { } type DescribeVolumeStatusInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11817,6 +13164,10 @@ type metadataDescribeVolumeStatusOutput struct { } type DescribeVolumesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more filters. @@ -11901,6 +13252,7 @@ type DescribeVolumesOutput struct { // are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` + // Information about the volumes. Volumes []*Volume `locationName:"volumeSet" locationNameList:"item" type:"list"` metadataDescribeVolumesOutput `json:"-" xml:"-"` @@ -11911,6 +13263,10 @@ type metadataDescribeVolumesOutput struct { } type DetachClassicLinkVPCInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance to unlink from the VPC. @@ -11938,6 +13294,10 @@ type metadataDetachClassicLinkVPCOutput struct { } type DetachInternetGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. @@ -11965,6 +13325,10 @@ type DetachNetworkInterfaceInput struct { // The ID of the attachment. AttachmentID *string `locationName:"attachmentId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Specifies whether to force a detachment. @@ -11986,6 +13350,10 @@ type metadataDetachNetworkInterfaceOutput struct { } type DetachVPNGatewayInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -12013,6 +13381,10 @@ type DetachVolumeInput struct { // The device name. Device *string `type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Forces detachment if the previous detachment attempt did not occur cleanly @@ -12060,6 +13432,10 @@ type metadataDisableVGWRoutePropagationOutput struct { } type DisableVPCClassicLinkInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -12087,6 +13463,10 @@ type DisassociateAddressInput struct { // [EC2-VPC] The association ID. Required for EC2-VPC. AssociationID *string `locationName:"AssociationId" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. @@ -12112,6 +13492,10 @@ type DisassociateRouteTableInput struct { // table and subnet. AssociationID *string `locationName:"associationId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` metadataDisassociateRouteTableInput `json:"-" xml:"-"` @@ -12131,11 +13515,13 @@ type metadataDisassociateRouteTableOutput struct { // Describes a disk image. type DiskImage struct { + // A description of the disk image. Description *string `type:"string"` + // Information about the disk image. Image *DiskImageDetail `type:"structure"` - // Describes an Amazon EBS volume. + // Information about the volume. Volume *VolumeDetail `type:"structure"` metadataDiskImage `json:"-" xml:"-"` @@ -12145,6 +13531,7 @@ type metadataDiskImage struct { SDKShapeTraits bool `type:"structure"` } +// Describes a disk image. type DiskImageDescription struct { // The checksum computed for the disk image. Checksum *string `locationName:"checksum" type:"string"` @@ -12159,7 +13546,7 @@ type DiskImageDescription struct { // topic in the Amazon Simple Storage Service Developer Guide. ImportManifestURL *string `locationName:"importManifestUrl" type:"string" required:"true"` - // The size of the disk image. + // The size of the disk image, in GiB. Size *int64 `locationName:"size" type:"long" required:"true"` metadataDiskImageDescription `json:"-" xml:"-"` @@ -12169,7 +13556,9 @@ type metadataDiskImageDescription struct { SDKShapeTraits bool `type:"structure"` } +// Describes a disk image. type DiskImageDetail struct { + // The size of the disk image, in GiB. Bytes *int64 `locationName:"bytes" type:"long" required:"true"` // The disk image format. @@ -12189,11 +13578,12 @@ type metadataDiskImageDetail struct { SDKShapeTraits bool `type:"structure"` } +// Describes a disk image volume. type DiskImageVolumeDescription struct { // The volume identifier. ID *string `locationName:"id" type:"string" required:"true"` - // The size of the volume. + // The size of the volume, in GiB. Size *int64 `locationName:"size" type:"long"` metadataDiskImageVolumeDescription `json:"-" xml:"-"` @@ -12203,13 +13593,13 @@ type metadataDiskImageVolumeDescription struct { SDKShapeTraits bool `type:"structure"` } -// Describes an Amazon EBS block device. +// Describes a block device for an EBS volume. type EBSBlockDevice struct { - // Indicates whether the Amazon EBS volume is deleted on instance termination. + // Indicates whether the EBS volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - // Indicates whether the Amazon EBS volume is encrypted. Encrypted Amazon EBS - // volumes may only be attached to instances that support Amazon EBS encryption. + // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes + // may only be attached to instances that support Amazon EBS encryption. Encrypted *bool `locationName:"encrypted" type:"boolean"` // The number of I/O operations per second (IOPS) that the volume supports. @@ -12253,8 +13643,7 @@ type metadataEBSBlockDevice struct { SDKShapeTraits bool `type:"structure"` } -// Describes a parameter used to set up an Amazon EBS volume in a block device -// mapping. +// Describes a parameter used to set up an EBS volume in a block device mapping. type EBSInstanceBlockDevice struct { // The time stamp when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` @@ -12265,7 +13654,7 @@ type EBSInstanceBlockDevice struct { // The attachment state. Status *string `locationName:"status" type:"string"` - // The ID of the Amazon EBS volume. + // The ID of the EBS volume. VolumeID *string `locationName:"volumeId" type:"string"` metadataEBSInstanceBlockDevice `json:"-" xml:"-"` @@ -12279,7 +13668,7 @@ type EBSInstanceBlockDeviceSpecification struct { // Indicates whether the volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - // The ID of the Amazon EBS volume. + // The ID of the EBS volume. VolumeID *string `locationName:"volumeId" type:"string"` metadataEBSInstanceBlockDeviceSpecification `json:"-" xml:"-"` @@ -12312,6 +13701,10 @@ type metadataEnableVGWRoutePropagationOutput struct { } type EnableVPCClassicLinkInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. @@ -12336,6 +13729,10 @@ type metadataEnableVPCClassicLinkOutput struct { } type EnableVolumeIOInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. @@ -12356,7 +13753,66 @@ type metadataEnableVolumeIOOutput struct { SDKShapeTraits bool `type:"structure"` } -// Describes an export task. +// Describes a Spot fleet event. +type EventInformation struct { + // The description of the event. + EventDescription *string `locationName:"eventDescription" type:"string"` + + // The event. + // + // The following are the error events. + // + // iamFleetRoleInvalid - Spot fleet did not have the required permissions + // either to launch or terminate an instance. + // + // spotFleetRequestConfigurationInvalid - The configuration is not valid. + // For more information, see the description. spotInstanceCountLimitExceeded + // - You've reached the limit on the number of Spot Instances that you can launch. + // + // The following are the fleetRequestChange events. + // + // active - The Spot fleet has been validated and Amazon EC2 is attempting + // to maintain the target number of running Spot Instances. + // + // cancelled - The Spot fleet is canceled and has no running Spot Instances. + // The Spot fleet will be deleted two days after its instances were terminated. + // + // cancelled_running - The Spot fleet is canceled and will not launch additional + // Spot Instances, but its existing Spot Instances will continue to run until + // they are interrupted or terminated. + // + // cancelled_terminating - The Spot fleet is canceled and its Spot Instances + // are terminating. + // + // expired - The Spot fleet request has expired. A subsequent event indicates + // that the instances were terminated, if the request was created with terminateInstancesWithExpiration + // set. + // + // price_update - The bid price for a launch configuration was adjusted because + // it was too high. This change is permanent. + // + // submitted - The Spot fleet request is being evaluated and Amazon EC2 is + // preparing to launch the target number of Spot Instances. + // + // The following are the instanceChange events. + // + // launched - A bid was fulfilled and a new instance was launched. + // + // terminated - An instance was terminated by the user. + EventSubType *string `locationName:"eventSubType" type:"string"` + + // The ID of the instance. This information is available only for instanceChange + // events. + InstanceID *string `locationName:"instanceId" type:"string"` + + metadataEventInformation `json:"-" xml:"-"` +} + +type metadataEventInformation struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes an instance export task. type ExportTask struct { // A description of the resource being exported. Description *string `locationName:"description" type:"string"` @@ -12364,12 +13820,13 @@ type ExportTask struct { // The ID of the export task. ExportTaskID *string `locationName:"exportTaskId" type:"string"` + // Information about the export task. ExportToS3Task *ExportToS3Task `locationName:"exportToS3" type:"structure"` - // The instance being exported. + // Information about the instance to export. InstanceExportDetails *InstanceExportDetails `locationName:"instanceExport" type:"structure"` - // The state of the conversion task. + // The state of the export task. State *string `locationName:"state" type:"string"` // The status message related to the export task. @@ -12382,6 +13839,7 @@ type metadataExportTask struct { SDKShapeTraits bool `type:"structure"` } +// Describes the format and location for an instance export task. type ExportToS3Task struct { // The container format used to combine disk images with metadata (such as OVF). // If absent, only the disk image is exported. @@ -12390,10 +13848,11 @@ type ExportToS3Task struct { // The format for the exported image. DiskImageFormat *string `locationName:"diskImageFormat" type:"string"` - // The Amazon S3 bucket for the destination image. The destination bucket must - // exist and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. + // The S3 bucket for the destination image. The destination bucket must exist + // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. S3Bucket *string `locationName:"s3Bucket" type:"string"` + // The encryption key for your S3 bucket. S3Key *string `locationName:"s3Key" type:"string"` metadataExportToS3Task `json:"-" xml:"-"` @@ -12403,15 +13862,21 @@ type metadataExportToS3Task struct { SDKShapeTraits bool `type:"structure"` } +// Describes an instance export task. type ExportToS3TaskSpecification struct { + // The container format used to combine disk images with metadata (such as OVF). + // If absent, only the disk image is exported. ContainerFormat *string `locationName:"containerFormat" type:"string"` + // The format for the exported image. DiskImageFormat *string `locationName:"diskImageFormat" type:"string"` + // The S3 bucket for the destination image. The destination bucket must exist + // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. S3Bucket *string `locationName:"s3Bucket" type:"string"` - // The image is written to a single object in the Amazon S3 bucket at the S3 - // key s3prefix + exportTaskId + '.' + diskImageFormat. + // The image is written to a single object in the S3 bucket at the S3 key s3prefix + // + exportTaskId + '.' + diskImageFormat. S3Prefix *string `locationName:"s3Prefix" type:"string"` metadataExportToS3TaskSpecification `json:"-" xml:"-"` @@ -12439,6 +13904,10 @@ type metadataFilter struct { } type GetConsoleOutputInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -12469,6 +13938,10 @@ type metadataGetConsoleOutputOutput struct { } type GetPasswordDataInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Windows instance. @@ -12513,6 +13986,31 @@ type metadataGroupIdentifier struct { SDKShapeTraits bool `type:"structure"` } +// Describes an event in the history of the Spot fleet request. +type HistoryRecord struct { + // Information about the event. + EventInformation *EventInformation `locationName:"eventInformation" type:"structure" required:"true"` + + // The event type. + // + // error - Indicates an error with the Spot fleet request. + // + // fleetRequestChange - Indicates a change in the status or configuration + // of the Spot fleet request. + // + // instanceChange - Indicates that an instance was launched or terminated. + EventType *string `locationName:"eventType" type:"string" required:"true"` + + // The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + metadataHistoryRecord `json:"-" xml:"-"` +} + +type metadataHistoryRecord struct { + SDKShapeTraits bool `type:"structure"` +} + // Describes an IAM instance profile. type IAMInstanceProfile struct { // The Amazon Resource Name (ARN) of the instance profile. @@ -12577,6 +14075,12 @@ type IPPermission struct { // One or more IP ranges. IPRanges []*IPRange `locationName:"ipRanges" locationNameList:"item" type:"list"` + // (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups + // only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress + // request, this is the AWS service that you want to access through a VPC endpoint + // from instances associated with the security group. + PrefixListIDs []*PrefixListID `locationName:"prefixListIds" locationNameList:"item" type:"list"` + // The end of port range for the TCP and UDP protocols, or an ICMP code. A value // of -1 indicates all ICMP codes for the specified ICMP type. ToPort *int64 `locationName:"toPort" type:"integer"` @@ -12662,8 +14166,8 @@ type Image struct { // The device name of the root device (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - // The type of root device used by the AMI. The AMI can use an Amazon EBS volume - // or an instance store volume. + // The type of root device used by the AMI. The AMI can use an EBS volume or + // an instance store volume. RootDeviceType *string `locationName:"rootDeviceType" type:"string"` // Specifies whether enhanced networking is enabled. @@ -12689,25 +14193,27 @@ type metadataImage struct { SDKShapeTraits bool `type:"structure"` } -// The disk container object for an ImportImage task. +// Describes the disk container object for an import image task. type ImageDiskContainer struct { - // The description of the disk image (optional). + // The description of the disk image. Description *string `type:"string"` - // The Amazon EBS block device mapping for the disk (optional). + // The block device mapping for the disk. DeviceName *string `type:"string"` - // The format of the disk image being imported (optional). + // The format of the disk image being imported. + // + // Valid values: RAW | VHD | VMDK | OVA Format *string `type:"string"` - // The Amazon EBS snapshot ID to be used for importing the snapshot. + // The ID of the EBS snapshot to be used for importing the snapshot. SnapshotID *string `locationName:"SnapshotId" type:"string"` // The URL to the Amazon S3-based disk image being imported. The URL can either // be a https URL (https://..) or an Amazon S3 URL (s3://..) URL *string `locationName:"Url" type:"string"` - // User's Amazon S3 bucket details used to access the image. + // The S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` metadataImageDiskContainer `json:"-" xml:"-"` @@ -12718,41 +14224,50 @@ type metadataImageDiskContainer struct { } type ImportImageInput struct { - // The architecture of the virtual machine being imported (optional). + // The architecture of the virtual machine. + // + // Valid values: i386 | x86_64 Architecture *string `type:"string"` - // Client-specific data. + // The client-specific data. ClientData *ClientData `type:"structure"` - // The token to enable idempotency for VM import requests (optional). + // The token to enable idempotency for VM import requests. ClientToken *string `type:"string"` - // A description string for the import image task (optional). + // A description string for the import image task. Description *string `type:"string"` + // Information about the disk containers. DiskContainers []*ImageDiskContainer `locationName:"DiskContainer" locationNameList:"item" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The target hypervisor platform to use (optional). + // The target hypervisor platform. + // + // Valid values: xen Hypervisor *string `type:"string"` - // The license type to be used for the Amazon Machine Image (AMI) after importing - // (optional). + // The license type to be used for the Amazon Machine Image (AMI) after importing. // // Note: You may only use BYOL if you have existing licenses with rights to // use these licenses in a third party cloud like AWS. For more information, // see VM Import/Export Prerequisites (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Valid Values: AWS | BYOL + // Valid values: AWS | BYOL LicenseType *string `type:"string"` - // The operating system of the virtual machine being imported (optional). + // The operating system of the virtual machine. + // + // Valid values: Windows | Linux Platform *string `type:"string"` - // The name of the role to use when not using the default role name 'vmimport' - // (optional). + // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` metadataImportImageInput `json:"-" xml:"-"` @@ -12763,30 +14278,31 @@ type metadataImportImageInput struct { } type ImportImageOutput struct { - // Architecture of the virtual machine being imported. + // The architecture of the virtual machine. Architecture *string `locationName:"architecture" type:"string"` // A description of the import task. Description *string `locationName:"description" type:"string"` - // Target hypervisor of the import task. + // The target hypervisor of the import task. Hypervisor *string `locationName:"hypervisor" type:"string"` - // The Amazon Machine Image (AMI) ID created by the import task. + // The ID of the Amazon Machine Image (AMI) created by the import task. ImageID *string `locationName:"imageId" type:"string"` - // The task id of the ImportImage task. + // The task ID of the import image task. ImportTaskID *string `locationName:"importTaskId" type:"string"` - // License type of the virtual machine being imported. + // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` - // Operating system of the VM being imported. + // The operating system of the virtual machine. Platform *string `locationName:"platform" type:"string"` - // The task's progress. + // The progress of the task. Progress *string `locationName:"progress" type:"string"` + // Information about the snapshots. SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` // A brief status of the task. @@ -12802,37 +14318,43 @@ type metadataImportImageOutput struct { SDKShapeTraits bool `type:"structure"` } +// Describes an import image task. type ImportImageTask struct { - // Architecture of the VM being imported. + // The architecture of the virtual machine. + // + // Valid values: i386 | x86_64 Architecture *string `locationName:"architecture" type:"string"` - // Description of the import task. + // A description of the import task. Description *string `locationName:"description" type:"string"` - // Target hypervisor for the import task. + // The target hypervisor for the import task. + // + // Valid values: xen Hypervisor *string `locationName:"hypervisor" type:"string"` - // The Amazon Machine Image (AMI) ID of the imported virtual machine. + // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. ImageID *string `locationName:"imageId" type:"string"` - // The ID of the import task. + // The ID of the import image task. ImportTaskID *string `locationName:"importTaskId" type:"string"` - // License type of the VM being imported. + // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` // The description string for the import image task. Platform *string `locationName:"platform" type:"string"` - // The percentage of progress of the ImportImage task. + // The percentage of progress of the import image task. Progress *string `locationName:"progress" type:"string"` + // Information about the snapshots. SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` - // A brief status for the ImportImage task. + // A brief status for the import image task. Status *string `locationName:"status" type:"string"` - // A descriptive status message for the ImportImage task. + // A descriptive status message for the import image task. StatusMessage *string `locationName:"statusMessage" type:"string"` metadataImportImageTask `json:"-" xml:"-"` @@ -12846,10 +14368,16 @@ type ImportInstanceInput struct { // A description for the instance being imported. Description *string `locationName:"description" type:"string"` + // The disk image. DiskImages []*DiskImage `locationName:"diskImage" type:"list"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The launch specification. LaunchSpecification *ImportInstanceLaunchSpecification `locationName:"launchSpecification" type:"structure"` // The instance operating system. @@ -12862,7 +14390,9 @@ type metadataImportInstanceInput struct { SDKShapeTraits bool `type:"structure"` } +// Describes the launch specification for VM import. type ImportInstanceLaunchSpecification struct { + // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` // The architecture of the instance. @@ -12878,28 +14408,24 @@ type ImportInstanceLaunchSpecification struct { // from the instance (using the operating system command for system shutdown). InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string"` - // The instance type. This is not supported for VMs imported into a VPC, which - // are assigned the default security group. After a VM is imported into a VPC, - // you can specify another security group using the AWS Management Console. - // For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. For more information about - // the Linux instance types you can import, see Before You Get Started (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html) + // The instance type. For more information about the instance types that you + // can import, see Before You Get Started (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/VMImportPrerequisites.html) // in the Amazon Elastic Compute Cloud User Guide. InstanceType *string `locationName:"instanceType" type:"string"` + // Indicates whether monitoring is enabled. Monitoring *bool `locationName:"monitoring" type:"boolean"` - // Describes the placement for the instance. + // The placement information for the instance. Placement *Placement `locationName:"placement" type:"structure"` - // [EC2-VPC] Optionally, you can use this parameter to assign the instance a - // specific available IP address from the IP address range of the subnet. + // [EC2-VPC] An available IP address from the IP address range of the subnet. PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` - // [EC2-VPC] The ID of the subnet to launch the instance into. + // [EC2-VPC] The ID of the subnet in which to launch the instance. SubnetID *string `locationName:"subnetId" type:"string"` - // User data to be made available to the instance. + // The Base64-encoded MIME user data to be made available to the instance. UserData *UserData `locationName:"userData" type:"structure"` metadataImportInstanceLaunchSpecification `json:"-" xml:"-"` @@ -12910,7 +14436,7 @@ type metadataImportInstanceLaunchSpecification struct { } type ImportInstanceOutput struct { - // Describes a conversion task. + // Information about the conversion task. ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` metadataImportInstanceOutput `json:"-" xml:"-"` @@ -12920,14 +14446,18 @@ type metadataImportInstanceOutput struct { SDKShapeTraits bool `type:"structure"` } +// Describes an import instance task. type ImportInstanceTaskDetails struct { + // A description of the task. Description *string `locationName:"description" type:"string"` + // The ID of the instance. InstanceID *string `locationName:"instanceId" type:"string"` // The instance operating system. Platform *string `locationName:"platform" type:"string"` + // One or more volumes. Volumes []*ImportInstanceVolumeDetailItem `locationName:"volumes" locationNameList:"item" type:"list" required:"true"` metadataImportInstanceTaskDetails `json:"-" xml:"-"` @@ -12945,6 +14475,7 @@ type ImportInstanceVolumeDetailItem struct { // The number of bytes converted so far. BytesConverted *int64 `locationName:"bytesConverted" type:"long" required:"true"` + // A description of the task. Description *string `locationName:"description" type:"string"` // The image. @@ -12967,6 +14498,10 @@ type metadataImportInstanceVolumeDetailItem struct { } type ImportKeyPairInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // A unique name for the key pair. @@ -12998,22 +14533,25 @@ type metadataImportKeyPairOutput struct { } type ImportSnapshotInput struct { - // Client-specific data. + // The client-specific data. ClientData *ClientData `type:"structure"` - // Token to enable idempotency for VM import requests (optional). + // Token to enable idempotency for VM import requests. ClientToken *string `type:"string"` - // The description string for the ImportSnapshot task. + // The description string for the import snapshot task. Description *string `type:"string"` - // The disk container object for the ImportSnapshot request. + // Information about the disk container. DiskContainer *SnapshotDiskContainer `type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The name of the role to use when not using the default role name 'vmimport' - // (optional). + // The name of the role to use when not using the default role, 'vmimport'. RoleName *string `type:"string"` metadataImportSnapshotInput `json:"-" xml:"-"` @@ -13024,13 +14562,13 @@ type metadataImportSnapshotInput struct { } type ImportSnapshotOutput struct { - // Description of the import snapshot task. + // A description of the import snapshot task. Description *string `locationName:"description" type:"string"` - // Task ID of the ImportSnapshot task. + // The ID of the import snapshot task. ImportTaskID *string `locationName:"importTaskId" type:"string"` - // Details about the import snapshot task. + // Information about the import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` metadataImportSnapshotOutput `json:"-" xml:"-"` @@ -13040,14 +14578,15 @@ type metadataImportSnapshotOutput struct { SDKShapeTraits bool `type:"structure"` } +// Describes an import snapshot task. type ImportSnapshotTask struct { - // Description for the import snapshot task. + // A description of the import snapshot task. Description *string `locationName:"description" type:"string"` - // The task ID of the ImportSnapshot task. + // The ID of the import snapshot task. ImportTaskID *string `locationName:"importTaskId" type:"string"` - // Details about the import snapshot task. + // Describes an import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` metadataImportSnapshotTask `json:"-" xml:"-"` @@ -13058,17 +14597,22 @@ type metadataImportSnapshotTask struct { } type ImportVolumeInput struct { - // The Availability Zone for the resulting Amazon EBS volume. + // The Availability Zone for the resulting EBS volume. AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - // An optional description for the volume being imported. + // A description of the volume. Description *string `locationName:"description" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The disk image. Image *DiskImageDetail `locationName:"image" type:"structure" required:"true"` - // Describes an Amazon EBS volume. + // The volume size. Volume *VolumeDetail `locationName:"volume" type:"structure" required:"true"` metadataImportVolumeInput `json:"-" xml:"-"` @@ -13079,7 +14623,7 @@ type metadataImportVolumeInput struct { } type ImportVolumeOutput struct { - // Describes a conversion task. + // Information about the conversion task. ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` metadataImportVolumeOutput `json:"-" xml:"-"` @@ -13199,8 +14743,8 @@ type Instance struct { // The root device name (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - // The root device type used by the AMI. The AMI can use an Amazon EBS volume - // or an instance store volume. + // The root device type used by the AMI. The AMI can use an EBS volume or an + // instance store volume. RootDeviceType *string `locationName:"rootDeviceType" type:"string"` // Specifies whether enhanced networking is enabled. @@ -13253,8 +14797,8 @@ type InstanceBlockDeviceMapping struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). DeviceName *string `locationName:"deviceName" type:"string"` - // Parameters used to automatically set up Amazon EBS volumes when the instance - // is launched. + // Parameters used to automatically set up EBS volumes when the instance is + // launched. EBS *EBSInstanceBlockDevice `locationName:"ebs" type:"structure"` metadataInstanceBlockDeviceMapping `json:"-" xml:"-"` @@ -13269,8 +14813,8 @@ type InstanceBlockDeviceMappingSpecification struct { // The device name exposed to the instance (for example, /dev/sdh or xvdh). DeviceName *string `locationName:"deviceName" type:"string"` - // Parameters used to automatically set up Amazon EBS volumes when the instance - // is launched. + // Parameters used to automatically set up EBS volumes when the instance is + // launched. EBS *EBSInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` // suppress the specified device included in the block device mapping. @@ -13288,7 +14832,7 @@ type metadataInstanceBlockDeviceMappingSpecification struct { // Describes a Reserved Instance listing state. type InstanceCount struct { - // he number of listed Reserved Instances in the state specified by the state. + // The number of listed Reserved Instances in the state specified by the state. InstanceCount *int64 `locationName:"instanceCount" type:"integer"` // The states of the listed Reserved Instances. @@ -13301,7 +14845,7 @@ type metadataInstanceCount struct { SDKShapeTraits bool `type:"structure"` } -// Describes an instance export task. +// Describes an instance to export. type InstanceExportDetails struct { // The ID of the resource being exported. InstanceID *string `locationName:"instanceId" type:"string"` @@ -13552,7 +15096,7 @@ type InstanceStatus struct { // The Availability Zone of the instance. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - // Extra information regarding events associated with the instance. + // Any scheduled events associated with the instance. Events []*InstanceStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` // The ID of the instance. @@ -13597,12 +15141,16 @@ type metadataInstanceStatusDetails struct { SDKShapeTraits bool `type:"structure"` } -// Describes an instance event. +// Describes a scheduled event for an instance. type InstanceStatusEvent struct { - // The associated code of the event. + // The event code. Code *string `locationName:"code" type:"string"` // A description of the event. + // + // After a scheduled event is completed, it can still be described for up to + // a week. If the event has been completed, this description starts with the + // following text: [Completed]. Description *string `locationName:"description" type:"string"` // The latest scheduled end time for the event. @@ -13785,6 +15333,10 @@ type ModifyImageAttributeInput struct { // A description for the AMI. Description *AttributeValue `type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. @@ -13846,6 +15398,10 @@ type ModifyInstanceAttributeInput struct { // console, CLI, or API; otherwise, you can. DisableAPITermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Specifies whether the instance is optimized for EBS I/O. This optimization @@ -13925,6 +15481,10 @@ type ModifyNetworkInterfaceAttributeInput struct { // A description for the network interface. Description *AttributeValue `locationName:"description" type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Changes the security groups for the network interface. The new set of groups @@ -13994,6 +15554,10 @@ type ModifySnapshotAttributeInput struct { // A JSON representation of the snapshot attribute modification. CreateVolumePermission *CreateVolumePermissionModifications `type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The group to modify for the snapshot. @@ -14078,10 +15642,56 @@ type metadataModifyVPCAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +type ModifyVPCEndpointInput struct { + // One or more route tables IDs to associate with the endpoint. + AddRouteTableIDs []*string `locationName:"AddRouteTableId" locationNameList:"item" type:"list"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // A policy document to attach to the endpoint. The policy must be in valid + // JSON format. + PolicyDocument *string `type:"string"` + + // One or more route table IDs to disassociate from the endpoint. + RemoveRouteTableIDs []*string `locationName:"RemoveRouteTableId" locationNameList:"item" type:"list"` + + // Specify true to reset the policy document to the default policy. The default + // policy allows access to the service. + ResetPolicy *bool `type:"boolean"` + + // The ID of the endpoint. + VPCEndpointID *string `locationName:"VpcEndpointId" type:"string" required:"true"` + + metadataModifyVPCEndpointInput `json:"-" xml:"-"` +} + +type metadataModifyVPCEndpointInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type ModifyVPCEndpointOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataModifyVPCEndpointOutput `json:"-" xml:"-"` +} + +type metadataModifyVPCEndpointOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type ModifyVolumeAttributeInput struct { // Indicates whether the volume should be auto-enabled for I/O operations. AutoEnableIO *AttributeBooleanValue `type:"structure"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. @@ -14103,6 +15713,10 @@ type metadataModifyVolumeAttributeOutput struct { } type MonitorInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. @@ -14138,6 +15752,53 @@ type metadataMonitoring struct { SDKShapeTraits bool `type:"structure"` } +type MoveAddressToVPCInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The Elastic IP address. + PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + + metadataMoveAddressToVPCInput `json:"-" xml:"-"` +} + +type metadataMoveAddressToVPCInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type MoveAddressToVPCOutput struct { + // The allocation ID for the Elastic IP address. + AllocationID *string `locationName:"allocationId" type:"string"` + + // The status of the move of the IP address. + Status *string `locationName:"status" type:"string"` + + metadataMoveAddressToVPCOutput `json:"-" xml:"-"` +} + +type metadataMoveAddressToVPCOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes the status of a moving Elastic IP address. +type MovingAddressStatus struct { + // The status of the Elastic IP address that's being moved to the EC2-VPC platform, + // or restored to the EC2-Classic platform. + MoveStatus *string `locationName:"moveStatus" type:"string"` + + // The Elastic IP address. + PublicIP *string `locationName:"publicIp" type:"string"` + + metadataMovingAddressStatus `json:"-" xml:"-"` +} + +type metadataMovingAddressStatus struct { + SDKShapeTraits bool `type:"structure"` +} + // Describes a network ACL. type NetworkACL struct { // Any associations between the network ACL and one or more subnets @@ -14436,6 +16097,36 @@ type metadataPortRange struct { SDKShapeTraits bool `type:"structure"` } +// Describes prefixes for AWS services. +type PrefixList struct { + // The IP address range of the AWS service. + CIDRs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` + + // The ID of the prefix. + PrefixListID *string `locationName:"prefixListId" type:"string"` + + // The name of the prefix. + PrefixListName *string `locationName:"prefixListName" type:"string"` + + metadataPrefixList `json:"-" xml:"-"` +} + +type metadataPrefixList struct { + SDKShapeTraits bool `type:"structure"` +} + +// The ID of the prefix. +type PrefixListID struct { + // The ID of the prefix. + PrefixListID *string `locationName:"prefixListId" type:"string"` + + metadataPrefixListID `json:"-" xml:"-"` +} + +type metadataPrefixListID struct { + SDKShapeTraits bool `type:"structure"` +} + // Describes the price for a Reserved Instance. type PriceSchedule struct { // The current price schedule, as determined by the term remaining for the Reserved @@ -14547,6 +16238,10 @@ type metadataPropagatingVGW struct { } type PurchaseReservedInstancesOfferingInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The number of Reserved Instances to purchase. @@ -14579,6 +16274,10 @@ type metadataPurchaseReservedInstancesOfferingOutput struct { } type RebootInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. @@ -14642,6 +16341,10 @@ type RegisterImageInput struct { // A description for your AMI. Description *string `locationName:"description" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The full path to your AMI manifest in Amazon S3 storage. @@ -14696,6 +16399,10 @@ type metadataRegisterImageOutput struct { } type RejectVPCPeeringConnectionInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. @@ -14723,6 +16430,10 @@ type ReleaseAddressInput struct { // [EC2-VPC] The allocation ID. Required for EC2-VPC. AllocationID *string `locationName:"AllocationId" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. @@ -14748,6 +16459,10 @@ type ReplaceNetworkACLAssociationInput struct { // subnet. AssociationID *string `locationName:"associationId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new network ACL to associate with the subnet. @@ -14775,6 +16490,10 @@ type ReplaceNetworkACLEntryInput struct { // The network range to allow or deny, in CIDR notation. CIDRBlock *string `locationName:"cidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Indicates whether to replace the egress rule. @@ -14822,6 +16541,10 @@ type ReplaceRouteInput struct { // must match the CIDR of an existing route in the table. DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of an Internet gateway or virtual private gateway. @@ -14858,6 +16581,10 @@ type ReplaceRouteTableAssociationInput struct { // The association ID. AssociationID *string `locationName:"associationId" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new route table to associate with the subnet. @@ -14885,6 +16612,10 @@ type ReportInstanceStatusInput struct { // Descriptive text about the health state of your instance. Description *string `locationName:"description" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The time at which the reported instance health state ended. @@ -14938,6 +16669,37 @@ type metadataReportInstanceStatusOutput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the parameters for RequestSpotFleet. +type RequestSpotFleetInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The configuration for the Spot fleet request. + SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` + + metadataRequestSpotFleetInput `json:"-" xml:"-"` +} + +type metadataRequestSpotFleetInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the output of RequestSpotFleet. +type RequestSpotFleetOutput struct { + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + metadataRequestSpotFleetOutput `json:"-" xml:"-"` +} + +type metadataRequestSpotFleetOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// Contains the parameters for RequestSpotInstances. type RequestSpotInstancesInput struct { // The user-specified name for a logical grouping of bids. // @@ -14960,6 +16722,15 @@ type RequestSpotInstancesInput struct { // Default: Instances are launched in any available Availability Zone. AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The maximum number of Spot Instances to launch. @@ -15009,6 +16780,7 @@ type metadataRequestSpotInstancesInput struct { SDKShapeTraits bool `type:"structure"` } +// Contains the output of RequestSpotInstances. type RequestSpotInstancesOutput struct { // One or more Spot Instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` @@ -15367,6 +17139,10 @@ type ResetImageAttributeInput struct { // attribute). Attribute *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. @@ -15391,6 +17167,10 @@ type ResetInstanceAttributeInput struct { // The attribute to reset. Attribute *string `locationName:"attribute" type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. @@ -15412,6 +17192,10 @@ type metadataResetInstanceAttributeOutput struct { } type ResetNetworkInterfaceAttributeInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. @@ -15440,6 +17224,10 @@ type ResetSnapshotAttributeInput struct { // volumes can be reset). Attribute *string `type:"string" required:"true"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the snapshot. @@ -15460,11 +17248,46 @@ type metadataResetSnapshotAttributeOutput struct { SDKShapeTraits bool `type:"structure"` } +type RestoreAddressToClassicInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The Elastic IP address. + PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + + metadataRestoreAddressToClassicInput `json:"-" xml:"-"` +} + +type metadataRestoreAddressToClassicInput struct { + SDKShapeTraits bool `type:"structure"` +} + +type RestoreAddressToClassicOutput struct { + // The Elastic IP address. + PublicIP *string `locationName:"publicIp" type:"string"` + + // The move status for the IP address. + Status *string `locationName:"status" type:"string"` + + metadataRestoreAddressToClassicOutput `json:"-" xml:"-"` +} + +type metadataRestoreAddressToClassicOutput struct { + SDKShapeTraits bool `type:"structure"` +} + type RevokeSecurityGroupEgressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. CIDRIP *string `locationName:"cidrIp" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The start of port range for the TCP and UDP protocols, or an ICMP type number. @@ -15514,6 +17337,10 @@ type RevokeSecurityGroupIngressInput struct { // a source security group. CIDRIP *string `locationName:"CidrIp" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // The start of port range for the TCP and UDP protocols, or an ICMP type number. @@ -15566,6 +17393,9 @@ type Route struct { // The CIDR block used for the destination match. DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string"` + // The prefix of the AWS service. + DestinationPrefixListID *string `locationName:"destinationPrefixListId" type:"string"` + // The ID of a gateway attached to your VPC. GatewayID *string `locationName:"gatewayId" type:"string"` @@ -15673,13 +17503,17 @@ type RunInstancesInput struct { // Default: false DisableAPITermination *bool `locationName:"disableApiTermination" type:"boolean"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Indicates whether the instance is optimized for EBS I/O. This optimization // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal Amazon EBS I/O performance. This optimization isn't - // available with all instance types. Additional usage charges apply when using - // an EBS-optimized instance. + // stack to provide optimal EBS I/O performance. This optimization isn't available + // with all instance types. Additional usage charges apply when using an EBS-optimized + // instance. // // Default: false EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` @@ -15712,8 +17546,8 @@ type RunInstancesInput struct { // The name of the key pair. You can create a key pair using CreateKeyPair or // ImportKeyPair. // - // If you launch an instance without specifying a key pair, you can't connect - // to the instance. + // If you do not specify a key pair, you can't connect to the instance unless + // you choose an AMI that is configured to allow users another way to log in. KeyName *string `type:"string"` // The maximum number of instances to launch. If you specify more instances @@ -15877,7 +17711,7 @@ type Snapshot struct { // owns the snapshot. OwnerAlias *string `locationName:"ownerAlias" type:"string"` - // The AWS account ID of the Amazon EBS snapshot owner. + // The AWS account ID of the EBS snapshot owner. OwnerID *string `locationName:"ownerId" type:"string"` // The progress of the snapshot, as a percentage. @@ -15908,15 +17742,15 @@ type metadataSnapshot struct { SDKShapeTraits bool `type:"structure"` } -// The details of the snapshot created from the imported disk. +// Describes the snapshot created from the imported disk. type SnapshotDetail struct { - // Description for the snapshot. + // A description for the snapshot. Description *string `locationName:"description" type:"string"` - // The Amazon EBS block device mapping for the snapshot. + // The block device mapping for the snapshot. DeviceName *string `locationName:"deviceName" type:"string"` - // The size of the disk in the snapshot. + // The size of the disk in the snapshot, in GiB. DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` // The format of the disk image from which the snapshot is created. @@ -15937,7 +17771,7 @@ type SnapshotDetail struct { // The URL used to access the disk image. URL *string `locationName:"url" type:"string"` - // User's Amazon S3 bucket details used to access the image. + // Describes the S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` metadataSnapshotDetail `json:"-" xml:"-"` @@ -15947,19 +17781,21 @@ type metadataSnapshotDetail struct { SDKShapeTraits bool `type:"structure"` } -// The disk container object for the ImportSnapshot request. +// The disk container object for the import snapshot request. type SnapshotDiskContainer struct { // The description of the disk image being imported. Description *string `type:"string"` // The format of the disk image being imported. + // + // Valid values: RAW | VHD | VMDK | OVA Format *string `type:"string"` // The URL to the Amazon S3-based disk image being imported. It can either be // a https URL (https://..) or an Amazon S3 URL (s3://..). URL *string `locationName:"Url" type:"string"` - // User's Amazon S3 bucket details used to access the image. + // Describes the S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` metadataSnapshotDiskContainer `json:"-" xml:"-"` @@ -15974,28 +17810,28 @@ type SnapshotTaskDetail struct { // The description of the snapshot. Description *string `locationName:"description" type:"string"` - // The size of the disk in the snapshot. + // The size of the disk in the snapshot, in GiB. DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` // The format of the disk image from which the snapshot is created. Format *string `locationName:"format" type:"string"` - // The percentage of completion for the ImportSnapshot task. + // The percentage of completion for the import snapshot task. Progress *string `locationName:"progress" type:"string"` // The snapshot ID of the disk being imported. SnapshotID *string `locationName:"snapshotId" type:"string"` - // A brief status for the ImportSnapshot task. + // A brief status for the import snapshot task. Status *string `locationName:"status" type:"string"` - // A detailed status message for the ImportSnapshot task. + // A detailed status message for the import snapshot task. StatusMessage *string `locationName:"statusMessage" type:"string"` // The URL of the disk image from which the snapshot is created. URL *string `locationName:"url" type:"string"` - // User's Amazon S3 bucket details used to access the image. + // The S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` metadataSnapshotTaskDetail `json:"-" xml:"-"` @@ -16029,6 +17865,66 @@ type metadataSpotDatafeedSubscription struct { SDKShapeTraits bool `type:"structure"` } +// Describes a Spot fleet request. +type SpotFleetRequestConfig struct { + // Information about the configuration of the Spot fleet request. + SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` + + // The ID of the Spot fleet request. + SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + // The state of the Spot fleet request. + SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true"` + + metadataSpotFleetRequestConfig `json:"-" xml:"-"` +} + +type metadataSpotFleetRequestConfig struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes the configuration of a Spot fleet request. +type SpotFleetRequestConfigData struct { + // A unique, case-sensitive identifier you provide to ensure idempotency of + // your listings. This helps avoid duplicate listings. For more information, + // see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // Grants the Spot fleet service permission to terminate instances on your behalf + // when you cancel a Spot fleet request using CancelSpotFleetRequests or when + // the Spot fleet request expires, if you set terminateInstancesWithExpiration. + IAMFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` + + // Information about the launch specifications for the instances. + LaunchSpecifications []*LaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list" required:"true"` + + // The maximum hourly price (bid) for any Spot Instance launched to fulfill + // the request. + SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` + + // The maximum number of Spot Instances to launch. + TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"` + + // Indicates whether running instances should be terminated when the Spot fleet + // request expires. + TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"` + + // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // The default is to start fulfilling the request immediately. + ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` + + // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // At this point, no new Spot Instance requests are placed or enabled to fulfill + // the request. + ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` + + metadataSpotFleetRequestConfigData `json:"-" xml:"-"` +} + +type metadataSpotFleetRequestConfigData struct { + SDKShapeTraits bool `type:"structure"` +} + // Describe a Spot Instance request. type SpotInstanceRequest struct { // The Availability Zone group. If you specify the same Availability Zone group @@ -16036,7 +17932,8 @@ type SpotInstanceRequest struct { // Availability Zone. AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - // The time stamp when the Spot Instance request was created. + // The date and time when the Spot Instance request was created, in UTC format + // (for example, YYYY-MM-DDTHH:MM:SSZ). CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` // The fault codes for the Spot Instance request, if any. @@ -16081,17 +17978,17 @@ type SpotInstanceRequest struct { // The Spot Instance request type. Type *string `locationName:"type" type:"string"` - // The start date of the request. If this is a one-time request, the request - // becomes active at this date and time and remains active until all instances - // launch, the request expires, or the request is canceled. If the request is - // persistent, the request becomes active at this date and time and remains - // active until it expires or is canceled. + // The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // If this is a one-time request, the request becomes active at this date and + // time and remains active until all instances launch, the request expires, + // or the request is canceled. If the request is persistent, the request becomes + // active at this date and time and remains active until it expires or is canceled. ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - // The end date of the request. If this is a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date is reached. + // The end date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // If this is a one-time request, the request remains active until all instances + // launch, the request is canceled, or this date is reached. If the request + // is persistent, it remains active until it is canceled or this date is reached. ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` metadataSpotInstanceRequest `json:"-" xml:"-"` @@ -16124,7 +18021,8 @@ type SpotInstanceStatus struct { // The description for the status code. Message *string `locationName:"message" type:"string"` - // The time of the most recent status update. + // The date and time of the most recent status update, in UTC format (for example, + // YYYY-MM-DDTHH:MM:SSZ). UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` metadataSpotInstanceStatus `json:"-" xml:"-"` @@ -16164,7 +18062,7 @@ type SpotPrice struct { // The maximum price (bid) that you are willing to pay for a Spot Instance. SpotPrice *string `locationName:"spotPrice" type:"string"` - // The date and time the request was created. + // The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` metadataSpotPrice `json:"-" xml:"-"` @@ -16178,6 +18076,10 @@ type StartInstancesInput struct { // Reserved. AdditionalInfo *string `locationName:"additionalInfo" type:"string"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. @@ -16239,6 +18141,10 @@ type metadataStateReason struct { } type StopInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // Forces the instances to stop. The instances do not have an opportunity to @@ -16362,6 +18268,10 @@ type metadataTagDescription struct { } type TerminateInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. @@ -16409,6 +18319,10 @@ type metadataUnassignPrivateIPAddressesOutput struct { } type UnmonitorInstancesInput struct { + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. @@ -16432,12 +18346,43 @@ type metadataUnmonitorInstancesOutput struct { SDKShapeTraits bool `type:"structure"` } -// User's Amazon S3 bucket details used to access the image. +// Information about items that were not successfully processed in a batch call. +type UnsuccessfulItem struct { + // Information about the error. + Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"` + + // The ID of the resource. + ResourceID *string `locationName:"resourceId" type:"string"` + + metadataUnsuccessfulItem `json:"-" xml:"-"` +} + +type metadataUnsuccessfulItem struct { + SDKShapeTraits bool `type:"structure"` +} + +// Information about the error that occured. For more information about errors, +// see Error Codes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). +type UnsuccessfulItemError struct { + // The error code. + Code *string `locationName:"code" type:"string" required:"true"` + + // The error message accompanying the error code. + Message *string `locationName:"message" type:"string" required:"true"` + + metadataUnsuccessfulItemError `json:"-" xml:"-"` +} + +type metadataUnsuccessfulItemError struct { + SDKShapeTraits bool `type:"structure"` +} + +// Describes the S3 bucket for the disk image. type UserBucket struct { - // The Amazon S3 bucket name where the disk image is located. + // The name of the S3 bucket where the disk image is located. S3Bucket *string `type:"string"` - // The Amazon S3 Key for the disk image. + // The key for the disk image. S3Key *string `type:"string"` metadataUserBucket `json:"-" xml:"-"` @@ -16447,12 +18392,12 @@ type metadataUserBucket struct { SDKShapeTraits bool `type:"structure"` } -// User's Amazon S3 bucket details used to access the image. +// Describes the S3 bucket for the disk image. type UserBucketDetails struct { - // The Amazon S3 bucket from which the disk image was created. + // The S3 bucket from which the disk image was created. S3Bucket *string `locationName:"s3Bucket" type:"string"` - // The Amazon S3 key from which the disk image was created. + // The key from which the disk image was created. S3Key *string `locationName:"s3Key" type:"string"` metadataUserBucketDetails `json:"-" xml:"-"` @@ -16462,7 +18407,9 @@ type metadataUserBucketDetails struct { SDKShapeTraits bool `type:"structure"` } +// Describes the user data to be made available to an instance. type UserData struct { + // The Base64-encoded MIME user data for the instance. Data *string `locationName:"data" type:"string"` metadataUserData `json:"-" xml:"-"` @@ -16581,6 +18528,36 @@ type metadataVPCClassicLink struct { SDKShapeTraits bool `type:"structure"` } +// Describes a VPC endpoint. +type VPCEndpoint struct { + // The date and time the VPC endpoint was created. + CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` + + // The policy document associated with the endpoint. + PolicyDocument *string `locationName:"policyDocument" type:"string"` + + // One or more route tables associated with the endpoint. + RouteTableIDs []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` + + // The name of the AWS service to which the endpoint is associated. + ServiceName *string `locationName:"serviceName" type:"string"` + + // The state of the VPC endpoint. + State *string `locationName:"state" type:"string"` + + // The ID of the VPC endpoint. + VPCEndpointID *string `locationName:"vpcEndpointId" type:"string"` + + // The ID of the VPC to which the endpoint is associated. + VPCID *string `locationName:"vpcId" type:"string"` + + metadataVPCEndpoint `json:"-" xml:"-"` +} + +type metadataVPCEndpoint struct { + SDKShapeTraits bool `type:"structure"` +} + // Describes a VPC peering connection. type VPCPeeringConnection struct { // The information of the peer VPC. @@ -16756,6 +18733,7 @@ type metadataVPNStaticRoute struct { // Describes a volume. type Volume struct { + // Information about the volume attachments. Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` // The Availability Zone for the volume. @@ -16817,7 +18795,7 @@ type VolumeAttachment struct { // The time stamp when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - // Indicates whether the Amazon EBS volume is deleted on instance termination. + // Indicates whether the EBS volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // The device name. @@ -16839,7 +18817,7 @@ type metadataVolumeAttachment struct { SDKShapeTraits bool `type:"structure"` } -// Describes an Amazon EBS volume. +// Describes an EBS volume. type VolumeDetail struct { // The size of the volume, in GiB. Size *int64 `locationName:"size" type:"long" required:"true"` diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go similarity index 94% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go index 216e6a7daa..f080166e03 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go @@ -3,8 +3,8 @@ package ec2 import ( "time" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" ) func init() { diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go similarity index 83% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go index f00bebc110..24956345a2 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/customizations_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go @@ -1,5 +1,3 @@ -// +build !integration - package ec2_test import ( @@ -7,9 +5,9 @@ import ( "net/url" "testing" - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/test/unit" - "github.com/awslabs/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/stretchr/testify/assert" ) diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/ec2iface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go similarity index 90% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/ec2iface/interface.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index 6f6e76d30f..aa2b112c5a 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/ec2iface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go @@ -1,9 +1,13 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +// Package ec2iface provides an interface for the Amazon Elastic Compute Cloud. package ec2iface import ( - "github.com/awslabs/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/ec2" ) +// EC2API is the interface type for ec2.EC2. type EC2API interface { AcceptVPCPeeringConnection(*ec2.AcceptVPCPeeringConnectionInput) (*ec2.AcceptVPCPeeringConnectionOutput, error) @@ -43,6 +47,8 @@ type EC2API interface { CancelReservedInstancesListing(*ec2.CancelReservedInstancesListingInput) (*ec2.CancelReservedInstancesListingOutput, error) + CancelSpotFleetRequests(*ec2.CancelSpotFleetRequestsInput) (*ec2.CancelSpotFleetRequestsOutput, error) + CancelSpotInstanceRequests(*ec2.CancelSpotInstanceRequestsInput) (*ec2.CancelSpotInstanceRequestsOutput, error) ConfirmProductInstance(*ec2.ConfirmProductInstanceInput) (*ec2.ConfirmProductInstanceOutput, error) @@ -89,6 +95,8 @@ type EC2API interface { CreateVPC(*ec2.CreateVPCInput) (*ec2.CreateVPCOutput, error) + CreateVPCEndpoint(*ec2.CreateVPCEndpointInput) (*ec2.CreateVPCEndpointOutput, error) + CreateVPCPeeringConnection(*ec2.CreateVPCPeeringConnectionInput) (*ec2.CreateVPCPeeringConnectionOutput, error) CreateVPNConnection(*ec2.CreateVPNConnectionInput) (*ec2.CreateVPNConnectionOutput, error) @@ -131,6 +139,8 @@ type EC2API interface { DeleteVPC(*ec2.DeleteVPCInput) (*ec2.DeleteVPCOutput, error) + DeleteVPCEndpoints(*ec2.DeleteVPCEndpointsInput) (*ec2.DeleteVPCEndpointsOutput, error) + DeleteVPCPeeringConnection(*ec2.DeleteVPCPeeringConnectionInput) (*ec2.DeleteVPCPeeringConnectionOutput, error) DeleteVPNConnection(*ec2.DeleteVPNConnectionInput) (*ec2.DeleteVPNConnectionOutput, error) @@ -179,6 +189,8 @@ type EC2API interface { DescribeKeyPairs(*ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error) + DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error) + DescribeNetworkACLs(*ec2.DescribeNetworkACLsInput) (*ec2.DescribeNetworkACLsOutput, error) DescribeNetworkInterfaceAttribute(*ec2.DescribeNetworkInterfaceAttributeInput) (*ec2.DescribeNetworkInterfaceAttributeOutput, error) @@ -187,6 +199,8 @@ type EC2API interface { DescribePlacementGroups(*ec2.DescribePlacementGroupsInput) (*ec2.DescribePlacementGroupsOutput, error) + DescribePrefixLists(*ec2.DescribePrefixListsInput) (*ec2.DescribePrefixListsOutput, error) + DescribeRegions(*ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error) DescribeReservedInstances(*ec2.DescribeReservedInstancesInput) (*ec2.DescribeReservedInstancesOutput, error) @@ -207,6 +221,12 @@ type EC2API interface { DescribeSpotDatafeedSubscription(*ec2.DescribeSpotDatafeedSubscriptionInput) (*ec2.DescribeSpotDatafeedSubscriptionOutput, error) + DescribeSpotFleetInstances(*ec2.DescribeSpotFleetInstancesInput) (*ec2.DescribeSpotFleetInstancesOutput, error) + + DescribeSpotFleetRequestHistory(*ec2.DescribeSpotFleetRequestHistoryInput) (*ec2.DescribeSpotFleetRequestHistoryOutput, error) + + DescribeSpotFleetRequests(*ec2.DescribeSpotFleetRequestsInput) (*ec2.DescribeSpotFleetRequestsOutput, error) + DescribeSpotInstanceRequests(*ec2.DescribeSpotInstanceRequestsInput) (*ec2.DescribeSpotInstanceRequestsOutput, error) DescribeSpotPriceHistory(*ec2.DescribeSpotPriceHistoryInput) (*ec2.DescribeSpotPriceHistoryOutput, error) @@ -219,6 +239,10 @@ type EC2API interface { DescribeVPCClassicLink(*ec2.DescribeVPCClassicLinkInput) (*ec2.DescribeVPCClassicLinkOutput, error) + DescribeVPCEndpointServices(*ec2.DescribeVPCEndpointServicesInput) (*ec2.DescribeVPCEndpointServicesOutput, error) + + DescribeVPCEndpoints(*ec2.DescribeVPCEndpointsInput) (*ec2.DescribeVPCEndpointsOutput, error) + DescribeVPCPeeringConnections(*ec2.DescribeVPCPeeringConnectionsInput) (*ec2.DescribeVPCPeeringConnectionsOutput, error) DescribeVPCs(*ec2.DescribeVPCsInput) (*ec2.DescribeVPCsOutput, error) @@ -285,10 +309,14 @@ type EC2API interface { ModifyVPCAttribute(*ec2.ModifyVPCAttributeInput) (*ec2.ModifyVPCAttributeOutput, error) + ModifyVPCEndpoint(*ec2.ModifyVPCEndpointInput) (*ec2.ModifyVPCEndpointOutput, error) + ModifyVolumeAttribute(*ec2.ModifyVolumeAttributeInput) (*ec2.ModifyVolumeAttributeOutput, error) MonitorInstances(*ec2.MonitorInstancesInput) (*ec2.MonitorInstancesOutput, error) + MoveAddressToVPC(*ec2.MoveAddressToVPCInput) (*ec2.MoveAddressToVPCOutput, error) + PurchaseReservedInstancesOffering(*ec2.PurchaseReservedInstancesOfferingInput) (*ec2.PurchaseReservedInstancesOfferingOutput, error) RebootInstances(*ec2.RebootInstancesInput) (*ec2.RebootInstancesOutput, error) @@ -309,6 +337,8 @@ type EC2API interface { ReportInstanceStatus(*ec2.ReportInstanceStatusInput) (*ec2.ReportInstanceStatusOutput, error) + RequestSpotFleet(*ec2.RequestSpotFleetInput) (*ec2.RequestSpotFleetOutput, error) + RequestSpotInstances(*ec2.RequestSpotInstancesInput) (*ec2.RequestSpotInstancesOutput, error) ResetImageAttribute(*ec2.ResetImageAttributeInput) (*ec2.ResetImageAttributeOutput, error) @@ -319,6 +349,8 @@ type EC2API interface { ResetSnapshotAttribute(*ec2.ResetSnapshotAttributeInput) (*ec2.ResetSnapshotAttributeOutput, error) + RestoreAddressToClassic(*ec2.RestoreAddressToClassicInput) (*ec2.RestoreAddressToClassicOutput, error) + RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error) RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go new file mode 100644 index 0000000000..3941d260db --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go @@ -0,0 +1,15 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package ec2iface_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/stretchr/testify/assert" +) + +func TestInterface(t *testing.T) { + assert.Implements(t, (*ec2iface.EC2API)(nil), ec2.New(nil)) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go new file mode 100644 index 0000000000..76b6332028 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/examples_test.go @@ -0,0 +1,6511 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package ec2_test + +import ( + "bytes" + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/service/ec2" +) + +var _ time.Duration +var _ bytes.Buffer + +func ExampleEC2_AcceptVPCPeeringConnection() { + svc := ec2.New(nil) + + params := &ec2.AcceptVPCPeeringConnectionInput{ + DryRun: aws.Boolean(true), + VPCPeeringConnectionID: aws.String("String"), + } + resp, err := svc.AcceptVPCPeeringConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AllocateAddress() { + svc := ec2.New(nil) + + params := &ec2.AllocateAddressInput{ + Domain: aws.String("DomainType"), + DryRun: aws.Boolean(true), + } + resp, err := svc.AllocateAddress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AssignPrivateIPAddresses() { + svc := ec2.New(nil) + + params := &ec2.AssignPrivateIPAddressesInput{ + NetworkInterfaceID: aws.String("String"), // Required + AllowReassignment: aws.Boolean(true), + PrivateIPAddresses: []*string{ + aws.String("String"), // Required + // More values... + }, + SecondaryPrivateIPAddressCount: aws.Long(1), + } + resp, err := svc.AssignPrivateIPAddresses(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AssociateAddress() { + svc := ec2.New(nil) + + params := &ec2.AssociateAddressInput{ + AllocationID: aws.String("String"), + AllowReassociation: aws.Boolean(true), + DryRun: aws.Boolean(true), + InstanceID: aws.String("String"), + NetworkInterfaceID: aws.String("String"), + PrivateIPAddress: aws.String("String"), + PublicIP: aws.String("String"), + } + resp, err := svc.AssociateAddress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AssociateDHCPOptions() { + svc := ec2.New(nil) + + params := &ec2.AssociateDHCPOptionsInput{ + DHCPOptionsID: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AssociateDHCPOptions(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AssociateRouteTable() { + svc := ec2.New(nil) + + params := &ec2.AssociateRouteTableInput{ + RouteTableID: aws.String("String"), // Required + SubnetID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AssociateRouteTable(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AttachClassicLinkVPC() { + svc := ec2.New(nil) + + params := &ec2.AttachClassicLinkVPCInput{ + Groups: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + InstanceID: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AttachClassicLinkVPC(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AttachInternetGateway() { + svc := ec2.New(nil) + + params := &ec2.AttachInternetGatewayInput{ + InternetGatewayID: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AttachInternetGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AttachNetworkInterface() { + svc := ec2.New(nil) + + params := &ec2.AttachNetworkInterfaceInput{ + DeviceIndex: aws.Long(1), // Required + InstanceID: aws.String("String"), // Required + NetworkInterfaceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AttachNetworkInterface(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AttachVPNGateway() { + svc := ec2.New(nil) + + params := &ec2.AttachVPNGatewayInput{ + VPCID: aws.String("String"), // Required + VPNGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AttachVPNGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AttachVolume() { + svc := ec2.New(nil) + + params := &ec2.AttachVolumeInput{ + Device: aws.String("String"), // Required + InstanceID: aws.String("String"), // Required + VolumeID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.AttachVolume(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AuthorizeSecurityGroupEgress() { + svc := ec2.New(nil) + + params := &ec2.AuthorizeSecurityGroupEgressInput{ + GroupID: aws.String("String"), // Required + CIDRIP: aws.String("String"), + DryRun: aws.Boolean(true), + FromPort: aws.Long(1), + IPPermissions: []*ec2.IPPermission{ + &ec2.IPPermission{ // Required + FromPort: aws.Long(1), + IPProtocol: aws.String("String"), + IPRanges: []*ec2.IPRange{ + &ec2.IPRange{ // Required + CIDRIP: aws.String("String"), + }, + // More values... + }, + PrefixListIDs: []*ec2.PrefixListID{ + &ec2.PrefixListID{ // Required + PrefixListID: aws.String("String"), + }, + // More values... + }, + ToPort: aws.Long(1), + UserIDGroupPairs: []*ec2.UserIDGroupPair{ + &ec2.UserIDGroupPair{ // Required + GroupID: aws.String("String"), + GroupName: aws.String("String"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + // More values... + }, + IPProtocol: aws.String("String"), + SourceSecurityGroupName: aws.String("String"), + SourceSecurityGroupOwnerID: aws.String("String"), + ToPort: aws.Long(1), + } + resp, err := svc.AuthorizeSecurityGroupEgress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_AuthorizeSecurityGroupIngress() { + svc := ec2.New(nil) + + params := &ec2.AuthorizeSecurityGroupIngressInput{ + CIDRIP: aws.String("String"), + DryRun: aws.Boolean(true), + FromPort: aws.Long(1), + GroupID: aws.String("String"), + GroupName: aws.String("String"), + IPPermissions: []*ec2.IPPermission{ + &ec2.IPPermission{ // Required + FromPort: aws.Long(1), + IPProtocol: aws.String("String"), + IPRanges: []*ec2.IPRange{ + &ec2.IPRange{ // Required + CIDRIP: aws.String("String"), + }, + // More values... + }, + PrefixListIDs: []*ec2.PrefixListID{ + &ec2.PrefixListID{ // Required + PrefixListID: aws.String("String"), + }, + // More values... + }, + ToPort: aws.Long(1), + UserIDGroupPairs: []*ec2.UserIDGroupPair{ + &ec2.UserIDGroupPair{ // Required + GroupID: aws.String("String"), + GroupName: aws.String("String"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + // More values... + }, + IPProtocol: aws.String("String"), + SourceSecurityGroupName: aws.String("String"), + SourceSecurityGroupOwnerID: aws.String("String"), + ToPort: aws.Long(1), + } + resp, err := svc.AuthorizeSecurityGroupIngress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_BundleInstance() { + svc := ec2.New(nil) + + params := &ec2.BundleInstanceInput{ + InstanceID: aws.String("String"), // Required + Storage: &ec2.Storage{ // Required + S3: &ec2.S3Storage{ + AWSAccessKeyID: aws.String("String"), + Bucket: aws.String("String"), + Prefix: aws.String("String"), + UploadPolicy: []byte("PAYLOAD"), + UploadPolicySignature: aws.String("String"), + }, + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.BundleInstance(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelBundleTask() { + svc := ec2.New(nil) + + params := &ec2.CancelBundleTaskInput{ + BundleID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CancelBundleTask(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelConversionTask() { + svc := ec2.New(nil) + + params := &ec2.CancelConversionTaskInput{ + ConversionTaskID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + ReasonMessage: aws.String("String"), + } + resp, err := svc.CancelConversionTask(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelExportTask() { + svc := ec2.New(nil) + + params := &ec2.CancelExportTaskInput{ + ExportTaskID: aws.String("String"), // Required + } + resp, err := svc.CancelExportTask(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelImportTask() { + svc := ec2.New(nil) + + params := &ec2.CancelImportTaskInput{ + CancelReason: aws.String("String"), + DryRun: aws.Boolean(true), + ImportTaskID: aws.String("String"), + } + resp, err := svc.CancelImportTask(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelReservedInstancesListing() { + svc := ec2.New(nil) + + params := &ec2.CancelReservedInstancesListingInput{ + ReservedInstancesListingID: aws.String("String"), // Required + } + resp, err := svc.CancelReservedInstancesListing(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelSpotFleetRequests() { + svc := ec2.New(nil) + + params := &ec2.CancelSpotFleetRequestsInput{ + SpotFleetRequestIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + TerminateInstances: aws.Boolean(true), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CancelSpotFleetRequests(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CancelSpotInstanceRequests() { + svc := ec2.New(nil) + + params := &ec2.CancelSpotInstanceRequestsInput{ + SpotInstanceRequestIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.CancelSpotInstanceRequests(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ConfirmProductInstance() { + svc := ec2.New(nil) + + params := &ec2.ConfirmProductInstanceInput{ + InstanceID: aws.String("String"), // Required + ProductCode: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ConfirmProductInstance(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CopyImage() { + svc := ec2.New(nil) + + params := &ec2.CopyImageInput{ + Name: aws.String("String"), // Required + SourceImageID: aws.String("String"), // Required + SourceRegion: aws.String("String"), // Required + ClientToken: aws.String("String"), + Description: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.CopyImage(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CopySnapshot() { + svc := ec2.New(nil) + + params := &ec2.CopySnapshotInput{ + SourceRegion: aws.String("String"), // Required + SourceSnapshotID: aws.String("String"), // Required + Description: aws.String("String"), + DestinationRegion: aws.String("String"), + DryRun: aws.Boolean(true), + PresignedURL: aws.String("String"), + } + resp, err := svc.CopySnapshot(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateCustomerGateway() { + svc := ec2.New(nil) + + params := &ec2.CreateCustomerGatewayInput{ + BGPASN: aws.Long(1), // Required + PublicIP: aws.String("String"), // Required + Type: aws.String("GatewayType"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateCustomerGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateDHCPOptions() { + svc := ec2.New(nil) + + params := &ec2.CreateDHCPOptionsInput{ + DHCPConfigurations: []*ec2.NewDHCPConfiguration{ // Required + &ec2.NewDHCPConfiguration{ // Required + Key: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateDHCPOptions(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateImage() { + svc := ec2.New(nil) + + params := &ec2.CreateImageInput{ + InstanceID: aws.String("String"), // Required + Name: aws.String("String"), // Required + BlockDeviceMappings: []*ec2.BlockDeviceMapping{ + &ec2.BlockDeviceMapping{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSBlockDevice{ + DeleteOnTermination: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeSize: aws.Long(1), + VolumeType: aws.String("VolumeType"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + Description: aws.String("String"), + DryRun: aws.Boolean(true), + NoReboot: aws.Boolean(true), + } + resp, err := svc.CreateImage(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateInstanceExportTask() { + svc := ec2.New(nil) + + params := &ec2.CreateInstanceExportTaskInput{ + InstanceID: aws.String("String"), // Required + Description: aws.String("String"), + ExportToS3Task: &ec2.ExportToS3TaskSpecification{ + ContainerFormat: aws.String("ContainerFormat"), + DiskImageFormat: aws.String("DiskImageFormat"), + S3Bucket: aws.String("String"), + S3Prefix: aws.String("String"), + }, + TargetEnvironment: aws.String("ExportEnvironment"), + } + resp, err := svc.CreateInstanceExportTask(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateInternetGateway() { + svc := ec2.New(nil) + + params := &ec2.CreateInternetGatewayInput{ + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateInternetGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateKeyPair() { + svc := ec2.New(nil) + + params := &ec2.CreateKeyPairInput{ + KeyName: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateKeyPair(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateNetworkACL() { + svc := ec2.New(nil) + + params := &ec2.CreateNetworkACLInput{ + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateNetworkACL(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateNetworkACLEntry() { + svc := ec2.New(nil) + + params := &ec2.CreateNetworkACLEntryInput{ + CIDRBlock: aws.String("String"), // Required + Egress: aws.Boolean(true), // Required + NetworkACLID: aws.String("String"), // Required + Protocol: aws.String("String"), // Required + RuleAction: aws.String("RuleAction"), // Required + RuleNumber: aws.Long(1), // Required + DryRun: aws.Boolean(true), + ICMPTypeCode: &ec2.ICMPTypeCode{ + Code: aws.Long(1), + Type: aws.Long(1), + }, + PortRange: &ec2.PortRange{ + From: aws.Long(1), + To: aws.Long(1), + }, + } + resp, err := svc.CreateNetworkACLEntry(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateNetworkInterface() { + svc := ec2.New(nil) + + params := &ec2.CreateNetworkInterfaceInput{ + SubnetID: aws.String("String"), // Required + Description: aws.String("String"), + DryRun: aws.Boolean(true), + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + PrivateIPAddress: aws.String("String"), + PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + &ec2.PrivateIPAddressSpecification{ // Required + PrivateIPAddress: aws.String("String"), // Required + Primary: aws.Boolean(true), + }, + // More values... + }, + SecondaryPrivateIPAddressCount: aws.Long(1), + } + resp, err := svc.CreateNetworkInterface(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreatePlacementGroup() { + svc := ec2.New(nil) + + params := &ec2.CreatePlacementGroupInput{ + GroupName: aws.String("String"), // Required + Strategy: aws.String("PlacementStrategy"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CreatePlacementGroup(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateReservedInstancesListing() { + svc := ec2.New(nil) + + params := &ec2.CreateReservedInstancesListingInput{ + ClientToken: aws.String("String"), // Required + InstanceCount: aws.Long(1), // Required + PriceSchedules: []*ec2.PriceScheduleSpecification{ // Required + &ec2.PriceScheduleSpecification{ // Required + CurrencyCode: aws.String("CurrencyCodeValues"), + Price: aws.Double(1.0), + Term: aws.Long(1), + }, + // More values... + }, + ReservedInstancesID: aws.String("String"), // Required + } + resp, err := svc.CreateReservedInstancesListing(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateRoute() { + svc := ec2.New(nil) + + params := &ec2.CreateRouteInput{ + DestinationCIDRBlock: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + ClientToken: aws.String("String"), + DryRun: aws.Boolean(true), + GatewayID: aws.String("String"), + InstanceID: aws.String("String"), + NetworkInterfaceID: aws.String("String"), + VPCPeeringConnectionID: aws.String("String"), + } + resp, err := svc.CreateRoute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateRouteTable() { + svc := ec2.New(nil) + + params := &ec2.CreateRouteTableInput{ + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateRouteTable(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateSecurityGroup() { + svc := ec2.New(nil) + + params := &ec2.CreateSecurityGroupInput{ + Description: aws.String("String"), // Required + GroupName: aws.String("String"), // Required + DryRun: aws.Boolean(true), + VPCID: aws.String("String"), + } + resp, err := svc.CreateSecurityGroup(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateSnapshot() { + svc := ec2.New(nil) + + params := &ec2.CreateSnapshotInput{ + VolumeID: aws.String("String"), // Required + Description: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateSnapshot(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateSpotDatafeedSubscription() { + svc := ec2.New(nil) + + params := &ec2.CreateSpotDatafeedSubscriptionInput{ + Bucket: aws.String("String"), // Required + DryRun: aws.Boolean(true), + Prefix: aws.String("String"), + } + resp, err := svc.CreateSpotDatafeedSubscription(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateSubnet() { + svc := ec2.New(nil) + + params := &ec2.CreateSubnetInput{ + CIDRBlock: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + AvailabilityZone: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateSubnet(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateTags() { + svc := ec2.New(nil) + + params := &ec2.CreateTagsInput{ + Resources: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + Tags: []*ec2.Tag{ // Required + &ec2.Tag{ // Required + Key: aws.String("String"), + Value: aws.String("String"), + }, + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPC() { + svc := ec2.New(nil) + + params := &ec2.CreateVPCInput{ + CIDRBlock: aws.String("String"), // Required + DryRun: aws.Boolean(true), + InstanceTenancy: aws.String("Tenancy"), + } + resp, err := svc.CreateVPC(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPCEndpoint() { + svc := ec2.New(nil) + + params := &ec2.CreateVPCEndpointInput{ + ServiceName: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + ClientToken: aws.String("String"), + DryRun: aws.Boolean(true), + PolicyDocument: aws.String("String"), + RouteTableIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.CreateVPCEndpoint(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPCPeeringConnection() { + svc := ec2.New(nil) + + params := &ec2.CreateVPCPeeringConnectionInput{ + DryRun: aws.Boolean(true), + PeerOwnerID: aws.String("String"), + PeerVPCID: aws.String("String"), + VPCID: aws.String("String"), + } + resp, err := svc.CreateVPCPeeringConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPNConnection() { + svc := ec2.New(nil) + + params := &ec2.CreateVPNConnectionInput{ + CustomerGatewayID: aws.String("String"), // Required + Type: aws.String("String"), // Required + VPNGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + Options: &ec2.VPNConnectionOptionsSpecification{ + StaticRoutesOnly: aws.Boolean(true), + }, + } + resp, err := svc.CreateVPNConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPNConnectionRoute() { + svc := ec2.New(nil) + + params := &ec2.CreateVPNConnectionRouteInput{ + DestinationCIDRBlock: aws.String("String"), // Required + VPNConnectionID: aws.String("String"), // Required + } + resp, err := svc.CreateVPNConnectionRoute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVPNGateway() { + svc := ec2.New(nil) + + params := &ec2.CreateVPNGatewayInput{ + Type: aws.String("GatewayType"), // Required + AvailabilityZone: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.CreateVPNGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_CreateVolume() { + svc := ec2.New(nil) + + params := &ec2.CreateVolumeInput{ + AvailabilityZone: aws.String("String"), // Required + DryRun: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + KMSKeyID: aws.String("String"), + Size: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeType: aws.String("VolumeType"), + } + resp, err := svc.CreateVolume(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteCustomerGateway() { + svc := ec2.New(nil) + + params := &ec2.DeleteCustomerGatewayInput{ + CustomerGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteCustomerGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteDHCPOptions() { + svc := ec2.New(nil) + + params := &ec2.DeleteDHCPOptionsInput{ + DHCPOptionsID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteDHCPOptions(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteInternetGateway() { + svc := ec2.New(nil) + + params := &ec2.DeleteInternetGatewayInput{ + InternetGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteInternetGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteKeyPair() { + svc := ec2.New(nil) + + params := &ec2.DeleteKeyPairInput{ + KeyName: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteKeyPair(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteNetworkACL() { + svc := ec2.New(nil) + + params := &ec2.DeleteNetworkACLInput{ + NetworkACLID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteNetworkACL(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteNetworkACLEntry() { + svc := ec2.New(nil) + + params := &ec2.DeleteNetworkACLEntryInput{ + Egress: aws.Boolean(true), // Required + NetworkACLID: aws.String("String"), // Required + RuleNumber: aws.Long(1), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteNetworkACLEntry(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteNetworkInterface() { + svc := ec2.New(nil) + + params := &ec2.DeleteNetworkInterfaceInput{ + NetworkInterfaceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteNetworkInterface(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeletePlacementGroup() { + svc := ec2.New(nil) + + params := &ec2.DeletePlacementGroupInput{ + GroupName: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeletePlacementGroup(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteRoute() { + svc := ec2.New(nil) + + params := &ec2.DeleteRouteInput{ + DestinationCIDRBlock: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteRoute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteRouteTable() { + svc := ec2.New(nil) + + params := &ec2.DeleteRouteTableInput{ + RouteTableID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteRouteTable(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteSecurityGroup() { + svc := ec2.New(nil) + + params := &ec2.DeleteSecurityGroupInput{ + DryRun: aws.Boolean(true), + GroupID: aws.String("String"), + GroupName: aws.String("String"), + } + resp, err := svc.DeleteSecurityGroup(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteSnapshot() { + svc := ec2.New(nil) + + params := &ec2.DeleteSnapshotInput{ + SnapshotID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteSnapshot(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteSpotDatafeedSubscription() { + svc := ec2.New(nil) + + params := &ec2.DeleteSpotDatafeedSubscriptionInput{ + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteSpotDatafeedSubscription(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteSubnet() { + svc := ec2.New(nil) + + params := &ec2.DeleteSubnetInput{ + SubnetID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteSubnet(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteTags() { + svc := ec2.New(nil) + + params := &ec2.DeleteTagsInput{ + Resources: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Tags: []*ec2.Tag{ + &ec2.Tag{ // Required + Key: aws.String("String"), + Value: aws.String("String"), + }, + // More values... + }, + } + resp, err := svc.DeleteTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPC() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPCInput{ + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVPC(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPCEndpoints() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPCEndpointsInput{ + VPCEndpointIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVPCEndpoints(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPCPeeringConnection() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPCPeeringConnectionInput{ + VPCPeeringConnectionID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVPCPeeringConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPNConnection() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPNConnectionInput{ + VPNConnectionID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVPNConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPNConnectionRoute() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPNConnectionRouteInput{ + DestinationCIDRBlock: aws.String("String"), // Required + VPNConnectionID: aws.String("String"), // Required + } + resp, err := svc.DeleteVPNConnectionRoute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVPNGateway() { + svc := ec2.New(nil) + + params := &ec2.DeleteVPNGatewayInput{ + VPNGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVPNGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeleteVolume() { + svc := ec2.New(nil) + + params := &ec2.DeleteVolumeInput{ + VolumeID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeleteVolume(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DeregisterImage() { + svc := ec2.New(nil) + + params := &ec2.DeregisterImageInput{ + ImageID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DeregisterImage(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeAccountAttributes() { + svc := ec2.New(nil) + + params := &ec2.DescribeAccountAttributesInput{ + AttributeNames: []*string{ + aws.String("AccountAttributeName"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeAccountAttributes(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeAddresses() { + svc := ec2.New(nil) + + params := &ec2.DescribeAddressesInput{ + AllocationIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + PublicIPs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeAddresses(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeAvailabilityZones() { + svc := ec2.New(nil) + + params := &ec2.DescribeAvailabilityZonesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + ZoneNames: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeAvailabilityZones(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeBundleTasks() { + svc := ec2.New(nil) + + params := &ec2.DescribeBundleTasksInput{ + BundleIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + } + resp, err := svc.DescribeBundleTasks(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeClassicLinkInstances() { + svc := ec2.New(nil) + + params := &ec2.DescribeClassicLinkInstancesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + InstanceIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeClassicLinkInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeConversionTasks() { + svc := ec2.New(nil) + + params := &ec2.DescribeConversionTasksInput{ + ConversionTaskIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + } + resp, err := svc.DescribeConversionTasks(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeCustomerGateways() { + svc := ec2.New(nil) + + params := &ec2.DescribeCustomerGatewaysInput{ + CustomerGatewayIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + } + resp, err := svc.DescribeCustomerGateways(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeDHCPOptions() { + svc := ec2.New(nil) + + params := &ec2.DescribeDHCPOptionsInput{ + DHCPOptionsIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + } + resp, err := svc.DescribeDHCPOptions(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeExportTasks() { + svc := ec2.New(nil) + + params := &ec2.DescribeExportTasksInput{ + ExportTaskIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeExportTasks(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeImageAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeImageAttributeInput{ + Attribute: aws.String("ImageAttributeName"), // Required + ImageID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeImageAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeImages() { + svc := ec2.New(nil) + + params := &ec2.DescribeImagesInput{ + DryRun: aws.Boolean(true), + ExecutableUsers: []*string{ + aws.String("String"), // Required + // More values... + }, + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + ImageIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + Owners: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeImages(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeImportImageTasks() { + svc := ec2.New(nil) + + params := &ec2.DescribeImportImageTasksInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + ImportTaskIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeImportImageTasks(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeImportSnapshotTasks() { + svc := ec2.New(nil) + + params := &ec2.DescribeImportSnapshotTasksInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + ImportTaskIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeImportSnapshotTasks(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeInstanceAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeInstanceAttributeInput{ + Attribute: aws.String("InstanceAttributeName"), // Required + InstanceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeInstanceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeInstanceStatus() { + svc := ec2.New(nil) + + params := &ec2.DescribeInstanceStatusInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + IncludeAllInstances: aws.Boolean(true), + InstanceIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeInstanceStatus(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeInstances() { + svc := ec2.New(nil) + + params := &ec2.DescribeInstancesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + InstanceIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeInternetGateways() { + svc := ec2.New(nil) + + params := &ec2.DescribeInternetGatewaysInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + InternetGatewayIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeInternetGateways(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeKeyPairs() { + svc := ec2.New(nil) + + params := &ec2.DescribeKeyPairsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + KeyNames: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeKeyPairs(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeMovingAddresses() { + svc := ec2.New(nil) + + params := &ec2.DescribeMovingAddressesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + PublicIPs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeMovingAddresses(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeNetworkACLs() { + svc := ec2.New(nil) + + params := &ec2.DescribeNetworkACLsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + NetworkACLIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeNetworkACLs(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeNetworkInterfaceAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeNetworkInterfaceAttributeInput{ + NetworkInterfaceID: aws.String("String"), // Required + Attribute: aws.String("NetworkInterfaceAttribute"), + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeNetworkInterfaceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeNetworkInterfaces() { + svc := ec2.New(nil) + + params := &ec2.DescribeNetworkInterfacesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + NetworkInterfaceIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeNetworkInterfaces(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribePlacementGroups() { + svc := ec2.New(nil) + + params := &ec2.DescribePlacementGroupsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + GroupNames: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribePlacementGroups(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribePrefixLists() { + svc := ec2.New(nil) + + params := &ec2.DescribePrefixListsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + PrefixListIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribePrefixLists(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeRegions() { + svc := ec2.New(nil) + + params := &ec2.DescribeRegionsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + RegionNames: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeRegions(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeReservedInstances() { + svc := ec2.New(nil) + + params := &ec2.DescribeReservedInstancesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + OfferingType: aws.String("OfferingTypeValues"), + ReservedInstancesIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeReservedInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeReservedInstancesListings() { + svc := ec2.New(nil) + + params := &ec2.DescribeReservedInstancesListingsInput{ + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + ReservedInstancesID: aws.String("String"), + ReservedInstancesListingID: aws.String("String"), + } + resp, err := svc.DescribeReservedInstancesListings(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeReservedInstancesModifications() { + svc := ec2.New(nil) + + params := &ec2.DescribeReservedInstancesModificationsInput{ + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + NextToken: aws.String("String"), + ReservedInstancesModificationIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeReservedInstancesModifications(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeReservedInstancesOfferings() { + svc := ec2.New(nil) + + params := &ec2.DescribeReservedInstancesOfferingsInput{ + AvailabilityZone: aws.String("String"), + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + IncludeMarketplace: aws.Boolean(true), + InstanceTenancy: aws.String("Tenancy"), + InstanceType: aws.String("InstanceType"), + MaxDuration: aws.Long(1), + MaxInstanceCount: aws.Long(1), + MaxResults: aws.Long(1), + MinDuration: aws.Long(1), + NextToken: aws.String("String"), + OfferingType: aws.String("OfferingTypeValues"), + ProductDescription: aws.String("RIProductDescription"), + ReservedInstancesOfferingIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeReservedInstancesOfferings(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeRouteTables() { + svc := ec2.New(nil) + + params := &ec2.DescribeRouteTablesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + RouteTableIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeRouteTables(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSecurityGroups() { + svc := ec2.New(nil) + + params := &ec2.DescribeSecurityGroupsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + GroupIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + GroupNames: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeSecurityGroups(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSnapshotAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeSnapshotAttributeInput{ + Attribute: aws.String("SnapshotAttributeName"), // Required + SnapshotID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeSnapshotAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSnapshots() { + svc := ec2.New(nil) + + params := &ec2.DescribeSnapshotsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + OwnerIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + RestorableByUserIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + SnapshotIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeSnapshots(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotDatafeedSubscription() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotDatafeedSubscriptionInput{ + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeSpotDatafeedSubscription(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotFleetInstances() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotFleetInstancesInput{ + SpotFleetRequestID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeSpotFleetInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotFleetRequestHistory() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotFleetRequestHistoryInput{ + SpotFleetRequestID: aws.String("String"), // Required + StartTime: aws.Time(time.Now()), // Required + DryRun: aws.Boolean(true), + EventType: aws.String("EventType"), + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeSpotFleetRequestHistory(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotFleetRequests() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotFleetRequestsInput{ + DryRun: aws.Boolean(true), + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + SpotFleetRequestIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeSpotFleetRequests(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotInstanceRequests() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotInstanceRequestsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + SpotInstanceRequestIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeSpotInstanceRequests(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSpotPriceHistory() { + svc := ec2.New(nil) + + params := &ec2.DescribeSpotPriceHistoryInput{ + AvailabilityZone: aws.String("String"), + DryRun: aws.Boolean(true), + EndTime: aws.Time(time.Now()), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + InstanceTypes: []*string{ + aws.String("InstanceType"), // Required + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + ProductDescriptions: []*string{ + aws.String("String"), // Required + // More values... + }, + StartTime: aws.Time(time.Now()), + } + resp, err := svc.DescribeSpotPriceHistory(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeSubnets() { + svc := ec2.New(nil) + + params := &ec2.DescribeSubnetsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + SubnetIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeSubnets(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeTags() { + svc := ec2.New(nil) + + params := &ec2.DescribeTagsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCAttributeInput{ + VPCID: aws.String("String"), // Required + Attribute: aws.String("VpcAttributeName"), + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeVPCAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCClassicLink() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCClassicLinkInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + VPCIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPCClassicLink(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCEndpointServices() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCEndpointServicesInput{ + DryRun: aws.Boolean(true), + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeVPCEndpointServices(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCEndpoints() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCEndpointsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + VPCEndpointIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPCEndpoints(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCPeeringConnections() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCPeeringConnectionsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + VPCPeeringConnectionIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPCPeeringConnections(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPCs() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPCsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + VPCIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPCs(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPNConnections() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPNConnectionsInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + VPNConnectionIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPNConnections(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVPNGateways() { + svc := ec2.New(nil) + + params := &ec2.DescribeVPNGatewaysInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + VPNGatewayIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVPNGateways(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVolumeAttribute() { + svc := ec2.New(nil) + + params := &ec2.DescribeVolumeAttributeInput{ + VolumeID: aws.String("String"), // Required + Attribute: aws.String("VolumeAttributeName"), + DryRun: aws.Boolean(true), + } + resp, err := svc.DescribeVolumeAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVolumeStatus() { + svc := ec2.New(nil) + + params := &ec2.DescribeVolumeStatusInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + VolumeIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVolumeStatus(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DescribeVolumes() { + svc := ec2.New(nil) + + params := &ec2.DescribeVolumesInput{ + DryRun: aws.Boolean(true), + Filters: []*ec2.Filter{ + &ec2.Filter{ // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Long(1), + NextToken: aws.String("String"), + VolumeIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVolumes(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DetachClassicLinkVPC() { + svc := ec2.New(nil) + + params := &ec2.DetachClassicLinkVPCInput{ + InstanceID: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DetachClassicLinkVPC(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DetachInternetGateway() { + svc := ec2.New(nil) + + params := &ec2.DetachInternetGatewayInput{ + InternetGatewayID: aws.String("String"), // Required + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DetachInternetGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DetachNetworkInterface() { + svc := ec2.New(nil) + + params := &ec2.DetachNetworkInterfaceInput{ + AttachmentID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + Force: aws.Boolean(true), + } + resp, err := svc.DetachNetworkInterface(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DetachVPNGateway() { + svc := ec2.New(nil) + + params := &ec2.DetachVPNGatewayInput{ + VPCID: aws.String("String"), // Required + VPNGatewayID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DetachVPNGateway(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DetachVolume() { + svc := ec2.New(nil) + + params := &ec2.DetachVolumeInput{ + VolumeID: aws.String("String"), // Required + Device: aws.String("String"), + DryRun: aws.Boolean(true), + Force: aws.Boolean(true), + InstanceID: aws.String("String"), + } + resp, err := svc.DetachVolume(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DisableVGWRoutePropagation() { + svc := ec2.New(nil) + + params := &ec2.DisableVGWRoutePropagationInput{ + GatewayID: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + } + resp, err := svc.DisableVGWRoutePropagation(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DisableVPCClassicLink() { + svc := ec2.New(nil) + + params := &ec2.DisableVPCClassicLinkInput{ + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DisableVPCClassicLink(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DisassociateAddress() { + svc := ec2.New(nil) + + params := &ec2.DisassociateAddressInput{ + AssociationID: aws.String("String"), + DryRun: aws.Boolean(true), + PublicIP: aws.String("String"), + } + resp, err := svc.DisassociateAddress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_DisassociateRouteTable() { + svc := ec2.New(nil) + + params := &ec2.DisassociateRouteTableInput{ + AssociationID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.DisassociateRouteTable(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_EnableVGWRoutePropagation() { + svc := ec2.New(nil) + + params := &ec2.EnableVGWRoutePropagationInput{ + GatewayID: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + } + resp, err := svc.EnableVGWRoutePropagation(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_EnableVPCClassicLink() { + svc := ec2.New(nil) + + params := &ec2.EnableVPCClassicLinkInput{ + VPCID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.EnableVPCClassicLink(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_EnableVolumeIO() { + svc := ec2.New(nil) + + params := &ec2.EnableVolumeIOInput{ + VolumeID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.EnableVolumeIO(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_GetConsoleOutput() { + svc := ec2.New(nil) + + params := &ec2.GetConsoleOutputInput{ + InstanceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.GetConsoleOutput(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_GetPasswordData() { + svc := ec2.New(nil) + + params := &ec2.GetPasswordDataInput{ + InstanceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.GetPasswordData(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ImportImage() { + svc := ec2.New(nil) + + params := &ec2.ImportImageInput{ + Architecture: aws.String("String"), + ClientData: &ec2.ClientData{ + Comment: aws.String("String"), + UploadEnd: aws.Time(time.Now()), + UploadSize: aws.Double(1.0), + UploadStart: aws.Time(time.Now()), + }, + ClientToken: aws.String("String"), + Description: aws.String("String"), + DiskContainers: []*ec2.ImageDiskContainer{ + &ec2.ImageDiskContainer{ // Required + Description: aws.String("String"), + DeviceName: aws.String("String"), + Format: aws.String("String"), + SnapshotID: aws.String("String"), + URL: aws.String("String"), + UserBucket: &ec2.UserBucket{ + S3Bucket: aws.String("String"), + S3Key: aws.String("String"), + }, + }, + // More values... + }, + DryRun: aws.Boolean(true), + Hypervisor: aws.String("String"), + LicenseType: aws.String("String"), + Platform: aws.String("String"), + RoleName: aws.String("String"), + } + resp, err := svc.ImportImage(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ImportInstance() { + svc := ec2.New(nil) + + params := &ec2.ImportInstanceInput{ + Platform: aws.String("PlatformValues"), // Required + Description: aws.String("String"), + DiskImages: []*ec2.DiskImage{ + &ec2.DiskImage{ // Required + Description: aws.String("String"), + Image: &ec2.DiskImageDetail{ + Bytes: aws.Long(1), // Required + Format: aws.String("DiskImageFormat"), // Required + ImportManifestURL: aws.String("String"), // Required + }, + Volume: &ec2.VolumeDetail{ + Size: aws.Long(1), // Required + }, + }, + // More values... + }, + DryRun: aws.Boolean(true), + LaunchSpecification: &ec2.ImportInstanceLaunchSpecification{ + AdditionalInfo: aws.String("String"), + Architecture: aws.String("ArchitectureValues"), + GroupIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + GroupNames: []*string{ + aws.String("String"), // Required + // More values... + }, + InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), + InstanceType: aws.String("InstanceType"), + Monitoring: aws.Boolean(true), + Placement: &ec2.Placement{ + AvailabilityZone: aws.String("String"), + GroupName: aws.String("String"), + Tenancy: aws.String("Tenancy"), + }, + PrivateIPAddress: aws.String("String"), + SubnetID: aws.String("String"), + UserData: &ec2.UserData{ + Data: aws.String("String"), + }, + }, + } + resp, err := svc.ImportInstance(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ImportKeyPair() { + svc := ec2.New(nil) + + params := &ec2.ImportKeyPairInput{ + KeyName: aws.String("String"), // Required + PublicKeyMaterial: []byte("PAYLOAD"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ImportKeyPair(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ImportSnapshot() { + svc := ec2.New(nil) + + params := &ec2.ImportSnapshotInput{ + ClientData: &ec2.ClientData{ + Comment: aws.String("String"), + UploadEnd: aws.Time(time.Now()), + UploadSize: aws.Double(1.0), + UploadStart: aws.Time(time.Now()), + }, + ClientToken: aws.String("String"), + Description: aws.String("String"), + DiskContainer: &ec2.SnapshotDiskContainer{ + Description: aws.String("String"), + Format: aws.String("String"), + URL: aws.String("String"), + UserBucket: &ec2.UserBucket{ + S3Bucket: aws.String("String"), + S3Key: aws.String("String"), + }, + }, + DryRun: aws.Boolean(true), + RoleName: aws.String("String"), + } + resp, err := svc.ImportSnapshot(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ImportVolume() { + svc := ec2.New(nil) + + params := &ec2.ImportVolumeInput{ + AvailabilityZone: aws.String("String"), // Required + Image: &ec2.DiskImageDetail{ // Required + Bytes: aws.Long(1), // Required + Format: aws.String("DiskImageFormat"), // Required + ImportManifestURL: aws.String("String"), // Required + }, + Volume: &ec2.VolumeDetail{ // Required + Size: aws.Long(1), // Required + }, + Description: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.ImportVolume(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyImageAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifyImageAttributeInput{ + ImageID: aws.String("String"), // Required + Attribute: aws.String("String"), + Description: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + DryRun: aws.Boolean(true), + LaunchPermission: &ec2.LaunchPermissionModifications{ + Add: []*ec2.LaunchPermission{ + &ec2.LaunchPermission{ // Required + Group: aws.String("PermissionGroup"), + UserID: aws.String("String"), + }, + // More values... + }, + Remove: []*ec2.LaunchPermission{ + &ec2.LaunchPermission{ // Required + Group: aws.String("PermissionGroup"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + OperationType: aws.String("String"), + ProductCodes: []*string{ + aws.String("String"), // Required + // More values... + }, + UserGroups: []*string{ + aws.String("String"), // Required + // More values... + }, + UserIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + Value: aws.String("String"), + } + resp, err := svc.ModifyImageAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyInstanceAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifyInstanceAttributeInput{ + InstanceID: aws.String("String"), // Required + Attribute: aws.String("InstanceAttributeName"), + BlockDeviceMappings: []*ec2.InstanceBlockDeviceMappingSpecification{ + &ec2.InstanceBlockDeviceMappingSpecification{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSInstanceBlockDeviceSpecification{ + DeleteOnTermination: aws.Boolean(true), + VolumeID: aws.String("String"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + DisableAPITermination: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + DryRun: aws.Boolean(true), + EBSOptimized: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + InstanceInitiatedShutdownBehavior: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + InstanceType: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + Kernel: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + RAMDisk: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + SRIOVNetSupport: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + SourceDestCheck: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + UserData: &ec2.BlobAttributeValue{ + Value: []byte("PAYLOAD"), + }, + Value: aws.String("String"), + } + resp, err := svc.ModifyInstanceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyNetworkInterfaceAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifyNetworkInterfaceAttributeInput{ + NetworkInterfaceID: aws.String("String"), // Required + Attachment: &ec2.NetworkInterfaceAttachmentChanges{ + AttachmentID: aws.String("String"), + DeleteOnTermination: aws.Boolean(true), + }, + Description: &ec2.AttributeValue{ + Value: aws.String("String"), + }, + DryRun: aws.Boolean(true), + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + SourceDestCheck: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + } + resp, err := svc.ModifyNetworkInterfaceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyReservedInstances() { + svc := ec2.New(nil) + + params := &ec2.ModifyReservedInstancesInput{ + ReservedInstancesIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + TargetConfigurations: []*ec2.ReservedInstancesConfiguration{ // Required + &ec2.ReservedInstancesConfiguration{ // Required + AvailabilityZone: aws.String("String"), + InstanceCount: aws.Long(1), + InstanceType: aws.String("InstanceType"), + Platform: aws.String("String"), + }, + // More values... + }, + ClientToken: aws.String("String"), + } + resp, err := svc.ModifyReservedInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifySnapshotAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifySnapshotAttributeInput{ + SnapshotID: aws.String("String"), // Required + Attribute: aws.String("SnapshotAttributeName"), + CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ + Add: []*ec2.CreateVolumePermission{ + &ec2.CreateVolumePermission{ // Required + Group: aws.String("PermissionGroup"), + UserID: aws.String("String"), + }, + // More values... + }, + Remove: []*ec2.CreateVolumePermission{ + &ec2.CreateVolumePermission{ // Required + Group: aws.String("PermissionGroup"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + DryRun: aws.Boolean(true), + GroupNames: []*string{ + aws.String("String"), // Required + // More values... + }, + OperationType: aws.String("String"), + UserIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.ModifySnapshotAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifySubnetAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifySubnetAttributeInput{ + SubnetID: aws.String("String"), // Required + MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + } + resp, err := svc.ModifySubnetAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyVPCAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifyVPCAttributeInput{ + VPCID: aws.String("String"), // Required + EnableDNSHostnames: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + EnableDNSSupport: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + } + resp, err := svc.ModifyVPCAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyVPCEndpoint() { + svc := ec2.New(nil) + + params := &ec2.ModifyVPCEndpointInput{ + VPCEndpointID: aws.String("String"), // Required + AddRouteTableIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + PolicyDocument: aws.String("String"), + RemoveRouteTableIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + ResetPolicy: aws.Boolean(true), + } + resp, err := svc.ModifyVPCEndpoint(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ModifyVolumeAttribute() { + svc := ec2.New(nil) + + params := &ec2.ModifyVolumeAttributeInput{ + VolumeID: aws.String("String"), // Required + AutoEnableIO: &ec2.AttributeBooleanValue{ + Value: aws.Boolean(true), + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.ModifyVolumeAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_MonitorInstances() { + svc := ec2.New(nil) + + params := &ec2.MonitorInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.MonitorInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_MoveAddressToVPC() { + svc := ec2.New(nil) + + params := &ec2.MoveAddressToVPCInput{ + PublicIP: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.MoveAddressToVPC(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_PurchaseReservedInstancesOffering() { + svc := ec2.New(nil) + + params := &ec2.PurchaseReservedInstancesOfferingInput{ + InstanceCount: aws.Long(1), // Required + ReservedInstancesOfferingID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + LimitPrice: &ec2.ReservedInstanceLimitPrice{ + Amount: aws.Double(1.0), + CurrencyCode: aws.String("CurrencyCodeValues"), + }, + } + resp, err := svc.PurchaseReservedInstancesOffering(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RebootInstances() { + svc := ec2.New(nil) + + params := &ec2.RebootInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.RebootInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RegisterImage() { + svc := ec2.New(nil) + + params := &ec2.RegisterImageInput{ + Name: aws.String("String"), // Required + Architecture: aws.String("ArchitectureValues"), + BlockDeviceMappings: []*ec2.BlockDeviceMapping{ + &ec2.BlockDeviceMapping{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSBlockDevice{ + DeleteOnTermination: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeSize: aws.Long(1), + VolumeType: aws.String("VolumeType"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + Description: aws.String("String"), + DryRun: aws.Boolean(true), + ImageLocation: aws.String("String"), + KernelID: aws.String("String"), + RAMDiskID: aws.String("String"), + RootDeviceName: aws.String("String"), + SRIOVNetSupport: aws.String("String"), + VirtualizationType: aws.String("String"), + } + resp, err := svc.RegisterImage(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RejectVPCPeeringConnection() { + svc := ec2.New(nil) + + params := &ec2.RejectVPCPeeringConnectionInput{ + VPCPeeringConnectionID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.RejectVPCPeeringConnection(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReleaseAddress() { + svc := ec2.New(nil) + + params := &ec2.ReleaseAddressInput{ + AllocationID: aws.String("String"), + DryRun: aws.Boolean(true), + PublicIP: aws.String("String"), + } + resp, err := svc.ReleaseAddress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReplaceNetworkACLAssociation() { + svc := ec2.New(nil) + + params := &ec2.ReplaceNetworkACLAssociationInput{ + AssociationID: aws.String("String"), // Required + NetworkACLID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ReplaceNetworkACLAssociation(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReplaceNetworkACLEntry() { + svc := ec2.New(nil) + + params := &ec2.ReplaceNetworkACLEntryInput{ + CIDRBlock: aws.String("String"), // Required + Egress: aws.Boolean(true), // Required + NetworkACLID: aws.String("String"), // Required + Protocol: aws.String("String"), // Required + RuleAction: aws.String("RuleAction"), // Required + RuleNumber: aws.Long(1), // Required + DryRun: aws.Boolean(true), + ICMPTypeCode: &ec2.ICMPTypeCode{ + Code: aws.Long(1), + Type: aws.Long(1), + }, + PortRange: &ec2.PortRange{ + From: aws.Long(1), + To: aws.Long(1), + }, + } + resp, err := svc.ReplaceNetworkACLEntry(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReplaceRoute() { + svc := ec2.New(nil) + + params := &ec2.ReplaceRouteInput{ + DestinationCIDRBlock: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + GatewayID: aws.String("String"), + InstanceID: aws.String("String"), + NetworkInterfaceID: aws.String("String"), + VPCPeeringConnectionID: aws.String("String"), + } + resp, err := svc.ReplaceRoute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReplaceRouteTableAssociation() { + svc := ec2.New(nil) + + params := &ec2.ReplaceRouteTableAssociationInput{ + AssociationID: aws.String("String"), // Required + RouteTableID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ReplaceRouteTableAssociation(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ReportInstanceStatus() { + svc := ec2.New(nil) + + params := &ec2.ReportInstanceStatusInput{ + Instances: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + ReasonCodes: []*string{ // Required + aws.String("ReportInstanceReasonCodes"), // Required + // More values... + }, + Status: aws.String("ReportStatusType"), // Required + Description: aws.String("String"), + DryRun: aws.Boolean(true), + EndTime: aws.Time(time.Now()), + StartTime: aws.Time(time.Now()), + } + resp, err := svc.ReportInstanceStatus(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RequestSpotFleet() { + svc := ec2.New(nil) + + params := &ec2.RequestSpotFleetInput{ + SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required + IAMFleetRole: aws.String("String"), // Required + LaunchSpecifications: []*ec2.LaunchSpecification{ // Required + &ec2.LaunchSpecification{ // Required + AddressingType: aws.String("String"), + BlockDeviceMappings: []*ec2.BlockDeviceMapping{ + &ec2.BlockDeviceMapping{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSBlockDevice{ + DeleteOnTermination: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeSize: aws.Long(1), + VolumeType: aws.String("VolumeType"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + EBSOptimized: aws.Boolean(true), + IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ + ARN: aws.String("String"), + Name: aws.String("String"), + }, + ImageID: aws.String("String"), + InstanceType: aws.String("InstanceType"), + KernelID: aws.String("String"), + KeyName: aws.String("String"), + Monitoring: &ec2.RunInstancesMonitoringEnabled{ + Enabled: aws.Boolean(true), // Required + }, + NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ + &ec2.InstanceNetworkInterfaceSpecification{ // Required + AssociatePublicIPAddress: aws.Boolean(true), + DeleteOnTermination: aws.Boolean(true), + Description: aws.String("String"), + DeviceIndex: aws.Long(1), + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + NetworkInterfaceID: aws.String("String"), + PrivateIPAddress: aws.String("String"), + PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + &ec2.PrivateIPAddressSpecification{ // Required + PrivateIPAddress: aws.String("String"), // Required + Primary: aws.Boolean(true), + }, + // More values... + }, + SecondaryPrivateIPAddressCount: aws.Long(1), + SubnetID: aws.String("String"), + }, + // More values... + }, + Placement: &ec2.SpotPlacement{ + AvailabilityZone: aws.String("String"), + GroupName: aws.String("String"), + }, + RAMDiskID: aws.String("String"), + SecurityGroups: []*ec2.GroupIdentifier{ + &ec2.GroupIdentifier{ // Required + GroupID: aws.String("String"), + GroupName: aws.String("String"), + }, + // More values... + }, + SubnetID: aws.String("String"), + UserData: aws.String("String"), + }, + // More values... + }, + SpotPrice: aws.String("String"), // Required + TargetCapacity: aws.Long(1), // Required + ClientToken: aws.String("String"), + TerminateInstancesWithExpiration: aws.Boolean(true), + ValidFrom: aws.Time(time.Now()), + ValidUntil: aws.Time(time.Now()), + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.RequestSpotFleet(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RequestSpotInstances() { + svc := ec2.New(nil) + + params := &ec2.RequestSpotInstancesInput{ + SpotPrice: aws.String("String"), // Required + AvailabilityZoneGroup: aws.String("String"), + ClientToken: aws.String("String"), + DryRun: aws.Boolean(true), + InstanceCount: aws.Long(1), + LaunchGroup: aws.String("String"), + LaunchSpecification: &ec2.RequestSpotLaunchSpecification{ + AddressingType: aws.String("String"), + BlockDeviceMappings: []*ec2.BlockDeviceMapping{ + &ec2.BlockDeviceMapping{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSBlockDevice{ + DeleteOnTermination: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeSize: aws.Long(1), + VolumeType: aws.String("VolumeType"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + EBSOptimized: aws.Boolean(true), + IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ + ARN: aws.String("String"), + Name: aws.String("String"), + }, + ImageID: aws.String("String"), + InstanceType: aws.String("InstanceType"), + KernelID: aws.String("String"), + KeyName: aws.String("String"), + Monitoring: &ec2.RunInstancesMonitoringEnabled{ + Enabled: aws.Boolean(true), // Required + }, + NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ + &ec2.InstanceNetworkInterfaceSpecification{ // Required + AssociatePublicIPAddress: aws.Boolean(true), + DeleteOnTermination: aws.Boolean(true), + Description: aws.String("String"), + DeviceIndex: aws.Long(1), + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + NetworkInterfaceID: aws.String("String"), + PrivateIPAddress: aws.String("String"), + PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + &ec2.PrivateIPAddressSpecification{ // Required + PrivateIPAddress: aws.String("String"), // Required + Primary: aws.Boolean(true), + }, + // More values... + }, + SecondaryPrivateIPAddressCount: aws.Long(1), + SubnetID: aws.String("String"), + }, + // More values... + }, + Placement: &ec2.SpotPlacement{ + AvailabilityZone: aws.String("String"), + GroupName: aws.String("String"), + }, + RAMDiskID: aws.String("String"), + SecurityGroupIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + SecurityGroups: []*string{ + aws.String("String"), // Required + // More values... + }, + SubnetID: aws.String("String"), + UserData: aws.String("String"), + }, + Type: aws.String("SpotInstanceType"), + ValidFrom: aws.Time(time.Now()), + ValidUntil: aws.Time(time.Now()), + } + resp, err := svc.RequestSpotInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ResetImageAttribute() { + svc := ec2.New(nil) + + params := &ec2.ResetImageAttributeInput{ + Attribute: aws.String("ResetImageAttributeName"), // Required + ImageID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ResetImageAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ResetInstanceAttribute() { + svc := ec2.New(nil) + + params := &ec2.ResetInstanceAttributeInput{ + Attribute: aws.String("InstanceAttributeName"), // Required + InstanceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ResetInstanceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ResetNetworkInterfaceAttribute() { + svc := ec2.New(nil) + + params := &ec2.ResetNetworkInterfaceAttributeInput{ + NetworkInterfaceID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + SourceDestCheck: aws.String("String"), + } + resp, err := svc.ResetNetworkInterfaceAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_ResetSnapshotAttribute() { + svc := ec2.New(nil) + + params := &ec2.ResetSnapshotAttributeInput{ + Attribute: aws.String("SnapshotAttributeName"), // Required + SnapshotID: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.ResetSnapshotAttribute(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RestoreAddressToClassic() { + svc := ec2.New(nil) + + params := &ec2.RestoreAddressToClassicInput{ + PublicIP: aws.String("String"), // Required + DryRun: aws.Boolean(true), + } + resp, err := svc.RestoreAddressToClassic(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RevokeSecurityGroupEgress() { + svc := ec2.New(nil) + + params := &ec2.RevokeSecurityGroupEgressInput{ + GroupID: aws.String("String"), // Required + CIDRIP: aws.String("String"), + DryRun: aws.Boolean(true), + FromPort: aws.Long(1), + IPPermissions: []*ec2.IPPermission{ + &ec2.IPPermission{ // Required + FromPort: aws.Long(1), + IPProtocol: aws.String("String"), + IPRanges: []*ec2.IPRange{ + &ec2.IPRange{ // Required + CIDRIP: aws.String("String"), + }, + // More values... + }, + PrefixListIDs: []*ec2.PrefixListID{ + &ec2.PrefixListID{ // Required + PrefixListID: aws.String("String"), + }, + // More values... + }, + ToPort: aws.Long(1), + UserIDGroupPairs: []*ec2.UserIDGroupPair{ + &ec2.UserIDGroupPair{ // Required + GroupID: aws.String("String"), + GroupName: aws.String("String"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + // More values... + }, + IPProtocol: aws.String("String"), + SourceSecurityGroupName: aws.String("String"), + SourceSecurityGroupOwnerID: aws.String("String"), + ToPort: aws.Long(1), + } + resp, err := svc.RevokeSecurityGroupEgress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RevokeSecurityGroupIngress() { + svc := ec2.New(nil) + + params := &ec2.RevokeSecurityGroupIngressInput{ + CIDRIP: aws.String("String"), + DryRun: aws.Boolean(true), + FromPort: aws.Long(1), + GroupID: aws.String("String"), + GroupName: aws.String("String"), + IPPermissions: []*ec2.IPPermission{ + &ec2.IPPermission{ // Required + FromPort: aws.Long(1), + IPProtocol: aws.String("String"), + IPRanges: []*ec2.IPRange{ + &ec2.IPRange{ // Required + CIDRIP: aws.String("String"), + }, + // More values... + }, + PrefixListIDs: []*ec2.PrefixListID{ + &ec2.PrefixListID{ // Required + PrefixListID: aws.String("String"), + }, + // More values... + }, + ToPort: aws.Long(1), + UserIDGroupPairs: []*ec2.UserIDGroupPair{ + &ec2.UserIDGroupPair{ // Required + GroupID: aws.String("String"), + GroupName: aws.String("String"), + UserID: aws.String("String"), + }, + // More values... + }, + }, + // More values... + }, + IPProtocol: aws.String("String"), + SourceSecurityGroupName: aws.String("String"), + SourceSecurityGroupOwnerID: aws.String("String"), + ToPort: aws.Long(1), + } + resp, err := svc.RevokeSecurityGroupIngress(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_RunInstances() { + svc := ec2.New(nil) + + params := &ec2.RunInstancesInput{ + ImageID: aws.String("String"), // Required + MaxCount: aws.Long(1), // Required + MinCount: aws.Long(1), // Required + AdditionalInfo: aws.String("String"), + BlockDeviceMappings: []*ec2.BlockDeviceMapping{ + &ec2.BlockDeviceMapping{ // Required + DeviceName: aws.String("String"), + EBS: &ec2.EBSBlockDevice{ + DeleteOnTermination: aws.Boolean(true), + Encrypted: aws.Boolean(true), + IOPS: aws.Long(1), + SnapshotID: aws.String("String"), + VolumeSize: aws.Long(1), + VolumeType: aws.String("VolumeType"), + }, + NoDevice: aws.String("String"), + VirtualName: aws.String("String"), + }, + // More values... + }, + ClientToken: aws.String("String"), + DisableAPITermination: aws.Boolean(true), + DryRun: aws.Boolean(true), + EBSOptimized: aws.Boolean(true), + IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ + ARN: aws.String("String"), + Name: aws.String("String"), + }, + InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), + InstanceType: aws.String("InstanceType"), + KernelID: aws.String("String"), + KeyName: aws.String("String"), + Monitoring: &ec2.RunInstancesMonitoringEnabled{ + Enabled: aws.Boolean(true), // Required + }, + NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ + &ec2.InstanceNetworkInterfaceSpecification{ // Required + AssociatePublicIPAddress: aws.Boolean(true), + DeleteOnTermination: aws.Boolean(true), + Description: aws.String("String"), + DeviceIndex: aws.Long(1), + Groups: []*string{ + aws.String("String"), // Required + // More values... + }, + NetworkInterfaceID: aws.String("String"), + PrivateIPAddress: aws.String("String"), + PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + &ec2.PrivateIPAddressSpecification{ // Required + PrivateIPAddress: aws.String("String"), // Required + Primary: aws.Boolean(true), + }, + // More values... + }, + SecondaryPrivateIPAddressCount: aws.Long(1), + SubnetID: aws.String("String"), + }, + // More values... + }, + Placement: &ec2.Placement{ + AvailabilityZone: aws.String("String"), + GroupName: aws.String("String"), + Tenancy: aws.String("Tenancy"), + }, + PrivateIPAddress: aws.String("String"), + RAMDiskID: aws.String("String"), + SecurityGroupIDs: []*string{ + aws.String("String"), // Required + // More values... + }, + SecurityGroups: []*string{ + aws.String("String"), // Required + // More values... + }, + SubnetID: aws.String("String"), + UserData: aws.String("String"), + } + resp, err := svc.RunInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_StartInstances() { + svc := ec2.New(nil) + + params := &ec2.StartInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + AdditionalInfo: aws.String("String"), + DryRun: aws.Boolean(true), + } + resp, err := svc.StartInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_StopInstances() { + svc := ec2.New(nil) + + params := &ec2.StopInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + Force: aws.Boolean(true), + } + resp, err := svc.StopInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_TerminateInstances() { + svc := ec2.New(nil) + + params := &ec2.TerminateInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.TerminateInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_UnassignPrivateIPAddresses() { + svc := ec2.New(nil) + + params := &ec2.UnassignPrivateIPAddressesInput{ + NetworkInterfaceID: aws.String("String"), // Required + PrivateIPAddresses: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.UnassignPrivateIPAddresses(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleEC2_UnmonitorInstances() { + svc := ec2.New(nil) + + params := &ec2.UnmonitorInstancesInput{ + InstanceIDs: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Boolean(true), + } + resp, err := svc.UnmonitorInstances(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go similarity index 84% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/service.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go index 9556c45d75..792be71fb3 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go @@ -1,9 +1,11 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + package ec2 import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/ec2query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/ec2query" + "github.com/aws/aws-sdk-go/internal/signer/v4" ) // EC2 is a client for Amazon EC2. @@ -19,14 +21,10 @@ var initRequest func(*aws.Request) // New returns a new EC2 client. func New(config *aws.Config) *EC2 { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "ec2", - APIVersion: "2015-03-01", + APIVersion: "2015-04-15", } service.Initialize() diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go similarity index 95% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/api.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go index b8538c0be3..18fa15edf2 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/api.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/awslabs/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws" ) var oprw sync.Mutex @@ -43,11 +43,10 @@ func (c *ELB) AddTagsRequest(input *AddTagsInput) (req *aws.Request, output *Add // // For more information, see Tagging (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#tagging-elb) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) AddTags(input *AddTagsInput) (output *AddTagsOutput, err error) { +func (c *ELB) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { req, out := c.AddTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAddTags *aws.Operation @@ -81,11 +80,10 @@ func (c *ELB) ApplySecurityGroupsToLoadBalancerRequest(input *ApplySecurityGroup // // For more information, see Manage Security Groups for Amazon VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/USVPC_ApplySG.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (output *ApplySecurityGroupsToLoadBalancerOutput, err error) { +func (c *ELB) ApplySecurityGroupsToLoadBalancer(input *ApplySecurityGroupsToLoadBalancerInput) (*ApplySecurityGroupsToLoadBalancerOutput, error) { req, out := c.ApplySecurityGroupsToLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opApplySecurityGroupsToLoadBalancer *aws.Operation @@ -119,11 +117,10 @@ func (c *ELB) AttachLoadBalancerToSubnetsRequest(input *AttachLoadBalancerToSubn // The load balancer evenly distributes requests across all registered subnets. // For more information, see Elastic Load Balancing in Amazon VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (output *AttachLoadBalancerToSubnetsOutput, err error) { +func (c *ELB) AttachLoadBalancerToSubnets(input *AttachLoadBalancerToSubnetsInput) (*AttachLoadBalancerToSubnetsOutput, error) { req, out := c.AttachLoadBalancerToSubnetsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opAttachLoadBalancerToSubnets *aws.Operation @@ -156,11 +153,10 @@ func (c *ELB) ConfigureHealthCheckRequest(input *ConfigureHealthCheckInput) (req // // For more information, see Health Checks (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#healthcheck) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (output *ConfigureHealthCheckOutput, err error) { +func (c *ELB) ConfigureHealthCheck(input *ConfigureHealthCheckInput) (*ConfigureHealthCheckOutput, error) { req, out := c.ConfigureHealthCheckRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opConfigureHealthCheck *aws.Operation @@ -203,11 +199,10 @@ func (c *ELB) CreateAppCookieStickinessPolicyRequest(input *CreateAppCookieStick // // For more information, see Application-Controlled Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_StickySessions.html#US_EnableStickySessionsAppCookies) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (output *CreateAppCookieStickinessPolicyOutput, err error) { +func (c *ELB) CreateAppCookieStickinessPolicy(input *CreateAppCookieStickinessPolicyInput) (*CreateAppCookieStickinessPolicyOutput, error) { req, out := c.CreateAppCookieStickinessPolicyRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateAppCookieStickinessPolicy *aws.Operation @@ -252,11 +247,10 @@ func (c *ELB) CreateLBCookieStickinessPolicyRequest(input *CreateLBCookieStickin // // For more information, see Duration-Based Session Stickiness (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_StickySessions.html#US_EnableStickySessionsLBCookies) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (output *CreateLBCookieStickinessPolicyOutput, err error) { +func (c *ELB) CreateLBCookieStickinessPolicy(input *CreateLBCookieStickinessPolicyInput) (*CreateLBCookieStickinessPolicyOutput, error) { req, out := c.CreateLBCookieStickinessPolicyRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateLBCookieStickinessPolicy *aws.Operation @@ -306,11 +300,10 @@ func (c *ELB) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (req *aw // Elastic Load Balancing in EC2-Classic (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForEC2.html) // or Elastic Load Balancing in a VPC (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/UserScenariosForVPC.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (output *CreateLoadBalancerOutput, err error) { +func (c *ELB) CreateLoadBalancer(input *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error) { req, out := c.CreateLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateLoadBalancer *aws.Operation @@ -345,11 +338,10 @@ func (c *ELB) CreateLoadBalancerListenersRequest(input *CreateLoadBalancerListen // // For more information, see Add a Listener to Your Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/us-add-listener.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (output *CreateLoadBalancerListenersOutput, err error) { +func (c *ELB) CreateLoadBalancerListeners(input *CreateLoadBalancerListenersInput) (*CreateLoadBalancerListenersOutput, error) { req, out := c.CreateLoadBalancerListenersRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateLoadBalancerListeners *aws.Operation @@ -382,11 +374,10 @@ func (c *ELB) CreateLoadBalancerPolicyRequest(input *CreateLoadBalancerPolicyInp // Policies are settings that are saved for your load balancer and that can // be applied to the front-end listener or the back-end application server, // depending on the policy type. -func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (output *CreateLoadBalancerPolicyOutput, err error) { +func (c *ELB) CreateLoadBalancerPolicy(input *CreateLoadBalancerPolicyInput) (*CreateLoadBalancerPolicyOutput, error) { req, out := c.CreateLoadBalancerPolicyRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opCreateLoadBalancerPolicy *aws.Operation @@ -424,11 +415,10 @@ func (c *ELB) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (req *aw // // If the load balancer does not exist or has already been deleted, the call // to DeleteLoadBalancer still succeeds. -func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (output *DeleteLoadBalancerOutput, err error) { +func (c *ELB) DeleteLoadBalancer(input *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error) { req, out := c.DeleteLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteLoadBalancer *aws.Operation @@ -457,11 +447,10 @@ func (c *ELB) DeleteLoadBalancerListenersRequest(input *DeleteLoadBalancerListen } // Deletes the specified listeners from the specified load balancer. -func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (output *DeleteLoadBalancerListenersOutput, err error) { +func (c *ELB) DeleteLoadBalancerListeners(input *DeleteLoadBalancerListenersInput) (*DeleteLoadBalancerListenersOutput, error) { req, out := c.DeleteLoadBalancerListenersRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteLoadBalancerListeners *aws.Operation @@ -491,11 +480,10 @@ func (c *ELB) DeleteLoadBalancerPolicyRequest(input *DeleteLoadBalancerPolicyInp // Deletes the specified policy from the specified load balancer. This policy // must not be enabled for any listeners. -func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (output *DeleteLoadBalancerPolicyOutput, err error) { +func (c *ELB) DeleteLoadBalancerPolicy(input *DeleteLoadBalancerPolicyInput) (*DeleteLoadBalancerPolicyOutput, error) { req, out := c.DeleteLoadBalancerPolicyRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeleteLoadBalancerPolicy *aws.Operation @@ -532,11 +520,10 @@ func (c *ELB) DeregisterInstancesFromLoadBalancerRequest(input *DeregisterInstan // // For more information, see Deregister and Register Amazon EC2 Instances (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (output *DeregisterInstancesFromLoadBalancerOutput, err error) { +func (c *ELB) DeregisterInstancesFromLoadBalancer(input *DeregisterInstancesFromLoadBalancerInput) (*DeregisterInstancesFromLoadBalancerOutput, error) { req, out := c.DeregisterInstancesFromLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDeregisterInstancesFromLoadBalancer *aws.Operation @@ -568,11 +555,10 @@ func (c *ELB) DescribeInstanceHealthRequest(input *DescribeInstanceHealthInput) // load balancer. If no instances are specified, the call describes the state // of all instances registered with the load balancer, not including any terminated // instances. -func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (output *DescribeInstanceHealthOutput, err error) { +func (c *ELB) DescribeInstanceHealth(input *DescribeInstanceHealthInput) (*DescribeInstanceHealthOutput, error) { req, out := c.DescribeInstanceHealthRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeInstanceHealth *aws.Operation @@ -601,11 +587,10 @@ func (c *ELB) DescribeLoadBalancerAttributesRequest(input *DescribeLoadBalancerA } // Describes the attributes for the specified load balancer. -func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (output *DescribeLoadBalancerAttributesOutput, err error) { +func (c *ELB) DescribeLoadBalancerAttributes(input *DescribeLoadBalancerAttributesInput) (*DescribeLoadBalancerAttributesOutput, error) { req, out := c.DescribeLoadBalancerAttributesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeLoadBalancerAttributes *aws.Operation @@ -641,11 +626,10 @@ func (c *ELB) DescribeLoadBalancerPoliciesRequest(input *DescribeLoadBalancerPol // that policy. If you don't specify a load balancer name, the action returns // descriptions of the specified sample policies, or descriptions of all sample // policies. The names of the sample policies have the ELBSample- prefix. -func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (output *DescribeLoadBalancerPoliciesOutput, err error) { +func (c *ELB) DescribeLoadBalancerPolicies(input *DescribeLoadBalancerPoliciesInput) (*DescribeLoadBalancerPoliciesOutput, error) { req, out := c.DescribeLoadBalancerPoliciesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeLoadBalancerPolicies *aws.Operation @@ -677,11 +661,10 @@ func (c *ELB) DescribeLoadBalancerPolicyTypesRequest(input *DescribeLoadBalancer // // You can use these policy types with CreateLoadBalancerPolicy to create policy // configurations for a load balancer. -func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (output *DescribeLoadBalancerPolicyTypesOutput, err error) { +func (c *ELB) DescribeLoadBalancerPolicyTypes(input *DescribeLoadBalancerPolicyTypesInput) (*DescribeLoadBalancerPolicyTypesOutput, error) { req, out := c.DescribeLoadBalancerPolicyTypesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeLoadBalancerPolicyTypes *aws.Operation @@ -696,6 +679,12 @@ func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (r Name: "DescribeLoadBalancers", HTTPMethod: "POST", HTTPPath: "/", + Paginator: &aws.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "", + TruncationToken: "", + }, } } @@ -711,11 +700,17 @@ func (c *ELB) DescribeLoadBalancersRequest(input *DescribeLoadBalancersInput) (r // Describes the specified the load balancers. If no load balancers are specified, // the call describes all of your load balancers. -func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (output *DescribeLoadBalancersOutput, err error) { +func (c *ELB) DescribeLoadBalancers(input *DescribeLoadBalancersInput) (*DescribeLoadBalancersOutput, error) { req, out := c.DescribeLoadBalancersRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err +} + +func (c *ELB) DescribeLoadBalancersPages(input *DescribeLoadBalancersInput, fn func(p *DescribeLoadBalancersOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeLoadBalancersRequest(input) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeLoadBalancersOutput), lastPage) + }) } var opDescribeLoadBalancers *aws.Operation @@ -744,11 +739,10 @@ func (c *ELB) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, o } // Describes the tags associated with the specified load balancers. -func (c *ELB) DescribeTags(input *DescribeTagsInput) (output *DescribeTagsOutput, err error) { +func (c *ELB) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDescribeTags *aws.Operation @@ -782,11 +776,10 @@ func (c *ELB) DetachLoadBalancerFromSubnetsRequest(input *DetachLoadBalancerFrom // After a subnet is removed, all EC2 instances registered with the load balancer // in the removed subnet go into the OutOfService state. Then, the load balancer // balances the traffic among the remaining routable subnets. -func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (output *DetachLoadBalancerFromSubnetsOutput, err error) { +func (c *ELB) DetachLoadBalancerFromSubnets(input *DetachLoadBalancerFromSubnetsInput) (*DetachLoadBalancerFromSubnetsOutput, error) { req, out := c.DetachLoadBalancerFromSubnetsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDetachLoadBalancerFromSubnets *aws.Operation @@ -826,11 +819,10 @@ func (c *ELB) DisableAvailabilityZonesForLoadBalancerRequest(input *DisableAvail // For more information, see Disable an Availability Zone from a Load-Balanced // Application (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_ShrinkLBApp04.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (output *DisableAvailabilityZonesForLoadBalancerOutput, err error) { +func (c *ELB) DisableAvailabilityZonesForLoadBalancer(input *DisableAvailabilityZonesForLoadBalancerInput) (*DisableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.DisableAvailabilityZonesForLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opDisableAvailabilityZonesForLoadBalancer *aws.Operation @@ -866,11 +858,10 @@ func (c *ELB) EnableAvailabilityZonesForLoadBalancerRequest(input *EnableAvailab // // For more information, see Add Availability Zone (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_AddLBAvailabilityZone.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (output *EnableAvailabilityZonesForLoadBalancerOutput, err error) { +func (c *ELB) EnableAvailabilityZonesForLoadBalancer(input *EnableAvailabilityZonesForLoadBalancerInput) (*EnableAvailabilityZonesForLoadBalancerOutput, error) { req, out := c.EnableAvailabilityZonesForLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opEnableAvailabilityZonesForLoadBalancer *aws.Operation @@ -912,11 +903,10 @@ func (c *ELB) ModifyLoadBalancerAttributesRequest(input *ModifyLoadBalancerAttri // Connection Draining (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#conn-drain) // Access Logs (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html) // Idle Connection Timeout (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#idle-timeout) -func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (output *ModifyLoadBalancerAttributesOutput, err error) { +func (c *ELB) ModifyLoadBalancerAttributes(input *ModifyLoadBalancerAttributesInput) (*ModifyLoadBalancerAttributesOutput, error) { req, out := c.ModifyLoadBalancerAttributesRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opModifyLoadBalancerAttributes *aws.Operation @@ -971,11 +961,10 @@ func (c *ELB) RegisterInstancesWithLoadBalancerRequest(input *RegisterInstancesW // // For more information, see Deregister and Register EC2 Instances (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (output *RegisterInstancesWithLoadBalancerOutput, err error) { +func (c *ELB) RegisterInstancesWithLoadBalancer(input *RegisterInstancesWithLoadBalancerInput) (*RegisterInstancesWithLoadBalancerOutput, error) { req, out := c.RegisterInstancesWithLoadBalancerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRegisterInstancesWithLoadBalancer *aws.Operation @@ -1004,11 +993,10 @@ func (c *ELB) RemoveTagsRequest(input *RemoveTagsInput) (req *aws.Request, outpu } // Removes one or more tags from the specified load balancer. -func (c *ELB) RemoveTags(input *RemoveTagsInput) (output *RemoveTagsOutput, err error) { +func (c *ELB) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { req, out := c.RemoveTagsRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opRemoveTags *aws.Operation @@ -1043,11 +1031,10 @@ func (c *ELB) SetLoadBalancerListenerSSLCertificateRequest(input *SetLoadBalance // For more information about updating your SSL certificate, see Updating an // SSL Certificate for a Load Balancer (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_UpdatingLoadBalancerSSL.html) // in the Elastic Load Balancing Developer Guide. -func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (output *SetLoadBalancerListenerSSLCertificateOutput, err error) { +func (c *ELB) SetLoadBalancerListenerSSLCertificate(input *SetLoadBalancerListenerSSLCertificateInput) (*SetLoadBalancerListenerSSLCertificateOutput, error) { req, out := c.SetLoadBalancerListenerSSLCertificateRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opSetLoadBalancerListenerSSLCertificate *aws.Operation @@ -1086,11 +1073,10 @@ func (c *ELB) SetLoadBalancerPoliciesForBackendServerRequest(input *SetLoadBalan // // You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify // that the policy is associated with the back-end server. -func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (output *SetLoadBalancerPoliciesForBackendServerOutput, err error) { +func (c *ELB) SetLoadBalancerPoliciesForBackendServer(input *SetLoadBalancerPoliciesForBackendServerInput) (*SetLoadBalancerPoliciesForBackendServerOutput, error) { req, out := c.SetLoadBalancerPoliciesForBackendServerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opSetLoadBalancerPoliciesForBackendServer *aws.Operation @@ -1120,11 +1106,10 @@ func (c *ELB) SetLoadBalancerPoliciesOfListenerRequest(input *SetLoadBalancerPol // Associates, updates, or disables a policy with a listener for the specified // load balancer. You can associate multiple policies with a listener. -func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (output *SetLoadBalancerPoliciesOfListenerOutput, err error) { +func (c *ELB) SetLoadBalancerPoliciesOfListener(input *SetLoadBalancerPoliciesOfListenerInput) (*SetLoadBalancerPoliciesOfListenerOutput, error) { req, out := c.SetLoadBalancerPoliciesOfListenerRequest(input) - output = out - err = req.Send() - return + err := req.Send() + return out, err } var opSetLoadBalancerPoliciesOfListener *aws.Operation diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/elbiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go similarity index 93% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/elbiface/interface.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go index 053a62c8e3..5beab180ce 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/elbiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go @@ -1,9 +1,13 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +// Package elbiface provides an interface for the Elastic Load Balancing. package elbiface import ( - "github.com/awslabs/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/service/elb" ) +// ELBAPI is the interface type for elb.ELB. type ELBAPI interface { AddTags(*elb.AddTagsInput) (*elb.AddTagsOutput, error) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface_test.go new file mode 100644 index 0000000000..acf9105707 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/elbiface/interface_test.go @@ -0,0 +1,15 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package elbiface_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/service/elb/elbiface" + "github.com/stretchr/testify/assert" +) + +func TestInterface(t *testing.T) { + assert.Implements(t, (*elbiface.ELBAPI)(nil), elb.New(nil)) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go new file mode 100644 index 0000000000..354af9bb8c --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/examples_test.go @@ -0,0 +1,947 @@ +// 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/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/service/elb" +) + +var _ time.Duration +var _ bytes.Buffer + +func ExampleELB_AddTags() { + svc := elb.New(nil) + + params := &elb.AddTagsInput{ + LoadBalancerNames: []*string{ // Required + aws.String("AccessPointName"), // Required + // More values... + }, + Tags: []*elb.Tag{ // Required + &elb.Tag{ // Required + Key: aws.String("TagKey"), // Required + Value: aws.String("TagValue"), + }, + // More values... + }, + } + resp, err := svc.AddTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_ApplySecurityGroupsToLoadBalancer() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_AttachLoadBalancerToSubnets() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_ConfigureHealthCheck() { + svc := elb.New(nil) + + params := &elb.ConfigureHealthCheckInput{ + HealthCheck: &elb.HealthCheck{ // Required + HealthyThreshold: aws.Long(1), // Required + Interval: aws.Long(1), // Required + Target: aws.String("HealthCheckTarget"), // Required + Timeout: aws.Long(1), // Required + UnhealthyThreshold: aws.Long(1), // Required + }, + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.ConfigureHealthCheck(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_CreateAppCookieStickinessPolicy() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_CreateLBCookieStickinessPolicy() { + svc := elb.New(nil) + + params := &elb.CreateLBCookieStickinessPolicyInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + PolicyName: aws.String("PolicyName"), // Required + CookieExpirationPeriod: aws.Long(1), + } + resp, err := svc.CreateLBCookieStickinessPolicy(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_CreateLoadBalancer() { + svc := elb.New(nil) + + params := &elb.CreateLoadBalancerInput{ + Listeners: []*elb.Listener{ // Required + &elb.Listener{ // Required + InstancePort: aws.Long(1), // Required + LoadBalancerPort: aws.Long(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{ + &elb.Tag{ // Required + Key: aws.String("TagKey"), // Required + Value: aws.String("TagValue"), + }, + // More values... + }, + } + resp, err := svc.CreateLoadBalancer(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_CreateLoadBalancerListeners() { + svc := elb.New(nil) + + params := &elb.CreateLoadBalancerListenersInput{ + Listeners: []*elb.Listener{ // Required + &elb.Listener{ // Required + InstancePort: aws.Long(1), // Required + LoadBalancerPort: aws.Long(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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_CreateLoadBalancerPolicy() { + svc := elb.New(nil) + + params := &elb.CreateLoadBalancerPolicyInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + PolicyName: aws.String("PolicyName"), // Required + PolicyTypeName: aws.String("PolicyTypeName"), // Required + PolicyAttributes: []*elb.PolicyAttribute{ + &elb.PolicyAttribute{ // Required + AttributeName: aws.String("AttributeName"), + AttributeValue: aws.String("AttributeValue"), + }, + // More values... + }, + } + resp, err := svc.CreateLoadBalancerPolicy(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DeleteLoadBalancer() { + svc := elb.New(nil) + + params := &elb.DeleteLoadBalancerInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.DeleteLoadBalancer(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DeleteLoadBalancerListeners() { + svc := elb.New(nil) + + params := &elb.DeleteLoadBalancerListenersInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + LoadBalancerPorts: []*int64{ // Required + aws.Long(1), // Required + // More values... + }, + } + resp, err := svc.DeleteLoadBalancerListeners(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DeleteLoadBalancerPolicy() { + svc := elb.New(nil) + + params := &elb.DeleteLoadBalancerPolicyInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + PolicyName: aws.String("PolicyName"), // Required + } + resp, err := svc.DeleteLoadBalancerPolicy(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DeregisterInstancesFromLoadBalancer() { + svc := elb.New(nil) + + params := &elb.DeregisterInstancesFromLoadBalancerInput{ + Instances: []*elb.Instance{ // Required + &elb.Instance{ // Required + InstanceID: aws.String("InstanceId"), + }, + // More values... + }, + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.DeregisterInstancesFromLoadBalancer(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeInstanceHealth() { + svc := elb.New(nil) + + params := &elb.DescribeInstanceHealthInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + Instances: []*elb.Instance{ + &elb.Instance{ // Required + InstanceID: aws.String("InstanceId"), + }, + // More values... + }, + } + resp, err := svc.DescribeInstanceHealth(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeLoadBalancerAttributes() { + svc := elb.New(nil) + + params := &elb.DescribeLoadBalancerAttributesInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.DescribeLoadBalancerAttributes(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeLoadBalancerPolicies() { + svc := elb.New(nil) + + params := &elb.DescribeLoadBalancerPoliciesInput{ + LoadBalancerName: aws.String("AccessPointName"), + PolicyNames: []*string{ + aws.String("PolicyName"), // Required + // More values... + }, + } + resp, err := svc.DescribeLoadBalancerPolicies(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeLoadBalancerPolicyTypes() { + svc := elb.New(nil) + + params := &elb.DescribeLoadBalancerPolicyTypesInput{ + PolicyTypeNames: []*string{ + aws.String("PolicyTypeName"), // Required + // More values... + }, + } + resp, err := svc.DescribeLoadBalancerPolicyTypes(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeLoadBalancers() { + svc := elb.New(nil) + + params := &elb.DescribeLoadBalancersInput{ + LoadBalancerNames: []*string{ + aws.String("AccessPointName"), // Required + // More values... + }, + Marker: aws.String("Marker"), + PageSize: aws.Long(1), + } + resp, err := svc.DescribeLoadBalancers(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DescribeTags() { + svc := elb.New(nil) + + params := &elb.DescribeTagsInput{ + LoadBalancerNames: []*string{ // Required + aws.String("AccessPointName"), // Required + // More values... + }, + } + resp, err := svc.DescribeTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DetachLoadBalancerFromSubnets() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { + svc := elb.New(nil) + + 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 { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_ModifyLoadBalancerAttributes() { + svc := elb.New(nil) + + params := &elb.ModifyLoadBalancerAttributesInput{ + LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required + AccessLog: &elb.AccessLog{ + Enabled: aws.Boolean(true), // Required + EmitInterval: aws.Long(1), + S3BucketName: aws.String("S3BucketName"), + S3BucketPrefix: aws.String("AccessLogPrefix"), + }, + AdditionalAttributes: []*elb.AdditionalAttribute{ + &elb.AdditionalAttribute{ // Required + Key: aws.String("StringVal"), + Value: aws.String("StringVal"), + }, + // More values... + }, + ConnectionDraining: &elb.ConnectionDraining{ + Enabled: aws.Boolean(true), // Required + Timeout: aws.Long(1), + }, + ConnectionSettings: &elb.ConnectionSettings{ + IdleTimeout: aws.Long(1), // Required + }, + CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{ + Enabled: aws.Boolean(true), // Required + }, + }, + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.ModifyLoadBalancerAttributes(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_RegisterInstancesWithLoadBalancer() { + svc := elb.New(nil) + + params := &elb.RegisterInstancesWithLoadBalancerInput{ + Instances: []*elb.Instance{ // Required + &elb.Instance{ // Required + InstanceID: aws.String("InstanceId"), + }, + // More values... + }, + LoadBalancerName: aws.String("AccessPointName"), // Required + } + resp, err := svc.RegisterInstancesWithLoadBalancer(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_RemoveTags() { + svc := elb.New(nil) + + params := &elb.RemoveTagsInput{ + LoadBalancerNames: []*string{ // Required + aws.String("AccessPointName"), // Required + // More values... + }, + Tags: []*elb.TagKeyOnly{ // Required + &elb.TagKeyOnly{ // Required + Key: aws.String("TagKey"), + }, + // More values... + }, + } + resp, err := svc.RemoveTags(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_SetLoadBalancerListenerSSLCertificate() { + svc := elb.New(nil) + + params := &elb.SetLoadBalancerListenerSSLCertificateInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + LoadBalancerPort: aws.Long(1), // Required + SSLCertificateID: aws.String("SSLCertificateId"), // Required + } + resp, err := svc.SetLoadBalancerListenerSSLCertificate(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { + svc := elb.New(nil) + + params := &elb.SetLoadBalancerPoliciesForBackendServerInput{ + InstancePort: aws.Long(1), // Required + LoadBalancerName: aws.String("AccessPointName"), // Required + PolicyNames: []*string{ // Required + aws.String("PolicyName"), // Required + // More values... + }, + } + resp, err := svc.SetLoadBalancerPoliciesForBackendServer(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} + +func ExampleELB_SetLoadBalancerPoliciesOfListener() { + svc := elb.New(nil) + + params := &elb.SetLoadBalancerPoliciesOfListenerInput{ + LoadBalancerName: aws.String("AccessPointName"), // Required + LoadBalancerPort: aws.Long(1), // Required + PolicyNames: []*string{ // Required + aws.String("PolicyName"), // Required + // More values... + }, + } + resp, err := svc.SetLoadBalancerPoliciesOfListener(params) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + // Generic AWS Error with Code, Message, and original error (if any) + fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) + if reqErr, ok := err.(awserr.RequestFailure); ok { + // A service error occurred + fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) + } + } else { + // This case should never be hit, The SDK should alwsy return an + // error which satisfies the awserr.Error interface. + fmt.Println(err.Error()) + } + } + + // Pretty-print the response data. + fmt.Println(awsutil.StringValue(resp)) +} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go similarity index 86% rename from Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/service.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go index b578a08b11..b77651c535 100644 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/elb/service.go @@ -1,9 +1,11 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + package elb import ( - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/protocol/query" - "github.com/awslabs/aws-sdk-go/internal/signer/v4" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/internal/protocol/query" + "github.com/aws/aws-sdk-go/internal/signer/v4" ) // ELB is a client for Elastic Load Balancing. @@ -19,10 +21,6 @@ var initRequest func(*aws.Request) // New returns a new ELB client. func New(config *aws.Config) *ELB { - if config == nil { - config = &aws.Config{} - } - service := &aws.Service{ Config: aws.DefaultConfig.Merge(config), ServiceName: "elasticloadbalancing", diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy.go deleted file mode 100644 index ddab85f8a2..0000000000 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/awsutil/copy.go +++ /dev/null @@ -1,69 +0,0 @@ -package awsutil - -import ( - "io" - "reflect" -) - -// Copy deeply copies a src structure to dst. Useful for copying request and -// response structures. -func Copy(dst, src interface{}) { - rcopy(reflect.ValueOf(dst), reflect.ValueOf(src)) -} - -// CopyOf returns a copy of src while also allocating the memory for dst. -// src must be a pointer type or this operation will fail. -func CopyOf(src interface{}) (dst interface{}) { - dsti := reflect.New(reflect.TypeOf(src).Elem()) - dst = dsti.Interface() - rcopy(dsti, reflect.ValueOf(src)) - return -} - -// rcopy performs a recursive copy of values from the source to destination. -func rcopy(dst, src reflect.Value) { - if !src.IsValid() { - return - } - - switch src.Kind() { - case reflect.Ptr: - if _, ok := src.Interface().(io.Reader); ok { - if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() { - dst.Elem().Set(src) - } else if dst.CanSet() { - dst.Set(src) - } - } else { - e := src.Type().Elem() - if dst.CanSet() { - dst.Set(reflect.New(e)) - } - if src.Elem().IsValid() { - rcopy(dst.Elem(), src.Elem()) - } - } - case reflect.Struct: - dst.Set(reflect.New(src.Type()).Elem()) - for i := 0; i < src.NumField(); i++ { - rcopy(dst.Field(i), src.Field(i)) - } - case reflect.Slice: - s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) - dst.Set(s) - for i := 0; i < src.Len(); i++ { - rcopy(dst.Index(i), src.Index(i)) - } - case reflect.Map: - s := reflect.MakeMap(src.Type()) - dst.Set(s) - for _, k := range src.MapKeys() { - v := src.MapIndex(k) - v2 := reflect.New(v.Type()).Elem() - rcopy(v2, v) - dst.SetMapIndex(k, v2) - } - default: - dst.Set(src) - } -} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/error.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/error.go deleted file mode 100644 index c3921dcf48..0000000000 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/aws/error.go +++ /dev/null @@ -1,26 +0,0 @@ -package aws - -// An APIError is an error returned by an AWS API. -type APIError struct { - StatusCode int // HTTP status code e.g. 200 - Code string - Message string - RequestID string -} - -// Error returns the error as a string. Satisfies error interface. -func (e APIError) Error() string { - return e.Code + ": " + e.Message -} - -// Error returns an APIError pointer if the error e is an APIError type. -// If the error is not an APIError nil will be returned. -func Error(e error) *APIError { - if err, ok := e.(*APIError); ok { - return err - } else if err, ok := e.(APIError); ok { - return &err - } else { - return nil - } -} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/examples_test.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/examples_test.go deleted file mode 100644 index 4b61c1fa40..0000000000 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/examples_test.go +++ /dev/null @@ -1,4774 +0,0 @@ -package ec2_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/aws/awsutil" - "github.com/awslabs/aws-sdk-go/service/ec2" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleEC2_AcceptVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.AcceptVPCPeeringConnectionInput{ - DryRun: aws.Boolean(true), - VPCPeeringConnectionID: aws.String("String"), - } - resp, err := svc.AcceptVPCPeeringConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AllocateAddress() { - svc := ec2.New(nil) - - params := &ec2.AllocateAddressInput{ - Domain: aws.String("DomainType"), - DryRun: aws.Boolean(true), - } - resp, err := svc.AllocateAddress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AssignPrivateIPAddresses() { - svc := ec2.New(nil) - - params := &ec2.AssignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required - AllowReassignment: aws.Boolean(true), - PrivateIPAddresses: []*string{ - aws.String("String"), // Required - // More values... - }, - SecondaryPrivateIPAddressCount: aws.Long(1), - } - resp, err := svc.AssignPrivateIPAddresses(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AssociateAddress() { - svc := ec2.New(nil) - - params := &ec2.AssociateAddressInput{ - AllocationID: aws.String("String"), - AllowReassociation: aws.Boolean(true), - DryRun: aws.Boolean(true), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PublicIP: aws.String("String"), - } - resp, err := svc.AssociateAddress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AssociateDHCPOptions() { - svc := ec2.New(nil) - - params := &ec2.AssociateDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AssociateDHCPOptions(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AssociateRouteTable() { - svc := ec2.New(nil) - - params := &ec2.AssociateRouteTableInput{ - RouteTableID: aws.String("String"), // Required - SubnetID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AssociateRouteTable(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AttachClassicLinkVPC() { - svc := ec2.New(nil) - - params := &ec2.AttachClassicLinkVPCInput{ - Groups: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AttachClassicLinkVPC(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AttachInternetGateway() { - svc := ec2.New(nil) - - params := &ec2.AttachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AttachInternetGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AttachNetworkInterface() { - svc := ec2.New(nil) - - params := &ec2.AttachNetworkInterfaceInput{ - DeviceIndex: aws.Long(1), // Required - InstanceID: aws.String("String"), // Required - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AttachNetworkInterface(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AttachVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.AttachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AttachVPNGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AttachVolume() { - svc := ec2.New(nil) - - params := &ec2.AttachVolumeInput{ - Device: aws.String("String"), // Required - InstanceID: aws.String("String"), // Required - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.AttachVolume(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AuthorizeSecurityGroupEgress() { - svc := ec2.New(nil) - - params := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), - GroupName: aws.String("String"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IPProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), - } - resp, err := svc.AuthorizeSecurityGroupEgress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_AuthorizeSecurityGroupIngress() { - svc := ec2.New(nil) - - params := &ec2.AuthorizeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - GroupID: aws.String("String"), - GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), - GroupName: aws.String("String"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IPProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), - } - resp, err := svc.AuthorizeSecurityGroupIngress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_BundleInstance() { - svc := ec2.New(nil) - - params := &ec2.BundleInstanceInput{ - InstanceID: aws.String("String"), // Required - Storage: &ec2.Storage{ // Required - S3: &ec2.S3Storage{ - AWSAccessKeyID: aws.String("String"), - Bucket: aws.String("String"), - Prefix: aws.String("String"), - UploadPolicy: []byte("PAYLOAD"), - UploadPolicySignature: aws.String("String"), - }, - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.BundleInstance(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelBundleTask() { - svc := ec2.New(nil) - - params := &ec2.CancelBundleTaskInput{ - BundleID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CancelBundleTask(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelConversionTask() { - svc := ec2.New(nil) - - params := &ec2.CancelConversionTaskInput{ - ConversionTaskID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - ReasonMessage: aws.String("String"), - } - resp, err := svc.CancelConversionTask(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelExportTask() { - svc := ec2.New(nil) - - params := &ec2.CancelExportTaskInput{ - ExportTaskID: aws.String("String"), // Required - } - resp, err := svc.CancelExportTask(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelImportTask() { - svc := ec2.New(nil) - - params := &ec2.CancelImportTaskInput{ - CancelReason: aws.String("String"), - DryRun: aws.Boolean(true), - ImportTaskID: aws.String("String"), - } - resp, err := svc.CancelImportTask(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelReservedInstancesListing() { - svc := ec2.New(nil) - - params := &ec2.CancelReservedInstancesListingInput{ - ReservedInstancesListingID: aws.String("String"), // Required - } - resp, err := svc.CancelReservedInstancesListing(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CancelSpotInstanceRequests() { - svc := ec2.New(nil) - - params := &ec2.CancelSpotInstanceRequestsInput{ - SpotInstanceRequestIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.CancelSpotInstanceRequests(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ConfirmProductInstance() { - svc := ec2.New(nil) - - params := &ec2.ConfirmProductInstanceInput{ - InstanceID: aws.String("String"), // Required - ProductCode: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ConfirmProductInstance(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CopyImage() { - svc := ec2.New(nil) - - params := &ec2.CopyImageInput{ - Name: aws.String("String"), // Required - SourceImageID: aws.String("String"), // Required - SourceRegion: aws.String("String"), // Required - ClientToken: aws.String("String"), - Description: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.CopyImage(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CopySnapshot() { - svc := ec2.New(nil) - - params := &ec2.CopySnapshotInput{ - SourceRegion: aws.String("String"), // Required - SourceSnapshotID: aws.String("String"), // Required - Description: aws.String("String"), - DestinationRegion: aws.String("String"), - DryRun: aws.Boolean(true), - PresignedURL: aws.String("String"), - } - resp, err := svc.CopySnapshot(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateCustomerGateway() { - svc := ec2.New(nil) - - params := &ec2.CreateCustomerGatewayInput{ - BGPASN: aws.Long(1), // Required - PublicIP: aws.String("String"), // Required - Type: aws.String("GatewayType"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateCustomerGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateDHCPOptions() { - svc := ec2.New(nil) - - params := &ec2.CreateDHCPOptionsInput{ - DHCPConfigurations: []*ec2.NewDHCPConfiguration{ // Required - &ec2.NewDHCPConfiguration{ // Required - Key: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateDHCPOptions(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateImage() { - svc := ec2.New(nil) - - params := &ec2.CreateImageInput{ - InstanceID: aws.String("String"), // Required - Name: aws.String("String"), // Required - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required - DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - Description: aws.String("String"), - DryRun: aws.Boolean(true), - NoReboot: aws.Boolean(true), - } - resp, err := svc.CreateImage(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateInstanceExportTask() { - svc := ec2.New(nil) - - params := &ec2.CreateInstanceExportTaskInput{ - InstanceID: aws.String("String"), // Required - Description: aws.String("String"), - ExportToS3Task: &ec2.ExportToS3TaskSpecification{ - ContainerFormat: aws.String("ContainerFormat"), - DiskImageFormat: aws.String("DiskImageFormat"), - S3Bucket: aws.String("String"), - S3Prefix: aws.String("String"), - }, - TargetEnvironment: aws.String("ExportEnvironment"), - } - resp, err := svc.CreateInstanceExportTask(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateInternetGateway() { - svc := ec2.New(nil) - - params := &ec2.CreateInternetGatewayInput{ - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateInternetGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateKeyPair() { - svc := ec2.New(nil) - - params := &ec2.CreateKeyPairInput{ - KeyName: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateKeyPair(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateNetworkACL() { - svc := ec2.New(nil) - - params := &ec2.CreateNetworkACLInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateNetworkACL(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateNetworkACLEntry() { - svc := ec2.New(nil) - - params := &ec2.CreateNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required - Protocol: aws.String("String"), // Required - RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ - Code: aws.Long(1), - Type: aws.Long(1), - }, - PortRange: &ec2.PortRange{ - From: aws.Long(1), - To: aws.Long(1), - }, - } - resp, err := svc.CreateNetworkACLEntry(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateNetworkInterface() { - svc := ec2.New(nil) - - params := &ec2.CreateNetworkInterfaceInput{ - SubnetID: aws.String("String"), // Required - Description: aws.String("String"), - DryRun: aws.Boolean(true), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), - }, - // More values... - }, - SecondaryPrivateIPAddressCount: aws.Long(1), - } - resp, err := svc.CreateNetworkInterface(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreatePlacementGroup() { - svc := ec2.New(nil) - - params := &ec2.CreatePlacementGroupInput{ - GroupName: aws.String("String"), // Required - Strategy: aws.String("PlacementStrategy"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CreatePlacementGroup(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateReservedInstancesListing() { - svc := ec2.New(nil) - - params := &ec2.CreateReservedInstancesListingInput{ - ClientToken: aws.String("String"), // Required - InstanceCount: aws.Long(1), // Required - PriceSchedules: []*ec2.PriceScheduleSpecification{ // Required - &ec2.PriceScheduleSpecification{ // Required - CurrencyCode: aws.String("CurrencyCodeValues"), - Price: aws.Double(1.0), - Term: aws.Long(1), - }, - // More values... - }, - ReservedInstancesID: aws.String("String"), // Required - } - resp, err := svc.CreateReservedInstancesListing(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateRoute() { - svc := ec2.New(nil) - - params := &ec2.CreateRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), - } - resp, err := svc.CreateRoute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateRouteTable() { - svc := ec2.New(nil) - - params := &ec2.CreateRouteTableInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateRouteTable(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateSecurityGroup() { - svc := ec2.New(nil) - - params := &ec2.CreateSecurityGroupInput{ - Description: aws.String("String"), // Required - GroupName: aws.String("String"), // Required - DryRun: aws.Boolean(true), - VPCID: aws.String("String"), - } - resp, err := svc.CreateSecurityGroup(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateSnapshot() { - svc := ec2.New(nil) - - params := &ec2.CreateSnapshotInput{ - VolumeID: aws.String("String"), // Required - Description: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateSnapshot(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateSpotDatafeedSubscription() { - svc := ec2.New(nil) - - params := &ec2.CreateSpotDatafeedSubscriptionInput{ - Bucket: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Prefix: aws.String("String"), - } - resp, err := svc.CreateSpotDatafeedSubscription(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateSubnet() { - svc := ec2.New(nil) - - params := &ec2.CreateSubnetInput{ - CIDRBlock: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateSubnet(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateTags() { - svc := ec2.New(nil) - - params := &ec2.CreateTagsInput{ - Resources: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - Tags: []*ec2.Tag{ // Required - &ec2.Tag{ // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVPC() { - svc := ec2.New(nil) - - params := &ec2.CreateVPCInput{ - CIDRBlock: aws.String("String"), // Required - DryRun: aws.Boolean(true), - InstanceTenancy: aws.String("Tenancy"), - } - resp, err := svc.CreateVPC(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.CreateVPCPeeringConnectionInput{ - DryRun: aws.Boolean(true), - PeerOwnerID: aws.String("String"), - PeerVPCID: aws.String("String"), - VPCID: aws.String("String"), - } - resp, err := svc.CreateVPCPeeringConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVPNConnection() { - svc := ec2.New(nil) - - params := &ec2.CreateVPNConnectionInput{ - CustomerGatewayID: aws.String("String"), // Required - Type: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Options: &ec2.VPNConnectionOptionsSpecification{ - StaticRoutesOnly: aws.Boolean(true), - }, - } - resp, err := svc.CreateVPNConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVPNConnectionRoute() { - svc := ec2.New(nil) - - params := &ec2.CreateVPNConnectionRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - VPNConnectionID: aws.String("String"), // Required - } - resp, err := svc.CreateVPNConnectionRoute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.CreateVPNGatewayInput{ - Type: aws.String("GatewayType"), // Required - AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.CreateVPNGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_CreateVolume() { - svc := ec2.New(nil) - - params := &ec2.CreateVolumeInput{ - AvailabilityZone: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - KMSKeyID: aws.String("String"), - Size: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeType: aws.String("VolumeType"), - } - resp, err := svc.CreateVolume(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteCustomerGateway() { - svc := ec2.New(nil) - - params := &ec2.DeleteCustomerGatewayInput{ - CustomerGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteCustomerGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteDHCPOptions() { - svc := ec2.New(nil) - - params := &ec2.DeleteDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteDHCPOptions(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteInternetGateway() { - svc := ec2.New(nil) - - params := &ec2.DeleteInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteInternetGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteKeyPair() { - svc := ec2.New(nil) - - params := &ec2.DeleteKeyPairInput{ - KeyName: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteKeyPair(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteNetworkACL() { - svc := ec2.New(nil) - - params := &ec2.DeleteNetworkACLInput{ - NetworkACLID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteNetworkACL(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteNetworkACLEntry() { - svc := ec2.New(nil) - - params := &ec2.DeleteNetworkACLEntryInput{ - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteNetworkACLEntry(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteNetworkInterface() { - svc := ec2.New(nil) - - params := &ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteNetworkInterface(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeletePlacementGroup() { - svc := ec2.New(nil) - - params := &ec2.DeletePlacementGroupInput{ - GroupName: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeletePlacementGroup(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteRoute() { - svc := ec2.New(nil) - - params := &ec2.DeleteRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteRoute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteRouteTable() { - svc := ec2.New(nil) - - params := &ec2.DeleteRouteTableInput{ - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteRouteTable(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteSecurityGroup() { - svc := ec2.New(nil) - - params := &ec2.DeleteSecurityGroupInput{ - DryRun: aws.Boolean(true), - GroupID: aws.String("String"), - GroupName: aws.String("String"), - } - resp, err := svc.DeleteSecurityGroup(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteSnapshot() { - svc := ec2.New(nil) - - params := &ec2.DeleteSnapshotInput{ - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteSnapshot(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteSpotDatafeedSubscription() { - svc := ec2.New(nil) - - params := &ec2.DeleteSpotDatafeedSubscriptionInput{ - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteSpotDatafeedSubscription(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteSubnet() { - svc := ec2.New(nil) - - params := &ec2.DeleteSubnetInput{ - SubnetID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteSubnet(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteTags() { - svc := ec2.New(nil) - - params := &ec2.DeleteTagsInput{ - Resources: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Tags: []*ec2.Tag{ - &ec2.Tag{ // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - } - resp, err := svc.DeleteTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVPC() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPCInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteVPC(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteVPCPeeringConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVPNConnection() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPNConnectionInput{ - VPNConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteVPNConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVPNConnectionRoute() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPNConnectionRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - VPNConnectionID: aws.String("String"), // Required - } - resp, err := svc.DeleteVPNConnectionRoute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPNGatewayInput{ - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteVPNGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeleteVolume() { - svc := ec2.New(nil) - - params := &ec2.DeleteVolumeInput{ - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeleteVolume(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DeregisterImage() { - svc := ec2.New(nil) - - params := &ec2.DeregisterImageInput{ - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DeregisterImage(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeAccountAttributes() { - svc := ec2.New(nil) - - params := &ec2.DescribeAccountAttributesInput{ - AttributeNames: []*string{ - aws.String("AccountAttributeName"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeAccountAttributes(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeAddresses() { - svc := ec2.New(nil) - - params := &ec2.DescribeAddressesInput{ - AllocationIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - PublicIPs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeAddresses(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeAvailabilityZones() { - svc := ec2.New(nil) - - params := &ec2.DescribeAvailabilityZonesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ZoneNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeAvailabilityZones(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeBundleTasks() { - svc := ec2.New(nil) - - params := &ec2.DescribeBundleTasksInput{ - BundleIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeBundleTasks(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeClassicLinkInstances() { - svc := ec2.New(nil) - - params := &ec2.DescribeClassicLinkInstancesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeClassicLinkInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeConversionTasks() { - svc := ec2.New(nil) - - params := &ec2.DescribeConversionTasksInput{ - ConversionTaskIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeConversionTasks(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeCustomerGateways() { - svc := ec2.New(nil) - - params := &ec2.DescribeCustomerGatewaysInput{ - CustomerGatewayIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeCustomerGateways(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeDHCPOptions() { - svc := ec2.New(nil) - - params := &ec2.DescribeDHCPOptionsInput{ - DHCPOptionsIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeDHCPOptions(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeExportTasks() { - svc := ec2.New(nil) - - params := &ec2.DescribeExportTasksInput{ - ExportTaskIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeExportTasks(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeImageAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeImageAttributeInput{ - Attribute: aws.String("ImageAttributeName"), // Required - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeImageAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeImages() { - svc := ec2.New(nil) - - params := &ec2.DescribeImagesInput{ - DryRun: aws.Boolean(true), - ExecutableUsers: []*string{ - aws.String("String"), // Required - // More values... - }, - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImageIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - Owners: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeImages(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeImportImageTasks() { - svc := ec2.New(nil) - - params := &ec2.DescribeImportImageTasksInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImportTaskIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeImportImageTasks(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeImportSnapshotTasks() { - svc := ec2.New(nil) - - params := &ec2.DescribeImportSnapshotTasksInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImportTaskIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeImportSnapshotTasks(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeInstanceAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeInstanceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeInstanceStatus() { - svc := ec2.New(nil) - - params := &ec2.DescribeInstanceStatusInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - IncludeAllInstances: aws.Boolean(true), - InstanceIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeInstanceStatus(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeInstances() { - svc := ec2.New(nil) - - params := &ec2.DescribeInstancesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeInternetGateways() { - svc := ec2.New(nil) - - params := &ec2.DescribeInternetGatewaysInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InternetGatewayIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeInternetGateways(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeKeyPairs() { - svc := ec2.New(nil) - - params := &ec2.DescribeKeyPairsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - KeyNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeKeyPairs(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeNetworkACLs() { - svc := ec2.New(nil) - - params := &ec2.DescribeNetworkACLsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NetworkACLIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeNetworkACLs(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeNetworkInterfaceAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required - Attribute: aws.String("NetworkInterfaceAttribute"), - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeNetworkInterfaceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeNetworkInterfaces() { - svc := ec2.New(nil) - - params := &ec2.DescribeNetworkInterfacesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NetworkInterfaceIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeNetworkInterfaces(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribePlacementGroups() { - svc := ec2.New(nil) - - params := &ec2.DescribePlacementGroupsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribePlacementGroups(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeRegions() { - svc := ec2.New(nil) - - params := &ec2.DescribeRegionsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - RegionNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeRegions(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeReservedInstances() { - svc := ec2.New(nil) - - params := &ec2.DescribeReservedInstancesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - OfferingType: aws.String("OfferingTypeValues"), - ReservedInstancesIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeReservedInstancesListings() { - svc := ec2.New(nil) - - params := &ec2.DescribeReservedInstancesListingsInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ReservedInstancesID: aws.String("String"), - ReservedInstancesListingID: aws.String("String"), - } - resp, err := svc.DescribeReservedInstancesListings(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeReservedInstancesModifications() { - svc := ec2.New(nil) - - params := &ec2.DescribeReservedInstancesModificationsInput{ - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NextToken: aws.String("String"), - ReservedInstancesModificationIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstancesModifications(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeReservedInstancesOfferings() { - svc := ec2.New(nil) - - params := &ec2.DescribeReservedInstancesOfferingsInput{ - AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - IncludeMarketplace: aws.Boolean(true), - InstanceTenancy: aws.String("Tenancy"), - InstanceType: aws.String("InstanceType"), - MaxDuration: aws.Long(1), - MaxInstanceCount: aws.Long(1), - MaxResults: aws.Long(1), - MinDuration: aws.Long(1), - NextToken: aws.String("String"), - OfferingType: aws.String("OfferingTypeValues"), - ProductDescription: aws.String("RIProductDescription"), - ReservedInstancesOfferingIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstancesOfferings(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeRouteTables() { - svc := ec2.New(nil) - - params := &ec2.DescribeRouteTablesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - RouteTableIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeRouteTables(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSecurityGroups() { - svc := ec2.New(nil) - - params := &ec2.DescribeSecurityGroupsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - GroupIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSecurityGroups(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSnapshotAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeSnapshotAttributeInput{ - Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeSnapshotAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSnapshots() { - svc := ec2.New(nil) - - params := &ec2.DescribeSnapshotsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - OwnerIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - RestorableByUserIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - SnapshotIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSnapshots(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSpotDatafeedSubscription() { - svc := ec2.New(nil) - - params := &ec2.DescribeSpotDatafeedSubscriptionInput{ - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeSpotDatafeedSubscription(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSpotInstanceRequests() { - svc := ec2.New(nil) - - params := &ec2.DescribeSpotInstanceRequestsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - SpotInstanceRequestIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSpotInstanceRequests(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSpotPriceHistory() { - svc := ec2.New(nil) - - params := &ec2.DescribeSpotPriceHistoryInput{ - AvailabilityZone: aws.String("String"), - DryRun: aws.Boolean(true), - EndTime: aws.Time(time.Now()), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceTypes: []*string{ - aws.String("InstanceType"), // Required - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - ProductDescriptions: []*string{ - aws.String("String"), // Required - // More values... - }, - StartTime: aws.Time(time.Now()), - } - resp, err := svc.DescribeSpotPriceHistory(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeSubnets() { - svc := ec2.New(nil) - - params := &ec2.DescribeSubnetsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - SubnetIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSubnets(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeTags() { - svc := ec2.New(nil) - - params := &ec2.DescribeTagsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPCAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCAttributeInput{ - VPCID: aws.String("String"), // Required - Attribute: aws.String("VpcAttributeName"), - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeVPCAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPCClassicLink() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCClassicLinkInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VPCIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVPCClassicLink(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPCPeeringConnections() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCPeeringConnectionsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VPCPeeringConnectionIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVPCPeeringConnections(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPCs() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VPCIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVPCs(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPNConnections() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPNConnectionsInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VPNConnectionIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVPNConnections(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVPNGateways() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPNGatewaysInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VPNGatewayIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVPNGateways(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVolumeAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required - Attribute: aws.String("VolumeAttributeName"), - DryRun: aws.Boolean(true), - } - resp, err := svc.DescribeVolumeAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVolumeStatus() { - svc := ec2.New(nil) - - params := &ec2.DescribeVolumeStatusInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - VolumeIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVolumeStatus(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DescribeVolumes() { - svc := ec2.New(nil) - - params := &ec2.DescribeVolumesInput{ - DryRun: aws.Boolean(true), - Filters: []*ec2.Filter{ - &ec2.Filter{ // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Long(1), - NextToken: aws.String("String"), - VolumeIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVolumes(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DetachClassicLinkVPC() { - svc := ec2.New(nil) - - params := &ec2.DetachClassicLinkVPCInput{ - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DetachClassicLinkVPC(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DetachInternetGateway() { - svc := ec2.New(nil) - - params := &ec2.DetachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DetachInternetGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DetachNetworkInterface() { - svc := ec2.New(nil) - - params := &ec2.DetachNetworkInterfaceInput{ - AttachmentID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), - } - resp, err := svc.DetachNetworkInterface(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DetachVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.DetachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DetachVPNGateway(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DetachVolume() { - svc := ec2.New(nil) - - params := &ec2.DetachVolumeInput{ - VolumeID: aws.String("String"), // Required - Device: aws.String("String"), - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), - InstanceID: aws.String("String"), - } - resp, err := svc.DetachVolume(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DisableVGWRoutePropagation() { - svc := ec2.New(nil) - - params := &ec2.DisableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - } - resp, err := svc.DisableVGWRoutePropagation(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DisableVPCClassicLink() { - svc := ec2.New(nil) - - params := &ec2.DisableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DisableVPCClassicLink(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DisassociateAddress() { - svc := ec2.New(nil) - - params := &ec2.DisassociateAddressInput{ - AssociationID: aws.String("String"), - DryRun: aws.Boolean(true), - PublicIP: aws.String("String"), - } - resp, err := svc.DisassociateAddress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_DisassociateRouteTable() { - svc := ec2.New(nil) - - params := &ec2.DisassociateRouteTableInput{ - AssociationID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.DisassociateRouteTable(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_EnableVGWRoutePropagation() { - svc := ec2.New(nil) - - params := &ec2.EnableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - } - resp, err := svc.EnableVGWRoutePropagation(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_EnableVPCClassicLink() { - svc := ec2.New(nil) - - params := &ec2.EnableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.EnableVPCClassicLink(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_EnableVolumeIO() { - svc := ec2.New(nil) - - params := &ec2.EnableVolumeIOInput{ - VolumeID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.EnableVolumeIO(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_GetConsoleOutput() { - svc := ec2.New(nil) - - params := &ec2.GetConsoleOutputInput{ - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.GetConsoleOutput(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_GetPasswordData() { - svc := ec2.New(nil) - - params := &ec2.GetPasswordDataInput{ - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.GetPasswordData(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ImportImage() { - svc := ec2.New(nil) - - params := &ec2.ImportImageInput{ - Architecture: aws.String("String"), - ClientData: &ec2.ClientData{ - Comment: aws.String("String"), - UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Double(1.0), - UploadStart: aws.Time(time.Now()), - }, - ClientToken: aws.String("String"), - Description: aws.String("String"), - DiskContainers: []*ec2.ImageDiskContainer{ - &ec2.ImageDiskContainer{ // Required - Description: aws.String("String"), - DeviceName: aws.String("String"), - Format: aws.String("String"), - SnapshotID: aws.String("String"), - URL: aws.String("String"), - UserBucket: &ec2.UserBucket{ - S3Bucket: aws.String("String"), - S3Key: aws.String("String"), - }, - }, - // More values... - }, - DryRun: aws.Boolean(true), - Hypervisor: aws.String("String"), - LicenseType: aws.String("String"), - Platform: aws.String("String"), - RoleName: aws.String("String"), - } - resp, err := svc.ImportImage(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ImportInstance() { - svc := ec2.New(nil) - - params := &ec2.ImportInstanceInput{ - Platform: aws.String("PlatformValues"), // Required - Description: aws.String("String"), - DiskImages: []*ec2.DiskImage{ - &ec2.DiskImage{ // Required - Description: aws.String("String"), - Image: &ec2.DiskImageDetail{ - Bytes: aws.Long(1), // Required - Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required - }, - Volume: &ec2.VolumeDetail{ - Size: aws.Long(1), // Required - }, - }, - // More values... - }, - DryRun: aws.Boolean(true), - LaunchSpecification: &ec2.ImportInstanceLaunchSpecification{ - AdditionalInfo: aws.String("String"), - Architecture: aws.String("ArchitectureValues"), - GroupIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), - InstanceType: aws.String("InstanceType"), - Monitoring: aws.Boolean(true), - Placement: &ec2.Placement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - PrivateIPAddress: aws.String("String"), - SubnetID: aws.String("String"), - UserData: &ec2.UserData{ - Data: aws.String("String"), - }, - }, - } - resp, err := svc.ImportInstance(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ImportKeyPair() { - svc := ec2.New(nil) - - params := &ec2.ImportKeyPairInput{ - KeyName: aws.String("String"), // Required - PublicKeyMaterial: []byte("PAYLOAD"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ImportKeyPair(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ImportSnapshot() { - svc := ec2.New(nil) - - params := &ec2.ImportSnapshotInput{ - ClientData: &ec2.ClientData{ - Comment: aws.String("String"), - UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Double(1.0), - UploadStart: aws.Time(time.Now()), - }, - ClientToken: aws.String("String"), - Description: aws.String("String"), - DiskContainer: &ec2.SnapshotDiskContainer{ - Description: aws.String("String"), - Format: aws.String("String"), - URL: aws.String("String"), - UserBucket: &ec2.UserBucket{ - S3Bucket: aws.String("String"), - S3Key: aws.String("String"), - }, - }, - DryRun: aws.Boolean(true), - RoleName: aws.String("String"), - } - resp, err := svc.ImportSnapshot(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ImportVolume() { - svc := ec2.New(nil) - - params := &ec2.ImportVolumeInput{ - AvailabilityZone: aws.String("String"), // Required - Image: &ec2.DiskImageDetail{ // Required - Bytes: aws.Long(1), // Required - Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required - }, - Volume: &ec2.VolumeDetail{ // Required - Size: aws.Long(1), // Required - }, - Description: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.ImportVolume(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyImageAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyImageAttributeInput{ - ImageID: aws.String("String"), // Required - Attribute: aws.String("String"), - Description: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - DryRun: aws.Boolean(true), - LaunchPermission: &ec2.LaunchPermissionModifications{ - Add: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{ // Required - Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), - }, - // More values... - }, - Remove: []*ec2.LaunchPermission{ - &ec2.LaunchPermission{ // Required - Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - OperationType: aws.String("String"), - ProductCodes: []*string{ - aws.String("String"), // Required - // More values... - }, - UserGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - UserIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - Value: aws.String("String"), - } - resp, err := svc.ModifyImageAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyInstanceAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyInstanceAttributeInput{ - InstanceID: aws.String("String"), // Required - Attribute: aws.String("InstanceAttributeName"), - BlockDeviceMappings: []*ec2.InstanceBlockDeviceMappingSpecification{ - &ec2.InstanceBlockDeviceMappingSpecification{ // Required - DeviceName: aws.String("String"), - EBS: &ec2.EBSInstanceBlockDeviceSpecification{ - DeleteOnTermination: aws.Boolean(true), - VolumeID: aws.String("String"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - DisableAPITermination: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - DryRun: aws.Boolean(true), - EBSOptimized: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - InstanceInitiatedShutdownBehavior: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - InstanceType: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - Kernel: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - RAMDisk: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - SRIOVNetSupport: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - UserData: &ec2.BlobAttributeValue{ - Value: []byte("PAYLOAD"), - }, - Value: aws.String("String"), - } - resp, err := svc.ModifyInstanceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyNetworkInterfaceAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required - Attachment: &ec2.NetworkInterfaceAttachmentChanges{ - AttachmentID: aws.String("String"), - DeleteOnTermination: aws.Boolean(true), - }, - Description: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - DryRun: aws.Boolean(true), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - } - resp, err := svc.ModifyNetworkInterfaceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyReservedInstances() { - svc := ec2.New(nil) - - params := &ec2.ModifyReservedInstancesInput{ - ReservedInstancesIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - TargetConfigurations: []*ec2.ReservedInstancesConfiguration{ // Required - &ec2.ReservedInstancesConfiguration{ // Required - AvailabilityZone: aws.String("String"), - InstanceCount: aws.Long(1), - InstanceType: aws.String("InstanceType"), - Platform: aws.String("String"), - }, - // More values... - }, - ClientToken: aws.String("String"), - } - resp, err := svc.ModifyReservedInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifySnapshotAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifySnapshotAttributeInput{ - SnapshotID: aws.String("String"), // Required - Attribute: aws.String("SnapshotAttributeName"), - CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ - Add: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{ // Required - Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), - }, - // More values... - }, - Remove: []*ec2.CreateVolumePermission{ - &ec2.CreateVolumePermission{ // Required - Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - DryRun: aws.Boolean(true), - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - OperationType: aws.String("String"), - UserIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.ModifySnapshotAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifySubnetAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifySubnetAttributeInput{ - SubnetID: aws.String("String"), // Required - MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - } - resp, err := svc.ModifySubnetAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyVPCAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyVPCAttributeInput{ - VPCID: aws.String("String"), // Required - EnableDNSHostnames: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - EnableDNSSupport: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - } - resp, err := svc.ModifyVPCAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ModifyVolumeAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required - AutoEnableIO: &ec2.AttributeBooleanValue{ - Value: aws.Boolean(true), - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.ModifyVolumeAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_MonitorInstances() { - svc := ec2.New(nil) - - params := &ec2.MonitorInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.MonitorInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_PurchaseReservedInstancesOffering() { - svc := ec2.New(nil) - - params := &ec2.PurchaseReservedInstancesOfferingInput{ - InstanceCount: aws.Long(1), // Required - ReservedInstancesOfferingID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - LimitPrice: &ec2.ReservedInstanceLimitPrice{ - Amount: aws.Double(1.0), - CurrencyCode: aws.String("CurrencyCodeValues"), - }, - } - resp, err := svc.PurchaseReservedInstancesOffering(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RebootInstances() { - svc := ec2.New(nil) - - params := &ec2.RebootInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.RebootInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RegisterImage() { - svc := ec2.New(nil) - - params := &ec2.RegisterImageInput{ - Name: aws.String("String"), // Required - Architecture: aws.String("ArchitectureValues"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required - DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - Description: aws.String("String"), - DryRun: aws.Boolean(true), - ImageLocation: aws.String("String"), - KernelID: aws.String("String"), - RAMDiskID: aws.String("String"), - RootDeviceName: aws.String("String"), - SRIOVNetSupport: aws.String("String"), - VirtualizationType: aws.String("String"), - } - resp, err := svc.RegisterImage(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RejectVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.RejectVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.RejectVPCPeeringConnection(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReleaseAddress() { - svc := ec2.New(nil) - - params := &ec2.ReleaseAddressInput{ - AllocationID: aws.String("String"), - DryRun: aws.Boolean(true), - PublicIP: aws.String("String"), - } - resp, err := svc.ReleaseAddress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReplaceNetworkACLAssociation() { - svc := ec2.New(nil) - - params := &ec2.ReplaceNetworkACLAssociationInput{ - AssociationID: aws.String("String"), // Required - NetworkACLID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ReplaceNetworkACLAssociation(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReplaceNetworkACLEntry() { - svc := ec2.New(nil) - - params := &ec2.ReplaceNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required - Egress: aws.Boolean(true), // Required - NetworkACLID: aws.String("String"), // Required - Protocol: aws.String("String"), // Required - RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Long(1), // Required - DryRun: aws.Boolean(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ - Code: aws.Long(1), - Type: aws.Long(1), - }, - PortRange: &ec2.PortRange{ - From: aws.Long(1), - To: aws.Long(1), - }, - } - resp, err := svc.ReplaceNetworkACLEntry(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReplaceRoute() { - svc := ec2.New(nil) - - params := &ec2.ReplaceRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), - } - resp, err := svc.ReplaceRoute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReplaceRouteTableAssociation() { - svc := ec2.New(nil) - - params := &ec2.ReplaceRouteTableAssociationInput{ - AssociationID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ReplaceRouteTableAssociation(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ReportInstanceStatus() { - svc := ec2.New(nil) - - params := &ec2.ReportInstanceStatusInput{ - Instances: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - ReasonCodes: []*string{ // Required - aws.String("ReportInstanceReasonCodes"), // Required - // More values... - }, - Status: aws.String("ReportStatusType"), // Required - Description: aws.String("String"), - DryRun: aws.Boolean(true), - EndTime: aws.Time(time.Now()), - StartTime: aws.Time(time.Now()), - } - resp, err := svc.ReportInstanceStatus(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RequestSpotInstances() { - svc := ec2.New(nil) - - params := &ec2.RequestSpotInstancesInput{ - SpotPrice: aws.String("String"), // Required - AvailabilityZoneGroup: aws.String("String"), - DryRun: aws.Boolean(true), - InstanceCount: aws.Long(1), - LaunchGroup: aws.String("String"), - LaunchSpecification: &ec2.RequestSpotLaunchSpecification{ - AddressingType: aws.String("String"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required - DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), - Name: aws.String("String"), - }, - ImageID: aws.String("String"), - InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Boolean(true), // Required - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - &ec2.InstanceNetworkInterfaceSpecification{ // Required - AssociatePublicIPAddress: aws.Boolean(true), - DeleteOnTermination: aws.Boolean(true), - Description: aws.String("String"), - DeviceIndex: aws.Long(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), - }, - // More values... - }, - SecondaryPrivateIPAddressCount: aws.Long(1), - SubnetID: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.SpotPlacement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - }, - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - SecurityGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - SubnetID: aws.String("String"), - UserData: aws.String("String"), - }, - Type: aws.String("SpotInstanceType"), - ValidFrom: aws.Time(time.Now()), - ValidUntil: aws.Time(time.Now()), - } - resp, err := svc.RequestSpotInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ResetImageAttribute() { - svc := ec2.New(nil) - - params := &ec2.ResetImageAttributeInput{ - Attribute: aws.String("ResetImageAttributeName"), // Required - ImageID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ResetImageAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ResetInstanceAttribute() { - svc := ec2.New(nil) - - params := &ec2.ResetInstanceAttributeInput{ - Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ResetInstanceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ResetNetworkInterfaceAttribute() { - svc := ec2.New(nil) - - params := &ec2.ResetNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - SourceDestCheck: aws.String("String"), - } - resp, err := svc.ResetNetworkInterfaceAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_ResetSnapshotAttribute() { - svc := ec2.New(nil) - - params := &ec2.ResetSnapshotAttributeInput{ - Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required - DryRun: aws.Boolean(true), - } - resp, err := svc.ResetSnapshotAttribute(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RevokeSecurityGroupEgress() { - svc := ec2.New(nil) - - params := &ec2.RevokeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), - GroupName: aws.String("String"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IPProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), - } - resp, err := svc.RevokeSecurityGroupEgress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RevokeSecurityGroupIngress() { - svc := ec2.New(nil) - - params := &ec2.RevokeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), - DryRun: aws.Boolean(true), - FromPort: aws.Long(1), - GroupID: aws.String("String"), - GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ - &ec2.IPPermission{ // Required - FromPort: aws.Long(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ - &ec2.IPRange{ // Required - CIDRIP: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Long(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ - &ec2.UserIDGroupPair{ // Required - GroupID: aws.String("String"), - GroupName: aws.String("String"), - UserID: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IPProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), - ToPort: aws.Long(1), - } - resp, err := svc.RevokeSecurityGroupIngress(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_RunInstances() { - svc := ec2.New(nil) - - params := &ec2.RunInstancesInput{ - ImageID: aws.String("String"), // Required - MaxCount: aws.Long(1), // Required - MinCount: aws.Long(1), // Required - AdditionalInfo: aws.String("String"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - &ec2.BlockDeviceMapping{ // Required - DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ - DeleteOnTermination: aws.Boolean(true), - Encrypted: aws.Boolean(true), - IOPS: aws.Long(1), - SnapshotID: aws.String("String"), - VolumeSize: aws.Long(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - ClientToken: aws.String("String"), - DisableAPITermination: aws.Boolean(true), - DryRun: aws.Boolean(true), - EBSOptimized: aws.Boolean(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), - Name: aws.String("String"), - }, - InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), - InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Boolean(true), // Required - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - &ec2.InstanceNetworkInterfaceSpecification{ // Required - AssociatePublicIPAddress: aws.Boolean(true), - DeleteOnTermination: aws.Boolean(true), - Description: aws.String("String"), - DeviceIndex: aws.Long(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ - &ec2.PrivateIPAddressSpecification{ // Required - PrivateIPAddress: aws.String("String"), // Required - Primary: aws.Boolean(true), - }, - // More values... - }, - SecondaryPrivateIPAddressCount: aws.Long(1), - SubnetID: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.Placement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - PrivateIPAddress: aws.String("String"), - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - SecurityGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - SubnetID: aws.String("String"), - UserData: aws.String("String"), - } - resp, err := svc.RunInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_StartInstances() { - svc := ec2.New(nil) - - params := &ec2.StartInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - AdditionalInfo: aws.String("String"), - DryRun: aws.Boolean(true), - } - resp, err := svc.StartInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_StopInstances() { - svc := ec2.New(nil) - - params := &ec2.StopInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - Force: aws.Boolean(true), - } - resp, err := svc.StopInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_TerminateInstances() { - svc := ec2.New(nil) - - params := &ec2.TerminateInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.TerminateInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_UnassignPrivateIPAddresses() { - svc := ec2.New(nil) - - params := &ec2.UnassignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required - PrivateIPAddresses: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.UnassignPrivateIPAddresses(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleEC2_UnmonitorInstances() { - svc := ec2.New(nil) - - params := &ec2.UnmonitorInstancesInput{ - InstanceIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Boolean(true), - } - resp, err := svc.UnmonitorInstances(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/integration_test.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/integration_test.go deleted file mode 100644 index 01808b8fa3..0000000000 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/ec2/integration_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// +build integration - -package ec2_test - -import ( - "testing" - - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/internal/test/integration" - "github.com/awslabs/aws-sdk-go/internal/util/utilassert" - "github.com/awslabs/aws-sdk-go/service/ec2" - "github.com/stretchr/testify/assert" -) - -var ( - _ = assert.Equal - _ = utilassert.Match - _ = integration.Imported -) - -func TestMakingABasicRequest(t *testing.T) { - client := ec2.New(nil) - resp, e := client.DescribeRegions(&ec2.DescribeRegionsInput{}) - err := aws.Error(e) - _, _, _ = resp, e, err // avoid unused warnings - - assert.NoError(t, nil, err) - -} - -func TestErrorHandling(t *testing.T) { - client := ec2.New(nil) - resp, e := client.DescribeInstances(&ec2.DescribeInstancesInput{ - InstanceIDs: []*string{ - aws.String("i-12345678"), - }, - }) - err := aws.Error(e) - _, _, _ = resp, e, err // avoid unused warnings - - assert.NotEqual(t, nil, err) - assert.Equal(t, "InvalidInstanceID.NotFound", err.Code) - utilassert.Match(t, "The instance ID 'i-12345678' does not exist", err.Message) - -} diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/examples_test.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/examples_test.go deleted file mode 100644 index 7c25ba31f7..0000000000 --- a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/service/elb/examples_test.go +++ /dev/null @@ -1,748 +0,0 @@ -package elb_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/awslabs/aws-sdk-go/aws" - "github.com/awslabs/aws-sdk-go/aws/awsutil" - "github.com/awslabs/aws-sdk-go/service/elb" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleELB_AddTags() { - svc := elb.New(nil) - - params := &elb.AddTagsInput{ - LoadBalancerNames: []*string{ // Required - aws.String("AccessPointName"), // Required - // More values... - }, - Tags: []*elb.Tag{ // Required - &elb.Tag{ // Required - Key: aws.String("TagKey"), // Required - Value: aws.String("TagValue"), - }, - // More values... - }, - } - resp, err := svc.AddTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_ApplySecurityGroupsToLoadBalancer() { - svc := elb.New(nil) - - params := &elb.ApplySecurityGroupsToLoadBalancerInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - SecurityGroups: []*string{ // Required - aws.String("SecurityGroupId"), // Required - // More values... - }, - } - resp, err := svc.ApplySecurityGroupsToLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_AttachLoadBalancerToSubnets() { - svc := elb.New(nil) - - params := &elb.AttachLoadBalancerToSubnetsInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - Subnets: []*string{ // Required - aws.String("SubnetId"), // Required - // More values... - }, - } - resp, err := svc.AttachLoadBalancerToSubnets(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_ConfigureHealthCheck() { - svc := elb.New(nil) - - params := &elb.ConfigureHealthCheckInput{ - HealthCheck: &elb.HealthCheck{ // Required - HealthyThreshold: aws.Long(1), // Required - Interval: aws.Long(1), // Required - Target: aws.String("HealthCheckTarget"), // Required - Timeout: aws.Long(1), // Required - UnhealthyThreshold: aws.Long(1), // Required - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.ConfigureHealthCheck(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_CreateAppCookieStickinessPolicy() { - svc := elb.New(nil) - - params := &elb.CreateAppCookieStickinessPolicyInput{ - CookieName: aws.String("CookieName"), // Required - LoadBalancerName: aws.String("AccessPointName"), // Required - PolicyName: aws.String("PolicyName"), // Required - } - resp, err := svc.CreateAppCookieStickinessPolicy(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_CreateLBCookieStickinessPolicy() { - svc := elb.New(nil) - - params := &elb.CreateLBCookieStickinessPolicyInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - PolicyName: aws.String("PolicyName"), // Required - CookieExpirationPeriod: aws.Long(1), - } - resp, err := svc.CreateLBCookieStickinessPolicy(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_CreateLoadBalancer() { - svc := elb.New(nil) - - params := &elb.CreateLoadBalancerInput{ - Listeners: []*elb.Listener{ // Required - &elb.Listener{ // Required - InstancePort: aws.Long(1), // Required - LoadBalancerPort: aws.Long(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{ - &elb.Tag{ // Required - Key: aws.String("TagKey"), // Required - Value: aws.String("TagValue"), - }, - // More values... - }, - } - resp, err := svc.CreateLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_CreateLoadBalancerListeners() { - svc := elb.New(nil) - - params := &elb.CreateLoadBalancerListenersInput{ - Listeners: []*elb.Listener{ // Required - &elb.Listener{ // Required - InstancePort: aws.Long(1), // Required - LoadBalancerPort: aws.Long(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 awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_CreateLoadBalancerPolicy() { - svc := elb.New(nil) - - params := &elb.CreateLoadBalancerPolicyInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - PolicyName: aws.String("PolicyName"), // Required - PolicyTypeName: aws.String("PolicyTypeName"), // Required - PolicyAttributes: []*elb.PolicyAttribute{ - &elb.PolicyAttribute{ // Required - AttributeName: aws.String("AttributeName"), - AttributeValue: aws.String("AttributeValue"), - }, - // More values... - }, - } - resp, err := svc.CreateLoadBalancerPolicy(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DeleteLoadBalancer() { - svc := elb.New(nil) - - params := &elb.DeleteLoadBalancerInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.DeleteLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DeleteLoadBalancerListeners() { - svc := elb.New(nil) - - params := &elb.DeleteLoadBalancerListenersInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - LoadBalancerPorts: []*int64{ // Required - aws.Long(1), // Required - // More values... - }, - } - resp, err := svc.DeleteLoadBalancerListeners(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DeleteLoadBalancerPolicy() { - svc := elb.New(nil) - - params := &elb.DeleteLoadBalancerPolicyInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - PolicyName: aws.String("PolicyName"), // Required - } - resp, err := svc.DeleteLoadBalancerPolicy(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DeregisterInstancesFromLoadBalancer() { - svc := elb.New(nil) - - params := &elb.DeregisterInstancesFromLoadBalancerInput{ - Instances: []*elb.Instance{ // Required - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), - }, - // More values... - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.DeregisterInstancesFromLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeInstanceHealth() { - svc := elb.New(nil) - - params := &elb.DescribeInstanceHealthInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - Instances: []*elb.Instance{ - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), - }, - // More values... - }, - } - resp, err := svc.DescribeInstanceHealth(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeLoadBalancerAttributes() { - svc := elb.New(nil) - - params := &elb.DescribeLoadBalancerAttributesInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.DescribeLoadBalancerAttributes(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeLoadBalancerPolicies() { - svc := elb.New(nil) - - params := &elb.DescribeLoadBalancerPoliciesInput{ - LoadBalancerName: aws.String("AccessPointName"), - PolicyNames: []*string{ - aws.String("PolicyName"), // Required - // More values... - }, - } - resp, err := svc.DescribeLoadBalancerPolicies(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeLoadBalancerPolicyTypes() { - svc := elb.New(nil) - - params := &elb.DescribeLoadBalancerPolicyTypesInput{ - PolicyTypeNames: []*string{ - aws.String("PolicyTypeName"), // Required - // More values... - }, - } - resp, err := svc.DescribeLoadBalancerPolicyTypes(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeLoadBalancers() { - svc := elb.New(nil) - - params := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{ - aws.String("AccessPointName"), // Required - // More values... - }, - Marker: aws.String("Marker"), - PageSize: aws.Long(1), - } - resp, err := svc.DescribeLoadBalancers(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DescribeTags() { - svc := elb.New(nil) - - params := &elb.DescribeTagsInput{ - LoadBalancerNames: []*string{ // Required - aws.String("AccessPointName"), // Required - // More values... - }, - } - resp, err := svc.DescribeTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DetachLoadBalancerFromSubnets() { - svc := elb.New(nil) - - params := &elb.DetachLoadBalancerFromSubnetsInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - Subnets: []*string{ // Required - aws.String("SubnetId"), // Required - // More values... - }, - } - resp, err := svc.DetachLoadBalancerFromSubnets(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_DisableAvailabilityZonesForLoadBalancer() { - svc := elb.New(nil) - - params := &elb.DisableAvailabilityZonesForLoadBalancerInput{ - AvailabilityZones: []*string{ // Required - aws.String("AvailabilityZone"), // Required - // More values... - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.DisableAvailabilityZonesForLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_EnableAvailabilityZonesForLoadBalancer() { - svc := elb.New(nil) - - params := &elb.EnableAvailabilityZonesForLoadBalancerInput{ - AvailabilityZones: []*string{ // Required - aws.String("AvailabilityZone"), // Required - // More values... - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.EnableAvailabilityZonesForLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_ModifyLoadBalancerAttributes() { - svc := elb.New(nil) - - params := &elb.ModifyLoadBalancerAttributesInput{ - LoadBalancerAttributes: &elb.LoadBalancerAttributes{ // Required - AccessLog: &elb.AccessLog{ - Enabled: aws.Boolean(true), // Required - EmitInterval: aws.Long(1), - S3BucketName: aws.String("S3BucketName"), - S3BucketPrefix: aws.String("AccessLogPrefix"), - }, - AdditionalAttributes: []*elb.AdditionalAttribute{ - &elb.AdditionalAttribute{ // Required - Key: aws.String("StringVal"), - Value: aws.String("StringVal"), - }, - // More values... - }, - ConnectionDraining: &elb.ConnectionDraining{ - Enabled: aws.Boolean(true), // Required - Timeout: aws.Long(1), - }, - ConnectionSettings: &elb.ConnectionSettings{ - IdleTimeout: aws.Long(1), // Required - }, - CrossZoneLoadBalancing: &elb.CrossZoneLoadBalancing{ - Enabled: aws.Boolean(true), // Required - }, - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.ModifyLoadBalancerAttributes(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_RegisterInstancesWithLoadBalancer() { - svc := elb.New(nil) - - params := &elb.RegisterInstancesWithLoadBalancerInput{ - Instances: []*elb.Instance{ // Required - &elb.Instance{ // Required - InstanceID: aws.String("InstanceId"), - }, - // More values... - }, - LoadBalancerName: aws.String("AccessPointName"), // Required - } - resp, err := svc.RegisterInstancesWithLoadBalancer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_RemoveTags() { - svc := elb.New(nil) - - params := &elb.RemoveTagsInput{ - LoadBalancerNames: []*string{ // Required - aws.String("AccessPointName"), // Required - // More values... - }, - Tags: []*elb.TagKeyOnly{ // Required - &elb.TagKeyOnly{ // Required - Key: aws.String("TagKey"), - }, - // More values... - }, - } - resp, err := svc.RemoveTags(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_SetLoadBalancerListenerSSLCertificate() { - svc := elb.New(nil) - - params := &elb.SetLoadBalancerListenerSSLCertificateInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - LoadBalancerPort: aws.Long(1), // Required - SSLCertificateID: aws.String("SSLCertificateId"), // Required - } - resp, err := svc.SetLoadBalancerListenerSSLCertificate(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_SetLoadBalancerPoliciesForBackendServer() { - svc := elb.New(nil) - - params := &elb.SetLoadBalancerPoliciesForBackendServerInput{ - InstancePort: aws.Long(1), // Required - LoadBalancerName: aws.String("AccessPointName"), // Required - PolicyNames: []*string{ // Required - aws.String("PolicyName"), // Required - // More values... - }, - } - resp, err := svc.SetLoadBalancerPoliciesForBackendServer(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} - -func ExampleELB_SetLoadBalancerPoliciesOfListener() { - svc := elb.New(nil) - - params := &elb.SetLoadBalancerPoliciesOfListenerInput{ - LoadBalancerName: aws.String("AccessPointName"), // Required - LoadBalancerPort: aws.Long(1), // Required - PolicyNames: []*string{ // Required - aws.String("PolicyName"), // Required - // More values... - }, - } - resp, err := svc.SetLoadBalancerPoliciesOfListener(params) - - if awserr := aws.Error(err); awserr != nil { - // A service error occurred. - fmt.Println("Error:", awserr.Code, awserr.Message) - } else if err != nil { - // A non-service error occurred. - panic(err) - } - - // Pretty-print the response data. - fmt.Println(awsutil.StringValue(resp)) -} From 6eea271656a0812885dbcffdaca81b09e9cfe7c2 Mon Sep 17 00:00:00 2001 From: Trevor Pounds Date: Thu, 4 Jun 2015 10:27:24 -0700 Subject: [PATCH 3/3] Guard against non AWS errors. --- pkg/cloudprovider/aws/aws.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index a68cc548d0..44efa5c19e 100644 --- a/pkg/cloudprovider/aws/aws.go +++ b/pkg/cloudprovider/aws/aws.go @@ -1295,7 +1295,7 @@ func (s *AWSCloud) describeLoadBalancer(region, name string) (*elb.LoadBalancerD response, err := elbClient.DescribeLoadBalancers(request) if err != nil { - if awsError := err.(awserr.Error); awsError != nil { + if awsError, ok := err.(awserr.Error); ok { if awsError.Code() == "LoadBalancerNotFound" { return nil, nil }