diff --git a/CHANGELOG.md b/CHANGELOG.md index e01e105db6c..81b315d6323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,22 @@ -# 2.5 (unreleased) +# 2.6.0 (unreleased) + +### New Table Panel +* **table**: New powerful and flexible table panel, closes [#215](https://github.com/grafana/grafana/issues/215) + +### Enhancements +* **CloudWatch**: Support for multiple AWS Credentials, closes [#3053](https://github.com/grafana/grafana/issues/3053), [#3080](https://github.com/grafana/grafana/issues/3080) +* **Elasticsearch**: Support for dynamic daily indices for annotations, closes [#3061](https://github.com/grafana/grafana/issues/3061) +* **Graph Panel**: Option to hide series with all zeroes from legend and tooltip, closes [#1381](https://github.com/grafana/grafana/issues/1381), [#3336](https://github.com/grafana/grafana/issues/3336) + + +### Bug Fixes +* **cloudwatch**: fix for handling of period for long time ranges, fixes [#3086](https://github.com/grafana/grafana/issues/3086) +* **dashboard**: fix for collapse row by clicking on row title, fixes [#3065](https://github.com/grafana/grafana/issues/3065) +* **influxdb**: fix for relative time ranges `last x months` and `last x years`, fixes [#3067](https://github.com/grafana/grafana/issues/3067) +* **graph**: layout fix for color picker when right side legend was enabled, fixes [#3093](https://github.com/grafana/grafana/issues/3093) +* **elasticsearch**: disabling elastic query (via eye) caused error, fixes [#3300](https://github.com/grafana/grafana/issues/3300) + +# 2.5 (2015-10-28) **New Feature: Mix data sources** - A built in data source is now available named `-- Mixed --`, When picked in the metrics tab, @@ -11,12 +29,12 @@ it allows you to add queries of differnet data source types & instances to the s **New Feature: New and much improved time picker** - Support for quick ranges like `Today`, `This day last week`, `This week`, `The day so far`, etc. -- Muck improved UI and improved support for UTC, [Issue #2761](https://github.com/grafana/grafana/issues/2761) for more info. +- Improved UI and improved support for UTC, [Issue #2761](https://github.com/grafana/grafana/issues/2761) for more info. **User Onboarding** - Org admin can now send email invites (or invite links) to people who are not yet Grafana users - Sign up flow now supports email verification (if enabled) -- See [Issue #2353](https://github.com/grafana/grafana/issues/2354) for more info. +- See [Issue #2353](https://github.com/grafana/grafana/issues/2353) for more info. **Other new Features && Enhancements** - [Pull #2720](https://github.com/grafana/grafana/pull/2720). Admin: Initial basic quota support (per Org) @@ -28,6 +46,8 @@ it allows you to add queries of differnet data source types & instances to the s - [Issue #2708](https://github.com/grafana/grafana/issues/2708). InfluxDB: You can now set math expression for select clauses. - [Issue #1575](https://github.com/grafana/grafana/issues/1575). Drilldown link: now you can click on the external link icon in the panel header to access drilldown links! - [Issue #1646](https://github.com/grafana/grafana/issues/1646). OpenTSDB: Fetch list of aggregators from OpenTSDB +- [Issue #2955](https://github.com/grafana/grafana/issues/2955). Graph: More axis units (Length, Volume, Temperature, Pressure, etc), thanks @greglook +- [Issue #2928](https://github.com/grafana/grafana/issues/2928). LDAP: Support for searching for groups memberships, i.e. POSIX (no memberOf) schemas, also multiple ldap servers, and root ca cert, thanks @abligh **Fixes** - [Issue #2413](https://github.com/grafana/grafana/issues/2413). InfluxDB 0.9: Fix for handling empty series object in response from influxdb diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index c3bb723f01a..ee9d78e1470 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,6 +1,6 @@ { "ImportPath": "github.com/grafana/grafana", - "GoVersion": "go1.4.2", + "GoVersion": "go1.5", "Packages": [ "./pkg/..." ], @@ -20,53 +20,63 @@ }, { "ImportPath": "github.com/aws/aws-sdk-go/aws", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/endpoints", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/endpoints", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/ec2query", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/query", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/rest", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/protocol/xml/xmlutil", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { - "ImportPath": "github.com/aws/aws-sdk-go/internal/signer/v4", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/waiter", + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/cloudwatch", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { "ImportPath": "github.com/aws/aws-sdk-go/service/ec2", - "Comment": "v0.7.3", - "Rev": "bed164a424e75154a40550c04c313ef51a7bb275" + "Comment": "v0.10.4-18-gce51895", + "Rev": "ce51895e994693d65ab997ae48032bf13a9290b7" }, { "ImportPath": "github.com/davecgh/go-spew/spew", "Rev": "2df174808ee097f90d259e432cc04442cf60be21" }, + { + "ImportPath": "github.com/go-ini/ini", + "Comment": "v0-48-g060d7da", + "Rev": "060d7da055ba6ec5ea7a31f116332fe5efa04ce0" + }, { "ImportPath": "github.com/go-ldap/ldap", "Comment": "v1-19-g83e6542", @@ -90,6 +100,11 @@ "ImportPath": "github.com/gosimple/slug", "Rev": "8d258463b4459f161f51d6a357edacd3eef9d663" }, + { + "ImportPath": "github.com/jmespath/go-jmespath", + "Comment": "0.2.2", + "Rev": "3433f3ea46d9f8019119e7dd41274e112a2359a9" + }, { "ImportPath": "github.com/jtolds/gls", "Rev": "f1ac7f4f24f50328e6bc838ca4437d1612a0243c" @@ -124,10 +139,6 @@ "ImportPath": "github.com/streadway/amqp", "Rev": "150b7f24d6ad507e6026c13d85ce1f1391ac7400" }, - { - "ImportPath": "github.com/vaughan0/go-ini", - "Rev": "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1" - }, { "ImportPath": "golang.org/x/net/context", "Rev": "972f0c5fbe4ae29e666c3f78c3ed42ae7a448b0a" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go index 418fc4c14b4..003a6e8067e 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -113,7 +113,7 @@ func newRequestError(err Error, statusCode int, requestID string) *requestError // Error returns the string representation of the error. // Satisfies the error interface. func (r requestError) Error() string { - extra := fmt.Sprintf("status code: %d, request id: [%s]", + extra := fmt.Sprintf("status code: %d, request id: %s", r.statusCode, r.requestID) return SprintError(r.Code(), r.Message(), extra, r.OrigErr()) } 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 index f91743c6e1d..8429470b9d7 100644 --- 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 @@ -57,16 +57,13 @@ func rcopy(dst, src reflect.Value, root bool) { } } 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) + srcVal := src.FieldByName(name) + dstVal := dst.FieldByName(name) + if srcVal.IsValid() && dstVal.CanSet() { + rcopy(dstVal, srcVal, false) } } case reflect.Slice: diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go index 4f26241a2b8..84b7e3f34aa 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go @@ -77,6 +77,28 @@ func TestCopy(t *testing.T) { assert.NotEqual(t, f2.C, f1.C) } +func TestCopyNestedWithUnexported(t *testing.T) { + type Bar struct { + a int + B int + } + type Foo struct { + A string + B Bar + } + + f1 := &Foo{A: "string", B: Bar{a: 1, B: 2}} + + var f2 Foo + awsutil.Copy(&f2, f1) + + // Values match + assert.Equal(t, f2.A, f1.A) + assert.NotEqual(t, f2.B, f1.B) + assert.NotEqual(t, f2.B.a, f1.B.a) + assert.Equal(t, f2.B.B, f2.B.B) +} + func TestCopyIgnoreNilMembers(t *testing.T) { type Foo struct { A *string @@ -136,6 +158,8 @@ func TestCopyDifferentStructs(t *testing.T) { C map[string]*int SrcUnique string SameNameDiffType int + unexportedPtr *int + ExportedPtr *int } type DstFoo struct { A int @@ -143,6 +167,8 @@ func TestCopyDifferentStructs(t *testing.T) { C map[string]*int DstUnique int SameNameDiffType string + unexportedPtr *int + ExportedPtr *int } // Create the initial value @@ -159,6 +185,8 @@ func TestCopyDifferentStructs(t *testing.T) { }, SrcUnique: "unique", SameNameDiffType: 1, + unexportedPtr: &int1, + ExportedPtr: &int2, } // Do the copy @@ -173,6 +201,10 @@ func TestCopyDifferentStructs(t *testing.T) { assert.Equal(t, 1, f1.SameNameDiffType) assert.Equal(t, 0, f2.DstUnique) assert.Equal(t, "", f2.SameNameDiffType) + assert.Equal(t, int1, *f1.unexportedPtr) + assert.Nil(t, f2.unexportedPtr) + assert.Equal(t, int2, *f1.ExportedPtr) + assert.Equal(t, int2, *f2.ExportedPtr) } func ExampleCopyOf() { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go new file mode 100644 index 00000000000..59fa4a558a9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal.go @@ -0,0 +1,27 @@ +package awsutil + +import ( + "reflect" +) + +// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. +// In addition to this, this method will also dereference the input values if +// possible so the DeepEqual performed will not fail if one parameter is a +// pointer and the other is not. +// +// DeepEqual will not perform indirection of nested values of the input parameters. +func DeepEqual(a, b interface{}) bool { + ra := reflect.Indirect(reflect.ValueOf(a)) + rb := reflect.Indirect(reflect.ValueOf(b)) + + if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { + // If the elements are both nil, and of the same type the are equal + // If they are of different types they are not equal + return reflect.TypeOf(a) == reflect.TypeOf(b) + } else if raValid != rbValid { + // Both values must be valid to be equal + return false + } + + return reflect.DeepEqual(ra.Interface(), rb.Interface()) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go new file mode 100644 index 00000000000..7a5db6e49bc --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go @@ -0,0 +1,29 @@ +package awsutil_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/stretchr/testify/assert" +) + +func TestDeepEqual(t *testing.T) { + cases := []struct { + a, b interface{} + equal bool + }{ + {"a", "a", true}, + {"a", "b", false}, + {"a", aws.String(""), false}, + {"a", nil, false}, + {"a", aws.String("a"), true}, + {(*bool)(nil), (*bool)(nil), true}, + {(*bool)(nil), (*string)(nil), false}, + {nil, nil, true}, + } + + for i, c := range cases { + assert.Equal(t, c.equal, awsutil.DeepEqual(c.a, c.b), "%d, a:%v b:%v, %t", i, c.a, c.b, c.equal) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 905d82385ec..8c0dc2d8d24 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -5,6 +5,8 @@ import ( "regexp" "strconv" "strings" + + "github.com/jmespath/go-jmespath" ) var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) @@ -16,7 +18,7 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) if len(pathparts) > 1 { for _, pathpart := range pathparts { vals := rValuesAtPath(v, pathpart, create, caseSensitive) - if vals != nil && len(vals) > 0 { + if len(vals) > 0 { return vals } } @@ -142,46 +144,67 @@ func rValuesAtPath(v interface{}, path string, create bool, caseSensitive bool) return values } -// 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, true); rvals != nil { - vals := make([]interface{}, len(rvals)) - for i, rval := range rvals { - vals[i] = rval.Interface() - } - return vals +// ValuesAtPath returns a list of values at the case insensitive lexical +// path inside of a structure. +func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { + result, err := jmespath.Search(path, i) + if err != nil { + return nil, err } - return nil + + v := reflect.ValueOf(result) + if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) { + return nil, nil + } + if s, ok := result.([]interface{}); ok { + return s, err + } + if v.Kind() == reflect.Map && v.Len() == 0 { + return nil, nil + } + if v.Kind() == reflect.Slice { + out := make([]interface{}, v.Len()) + for i := 0; i < v.Len(); i++ { + out[i] = v.Index(i).Interface() + } + return out, nil + } + + return []interface{}{result}, 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() - } - return vals - } - return nil -} - -// SetValueAtPath sets an object at the lexical path inside of a structure +// SetValueAtPath sets a value at the case insensitive lexical path inside +// of a structure. func SetValueAtPath(i interface{}, path string, v interface{}) { - 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)) + setValue(rval, v) } } } + +func setValue(dstVal reflect.Value, src interface{}) { + if dstVal.Kind() == reflect.Ptr { + dstVal = reflect.Indirect(dstVal) + } + srcVal := reflect.ValueOf(src) + + if !srcVal.IsValid() { // src is literal nil + if dstVal.CanAddr() { + // Convert to pointer so that pointer's value can be nil'ed + // dstVal = dstVal.Addr() + } + dstVal.Set(reflect.Zero(dstVal.Type())) + + } else if srcVal.Kind() == reflect.Ptr { + if srcVal.IsNil() { + srcVal = reflect.Zero(dstVal.Type()) + } else { + srcVal = reflect.ValueOf(src).Elem() + } + dstVal.Set(srcVal) + } else { + dstVal.Set(srcVal) + } + +} diff --git a/Godeps/_workspace/src/github.com/aws/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 index 0da6b06fddc..378a4864848 100644 --- a/Godeps/_workspace/src/github.com/aws/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 @@ -13,6 +13,7 @@ type Struct struct { B *Struct D *Struct C string + E map[string]string } var data = Struct{ @@ -21,30 +22,69 @@ var data = Struct{ B: &Struct{B: &Struct{C: "terminal"}, D: &Struct{C: "terminal2"}}, C: "initial", } +var data2 = Struct{A: []Struct{ + {A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}}, + {A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}}, +}} func TestValueAtPathSuccess(t *testing.T) { - assert.Equal(t, []interface{}{"initial"}, awsutil.ValuesAtPath(data, "C")) - 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")) - assert.Equal(t, []interface{}{"terminal", "terminal2"}, awsutil.ValuesAtPath(data, "B.*.C")) - assert.Equal(t, []interface{}{"initial"}, awsutil.ValuesAtPath(data, "A.D.X || C")) + var testCases = []struct { + expect []interface{} + data interface{} + path string + }{ + {[]interface{}{"initial"}, data, "C"}, + {[]interface{}{"value1"}, data, "A[0].C"}, + {[]interface{}{"value2"}, data, "A[1].C"}, + {[]interface{}{"value3"}, data, "A[2].C"}, + {[]interface{}{"value3"}, data, "a[2].c"}, + {[]interface{}{"value3"}, data, "A[-1].C"}, + {[]interface{}{"value1", "value2", "value3"}, data, "A[].C"}, + {[]interface{}{"terminal"}, data, "B . B . C"}, + {[]interface{}{"initial"}, data, "A.D.X || C"}, + {[]interface{}{"initial"}, data, "A[0].B || C"}, + {[]interface{}{ + Struct{A: []Struct{{C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}, {C: "1"}}}, + Struct{A: []Struct{{C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}, {C: "2"}}}, + }, data2, "A"}, + } + for i, c := range testCases { + v, err := awsutil.ValuesAtPath(c.data, c.path) + assert.NoError(t, err, "case %d, expected no error, %s", i, c.path) + assert.Equal(t, c.expect, v, "case %d, %s", i, c.path) + } } func TestValueAtPathFailure(t *testing.T) { - assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, "C.x")) - assert.Equal(t, []interface{}(nil), awsutil.ValuesAtPath(data, ".x")) - assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(data, "X.Y.Z")) - 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, "z[-1].C")) - assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(nil, "A.B.C")) - assert.Equal(t, []interface{}{}, awsutil.ValuesAtPath(Struct{}, "A")) + var testCases = []struct { + expect []interface{} + errContains string + data interface{} + path string + }{ + {nil, "", data, "C.x"}, + {nil, "SyntaxError: Invalid token: tDot", data, ".x"}, + {nil, "", data, "X.Y.Z"}, + {nil, "", data, "A[100].C"}, + {nil, "", data, "A[3].C"}, + {nil, "", data, "B.B.C.Z"}, + {nil, "", data, "z[-1].C"}, + {nil, "", nil, "A.B.C"}, + {[]interface{}{}, "", Struct{}, "A"}, + {nil, "", data, "A[0].B.C"}, + {nil, "", data, "D"}, + } + + for i, c := range testCases { + v, err := awsutil.ValuesAtPath(c.data, c.path) + if c.errContains != "" { + assert.Contains(t, err.Error(), c.errContains, "case %d, expected error, %s", i, c.path) + continue + } else { + assert.NoError(t, err, "case %d, expected no error, %s", i, c.path) + } + assert.Equal(t, c.expect, v, "case %d, %s", i, c.path) + } } func TestSetValueAtPathSuccess(t *testing.T) { @@ -61,8 +101,8 @@ func TestSetValueAtPathSuccess(t *testing.T) { assert.Equal(t, "test0", s.B.D.C) var s2 Struct - awsutil.SetValueAtAnyPath(&s2, "b.b.c", "test0") + awsutil.SetValueAtPath(&s2, "b.b.c", "test0") assert.Equal(t, "test0", s2.B.B.C) - awsutil.SetValueAtAnyPath(&s2, "A", []Struct{{}}) + awsutil.SetValueAtPath(&s2, "A", []Struct{{}}) assert.Equal(t, []Struct{{}}, s2.A) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go new file mode 100644 index 00000000000..b6432f1a118 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go @@ -0,0 +1,89 @@ +package awsutil + +import ( + "bytes" + "fmt" + "reflect" + "strings" +) + +// StringValue returns the string representation of a value. +func StringValue(i interface{}) string { + var buf bytes.Buffer + stringValue(reflect.ValueOf(i), 0, &buf) + return buf.String() +} + +func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { + for v.Kind() == reflect.Ptr { + v = v.Elem() + } + + switch v.Kind() { + case reflect.Struct: + buf.WriteString("{\n") + + names := []string{} + for i := 0; i < v.Type().NumField(); i++ { + name := v.Type().Field(i).Name + f := v.Field(i) + if name[0:1] == strings.ToLower(name[0:1]) { + continue // ignore unexported fields + } + if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() { + continue // ignore unset fields + } + names = append(names, name) + } + + for i, n := range names { + val := v.FieldByName(n) + buf.WriteString(strings.Repeat(" ", indent+2)) + buf.WriteString(n + ": ") + stringValue(val, indent+2, buf) + + if i < len(names)-1 { + buf.WriteString(",\n") + } + } + + buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") + case reflect.Slice: + nl, id, id2 := "", "", "" + if v.Len() > 3 { + nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) + } + buf.WriteString("[" + nl) + for i := 0; i < v.Len(); i++ { + buf.WriteString(id2) + stringValue(v.Index(i), indent+2, buf) + + if i < v.Len()-1 { + buf.WriteString("," + nl) + } + } + + buf.WriteString(nl + id + "]") + case reflect.Map: + buf.WriteString("{\n") + + for i, k := range v.MapKeys() { + buf.WriteString(strings.Repeat(" ", indent+2)) + buf.WriteString(k.String() + ": ") + stringValue(v.MapIndex(k), indent+2, buf) + + if i < v.Len()-1 { + buf.WriteString(",\n") + } + } + + buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") + default: + format := "%v" + switch v.Interface().(type) { + case string: + format = "%q" + } + fmt.Fprintf(buf, format, v.Interface()) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go new file mode 100644 index 00000000000..63ab805b9c4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/client.go @@ -0,0 +1,111 @@ +package client + +import ( + "fmt" + "io/ioutil" + "net/http/httputil" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" +) + +// A Config provides configuration to a service client instance. +type Config struct { + Config *aws.Config + Handlers request.Handlers + Endpoint, SigningRegion string +} + +// ConfigProvider provides a generic way for a service client to receive +// the ClientConfig without circular dependencies. +type ConfigProvider interface { + ClientConfig(serviceName string, cfgs ...*aws.Config) Config +} + +// A Client implements the base client request and response handling +// used by all service clients. +type Client struct { + request.Retryer + metadata.ClientInfo + + Config aws.Config + Handlers request.Handlers +} + +// New will return a pointer to a new initialized service client. +func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client { + svc := &Client{ + Config: cfg, + ClientInfo: info, + Handlers: handlers, + } + + maxRetries := aws.IntValue(cfg.MaxRetries) + if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { + maxRetries = 3 + } + svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} + + svc.AddDebugHandlers() + + for _, option := range options { + option(svc) + } + + return svc +} + +// NewRequest returns a new Request pointer for the service API +// operation and parameters. +func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request { + return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data) +} + +// AddDebugHandlers injects debug logging handlers into the service to log request +// debug information. +func (c *Client) AddDebugHandlers() { + if !c.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + + c.Handlers.Send.PushFront(logRequest) + c.Handlers.Send.PushBack(logResponse) +} + +const logReqMsg = `DEBUG: Request %s/%s Details: +---[ REQUEST POST-SIGN ]----------------------------- +%s +-----------------------------------------------------` + +func logRequest(r *request.Request) { + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody) + + if logBody { + // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's + // Body as a NoOpCloser and will not be reset after read by the HTTP + // client reader. + r.Body.Seek(r.BodyStart, 0) + r.HTTPRequest.Body = ioutil.NopCloser(r.Body) + } + + r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody))) +} + +const logRespMsg = `DEBUG: Response %s/%s Details: +---[ RESPONSE ]-------------------------------------- +%s +-----------------------------------------------------` + +func logResponse(r *request.Request) { + var msg = "no reponse data" + if r.HTTPResponse != nil { + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody) + msg = string(dumpedBody) + } else if r.Error != nil { + msg = r.Error.Error() + } + r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg)) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go new file mode 100644 index 00000000000..24d39ce5641 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/default_retryer.go @@ -0,0 +1,45 @@ +package client + +import ( + "math" + "math/rand" + "time" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// DefaultRetryer implements basic retry logic using exponential backoff for +// most services. If you want to implement custom retry logic, implement the +// request.Retryer interface or create a structure type that composes this +// struct and override the specific methods. For example, to override only +// the MaxRetries method: +// +// type retryer struct { +// service.DefaultRetryer +// } +// +// // This implementation always has 100 max retries +// func (d retryer) MaxRetries() uint { return 100 } +type DefaultRetryer struct { + NumMaxRetries int +} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API request. +func (d DefaultRetryer) MaxRetries() int { + return d.NumMaxRetries +} + +// RetryRules returns the delay duration before retrying this request again +func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { + delay := int(math.Pow(2, float64(r.RetryCount))) * (rand.Intn(30) + 30) + return time.Duration(delay) * time.Millisecond +} + +// ShouldRetry returns if the request should be retried. +func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { + if r.HTTPResponse.StatusCode >= 500 { + return true + } + return r.IsErrorRetryable() +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go new file mode 100644 index 00000000000..4778056ddfd --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go @@ -0,0 +1,12 @@ +package metadata + +// ClientInfo wraps immutable data from the client.Client structure. +type ClientInfo struct { + ServiceName string + APIVersion string + Endpoint string + SigningName string + SigningRegion string + JSONVersion string + TargetPrefix string +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go index c27bdd3c106..f157f8b3b5a 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config.go @@ -2,48 +2,22 @@ package aws import ( "net/http" - "os" "time" "github.com/aws/aws-sdk-go/aws/credentials" ) -// DefaultChainCredentials is a Credentials which will find the first available -// credentials Value from the list of Providers. -// -// This should be used in the default case. Once the type of credentials are -// known switching to the specific Credentials will be more efficient. -var DefaultChainCredentials = credentials.NewChainCredentials( - []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - &credentials.EC2RoleProvider{ExpiryWindow: 5 * time.Minute}, - }) - -// The default number of retries for a service. The value of -1 indicates that -// the service specific retry default will be used. -const DefaultRetries = -1 - -// DefaultConfig is the default all service configuration will be based off of. -// By default, all clients use this structure for initialization options unless -// a custom configuration object is passed in. -// -// You may modify this global structure to change all default configuration -// in the SDK. Note that configuration options are copied by value, so any -// modifications must happen before constructing a client. -var DefaultConfig = NewConfig(). - WithCredentials(DefaultChainCredentials). - WithRegion(os.Getenv("AWS_REGION")). - WithHTTPClient(http.DefaultClient). - WithMaxRetries(DefaultRetries). - WithLogger(NewDefaultLogger()). - WithLogLevel(LogOff) +// UseServiceDefaultRetries instructs the config to use the service's own default +// number of retries. This will be the default action if Config.MaxRetries +// is nil also. +const UseServiceDefaultRetries = -1 // A Config provides service configuration for service clients. By default, -// all clients will use the {DefaultConfig} structure. +// all clients will use the {defaults.DefaultConfig} structure. type Config struct { // The credentials object to use when signing requests. Defaults to - // {DefaultChainCredentials}. + // a chain of credential providers to search for credentials in environment + // variables, shared credential file, and EC2 Instance Roles. Credentials *credentials.Credentials // An optional endpoint URL (hostname only or fully qualified URI) @@ -102,6 +76,8 @@ type Config struct { // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html // Amazon S3: Virtual Hosting of Buckets S3ForcePathStyle *bool + + SleepDelay func(time.Duration) } // NewConfig returns a new Config pointer that can be chained with builder methods to @@ -190,15 +166,24 @@ func (c *Config) WithS3ForcePathStyle(force bool) *Config { return c } -// Merge returns a new Config with the other Config's attribute values merged into -// this Config. If the other Config's attribute is nil it will not be merged into -// the new Config to be returned. -func (c Config) Merge(other *Config) *Config { - if other == nil { - return &c - } +// WithSleepDelay overrides the function used to sleep while waiting for the +// next retry. Defaults to time.Sleep. +func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { + c.SleepDelay = fn + return c +} - dst := c +// MergeIn merges the passed in configs into the existing config object. +func (c *Config) MergeIn(cfgs ...*Config) { + for _, other := range cfgs { + mergeInConfig(c, other) + } +} + +func mergeInConfig(dst *Config, other *Config) { + if other == nil { + return + } if other.Credentials != nil { dst.Credentials = other.Credentials @@ -244,11 +229,20 @@ func (c Config) Merge(other *Config) *Config { dst.S3ForcePathStyle = other.S3ForcePathStyle } - return &dst + if other.SleepDelay != nil { + dst.SleepDelay = other.SleepDelay + } } -// Copy will return a shallow copy of the Config object. -func (c Config) Copy() *Config { - dst := c - return &dst +// Copy will return a shallow copy of the Config object. If any additional +// configurations are provided they will be merged into the new config returned. +func (c *Config) Copy(cfgs ...*Config) *Config { + dst := &Config{} + dst.MergeIn(c) + + for _, cfg := range cfgs { + dst.MergeIn(cfg) + } + + return dst } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go index ddf3f39764d..fe97a31fc76 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/config_test.go @@ -4,18 +4,11 @@ import ( "net/http" "reflect" "testing" - "time" "github.com/aws/aws-sdk-go/aws/credentials" ) -var testCredentials = credentials.NewChainCredentials([]credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{ - Filename: "TestFilename", - Profile: "TestProfile"}, - &credentials.EC2RoleProvider{ExpiryWindow: 5 * time.Minute}, -}) +var testCredentials = credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") var copyTestConfig = Config{ Credentials: testCredentials, @@ -25,7 +18,7 @@ var copyTestConfig = Config{ HTTPClient: http.DefaultClient, LogLevel: LogLevel(LogDebug), Logger: NewDefaultLogger(), - MaxRetries: Int(DefaultRetries), + MaxRetries: Int(3), DisableParamValidation: Bool(true), DisableComputeChecksums: Bool(true), S3ForcePathStyle: Bool(true), @@ -38,6 +31,11 @@ func TestCopy(t *testing.T) { t.Errorf("Copy() = %+v", got) t.Errorf(" want %+v", want) } + + got.Region = String("other") + if got.Region == want.Region { + t.Errorf("Expect setting copy values not not reflect in source") + } } func TestCopyReturnsNewInstance(t *testing.T) { @@ -76,7 +74,8 @@ var mergeTests = []struct { func TestMerge(t *testing.T) { for i, tt := range mergeTests { - got := tt.cfg.Merge(tt.in) + got := tt.cfg.Copy() + got.MergeIn(tt.in) if !reflect.DeepEqual(got, tt.want) { t.Errorf("Config %d %+v", i, tt.cfg) t.Errorf(" Merge(%+v)", tt.in) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convutil.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types.go similarity index 100% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convutil.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types.go diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convutil_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go similarity index 89% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convutil_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go index 6d06cd30f0a..df7a3e5d2de 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convutil_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/convert_types_test.go @@ -1,10 +1,9 @@ -package aws_test +package aws import ( "testing" "time" - "github.com/aws/aws-sdk-go/aws" "github.com/stretchr/testify/assert" ) @@ -18,20 +17,20 @@ func TestStringSlice(t *testing.T) { if in == nil { continue } - out := aws.StringSlice(in) + out := StringSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.StringValueSlice(out) + out2 := StringValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } } var testCasesStringValueSlice = [][]*string{ - {aws.String("a"), aws.String("b"), nil, aws.String("c")}, + {String("a"), String("b"), nil, String("c")}, } func TestStringValueSlice(t *testing.T) { @@ -39,7 +38,7 @@ func TestStringValueSlice(t *testing.T) { if in == nil { continue } - out := aws.StringValueSlice(in) + out := StringValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -49,7 +48,7 @@ func TestStringValueSlice(t *testing.T) { } } - out2 := aws.StringSlice(out) + out2 := StringSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -70,13 +69,13 @@ func TestStringMap(t *testing.T) { if in == nil { continue } - out := aws.StringMap(in) + out := StringMap(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.StringValueMap(out) + out2 := StringValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -91,13 +90,13 @@ func TestBoolSlice(t *testing.T) { if in == nil { continue } - out := aws.BoolSlice(in) + out := BoolSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.BoolValueSlice(out) + out2 := BoolValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -110,7 +109,7 @@ func TestBoolValueSlice(t *testing.T) { if in == nil { continue } - out := aws.BoolValueSlice(in) + out := BoolValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -120,7 +119,7 @@ func TestBoolValueSlice(t *testing.T) { } } - out2 := aws.BoolSlice(out) + out2 := BoolSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -141,13 +140,13 @@ func TestBoolMap(t *testing.T) { if in == nil { continue } - out := aws.BoolMap(in) + out := BoolMap(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.BoolValueMap(out) + out2 := BoolValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -162,13 +161,13 @@ func TestIntSlice(t *testing.T) { if in == nil { continue } - out := aws.IntSlice(in) + out := IntSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.IntValueSlice(out) + out2 := IntValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -181,7 +180,7 @@ func TestIntValueSlice(t *testing.T) { if in == nil { continue } - out := aws.IntValueSlice(in) + out := IntValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -191,7 +190,7 @@ func TestIntValueSlice(t *testing.T) { } } - out2 := aws.IntSlice(out) + out2 := IntSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -212,13 +211,13 @@ func TestIntMap(t *testing.T) { if in == nil { continue } - out := aws.IntMap(in) + out := IntMap(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.IntValueMap(out) + out2 := IntValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -233,13 +232,13 @@ func TestInt64Slice(t *testing.T) { if in == nil { continue } - out := aws.Int64Slice(in) + out := Int64Slice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.Int64ValueSlice(out) + out2 := Int64ValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -252,7 +251,7 @@ func TestInt64ValueSlice(t *testing.T) { if in == nil { continue } - out := aws.Int64ValueSlice(in) + out := Int64ValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -262,7 +261,7 @@ func TestInt64ValueSlice(t *testing.T) { } } - out2 := aws.Int64Slice(out) + out2 := Int64Slice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -283,13 +282,13 @@ func TestInt64Map(t *testing.T) { if in == nil { continue } - out := aws.Int64Map(in) + out := Int64Map(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.Int64ValueMap(out) + out2 := Int64ValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -304,13 +303,13 @@ func TestFloat64Slice(t *testing.T) { if in == nil { continue } - out := aws.Float64Slice(in) + out := Float64Slice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.Float64ValueSlice(out) + out2 := Float64ValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -323,7 +322,7 @@ func TestFloat64ValueSlice(t *testing.T) { if in == nil { continue } - out := aws.Float64ValueSlice(in) + out := Float64ValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -333,7 +332,7 @@ func TestFloat64ValueSlice(t *testing.T) { } } - out2 := aws.Float64Slice(out) + out2 := Float64Slice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -354,13 +353,13 @@ func TestFloat64Map(t *testing.T) { if in == nil { continue } - out := aws.Float64Map(in) + out := Float64Map(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.Float64ValueMap(out) + out2 := Float64ValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -375,13 +374,13 @@ func TestTimeSlice(t *testing.T) { if in == nil { continue } - out := aws.TimeSlice(in) + out := TimeSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.TimeValueSlice(out) + out2 := TimeValueSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } @@ -394,7 +393,7 @@ func TestTimeValueSlice(t *testing.T) { if in == nil { continue } - out := aws.TimeValueSlice(in) + out := TimeValueSlice(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { if in[i] == nil { @@ -404,7 +403,7 @@ func TestTimeValueSlice(t *testing.T) { } } - out2 := aws.TimeSlice(out) + out2 := TimeSlice(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) for i := range out2 { if in[i] == nil { @@ -425,13 +424,13 @@ func TestTimeMap(t *testing.T) { if in == nil { continue } - out := aws.TimeMap(in) + out := TimeMap(in) assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) for i := range out { assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) } - out2 := aws.TimeValueMap(out) + out2 := TimeValueMap(out) assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go similarity index 60% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index 45ae8807359..1d3e656fd68 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -1,4 +1,4 @@ -package aws +package corehandlers import ( "bytes" @@ -8,25 +8,23 @@ import ( "net/http" "net/url" "regexp" + "runtime" "strconv" - "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" ) -var sleepDelay = func(delay time.Duration) { - time.Sleep(delay) -} - // Interface for matching types which also have a Len method. type lener interface { Len() int } -// BuildContentLength builds the content length of a request based on the body, +// BuildContentLengthHandler builds the content length of a request based on the body, // or will use the HTTPRequest.Header's "Content-Length" if defined. If unable // to determine request body length and no "Content-Length" was specified it will panic. -func BuildContentLength(r *Request) { +var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) { if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { length, _ := strconv.ParseInt(slength, 10, 64) r.HTTPRequest.ContentLength = length @@ -40,36 +38,38 @@ func BuildContentLength(r *Request) { case lener: length = int64(body.Len()) case io.Seeker: - r.bodyStart, _ = body.Seek(0, 1) + r.BodyStart, _ = body.Seek(0, 1) end, _ := body.Seek(0, 2) - body.Seek(r.bodyStart, 0) // make sure to seek back to original location - length = end - r.bodyStart + body.Seek(r.BodyStart, 0) // make sure to seek back to original location + length = end - r.BodyStart default: panic("Cannot get length of body, must provide `ContentLength`") } r.HTTPRequest.ContentLength = length r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) +}} + +// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent. +var SDKVersionUserAgentHandler = request.NamedHandler{ + Name: "core.SDKVersionUserAgentHandler", + Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, + runtime.Version(), runtime.GOOS, runtime.GOARCH), } -// UserAgentHandler is a request handler for injecting User agent into requests. -func UserAgentHandler(r *Request) { - r.HTTPRequest.Header.Set("User-Agent", SDKName+"/"+SDKVersion) -} - -var reStatusCode = regexp.MustCompile(`^(\d+)`) +var reStatusCode = regexp.MustCompile(`^(\d{3})`) // SendHandler is a request handler to send service request using HTTP client. -func SendHandler(r *Request) { +var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *request.Request) { var err error - r.HTTPResponse, err = r.Service.Config.HTTPClient.Do(r.HTTPRequest) + r.HTTPResponse, err = r.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 { + if e, ok := err.(*url.Error); ok && e.Err != nil { + if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { code, _ := strconv.ParseInt(s[1], 10, 64) r.HTTPResponse = &http.Response{ StatusCode: int(code), @@ -79,7 +79,7 @@ func SendHandler(r *Request) { return } } - if r.HTTPRequest == nil { + if r.HTTPResponse == nil { // Add a dummy request response object to ensure the HTTPResponse // value is consistent. r.HTTPResponse = &http.Response{ @@ -90,68 +90,50 @@ func SendHandler(r *Request) { } // Catch all other request errors. r.Error = awserr.New("RequestError", "send request failed", err) - r.Retryable = Bool(true) // network errors are retryable + r.Retryable = aws.Bool(true) // network errors are retryable } -} +}} // ValidateResponseHandler is a request handler to validate service response. -func ValidateResponseHandler(r *Request) { +var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { // this may be replaced by an UnmarshalError handler r.Error = awserr.New("UnknownError", "unknown error", nil) } -} +}} // AfterRetryHandler performs final checks to determine if the request should // be retried and how long to delay. -func AfterRetryHandler(r *Request) { +var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) { // If one of the other handlers already set the retry state // we don't want to override it based on the service's state if r.Retryable == nil { - r.Retryable = Bool(r.Service.ShouldRetry(r)) + r.Retryable = aws.Bool(r.ShouldRetry(r)) } if r.WillRetry() { - r.RetryDelay = r.Service.RetryRules(r) - sleepDelay(r.RetryDelay) + r.RetryDelay = r.RetryRules(r) + r.Config.SleepDelay(r.RetryDelay) // 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 r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - if isCodeExpiredCreds(err.Code()) { - r.Config.Credentials.Expire() - } - } + if r.IsErrorExpired() { + r.Config.Credentials.Expire() } r.RetryCount++ r.Error = nil } -} - -var ( - // ErrMissingRegion is an error that is returned if region configuration is - // not found. - // - // @readonly - ErrMissingRegion error = awserr.New("MissingRegion", "could not find region configuration", nil) - - // ErrMissingEndpoint is an error that is returned if an endpoint cannot be - // resolved for a service. - // - // @readonly - ErrMissingEndpoint error = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) -) +}} // ValidateEndpointHandler is a request handler to validate a request had the // appropriate Region and Endpoint set. Will set r.Error if the endpoint or // region is not valid. -func ValidateEndpointHandler(r *Request) { - if r.Service.SigningRegion == "" && StringValue(r.Service.Config.Region) == "" { - r.Error = ErrMissingRegion - } else if r.Service.Endpoint == "" { - r.Error = ErrMissingEndpoint +var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) { + if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" { + r.Error = aws.ErrMissingRegion + } else if r.ClientInfo.Endpoint == "" { + r.Error = aws.ErrMissingEndpoint } -} +}} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go new file mode 100644 index 00000000000..632ea8d4ea1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go @@ -0,0 +1,113 @@ +package corehandlers_test + +import ( + "fmt" + "net/http" + "os" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting" +) + +func TestValidateEndpointHandler(t *testing.T) { + os.Clearenv() + + svc := awstesting.NewClient(aws.NewConfig().WithRegion("us-west-2")) + svc.Handlers.Clear() + svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + err := req.Build() + + assert.NoError(t, err) +} + +func TestValidateEndpointHandlerErrorRegion(t *testing.T) { + os.Clearenv() + + svc := awstesting.NewClient() + svc.Handlers.Clear() + svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + err := req.Build() + + assert.Error(t, err) + assert.Equal(t, aws.ErrMissingRegion, err) +} + +type mockCredsProvider struct { + expired bool + retrieveCalled bool +} + +func (m *mockCredsProvider) Retrieve() (credentials.Value, error) { + m.retrieveCalled = true + return credentials.Value{}, nil +} + +func (m *mockCredsProvider) IsExpired() bool { + return m.expired +} + +func TestAfterRetryRefreshCreds(t *testing.T) { + os.Clearenv() + credProvider := &mockCredsProvider{} + + svc := awstesting.NewClient(&aws.Config{ + Credentials: credentials.NewCredentials(credProvider), + MaxRetries: aws.Int(1), + }) + + svc.Handlers.Clear() + svc.Handlers.ValidateResponse.PushBack(func(r *request.Request) { + r.Error = awserr.New("UnknownError", "", nil) + r.HTTPResponse = &http.Response{StatusCode: 400} + }) + svc.Handlers.UnmarshalError.PushBack(func(r *request.Request) { + r.Error = awserr.New("ExpiredTokenException", "", nil) + }) + svc.Handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) + + assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired") + assert.False(t, credProvider.retrieveCalled) + + req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + req.Send() + + assert.True(t, svc.Config.Credentials.IsExpired()) + assert.False(t, credProvider.retrieveCalled) + + _, err := svc.Config.Credentials.Get() + assert.NoError(t, err) + assert.True(t, credProvider.retrieveCalled) +} + +type testSendHandlerTransport struct{} + +func (t *testSendHandlerTransport) RoundTrip(r *http.Request) (*http.Response, error) { + return nil, fmt.Errorf("mock error") +} + +func TestSendHandlerError(t *testing.T) { + svc := awstesting.NewClient(&aws.Config{ + HTTPClient: &http.Client{ + Transport: &testSendHandlerTransport{}, + }, + }) + svc.Handlers.Clear() + svc.Handlers.Send.PushBackNamed(corehandlers.SendHandler) + r := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) + + r.Send() + + assert.Error(t, r.Error) + assert.NotNil(t, r.HTTPResponse) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go new file mode 100644 index 00000000000..3b53f5e026a --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go @@ -0,0 +1,144 @@ +package corehandlers + +import ( + "fmt" + "reflect" + "strconv" + "strings" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// ValidateParametersHandler is a request handler to validate the input parameters. +// Validating parameters only has meaning if done prior to the request being sent. +var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { + if r.ParamsFilled() { + v := validator{errors: []string{}} + v.validateAny(reflect.ValueOf(r.Params), "") + + 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 = awserr.New("InvalidParameter", msg, nil) + } + } +}} + +// A validator validates values. Collects validations errors which occurs. +type validator struct { + errors []string +} + +// validateAny will validate any struct, slice or map type. All validations +// are also performed recursively for nested types. +func (v *validator) validateAny(value reflect.Value, path string) { + value = reflect.Indirect(value) + if !value.IsValid() { + return + } + + switch value.Kind() { + case reflect.Struct: + v.validateStruct(value, path) + case reflect.Slice: + for i := 0; i < value.Len(); i++ { + v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i)) + } + case reflect.Map: + for _, n := range value.MapKeys() { + v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String())) + } + } +} + +// validateStruct will validate the struct value's fields. If the structure has +// nested types those types will be validated also. +func (v *validator) validateStruct(value reflect.Value, path string) { + prefix := "." + if path == "" { + prefix = "" + } + + for i := 0; i < value.Type().NumField(); i++ { + f := value.Type().Field(i) + if strings.ToLower(f.Name[0:1]) == f.Name[0:1] { + continue + } + fvalue := value.FieldByName(f.Name) + + err := validateField(f, fvalue, validateFieldRequired, validateFieldMin) + if err != nil { + v.errors = append(v.errors, fmt.Sprintf("%s: %s", err.Error(), path+prefix+f.Name)) + continue + } + + v.validateAny(fvalue, path+prefix+f.Name) + } +} + +type validatorFunc func(f reflect.StructField, fvalue reflect.Value) error + +func validateField(f reflect.StructField, fvalue reflect.Value, funcs ...validatorFunc) error { + for _, fn := range funcs { + if err := fn(f, fvalue); err != nil { + return err + } + } + return nil +} + +// Validates that a field has a valid value provided for required fields. +func validateFieldRequired(f reflect.StructField, fvalue reflect.Value) error { + if f.Tag.Get("required") == "" { + return nil + } + + switch fvalue.Kind() { + case reflect.Ptr, reflect.Slice, reflect.Map: + if fvalue.IsNil() { + return fmt.Errorf("missing required parameter") + } + default: + if !fvalue.IsValid() { + return fmt.Errorf("missing required parameter") + } + } + return nil +} + +// Validates that if a value is provided for a field, that value must be at +// least a minimum length. +func validateFieldMin(f reflect.StructField, fvalue reflect.Value) error { + minStr := f.Tag.Get("min") + if minStr == "" { + return nil + } + min, _ := strconv.ParseInt(minStr, 10, 64) + + kind := fvalue.Kind() + if kind == reflect.Ptr { + if fvalue.IsNil() { + return nil + } + fvalue = fvalue.Elem() + } + + switch fvalue.Kind() { + case reflect.String: + if int64(fvalue.Len()) < min { + return fmt.Errorf("field too short, minimum length %d", min) + } + case reflect.Slice, reflect.Map: + if fvalue.IsNil() { + return nil + } + if int64(fvalue.Len()) < min { + return fmt.Errorf("field too short, minimum length %d", min) + } + + // TODO min can also apply to number minimum value. + + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go new file mode 100644 index 00000000000..96bfc0e6720 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go @@ -0,0 +1,134 @@ +package corehandlers_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/stretchr/testify/require" +) + +var testSvc = func() *client.Client { + s := &client.Client{ + Config: aws.Config{}, + ClientInfo: metadata.ClientInfo{ + ServiceName: "mock-service", + APIVersion: "2015-01-01", + }, + } + return s +}() + +type StructShape struct { + RequiredList []*ConditionalStructShape `required:"true"` + RequiredMap map[string]*ConditionalStructShape `required:"true"` + RequiredBool *bool `required:"true"` + OptionalStruct *ConditionalStructShape + + hiddenParameter *string + + metadataStructureShape +} + +type metadataStructureShape struct { + SDKShapeTraits bool +} + +type ConditionalStructShape struct { + Name *string `required:"true"` + SDKShapeTraits bool +} + +func TestNoErrors(t *testing.T) { + input := &StructShape{ + RequiredList: []*ConditionalStructShape{}, + RequiredMap: map[string]*ConditionalStructShape{ + "key1": {Name: aws.String("Name")}, + "key2": {Name: aws.String("Name")}, + }, + RequiredBool: aws.Bool(true), + OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")}, + } + + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + require.NoError(t, req.Error) +} + +func TestMissingRequiredParameters(t *testing.T) { + input := &StructShape{} + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.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{{}}, + RequiredMap: map[string]*ConditionalStructShape{ + "key1": {Name: aws.String("Name")}, + "key2": {}, + }, + RequiredBool: aws.Bool(true), + OptionalStruct: &ConditionalStructShape{}, + } + + req := testSvc.NewRequest(&request.Operation{}, input, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.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()) +} + +type testInput struct { + StringField string `min:"5"` + PtrStrField *string `min:"2"` + ListField []string `min:"3"` + MapField map[string]string `min:"4"` +} + +var testsFieldMin = []struct { + err awserr.Error + in testInput +}{ + { + err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 5: StringField", nil), + in: testInput{StringField: "abcd"}, + }, + { + err: awserr.New("InvalidParameter", "2 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField", nil), + in: testInput{StringField: "abcd", ListField: []string{"a", "b"}}, + }, + { + err: awserr.New("InvalidParameter", "3 validation errors:\n- field too short, minimum length 5: StringField\n- field too short, minimum length 3: ListField\n- field too short, minimum length 4: MapField", nil), + in: testInput{StringField: "abcd", ListField: []string{"a", "b"}, MapField: map[string]string{"a": "a", "b": "b"}}, + }, + { + err: awserr.New("InvalidParameter", "1 validation errors:\n- field too short, minimum length 2: PtrStrField", nil), + in: testInput{StringField: "abcde", PtrStrField: aws.String("v")}, + }, + { + err: nil, + in: testInput{StringField: "abcde", PtrStrField: aws.String("value"), + ListField: []string{"a", "b", "c"}, MapField: map[string]string{"a": "a", "b": "b", "c": "c", "d": "d"}}, + }, +} + +func TestValidateFieldMinParameter(t *testing.T) { + for i, c := range testsFieldMin { + req := testSvc.NewRequest(&request.Operation{}, &c.in, nil) + corehandlers.ValidateParametersHandler.Fn(req) + + require.Equal(t, c.err, req.Error, "%d case failed", i) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 2834a088aab..5dd71f02e80 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -53,8 +53,8 @@ import ( "time" ) -// Create an empty Credential object that can be used as dummy placeholder -// credentials for requests that do not need signed. +// AnonymousCredentials is an empty Credential object that can be used as +// dummy placeholder credentials for requests that do not need signed. // // This Credentials can be used to configure a service to not sign requests // when making service API calls. For example, when accessing public diff --git a/Godeps/_workspace/src/github.com/aws/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 deleted file mode 100644 index 0eecbe3b125..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider.go +++ /dev/null @@ -1,162 +0,0 @@ -package credentials - -import ( - "bufio" - "encoding/json" - "fmt" - "net/http" - "time" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -const metadataCredentialsEndpoint = "http://169.254.169.254/latest/meta-data/iam/security-credentials/" - -// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if -// those credentials are expired. -// -// Example how to configure the EC2RoleProvider with custom http Client, Endpoint -// or ExpiryWindow -// -// p := &credentials.EC2RoleProvider{ -// // Pass in a custom timeout to be used when requesting -// // IAM EC2 Role credentials. -// Client: &http.Client{ -// Timeout: 10 * time.Second, -// }, -// // Use default EC2 Role metadata endpoint, Alternate endpoints can be -// // specified setting Endpoint to something else. -// Endpoint: "", -// // Do not use early expiry of credentials. If a non zero value is -// // specified the credentials will be expired early -// ExpiryWindow: 0, -// } -type EC2RoleProvider struct { - Expiry - - // Endpoint must be fully quantified URL - Endpoint string - - // HTTP client to use when connecting to EC2 service - Client *http.Client - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration -} - -// NewEC2RoleCredentials returns a pointer to a new Credentials object -// wrapping the EC2RoleProvider. -// -// Takes a custom http.Client which can be configured for custom handling of -// things such as timeout. -// -// Endpoint is the URL that the EC2RoleProvider will connect to when retrieving -// role and credentials. -// -// Window is the expiry window that will be subtracted from the expiry returned -// by the role credential request. This is done so that the credentials will -// expire sooner than their actual lifespan. -func NewEC2RoleCredentials(client *http.Client, endpoint string, window time.Duration) *Credentials { - return NewCredentials(&EC2RoleProvider{ - Endpoint: endpoint, - Client: client, - ExpiryWindow: window, - }) -} - -// Retrieve retrieves credentials from the EC2 service. -// Error will be returned if the request fails, or unable to extract -// the desired credentials. -func (m *EC2RoleProvider) Retrieve() (Value, error) { - if m.Client == nil { - m.Client = http.DefaultClient - } - if m.Endpoint == "" { - m.Endpoint = metadataCredentialsEndpoint - } - - credsList, err := requestCredList(m.Client, m.Endpoint) - if err != nil { - return Value{}, err - } - - if len(credsList) == 0 { - return Value{}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) - } - credsName := credsList[0] - - roleCreds, err := requestCred(m.Client, m.Endpoint, credsName) - if err != nil { - return Value{}, err - } - - m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow) - - return Value{ - AccessKeyID: roleCreds.AccessKeyID, - SecretAccessKey: roleCreds.SecretAccessKey, - SessionToken: roleCreds.Token, - }, nil -} - -// A ec2RoleCredRespBody provides the shape for deserializing credential -// request responses. -type ec2RoleCredRespBody struct { - Expiration time.Time - AccessKeyID string - SecretAccessKey string - Token string -} - -// requestCredList requests a list of credentials from the EC2 service. -// If there are no credentials, or there is an error making or receiving the request -func requestCredList(client *http.Client, endpoint string) ([]string, error) { - resp, err := client.Get(endpoint) - if err != nil { - return nil, awserr.New("ListEC2Role", "failed to list EC2 Roles", err) - } - defer resp.Body.Close() - - credsList := []string{} - s := bufio.NewScanner(resp.Body) - for s.Scan() { - credsList = append(credsList, s.Text()) - } - - if err := s.Err(); err != nil { - return nil, awserr.New("ReadEC2Role", "failed to read list of EC2 Roles", err) - } - - return credsList, nil -} - -// requestCred requests the credentials for a specific credentials from the EC2 service. -// -// If the credentials cannot be found, or there is an error reading the response -// and error will be returned. -func requestCred(client *http.Client, endpoint, credsName string) (*ec2RoleCredRespBody, error) { - resp, err := client.Get(endpoint + credsName) - if err != nil { - return nil, awserr.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, awserr.New("DecodeEC2RoleCredentials", - fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName), - err) - } - - return respCreds, nil -} diff --git a/Godeps/_workspace/src/github.com/aws/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 deleted file mode 100644 index da1549a4f2e..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2_role_provider_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package credentials - -import ( - "fmt" - "github.com/stretchr/testify/assert" - "net/http" - "net/http/httptest" - "testing" - "time" -) - -func initTestServer(expireOn string) *httptest.Server { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.RequestURI == "/" { - fmt.Fprintln(w, "/creds") - } else { - fmt.Fprintf(w, `{ - "AccessKeyId" : "accessKey", - "SecretAccessKey" : "secret", - "Token" : "token", - "Expiration" : "%s" -}`, expireOn) - } - })) - - return server -} - -func TestEC2RoleProvider(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestEC2RoleProviderIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") - - p.CurrentTime = func() time.Time { - return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired.") -} - -func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL, ExpiryWindow: time.Hour * 1} - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") - - p.CurrentTime = func() time.Time { - return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired.") -} - -func BenchmarkEC2RoleProvider(b *testing.B) { - server := initTestServer("2014-12-16T01:51:37Z") - defer server.Close() - - p := &EC2RoleProvider{Client: http.DefaultClient, Endpoint: server.URL} - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - - b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } - } - }) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go new file mode 100644 index 00000000000..80702c26f9c --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go @@ -0,0 +1,173 @@ +package ec2rolecreds + +import ( + "bufio" + "encoding/json" + "fmt" + "path" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/ec2metadata" +) + +// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if +// those credentials are expired. +// +// Example how to configure the EC2RoleProvider with custom http Client, Endpoint +// or ExpiryWindow +// +// p := &ec2rolecreds.EC2RoleProvider{ +// // Pass in a custom timeout to be used when requesting +// // IAM EC2 Role credentials. +// Client: &http.Client{ +// Timeout: 10 * time.Second, +// }, +// // Do not use early expiry of credentials. If a non zero value is +// // specified the credentials will be expired early +// ExpiryWindow: 0, +// } +type EC2RoleProvider struct { + credentials.Expiry + + // Required EC2Metadata client to use when connecting to EC2 metadata service. + Client *ec2metadata.EC2Metadata + + // ExpiryWindow will allow the credentials to trigger refreshing prior to + // the credentials actually expiring. This is beneficial so race conditions + // with expiring credentials do not cause request to fail unexpectedly + // due to ExpiredTokenException exceptions. + // + // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true + // 10 seconds before the credentials are actually expired. + // + // If ExpiryWindow is 0 or less it will be ignored. + ExpiryWindow time.Duration +} + +// NewCredentials returns a pointer to a new Credentials object wrapping +// the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client. +// The ConfigProvider is satisfied by the session.Session type. +func NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials { + p := &EC2RoleProvider{ + Client: ec2metadata.New(c), + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping +// the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2 +// metadata service. +func NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials { + p := &EC2RoleProvider{ + Client: client, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// Retrieve retrieves credentials from the EC2 service. +// Error will be returned if the request fails, or unable to extract +// the desired credentials. +func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) { + credsList, err := requestCredList(m.Client) + if err != nil { + return credentials.Value{}, err + } + + if len(credsList) == 0 { + return credentials.Value{}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil) + } + credsName := credsList[0] + + roleCreds, err := requestCred(m.Client, credsName) + if err != nil { + return credentials.Value{}, err + } + + m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow) + + return credentials.Value{ + AccessKeyID: roleCreds.AccessKeyID, + SecretAccessKey: roleCreds.SecretAccessKey, + SessionToken: roleCreds.Token, + }, nil +} + +// A ec2RoleCredRespBody provides the shape for unmarshalling credential +// request responses. +type ec2RoleCredRespBody struct { + // Success State + Expiration time.Time + AccessKeyID string + SecretAccessKey string + Token string + + // Error state + Code string + Message string +} + +const iamSecurityCredsPath = "/iam/security-credentials" + +// requestCredList requests a list of credentials from the EC2 service. +// If there are no credentials, or there is an error making or receiving the request +func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) { + resp, err := client.GetMetadata(iamSecurityCredsPath) + if err != nil { + return nil, awserr.New("EC2RoleRequestError", "failed to list EC2 Roles", err) + } + + credsList := []string{} + s := bufio.NewScanner(strings.NewReader(resp)) + for s.Scan() { + credsList = append(credsList, s.Text()) + } + + if err := s.Err(); err != nil { + return nil, awserr.New("SerializationError", "failed to read list of EC2 Roles", err) + } + + return credsList, nil +} + +// requestCred requests the credentials for a specific credentials from the EC2 service. +// +// If the credentials cannot be found, or there is an error reading the response +// and error will be returned. +func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) { + resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName)) + if err != nil { + return ec2RoleCredRespBody{}, + awserr.New("EC2RoleRequestError", + fmt.Sprintf("failed to get %s EC2 Role credentials", credsName), + err) + } + + respCreds := ec2RoleCredRespBody{} + if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil { + return ec2RoleCredRespBody{}, + awserr.New("SerializationError", + fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName), + err) + } + + if respCreds.Code != "Success" { + // If an error code was returned something failed requesting the role. + return ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil) + } + + return respCreds, nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go new file mode 100644 index 00000000000..da3d8ed3ec1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go @@ -0,0 +1,159 @@ +package ec2rolecreds_test + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/session" +) + +const credsRespTmpl = `{ + "Code": "Success", + "Type": "AWS-HMAC", + "AccessKeyId" : "accessKey", + "SecretAccessKey" : "secret", + "Token" : "token", + "Expiration" : "%s", + "LastUpdated" : "2009-11-23T0:00:00Z" +}` + +const credsFailRespTmpl = `{ + "Code": "ErrorCode", + "Message": "ErrorMsg", + "LastUpdated": "2009-11-23T0:00:00Z" +}` + +func initTestServer(expireOn string, failAssume bool) *httptest.Server { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/latest/meta-data/iam/security-credentials" { + fmt.Fprintln(w, "RoleName") + } else if r.URL.Path == "/latest/meta-data/iam/security-credentials/RoleName" { + if failAssume { + fmt.Fprintf(w, credsFailRespTmpl) + } else { + fmt.Fprintf(w, credsRespTmpl, expireOn) + } + } else { + http.Error(w, "bad request", http.StatusBadRequest) + } + })) + + return server +} + +func TestEC2RoleProvider(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + + creds, err := p.Retrieve() + assert.Nil(t, err, "Expect no error, %v", err) + + assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") +} + +func TestEC2RoleProviderFailAssume(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", true) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + + creds, err := p.Retrieve() + assert.Error(t, err, "Expect error") + + e := err.(awserr.Error) + assert.Equal(t, "ErrorCode", e.Code()) + assert.Equal(t, "ErrorMsg", e.Message()) + assert.Nil(t, e.OrigErr()) + + assert.Equal(t, "", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "", creds.SessionToken, "Expect session token to match") +} + +func TestEC2RoleProviderIsExpired(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 15, 21, 26, 0, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") + + _, err := p.Retrieve() + assert.Nil(t, err, "Expect no error, %v", err) + + assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") + + p.CurrentTime = func() time.Time { + return time.Date(3014, 12, 15, 21, 26, 0, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired.") +} + +func TestEC2RoleProviderExpiryWindowIsExpired(t *testing.T) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + ExpiryWindow: time.Hour * 1, + } + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 15, 0, 51, 37, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") + + _, err := p.Retrieve() + assert.Nil(t, err, "Expect no error, %v", err) + + assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve.") + + p.CurrentTime = func() time.Time { + return time.Date(2014, 12, 16, 0, 55, 37, 0, time.UTC) + } + + assert.True(t, p.IsExpired(), "Expect creds to be expired.") +} + +func BenchmarkEC3RoleProvider(b *testing.B) { + server := initTestServer("2014-12-16T01:51:37Z", false) + defer server.Close() + + p := &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}), + } + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + if _, err := p.Retrieve(); err != nil { + b.Fatal(err) + } + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini index aa2dc506ad0..7fc91d9d204 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/example.ini @@ -6,3 +6,7 @@ aws_session_token = token [no_token] aws_access_key_id = accessKey aws_secret_access_key = secret + +[with_colon] +aws_access_key_id: accessKey +aws_secret_access_key: secret diff --git a/Godeps/_workspace/src/github.com/aws/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 index b457e63a338..09bd00a9506 100644 --- a/Godeps/_workspace/src/github.com/aws/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 @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/vaughan0/go-ini" + "github.com/go-ini/ini" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -22,8 +22,12 @@ var ( // // Profile ini file example: $HOME/.aws/credentials type SharedCredentialsProvider struct { - // Path to the shared credentials file. If empty will default to current user's - // home directory. + // Path to the shared credentials file. + // + // If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the + // env value is empty will default to current user's home directory. + // Linux/OSX: "$HOME/.aws/credentials" + // Windows: "%USERPROFILE%\.aws\credentials" Filename string // AWS Profile to extract credentials from the shared credentials file. If empty @@ -72,32 +76,36 @@ func (p *SharedCredentialsProvider) IsExpired() bool { // The credentials retrieved from the profile will be returned or error. Error will be // returned if it fails to read from the file, or the data is invalid. func loadProfile(filename, profile string) (Value, error) { - config, err := ini.LoadFile(filename) + config, err := ini.Load(filename) if err != nil { return Value{}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) } - iniProfile := config.Section(profile) - - id, ok := iniProfile["aws_access_key_id"] - if !ok { - return Value{}, awserr.New("SharedCredsAccessKey", - fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), - nil) + iniProfile, err := config.GetSection(profile) + if err != nil { + return Value{}, awserr.New("SharedCredsLoad", "failed to get profile", err) } - secret, ok := iniProfile["aws_secret_access_key"] - if !ok { + id, err := iniProfile.GetKey("aws_access_key_id") + if err != nil { + return Value{}, awserr.New("SharedCredsAccessKey", + fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), + err) + } + + secret, err := iniProfile.GetKey("aws_secret_access_key") + if err != nil { return Value{}, awserr.New("SharedCredsSecret", fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), nil) } - token := iniProfile["aws_session_token"] + // Default to empty string if not found + token := iniProfile.Key("aws_session_token") return Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: token, + AccessKeyID: id.String(), + SecretAccessKey: secret.String(), + SessionToken: token.String(), }, nil } @@ -106,6 +114,10 @@ func loadProfile(filename, profile string) (Value, error) { // Will return an error if the user's home directory path cannot be found. func (p *SharedCredentialsProvider) filename() (string, error) { if p.Filename == "" { + if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); p.Filename != "" { + return p.Filename, nil + } + homeDir := os.Getenv("HOME") // *nix if homeDir == "" { // Windows homeDir = os.Getenv("USERPROFILE") diff --git a/Godeps/_workspace/src/github.com/aws/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 index 3621d56eddc..2e26da2634b 100644 --- a/Godeps/_workspace/src/github.com/aws/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 @@ -31,6 +31,19 @@ func TestSharedCredentialsProviderIsExpired(t *testing.T) { assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve") } +func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILE(t *testing.T) { + os.Clearenv() + os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "example.ini") + p := SharedCredentialsProvider{} + creds, err := p.Retrieve() + + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") + assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") +} + func TestSharedCredentialsProviderWithAWS_PROFILE(t *testing.T) { os.Clearenv() os.Setenv("AWS_PROFILE", "no_token") @@ -56,6 +69,18 @@ func TestSharedCredentialsProviderWithoutTokenFromProfile(t *testing.T) { assert.Empty(t, creds.SessionToken, "Expect no token") } +func TestSharedCredentialsProviderColonInCredFile(t *testing.T) { + os.Clearenv() + + p := SharedCredentialsProvider{Filename: "example.ini", Profile: "with_colon"} + creds, err := p.Retrieve() + assert.Nil(t, err, "Expect no error") + + assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") + assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") + assert.Empty(t, creds.SessionToken, "Expect no token") +} + func BenchmarkSharedCredentialsProvider(b *testing.B) { os.Clearenv() @@ -66,12 +91,10 @@ func BenchmarkSharedCredentialsProvider(b *testing.B) { } b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } + for i := 0; i < b.N; i++ { + _, err := p.Retrieve() + if err != nil { + b.Fatal(err) } - }) + } } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index 80890b9d0dd..0214860d4cc 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -6,10 +6,12 @@ package stscreds import ( "fmt" + "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/service/sts" - "time" ) // AssumeRoler represents the minimal subset of the STS client API used by this provider. @@ -17,31 +19,17 @@ type AssumeRoler interface { AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) } +// DefaultDuration is the default amount of time in minutes that the credentials +// will be valid for. +var DefaultDuration = time.Duration(15) * time.Minute + // AssumeRoleProvider retrieves temporary credentials from the STS service, and // keeps track of their expiration time. This provider must be used explicitly, // as it is not included in the credentials chain. -// -// Example how to configure a service to use this provider: -// -// config := &aws.Config{ -// Credentials: stscreds.NewCredentials(nil, "arn-of-the-role-to-assume", 10*time.Second), -// }) -// // Use config for creating your AWS service. -// -// Example how to obtain customised credentials: -// -// provider := &stscreds.Provider{ -// // Extend the duration to 1 hour. -// Duration: time.Hour, -// // Custom role name. -// RoleSessionName: "custom-session-name", -// } -// creds := credentials.NewCredentials(provider) -// type AssumeRoleProvider struct { credentials.Expiry - // Custom STS client. If not set the default STS client will be used. + // STS client to make assume role request with. Client AssumeRoler // Role to be assumed. @@ -53,6 +41,9 @@ type AssumeRoleProvider struct { // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. Duration time.Duration + // Optional ExternalID to pass along, defaults to nil if not set. + ExternalID *string + // ExpiryWindow will allow the credentials to trigger refreshing prior to // the credentials actually expiring. This is beneficial so race conditions // with expiring credentials do not cause request to fail unexpectedly @@ -66,43 +57,62 @@ type AssumeRoleProvider struct { } // NewCredentials returns a pointer to a new Credentials object wrapping the -// AssumeRoleProvider. The credentials will expire every 15 minutes and the +// AssumeRoleProvider. The credentials will expire every 15 minutes and the // role will be named after a nanosecond timestamp of this operation. // -// The sts and roleARN parameters are used for building the "AssumeRole" call. -// Pass nil as sts to use the default client. +// Takes a Config provider to create the STS client. The ConfigProvider is +// satisfied by the session.Session type. +func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { + p := &AssumeRoleProvider{ + Client: sts.New(c), + RoleARN: roleARN, + Duration: DefaultDuration, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the +// AssumeRoleProvider. The credentials will expire every 15 minutes and the +// role will be named after a nanosecond timestamp of this operation. // -// Window is the expiry window that will be subtracted from the expiry returned -// by the role credential request. This is done so that the credentials will -// expire sooner than their actual lifespan. -func NewCredentials(client AssumeRoler, roleARN string, window time.Duration) *credentials.Credentials { - return credentials.NewCredentials(&AssumeRoleProvider{ - Client: client, - RoleARN: roleARN, - ExpiryWindow: window, - }) +// Takes an AssumeRoler which can be satisfiede by the STS client. +func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials { + p := &AssumeRoleProvider{ + Client: svc, + RoleARN: roleARN, + Duration: DefaultDuration, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) } // Retrieve generates a new set of temporary credentials using STS. func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { // Apply defaults where parameters are not set. - if p.Client == nil { - p.Client = sts.New(nil) - } if p.RoleSessionName == "" { // Try to work out a role name that will hopefully end up unique. p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano()) } if p.Duration == 0 { // Expire as often as AWS permits. - p.Duration = 15 * time.Minute + p.Duration = DefaultDuration } roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{ DurationSeconds: aws.Int64(int64(p.Duration / time.Second)), - RoleARN: aws.String(p.RoleARN), + RoleArn: aws.String(p.RoleARN), RoleSessionName: aws.String(p.RoleSessionName), + ExternalId: p.ExternalID, }) if err != nil { @@ -113,7 +123,7 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow) return credentials.Value{ - AccessKeyID: *roleOutput.Credentials.AccessKeyID, + AccessKeyID: *roleOutput.Credentials.AccessKeyId, SecretAccessKey: *roleOutput.Credentials.SecretAccessKey, SessionToken: *roleOutput.Credentials.SessionToken, }, nil diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go index 98b7690026b..6bd6e91973e 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go @@ -1,11 +1,12 @@ package stscreds import ( + "testing" + "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sts" "github.com/stretchr/testify/assert" - "testing" - "time" ) type stubSTS struct { @@ -16,7 +17,7 @@ func (s *stubSTS) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, return &sts.AssumeRoleOutput{ Credentials: &sts.Credentials{ // Just reflect the role arn to the provider. - AccessKeyID: input.RoleARN, + AccessKeyId: input.RoleArn, SecretAccessKey: aws.String("assumedSecretAccessKey"), SessionToken: aws.String("assumedSessionToken"), Expiration: &expiry, @@ -47,12 +48,9 @@ func BenchmarkAssumeRoleProvider(b *testing.B) { } b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - _, err := p.Retrieve() - if err != nil { - b.Fatal(err) - } + for i := 0; i < b.N; i++ { + if _, err := p.Retrieve(); err != nil { + b.Fatal(err) } - }) + } } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go new file mode 100644 index 00000000000..b746783beca --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -0,0 +1,76 @@ +// Package defaults is a collection of helpers to retrieve the SDK's default +// configuration and handlers. +package defaults + +import ( + "net/http" + "os" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/endpoints" +) + +// A Defaults provides a collection of default values for SDK clients. +type Defaults struct { + Config *aws.Config + Handlers request.Handlers +} + +// Get returns the SDK's default values with Config and handlers pre-configured. +func Get() Defaults { + cfg := Config() + handlers := Handlers() + cfg.Credentials = CredChain(cfg, handlers) + + return Defaults{ + Config: cfg, + Handlers: handlers, + } +} + +// Config returns the default configuration. +func Config() *aws.Config { + return aws.NewConfig(). + WithCredentials(credentials.AnonymousCredentials). + WithRegion(os.Getenv("AWS_REGION")). + WithHTTPClient(http.DefaultClient). + WithMaxRetries(aws.UseServiceDefaultRetries). + WithLogger(aws.NewDefaultLogger()). + WithLogLevel(aws.LogOff). + WithSleepDelay(time.Sleep) +} + +// Handlers returns the default request handlers. +func Handlers() request.Handlers { + var handlers request.Handlers + + handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) + handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) + handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) + handlers.Send.PushBackNamed(corehandlers.SendHandler) + handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) + handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler) + + return handlers +} + +// CredChain returns the default credential chain. +func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials { + endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName, *cfg.Region, true) + + return credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, + &ec2rolecreds.EC2RoleProvider{ + Client: ec2metadata.NewClient(*cfg, handlers, endpoint, signingRegion), + ExpiryWindow: 5 * time.Minute, + }, + }) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go new file mode 100644 index 00000000000..e5137ca17da --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -0,0 +1,43 @@ +package ec2metadata + +import ( + "path" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// GetMetadata uses the path provided to request +func (c *EC2Metadata) GetMetadata(p string) (string, error) { + op := &request.Operation{ + Name: "GetMetadata", + HTTPMethod: "GET", + HTTPPath: path.Join("/", "meta-data", p), + } + + output := &metadataOutput{} + req := c.NewRequest(op, nil, output) + + return output.Content, req.Send() +} + +// Region returns the region the instance is running in. +func (c *EC2Metadata) Region() (string, error) { + resp, err := c.GetMetadata("placement/availability-zone") + if err != nil { + return "", err + } + + // returns region without the suffix. Eg: us-west-2a becomes us-west-2 + return resp[:len(resp)-1], nil +} + +// Available returns if the application has access to the EC2 Metadata service. +// Can be used to determine if application is running within an EC2 Instance and +// the metadata service is available. +func (c *EC2Metadata) Available() bool { + if _, err := c.GetMetadata("instance-id"); err != nil { + return false + } + + return true +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go new file mode 100644 index 00000000000..c3c92972b7c --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go @@ -0,0 +1,101 @@ +package ec2metadata_test + +import ( + "bytes" + "io/ioutil" + "net/http" + "net/http/httptest" + "path" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" +) + +func initTestServer(path string, resp string) *httptest.Server { + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.RequestURI != path { + http.Error(w, "not found", http.StatusNotFound) + return + } + + w.Write([]byte(resp)) + })) +} + +func TestEndpoint(t *testing.T) { + c := ec2metadata.New(session.New()) + op := &request.Operation{ + Name: "GetMetadata", + HTTPMethod: "GET", + HTTPPath: path.Join("/", "meta-data", "testpath"), + } + + req := c.NewRequest(op, nil, nil) + assert.Equal(t, "http://169.254.169.254/latest", req.ClientInfo.Endpoint) + assert.Equal(t, "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String()) +} + +func TestGetMetadata(t *testing.T) { + server := initTestServer( + "/latest/meta-data/some/path", + "success", // real response includes suffix + ) + defer server.Close() + c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + + resp, err := c.GetMetadata("some/path") + + assert.NoError(t, err) + assert.Equal(t, "success", resp) +} + +func TestGetRegion(t *testing.T) { + server := initTestServer( + "/latest/meta-data/placement/availability-zone", + "us-west-2a", // real response includes suffix + ) + defer server.Close() + c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + + region, err := c.Region() + + assert.NoError(t, err) + assert.Equal(t, "us-west-2", region) +} + +func TestMetadataAvailable(t *testing.T) { + server := initTestServer( + "/latest/meta-data/instance-id", + "instance-id", + ) + defer server.Close() + c := ec2metadata.New(session.New(), &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) + + available := c.Available() + + assert.True(t, available) +} + +func TestMetadataNotAvailable(t *testing.T) { + c := ec2metadata.New(session.New()) + c.Handlers.Send.Clear() + c.Handlers.Send.PushBack(func(r *request.Request) { + r.HTTPResponse = &http.Response{ + StatusCode: int(0), + Status: http.StatusText(int(0)), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + } + r.Error = awserr.New("RequestError", "send request failed", nil) + r.Retryable = aws.Bool(true) // network errors are retryable + }) + + available := c.Available() + + assert.False(t, available) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go new file mode 100644 index 00000000000..f0dc331e012 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -0,0 +1,116 @@ +// Package ec2metadata provides the client for making API calls to the +// EC2 Metadata service. +package ec2metadata + +import ( + "io/ioutil" + "net" + "net/http" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" +) + +// ServiceName is the name of the service. +const ServiceName = "ec2metadata" + +// A EC2Metadata is an EC2 Metadata service Client. +type EC2Metadata struct { + *client.Client +} + +// New creates a new instance of the EC2Metadata client with a session. +// This client is safe to use across multiple goroutines. +// +// Example: +// // Create a EC2Metadata client from just a session. +// svc := ec2metadata.New(mySession) +// +// // Create a EC2Metadata client with additional configuration +// svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody)) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata { + c := p.ClientConfig(ServiceName, cfgs...) + return NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// NewClient returns a new EC2Metadata client. Should be used to create +// a client when not using a session. Generally using just New with a session +// is preferred. +func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata { + // If the default http client is provided, replace it with a custom + // client using default timeouts. + if cfg.HTTPClient == http.DefaultClient { + cfg.HTTPClient = &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + // use a shorter timeout than default because the metadata + // service is local if it is running, and to fail faster + // if not running on an ec2 instance. + Timeout: 5 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + }, + } + } + + svc := &EC2Metadata{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + Endpoint: endpoint, + APIVersion: "latest", + }, + handlers, + ), + } + + svc.Handlers.Unmarshal.PushBack(unmarshalHandler) + svc.Handlers.UnmarshalError.PushBack(unmarshalError) + svc.Handlers.Validate.Clear() + svc.Handlers.Validate.PushBack(validateEndpointHandler) + + // Add additional options to the service config + for _, option := range opts { + option(svc.Client) + } + + return svc +} + +type metadataOutput struct { + Content string +} + +func unmarshalHandler(r *request.Request) { + defer r.HTTPResponse.Body.Close() + b, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err) + } + + data := r.Data.(*metadataOutput) + data.Content = string(b) +} + +func unmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + _, err := ioutil.ReadAll(r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err) + } + + // TODO extract the error... +} + +func validateEndpointHandler(r *request.Request) { + if r.ClientInfo.Endpoint == "" { + r.Error = aws.ErrMissingEndpoint + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go new file mode 100644 index 00000000000..57663616868 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/errors.go @@ -0,0 +1,17 @@ +package aws + +import "github.com/aws/aws-sdk-go/aws/awserr" + +var ( + // ErrMissingRegion is an error that is returned if region configuration is + // not found. + // + // @readonly + ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) + + // ErrMissingEndpoint is an error that is returned if an endpoint cannot be + // resolved for a service. + // + // @readonly + ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) +) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go deleted file mode 100644 index bc6a8f29c1e..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handler_functions_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package aws - -import ( - "net/http" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/stretchr/testify/assert" -) - -func TestValidateEndpointHandler(t *testing.T) { - os.Clearenv() - svc := NewService(NewConfig().WithRegion("us-west-2")) - svc.Handlers.Clear() - svc.Handlers.Validate.PushBack(ValidateEndpointHandler) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - assert.NoError(t, err) -} - -func TestValidateEndpointHandlerErrorRegion(t *testing.T) { - os.Clearenv() - svc := NewService(nil) - svc.Handlers.Clear() - svc.Handlers.Validate.PushBack(ValidateEndpointHandler) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - assert.Error(t, err) - assert.Equal(t, ErrMissingRegion, err) -} - -type mockCredsProvider struct { - expired bool - retrieveCalled bool -} - -func (m *mockCredsProvider) Retrieve() (credentials.Value, error) { - m.retrieveCalled = true - return credentials.Value{}, nil -} - -func (m *mockCredsProvider) IsExpired() bool { - return m.expired -} - -func TestAfterRetryRefreshCreds(t *testing.T) { - os.Clearenv() - credProvider := &mockCredsProvider{} - svc := NewService(&Config{Credentials: credentials.NewCredentials(credProvider), MaxRetries: Int(1)}) - - svc.Handlers.Clear() - svc.Handlers.ValidateResponse.PushBack(func(r *Request) { - r.Error = awserr.New("UnknownError", "", nil) - r.HTTPResponse = &http.Response{StatusCode: 400} - }) - svc.Handlers.UnmarshalError.PushBack(func(r *Request) { - r.Error = awserr.New("ExpiredTokenException", "", nil) - }) - svc.Handlers.AfterRetry.PushBack(func(r *Request) { - AfterRetryHandler(r) - }) - - assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired") - assert.False(t, credProvider.retrieveCalled) - - req := NewRequest(svc, &Operation{Name: "Operation"}, nil, nil) - req.Send() - - assert.True(t, svc.Config.Credentials.IsExpired()) - assert.False(t, credProvider.retrieveCalled) - - _, err := svc.Config.Credentials.Get() - assert.NoError(t, err) - assert.True(t, credProvider.retrieveCalled) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go deleted file mode 100644 index 1968cb9f8b1..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers.go +++ /dev/null @@ -1,85 +0,0 @@ -package aws - -// A Handlers provides a collection of request handlers for various -// stages of handling requests. -type Handlers struct { - Validate HandlerList - Build HandlerList - Sign HandlerList - Send HandlerList - ValidateResponse HandlerList - Unmarshal HandlerList - UnmarshalMeta HandlerList - UnmarshalError HandlerList - Retry HandlerList - AfterRetry HandlerList -} - -// copy returns of this handler's lists. -func (h *Handlers) copy() Handlers { - return Handlers{ - Validate: h.Validate.copy(), - Build: h.Build.copy(), - Sign: h.Sign.copy(), - Send: h.Send.copy(), - ValidateResponse: h.ValidateResponse.copy(), - Unmarshal: h.Unmarshal.copy(), - UnmarshalError: h.UnmarshalError.copy(), - UnmarshalMeta: h.UnmarshalMeta.copy(), - Retry: h.Retry.copy(), - AfterRetry: h.AfterRetry.copy(), - } -} - -// Clear removes callback functions for all handlers -func (h *Handlers) Clear() { - h.Validate.Clear() - h.Build.Clear() - h.Send.Clear() - h.Sign.Clear() - h.Unmarshal.Clear() - h.UnmarshalMeta.Clear() - h.UnmarshalError.Clear() - h.ValidateResponse.Clear() - h.Retry.Clear() - h.AfterRetry.Clear() -} - -// A HandlerList manages zero or more handlers in a list. -type HandlerList struct { - list []func(*Request) -} - -// copy creates a copy of the handler list. -func (l *HandlerList) copy() HandlerList { - var n HandlerList - n.list = append([]func(*Request){}, l.list...) - return n -} - -// Clear clears the handler list. -func (l *HandlerList) Clear() { - l.list = []func(*Request){} -} - -// Len returns the number of handlers in the list. -func (l *HandlerList) Len() int { - return len(l.list) -} - -// PushBack pushes handlers f to the back of the handler list. -func (l *HandlerList) PushBack(f ...func(*Request)) { - l.list = append(l.list, f...) -} - -// PushFront pushes handlers f to the front of the handler list. -func (l *HandlerList) PushFront(f ...func(*Request)) { - l.list = append(f, l.list...) -} - -// Run executes all handlers in the list with a given request object. -func (l *HandlerList) Run(r *Request) { - for _, f := range l.list { - f(r) - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go deleted file mode 100644 index 944e1d3edcf..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/handlers_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package aws - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHandlerList(t *testing.T) { - s := "" - r := &Request{} - l := HandlerList{} - l.PushBack(func(r *Request) { - s += "a" - r.Data = s - }) - l.Run(r) - assert.Equal(t, "a", s) - assert.Equal(t, "a", r.Data) -} - -func TestMultipleHandlers(t *testing.T) { - r := &Request{} - l := HandlerList{} - l.PushBack(func(r *Request) { r.Data = nil }) - l.PushFront(func(r *Request) { r.Data = Bool(true) }) - l.Run(r) - if r.Data != nil { - t.Error("Expected handler to execute") - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go index 935661c0b70..f5369487384 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/logger.go @@ -62,6 +62,15 @@ const ( // see the body content of requests and responses made while using the SDK // Will also enable LogDebug. LogDebugWithHTTPBody + + // LogDebugWithRequestRetries states the SDK should log when service requests will + // be retried. This should be used to log when you want to log when service + // requests are being retried. Will also enable LogDebug. + LogDebugWithRequestRetries + + // LogDebugWithRequestErrors states the SDK should log when service requests fail + // to build, send, validate, or unmarshal. + LogDebugWithRequestErrors ) // A Logger is a minimalistic interface for the SDK to log messages to. Should diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go deleted file mode 100644 index b4e95cebd57..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator.go +++ /dev/null @@ -1,89 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -// ValidateParameters is a request handler to validate the input parameters. -// Validating parameters only has meaning if done prior to the request being sent. -func ValidateParameters(r *Request) { - if r.ParamsFilled() { - v := validator{errors: []string{}} - v.validateAny(reflect.ValueOf(r.Params), "") - - 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 = awserr.New("InvalidParameter", msg, nil) - } - } -} - -// A validator validates values. Collects validations errors which occurs. -type validator struct { - errors []string -} - -// validateAny will validate any struct, slice or map type. All validations -// are also performed recursively for nested types. -func (v *validator) validateAny(value reflect.Value, path string) { - value = reflect.Indirect(value) - if !value.IsValid() { - return - } - - switch value.Kind() { - case reflect.Struct: - v.validateStruct(value, path) - case reflect.Slice: - for i := 0; i < value.Len(); i++ { - v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i)) - } - case reflect.Map: - for _, n := range value.MapKeys() { - v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String())) - } - } -} - -// validateStruct will validate the struct value's fields. If the structure has -// nested types those types will be validated also. -func (v *validator) validateStruct(value reflect.Value, path string) { - prefix := "." - if path == "" { - prefix = "" - } - - for i := 0; i < value.Type().NumField(); i++ { - f := value.Type().Field(i) - if strings.ToLower(f.Name[0:1]) == f.Name[0:1] { - continue - } - fvalue := value.FieldByName(f.Name) - - notset := false - if f.Tag.Get("required") != "" { - switch fvalue.Kind() { - case reflect.Ptr, reflect.Slice, reflect.Map: - if fvalue.IsNil() { - notset = true - } - default: - if !fvalue.IsValid() { - notset = true - } - } - } - - if notset { - msg := "missing required parameter: " + path + prefix + f.Name - v.errors = append(v.errors, msg) - } else { - v.validateAny(fvalue, path+prefix+f.Name) - } - } -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go deleted file mode 100644 index e09acf8af34..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/param_validator_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package aws_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/stretchr/testify/assert" -) - -var service = func() *aws.Service { - s := &aws.Service{ - Config: &aws.Config{}, - ServiceName: "mock-service", - APIVersion: "2015-01-01", - } - return s -}() - -type StructShape struct { - RequiredList []*ConditionalStructShape `required:"true"` - RequiredMap map[string]*ConditionalStructShape `required:"true"` - RequiredBool *bool `required:"true"` - OptionalStruct *ConditionalStructShape - - hiddenParameter *string - - metadataStructureShape -} - -type metadataStructureShape struct { - SDKShapeTraits bool -} - -type ConditionalStructShape struct { - Name *string `required:"true"` - SDKShapeTraits bool -} - -func TestNoErrors(t *testing.T) { - input := &StructShape{ - RequiredList: []*ConditionalStructShape{}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": {Name: aws.String("Name")}, - "key2": {Name: aws.String("Name")}, - }, - RequiredBool: aws.Bool(true), - OptionalStruct: &ConditionalStructShape{Name: aws.String("Name")}, - } - - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - assert.NoError(t, req.Error) -} - -func TestMissingRequiredParameters(t *testing.T) { - input := &StructShape{} - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - - 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{{}}, - RequiredMap: map[string]*ConditionalStructShape{ - "key1": {Name: aws.String("Name")}, - "key2": {}, - }, - RequiredBool: aws.Bool(true), - OptionalStruct: &ConditionalStructShape{}, - } - - req := aws.NewRequest(service, &aws.Operation{}, input, nil) - aws.ValidateParameters(req) - - 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/aws/aws-sdk-go/aws/request/handlers.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go new file mode 100644 index 00000000000..3e90a7976ae --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -0,0 +1,140 @@ +package request + +import ( + "fmt" + "strings" +) + +// A Handlers provides a collection of request handlers for various +// stages of handling requests. +type Handlers struct { + Validate HandlerList + Build HandlerList + Sign HandlerList + Send HandlerList + ValidateResponse HandlerList + Unmarshal HandlerList + UnmarshalMeta HandlerList + UnmarshalError HandlerList + Retry HandlerList + AfterRetry HandlerList +} + +// Copy returns of this handler's lists. +func (h *Handlers) Copy() Handlers { + return Handlers{ + Validate: h.Validate.copy(), + Build: h.Build.copy(), + Sign: h.Sign.copy(), + Send: h.Send.copy(), + ValidateResponse: h.ValidateResponse.copy(), + Unmarshal: h.Unmarshal.copy(), + UnmarshalError: h.UnmarshalError.copy(), + UnmarshalMeta: h.UnmarshalMeta.copy(), + Retry: h.Retry.copy(), + AfterRetry: h.AfterRetry.copy(), + } +} + +// Clear removes callback functions for all handlers +func (h *Handlers) Clear() { + h.Validate.Clear() + h.Build.Clear() + h.Send.Clear() + h.Sign.Clear() + h.Unmarshal.Clear() + h.UnmarshalMeta.Clear() + h.UnmarshalError.Clear() + h.ValidateResponse.Clear() + h.Retry.Clear() + h.AfterRetry.Clear() +} + +// A HandlerList manages zero or more handlers in a list. +type HandlerList struct { + list []NamedHandler +} + +// A NamedHandler is a struct that contains a name and function callback. +type NamedHandler struct { + Name string + Fn func(*Request) +} + +// copy creates a copy of the handler list. +func (l *HandlerList) copy() HandlerList { + var n HandlerList + n.list = append([]NamedHandler{}, l.list...) + return n +} + +// Clear clears the handler list. +func (l *HandlerList) Clear() { + l.list = []NamedHandler{} +} + +// Len returns the number of handlers in the list. +func (l *HandlerList) Len() int { + return len(l.list) +} + +// PushBack pushes handler f to the back of the handler list. +func (l *HandlerList) PushBack(f func(*Request)) { + l.list = append(l.list, NamedHandler{"__anonymous", f}) +} + +// PushFront pushes handler f to the front of the handler list. +func (l *HandlerList) PushFront(f func(*Request)) { + l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...) +} + +// PushBackNamed pushes named handler f to the back of the handler list. +func (l *HandlerList) PushBackNamed(n NamedHandler) { + l.list = append(l.list, n) +} + +// PushFrontNamed pushes named handler f to the front of the handler list. +func (l *HandlerList) PushFrontNamed(n NamedHandler) { + l.list = append([]NamedHandler{n}, l.list...) +} + +// Remove removes a NamedHandler n +func (l *HandlerList) Remove(n NamedHandler) { + newlist := []NamedHandler{} + for _, m := range l.list { + if m.Name != n.Name { + newlist = append(newlist, m) + } + } + l.list = newlist +} + +// Run executes all handlers in the list with a given request object. +func (l *HandlerList) Run(r *Request) { + for _, f := range l.list { + f.Fn(r) + } +} + +// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request +// header. If the extra parameters are provided they will be added as metadata to the +// name/version pair resulting in the following format. +// "name/version (extra0; extra1; ...)" +// The user agent part will be concatenated with this current request's user agent string. +func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) { + ua := fmt.Sprintf("%s/%s", name, version) + if len(extra) > 0 { + ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; ")) + } + return func(r *Request) { + AddToUserAgent(r, ua) + } +} + +// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header. +// The input string will be concatenated with the current request's user agent string. +func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) { + return func(r *Request) { + AddToUserAgent(r, s) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go new file mode 100644 index 00000000000..16a1418283b --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/handlers_test.go @@ -0,0 +1,47 @@ +package request_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +func TestHandlerList(t *testing.T) { + s := "" + r := &request.Request{} + l := request.HandlerList{} + l.PushBack(func(r *request.Request) { + s += "a" + r.Data = s + }) + l.Run(r) + assert.Equal(t, "a", s) + assert.Equal(t, "a", r.Data) +} + +func TestMultipleHandlers(t *testing.T) { + r := &request.Request{} + l := request.HandlerList{} + l.PushBack(func(r *request.Request) { r.Data = nil }) + l.PushFront(func(r *request.Request) { r.Data = aws.Bool(true) }) + l.Run(r) + if r.Data != nil { + t.Error("Expected handler to execute") + } +} + +func TestNamedHandlers(t *testing.T) { + l := request.HandlerList{} + named := request.NamedHandler{Name: "Name", Fn: func(r *request.Request) {}} + named2 := request.NamedHandler{Name: "NotName", Fn: func(r *request.Request) {}} + l.PushBackNamed(named) + l.PushBackNamed(named) + l.PushBackNamed(named2) + l.PushBack(func(r *request.Request) {}) + assert.Equal(t, 4, l.Len()) + l.Remove(named) + assert.Equal(t, 2, l.Len()) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go similarity index 62% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go index f3248fc467a..3735d7fa533 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request.go @@ -1,7 +1,8 @@ -package aws +package request import ( "bytes" + "fmt" "io" "io/ioutil" "net/http" @@ -10,25 +11,29 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client/metadata" ) // A Request is the service request to be made. type Request struct { - *Service - Handlers Handlers + Config aws.Config + ClientInfo metadata.ClientInfo + Handlers Handlers + + Retryer Time time.Time ExpireTime time.Duration Operation *Operation HTTPRequest *http.Request HTTPResponse *http.Response Body io.ReadSeeker - bodyStart int64 // offset from beginning of Body that the request body starts + BodyStart int64 // offset from beginning of Body that the request body starts Params interface{} Error error Data interface{} RequestID string - RetryCount uint + RetryCount int Retryable *bool RetryDelay time.Duration @@ -51,13 +56,15 @@ type Paginator struct { TruncationToken string } -// NewRequest returns a new Request pointer for the service API +// New returns a new Request pointer for the service API // operation and parameters. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response // payload will be deserialized to. -func NewRequest(service *Service, operation *Operation, params interface{}, data interface{}) *Request { +func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, + retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { + method := operation.HTTPMethod if method == "" { method = "POST" @@ -68,11 +75,14 @@ func NewRequest(service *Service, operation *Operation, params interface{}, data } httpReq, _ := http.NewRequest(method, "", nil) - httpReq.URL, _ = url.Parse(service.Endpoint + p) + httpReq.URL, _ = url.Parse(clientInfo.Endpoint + p) r := &Request{ - Service: service, - Handlers: service.Handlers.copy(), + Config: cfg, + ClientInfo: clientInfo, + Handlers: handlers.Copy(), + + Retryer: retryer, Time: time.Now(), ExpireTime: 0, Operation: operation, @@ -89,7 +99,7 @@ func NewRequest(service *Service, operation *Operation, params interface{}, data // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { - return r.Error != nil && BoolValue(r.Retryable) && r.RetryCount < r.Service.MaxRetries() + return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() } // ParamsFilled returns if the request's parameters have been populated @@ -134,6 +144,20 @@ func (r *Request) Presign(expireTime time.Duration) (string, error) { return r.HTTPRequest.URL.String(), nil } +func debugLogReqError(r *Request, stage string, retrying bool, err error) { + if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { + return + } + + retryStr := "not retrying" + if retrying { + retryStr = "will retry" + } + + r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", + stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) +} + // Build will build the request's object so it can be signed and sent // to the service. Build will also validate all the request's parameters. // Anny additional build Handlers set on this request will be run @@ -149,6 +173,7 @@ func (r *Request) Build() error { r.Error = nil r.Handlers.Validate.Run(r) if r.Error != nil { + debugLogReqError(r, "Validate Request", false, r.Error) return r.Error } r.Handlers.Build.Run(r) @@ -165,6 +190,7 @@ func (r *Request) Build() error { func (r *Request) Sign() error { r.Build() if r.Error != nil { + debugLogReqError(r, "Build Request", false, r.Error) return r.Error } @@ -183,42 +209,57 @@ func (r *Request) Send() error { return r.Error } - if BoolValue(r.Retryable) { + if aws.BoolValue(r.Retryable) { + if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { + r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", + r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) + } + // Re-seek the body back to the original point in for a retry so that // send will send the body's contents again in the upcoming request. - r.Body.Seek(r.bodyStart, 0) + r.Body.Seek(r.BodyStart, 0) + r.HTTPRequest.Body = ioutil.NopCloser(r.Body) } r.Retryable = nil r.Handlers.Send.Run(r) if r.Error != nil { + err := r.Error r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Send Request", false, r.Error) return r.Error } + debugLogReqError(r, "Send Request", true, err) continue } r.Handlers.UnmarshalMeta.Run(r) r.Handlers.ValidateResponse.Run(r) if r.Error != nil { + err := r.Error r.Handlers.UnmarshalError.Run(r) r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Validate Response", false, r.Error) return r.Error } + debugLogReqError(r, "Validate Response", true, err) continue } r.Handlers.Unmarshal.Run(r) if r.Error != nil { + err := r.Error r.Handlers.Retry.Run(r) r.Handlers.AfterRetry.Run(r) if r.Error != nil { + debugLogReqError(r, "Unmarshal Response", false, r.Error) return r.Error } + debugLogReqError(r, "Unmarshal Response", true, err) continue } @@ -228,85 +269,11 @@ 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 +// AddToUserAgent adds the string to the end of the request's current user agent. +func AddToUserAgent(r *Request, s string) { + curUA := r.HTTPRequest.Header.Get("User-Agent") + if len(curUA) > 0 { + s = curUA + " " + s + } + r.HTTPRequest.Header.Set("User-Agent", s) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go new file mode 100644 index 00000000000..b19fbd70b4a --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -0,0 +1,96 @@ +package request + +import ( + "reflect" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" +) + +//type Paginater interface { +// HasNextPage() bool +// NextPage() *Request +// EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error +//} + +// HasNextPage returns true if this request has more pages of data available. +func (r *Request) HasNextPage() bool { + return len(r.nextPageTokens()) > 0 +} + +// 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.ValuesAtPath(r.Data, r.Operation.TruncationToken) + if len(tr) == 0 { + return nil + } + + switch v := tr[0].(type) { + case *bool: + if !aws.BoolValue(v) { + return nil + } + case bool: + if v == false { + return nil + } + } + } + + tokens := []interface{}{} + for _, outToken := range r.Operation.OutputTokens { + v, _ := awsutil.ValuesAtPath(r.Data, outToken) + if len(v) > 0 { + tokens = append(tokens, v[0]) + } + } + + return tokens +} + +// 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 len(tokens) == 0 { + return nil + } + + data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() + nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data) + for i, intok := range nr.Operation.InputTokens { + awsutil.SetValueAtPath(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/request_pagination_test.go similarity index 71% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_pagination_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go index 6b20c073193..a9863eaf97f 100644 --- 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/request_pagination_test.go @@ -1,20 +1,108 @@ -package aws_test +package request_test import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting/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 TestPaginationQueryPage(t *testing.T) { + db := dynamodb.New(unit.Session) + tokens, pages, numPages, gotToEnd := []map[string]*dynamodb.AttributeValue{}, []map[string]*dynamodb.AttributeValue{}, 0, false + + reqNum := 0 + resps := []*dynamodb.QueryOutput{ + { + LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}}, + Count: aws.Int64(1), + Items: []map[string]*dynamodb.AttributeValue{ + map[string]*dynamodb.AttributeValue{ + "key": {S: aws.String("key1")}, + }, + }, + }, + { + LastEvaluatedKey: map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}}, + Count: aws.Int64(1), + Items: []map[string]*dynamodb.AttributeValue{ + map[string]*dynamodb.AttributeValue{ + "key": {S: aws.String("key2")}, + }, + }, + }, + { + LastEvaluatedKey: map[string]*dynamodb.AttributeValue{}, + Count: aws.Int64(1), + Items: []map[string]*dynamodb.AttributeValue{ + map[string]*dynamodb.AttributeValue{ + "key": {S: aws.String("key3")}, + }, + }, + }, + } + + db.Handlers.Send.Clear() // mock sending + db.Handlers.Unmarshal.Clear() + db.Handlers.UnmarshalMeta.Clear() + db.Handlers.ValidateResponse.Clear() + db.Handlers.Build.PushBack(func(r *request.Request) { + in := r.Params.(*dynamodb.QueryInput) + if in == nil { + tokens = append(tokens, nil) + } else if len(in.ExclusiveStartKey) != 0 { + tokens = append(tokens, in.ExclusiveStartKey) + } + }) + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[reqNum] + reqNum++ + }) + + params := &dynamodb.QueryInput{ + Limit: aws.Int64(2), + TableName: aws.String("tablename"), + } + err := db.QueryPages(params, func(p *dynamodb.QueryOutput, last bool) bool { + numPages++ + for _, item := range p.Items { + pages = append(pages, item) + } + if last { + if gotToEnd { + assert.Fail(t, "last=true happened twice") + } + gotToEnd = true + } + return true + }) + assert.Nil(t, err) + + assert.Equal(t, + []map[string]*dynamodb.AttributeValue{ + map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}}, + map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}}, + }, tokens) + assert.Equal(t, + []map[string]*dynamodb.AttributeValue{ + map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key1")}}, + map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key2")}}, + map[string]*dynamodb.AttributeValue{"key": {S: aws.String("key3")}}, + }, pages) + assert.Equal(t, 3, numPages) + assert.True(t, gotToEnd) + assert.Nil(t, params.ExclusiveStartKey) +} // Use DynamoDB methods for simplicity func TestPagination(t *testing.T) { - db := dynamodb.New(nil) + db := dynamodb.New(unit.Session) tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false reqNum := 0 @@ -28,7 +116,7 @@ func TestPagination(t *testing.T) { db.Handlers.Unmarshal.Clear() db.Handlers.UnmarshalMeta.Clear() db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { + db.Handlers.Build.PushBack(func(r *request.Request) { in := r.Params.(*dynamodb.ListTablesInput) if in == nil { tokens = append(tokens, "") @@ -36,7 +124,7 @@ func TestPagination(t *testing.T) { tokens = append(tokens, *in.ExclusiveStartTableName) } }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = resps[reqNum] reqNum++ }) @@ -66,7 +154,7 @@ func TestPagination(t *testing.T) { // Use DynamoDB methods for simplicity func TestPaginationEachPage(t *testing.T) { - db := dynamodb.New(nil) + db := dynamodb.New(unit.Session) tokens, pages, numPages, gotToEnd := []string{}, []string{}, 0, false reqNum := 0 @@ -80,7 +168,7 @@ func TestPaginationEachPage(t *testing.T) { db.Handlers.Unmarshal.Clear() db.Handlers.UnmarshalMeta.Clear() db.Handlers.ValidateResponse.Clear() - db.Handlers.Build.PushBack(func(r *aws.Request) { + db.Handlers.Build.PushBack(func(r *request.Request) { in := r.Params.(*dynamodb.ListTablesInput) if in == nil { tokens = append(tokens, "") @@ -88,7 +176,7 @@ func TestPaginationEachPage(t *testing.T) { tokens = append(tokens, *in.ExclusiveStartTableName) } }) - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = resps[reqNum] reqNum++ }) @@ -119,7 +207,7 @@ func TestPaginationEachPage(t *testing.T) { // Use DynamoDB methods for simplicity func TestPaginationEarlyExit(t *testing.T) { - db := dynamodb.New(nil) + db := dynamodb.New(unit.Session) numPages, gotToEnd := 0, false reqNum := 0 @@ -133,7 +221,7 @@ func TestPaginationEarlyExit(t *testing.T) { db.Handlers.Unmarshal.Clear() db.Handlers.UnmarshalMeta.Clear() db.Handlers.ValidateResponse.Clear() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = resps[reqNum] reqNum++ }) @@ -159,12 +247,12 @@ func TestPaginationEarlyExit(t *testing.T) { } func TestSkipPagination(t *testing.T) { - client := s3.New(nil) + client := s3.New(unit.Session) 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) { + client.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = &s3.HeadBucketOutput{} }) @@ -184,10 +272,9 @@ func TestSkipPagination(t *testing.T) { // Use S3 for simplicity func TestPaginationTruncation(t *testing.T) { - count := 0 - client := s3.New(nil) + client := s3.New(unit.Session) - reqNum := &count + reqNum := 0 resps := []*s3.ListObjectsOutput{ {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key1")}}}, {IsTruncated: aws.Bool(true), Contents: []*s3.Object{{Key: aws.String("Key2")}}}, @@ -199,9 +286,9 @@ func TestPaginationTruncation(t *testing.T) { 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++ + client.Handlers.Unmarshal.PushBack(func(r *request.Request) { + r.Data = resps[reqNum] + reqNum++ }) params := &s3.ListObjectsInput{Bucket: aws.String("bucket")} @@ -216,7 +303,7 @@ func TestPaginationTruncation(t *testing.T) { assert.Nil(t, err) // Try again without truncation token at all - count = 0 + reqNum = 0 resps[1].IsTruncated = nil resps[2].IsTruncated = aws.Bool(true) results = []string{} @@ -249,7 +336,7 @@ var benchResps = []*dynamodb.ListTablesOutput{ } var benchDb = func() *dynamodb.DynamoDB { - db := dynamodb.New(nil) + db := dynamodb.New(unit.Session) db.Handlers.Send.Clear() // mock sending db.Handlers.Unmarshal.Clear() db.Handlers.UnmarshalMeta.Clear() @@ -260,7 +347,7 @@ var benchDb = func() *dynamodb.DynamoDB { func BenchmarkCodegenIterator(b *testing.B) { reqNum := 0 db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = benchResps[reqNum] reqNum++ }) @@ -289,7 +376,7 @@ func BenchmarkCodegenIterator(b *testing.B) { func BenchmarkEachPageIterator(b *testing.B) { reqNum := 0 db := benchDb() - db.Handlers.Unmarshal.PushBack(func(r *aws.Request) { + db.Handlers.Unmarshal.PushBack(func(r *request.Request) { r.Data = benchResps[reqNum] reqNum++ }) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go similarity index 70% rename from Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go rename to Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go index d5d945d983f..4828dff7fda 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/request_test.go @@ -1,4 +1,4 @@ -package aws +package request_test import ( "bytes" @@ -7,12 +7,17 @@ import ( "io" "io/ioutil" "net/http" + "runtime" "testing" "time" + "github.com/stretchr/testify/assert" + + "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/stretchr/testify/assert" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting" ) type testData struct { @@ -23,7 +28,7 @@ func body(str string) io.ReadCloser { return ioutil.NopCloser(bytes.NewReader([]byte(str))) } -func unmarshal(req *Request) { +func unmarshal(req *request.Request) { defer req.HTTPResponse.Body.Close() if req.Data != nil { json.NewDecoder(req.HTTPResponse.Body).Decode(req.Data) @@ -31,7 +36,7 @@ func unmarshal(req *Request) { return } -func unmarshalError(req *Request) { +func unmarshalError(req *request.Request) { bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) if err != nil { req.Error = awserr.New("UnmarshaleError", req.HTTPResponse.Status, err) @@ -71,17 +76,17 @@ func TestRequestRecoverRetry5xx(t *testing.T) { {StatusCode: 200, Body: body(`{"data":"valid"}`)}, } - s := NewService(NewConfig().WithMaxRetries(10)) + s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.PushBack(unmarshal) s.Handlers.UnmarshalError.PushBack(unmarshalError) s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { + s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &reqs[reqNum] reqNum++ }) out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) err := r.Send() assert.Nil(t, err) assert.Equal(t, 2, int(r.RetryCount)) @@ -97,17 +102,17 @@ func TestRequestRecoverRetry4xxRetryable(t *testing.T) { {StatusCode: 200, Body: body(`{"data":"valid"}`)}, } - s := NewService(NewConfig().WithMaxRetries(10)) + s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.PushBack(unmarshal) s.Handlers.UnmarshalError.PushBack(unmarshalError) s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { + s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &reqs[reqNum] reqNum++ }) out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) err := r.Send() assert.Nil(t, err) assert.Equal(t, 2, int(r.RetryCount)) @@ -116,16 +121,16 @@ func TestRequestRecoverRetry4xxRetryable(t *testing.T) { // test that retries don't occur for 4xx status codes with a response type that can't be retried func TestRequest4xxUnretryable(t *testing.T) { - s := NewService(NewConfig().WithMaxRetries(10)) + s := awstesting.NewClient(aws.NewConfig().WithMaxRetries(10)) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.PushBack(unmarshal) s.Handlers.UnmarshalError.PushBack(unmarshalError) s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { + s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &http.Response{StatusCode: 401, Body: body(`{"__type":"SignatureDoesNotMatch","message":"Signature does not match."}`)} }) out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) err := r.Send() assert.NotNil(t, err) if e, ok := err.(awserr.RequestFailure); ok { @@ -140,7 +145,7 @@ func TestRequest4xxUnretryable(t *testing.T) { func TestRequestExhaustRetries(t *testing.T) { delays := []time.Duration{} - sleepDelay = func(delay time.Duration) { + sleepDelay := func(delay time.Duration) { delays = append(delays, delay) } @@ -152,16 +157,16 @@ func TestRequestExhaustRetries(t *testing.T) { {StatusCode: 500, Body: body(`{"__type":"UnknownError","message":"An error occurred."}`)}, } - s := NewService(NewConfig().WithMaxRetries(DefaultRetries)) + s := awstesting.NewClient(aws.NewConfig().WithSleepDelay(sleepDelay)) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.PushBack(unmarshal) s.Handlers.UnmarshalError.PushBack(unmarshalError) s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { + s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &reqs[reqNum] reqNum++ }) - r := NewRequest(s, &Operation{Name: "Operation"}, nil, nil) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) err := r.Send() assert.NotNil(t, err) if e, ok := err.(awserr.RequestFailure); ok { @@ -190,7 +195,7 @@ func TestRequestRecoverExpiredCreds(t *testing.T) { {StatusCode: 200, Body: body(`{"data":"valid"}`)}, } - s := NewService(&Config{MaxRetries: Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")}) + s := awstesting.NewClient(&aws.Config{MaxRetries: aws.Int(10), Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "")}) s.Handlers.Validate.Clear() s.Handlers.Unmarshal.PushBack(unmarshal) s.Handlers.UnmarshalError.PushBack(unmarshalError) @@ -198,21 +203,21 @@ func TestRequestRecoverExpiredCreds(t *testing.T) { credExpiredBeforeRetry := false credExpiredAfterRetry := false - s.Handlers.AfterRetry.PushBack(func(r *Request) { + s.Handlers.AfterRetry.PushBack(func(r *request.Request) { credExpiredAfterRetry = r.Config.Credentials.IsExpired() }) s.Handlers.Sign.Clear() - s.Handlers.Sign.PushBack(func(r *Request) { + s.Handlers.Sign.PushBack(func(r *request.Request) { r.Config.Credentials.Get() }) s.Handlers.Send.Clear() // mock sending - s.Handlers.Send.PushBack(func(r *Request) { + s.Handlers.Send.PushBack(func(r *request.Request) { r.HTTPResponse = &reqs[reqNum] reqNum++ }) out := &testData{} - r := NewRequest(s, &Operation{Name: "Operation"}, nil, out) + r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) err := r.Send() assert.Nil(t, err) @@ -223,3 +228,34 @@ func TestRequestRecoverExpiredCreds(t *testing.T) { assert.Equal(t, 1, int(r.RetryCount)) assert.Equal(t, "valid", out.Data) } + +func TestMakeAddtoUserAgentHandler(t *testing.T) { + fn := request.MakeAddToUserAgentHandler("name", "version", "extra1", "extra2") + r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}} + r.HTTPRequest.Header.Set("User-Agent", "foo/bar") + fn(r) + + assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent")) +} + +func TestMakeAddtoUserAgentFreeFormHandler(t *testing.T) { + fn := request.MakeAddToUserAgentFreeFormHandler("name/version (extra1; extra2)") + r := &request.Request{HTTPRequest: &http.Request{Header: http.Header{}}} + r.HTTPRequest.Header.Set("User-Agent", "foo/bar") + fn(r) + + assert.Equal(t, "foo/bar name/version (extra1; extra2)", r.HTTPRequest.Header.Get("User-Agent")) +} + +func TestRequestUserAgent(t *testing.T) { + s := awstesting.NewClient(&aws.Config{Region: aws.String("us-east-1")}) + // s.Handlers.Validate.Clear() + + req := s.NewRequest(&request.Operation{Name: "Operation"}, nil, &testData{}) + req.HTTPRequest.Header.Set("User-Agent", "foo/bar") + assert.NoError(t, req.Build()) + + expectUA := fmt.Sprintf("foo/bar %s/%s (%s; %s; %s)", + aws.SDKName, aws.SDKVersion, runtime.Version(), runtime.GOOS, runtime.GOARCH) + assert.Equal(t, expectUA, req.HTTPRequest.Header.Get("User-Agent")) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go new file mode 100644 index 00000000000..b06143b8358 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -0,0 +1,74 @@ +package request + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +// Retryer is an interface to control retry logic for a given service. +// The default implementation used by most services is the service.DefaultRetryer +// structure, which contains basic retry logic using exponential backoff. +type Retryer interface { + RetryRules(*Request) time.Duration + ShouldRetry(*Request) bool + MaxRetries() int +} + +// retryableCodes is a collection of service response codes which are retry-able +// without any further action. +var retryableCodes = map[string]struct{}{ + "RequestError": {}, + "RequestTimeout": {}, + "ProvisionedThroughputExceededException": {}, + "Throttling": {}, + "ThrottlingException": {}, + "RequestLimitExceeded": {}, + "RequestThrottled": {}, + "LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once + "TooManyRequestsException": {}, // Lambda functions +} + +// 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": {}, + "ExpiredTokenException": {}, + "RequestExpired": {}, // 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 +} + +// IsErrorRetryable returns whether the error is retryable, based on its Code. +// Returns false if the request has no Error set. +func (r *Request) IsErrorRetryable() bool { + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + return isCodeRetryable(err.Code()) + } + } + return false +} + +// IsErrorExpired returns whether the error code is a credential expiry error. +// Returns false if the request has no Error set. +func (r *Request) IsErrorExpired() bool { + if r.Error != nil { + if err, ok := r.Error.(awserr.Error); ok { + return isCodeExpiredCreds(err.Code()) + } + } + return false +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go deleted file mode 100644 index 672f7de1d63..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/service.go +++ /dev/null @@ -1,194 +0,0 @@ -package aws - -import ( - "fmt" - "math" - "math/rand" - "net/http" - "net/http/httputil" - "regexp" - "time" - - "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 -// used by all services. -type Service struct { - Config *Config - Handlers Handlers - ServiceName string - APIVersion string - Endpoint string - SigningName string - SigningRegion string - JSONVersion string - TargetPrefix string - RetryRules func(*Request) time.Duration - ShouldRetry func(*Request) bool - DefaultMaxRetries uint -} - -var schemeRE = regexp.MustCompile("^([^:]+)://") - -// NewService will return a pointer to a new Server object initialized. -func NewService(config *Config) *Service { - svc := &Service{Config: config} - svc.Initialize() - return svc -} - -// Initialize initializes the service. -func (s *Service) Initialize() { - if s.Config == nil { - s.Config = &Config{} - } - if s.Config.HTTPClient == nil { - s.Config.HTTPClient = http.DefaultClient - } - - if s.RetryRules == nil { - s.RetryRules = retryRules - } - - if s.ShouldRetry == nil { - s.ShouldRetry = shouldRetry - } - - s.DefaultMaxRetries = 3 - s.Handlers.Validate.PushBack(ValidateEndpointHandler) - s.Handlers.Build.PushBack(UserAgentHandler) - s.Handlers.Sign.PushBack(BuildContentLength) - s.Handlers.Send.PushBack(SendHandler) - s.Handlers.AfterRetry.PushBack(AfterRetryHandler) - s.Handlers.ValidateResponse.PushBack(ValidateResponseHandler) - s.AddDebugHandlers() - s.buildEndpoint() - - if !BoolValue(s.Config.DisableParamValidation) { - s.Handlers.Validate.PushBack(ValidateParameters) - } -} - -// buildEndpoint builds the endpoint values the service will use to make requests with. -func (s *Service) buildEndpoint() { - if StringValue(s.Config.Endpoint) != "" { - s.Endpoint = *s.Config.Endpoint - } else { - s.Endpoint, s.SigningRegion = - endpoints.EndpointForRegion(s.ServiceName, StringValue(s.Config.Region)) - } - - if s.Endpoint != "" && !schemeRE.MatchString(s.Endpoint) { - scheme := "https" - if BoolValue(s.Config.DisableSSL) { - scheme = "http" - } - s.Endpoint = scheme + "://" + s.Endpoint - } -} - -// AddDebugHandlers injects debug logging handlers into the service to log request -// debug information. -func (s *Service) AddDebugHandlers() { - if !s.Config.LogLevel.AtLeast(LogDebug) { - return - } - - s.Handlers.Send.PushFront(logRequest) - s.Handlers.Send.PushBack(logResponse) -} - -const logReqMsg = `DEBUG: Request %s/%s Details: ----[ REQUEST POST-SIGN ]----------------------------- -%s ------------------------------------------------------` - -func logRequest(r *Request) { - logBody := r.Config.LogLevel.Matches(LogDebugWithHTTPBody) - dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody) - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ServiceName, r.Operation.Name, string(dumpedBody))) -} - -const logRespMsg = `DEBUG: Response %s/%s Details: ----[ RESPONSE ]-------------------------------------- -%s ------------------------------------------------------` - -func logResponse(r *Request) { - var msg = "no reponse data" - if r.HTTPResponse != nil { - logBody := r.Config.LogLevel.Matches(LogDebugWithHTTPBody) - dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody) - msg = string(dumpedBody) - } else if r.Error != nil { - msg = r.Error.Error() - } - r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ServiceName, r.Operation.Name, msg)) -} - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API request. -func (s *Service) MaxRetries() uint { - if IntValue(s.Config.MaxRetries) < 0 { - return s.DefaultMaxRetries - } - return uint(IntValue(s.Config.MaxRetries)) -} - -var seededRand = rand.New(rand.NewSource(time.Now().UnixNano())) - -// retryRules returns the delay duration before retrying this request again -func retryRules(r *Request) time.Duration { - - delay := int(math.Pow(2, float64(r.RetryCount))) * (seededRand.Intn(30) + 30) - return time.Duration(delay) * time.Millisecond -} - -// retryableCodes is a collection of service response codes which are retry-able -// without any further action. -var retryableCodes = map[string]struct{}{ - "RequestError": {}, - "ProvisionedThroughputExceededException": {}, - "Throttling": {}, - "ThrottlingException": {}, - "RequestLimitExceeded": {}, - "RequestThrottled": {}, -} - -// 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": {}, - "ExpiredTokenException": {}, - "RequestExpired": {}, // 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 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/aws/aws-sdk-go/aws/session/session.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go new file mode 100644 index 00000000000..eb7fc2052f1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session.go @@ -0,0 +1,105 @@ +// Package session provides a way to create service clients with shared configuration +// and handlers. +package session + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/corehandlers" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/endpoints" +) + +// A Session provides a central location to create service clients from and +// store configurations and request handlers for those services. +// +// Sessions are safe to create service clients concurrently, but it is not safe +// to mutate the session concurrently. +type Session struct { + Config *aws.Config + Handlers request.Handlers +} + +// New creates a new instance of the handlers merging in the provided Configs +// on top of the SDK's default configurations. Once the session is created it +// can be mutated to modify Configs or Handlers. The session is safe to be read +// concurrently, but it should not be written to concurrently. +// +// Example: +// // Create a session with the default config and request handlers. +// sess := session.New() +// +// // Create a session with a custom region +// sess := session.New(&aws.Config{Region: aws.String("us-east-1")}) +// +// // Create a session, and add additional handlers for all service +// // clients created with the session to inherit. Adds logging handler. +// sess := session.New() +// sess.Handlers.Send.PushFront(func(r *request.Request) { +// // Log every request made and its payload +// logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params) +// }) +// +// // Create a S3 client instance from a session +// sess := session.New() +// svc := s3.New(sess) +func New(cfgs ...*aws.Config) *Session { + def := defaults.Get() + s := &Session{ + Config: def.Config, + Handlers: def.Handlers, + } + s.Config.MergeIn(cfgs...) + + initHandlers(s) + + return s +} + +func initHandlers(s *Session) { + // Add the Validate parameter handler if it is not disabled. + s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) + if !aws.BoolValue(s.Config.DisableParamValidation) { + s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler) + } +} + +// Copy creates and returns a copy of the current session, coping the config +// and handlers. If any additional configs are provided they will be merged +// on top of the session's copied config. +// +// Example: +// // Create a copy of the current session, configured for the us-west-2 region. +// sess.Copy(&aws.Config{Region: aws.String("us-west-2"}) +func (s *Session) Copy(cfgs ...*aws.Config) *Session { + newSession := &Session{ + Config: s.Config.Copy(cfgs...), + Handlers: s.Handlers.Copy(), + } + + initHandlers(newSession) + + return newSession +} + +// ClientConfig satisfies the client.ConfigProvider interface and is used to +// configure the service client instances. Passing the Session to the service +// client's constructor (New) will use this method to configure the client. +// +// Example: +// sess := session.New() +// s3.New(sess) +func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { + s = s.Copy(cfgs...) + endpoint, signingRegion := endpoints.NormalizeEndpoint( + aws.StringValue(s.Config.Endpoint), serviceName, + aws.StringValue(s.Config.Region), aws.BoolValue(s.Config.DisableSSL)) + + return client.Config{ + Config: s.Config, + Handlers: s.Handlers, + Endpoint: endpoint, + SigningRegion: signingRegion, + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go new file mode 100644 index 00000000000..e56c02fc661 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/session/session_test.go @@ -0,0 +1,20 @@ +package session_test + +import ( + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" +) + +func TestNewDefaultSession(t *testing.T) { + s := session.New(&aws.Config{Region: aws.String("region")}) + + assert.Equal(t, "region", *s.Config.Region) + assert.Equal(t, http.DefaultClient, s.Config.HTTPClient) + assert.NotNil(t, s.Config.Logger) + assert.Equal(t, aws.LogOff, *s.Config.LogLevel) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go index 87905d7e06e..0f067c57f4e 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types.go @@ -2,9 +2,10 @@ package aws import ( "io" + "sync" ) -// ReadSeekCloser wraps a io.Reader returning a ReaderSeakerCloser +// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { return ReaderSeekerCloser{r} } @@ -53,3 +54,35 @@ func (r ReaderSeekerCloser) Close() error { } return nil } + +// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface +// Can be used with the s3manager.Downloader to download content to a buffer +// in memory. Safe to use concurrently. +type WriteAtBuffer struct { + buf []byte + m sync.Mutex +} + +// WriteAt writes a slice of bytes to a buffer starting at the position provided +// The number of bytes written will be returned, or error. Can overwrite previous +// written slices if the write ats overlap. +func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) { + b.m.Lock() + defer b.m.Unlock() + + expLen := pos + int64(len(p)) + if int64(len(b.buf)) < expLen { + newBuf := make([]byte, expLen) + copy(newBuf, b.buf) + b.buf = newBuf + } + copy(b.buf[pos:], p) + return len(p), nil +} + +// Bytes returns a slice of bytes written to the buffer. +func (b *WriteAtBuffer) Bytes() []byte { + b.m.Lock() + defer b.m.Unlock() + return b.buf[:len(b.buf):len(b.buf)] +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go new file mode 100644 index 00000000000..a4ed20e7d22 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/types_test.go @@ -0,0 +1,56 @@ +package aws + +import ( + "math/rand" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestWriteAtBuffer(t *testing.T) { + b := &WriteAtBuffer{} + + n, err := b.WriteAt([]byte{1}, 0) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + n, err = b.WriteAt([]byte{1, 1, 1}, 5) + assert.NoError(t, err) + assert.Equal(t, 3, n) + + n, err = b.WriteAt([]byte{2}, 1) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + n, err = b.WriteAt([]byte{3}, 2) + assert.NoError(t, err) + assert.Equal(t, 1, n) + + assert.Equal(t, []byte{1, 2, 3, 0, 0, 1, 1, 1}, b.Bytes()) +} + +func BenchmarkWriteAtBuffer(b *testing.B) { + buf := &WriteAtBuffer{} + r := rand.New(rand.NewSource(1)) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + to := r.Intn(10) * 4096 + bs := make([]byte, to) + buf.WriteAt(bs, r.Int63n(10)*4096) + } +} + +func BenchmarkWriteAtBufferParallel(b *testing.B) { + buf := &WriteAtBuffer{} + r := rand.New(rand.NewSource(1)) + + b.ResetTimer() + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + to := r.Intn(10) * 4096 + bs := make([]byte, to) + buf.WriteAt(bs, r.Int63n(10)*4096) + } + }) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/version.go index 681a6e265c1..f4741adfb44 100644 --- a/Godeps/_workspace/src/github.com/aws/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.7.3" +const SDKVersion = "0.10.4" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go new file mode 100644 index 00000000000..2b279e65999 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go @@ -0,0 +1,65 @@ +// Package endpoints validates regional endpoints for services. +package endpoints + +//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go +//go:generate gofmt -s -w endpoints_map.go + +import ( + "fmt" + "regexp" + "strings" +) + +// NormalizeEndpoint takes and endpoint and service API information to return a +// normalized endpoint and signing region. If the endpoint is not an empty string +// the service name and region will be used to look up the service's API endpoint. +// If the endpoint is provided the scheme will be added if it is not present. +func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (normEndpoint, signingRegion string) { + if endpoint == "" { + return EndpointForRegion(serviceName, region, disableSSL) + } + + return AddScheme(endpoint, disableSSL), "" +} + +// EndpointForRegion returns an endpoint and its signing region for a service and region. +// if the service and region pair are not found endpoint and signingRegion will be empty. +func EndpointForRegion(svcName, region string, disableSSL bool) (endpoint, signingRegion string) { + derivedKeys := []string{ + region + "/" + svcName, + region + "/*", + "*/" + svcName, + "*/*", + } + + for _, key := range derivedKeys { + if val, ok := endpointsMap.Endpoints[key]; ok { + ep := val.Endpoint + ep = strings.Replace(ep, "{region}", region, -1) + ep = strings.Replace(ep, "{service}", svcName, -1) + + endpoint = ep + signingRegion = val.SigningRegion + break + } + } + + return AddScheme(endpoint, disableSSL), signingRegion +} + +// Regular expression to determine if the endpoint string is prefixed with a scheme. +var schemeRE = regexp.MustCompile("^([^:]+)://") + +// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no +// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS. +func AddScheme(endpoint string, disableSSL bool) string { + if endpoint != "" && !schemeRE.MatchString(endpoint) { + scheme := "https" + if disableSSL { + scheme = "http" + } + endpoint = fmt.Sprintf("%s://%s", scheme, endpoint) + } + + return endpoint +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json new file mode 100644 index 00000000000..ea819b1ec35 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json @@ -0,0 +1,89 @@ +{ + "version": 2, + "endpoints": { + "*/*": { + "endpoint": "{service}.{region}.amazonaws.com" + }, + "cn-north-1/*": { + "endpoint": "{service}.{region}.amazonaws.com.cn", + "signatureVersion": "v4" + }, + "us-gov-west-1/iam": { + "endpoint": "iam.us-gov.amazonaws.com" + }, + "us-gov-west-1/sts": { + "endpoint": "sts.us-gov-west-1.amazonaws.com" + }, + "us-gov-west-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "*/cloudfront": { + "endpoint": "cloudfront.amazonaws.com", + "signingRegion": "us-east-1" + }, + "*/cloudsearchdomain": { + "endpoint": "", + "signingRegion": "us-east-1" + }, + "*/data.iot": { + "endpoint": "", + "signingRegion": "us-east-1" + }, + "*/ec2metadata": { + "endpoint": "http://169.254.169.254/latest", + "signingRegion": "us-east-1" + }, + "*/iam": { + "endpoint": "iam.amazonaws.com", + "signingRegion": "us-east-1" + }, + "*/importexport": { + "endpoint": "importexport.amazonaws.com", + "signingRegion": "us-east-1" + }, + "*/route53": { + "endpoint": "route53.amazonaws.com", + "signingRegion": "us-east-1" + }, + "*/sts": { + "endpoint": "sts.amazonaws.com", + "signingRegion": "us-east-1" + }, + "*/waf": { + "endpoint": "waf.amazonaws.com", + "signingRegion": "us-east-1" + }, + "us-east-1/sdb": { + "endpoint": "sdb.amazonaws.com", + "signingRegion": "us-east-1" + }, + "us-east-1/s3": { + "endpoint": "s3.amazonaws.com" + }, + "us-west-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "us-west-2/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "eu-west-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "ap-southeast-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "ap-southeast-2/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "ap-northeast-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "sa-east-1/s3": { + "endpoint": "s3-{region}.amazonaws.com" + }, + "eu-central-1/s3": { + "endpoint": "{service}.{region}.amazonaws.com", + "signatureVersion": "v4" + } + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go new file mode 100644 index 00000000000..3fab91c7f19 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go @@ -0,0 +1,101 @@ +package endpoints + +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +type endpointStruct struct { + Version int + Endpoints map[string]endpointEntry +} + +type endpointEntry struct { + Endpoint string + SigningRegion string +} + +var endpointsMap = endpointStruct{ + Version: 2, + Endpoints: map[string]endpointEntry{ + "*/*": { + Endpoint: "{service}.{region}.amazonaws.com", + }, + "*/cloudfront": { + Endpoint: "cloudfront.amazonaws.com", + SigningRegion: "us-east-1", + }, + "*/cloudsearchdomain": { + Endpoint: "", + SigningRegion: "us-east-1", + }, + "*/data.iot": { + Endpoint: "", + SigningRegion: "us-east-1", + }, + "*/ec2metadata": { + Endpoint: "http://169.254.169.254/latest", + SigningRegion: "us-east-1", + }, + "*/iam": { + Endpoint: "iam.amazonaws.com", + SigningRegion: "us-east-1", + }, + "*/importexport": { + Endpoint: "importexport.amazonaws.com", + SigningRegion: "us-east-1", + }, + "*/route53": { + Endpoint: "route53.amazonaws.com", + SigningRegion: "us-east-1", + }, + "*/sts": { + Endpoint: "sts.amazonaws.com", + SigningRegion: "us-east-1", + }, + "*/waf": { + Endpoint: "waf.amazonaws.com", + SigningRegion: "us-east-1", + }, + "ap-northeast-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "ap-southeast-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "ap-southeast-2/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "cn-north-1/*": { + Endpoint: "{service}.{region}.amazonaws.com.cn", + }, + "eu-central-1/s3": { + Endpoint: "{service}.{region}.amazonaws.com", + }, + "eu-west-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "sa-east-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "us-east-1/s3": { + Endpoint: "s3.amazonaws.com", + }, + "us-east-1/sdb": { + Endpoint: "sdb.amazonaws.com", + SigningRegion: "us-east-1", + }, + "us-gov-west-1/iam": { + Endpoint: "iam.us-gov.amazonaws.com", + }, + "us-gov-west-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "us-gov-west-1/sts": { + Endpoint: "sts.us-gov-west-1.amazonaws.com", + }, + "us-west-1/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + "us-west-2/s3": { + Endpoint: "s3-{region}.amazonaws.com", + }, + }, +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go new file mode 100644 index 00000000000..2add48890b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/endpoints/endpoints_test.go @@ -0,0 +1,41 @@ +package endpoints_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/private/endpoints" +) + +func TestGenericEndpoint(t *testing.T) { + name := "service" + region := "mock-region-1" + + ep, sr := endpoints.EndpointForRegion(name, region, false) + assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com", name, region), ep) + assert.Empty(t, sr) +} + +func TestGlobalEndpoints(t *testing.T) { + region := "mock-region-1" + svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "waf"} + + for _, name := range svcs { + ep, sr := endpoints.EndpointForRegion(name, region, false) + assert.Equal(t, fmt.Sprintf("https://%s.amazonaws.com", name), ep) + assert.Equal(t, "us-east-1", sr) + } +} + +func TestServicesInCN(t *testing.T) { + region := "cn-north-1" + svcs := []string{"cloudfront", "iam", "importexport", "route53", "sts", "s3", "waf"} + + for _, name := range svcs { + ep, sr := endpoints.EndpointForRegion(name, region, false) + assert.Equal(t, fmt.Sprintf("https://%s.%s.amazonaws.com.cn", name, region), ep) + assert.Empty(t, sr) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go new file mode 100644 index 00000000000..0ead0126ee8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go @@ -0,0 +1,32 @@ +// Package ec2query provides serialisation of AWS EC2 requests and responses. +package ec2query + +//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/ec2.json build_test.go + +import ( + "net/url" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" +) + +// Build builds a request for the EC2 protocol. +func Build(r *request.Request) { + body := url.Values{ + "Action": {r.Operation.Name}, + "Version": {r.ClientInfo.APIVersion}, + } + if err := queryutil.Parse(body, r.Params, true); err != nil { + r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err) + } + + if r.ExpireTime == 0 { + r.HTTPRequest.Method = "POST" + r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") + r.SetBufferBody([]byte(body.Encode())) + } else { // This is a pre-signed request + r.HTTPRequest.Method = "GET" + r.HTTPRequest.URL.RawQuery = body.Encode() + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go new file mode 100644 index 00000000000..e135b93601d --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go @@ -0,0 +1,85 @@ +// +build bench + +package ec2query_test + +import ( + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/protocol/ec2query" + "github.com/aws/aws-sdk-go/service/ec2" +) + +func BenchmarkEC2QueryBuild_Complex_ec2AuthorizeSecurityGroupEgress(b *testing.B) { + params := &ec2.AuthorizeSecurityGroupEgressInput{ + GroupId: aws.String("String"), // Required + CidrIp: aws.String("String"), + DryRun: aws.Bool(true), + FromPort: aws.Int64(1), + IpPermissions: []*ec2.IpPermission{ + { // Required + FromPort: aws.Int64(1), + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ + { // Required + CidrIp: aws.String("String"), + }, + // More values... + }, + PrefixListIds: []*ec2.PrefixListId{ + { // Required + PrefixListId: aws.String("String"), + }, + // More values... + }, + ToPort: aws.Int64(1), + UserIdGroupPairs: []*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.Int64(1), + } + + benchEC2QueryBuild(b, "AuthorizeSecurityGroupEgress", params) +} + +func BenchmarkEC2QueryBuild_Simple_ec2AttachNetworkInterface(b *testing.B) { + params := &ec2.AttachNetworkInterfaceInput{ + DeviceIndex: aws.Int64(1), // Required + InstanceId: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + + benchEC2QueryBuild(b, "AttachNetworkInterface", params) +} + +func benchEC2QueryBuild(b *testing.B, opName string, params interface{}) { + svc := awstesting.NewClient() + svc.ServiceName = "ec2" + svc.APIVersion = "2015-04-15" + + for i := 0; i < b.N; i++ { + r := svc.NewRequest(&request.Operation{ + Name: opName, + HTTPMethod: "POST", + HTTPPath: "/", + }, params, nil) + ec2query.Build(r) + if r.Error != nil { + b.Fatal("Unexpected error", r.Error) + } + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go new file mode 100644 index 00000000000..887feeb1ea8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go @@ -0,0 +1,1051 @@ +package ec2query_test + +import ( + "bytes" + "encoding/json" + "encoding/xml" + "io" + "io/ioutil" + "net/http" + "net/url" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/protocol/ec2query" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/private/signer/v4" + "github.com/aws/aws-sdk-go/private/util" + "github.com/stretchr/testify/assert" +) + +var _ bytes.Buffer // always import bytes +var _ http.Request +var _ json.Marshaler +var _ time.Time +var _ xmlutil.XMLNode +var _ xml.Attr +var _ = awstesting.GenerateAssertions +var _ = ioutil.Discard +var _ = util.Trim("") +var _ = url.Values{} +var _ = io.EOF +var _ = aws.String + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService1ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService1ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService1ProtocolTest client from just a session. +// svc := inputservice1protocoltest.New(mySession) +// +// // Create a InputService1ProtocolTest client with additional configuration +// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest { + c := p.ClientConfig("inputservice1protocoltest", cfgs...) + return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService1ProtocolTest { + svc := &InputService1ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice1protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService1ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService1TestCaseOperation1 = "OperationName" + +// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation1, + } + + if input == nil { + input = &InputService1TestShapeInputService1TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService1TestShapeInputService1TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputService1TestCaseOperation1Input) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { + req, out := c.InputService1TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService1TestShapeInputService1TestCaseOperation1Input struct { + Bar *string `type:"string"` + + Foo *string `type:"string"` + + metadataInputService1TestShapeInputService1TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputService1TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService1TestShapeInputService1TestCaseOperation1Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService2ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService2ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService2ProtocolTest client from just a session. +// svc := inputservice2protocoltest.New(mySession) +// +// // Create a InputService2ProtocolTest client with additional configuration +// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest { + c := p.ClientConfig("inputservice2protocoltest", cfgs...) + return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService2ProtocolTest { + svc := &InputService2ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice2protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService2ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService2TestCaseOperation1 = "OperationName" + +// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService2TestCaseOperation1, + } + + if input == nil { + input = &InputService2TestShapeInputService2TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService2TestShapeInputService2TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { + req, out := c.InputService2TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService2TestShapeInputService2TestCaseOperation1Input struct { + Bar *string `locationName:"barLocationName" type:"string"` + + Foo *string `type:"string"` + + Yuck *string `locationName:"yuckLocationName" queryName:"yuckQueryName" type:"string"` + + metadataInputService2TestShapeInputService2TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeInputService2TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService2TestShapeInputService2TestCaseOperation1Output struct { + metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService3ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService3ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService3ProtocolTest client from just a session. +// svc := inputservice3protocoltest.New(mySession) +// +// // Create a InputService3ProtocolTest client with additional configuration +// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest { + c := p.ClientConfig("inputservice3protocoltest", cfgs...) + return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService3ProtocolTest { + svc := &InputService3ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice3protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService3ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService3TestCaseOperation1 = "OperationName" + +// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputService3TestCaseOperation1Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService3TestCaseOperation1, + } + + if input == nil { + input = &InputService3TestShapeInputService3TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService3TestShapeInputService3TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputService3TestCaseOperation1Input) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { + req, out := c.InputService3TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService3TestShapeInputService3TestCaseOperation1Input struct { + StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"` + + metadataInputService3TestShapeInputService3TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeInputService3TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService3TestShapeInputService3TestCaseOperation1Output struct { + metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService3TestShapeStructType struct { + ScalarArg *string `locationName:"Scalar" type:"string"` + + metadataInputService3TestShapeStructType `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeStructType struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService4ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService4ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService4ProtocolTest client from just a session. +// svc := inputservice4protocoltest.New(mySession) +// +// // Create a InputService4ProtocolTest client with additional configuration +// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest { + c := p.ClientConfig("inputservice4protocoltest", cfgs...) + return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService4ProtocolTest { + svc := &InputService4ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice4protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService4ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService4TestCaseOperation1 = "OperationName" + +// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputService4TestCaseOperation1Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService4TestCaseOperation1, + } + + if input == nil { + input = &InputService4TestShapeInputService4TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService4TestShapeInputService4TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputService4TestCaseOperation1Input) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { + req, out := c.InputService4TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService4TestShapeInputService4TestCaseOperation1Input struct { + ListArg []*string `type:"list"` + + metadataInputService4TestShapeInputService4TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService4TestShapeInputService4TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService4TestShapeInputService4TestCaseOperation1Output struct { + metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService5ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService5ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService5ProtocolTest client from just a session. +// svc := inputservice5protocoltest.New(mySession) +// +// // Create a InputService5ProtocolTest client with additional configuration +// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest { + c := p.ClientConfig("inputservice5protocoltest", cfgs...) + return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService5ProtocolTest { + svc := &InputService5ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice5protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService5ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService5TestCaseOperation1 = "OperationName" + +// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService5TestCaseOperation1, + } + + if input == nil { + input = &InputService5TestShapeInputService5TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService5TestShapeInputService5TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { + req, out := c.InputService5TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService5TestShapeInputService5TestCaseOperation1Input struct { + ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"` + + metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService5TestShapeInputService5TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService5TestShapeInputService5TestCaseOperation1Output struct { + metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService6ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService6ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService6ProtocolTest client from just a session. +// svc := inputservice6protocoltest.New(mySession) +// +// // Create a InputService6ProtocolTest client with additional configuration +// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest { + c := p.ClientConfig("inputservice6protocoltest", cfgs...) + return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService6ProtocolTest { + svc := &InputService6ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice6protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService6ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService6TestCaseOperation1 = "OperationName" + +// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService6TestCaseOperation1, + } + + if input == nil { + input = &InputService6TestShapeInputService6TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService6TestShapeInputService6TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { + req, out := c.InputService6TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService6TestShapeInputService6TestCaseOperation1Input struct { + ListArg []*string `locationName:"ListMemberName" queryName:"ListQueryName" locationNameList:"item" type:"list"` + + metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService6TestShapeInputService6TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService6TestShapeInputService6TestCaseOperation1Output struct { + metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService7ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService7ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService7ProtocolTest client from just a session. +// svc := inputservice7protocoltest.New(mySession) +// +// // Create a InputService7ProtocolTest client with additional configuration +// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest { + c := p.ClientConfig("inputservice7protocoltest", cfgs...) + return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService7ProtocolTest { + svc := &InputService7ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice7protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService7ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService7TestCaseOperation1 = "OperationName" + +// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService7TestCaseOperation1, + } + + if input == nil { + input = &InputService7TestShapeInputService7TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService7TestShapeInputService7TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { + req, out := c.InputService7TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService7TestShapeInputService7TestCaseOperation1Input struct { + BlobArg []byte `type:"blob"` + + metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService7TestShapeInputService7TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService7TestShapeInputService7TestCaseOperation1Output struct { + metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService8ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService8ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService8ProtocolTest client from just a session. +// svc := inputservice8protocoltest.New(mySession) +// +// // Create a InputService8ProtocolTest client with additional configuration +// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest { + c := p.ClientConfig("inputservice8protocoltest", cfgs...) + return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService8ProtocolTest { + svc := &InputService8ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice8protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService8ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService8TestCaseOperation1 = "OperationName" + +// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService8TestCaseOperation1, + } + + if input == nil { + input = &InputService8TestShapeInputService8TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService8TestShapeInputService8TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { + req, out := c.InputService8TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService8TestShapeInputService8TestCaseOperation1Input struct { + TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService8TestShapeInputService8TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService8TestShapeInputService8TestCaseOperation1Output struct { + metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +// +// Tests begin here +// + +func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { + sess := session.New() + svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService1TestShapeInputService1TestCaseOperation1Input{ + Bar: aws.String("val2"), + Foo: aws.String("val1"), + } + req, _ := svc.InputService1TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Bar=val2&Foo=val1&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedToMembersCase1(t *testing.T) { + sess := session.New() + svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService2TestShapeInputService2TestCaseOperation1Input{ + Bar: aws.String("val2"), + Foo: aws.String("val1"), + Yuck: aws.String("val3"), + } + req, _ := svc.InputService2TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&BarLocationName=val2&Foo=val1&Version=2014-01-01&yuckQueryName=val3`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) { + sess := session.New() + svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService3TestShapeInputService3TestCaseOperation1Input{ + StructArg: &InputService3TestShapeStructType{ + ScalarArg: aws.String("foo"), + }, + } + req, _ := svc.InputService3TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Struct.Scalar=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService4ProtocolTestListTypesCase1(t *testing.T) { + sess := session.New() + svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService4TestShapeInputService4TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("foo"), + aws.String("bar"), + aws.String("baz"), + }, + } + req, _ := svc.InputService4TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *testing.T) { + sess := session.New() + svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService5TestShapeInputService5TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), + }, + } + req, _ := svc.InputService5TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListMemberName.1=a&ListMemberName.2=b&ListMemberName.3=c&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(t *testing.T) { + sess := session.New() + svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService6TestShapeInputService6TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), + }, + } + req, _ := svc.InputService6TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListQueryName.1=a&ListQueryName.2=b&ListQueryName.3=c&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { + sess := session.New() + svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService7TestShapeInputService7TestCaseOperation1Input{ + BlobArg: []byte("foo"), + } + req, _ := svc.InputService7TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&BlobArg=Zm9v&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { + sess := session.New() + svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService8TestShapeInputService8TestCaseOperation1Input{ + TimeArg: aws.Time(time.Unix(1422172800, 0)), + } + req, _ := svc.InputService8TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + ec2query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go new file mode 100644 index 00000000000..658190f7051 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go @@ -0,0 +1,54 @@ +package ec2query + +//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/ec2.json unmarshal_test.go + +import ( + "encoding/xml" + "io" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" +) + +// Unmarshal unmarshals a response body for the EC2 protocol. +func Unmarshal(r *request.Request) { + defer r.HTTPResponse.Body.Close() + if r.DataFilled() { + decoder := xml.NewDecoder(r.HTTPResponse.Body) + err := xmlutil.UnmarshalXML(r.Data, decoder, "") + if err != nil { + r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err) + return + } + } +} + +// UnmarshalMeta unmarshals response headers for the EC2 protocol. +func UnmarshalMeta(r *request.Request) { + // TODO implement unmarshaling of request IDs +} + +type xmlErrorResponse struct { + XMLName xml.Name `xml:"Response"` + Code string `xml:"Errors>Error>Code"` + Message string `xml:"Errors>Error>Message"` + RequestID string `xml:"RequestId"` +} + +// UnmarshalError unmarshals a response error for the EC2 protocol. +func UnmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + resp := &xmlErrorResponse{} + err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) + if err != nil && err != io.EOF { + r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err) + } else { + r.Error = awserr.NewRequestFailure( + awserr.New(resp.Code, resp.Message, nil), + r.HTTPResponse.StatusCode, + resp.RequestID, + ) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go new file mode 100644 index 00000000000..c347c371c10 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go @@ -0,0 +1,1132 @@ +package ec2query_test + +import ( + "bytes" + "encoding/json" + "encoding/xml" + "io" + "io/ioutil" + "net/http" + "net/url" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/protocol/ec2query" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/private/signer/v4" + "github.com/aws/aws-sdk-go/private/util" + "github.com/stretchr/testify/assert" +) + +var _ bytes.Buffer // always import bytes +var _ http.Request +var _ json.Marshaler +var _ time.Time +var _ xmlutil.XMLNode +var _ xml.Attr +var _ = awstesting.GenerateAssertions +var _ = ioutil.Discard +var _ = util.Trim("") +var _ = url.Values{} +var _ = io.EOF +var _ = aws.String + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService1ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService1ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService1ProtocolTest client from just a session. +// svc := outputservice1protocoltest.New(mySession) +// +// // Create a OutputService1ProtocolTest client with additional configuration +// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest { + c := p.ClientConfig("outputservice1protocoltest", cfgs...) + return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService1ProtocolTest { + svc := &OutputService1ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice1protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService1TestCaseOperation1 = "OperationName" + +// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService1TestCaseOperation1, + } + + if input == nil { + input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { + req, out := c.OutputService1TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { + metadataOutputService1TestShapeOutputService1TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { + Char *string `type:"character"` + + Double *float64 `type:"double"` + + FalseBool *bool `type:"boolean"` + + Float *float64 `type:"float"` + + Long *int64 `type:"long"` + + Num *int64 `locationName:"FooNum" type:"integer"` + + Str *string `type:"string"` + + TrueBool *bool `type:"boolean"` + + metadataOutputService1TestShapeOutputService1TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService2ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService2ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService2ProtocolTest client from just a session. +// svc := outputservice2protocoltest.New(mySession) +// +// // Create a OutputService2ProtocolTest client with additional configuration +// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest { + c := p.ClientConfig("outputservice2protocoltest", cfgs...) + return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest { + svc := &OutputService2ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice2protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService2TestCaseOperation1 = "OperationName" + +// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService2TestCaseOperation1, + } + + if input == nil { + input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { + req, out := c.OutputService2TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { + metadataOutputService2TestShapeOutputService2TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { + Blob []byte `type:"blob"` + + metadataOutputService2TestShapeOutputService2TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService3ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService3ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService3ProtocolTest client from just a session. +// svc := outputservice3protocoltest.New(mySession) +// +// // Create a OutputService3ProtocolTest client with additional configuration +// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest { + c := p.ClientConfig("outputservice3protocoltest", cfgs...) + return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest { + svc := &OutputService3ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice3protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService3TestCaseOperation1 = "OperationName" + +// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService3TestCaseOperation1, + } + + if input == nil { + input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { + req, out := c.OutputService3TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { + metadataOutputService3TestShapeOutputService3TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { + ListMember []*string `type:"list"` + + metadataOutputService3TestShapeOutputService3TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService4ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService4ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService4ProtocolTest client from just a session. +// svc := outputservice4protocoltest.New(mySession) +// +// // Create a OutputService4ProtocolTest client with additional configuration +// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest { + c := p.ClientConfig("outputservice4protocoltest", cfgs...) + return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest { + svc := &OutputService4ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice4protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService4TestCaseOperation1 = "OperationName" + +// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService4TestCaseOperation1, + } + + if input == nil { + input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { + req, out := c.OutputService4TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { + metadataOutputService4TestShapeOutputService4TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { + ListMember []*string `locationNameList:"item" type:"list"` + + metadataOutputService4TestShapeOutputService4TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService5ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService5ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService5ProtocolTest client from just a session. +// svc := outputservice5protocoltest.New(mySession) +// +// // Create a OutputService5ProtocolTest client with additional configuration +// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest { + c := p.ClientConfig("outputservice5protocoltest", cfgs...) + return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest { + svc := &OutputService5ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice5protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService5TestCaseOperation1 = "OperationName" + +// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService5TestCaseOperation1, + } + + if input == nil { + input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { + req, out := c.OutputService5TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { + metadataOutputService5TestShapeOutputService5TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { + ListMember []*string `type:"list" flattened:"true"` + + metadataOutputService5TestShapeOutputService5TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService6ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService6ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService6ProtocolTest client from just a session. +// svc := outputservice6protocoltest.New(mySession) +// +// // Create a OutputService6ProtocolTest client with additional configuration +// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest { + c := p.ClientConfig("outputservice6protocoltest", cfgs...) + return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest { + svc := &OutputService6ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice6protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService6TestCaseOperation1 = "OperationName" + +// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService6TestCaseOperation1, + } + + if input == nil { + input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { + req, out := c.OutputService6TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { + metadataOutputService6TestShapeOutputService6TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { + Map map[string]*OutputService6TestShapeStructureType `type:"map"` + + metadataOutputService6TestShapeOutputService6TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService6TestShapeStructureType struct { + Foo *string `locationName:"foo" type:"string"` + + metadataOutputService6TestShapeStructureType `json:"-" xml:"-"` +} + +type metadataOutputService6TestShapeStructureType struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService7ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService7ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService7ProtocolTest client from just a session. +// svc := outputservice7protocoltest.New(mySession) +// +// // Create a OutputService7ProtocolTest client with additional configuration +// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest { + c := p.ClientConfig("outputservice7protocoltest", cfgs...) + return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest { + svc := &OutputService7ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice7protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService7TestCaseOperation1 = "OperationName" + +// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService7TestCaseOperation1, + } + + if input == nil { + input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { + req, out := c.OutputService7TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { + metadataOutputService7TestShapeOutputService7TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { + Map map[string]*string `type:"map" flattened:"true"` + + metadataOutputService7TestShapeOutputService7TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService8ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService8ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService8ProtocolTest client from just a session. +// svc := outputservice8protocoltest.New(mySession) +// +// // Create a OutputService8ProtocolTest client with additional configuration +// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest { + c := p.ClientConfig("outputservice8protocoltest", cfgs...) + return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest { + svc := &OutputService8ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice8protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService8TestCaseOperation1 = "OperationName" + +// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService8TestCaseOperation1, + } + + if input == nil { + input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { + req, out := c.OutputService8TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { + metadataOutputService8TestShapeOutputService8TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { + Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` + + metadataOutputService8TestShapeOutputService8TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService9ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService9ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService9ProtocolTest client from just a session. +// svc := outputservice9protocoltest.New(mySession) +// +// // Create a OutputService9ProtocolTest client with additional configuration +// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest { + c := p.ClientConfig("outputservice9protocoltest", cfgs...) + return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest { + svc := &OutputService9ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice9protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService9TestCaseOperation1 = "OperationName" + +// OutputService9TestCaseOperation1Request generates a request for the OutputService9TestCaseOperation1 operation. +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService9TestCaseOperation1, + } + + if input == nil { + input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { + req, out := c.OutputService9TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { + metadataOutputService9TestShapeOutputService9TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService9TestShapeOutputService9TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { + Foo *string `type:"string"` + + metadataOutputService9TestShapeOutputService9TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService9TestShapeOutputService9TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +// +// Tests begin here +// + +func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200arequest-id")) + req, out := svc.OutputService1TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "a", *out.Char) + assert.Equal(t, 1.3, *out.Double) + assert.Equal(t, false, *out.FalseBool) + assert.Equal(t, 1.2, *out.Float) + assert.Equal(t, int64(200), *out.Long) + assert.Equal(t, int64(123), *out.Num) + assert.Equal(t, "myname", *out.Str) + assert.Equal(t, true, *out.TrueBool) + +} + +func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("dmFsdWU=requestid")) + req, out := svc.OutputService2TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "value", string(out.Blob)) + +} + +func TestOutputService3ProtocolTestListsCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService3TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService4TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService5ProtocolTestFlattenedListCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService5TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService6TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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) + +} + +func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService7TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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"]) + +} + +func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService8TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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"]) + +} + +func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("requestid")) + req, out := svc.OutputService9TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + ec2query.UnmarshalMeta(req) + ec2query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "", *out.Foo) + +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go new file mode 100644 index 00000000000..2d78c35c241 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build.go @@ -0,0 +1,33 @@ +// Package query provides serialisation of AWS query requests, and responses. +package query + +//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go + +import ( + "net/url" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" +) + +// Build builds a request for an AWS Query service. +func Build(r *request.Request) { + body := url.Values{ + "Action": {r.Operation.Name}, + "Version": {r.ClientInfo.APIVersion}, + } + if err := queryutil.Parse(body, r.Params, false); err != nil { + r.Error = awserr.New("SerializationError", "failed encoding Query request", err) + return + } + + if r.ExpireTime == 0 { + r.HTTPRequest.Method = "POST" + r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") + r.SetBufferBody([]byte(body.Encode())) + } else { // This is a pre-signed request + r.HTTPRequest.Method = "GET" + r.HTTPRequest.URL.RawQuery = body.Encode() + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go new file mode 100644 index 00000000000..535821b2fd4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go @@ -0,0 +1,2139 @@ +package query_test + +import ( + "bytes" + "encoding/json" + "encoding/xml" + "io" + "io/ioutil" + "net/http" + "net/url" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/protocol/query" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/private/signer/v4" + "github.com/aws/aws-sdk-go/private/util" + "github.com/stretchr/testify/assert" +) + +var _ bytes.Buffer // always import bytes +var _ http.Request +var _ json.Marshaler +var _ time.Time +var _ xmlutil.XMLNode +var _ xml.Attr +var _ = awstesting.GenerateAssertions +var _ = ioutil.Discard +var _ = util.Trim("") +var _ = url.Values{} +var _ = io.EOF +var _ = aws.String + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService1ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService1ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService1ProtocolTest client from just a session. +// svc := inputservice1protocoltest.New(mySession) +// +// // Create a InputService1ProtocolTest client with additional configuration +// svc := inputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService1ProtocolTest { + c := p.ClientConfig("inputservice1protocoltest", cfgs...) + return newInputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService1ProtocolTest { + svc := &InputService1ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice1protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService1ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService1TestCaseOperation1 = "OperationName" + +// InputService1TestCaseOperation1Request generates a request for the InputService1TestCaseOperation1 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation1, + } + + if input == nil { + input = &InputService1TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService1TestShapeInputService1TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService1ProtocolTest) InputService1TestCaseOperation1(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation1Output, error) { + req, out := c.InputService1TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +const opInputService1TestCaseOperation2 = "OperationName" + +// InputService1TestCaseOperation2Request generates a request for the InputService1TestCaseOperation2 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation2Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation2, + } + + if input == nil { + input = &InputService1TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService1TestShapeInputService1TestCaseOperation2Output{} + req.Data = output + return +} + +func (c *InputService1ProtocolTest) InputService1TestCaseOperation2(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation2Output, error) { + req, out := c.InputService1TestCaseOperation2Request(input) + err := req.Send() + return out, err +} + +const opInputService1TestCaseOperation3 = "OperationName" + +// InputService1TestCaseOperation3Request generates a request for the InputService1TestCaseOperation3 operation. +func (c *InputService1ProtocolTest) InputService1TestCaseOperation3Request(input *InputService1TestShapeInputShape) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation3Output) { + op := &request.Operation{ + Name: opInputService1TestCaseOperation3, + } + + if input == nil { + input = &InputService1TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService1TestShapeInputService1TestCaseOperation3Output{} + req.Data = output + return +} + +func (c *InputService1ProtocolTest) InputService1TestCaseOperation3(input *InputService1TestShapeInputShape) (*InputService1TestShapeInputService1TestCaseOperation3Output, error) { + req, out := c.InputService1TestCaseOperation3Request(input) + err := req.Send() + return out, err +} + +type InputService1TestShapeInputService1TestCaseOperation1Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputService1TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService1TestShapeInputService1TestCaseOperation2Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation2Output `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputService1TestCaseOperation2Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService1TestShapeInputService1TestCaseOperation3Output struct { + metadataInputService1TestShapeInputService1TestCaseOperation3Output `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputService1TestCaseOperation3Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService1TestShapeInputShape struct { + Bar *string `type:"string"` + + Baz *bool `type:"boolean"` + + Foo *string `type:"string"` + + metadataInputService1TestShapeInputShape `json:"-" xml:"-"` +} + +type metadataInputService1TestShapeInputShape struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService2ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService2ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService2ProtocolTest client from just a session. +// svc := inputservice2protocoltest.New(mySession) +// +// // Create a InputService2ProtocolTest client with additional configuration +// svc := inputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService2ProtocolTest { + c := p.ClientConfig("inputservice2protocoltest", cfgs...) + return newInputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService2ProtocolTest { + svc := &InputService2ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice2protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService2ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService2TestCaseOperation1 = "OperationName" + +// InputService2TestCaseOperation1Request generates a request for the InputService2TestCaseOperation1 operation. +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1Request(input *InputService2TestShapeInputService2TestCaseOperation1Input) (req *request.Request, output *InputService2TestShapeInputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService2TestCaseOperation1, + } + + if input == nil { + input = &InputService2TestShapeInputService2TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService2TestShapeInputService2TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService2ProtocolTest) InputService2TestCaseOperation1(input *InputService2TestShapeInputService2TestCaseOperation1Input) (*InputService2TestShapeInputService2TestCaseOperation1Output, error) { + req, out := c.InputService2TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService2TestShapeInputService2TestCaseOperation1Input struct { + StructArg *InputService2TestShapeStructType `type:"structure"` + + metadataInputService2TestShapeInputService2TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeInputService2TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService2TestShapeInputService2TestCaseOperation1Output struct { + metadataInputService2TestShapeInputService2TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeInputService2TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService2TestShapeStructType struct { + ScalarArg *string `type:"string"` + + metadataInputService2TestShapeStructType `json:"-" xml:"-"` +} + +type metadataInputService2TestShapeStructType struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService3ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService3ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService3ProtocolTest client from just a session. +// svc := inputservice3protocoltest.New(mySession) +// +// // Create a InputService3ProtocolTest client with additional configuration +// svc := inputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService3ProtocolTest { + c := p.ClientConfig("inputservice3protocoltest", cfgs...) + return newInputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService3ProtocolTest { + svc := &InputService3ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice3protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService3ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService3TestCaseOperation1 = "OperationName" + +// InputService3TestCaseOperation1Request generates a request for the InputService3TestCaseOperation1 operation. +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService3TestCaseOperation1, + } + + if input == nil { + input = &InputService3TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService3TestShapeInputService3TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService3ProtocolTest) InputService3TestCaseOperation1(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation1Output, error) { + req, out := c.InputService3TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +const opInputService3TestCaseOperation2 = "OperationName" + +// InputService3TestCaseOperation2Request generates a request for the InputService3TestCaseOperation2 operation. +func (c *InputService3ProtocolTest) InputService3TestCaseOperation2Request(input *InputService3TestShapeInputShape) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation2Output) { + op := &request.Operation{ + Name: opInputService3TestCaseOperation2, + } + + if input == nil { + input = &InputService3TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService3TestShapeInputService3TestCaseOperation2Output{} + req.Data = output + return +} + +func (c *InputService3ProtocolTest) InputService3TestCaseOperation2(input *InputService3TestShapeInputShape) (*InputService3TestShapeInputService3TestCaseOperation2Output, error) { + req, out := c.InputService3TestCaseOperation2Request(input) + err := req.Send() + return out, err +} + +type InputService3TestShapeInputService3TestCaseOperation1Output struct { + metadataInputService3TestShapeInputService3TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeInputService3TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService3TestShapeInputService3TestCaseOperation2Output struct { + metadataInputService3TestShapeInputService3TestCaseOperation2Output `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeInputService3TestCaseOperation2Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService3TestShapeInputShape struct { + ListArg []*string `type:"list"` + + metadataInputService3TestShapeInputShape `json:"-" xml:"-"` +} + +type metadataInputService3TestShapeInputShape struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService4ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService4ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService4ProtocolTest client from just a session. +// svc := inputservice4protocoltest.New(mySession) +// +// // Create a InputService4ProtocolTest client with additional configuration +// svc := inputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService4ProtocolTest { + c := p.ClientConfig("inputservice4protocoltest", cfgs...) + return newInputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService4ProtocolTest { + svc := &InputService4ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice4protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService4ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService4TestCaseOperation1 = "OperationName" + +// InputService4TestCaseOperation1Request generates a request for the InputService4TestCaseOperation1 operation. +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1Request(input *InputService4TestShapeInputShape) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService4TestCaseOperation1, + } + + if input == nil { + input = &InputService4TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService4TestShapeInputService4TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService4ProtocolTest) InputService4TestCaseOperation1(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation1Output, error) { + req, out := c.InputService4TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +const opInputService4TestCaseOperation2 = "OperationName" + +// InputService4TestCaseOperation2Request generates a request for the InputService4TestCaseOperation2 operation. +func (c *InputService4ProtocolTest) InputService4TestCaseOperation2Request(input *InputService4TestShapeInputShape) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation2Output) { + op := &request.Operation{ + Name: opInputService4TestCaseOperation2, + } + + if input == nil { + input = &InputService4TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService4TestShapeInputService4TestCaseOperation2Output{} + req.Data = output + return +} + +func (c *InputService4ProtocolTest) InputService4TestCaseOperation2(input *InputService4TestShapeInputShape) (*InputService4TestShapeInputService4TestCaseOperation2Output, error) { + req, out := c.InputService4TestCaseOperation2Request(input) + err := req.Send() + return out, err +} + +type InputService4TestShapeInputService4TestCaseOperation1Output struct { + metadataInputService4TestShapeInputService4TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService4TestShapeInputService4TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService4TestShapeInputService4TestCaseOperation2Output struct { + metadataInputService4TestShapeInputService4TestCaseOperation2Output `json:"-" xml:"-"` +} + +type metadataInputService4TestShapeInputService4TestCaseOperation2Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService4TestShapeInputShape struct { + ListArg []*string `type:"list" flattened:"true"` + + NamedListArg []*string `locationNameList:"Foo" type:"list" flattened:"true"` + + ScalarArg *string `type:"string"` + + metadataInputService4TestShapeInputShape `json:"-" xml:"-"` +} + +type metadataInputService4TestShapeInputShape struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService5ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService5ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService5ProtocolTest client from just a session. +// svc := inputservice5protocoltest.New(mySession) +// +// // Create a InputService5ProtocolTest client with additional configuration +// svc := inputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService5ProtocolTest { + c := p.ClientConfig("inputservice5protocoltest", cfgs...) + return newInputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService5ProtocolTest { + svc := &InputService5ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice5protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService5ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService5TestCaseOperation1 = "OperationName" + +// InputService5TestCaseOperation1Request generates a request for the InputService5TestCaseOperation1 operation. +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1Request(input *InputService5TestShapeInputService5TestCaseOperation1Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService5TestCaseOperation1, + } + + if input == nil { + input = &InputService5TestShapeInputService5TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService5TestShapeInputService5TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService5ProtocolTest) InputService5TestCaseOperation1(input *InputService5TestShapeInputService5TestCaseOperation1Input) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { + req, out := c.InputService5TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService5TestShapeInputService5TestCaseOperation1Input struct { + MapArg map[string]*string `type:"map" flattened:"true"` + + metadataInputService5TestShapeInputService5TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService5TestShapeInputService5TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService5TestShapeInputService5TestCaseOperation1Output struct { + metadataInputService5TestShapeInputService5TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService5TestShapeInputService5TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService6ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService6ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService6ProtocolTest client from just a session. +// svc := inputservice6protocoltest.New(mySession) +// +// // Create a InputService6ProtocolTest client with additional configuration +// svc := inputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService6ProtocolTest { + c := p.ClientConfig("inputservice6protocoltest", cfgs...) + return newInputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService6ProtocolTest { + svc := &InputService6ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice6protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService6ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService6TestCaseOperation1 = "OperationName" + +// InputService6TestCaseOperation1Request generates a request for the InputService6TestCaseOperation1 operation. +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1Request(input *InputService6TestShapeInputService6TestCaseOperation1Input) (req *request.Request, output *InputService6TestShapeInputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService6TestCaseOperation1, + } + + if input == nil { + input = &InputService6TestShapeInputService6TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService6TestShapeInputService6TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService6ProtocolTest) InputService6TestCaseOperation1(input *InputService6TestShapeInputService6TestCaseOperation1Input) (*InputService6TestShapeInputService6TestCaseOperation1Output, error) { + req, out := c.InputService6TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService6TestShapeInputService6TestCaseOperation1Input struct { + ListArg []*string `locationNameList:"item" type:"list"` + + metadataInputService6TestShapeInputService6TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService6TestShapeInputService6TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService6TestShapeInputService6TestCaseOperation1Output struct { + metadataInputService6TestShapeInputService6TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService6TestShapeInputService6TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService7ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService7ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService7ProtocolTest client from just a session. +// svc := inputservice7protocoltest.New(mySession) +// +// // Create a InputService7ProtocolTest client with additional configuration +// svc := inputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService7ProtocolTest { + c := p.ClientConfig("inputservice7protocoltest", cfgs...) + return newInputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService7ProtocolTest { + svc := &InputService7ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice7protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService7ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService7TestCaseOperation1 = "OperationName" + +// InputService7TestCaseOperation1Request generates a request for the InputService7TestCaseOperation1 operation. +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1Request(input *InputService7TestShapeInputService7TestCaseOperation1Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService7TestCaseOperation1, + } + + if input == nil { + input = &InputService7TestShapeInputService7TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService7TestShapeInputService7TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService7ProtocolTest) InputService7TestCaseOperation1(input *InputService7TestShapeInputService7TestCaseOperation1Input) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { + req, out := c.InputService7TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService7TestShapeInputService7TestCaseOperation1Input struct { + ListArg []*string `locationNameList:"ListArgLocation" type:"list" flattened:"true"` + + ScalarArg *string `type:"string"` + + metadataInputService7TestShapeInputService7TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService7TestShapeInputService7TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService7TestShapeInputService7TestCaseOperation1Output struct { + metadataInputService7TestShapeInputService7TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService7TestShapeInputService7TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService8ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService8ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService8ProtocolTest client from just a session. +// svc := inputservice8protocoltest.New(mySession) +// +// // Create a InputService8ProtocolTest client with additional configuration +// svc := inputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService8ProtocolTest { + c := p.ClientConfig("inputservice8protocoltest", cfgs...) + return newInputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService8ProtocolTest { + svc := &InputService8ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice8protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService8ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService8TestCaseOperation1 = "OperationName" + +// InputService8TestCaseOperation1Request generates a request for the InputService8TestCaseOperation1 operation. +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1Request(input *InputService8TestShapeInputService8TestCaseOperation1Input) (req *request.Request, output *InputService8TestShapeInputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService8TestCaseOperation1, + } + + if input == nil { + input = &InputService8TestShapeInputService8TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService8TestShapeInputService8TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService8ProtocolTest) InputService8TestCaseOperation1(input *InputService8TestShapeInputService8TestCaseOperation1Input) (*InputService8TestShapeInputService8TestCaseOperation1Output, error) { + req, out := c.InputService8TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService8TestShapeInputService8TestCaseOperation1Input struct { + MapArg map[string]*string `type:"map"` + + metadataInputService8TestShapeInputService8TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService8TestShapeInputService8TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService8TestShapeInputService8TestCaseOperation1Output struct { + metadataInputService8TestShapeInputService8TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService8TestShapeInputService8TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService9ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService9ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService9ProtocolTest client from just a session. +// svc := inputservice9protocoltest.New(mySession) +// +// // Create a InputService9ProtocolTest client with additional configuration +// svc := inputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService9ProtocolTest { + c := p.ClientConfig("inputservice9protocoltest", cfgs...) + return newInputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService9ProtocolTest { + svc := &InputService9ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice9protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService9ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService9TestCaseOperation1 = "OperationName" + +// InputService9TestCaseOperation1Request generates a request for the InputService9TestCaseOperation1 operation. +func (c *InputService9ProtocolTest) InputService9TestCaseOperation1Request(input *InputService9TestShapeInputService9TestCaseOperation1Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService9TestCaseOperation1, + } + + if input == nil { + input = &InputService9TestShapeInputService9TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService9TestShapeInputService9TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService9ProtocolTest) InputService9TestCaseOperation1(input *InputService9TestShapeInputService9TestCaseOperation1Input) (*InputService9TestShapeInputService9TestCaseOperation1Output, error) { + req, out := c.InputService9TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService9TestShapeInputService9TestCaseOperation1Input struct { + MapArg map[string]*string `locationNameKey:"TheKey" locationNameValue:"TheValue" type:"map"` + + metadataInputService9TestShapeInputService9TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService9TestShapeInputService9TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService9TestShapeInputService9TestCaseOperation1Output struct { + metadataInputService9TestShapeInputService9TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService9TestShapeInputService9TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService10ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService10ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService10ProtocolTest client from just a session. +// svc := inputservice10protocoltest.New(mySession) +// +// // Create a InputService10ProtocolTest client with additional configuration +// svc := inputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService10ProtocolTest { + c := p.ClientConfig("inputservice10protocoltest", cfgs...) + return newInputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService10ProtocolTest { + svc := &InputService10ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice10protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService10ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService10TestCaseOperation1 = "OperationName" + +// InputService10TestCaseOperation1Request generates a request for the InputService10TestCaseOperation1 operation. +func (c *InputService10ProtocolTest) InputService10TestCaseOperation1Request(input *InputService10TestShapeInputService10TestCaseOperation1Input) (req *request.Request, output *InputService10TestShapeInputService10TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService10TestCaseOperation1, + } + + if input == nil { + input = &InputService10TestShapeInputService10TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService10TestShapeInputService10TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService10ProtocolTest) InputService10TestCaseOperation1(input *InputService10TestShapeInputService10TestCaseOperation1Input) (*InputService10TestShapeInputService10TestCaseOperation1Output, error) { + req, out := c.InputService10TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService10TestShapeInputService10TestCaseOperation1Input struct { + BlobArg []byte `type:"blob"` + + metadataInputService10TestShapeInputService10TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService10TestShapeInputService10TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService10TestShapeInputService10TestCaseOperation1Output struct { + metadataInputService10TestShapeInputService10TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService10TestShapeInputService10TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService11ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService11ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService11ProtocolTest client from just a session. +// svc := inputservice11protocoltest.New(mySession) +// +// // Create a InputService11ProtocolTest client with additional configuration +// svc := inputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService11ProtocolTest { + c := p.ClientConfig("inputservice11protocoltest", cfgs...) + return newInputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService11ProtocolTest { + svc := &InputService11ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice11protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService11ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService11TestCaseOperation1 = "OperationName" + +// InputService11TestCaseOperation1Request generates a request for the InputService11TestCaseOperation1 operation. +func (c *InputService11ProtocolTest) InputService11TestCaseOperation1Request(input *InputService11TestShapeInputService11TestCaseOperation1Input) (req *request.Request, output *InputService11TestShapeInputService11TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService11TestCaseOperation1, + } + + if input == nil { + input = &InputService11TestShapeInputService11TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &InputService11TestShapeInputService11TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService11ProtocolTest) InputService11TestCaseOperation1(input *InputService11TestShapeInputService11TestCaseOperation1Input) (*InputService11TestShapeInputService11TestCaseOperation1Output, error) { + req, out := c.InputService11TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type InputService11TestShapeInputService11TestCaseOperation1Input struct { + TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + metadataInputService11TestShapeInputService11TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataInputService11TestShapeInputService11TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService11TestShapeInputService11TestCaseOperation1Output struct { + metadataInputService11TestShapeInputService11TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService11TestShapeInputService11TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type InputService12ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the InputService12ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a InputService12ProtocolTest client from just a session. +// svc := inputservice12protocoltest.New(mySession) +// +// // Create a InputService12ProtocolTest client with additional configuration +// svc := inputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewInputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *InputService12ProtocolTest { + c := p.ClientConfig("inputservice12protocoltest", cfgs...) + return newInputService12ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *InputService12ProtocolTest { + svc := &InputService12ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "inputservice12protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2014-01-01", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a InputService12ProtocolTest operation and runs any +// custom request initialization. +func (c *InputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opInputService12TestCaseOperation1 = "OperationName" + +// InputService12TestCaseOperation1Request generates a request for the InputService12TestCaseOperation1 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation1Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation1Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation1, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation1(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { + req, out := c.InputService12TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +const opInputService12TestCaseOperation2 = "OperationName" + +// InputService12TestCaseOperation2Request generates a request for the InputService12TestCaseOperation2 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation2Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation2Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation2, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation2Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation2(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation2Output, error) { + req, out := c.InputService12TestCaseOperation2Request(input) + err := req.Send() + return out, err +} + +const opInputService12TestCaseOperation3 = "OperationName" + +// InputService12TestCaseOperation3Request generates a request for the InputService12TestCaseOperation3 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation3Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation3Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation3, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation3Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation3(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation3Output, error) { + req, out := c.InputService12TestCaseOperation3Request(input) + err := req.Send() + return out, err +} + +const opInputService12TestCaseOperation4 = "OperationName" + +// InputService12TestCaseOperation4Request generates a request for the InputService12TestCaseOperation4 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation4Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation4Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation4, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation4Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation4(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation4Output, error) { + req, out := c.InputService12TestCaseOperation4Request(input) + err := req.Send() + return out, err +} + +const opInputService12TestCaseOperation5 = "OperationName" + +// InputService12TestCaseOperation5Request generates a request for the InputService12TestCaseOperation5 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation5Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation5Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation5, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation5Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation5(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation5Output, error) { + req, out := c.InputService12TestCaseOperation5Request(input) + err := req.Send() + return out, err +} + +const opInputService12TestCaseOperation6 = "OperationName" + +// InputService12TestCaseOperation6Request generates a request for the InputService12TestCaseOperation6 operation. +func (c *InputService12ProtocolTest) InputService12TestCaseOperation6Request(input *InputService12TestShapeInputShape) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation6Output) { + op := &request.Operation{ + Name: opInputService12TestCaseOperation6, + } + + if input == nil { + input = &InputService12TestShapeInputShape{} + } + + req = c.newRequest(op, input, output) + output = &InputService12TestShapeInputService12TestCaseOperation6Output{} + req.Data = output + return +} + +func (c *InputService12ProtocolTest) InputService12TestCaseOperation6(input *InputService12TestShapeInputShape) (*InputService12TestShapeInputService12TestCaseOperation6Output, error) { + req, out := c.InputService12TestCaseOperation6Request(input) + err := req.Send() + return out, err +} + +type InputService12TestShapeInputService12TestCaseOperation1Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputService12TestCaseOperation2Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation2Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation2Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputService12TestCaseOperation3Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation3Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation3Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputService12TestCaseOperation4Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation4Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation4Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputService12TestCaseOperation5Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation5Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation5Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputService12TestCaseOperation6Output struct { + metadataInputService12TestShapeInputService12TestCaseOperation6Output `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputService12TestCaseOperation6Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeInputShape struct { + RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"` + + metadataInputService12TestShapeInputShape `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeInputShape struct { + SDKShapeTraits bool `type:"structure"` +} + +type InputService12TestShapeRecursiveStructType struct { + NoRecurse *string `type:"string"` + + RecursiveList []*InputService12TestShapeRecursiveStructType `type:"list"` + + RecursiveMap map[string]*InputService12TestShapeRecursiveStructType `type:"map"` + + RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"` + + metadataInputService12TestShapeRecursiveStructType `json:"-" xml:"-"` +} + +type metadataInputService12TestShapeRecursiveStructType struct { + SDKShapeTraits bool `type:"structure"` +} + +// +// Tests begin here +// + +func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { + sess := session.New() + svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService1TestShapeInputShape{ + Bar: aws.String("val2"), + Foo: aws.String("val1"), + } + req, _ := svc.InputService1TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Bar=val2&Foo=val1&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService1ProtocolTestScalarMembersCase2(t *testing.T) { + sess := session.New() + svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService1TestShapeInputShape{ + Baz: aws.Bool(true), + } + req, _ := svc.InputService1TestCaseOperation2Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Baz=true&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService1ProtocolTestScalarMembersCase3(t *testing.T) { + sess := session.New() + svc := NewInputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService1TestShapeInputShape{ + Baz: aws.Bool(false), + } + req, _ := svc.InputService1TestCaseOperation3Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Baz=false&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService2ProtocolTestNestedStructureMembersCase1(t *testing.T) { + sess := session.New() + svc := NewInputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService2TestShapeInputService2TestCaseOperation1Input{ + StructArg: &InputService2TestShapeStructType{ + ScalarArg: aws.String("foo"), + }, + } + req, _ := svc.InputService2TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&StructArg.ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService3ProtocolTestListTypesCase1(t *testing.T) { + sess := session.New() + svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService3TestShapeInputShape{ + ListArg: []*string{ + aws.String("foo"), + aws.String("bar"), + aws.String("baz"), + }, + } + req, _ := svc.InputService3TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArg.member.1=foo&ListArg.member.2=bar&ListArg.member.3=baz&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService3ProtocolTestListTypesCase2(t *testing.T) { + sess := session.New() + svc := NewInputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService3TestShapeInputShape{ + ListArg: []*string{}, + } + req, _ := svc.InputService3TestCaseOperation2Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArg=&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService4ProtocolTestFlattenedListCase1(t *testing.T) { + sess := session.New() + svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService4TestShapeInputShape{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), + }, + ScalarArg: aws.String("foo"), + } + req, _ := svc.InputService4TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArg.1=a&ListArg.2=b&ListArg.3=c&ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService4ProtocolTestFlattenedListCase2(t *testing.T) { + sess := session.New() + svc := NewInputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService4TestShapeInputShape{ + NamedListArg: []*string{ + aws.String("a"), + }, + } + req, _ := svc.InputService4TestCaseOperation2Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&Foo.1=a&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService5ProtocolTestSerializeFlattenedMapTypeCase1(t *testing.T) { + sess := session.New() + svc := NewInputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService5TestShapeInputService5TestCaseOperation1Input{ + MapArg: map[string]*string{ + "key1": aws.String("val1"), + "key2": aws.String("val2"), + }, + } + req, _ := svc.InputService5TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&MapArg.1.key=key1&MapArg.1.value=val1&MapArg.2.key=key2&MapArg.2.value=val2&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService6ProtocolTestNonFlattenedListWithLocationNameCase1(t *testing.T) { + sess := session.New() + svc := NewInputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService6TestShapeInputService6TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), + }, + } + req, _ := svc.InputService6TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArg.item.1=a&ListArg.item.2=b&ListArg.item.3=c&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService7ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { + sess := session.New() + svc := NewInputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService7TestShapeInputService7TestCaseOperation1Input{ + ListArg: []*string{ + aws.String("a"), + aws.String("b"), + aws.String("c"), + }, + ScalarArg: aws.String("foo"), + } + req, _ := svc.InputService7TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&ListArgLocation.1=a&ListArgLocation.2=b&ListArgLocation.3=c&ScalarArg=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService8ProtocolTestSerializeMapTypeCase1(t *testing.T) { + sess := session.New() + svc := NewInputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService8TestShapeInputService8TestCaseOperation1Input{ + MapArg: map[string]*string{ + "key1": aws.String("val1"), + "key2": aws.String("val2"), + }, + } + req, _ := svc.InputService8TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&MapArg.entry.1.key=key1&MapArg.entry.1.value=val1&MapArg.entry.2.key=key2&MapArg.entry.2.value=val2&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService9ProtocolTestSerializeMapTypeWithLocationNameCase1(t *testing.T) { + sess := session.New() + svc := NewInputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService9TestShapeInputService9TestCaseOperation1Input{ + MapArg: map[string]*string{ + "key1": aws.String("val1"), + "key2": aws.String("val2"), + }, + } + req, _ := svc.InputService9TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&MapArg.entry.1.TheKey=key1&MapArg.entry.1.TheValue=val1&MapArg.entry.2.TheKey=key2&MapArg.entry.2.TheValue=val2&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService10ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { + sess := session.New() + svc := NewInputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService10TestShapeInputService10TestCaseOperation1Input{ + BlobArg: []byte("foo"), + } + req, _ := svc.InputService10TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&BlobArg=Zm9v&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService11ProtocolTestTimestampValuesCase1(t *testing.T) { + sess := session.New() + svc := NewInputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService11TestShapeInputService11TestCaseOperation1Input{ + TimeArg: aws.Time(time.Unix(1422172800, 0)), + } + req, _ := svc.InputService11TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase1(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + NoRecurse: aws.String("foo"), + }, + } + req, _ := svc.InputService12TestCaseOperation1Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase2(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + NoRecurse: aws.String("foo"), + }, + }, + } + req, _ := svc.InputService12TestCaseOperation2Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase3(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + NoRecurse: aws.String("foo"), + }, + }, + }, + }, + } + req, _ := svc.InputService12TestCaseOperation3Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveStruct.RecursiveStruct.RecursiveStruct.NoRecurse=foo&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase4(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveList: []*InputService12TestShapeRecursiveStructType{ + { + NoRecurse: aws.String("foo"), + }, + { + NoRecurse: aws.String("bar"), + }, + }, + }, + } + req, _ := svc.InputService12TestCaseOperation4Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveList.member.1.NoRecurse=foo&RecursiveStruct.RecursiveList.member.2.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase5(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveList: []*InputService12TestShapeRecursiveStructType{ + { + NoRecurse: aws.String("foo"), + }, + { + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + NoRecurse: aws.String("bar"), + }, + }, + }, + }, + } + req, _ := svc.InputService12TestCaseOperation5Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveList.member.1.NoRecurse=foo&RecursiveStruct.RecursiveList.member.2.RecursiveStruct.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} + +func TestInputService12ProtocolTestRecursiveShapesCase6(t *testing.T) { + sess := session.New() + svc := NewInputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + input := &InputService12TestShapeInputShape{ + RecursiveStruct: &InputService12TestShapeRecursiveStructType{ + RecursiveMap: map[string]*InputService12TestShapeRecursiveStructType{ + "bar": { + NoRecurse: aws.String("bar"), + }, + "foo": { + NoRecurse: aws.String("foo"), + }, + }, + }, + } + req, _ := svc.InputService12TestCaseOperation6Request(input) + r := req.HTTPRequest + + // build request + query.Build(req) + assert.NoError(t, req.Error) + + // assert body + assert.NotNil(t, r.Body) + body, _ := ioutil.ReadAll(r.Body) + awstesting.AssertQuery(t, `Action=OperationName&RecursiveStruct.RecursiveMap.entry.1.key=foo&RecursiveStruct.RecursiveMap.entry.1.value.NoRecurse=foo&RecursiveStruct.RecursiveMap.entry.2.key=bar&RecursiveStruct.RecursiveMap.entry.2.value.NoRecurse=bar&Version=2014-01-01`, util.Trim(string(body))) + + // assert URL + awstesting.AssertURL(t, "https://test/", r.URL.String()) + + // assert headers + +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go new file mode 100644 index 00000000000..4afa4cf0eed --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go @@ -0,0 +1,223 @@ +package queryutil + +import ( + "encoding/base64" + "fmt" + "net/url" + "reflect" + "sort" + "strconv" + "strings" + "time" +) + +// Parse parses an object i and fills a url.Values object. The isEC2 flag +// indicates if this is the EC2 Query sub-protocol. +func Parse(body url.Values, i interface{}, isEC2 bool) error { + q := queryParser{isEC2: isEC2} + return q.parseValue(body, reflect.ValueOf(i), "", "") +} + +func elemOf(value reflect.Value) reflect.Value { + for value.Kind() == reflect.Ptr { + value = value.Elem() + } + return value +} + +type queryParser struct { + isEC2 bool +} + +func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { + value = elemOf(value) + + // no need to handle zero values + if !value.IsValid() { + return nil + } + + t := tag.Get("type") + if t == "" { + switch value.Kind() { + case reflect.Struct: + t = "structure" + case reflect.Slice: + t = "list" + case reflect.Map: + t = "map" + } + } + + switch t { + case "structure": + return q.parseStruct(v, value, prefix) + case "list": + return q.parseList(v, value, prefix, tag) + case "map": + return q.parseMap(v, value, prefix, tag) + default: + return q.parseScalar(v, value, prefix, tag) + } +} + +func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error { + if !value.IsValid() { + return nil + } + + t := value.Type() + for i := 0; i < value.NumField(); i++ { + if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c { + continue // ignore unexported fields + } + + elemValue := elemOf(value.Field(i)) + field := t.Field(i) + var name string + + if q.isEC2 { + name = field.Tag.Get("queryName") + } + if name == "" { + if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { + name = field.Tag.Get("locationNameList") + } else if locName := field.Tag.Get("locationName"); locName != "" { + name = locName + } + if name != "" && q.isEC2 { + name = strings.ToUpper(name[0:1]) + name[1:] + } + } + if name == "" { + name = field.Name + } + + if prefix != "" { + name = prefix + "." + name + } + + if err := q.parseValue(v, elemValue, name, field.Tag); err != nil { + return err + } + } + return nil +} + +func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { + // If it's empty, generate an empty value + if !value.IsNil() && value.Len() == 0 { + v.Set(prefix, "") + return nil + } + + // check for unflattened list member + if !q.isEC2 && tag.Get("flattened") == "" { + prefix += ".member" + } + + for i := 0; i < value.Len(); i++ { + slicePrefix := prefix + if slicePrefix == "" { + slicePrefix = strconv.Itoa(i + 1) + } else { + slicePrefix = slicePrefix + "." + strconv.Itoa(i+1) + } + if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil { + return err + } + } + return nil +} + +func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { + // If it's empty, generate an empty value + if !value.IsNil() && value.Len() == 0 { + v.Set(prefix, "") + return nil + } + + // check for unflattened list member + if !q.isEC2 && tag.Get("flattened") == "" { + prefix += ".entry" + } + + // sort keys for improved serialization consistency. + // this is not strictly necessary for protocol support. + mapKeyValues := value.MapKeys() + mapKeys := map[string]reflect.Value{} + mapKeyNames := make([]string, len(mapKeyValues)) + for i, mapKey := range mapKeyValues { + name := mapKey.String() + mapKeys[name] = mapKey + mapKeyNames[i] = name + } + sort.Strings(mapKeyNames) + + for i, mapKeyName := range mapKeyNames { + mapKey := mapKeys[mapKeyName] + mapValue := value.MapIndex(mapKey) + + kname := tag.Get("locationNameKey") + if kname == "" { + kname = "key" + } + vname := tag.Get("locationNameValue") + if vname == "" { + vname = "value" + } + + // serialize key + var keyName string + if prefix == "" { + keyName = strconv.Itoa(i+1) + "." + kname + } else { + keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname + } + + if err := q.parseValue(v, mapKey, keyName, ""); err != nil { + return err + } + + // serialize value + var valueName string + if prefix == "" { + valueName = strconv.Itoa(i+1) + "." + vname + } else { + valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname + } + + if err := q.parseValue(v, mapValue, valueName, ""); err != nil { + return err + } + } + + return nil +} + +func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error { + switch value := r.Interface().(type) { + case string: + v.Set(name, value) + case []byte: + if !r.IsNil() { + v.Set(name, base64.StdEncoding.EncodeToString(value)) + } + case bool: + v.Set(name, strconv.FormatBool(value)) + case int64: + v.Set(name, strconv.FormatInt(value, 10)) + case int: + v.Set(name, strconv.Itoa(value)) + case float64: + v.Set(name, strconv.FormatFloat(value, 'f', -1, 64)) + case float32: + v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) + case time.Time: + const ISO8601UTC = "2006-01-02T15:04:05Z" + v.Set(name, value.UTC().Format(ISO8601UTC)) + default: + return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name()) + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go new file mode 100644 index 00000000000..1fcab1d1a13 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go @@ -0,0 +1,29 @@ +package query + +//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go + +import ( + "encoding/xml" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" +) + +// Unmarshal unmarshals a response for an AWS Query service. +func Unmarshal(r *request.Request) { + defer r.HTTPResponse.Body.Close() + if r.DataFilled() { + decoder := xml.NewDecoder(r.HTTPResponse.Body) + err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") + if err != nil { + r.Error = awserr.New("SerializationError", "failed decoding Query response", err) + return + } + } +} + +// UnmarshalMeta unmarshals header response values for an AWS Query service. +func UnmarshalMeta(r *request.Request) { + // TODO implement unmarshaling of request IDs +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go new file mode 100644 index 00000000000..08609d92088 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go @@ -0,0 +1,33 @@ +package query + +import ( + "encoding/xml" + "io" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +type xmlErrorResponse struct { + XMLName xml.Name `xml:"ErrorResponse"` + Code string `xml:"Error>Code"` + Message string `xml:"Error>Message"` + RequestID string `xml:"RequestId"` +} + +// UnmarshalError unmarshals an error response for an AWS Query service. +func UnmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + resp := &xmlErrorResponse{} + err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) + if err != nil && err != io.EOF { + r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err) + } else { + r.Error = awserr.NewRequestFailure( + awserr.New(resp.Code, resp.Message, nil), + r.HTTPResponse.StatusCode, + resp.RequestID, + ) + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go new file mode 100644 index 00000000000..fe2a58e3650 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go @@ -0,0 +1,1878 @@ +package query_test + +import ( + "bytes" + "encoding/json" + "encoding/xml" + "io" + "io/ioutil" + "net/http" + "net/url" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/protocol/query" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" + "github.com/aws/aws-sdk-go/private/signer/v4" + "github.com/aws/aws-sdk-go/private/util" + "github.com/stretchr/testify/assert" +) + +var _ bytes.Buffer // always import bytes +var _ http.Request +var _ json.Marshaler +var _ time.Time +var _ xmlutil.XMLNode +var _ xml.Attr +var _ = awstesting.GenerateAssertions +var _ = ioutil.Discard +var _ = util.Trim("") +var _ = url.Values{} +var _ = io.EOF +var _ = aws.String + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService1ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService1ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService1ProtocolTest client from just a session. +// svc := outputservice1protocoltest.New(mySession) +// +// // Create a OutputService1ProtocolTest client with additional configuration +// svc := outputservice1protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService1ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService1ProtocolTest { + c := p.ClientConfig("outputservice1protocoltest", cfgs...) + return newOutputService1ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService1ProtocolTest { + svc := &OutputService1ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice1protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService1ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService1ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService1TestCaseOperation1 = "OperationName" + +// OutputService1TestCaseOperation1Request generates a request for the OutputService1TestCaseOperation1 operation. +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1Request(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (req *request.Request, output *OutputService1TestShapeOutputService1TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService1TestCaseOperation1, + } + + if input == nil { + input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService1TestShapeOutputService1TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService1ProtocolTest) OutputService1TestCaseOperation1(input *OutputService1TestShapeOutputService1TestCaseOperation1Input) (*OutputService1TestShapeOutputService1TestCaseOperation1Output, error) { + req, out := c.OutputService1TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService1TestShapeOutputService1TestCaseOperation1Input struct { + metadataOutputService1TestShapeOutputService1TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService1TestShapeOutputService1TestCaseOperation1Output struct { + Char *string `type:"character"` + + Double *float64 `type:"double"` + + FalseBool *bool `type:"boolean"` + + Float *float64 `type:"float"` + + Long *int64 `type:"long"` + + Num *int64 `locationName:"FooNum" type:"integer"` + + Str *string `type:"string"` + + Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + TrueBool *bool `type:"boolean"` + + metadataOutputService1TestShapeOutputService1TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService1TestShapeOutputService1TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService2ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService2ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService2ProtocolTest client from just a session. +// svc := outputservice2protocoltest.New(mySession) +// +// // Create a OutputService2ProtocolTest client with additional configuration +// svc := outputservice2protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService2ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService2ProtocolTest { + c := p.ClientConfig("outputservice2protocoltest", cfgs...) + return newOutputService2ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService2ProtocolTest { + svc := &OutputService2ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice2protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService2ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService2ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService2TestCaseOperation1 = "OperationName" + +// OutputService2TestCaseOperation1Request generates a request for the OutputService2TestCaseOperation1 operation. +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1Request(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (req *request.Request, output *OutputService2TestShapeOutputService2TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService2TestCaseOperation1, + } + + if input == nil { + input = &OutputService2TestShapeOutputService2TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService2TestShapeOutputService2TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService2ProtocolTest) OutputService2TestCaseOperation1(input *OutputService2TestShapeOutputService2TestCaseOperation1Input) (*OutputService2TestShapeOutputService2TestCaseOperation1Output, error) { + req, out := c.OutputService2TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { + metadataOutputService2TestShapeOutputService2TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { + Num *int64 `type:"integer"` + + Str *string `type:"string"` + + metadataOutputService2TestShapeOutputService2TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService2TestShapeOutputService2TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService3ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService3ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService3ProtocolTest client from just a session. +// svc := outputservice3protocoltest.New(mySession) +// +// // Create a OutputService3ProtocolTest client with additional configuration +// svc := outputservice3protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService3ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService3ProtocolTest { + c := p.ClientConfig("outputservice3protocoltest", cfgs...) + return newOutputService3ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService3ProtocolTest { + svc := &OutputService3ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice3protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService3ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService3ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService3TestCaseOperation1 = "OperationName" + +// OutputService3TestCaseOperation1Request generates a request for the OutputService3TestCaseOperation1 operation. +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1Request(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (req *request.Request, output *OutputService3TestShapeOutputService3TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService3TestCaseOperation1, + } + + if input == nil { + input = &OutputService3TestShapeOutputService3TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService3TestShapeOutputService3TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService3ProtocolTest) OutputService3TestCaseOperation1(input *OutputService3TestShapeOutputService3TestCaseOperation1Input) (*OutputService3TestShapeOutputService3TestCaseOperation1Output, error) { + req, out := c.OutputService3TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService3TestShapeOutputService3TestCaseOperation1Input struct { + metadataOutputService3TestShapeOutputService3TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService3TestShapeOutputService3TestCaseOperation1Output struct { + Blob []byte `type:"blob"` + + metadataOutputService3TestShapeOutputService3TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService3TestShapeOutputService3TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService4ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService4ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService4ProtocolTest client from just a session. +// svc := outputservice4protocoltest.New(mySession) +// +// // Create a OutputService4ProtocolTest client with additional configuration +// svc := outputservice4protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService4ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService4ProtocolTest { + c := p.ClientConfig("outputservice4protocoltest", cfgs...) + return newOutputService4ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService4ProtocolTest { + svc := &OutputService4ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice4protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService4ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService4ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService4TestCaseOperation1 = "OperationName" + +// OutputService4TestCaseOperation1Request generates a request for the OutputService4TestCaseOperation1 operation. +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1Request(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService4TestCaseOperation1, + } + + if input == nil { + input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService4TestShapeOutputService4TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation1(input *OutputService4TestShapeOutputService4TestCaseOperation1Input) (*OutputService4TestShapeOutputService4TestCaseOperation1Output, error) { + req, out := c.OutputService4TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { + metadataOutputService4TestShapeOutputService4TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService4TestShapeOutputService4TestCaseOperation1Output struct { + ListMember []*string `type:"list"` + + metadataOutputService4TestShapeOutputService4TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService4TestShapeOutputService4TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService5ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService5ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService5ProtocolTest client from just a session. +// svc := outputservice5protocoltest.New(mySession) +// +// // Create a OutputService5ProtocolTest client with additional configuration +// svc := outputservice5protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService5ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService5ProtocolTest { + c := p.ClientConfig("outputservice5protocoltest", cfgs...) + return newOutputService5ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService5ProtocolTest { + svc := &OutputService5ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice5protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService5ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService5ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService5TestCaseOperation1 = "OperationName" + +// OutputService5TestCaseOperation1Request generates a request for the OutputService5TestCaseOperation1 operation. +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1Request(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (req *request.Request, output *OutputService5TestShapeOutputService5TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService5TestCaseOperation1, + } + + if input == nil { + input = &OutputService5TestShapeOutputService5TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService5TestShapeOutputService5TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService5ProtocolTest) OutputService5TestCaseOperation1(input *OutputService5TestShapeOutputService5TestCaseOperation1Input) (*OutputService5TestShapeOutputService5TestCaseOperation1Output, error) { + req, out := c.OutputService5TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService5TestShapeOutputService5TestCaseOperation1Input struct { + metadataOutputService5TestShapeOutputService5TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService5TestShapeOutputService5TestCaseOperation1Output struct { + ListMember []*string `locationNameList:"item" type:"list"` + + metadataOutputService5TestShapeOutputService5TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService5TestShapeOutputService5TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService6ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService6ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService6ProtocolTest client from just a session. +// svc := outputservice6protocoltest.New(mySession) +// +// // Create a OutputService6ProtocolTest client with additional configuration +// svc := outputservice6protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService6ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService6ProtocolTest { + c := p.ClientConfig("outputservice6protocoltest", cfgs...) + return newOutputService6ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService6ProtocolTest { + svc := &OutputService6ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice6protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService6ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService6ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService6TestCaseOperation1 = "OperationName" + +// OutputService6TestCaseOperation1Request generates a request for the OutputService6TestCaseOperation1 operation. +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1Request(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (req *request.Request, output *OutputService6TestShapeOutputService6TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService6TestCaseOperation1, + } + + if input == nil { + input = &OutputService6TestShapeOutputService6TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService6TestShapeOutputService6TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService6ProtocolTest) OutputService6TestCaseOperation1(input *OutputService6TestShapeOutputService6TestCaseOperation1Input) (*OutputService6TestShapeOutputService6TestCaseOperation1Output, error) { + req, out := c.OutputService6TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService6TestShapeOutputService6TestCaseOperation1Input struct { + metadataOutputService6TestShapeOutputService6TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService6TestShapeOutputService6TestCaseOperation1Output struct { + ListMember []*string `type:"list" flattened:"true"` + + metadataOutputService6TestShapeOutputService6TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService6TestShapeOutputService6TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService7ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService7ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService7ProtocolTest client from just a session. +// svc := outputservice7protocoltest.New(mySession) +// +// // Create a OutputService7ProtocolTest client with additional configuration +// svc := outputservice7protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService7ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService7ProtocolTest { + c := p.ClientConfig("outputservice7protocoltest", cfgs...) + return newOutputService7ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService7ProtocolTest { + svc := &OutputService7ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice7protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService7ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService7ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService7TestCaseOperation1 = "OperationName" + +// OutputService7TestCaseOperation1Request generates a request for the OutputService7TestCaseOperation1 operation. +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1Request(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (req *request.Request, output *OutputService7TestShapeOutputService7TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService7TestCaseOperation1, + } + + if input == nil { + input = &OutputService7TestShapeOutputService7TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService7TestShapeOutputService7TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService7ProtocolTest) OutputService7TestCaseOperation1(input *OutputService7TestShapeOutputService7TestCaseOperation1Input) (*OutputService7TestShapeOutputService7TestCaseOperation1Output, error) { + req, out := c.OutputService7TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService7TestShapeOutputService7TestCaseOperation1Input struct { + metadataOutputService7TestShapeOutputService7TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService7TestShapeOutputService7TestCaseOperation1Output struct { + ListMember []*string `type:"list" flattened:"true"` + + metadataOutputService7TestShapeOutputService7TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService7TestShapeOutputService7TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService8ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService8ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService8ProtocolTest client from just a session. +// svc := outputservice8protocoltest.New(mySession) +// +// // Create a OutputService8ProtocolTest client with additional configuration +// svc := outputservice8protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService8ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService8ProtocolTest { + c := p.ClientConfig("outputservice8protocoltest", cfgs...) + return newOutputService8ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService8ProtocolTest { + svc := &OutputService8ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice8protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService8ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService8ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService8TestCaseOperation1 = "OperationName" + +// OutputService8TestCaseOperation1Request generates a request for the OutputService8TestCaseOperation1 operation. +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1Request(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (req *request.Request, output *OutputService8TestShapeOutputService8TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService8TestCaseOperation1, + } + + if input == nil { + input = &OutputService8TestShapeOutputService8TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService8TestShapeOutputService8TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService8ProtocolTest) OutputService8TestCaseOperation1(input *OutputService8TestShapeOutputService8TestCaseOperation1Input) (*OutputService8TestShapeOutputService8TestCaseOperation1Output, error) { + req, out := c.OutputService8TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService8TestShapeOutputService8TestCaseOperation1Input struct { + metadataOutputService8TestShapeOutputService8TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService8TestShapeOutputService8TestCaseOperation1Output struct { + List []*OutputService8TestShapeStructureShape `type:"list"` + + metadataOutputService8TestShapeOutputService8TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService8TestShapeOutputService8TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService8TestShapeStructureShape struct { + Bar *string `type:"string"` + + Baz *string `type:"string"` + + Foo *string `type:"string"` + + metadataOutputService8TestShapeStructureShape `json:"-" xml:"-"` +} + +type metadataOutputService8TestShapeStructureShape struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService9ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService9ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService9ProtocolTest client from just a session. +// svc := outputservice9protocoltest.New(mySession) +// +// // Create a OutputService9ProtocolTest client with additional configuration +// svc := outputservice9protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService9ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService9ProtocolTest { + c := p.ClientConfig("outputservice9protocoltest", cfgs...) + return newOutputService9ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService9ProtocolTest { + svc := &OutputService9ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice9protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService9ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService9ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService9TestCaseOperation1 = "OperationName" + +// OutputService9TestCaseOperation1Request generates a request for the OutputService9TestCaseOperation1 operation. +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1Request(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (req *request.Request, output *OutputService9TestShapeOutputService9TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService9TestCaseOperation1, + } + + if input == nil { + input = &OutputService9TestShapeOutputService9TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService9TestShapeOutputService9TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService9ProtocolTest) OutputService9TestCaseOperation1(input *OutputService9TestShapeOutputService9TestCaseOperation1Input) (*OutputService9TestShapeOutputService9TestCaseOperation1Output, error) { + req, out := c.OutputService9TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService9TestShapeOutputService9TestCaseOperation1Input struct { + metadataOutputService9TestShapeOutputService9TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService9TestShapeOutputService9TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService9TestShapeOutputService9TestCaseOperation1Output struct { + List []*OutputService9TestShapeStructureShape `type:"list" flattened:"true"` + + metadataOutputService9TestShapeOutputService9TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService9TestShapeOutputService9TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService9TestShapeStructureShape struct { + Bar *string `type:"string"` + + Baz *string `type:"string"` + + Foo *string `type:"string"` + + metadataOutputService9TestShapeStructureShape `json:"-" xml:"-"` +} + +type metadataOutputService9TestShapeStructureShape struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService10ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService10ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService10ProtocolTest client from just a session. +// svc := outputservice10protocoltest.New(mySession) +// +// // Create a OutputService10ProtocolTest client with additional configuration +// svc := outputservice10protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService10ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService10ProtocolTest { + c := p.ClientConfig("outputservice10protocoltest", cfgs...) + return newOutputService10ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService10ProtocolTest { + svc := &OutputService10ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice10protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService10ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService10ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService10TestCaseOperation1 = "OperationName" + +// OutputService10TestCaseOperation1Request generates a request for the OutputService10TestCaseOperation1 operation. +func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1Request(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (req *request.Request, output *OutputService10TestShapeOutputService10TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService10TestCaseOperation1, + } + + if input == nil { + input = &OutputService10TestShapeOutputService10TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService10TestShapeOutputService10TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService10ProtocolTest) OutputService10TestCaseOperation1(input *OutputService10TestShapeOutputService10TestCaseOperation1Input) (*OutputService10TestShapeOutputService10TestCaseOperation1Output, error) { + req, out := c.OutputService10TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { + metadataOutputService10TestShapeOutputService10TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService10TestShapeOutputService10TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService10TestShapeOutputService10TestCaseOperation1Output struct { + List []*string `locationNameList:"NamedList" type:"list" flattened:"true"` + + metadataOutputService10TestShapeOutputService10TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService10TestShapeOutputService10TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService11ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService11ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService11ProtocolTest client from just a session. +// svc := outputservice11protocoltest.New(mySession) +// +// // Create a OutputService11ProtocolTest client with additional configuration +// svc := outputservice11protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService11ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService11ProtocolTest { + c := p.ClientConfig("outputservice11protocoltest", cfgs...) + return newOutputService11ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService11ProtocolTest { + svc := &OutputService11ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice11protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService11ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService11ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService11TestCaseOperation1 = "OperationName" + +// OutputService11TestCaseOperation1Request generates a request for the OutputService11TestCaseOperation1 operation. +func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1Request(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (req *request.Request, output *OutputService11TestShapeOutputService11TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService11TestCaseOperation1, + } + + if input == nil { + input = &OutputService11TestShapeOutputService11TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService11TestShapeOutputService11TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService11ProtocolTest) OutputService11TestCaseOperation1(input *OutputService11TestShapeOutputService11TestCaseOperation1Input) (*OutputService11TestShapeOutputService11TestCaseOperation1Output, error) { + req, out := c.OutputService11TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService11TestShapeOutputService11TestCaseOperation1Input struct { + metadataOutputService11TestShapeOutputService11TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService11TestShapeOutputService11TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService11TestShapeOutputService11TestCaseOperation1Output struct { + Map map[string]*OutputService11TestShapeStructType `type:"map"` + + metadataOutputService11TestShapeOutputService11TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService11TestShapeOutputService11TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService11TestShapeStructType struct { + Foo *string `locationName:"foo" type:"string"` + + metadataOutputService11TestShapeStructType `json:"-" xml:"-"` +} + +type metadataOutputService11TestShapeStructType struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService12ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService12ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService12ProtocolTest client from just a session. +// svc := outputservice12protocoltest.New(mySession) +// +// // Create a OutputService12ProtocolTest client with additional configuration +// svc := outputservice12protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService12ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService12ProtocolTest { + c := p.ClientConfig("outputservice12protocoltest", cfgs...) + return newOutputService12ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService12ProtocolTest { + svc := &OutputService12ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice12protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService12ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService12ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService12TestCaseOperation1 = "OperationName" + +// OutputService12TestCaseOperation1Request generates a request for the OutputService12TestCaseOperation1 operation. +func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1Request(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (req *request.Request, output *OutputService12TestShapeOutputService12TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService12TestCaseOperation1, + } + + if input == nil { + input = &OutputService12TestShapeOutputService12TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService12TestShapeOutputService12TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService12ProtocolTest) OutputService12TestCaseOperation1(input *OutputService12TestShapeOutputService12TestCaseOperation1Input) (*OutputService12TestShapeOutputService12TestCaseOperation1Output, error) { + req, out := c.OutputService12TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService12TestShapeOutputService12TestCaseOperation1Input struct { + metadataOutputService12TestShapeOutputService12TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService12TestShapeOutputService12TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService12TestShapeOutputService12TestCaseOperation1Output struct { + Map map[string]*string `type:"map" flattened:"true"` + + metadataOutputService12TestShapeOutputService12TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService12TestShapeOutputService12TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService13ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService13ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService13ProtocolTest client from just a session. +// svc := outputservice13protocoltest.New(mySession) +// +// // Create a OutputService13ProtocolTest client with additional configuration +// svc := outputservice13protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService13ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService13ProtocolTest { + c := p.ClientConfig("outputservice13protocoltest", cfgs...) + return newOutputService13ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService13ProtocolTest { + svc := &OutputService13ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice13protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService13ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService13ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService13TestCaseOperation1 = "OperationName" + +// OutputService13TestCaseOperation1Request generates a request for the OutputService13TestCaseOperation1 operation. +func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1Request(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (req *request.Request, output *OutputService13TestShapeOutputService13TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService13TestCaseOperation1, + } + + if input == nil { + input = &OutputService13TestShapeOutputService13TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService13TestShapeOutputService13TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService13ProtocolTest) OutputService13TestCaseOperation1(input *OutputService13TestShapeOutputService13TestCaseOperation1Input) (*OutputService13TestShapeOutputService13TestCaseOperation1Output, error) { + req, out := c.OutputService13TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService13TestShapeOutputService13TestCaseOperation1Input struct { + metadataOutputService13TestShapeOutputService13TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService13TestShapeOutputService13TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService13TestShapeOutputService13TestCaseOperation1Output struct { + Map map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` + + metadataOutputService13TestShapeOutputService13TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService13TestShapeOutputService13TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService14ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService14ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService14ProtocolTest client from just a session. +// svc := outputservice14protocoltest.New(mySession) +// +// // Create a OutputService14ProtocolTest client with additional configuration +// svc := outputservice14protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService14ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService14ProtocolTest { + c := p.ClientConfig("outputservice14protocoltest", cfgs...) + return newOutputService14ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService14ProtocolTest { + svc := &OutputService14ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice14protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService14ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService14ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService14TestCaseOperation1 = "OperationName" + +// OutputService14TestCaseOperation1Request generates a request for the OutputService14TestCaseOperation1 operation. +func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1Request(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (req *request.Request, output *OutputService14TestShapeOutputService14TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService14TestCaseOperation1, + } + + if input == nil { + input = &OutputService14TestShapeOutputService14TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService14TestShapeOutputService14TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService14ProtocolTest) OutputService14TestCaseOperation1(input *OutputService14TestShapeOutputService14TestCaseOperation1Input) (*OutputService14TestShapeOutputService14TestCaseOperation1Output, error) { + req, out := c.OutputService14TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService14TestShapeOutputService14TestCaseOperation1Input struct { + metadataOutputService14TestShapeOutputService14TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService14TestShapeOutputService14TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService14TestShapeOutputService14TestCaseOperation1Output struct { + Map map[string]*string `locationNameKey:"foo" locationNameValue:"bar" type:"map" flattened:"true"` + + metadataOutputService14TestShapeOutputService14TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService14TestShapeOutputService14TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. +type OutputService15ProtocolTest struct { + *client.Client +} + +// New creates a new instance of the OutputService15ProtocolTest client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a OutputService15ProtocolTest client from just a session. +// svc := outputservice15protocoltest.New(mySession) +// +// // Create a OutputService15ProtocolTest client with additional configuration +// svc := outputservice15protocoltest.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func NewOutputService15ProtocolTest(p client.ConfigProvider, cfgs ...*aws.Config) *OutputService15ProtocolTest { + c := p.ClientConfig("outputservice15protocoltest", cfgs...) + return newOutputService15ProtocolTestClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *OutputService15ProtocolTest { + svc := &OutputService15ProtocolTest{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: "outputservice15protocoltest", + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + + return svc +} + +// newRequest creates a new request for a OutputService15ProtocolTest operation and runs any +// custom request initialization. +func (c *OutputService15ProtocolTest) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + return req +} + +const opOutputService15TestCaseOperation1 = "OperationName" + +// OutputService15TestCaseOperation1Request generates a request for the OutputService15TestCaseOperation1 operation. +func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1Request(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (req *request.Request, output *OutputService15TestShapeOutputService15TestCaseOperation1Output) { + op := &request.Operation{ + Name: opOutputService15TestCaseOperation1, + } + + if input == nil { + input = &OutputService15TestShapeOutputService15TestCaseOperation1Input{} + } + + req = c.newRequest(op, input, output) + output = &OutputService15TestShapeOutputService15TestCaseOperation1Output{} + req.Data = output + return +} + +func (c *OutputService15ProtocolTest) OutputService15TestCaseOperation1(input *OutputService15TestShapeOutputService15TestCaseOperation1Input) (*OutputService15TestShapeOutputService15TestCaseOperation1Output, error) { + req, out := c.OutputService15TestCaseOperation1Request(input) + err := req.Send() + return out, err +} + +type OutputService15TestShapeOutputService15TestCaseOperation1Input struct { + metadataOutputService15TestShapeOutputService15TestCaseOperation1Input `json:"-" xml:"-"` +} + +type metadataOutputService15TestShapeOutputService15TestCaseOperation1Input struct { + SDKShapeTraits bool `type:"structure"` +} + +type OutputService15TestShapeOutputService15TestCaseOperation1Output struct { + Foo *string `type:"string"` + + metadataOutputService15TestShapeOutputService15TestCaseOperation1Output `json:"-" xml:"-"` +} + +type metadataOutputService15TestShapeOutputService15TestCaseOperation1Output struct { + SDKShapeTraits bool `type:"structure"` +} + +// +// Tests begin here +// + +func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService1ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("myname123falsetrue1.21.3200a2015-01-25T08:00:00Zrequest-id")) + req, out := svc.OutputService1TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "a", *out.Char) + assert.Equal(t, 1.3, *out.Double) + assert.Equal(t, false, *out.FalseBool) + assert.Equal(t, 1.2, *out.Float) + assert.Equal(t, int64(200), *out.Long) + assert.Equal(t, int64(123), *out.Num) + assert.Equal(t, "myname", *out.Str) + assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String()) + assert.Equal(t, true, *out.TrueBool) + +} + +func TestOutputService2ProtocolTestNotAllMembersInResponseCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService2ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("mynamerequest-id")) + req, out := svc.OutputService2TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "myname", *out.Str) + +} + +func TestOutputService3ProtocolTestBlobCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService3ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("dmFsdWU=requestid")) + req, out := svc.OutputService3TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "value", string(out.Blob)) + +} + +func TestOutputService4ProtocolTestListsCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService4ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService4TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService5ProtocolTestListWithCustomMemberNameCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService5ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService5TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService6ProtocolTestFlattenedListCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService6ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abc123requestid")) + req, out := svc.OutputService6TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + assert.Equal(t, "123", *out.ListMember[1]) + +} + +func TestOutputService7ProtocolTestFlattenedSingleElementListCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService7ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abcrequestid")) + req, out := svc.OutputService7TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "abc", *out.ListMember[0]) + +} + +func TestOutputService8ProtocolTestListOfStructuresCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService8ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) + req, out := svc.OutputService8TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "firstbar", *out.List[0].Bar) + assert.Equal(t, "firstbaz", *out.List[0].Baz) + assert.Equal(t, "firstfoo", *out.List[0].Foo) + assert.Equal(t, "secondbar", *out.List[1].Bar) + assert.Equal(t, "secondbaz", *out.List[1].Baz) + assert.Equal(t, "secondfoo", *out.List[1].Foo) + +} + +func TestOutputService9ProtocolTestFlattenedListOfStructuresCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService9ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("firstfoofirstbarfirstbazsecondfoosecondbarsecondbazrequestid")) + req, out := svc.OutputService9TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "firstbar", *out.List[0].Bar) + assert.Equal(t, "firstbaz", *out.List[0].Baz) + assert.Equal(t, "firstfoo", *out.List[0].Foo) + assert.Equal(t, "secondbar", *out.List[1].Bar) + assert.Equal(t, "secondbaz", *out.List[1].Baz) + assert.Equal(t, "secondfoo", *out.List[1].Foo) + +} + +func TestOutputService10ProtocolTestFlattenedListWithLocationNameCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService10ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("abrequestid")) + req, out := svc.OutputService10TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "a", *out.List[0]) + assert.Equal(t, "b", *out.List[1]) + +} + +func TestOutputService11ProtocolTestNormalMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService11ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService11TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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) + +} + +func TestOutputService12ProtocolTestFlattenedMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService12ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService12TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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"]) + +} + +func TestOutputService13ProtocolTestFlattenedMapInShapeDefinitionCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService13ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarrequestid")) + req, out := svc.OutputService13TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "bar", *out.Map["qux"]) + +} + +func TestOutputService14ProtocolTestNamedMapCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService14ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) + req, out := svc.OutputService14TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // 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"]) + +} + +func TestOutputService15ProtocolTestEmptyStringCase1(t *testing.T) { + sess := session.New() + svc := NewOutputService15ProtocolTest(sess, &aws.Config{Endpoint: aws.String("https://test")}) + + buf := bytes.NewReader([]byte("requestid")) + req, out := svc.OutputService15TestCaseOperation1Request(nil) + req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} + + // set headers + + // unmarshal response + query.UnmarshalMeta(req) + query.Unmarshal(req) + assert.NoError(t, req.Error) + + // assert response + assert.NotNil(t, out) // ensure out variable is used + assert.Equal(t, "", *out.Foo) + +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/build.go new file mode 100644 index 00000000000..87352bc60de --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/build.go @@ -0,0 +1,254 @@ +// Package rest provides RESTful serialization of AWS requests and responses. +package rest + +import ( + "bytes" + "encoding/base64" + "fmt" + "io" + "net/http" + "net/url" + "path" + "reflect" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// 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 + +var errValueNotSet = fmt.Errorf("value not set") + +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 *request.Request) { + if r.ParamsFilled() { + v := reflect.ValueOf(r.Params).Elem() + buildLocationElements(r, v) + buildBody(r, v) + } +} + +func buildLocationElements(r *request.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 + } + + var err error + switch field.Tag.Get("location") { + case "headers": // header maps + err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName")) + case "header": + err = buildHeader(&r.HTTPRequest.Header, m, name) + case "uri": + err = buildURI(r.HTTPRequest.URL, m, name) + case "querystring": + err = buildQueryString(query, m, name) + } + r.Error = err + } + if r.Error != nil { + return + } + } + + r.HTTPRequest.URL.RawQuery = query.Encode() + updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path) +} + +func buildBody(r *request.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 = awserr.New("SerializationError", + "failed to encode REST request", + fmt.Errorf("unknown payload type %s", payload.Type())) + } + } + } + } + } +} + +func buildHeader(header *http.Header, v reflect.Value, name string) error { + str, err := convertType(v) + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + } + + header.Add(name, str) + + return nil +} + +func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error { + for _, key := range v.MapKeys() { + str, err := convertType(v.MapIndex(key)) + if err == errValueNotSet { + continue + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + + } + + header.Add(prefix+key.String(), str) + } + return nil +} + +func buildURI(u *url.URL, v reflect.Value, name string) error { + value, err := convertType(v) + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + } + + uri := u.Path + uri = strings.Replace(uri, "{"+name+"}", EscapePath(value, true), -1) + uri = strings.Replace(uri, "{"+name+"+}", EscapePath(value, false), -1) + u.Path = uri + + return nil +} + +func buildQueryString(query url.Values, v reflect.Value, name string) error { + switch value := v.Interface().(type) { + case []*string: + for _, item := range value { + query.Add(name, *item) + } + case map[string]*string: + for key, item := range value { + query.Add(key, *item) + } + case map[string][]*string: + for key, items := range value { + for _, item := range items { + query.Add(key, *item) + } + } + default: + str, err := convertType(v) + if err == errValueNotSet { + return nil + } else if err != nil { + return awserr.New("SerializationError", "failed to encode REST request", err) + } + query.Set(name, str) + } + + return nil +} + +func updatePath(url *url.URL, urlPath string) { + scheme, query := url.Scheme, url.RawQuery + + hasSlash := strings.HasSuffix(urlPath, "/") + + // clean up path + urlPath = path.Clean(urlPath) + if hasSlash && !strings.HasSuffix(urlPath, "/") { + 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 "", errValueNotSet + } + + 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 "", err + } + return str, nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go new file mode 100644 index 00000000000..1f603bb719f --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/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/private/protocol/rest/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go new file mode 100644 index 00000000000..06d9accbacb --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -0,0 +1,183 @@ +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/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// Unmarshal unmarshals the REST component of a response in a REST service. +func Unmarshal(r *request.Request) { + if r.DataFilled() { + v := reflect.Indirect(reflect.ValueOf(r.Data)) + unmarshalBody(r, v) + } +} + +// UnmarshalMeta unmarshals the REST metadata of a response in a REST service +func UnmarshalMeta(r *request.Request) { + r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") + if r.DataFilled() { + v := reflect.Indirect(reflect.ValueOf(r.Data)) + unmarshalLocationElements(r, v) + } +} + +func unmarshalBody(r *request.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 = awserr.New("SerializationError", "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 = awserr.New("SerializationError", "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 = awserr.New("SerializationError", + "failed to decode REST response", + fmt.Errorf("unknown payload type %s", payload.Type())) + } + } + } + } + } + } +} + +func unmarshalLocationElements(r *request.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 = awserr.New("SerializationError", "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 = awserr.New("SerializationError", "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/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go new file mode 100644 index 00000000000..d3db250231b --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go @@ -0,0 +1,287 @@ +// Package xmlutil provides XML serialisation of AWS requests and responses. +package xmlutil + +import ( + "encoding/base64" + "encoding/xml" + "fmt" + "reflect" + "sort" + "strconv" + "strings" + "time" +) + +// BuildXML will serialize params into an xml.Encoder. +// Error will be returned if the serialization of any of the params or nested values fails. +func BuildXML(params interface{}, e *xml.Encoder) error { + b := xmlBuilder{encoder: e, namespaces: map[string]string{}} + root := NewXMLElement(xml.Name{}) + if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil { + return err + } + for _, c := range root.Children { + for _, v := range c { + return StructToXML(e, v, false) + } + } + return nil +} + +// Returns the reflection element of a value, if it is a pointer. +func elemOf(value reflect.Value) reflect.Value { + for value.Kind() == reflect.Ptr { + value = value.Elem() + } + return value +} + +// A xmlBuilder serializes values from Go code to XML +type xmlBuilder struct { + encoder *xml.Encoder + namespaces map[string]string +} + +// buildValue generic XMLNode builder for any type. Will build value for their specific type +// struct, list, map, scalar. +// +// Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If +// type is not provided reflect will be used to determine the value's type. +func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { + value = elemOf(value) + if !value.IsValid() { // no need to handle zero values + return nil + } else if tag.Get("location") != "" { // don't handle non-body location values + return nil + } + + t := tag.Get("type") + if t == "" { + switch value.Kind() { + case reflect.Struct: + t = "structure" + case reflect.Slice: + t = "list" + case reflect.Map: + t = "map" + } + } + + switch t { + case "structure": + if field, ok := value.Type().FieldByName("SDKShapeTraits"); ok { + tag = tag + reflect.StructTag(" ") + field.Tag + } + return b.buildStruct(value, current, tag) + case "list": + return b.buildList(value, current, tag) + case "map": + return b.buildMap(value, current, tag) + default: + return b.buildScalar(value, current, tag) + } +} + +// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested +// types are converted to XMLNodes also. +func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { + if !value.IsValid() { + return nil + } + + fieldAdded := false + + // unwrap payloads + if payload := tag.Get("payload"); payload != "" { + field, _ := value.Type().FieldByName(payload) + tag = field.Tag + value = elemOf(value.FieldByName(payload)) + + if !value.IsValid() { + return nil + } + } + + child := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) + + // there is an xmlNamespace associated with this struct + if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" { + ns := xml.Attr{ + Name: xml.Name{Local: "xmlns"}, + Value: uri, + } + if prefix != "" { + b.namespaces[prefix] = uri // register the namespace + ns.Name.Local = "xmlns:" + prefix + } + + child.Attr = append(child.Attr, ns) + } + + t := value.Type() + for i := 0; i < value.NumField(); i++ { + if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c { + continue // ignore unexported fields + } + + member := elemOf(value.Field(i)) + field := t.Field(i) + mTag := field.Tag + + if mTag.Get("location") != "" { // skip non-body members + continue + } + + memberName := mTag.Get("locationName") + if memberName == "" { + memberName = field.Name + mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`) + } + if err := b.buildValue(member, child, mTag); err != nil { + return err + } + + fieldAdded = true + } + + if fieldAdded { // only append this child if we have one ore more valid members + current.AddChild(child) + } + + return nil +} + +// buildList adds the value's list items to the current XMLNode as children nodes. All +// nested values in the list are converted to XMLNodes also. +func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { + if value.IsNil() { // don't build omitted lists + return nil + } + + // check for unflattened list member + flattened := tag.Get("flattened") != "" + + xname := xml.Name{Local: tag.Get("locationName")} + if flattened { + for i := 0; i < value.Len(); i++ { + child := NewXMLElement(xname) + current.AddChild(child) + if err := b.buildValue(value.Index(i), child, ""); err != nil { + return err + } + } + } else { + list := NewXMLElement(xname) + current.AddChild(list) + + for i := 0; i < value.Len(); i++ { + iname := tag.Get("locationNameList") + if iname == "" { + iname = "member" + } + + child := NewXMLElement(xml.Name{Local: iname}) + list.AddChild(child) + if err := b.buildValue(value.Index(i), child, ""); err != nil { + return err + } + } + } + + return nil +} + +// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All +// nested values in the map are converted to XMLNodes also. +// +// Error will be returned if it is unable to build the map's values into XMLNodes +func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { + if value.IsNil() { // don't build omitted maps + return nil + } + + maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) + current.AddChild(maproot) + current = maproot + + kname, vname := "key", "value" + if n := tag.Get("locationNameKey"); n != "" { + kname = n + } + if n := tag.Get("locationNameValue"); n != "" { + vname = n + } + + // sorting is not required for compliance, but it makes testing easier + keys := make([]string, value.Len()) + for i, k := range value.MapKeys() { + keys[i] = k.String() + } + sort.Strings(keys) + + for _, k := range keys { + v := value.MapIndex(reflect.ValueOf(k)) + + mapcur := current + if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps + child := NewXMLElement(xml.Name{Local: "entry"}) + mapcur.AddChild(child) + mapcur = child + } + + kchild := NewXMLElement(xml.Name{Local: kname}) + kchild.Text = k + vchild := NewXMLElement(xml.Name{Local: vname}) + mapcur.AddChild(kchild) + mapcur.AddChild(vchild) + + if err := b.buildValue(v, vchild, ""); err != nil { + return err + } + } + + return nil +} + +// buildScalar will convert the value into a string and append it as a attribute or child +// of the current XMLNode. +// +// The value will be added as an attribute if tag contains a "xmlAttribute" attribute value. +// +// Error will be returned if the value type is unsupported. +func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { + var str string + switch converted := value.Interface().(type) { + case string: + str = converted + case []byte: + if !value.IsNil() { + str = base64.StdEncoding.EncodeToString(converted) + } + case bool: + str = strconv.FormatBool(converted) + case int64: + str = strconv.FormatInt(converted, 10) + case int: + str = strconv.Itoa(converted) + case float64: + str = strconv.FormatFloat(converted, 'f', -1, 64) + case float32: + str = strconv.FormatFloat(float64(converted), 'f', -1, 32) + case time.Time: + const ISO8601UTC = "2006-01-02T15:04:05Z" + str = converted.UTC().Format(ISO8601UTC) + default: + return fmt.Errorf("unsupported value for param %s: %v (%s)", + tag.Get("locationName"), value.Interface(), value.Type().Name()) + } + + xname := xml.Name{Local: tag.Get("locationName")} + if tag.Get("xmlAttribute") != "" { // put into current node's attribute list + attr := xml.Attr{Name: xname, Value: str} + current.Attr = append(current.Attr, attr) + } else { // regular text node + current.AddChild(&XMLNode{Name: xname, Text: str}) + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go new file mode 100644 index 00000000000..5e4fe210b36 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go @@ -0,0 +1,260 @@ +package xmlutil + +import ( + "encoding/base64" + "encoding/xml" + "fmt" + "io" + "reflect" + "strconv" + "strings" + "time" +) + +// UnmarshalXML deserializes an xml.Decoder into the container v. V +// needs to match the shape of the XML expected to be decoded. +// If the shape doesn't match unmarshaling will fail. +func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { + n, _ := XMLToStruct(d, nil) + if n.Children != nil { + for _, root := range n.Children { + for _, c := range root { + if wrappedChild, ok := c.Children[wrapper]; ok { + c = wrappedChild[0] // pull out wrapped element + } + + err := parse(reflect.ValueOf(v), c, "") + if err != nil { + if err == io.EOF { + return nil + } + return err + } + } + } + return nil + } + return nil +} + +// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect +// will be used to determine the type from r. +func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { + rtype := r.Type() + if rtype.Kind() == reflect.Ptr { + rtype = rtype.Elem() // check kind of actual element type + } + + t := tag.Get("type") + if t == "" { + switch rtype.Kind() { + case reflect.Struct: + t = "structure" + case reflect.Slice: + t = "list" + case reflect.Map: + t = "map" + } + } + + switch t { + case "structure": + if field, ok := rtype.FieldByName("SDKShapeTraits"); ok { + tag = field.Tag + } + return parseStruct(r, node, tag) + case "list": + return parseList(r, node, tag) + case "map": + return parseMap(r, node, tag) + default: + return parseScalar(r, node, tag) + } +} + +// parseStruct deserializes a structure and its fields from an XMLNode. Any nested +// types in the structure will also be deserialized. +func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { + t := r.Type() + if r.Kind() == reflect.Ptr { + if r.IsNil() { // create the structure if it's nil + s := reflect.New(r.Type().Elem()) + r.Set(s) + r = s + } + + r = r.Elem() + t = t.Elem() + } + + // unwrap any payloads + if payload := tag.Get("payload"); payload != "" { + field, _ := t.FieldByName(payload) + return parseStruct(r.FieldByName(payload), node, field.Tag) + } + + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + if c := field.Name[0:1]; strings.ToLower(c) == c { + continue // ignore unexported fields + } + + // figure out what this field is called + name := field.Name + if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { + name = field.Tag.Get("locationNameList") + } else if locName := field.Tag.Get("locationName"); locName != "" { + name = locName + } + + // try to find the field by name in elements + elems := node.Children[name] + + if elems == nil { // try to find the field in attributes + for _, a := range node.Attr { + if name == a.Name.Local { + // turn this into a text node for de-serializing + elems = []*XMLNode{{Text: a.Value}} + } + } + } + + member := r.FieldByName(field.Name) + for _, elem := range elems { + err := parse(member, elem, field.Tag) + if err != nil { + return err + } + } + } + return nil +} + +// parseList deserializes a list of values from an XML node. Each list entry +// will also be deserialized. +func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { + t := r.Type() + + if tag.Get("flattened") == "" { // look at all item entries + mname := "member" + if name := tag.Get("locationNameList"); name != "" { + mname = name + } + + if Children, ok := node.Children[mname]; ok { + if r.IsNil() { + r.Set(reflect.MakeSlice(t, len(Children), len(Children))) + } + + for i, c := range Children { + err := parse(r.Index(i), c, "") + if err != nil { + return err + } + } + } + } else { // flattened list means this is a single element + if r.IsNil() { + r.Set(reflect.MakeSlice(t, 0, 0)) + } + + childR := reflect.Zero(t.Elem()) + r.Set(reflect.Append(r, childR)) + err := parse(r.Index(r.Len()-1), node, "") + if err != nil { + return err + } + } + + return nil +} + +// 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 { + if r.IsNil() { + r.Set(reflect.MakeMap(r.Type())) + } + + if tag.Get("flattened") == "" { // look at all child entries + for _, entry := range node.Children["entry"] { + parseMapEntry(r, entry, tag) + } + } else { // this element is itself an entry + parseMapEntry(r, node, tag) + } + + return nil +} + +// parseMapEntry deserializes a map entry from a XML node. +func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { + kname, vname := "key", "value" + if n := tag.Get("locationNameKey"); n != "" { + kname = n + } + if n := tag.Get("locationNameValue"); n != "" { + vname = n + } + + keys, ok := node.Children[kname] + values := node.Children[vname] + if ok { + for i, key := range keys { + keyR := reflect.ValueOf(key.Text) + value := values[i] + valueR := reflect.New(r.Type().Elem()).Elem() + + parse(valueR, value, "") + r.SetMapIndex(keyR, valueR) + } + } + return nil +} + +// parseScaller deserializes an XMLNode value into a concrete type based on the +// interface type of r. +// +// Error is returned if the deserialization fails due to invalid type conversion, +// or unsupported interface type. +func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { + switch r.Interface().(type) { + case *string: + r.Set(reflect.ValueOf(&node.Text)) + return nil + case []byte: + b, err := base64.StdEncoding.DecodeString(node.Text) + if err != nil { + return err + } + r.Set(reflect.ValueOf(b)) + case *bool: + v, err := strconv.ParseBool(node.Text) + if err != nil { + return err + } + r.Set(reflect.ValueOf(&v)) + case *int64: + v, err := strconv.ParseInt(node.Text, 10, 64) + if err != nil { + return err + } + r.Set(reflect.ValueOf(&v)) + case *float64: + v, err := strconv.ParseFloat(node.Text, 64) + if err != nil { + return err + } + r.Set(reflect.ValueOf(&v)) + case *time.Time: + const ISO8601UTC = "2006-01-02T15:04:05Z" + t, err := time.Parse(ISO8601UTC, node.Text) + if err != nil { + return err + } + r.Set(reflect.ValueOf(&t)) + default: + return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type()) + } + return nil +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go new file mode 100644 index 00000000000..72c198a9d8d --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go @@ -0,0 +1,105 @@ +package xmlutil + +import ( + "encoding/xml" + "io" + "sort" +) + +// A XMLNode contains the values to be encoded or decoded. +type XMLNode struct { + Name xml.Name `json:",omitempty"` + Children map[string][]*XMLNode `json:",omitempty"` + Text string `json:",omitempty"` + Attr []xml.Attr `json:",omitempty"` +} + +// NewXMLElement returns a pointer to a new XMLNode initialized to default values. +func NewXMLElement(name xml.Name) *XMLNode { + return &XMLNode{ + Name: name, + Children: map[string][]*XMLNode{}, + Attr: []xml.Attr{}, + } +} + +// AddChild adds child to the XMLNode. +func (n *XMLNode) AddChild(child *XMLNode) { + if _, ok := n.Children[child.Name.Local]; !ok { + n.Children[child.Name.Local] = []*XMLNode{} + } + n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child) +} + +// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values. +func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) { + out := &XMLNode{} + for { + tok, err := d.Token() + if tok == nil || err == io.EOF { + break + } + if err != nil { + return out, err + } + + switch typed := tok.(type) { + case xml.CharData: + out.Text = string(typed.Copy()) + case xml.StartElement: + el := typed.Copy() + out.Attr = el.Attr + if out.Children == nil { + out.Children = map[string][]*XMLNode{} + } + + name := typed.Name.Local + slice := out.Children[name] + if slice == nil { + slice = []*XMLNode{} + } + node, e := XMLToStruct(d, &el) + if e != nil { + return out, e + } + node.Name = typed.Name + slice = append(slice, node) + out.Children[name] = slice + case xml.EndElement: + if s != nil && s.Name.Local == typed.Name.Local { // matching end token + return out, nil + } + } + } + return out, nil +} + +// StructToXML writes an XMLNode to a xml.Encoder as tokens. +func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { + e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr}) + + if node.Text != "" { + e.EncodeToken(xml.CharData([]byte(node.Text))) + } else if sorted { + sortedNames := []string{} + for k := range node.Children { + sortedNames = append(sortedNames, k) + } + sort.Strings(sortedNames) + + for _, k := range sortedNames { + for _, v := range node.Children[k] { + StructToXML(e, v, sorted) + } + } + } else { + for _, c := range node.Children { + for _, v := range c { + StructToXML(e, v, sorted) + } + } + } + + e.EncodeToken(xml.EndElement{Name: node.Name}) + return e.Flush() +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go new file mode 100644 index 00000000000..51a26d6ade6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/functional_test.go @@ -0,0 +1,42 @@ +package v4_test + +import ( + "net/url" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/awstesting/unit" + "github.com/aws/aws-sdk-go/service/s3" +) + +func TestPresignHandler(t *testing.T) { + svc := s3.New(unit.Session) + req, _ := svc.PutObjectRequest(&s3.PutObjectInput{ + Bucket: aws.String("bucket"), + Key: aws.String("key"), + ContentDisposition: aws.String("a+b c$d"), + ACL: aws.String("public-read"), + }) + req.Time = time.Unix(0, 0) + urlstr, err := req.Presign(5 * time.Minute) + + assert.NoError(t, err) + + expectedDate := "19700101T000000Z" + expectedHeaders := "host;x-amz-acl" + expectedSig := "7edcb4e3a1bf12f4989018d75acbe3a7f03df24bd6f3112602d59fc551f0e4e2" + expectedCred := "AKID/19700101/mock-region/s3/aws4_request" + + u, _ := url.Parse(urlstr) + urlQ := u.Query() + assert.Equal(t, expectedSig, urlQ.Get("X-Amz-Signature")) + assert.Equal(t, expectedCred, urlQ.Get("X-Amz-Credential")) + assert.Equal(t, expectedHeaders, urlQ.Get("X-Amz-SignedHeaders")) + assert.Equal(t, expectedDate, urlQ.Get("X-Amz-Date")) + assert.Equal(t, "300", urlQ.Get("X-Amz-Expires")) + + assert.NotContains(t, urlstr, "+") // + encoded as %20 +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go new file mode 100644 index 00000000000..dc176f312ba --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4.go @@ -0,0 +1,365 @@ +// Package v4 implements signing for AWS V4 signer +package v4 + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "net/http" + "net/url" + "sort" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/rest" +) + +const ( + authHeaderPrefix = "AWS4-HMAC-SHA256" + timeFormat = "20060102T150405Z" + shortTimeFormat = "20060102" +) + +var ignoredHeaders = map[string]bool{ + "Authorization": true, + "Content-Type": true, + "Content-Length": true, + "User-Agent": true, +} + +type signer struct { + Request *http.Request + Time time.Time + ExpireTime time.Duration + ServiceName string + Region string + CredValues credentials.Value + Credentials *credentials.Credentials + Query url.Values + Body io.ReadSeeker + Debug aws.LogLevelType + Logger aws.Logger + + isPresign bool + formattedTime string + formattedShortTime string + + signedHeaders string + canonicalHeaders string + canonicalString string + credentialString string + stringToSign string + signature string + authorization string +} + +// Sign requests with signature version 4. +// +// Will sign the requests with the service config's Credentials object +// Signing is skipped if the credentials is the credentials.AnonymousCredentials +// object. +func Sign(req *request.Request) { + // If the request does not need to be signed ignore the signing of the + // request if the AnonymousCredentials object is used. + if req.Config.Credentials == credentials.AnonymousCredentials { + return + } + + region := req.ClientInfo.SigningRegion + if region == "" { + region = aws.StringValue(req.Config.Region) + } + + name := req.ClientInfo.SigningName + if name == "" { + name = req.ClientInfo.ServiceName + } + + s := signer{ + Request: req.HTTPRequest, + Time: req.Time, + ExpireTime: req.ExpireTime, + Query: req.HTTPRequest.URL.Query(), + Body: req.Body, + ServiceName: name, + Region: region, + Credentials: req.Config.Credentials, + Debug: req.Config.LogLevel.Value(), + Logger: req.Config.Logger, + } + + req.Error = s.sign() +} + +func (v4 *signer) sign() error { + if v4.ExpireTime != 0 { + v4.isPresign = true + } + + if v4.isRequestSigned() { + if !v4.Credentials.IsExpired() { + // If the request is already signed, and the credentials have not + // expired yet ignore the signing request. + return nil + } + + // The credentials have expired for this request. The current signing + // is invalid, and needs to be request because the request will fail. + if v4.isPresign { + v4.removePresign() + // Update the request's query string to ensure the values stays in + // sync in the case retrieving the new credentials fails. + v4.Request.URL.RawQuery = v4.Query.Encode() + } + } + + var err error + v4.CredValues, err = v4.Credentials.Get() + if err != nil { + return err + } + + if v4.isPresign { + v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix) + if v4.CredValues.SessionToken != "" { + v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) + } else { + v4.Query.Del("X-Amz-Security-Token") + } + } else if v4.CredValues.SessionToken != "" { + v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) + } + + v4.build() + + if v4.Debug.Matches(aws.LogDebugWithSigning) { + v4.logSigningInfo() + } + + return nil +} + +const logSignInfoMsg = `DEBUG: Request Signiture: +---[ CANONICAL STRING ]----------------------------- +%s +---[ STRING TO SIGN ]-------------------------------- +%s%s +-----------------------------------------------------` +const logSignedURLMsg = ` +---[ SIGNED URL ]------------------------------------ +%s` + +func (v4 *signer) logSigningInfo() { + signedURLMsg := "" + if v4.isPresign { + signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String()) + } + msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg) + v4.Logger.Log(msg) +} + +func (v4 *signer) build() { + v4.buildTime() // no depends + v4.buildCredentialString() // no depends + if v4.isPresign { + v4.buildQuery() // no depends + } + v4.buildCanonicalHeaders() // depends on cred string + v4.buildCanonicalString() // depends on canon headers / signed headers + v4.buildStringToSign() // depends on canon string + v4.buildSignature() // depends on string to sign + + if v4.isPresign { + v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature + } else { + parts := []string{ + authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString, + "SignedHeaders=" + v4.signedHeaders, + "Signature=" + v4.signature, + } + v4.Request.Header.Set("Authorization", strings.Join(parts, ", ")) + } +} + +func (v4 *signer) buildTime() { + v4.formattedTime = v4.Time.UTC().Format(timeFormat) + v4.formattedShortTime = v4.Time.UTC().Format(shortTimeFormat) + + if v4.isPresign { + duration := int64(v4.ExpireTime / time.Second) + v4.Query.Set("X-Amz-Date", v4.formattedTime) + v4.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) + } else { + v4.Request.Header.Set("X-Amz-Date", v4.formattedTime) + } +} + +func (v4 *signer) buildCredentialString() { + v4.credentialString = strings.Join([]string{ + v4.formattedShortTime, + v4.Region, + v4.ServiceName, + "aws4_request", + }, "/") + + if v4.isPresign { + v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString) + } +} + +func (v4 *signer) buildQuery() { + for k, h := range v4.Request.Header { + if strings.HasPrefix(http.CanonicalHeaderKey(k), "X-Amz-") { + continue // never hoist x-amz-* headers, they must be signed + } + if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { + continue // never hoist ignored headers + } + + v4.Request.Header.Del(k) + v4.Query.Del(k) + for _, v := range h { + v4.Query.Add(k, v) + } + } +} + +func (v4 *signer) buildCanonicalHeaders() { + var headers []string + headers = append(headers, "host") + for k := range v4.Request.Header { + if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok { + continue // ignored header + } + headers = append(headers, strings.ToLower(k)) + } + sort.Strings(headers) + + v4.signedHeaders = strings.Join(headers, ";") + + if v4.isPresign { + v4.Query.Set("X-Amz-SignedHeaders", v4.signedHeaders) + } + + headerValues := make([]string, len(headers)) + for i, k := range headers { + if k == "host" { + headerValues[i] = "host:" + v4.Request.URL.Host + } else { + headerValues[i] = k + ":" + + strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",") + } + } + + v4.canonicalHeaders = strings.Join(headerValues, "\n") +} + +func (v4 *signer) buildCanonicalString() { + v4.Request.URL.RawQuery = strings.Replace(v4.Query.Encode(), "+", "%20", -1) + uri := v4.Request.URL.Opaque + if uri != "" { + uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/") + } else { + uri = v4.Request.URL.Path + } + if uri == "" { + uri = "/" + } + + if v4.ServiceName != "s3" { + uri = rest.EscapePath(uri, false) + } + + v4.canonicalString = strings.Join([]string{ + v4.Request.Method, + uri, + v4.Request.URL.RawQuery, + v4.canonicalHeaders + "\n", + v4.signedHeaders, + v4.bodyDigest(), + }, "\n") +} + +func (v4 *signer) buildStringToSign() { + v4.stringToSign = strings.Join([]string{ + authHeaderPrefix, + v4.formattedTime, + v4.credentialString, + hex.EncodeToString(makeSha256([]byte(v4.canonicalString))), + }, "\n") +} + +func (v4 *signer) buildSignature() { + secret := v4.CredValues.SecretAccessKey + date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime)) + region := makeHmac(date, []byte(v4.Region)) + service := makeHmac(region, []byte(v4.ServiceName)) + credentials := makeHmac(service, []byte("aws4_request")) + signature := makeHmac(credentials, []byte(v4.stringToSign)) + v4.signature = hex.EncodeToString(signature) +} + +func (v4 *signer) bodyDigest() string { + hash := v4.Request.Header.Get("X-Amz-Content-Sha256") + if hash == "" { + if v4.isPresign && v4.ServiceName == "s3" { + hash = "UNSIGNED-PAYLOAD" + } else if v4.Body == nil { + hash = hex.EncodeToString(makeSha256([]byte{})) + } else { + hash = hex.EncodeToString(makeSha256Reader(v4.Body)) + } + v4.Request.Header.Add("X-Amz-Content-Sha256", hash) + } + return hash +} + +// isRequestSigned returns if the request is currently signed or presigned +func (v4 *signer) isRequestSigned() bool { + if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" { + return true + } + if v4.Request.Header.Get("Authorization") != "" { + return true + } + + return false +} + +// unsign removes signing flags for both signed and presigned requests. +func (v4 *signer) removePresign() { + v4.Query.Del("X-Amz-Algorithm") + v4.Query.Del("X-Amz-Signature") + v4.Query.Del("X-Amz-Security-Token") + v4.Query.Del("X-Amz-Date") + v4.Query.Del("X-Amz-Expires") + v4.Query.Del("X-Amz-Credential") + v4.Query.Del("X-Amz-SignedHeaders") +} + +func makeHmac(key []byte, data []byte) []byte { + hash := hmac.New(sha256.New, key) + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256(data []byte) []byte { + hash := sha256.New() + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256Reader(reader io.ReadSeeker) []byte { + hash := sha256.New() + start, _ := reader.Seek(0, 1) + defer reader.Seek(start, 0) + + io.Copy(hash, reader) + return hash.Sum(nil) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go new file mode 100644 index 00000000000..f39414fcf91 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/signer/v4/v4_test.go @@ -0,0 +1,252 @@ +package v4 + +import ( + "net/http" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting" +) + +func buildSigner(serviceName string, region string, signTime time.Time, expireTime time.Duration, body string) signer { + endpoint := "https://" + serviceName + "." + region + ".amazonaws.com" + reader := strings.NewReader(body) + req, _ := http.NewRequest("POST", endpoint, reader) + req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()" + req.Header.Add("X-Amz-Target", "prefix.Operation") + req.Header.Add("Content-Type", "application/x-amz-json-1.0") + req.Header.Add("Content-Length", string(len(body))) + req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)") + + return signer{ + Request: req, + Time: signTime, + ExpireTime: expireTime, + Query: req.URL.Query(), + Body: reader, + ServiceName: serviceName, + Region: region, + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), + } +} + +func removeWS(text string) string { + text = strings.Replace(text, " ", "", -1) + text = strings.Replace(text, "\n", "", -1) + text = strings.Replace(text, "\t", "", -1) + return text +} + +func assertEqual(t *testing.T, expected, given string) { + if removeWS(expected) != removeWS(given) { + t.Errorf("\nExpected: %s\nGiven: %s", expected, given) + } +} + +func TestPresignRequest(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 300*time.Second, "{}") + signer.sign() + + expectedDate := "19700101T000000Z" + expectedHeaders := "host;x-amz-meta-other-header;x-amz-target" + expectedSig := "5eeedebf6f995145ce56daa02902d10485246d3defb34f97b973c1f40ab82d36" + expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" + + q := signer.Request.URL.Query() + assert.Equal(t, expectedSig, q.Get("X-Amz-Signature")) + assert.Equal(t, expectedCred, q.Get("X-Amz-Credential")) + assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders")) + assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) +} + +func TestSignRequest(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 0, "{}") + 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=69ada33fec48180dab153576e4dd80c4e04124f80dda3eccfed8a67c2b91ed5e" + + q := signer.Request.Header + assert.Equal(t, expectedSig, q.Get("Authorization")) + assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) +} + +func TestSignEmptyBody(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "") + signer.Body = nil + signer.sign() + hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", hash) +} + +func TestSignBody(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello") + signer.sign() + hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) +} + +func TestSignSeekedBody(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, " hello") + signer.Body.Read(make([]byte, 3)) // consume first 3 bytes so body is now "hello" + signer.sign() + hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) + + start, _ := signer.Body.Seek(0, 1) + assert.Equal(t, int64(3), start) +} + +func TestPresignEmptyBodyS3(t *testing.T) { + signer := buildSigner("s3", "us-east-1", time.Now(), 5*time.Minute, "hello") + signer.sign() + hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "UNSIGNED-PAYLOAD", hash) +} + +func TestSignPrecomputedBodyChecksum(t *testing.T) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello") + signer.Request.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED") + signer.sign() + hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + assert.Equal(t, "PRECOMPUTED", hash) +} + +func TestAnonymousCredentials(t *testing.T) { + svc := awstesting.NewClient(&aws.Config{Credentials: credentials.AnonymousCredentials}) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + Sign(r) + + urlQ := r.HTTPRequest.URL.Query() + assert.Empty(t, urlQ.Get("X-Amz-Signature")) + assert.Empty(t, urlQ.Get("X-Amz-Credential")) + assert.Empty(t, urlQ.Get("X-Amz-SignedHeaders")) + assert.Empty(t, urlQ.Get("X-Amz-Date")) + + hQ := r.HTTPRequest.Header + assert.Empty(t, hQ.Get("Authorization")) + assert.Empty(t, hQ.Get("X-Amz-Date")) +} + +func TestIgnoreResignRequestWithValidCreds(t *testing.T) { + svc := awstesting.NewClient(&aws.Config{ + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), + Region: aws.String("us-west-2"), + }) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + + Sign(r) + sig := r.HTTPRequest.Header.Get("Authorization") + + Sign(r) + assert.Equal(t, sig, r.HTTPRequest.Header.Get("Authorization")) +} + +func TestIgnorePreResignRequestWithValidCreds(t *testing.T) { + svc := awstesting.NewClient(&aws.Config{ + Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), + Region: aws.String("us-west-2"), + }) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + r.ExpireTime = time.Minute * 10 + + Sign(r) + sig := r.HTTPRequest.Header.Get("X-Amz-Signature") + + Sign(r) + assert.Equal(t, sig, r.HTTPRequest.Header.Get("X-Amz-Signature")) +} + +func TestResignRequestExpiredCreds(t *testing.T) { + creds := credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") + svc := awstesting.NewClient(&aws.Config{Credentials: creds}) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + Sign(r) + querySig := r.HTTPRequest.Header.Get("Authorization") + + creds.Expire() + + Sign(r) + assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization")) +} + +func TestPreResignRequestExpiredCreds(t *testing.T) { + provider := &credentials.StaticProvider{Value: credentials.Value{ + AccessKeyID: "AKID", + SecretAccessKey: "SECRET", + SessionToken: "SESSION", + }} + creds := credentials.NewCredentials(provider) + svc := awstesting.NewClient(&aws.Config{Credentials: creds}) + r := svc.NewRequest( + &request.Operation{ + Name: "BatchGetItem", + HTTPMethod: "POST", + HTTPPath: "/", + }, + nil, + nil, + ) + r.ExpireTime = time.Minute * 10 + + Sign(r) + querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature") + + creds.Expire() + r.Time = time.Now().Add(time.Hour * 48) + + Sign(r) + assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) +} + +func BenchmarkPresignRequest(b *testing.B) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 300*time.Second, "{}") + for i := 0; i < b.N; i++ { + signer.sign() + } +} + +func BenchmarkSignRequest(b *testing.B) { + signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "{}") + for i := 0; i < b.N; i++ { + signer.sign() + } +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go new file mode 100644 index 00000000000..335af91dc61 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter.go @@ -0,0 +1,103 @@ +package waiter + +import ( + "fmt" + "reflect" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" +) + +// A Config provides a collection of configuration values to setup a generated +// waiter code with. +type Config struct { + Name string + Delay int + MaxAttempts int + Operation string + Acceptors []WaitAcceptor +} + +// A WaitAcceptor provides the information needed to wait for an API operation +// to complete. +type WaitAcceptor struct { + Expected interface{} + Matcher string + State string + Argument string +} + +// A Waiter provides waiting for an operation to complete. +type Waiter struct { + Config + Client interface{} + Input interface{} +} + +// Wait waits for an operation to complete, expire max attempts, or fail. Error +// is returned if the operation fails. +func (w *Waiter) Wait() error { + client := reflect.ValueOf(w.Client) + in := reflect.ValueOf(w.Input) + method := client.MethodByName(w.Config.Operation + "Request") + + for i := 0; i < w.MaxAttempts; i++ { + res := method.Call([]reflect.Value{in}) + req := res[0].Interface().(*request.Request) + req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter")) + if err := req.Send(); err != nil { + return err + } + + for _, a := range w.Acceptors { + result := false + switch a.Matcher { + case "pathAll": + if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil { + result = true + for _, val := range vals { + if !awsutil.DeepEqual(val, a.Expected) { + result = false + break + } + } + } + case "pathAny": + if vals, _ := awsutil.ValuesAtPath(req.Data, a.Argument); req.Error == nil && vals != nil { + for _, val := range vals { + if awsutil.DeepEqual(val, a.Expected) { + result = true + break + } + } + } + case "status": + s := a.Expected.(int) + result = s == req.HTTPResponse.StatusCode + } + + if result { + switch a.State { + case "success": + return nil // waiter completed + case "failure": + if req.Error == nil { + return awserr.New("ResourceNotReady", + fmt.Sprintf("failed waiting for successful resource state"), nil) + } + return req.Error // waiter failed + case "retry": + // do nothing, just retry + } + break + } + } + + time.Sleep(time.Second * time.Duration(w.Delay)) + } + + return awserr.New("ResourceNotReady", + fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go new file mode 100644 index 00000000000..58267295b11 --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/private/waiter/waiter_test.go @@ -0,0 +1,183 @@ +package waiter_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/awstesting" + "github.com/aws/aws-sdk-go/private/waiter" +) + +type mockClient struct { + *client.Client +} +type MockInput struct{} +type MockOutput struct { + States []*MockState +} +type MockState struct { + State *string +} + +func (c *mockClient) MockRequest(input *MockInput) (*request.Request, *MockOutput) { + op := &request.Operation{ + Name: "Mock", + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &MockInput{} + } + + output := &MockOutput{} + req := c.NewRequest(op, input, output) + req.Data = output + return req, output +} + +var mockAcceptors = []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "States[].State", + Expected: "running", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "States[].State", + Expected: "stopping", + }, +} + +func TestWaiter(t *testing.T) { + svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ + Region: aws.String("mock-region"), + })} + svc.Handlers.Send.Clear() // mock sending + svc.Handlers.Unmarshal.Clear() + svc.Handlers.UnmarshalMeta.Clear() + svc.Handlers.ValidateResponse.Clear() + + reqNum := 0 + resps := []*MockOutput{ + { // Request 1 + States: []*MockState{ + {State: aws.String("pending")}, + {State: aws.String("pending")}, + }, + }, + { // Request 1 + States: []*MockState{ + {State: aws.String("running")}, + {State: aws.String("pending")}, + }, + }, + { // Request 1 + States: []*MockState{ + {State: aws.String("running")}, + {State: aws.String("running")}, + }, + }, + } + + numBuiltReq := 0 + svc.Handlers.Build.PushBack(func(r *request.Request) { + numBuiltReq++ + }) + svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { + if reqNum >= len(resps) { + assert.Fail(t, "too many polling requests made") + return + } + r.Data = resps[reqNum] + reqNum++ + }) + + waiterCfg := waiter.Config{ + Operation: "Mock", + Delay: 0, + MaxAttempts: 10, + Acceptors: mockAcceptors, + } + w := waiter.Waiter{ + Client: svc, + Input: &MockInput{}, + Config: waiterCfg, + } + + err := w.Wait() + assert.NoError(t, err) + assert.Equal(t, 3, numBuiltReq) + assert.Equal(t, 3, reqNum) +} + +func TestWaiterFailure(t *testing.T) { + svc := &mockClient{Client: awstesting.NewClient(&aws.Config{ + Region: aws.String("mock-region"), + })} + svc.Handlers.Send.Clear() // mock sending + svc.Handlers.Unmarshal.Clear() + svc.Handlers.UnmarshalMeta.Clear() + svc.Handlers.ValidateResponse.Clear() + + reqNum := 0 + resps := []*MockOutput{ + { // Request 1 + States: []*MockState{ + {State: aws.String("pending")}, + {State: aws.String("pending")}, + }, + }, + { // Request 1 + States: []*MockState{ + {State: aws.String("running")}, + {State: aws.String("pending")}, + }, + }, + { // Request 1 + States: []*MockState{ + {State: aws.String("running")}, + {State: aws.String("stopping")}, + }, + }, + } + + numBuiltReq := 0 + svc.Handlers.Build.PushBack(func(r *request.Request) { + numBuiltReq++ + }) + svc.Handlers.Unmarshal.PushBack(func(r *request.Request) { + if reqNum >= len(resps) { + assert.Fail(t, "too many polling requests made") + return + } + r.Data = resps[reqNum] + reqNum++ + }) + + waiterCfg := waiter.Config{ + Operation: "Mock", + Delay: 0, + MaxAttempts: 10, + Acceptors: mockAcceptors, + } + w := waiter.Waiter{ + Client: svc, + Input: &MockInput{}, + Config: waiterCfg, + } + + err := w.Wait().(awserr.Error) + assert.Error(t, err) + assert.Equal(t, "ResourceNotReady", err.Code()) + assert.Equal(t, "failed waiting for successful resource state", err.Message()) + assert.Equal(t, 3, numBuiltReq) + assert.Equal(t, 3, reqNum) +} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go index d5a92f6d62b..2099e40491d 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/api.go @@ -6,15 +6,15 @@ package cloudwatch import ( "time" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) const opDeleteAlarms = "DeleteAlarms" // DeleteAlarmsRequest generates a request for the DeleteAlarms operation. -func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *aws.Request, output *DeleteAlarmsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request.Request, output *DeleteAlarmsOutput) { + op := &request.Operation{ Name: opDeleteAlarms, HTTPMethod: "POST", HTTPPath: "/", @@ -40,12 +40,12 @@ func (c *CloudWatch) DeleteAlarms(input *DeleteAlarmsInput) (*DeleteAlarmsOutput const opDescribeAlarmHistory = "DescribeAlarmHistory" // DescribeAlarmHistoryRequest generates a request for the DescribeAlarmHistory operation. -func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *aws.Request, output *DescribeAlarmHistoryOutput) { - op := &aws.Operation{ +func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInput) (req *request.Request, output *DescribeAlarmHistoryOutput) { + op := &request.Operation{ Name: opDescribeAlarmHistory, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxRecords", @@ -74,6 +74,7 @@ func (c *CloudWatch) DescribeAlarmHistory(input *DescribeAlarmHistoryInput) (*De func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, fn func(p *DescribeAlarmHistoryOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeAlarmHistoryRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeAlarmHistoryOutput), lastPage) }) @@ -82,12 +83,12 @@ func (c *CloudWatch) DescribeAlarmHistoryPages(input *DescribeAlarmHistoryInput, const opDescribeAlarms = "DescribeAlarms" // DescribeAlarmsRequest generates a request for the DescribeAlarms operation. -func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *aws.Request, output *DescribeAlarmsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *request.Request, output *DescribeAlarmsOutput) { + op := &request.Operation{ Name: opDescribeAlarms, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxRecords", @@ -116,6 +117,7 @@ func (c *CloudWatch) DescribeAlarms(input *DescribeAlarmsInput) (*DescribeAlarms func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p *DescribeAlarmsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeAlarmsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeAlarmsOutput), lastPage) }) @@ -124,8 +126,8 @@ func (c *CloudWatch) DescribeAlarmsPages(input *DescribeAlarmsInput, fn func(p * const opDescribeAlarmsForMetric = "DescribeAlarmsForMetric" // DescribeAlarmsForMetricRequest generates a request for the DescribeAlarmsForMetric operation. -func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *aws.Request, output *DescribeAlarmsForMetricOutput) { - op := &aws.Operation{ +func (c *CloudWatch) DescribeAlarmsForMetricRequest(input *DescribeAlarmsForMetricInput) (req *request.Request, output *DescribeAlarmsForMetricOutput) { + op := &request.Operation{ Name: opDescribeAlarmsForMetric, HTTPMethod: "POST", HTTPPath: "/", @@ -152,8 +154,8 @@ func (c *CloudWatch) DescribeAlarmsForMetric(input *DescribeAlarmsForMetricInput const opDisableAlarmActions = "DisableAlarmActions" // DisableAlarmActionsRequest generates a request for the DisableAlarmActions operation. -func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *aws.Request, output *DisableAlarmActionsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) { + op := &request.Operation{ Name: opDisableAlarmActions, HTTPMethod: "POST", HTTPPath: "/", @@ -180,8 +182,8 @@ func (c *CloudWatch) DisableAlarmActions(input *DisableAlarmActionsInput) (*Disa const opEnableAlarmActions = "EnableAlarmActions" // EnableAlarmActionsRequest generates a request for the EnableAlarmActions operation. -func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *aws.Request, output *EnableAlarmActionsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) { + op := &request.Operation{ Name: opEnableAlarmActions, HTTPMethod: "POST", HTTPPath: "/", @@ -207,8 +209,8 @@ func (c *CloudWatch) EnableAlarmActions(input *EnableAlarmActionsInput) (*Enable const opGetMetricStatistics = "GetMetricStatistics" // GetMetricStatisticsRequest generates a request for the GetMetricStatistics operation. -func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *aws.Request, output *GetMetricStatisticsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) GetMetricStatisticsRequest(input *GetMetricStatisticsInput) (req *request.Request, output *GetMetricStatisticsOutput) { + op := &request.Operation{ Name: opGetMetricStatistics, HTTPMethod: "POST", HTTPPath: "/", @@ -259,12 +261,12 @@ func (c *CloudWatch) GetMetricStatistics(input *GetMetricStatisticsInput) (*GetM const opListMetrics = "ListMetrics" // ListMetricsRequest generates a request for the ListMetrics operation. -func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *aws.Request, output *ListMetricsOutput) { - op := &aws.Operation{ +func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.Request, output *ListMetricsOutput) { + op := &request.Operation{ Name: opListMetrics, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "", @@ -293,6 +295,7 @@ func (c *CloudWatch) ListMetrics(input *ListMetricsInput) (*ListMetricsOutput, e func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMetricsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.ListMetricsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*ListMetricsOutput), lastPage) }) @@ -301,8 +304,8 @@ func (c *CloudWatch) ListMetricsPages(input *ListMetricsInput, fn func(p *ListMe const opPutMetricAlarm = "PutMetricAlarm" // PutMetricAlarmRequest generates a request for the PutMetricAlarm operation. -func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *aws.Request, output *PutMetricAlarmOutput) { - op := &aws.Operation{ +func (c *CloudWatch) PutMetricAlarmRequest(input *PutMetricAlarmInput) (req *request.Request, output *PutMetricAlarmOutput) { + op := &request.Operation{ Name: opPutMetricAlarm, HTTPMethod: "POST", HTTPPath: "/", @@ -334,8 +337,8 @@ func (c *CloudWatch) PutMetricAlarm(input *PutMetricAlarmInput) (*PutMetricAlarm const opPutMetricData = "PutMetricData" // PutMetricDataRequest generates a request for the PutMetricData operation. -func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *aws.Request, output *PutMetricDataOutput) { - op := &aws.Operation{ +func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *request.Request, output *PutMetricDataOutput) { + op := &request.Operation{ Name: opPutMetricData, HTTPMethod: "POST", HTTPPath: "/", @@ -374,8 +377,8 @@ func (c *CloudWatch) PutMetricData(input *PutMetricDataInput) (*PutMetricDataOut const opSetAlarmState = "SetAlarmState" // SetAlarmStateRequest generates a request for the SetAlarmState operation. -func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *aws.Request, output *SetAlarmStateOutput) { - op := &aws.Operation{ +func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *request.Request, output *SetAlarmStateOutput) { + op := &request.Operation{ Name: opSetAlarmState, HTTPMethod: "POST", HTTPPath: "/", @@ -406,16 +409,16 @@ func (c *CloudWatch) SetAlarmState(input *SetAlarmStateInput) (*SetAlarmStateOut // returns this data type as part of the DescribeAlarmHistoryResult data type. type AlarmHistoryItem struct { // The descriptive name for the alarm. - AlarmName *string `type:"string"` + AlarmName *string `min:"1" type:"string"` // Machine-readable data about the alarm in JSON format. - HistoryData *string `type:"string"` + HistoryData *string `min:"1" type:"string"` // The type of alarm history item. HistoryItemType *string `type:"string" enum:"HistoryItemType"` // A human-readable summary of the alarm history. - HistorySummary *string `type:"string"` + HistorySummary *string `min:"1" type:"string"` // The time stamp for the alarm history item. Amazon CloudWatch uses Coordinated // Universal Time (UTC) when returning time stamps, which do not accommodate @@ -528,7 +531,7 @@ func (s DeleteAlarmsOutput) GoString() string { type DescribeAlarmHistoryInput struct { // The name of the alarm. - AlarmName *string `type:"string"` + AlarmName *string `min:"1" type:"string"` // The ending date to retrieve alarm history. EndDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` @@ -537,7 +540,7 @@ type DescribeAlarmHistoryInput struct { HistoryItemType *string `type:"string" enum:"HistoryItemType"` // The maximum number of alarm history records to retrieve. - MaxRecords *int64 `type:"integer"` + MaxRecords *int64 `min:"1" type:"integer"` // The token returned by a previous call to indicate that there is more data // available. @@ -593,13 +596,13 @@ type DescribeAlarmsForMetricInput struct { Dimensions []*Dimension `type:"list"` // The name of the metric. - MetricName *string `type:"string" required:"true"` + MetricName *string `min:"1" type:"string" required:"true"` // The namespace of the metric. - Namespace *string `type:"string" required:"true"` + Namespace *string `min:"1" type:"string" required:"true"` // The period in seconds over which the statistic is applied. - Period *int64 `type:"integer"` + Period *int64 `min:"60" type:"integer"` // The statistic for the metric. Statistic *string `type:"string" enum:"Statistic"` @@ -648,17 +651,17 @@ func (s DescribeAlarmsForMetricOutput) GoString() string { type DescribeAlarmsInput struct { // The action name prefix. - ActionPrefix *string `type:"string"` + ActionPrefix *string `min:"1" type:"string"` // The alarm name prefix. AlarmNames cannot be specified if this parameter is // specified. - AlarmNamePrefix *string `type:"string"` + AlarmNamePrefix *string `min:"1" type:"string"` // A list of alarm names to retrieve information for. AlarmNames []*string `type:"list"` // The maximum number of alarm descriptions to retrieve. - MaxRecords *int64 `type:"integer"` + MaxRecords *int64 `min:"1" type:"integer"` // The token returned by a previous call to indicate that there is more data // available. @@ -715,10 +718,10 @@ func (s DescribeAlarmsOutput) GoString() string { // For examples that use one or more dimensions, see PutMetricData. type Dimension struct { // The name of the dimension. - Name *string `type:"string" required:"true"` + Name *string `min:"1" type:"string" required:"true"` // The value representing the dimension measurement - Value *string `type:"string" required:"true"` + Value *string `min:"1" type:"string" required:"true"` metadataDimension `json:"-" xml:"-"` } @@ -740,10 +743,10 @@ func (s Dimension) GoString() string { // The DimensionFilter data type is used to filter ListMetrics results. type DimensionFilter struct { // The dimension name to be matched. - Name *string `type:"string" required:"true"` + Name *string `min:"1" type:"string" required:"true"` // The value of the dimension to be matched. - Value *string `type:"string"` + Value *string `min:"1" type:"string"` metadataDimensionFilter `json:"-" xml:"-"` } @@ -850,14 +853,14 @@ type GetMetricStatisticsInput struct { EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` // The name of the metric, with or without spaces. - MetricName *string `type:"string" required:"true"` + MetricName *string `min:"1" type:"string" required:"true"` // The namespace of the metric, with or without spaces. - Namespace *string `type:"string" required:"true"` + Namespace *string `min:"1" type:"string" required:"true"` // The granularity, in seconds, of the returned datapoints. Period must be at // least 60 seconds and must be a multiple of 60. The default value is 60. - Period *int64 `type:"integer" required:"true"` + Period *int64 `min:"60" type:"integer" required:"true"` // The time stamp to use for determining the first datapoint to return. The // value specified is inclusive; results include datapoints with the time stamp @@ -869,7 +872,7 @@ type GetMetricStatisticsInput struct { // in the Amazon CloudWatch Developer Guide. // // Valid Values: Average | Sum | SampleCount | Maximum | Minimum - Statistics []*string `type:"list" required:"true"` + Statistics []*string `min:"1" type:"list" required:"true"` // The unit for the metric. Unit *string `type:"string" enum:"StandardUnit"` @@ -921,10 +924,10 @@ type ListMetricsInput struct { Dimensions []*DimensionFilter `type:"list"` // The name of the metric to filter against. - MetricName *string `type:"string"` + MetricName *string `min:"1" type:"string"` // The namespace to filter against. - Namespace *string `type:"string"` + Namespace *string `min:"1" type:"string"` // The token returned by a previous call to indicate that there is more data // available. @@ -984,10 +987,10 @@ type Metric struct { Dimensions []*Dimension `type:"list"` // The name of the metric. - MetricName *string `type:"string"` + MetricName *string `min:"1" type:"string"` // The namespace of the metric. - Namespace *string `type:"string"` + Namespace *string `min:"1" type:"string"` metadataMetric `json:"-" xml:"-"` } @@ -1013,15 +1016,15 @@ type MetricAlarm struct { // state. ActionsEnabled *bool `type:"boolean"` - // The Amazon Resource Name (ARN) of the alarm. - AlarmARN *string `locationName:"AlarmArn" type:"string"` - // The list of actions to execute when this alarm transitions into an ALARM // state from any other state. Each action is specified as an Amazon Resource // Number (ARN). Currently the only actions supported are publishing to an Amazon // SNS topic and triggering an Auto Scaling policy. AlarmActions []*string `type:"list"` + // The Amazon Resource Name (ARN) of the alarm. + AlarmArn *string `min:"1" type:"string"` + // The time stamp of the last update to the alarm configuration. Amazon CloudWatch // uses Coordinated Universal Time (UTC) when returning time stamps, which do // not accommodate seasonal adjustments such as daylight savings time. For more @@ -1033,7 +1036,7 @@ type MetricAlarm struct { AlarmDescription *string `type:"string"` // The name of the alarm. - AlarmName *string `type:"string"` + AlarmName *string `min:"1" type:"string"` // The arithmetic operation to use when comparing the specified Statistic and // Threshold. The specified Statistic value is used as the first operand. @@ -1043,7 +1046,7 @@ type MetricAlarm struct { Dimensions []*Dimension `type:"list"` // The number of periods over which data is compared to the specified threshold. - EvaluationPeriods *int64 `type:"integer"` + EvaluationPeriods *int64 `min:"1" type:"integer"` // The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA // state from any other state. Each action is specified as an Amazon Resource @@ -1054,10 +1057,10 @@ type MetricAlarm struct { InsufficientDataActions []*string `type:"list"` // The name of the alarm's metric. - MetricName *string `type:"string"` + MetricName *string `min:"1" type:"string"` // The namespace of alarm's associated metric. - Namespace *string `type:"string"` + Namespace *string `min:"1" type:"string"` // The list of actions to execute when this alarm transitions into an OK state // from any other state. Each action is specified as an Amazon Resource Number @@ -1066,7 +1069,7 @@ type MetricAlarm struct { OKActions []*string `type:"list"` // The period in seconds over which the statistic is applied. - Period *int64 `type:"integer"` + Period *int64 `min:"60" type:"integer"` // A human-readable explanation for the alarm's state. StateReason *string `type:"string"` @@ -1119,7 +1122,7 @@ type MetricDatum struct { Dimensions []*Dimension `type:"list"` // The name of the metric. - MetricName *string `type:"string" required:"true"` + MetricName *string `min:"1" type:"string" required:"true"` // A set of statistical values describing the metric. StatisticValues *StatisticSet `type:"structure"` @@ -1176,7 +1179,7 @@ type PutMetricAlarmInput struct { // The descriptive name for the alarm. This name must be unique within the user's // AWS account - AlarmName *string `type:"string" required:"true"` + AlarmName *string `min:"1" type:"string" required:"true"` // The arithmetic operation to use when comparing the specified Statistic and // Threshold. The specified Statistic value is used as the first operand. @@ -1186,7 +1189,7 @@ type PutMetricAlarmInput struct { Dimensions []*Dimension `type:"list"` // The number of periods over which data is compared to the specified threshold. - EvaluationPeriods *int64 `type:"integer" required:"true"` + EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` // The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA // state from any other state. Each action is specified as an Amazon Resource @@ -1195,10 +1198,10 @@ type PutMetricAlarmInput struct { InsufficientDataActions []*string `type:"list"` // The name for the alarm's associated metric. - MetricName *string `type:"string" required:"true"` + MetricName *string `min:"1" type:"string" required:"true"` // The namespace for the alarm's associated metric. - Namespace *string `type:"string" required:"true"` + Namespace *string `min:"1" type:"string" required:"true"` // The list of actions to execute when this alarm transitions into an OK state // from any other state. Each action is specified as an Amazon Resource Number @@ -1207,7 +1210,7 @@ type PutMetricAlarmInput struct { OKActions []*string `type:"list"` // The period in seconds over which the specified statistic is applied. - Period *int64 `type:"integer" required:"true"` + Period *int64 `min:"60" type:"integer" required:"true"` // The statistic to apply to the alarm's associated metric. Statistic *string `type:"string" required:"true" enum:"Statistic"` @@ -1258,7 +1261,7 @@ type PutMetricDataInput struct { MetricData []*MetricDatum `type:"list" required:"true"` // The namespace for the metric data. - Namespace *string `type:"string" required:"true"` + Namespace *string `min:"1" type:"string" required:"true"` metadataPutMetricDataInput `json:"-" xml:"-"` } @@ -1298,7 +1301,7 @@ func (s PutMetricDataOutput) GoString() string { type SetAlarmStateInput struct { // The descriptive name for the alarm. This name must be unique within the user's // AWS account. The maximum length is 255 characters. - AlarmName *string `type:"string" required:"true"` + AlarmName *string `min:"1" type:"string" required:"true"` // The reason that this alarm is set to this specific state (in human-readable // text format) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go index 77947d73980..140dc9e9832 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go @@ -4,59 +4,61 @@ package cloudwatchiface import ( - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/cloudwatch" ) // CloudWatchAPI is the interface type for cloudwatch.CloudWatch. type CloudWatchAPI interface { - DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*aws.Request, *cloudwatch.DeleteAlarmsOutput) + DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput) DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error) - DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*aws.Request, *cloudwatch.DescribeAlarmHistoryOutput) + DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput) DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error) DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error - DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*aws.Request, *cloudwatch.DescribeAlarmsOutput) + DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput) DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error) DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error - DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*aws.Request, *cloudwatch.DescribeAlarmsForMetricOutput) + DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput) DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error) - DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*aws.Request, *cloudwatch.DisableAlarmActionsOutput) + DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput) DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error) - EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*aws.Request, *cloudwatch.EnableAlarmActionsOutput) + EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput) EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error) - GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*aws.Request, *cloudwatch.GetMetricStatisticsOutput) + GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput) GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error) - ListMetricsRequest(*cloudwatch.ListMetricsInput) (*aws.Request, *cloudwatch.ListMetricsOutput) + ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput) ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error) ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error - PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*aws.Request, *cloudwatch.PutMetricAlarmOutput) + PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput) PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error) - PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*aws.Request, *cloudwatch.PutMetricDataOutput) + PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput) PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error) - SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*aws.Request, *cloudwatch.SetAlarmStateOutput) + SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput) SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error) } + +var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil) diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go deleted file mode 100644 index cdc377249db..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface_test.go +++ /dev/null @@ -1,15 +0,0 @@ -// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. - -package cloudwatchiface_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/service/cloudwatch" - "github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface" - "github.com/stretchr/testify/assert" -) - -func TestInterface(t *testing.T) { - assert.Implements(t, (*cloudwatchiface.CloudWatchAPI)(nil), cloudwatch.New(nil)) -} diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go index cd1eeb2350a..07b010852b9 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/examples_test.go @@ -8,8 +8,7 @@ import ( "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/aws/session" "github.com/aws/aws-sdk-go/service/cloudwatch" ) @@ -17,7 +16,7 @@ var _ time.Duration var _ bytes.Buffer func ExampleCloudWatch_DeleteAlarms() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.DeleteAlarmsInput{ AlarmNames: []*string{ // Required @@ -28,26 +27,18 @@ func ExampleCloudWatch_DeleteAlarms() { resp, err := svc.DeleteAlarms(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_DescribeAlarmHistory() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.DescribeAlarmHistoryInput{ AlarmName: aws.String("AlarmName"), @@ -60,26 +51,18 @@ func ExampleCloudWatch_DescribeAlarmHistory() { resp, err := svc.DescribeAlarmHistory(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_DescribeAlarms() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.DescribeAlarmsInput{ ActionPrefix: aws.String("ActionPrefix"), @@ -95,26 +78,18 @@ func ExampleCloudWatch_DescribeAlarms() { resp, err := svc.DescribeAlarms(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_DescribeAlarmsForMetric() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.DescribeAlarmsForMetricInput{ MetricName: aws.String("MetricName"), // Required @@ -133,26 +108,18 @@ func ExampleCloudWatch_DescribeAlarmsForMetric() { resp, err := svc.DescribeAlarmsForMetric(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_DisableAlarmActions() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.DisableAlarmActionsInput{ AlarmNames: []*string{ // Required @@ -163,26 +130,18 @@ func ExampleCloudWatch_DisableAlarmActions() { resp, err := svc.DisableAlarmActions(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_EnableAlarmActions() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.EnableAlarmActionsInput{ AlarmNames: []*string{ // Required @@ -193,26 +152,18 @@ func ExampleCloudWatch_EnableAlarmActions() { resp, err := svc.EnableAlarmActions(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_GetMetricStatistics() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.GetMetricStatisticsInput{ EndTime: aws.Time(time.Now()), // Required @@ -236,26 +187,18 @@ func ExampleCloudWatch_GetMetricStatistics() { resp, err := svc.GetMetricStatistics(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_ListMetrics() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.ListMetricsInput{ Dimensions: []*cloudwatch.DimensionFilter{ @@ -272,26 +215,18 @@ func ExampleCloudWatch_ListMetrics() { resp, err := svc.ListMetrics(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_PutMetricAlarm() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.PutMetricAlarmInput{ AlarmName: aws.String("AlarmName"), // Required @@ -328,26 +263,18 @@ func ExampleCloudWatch_PutMetricAlarm() { resp, err := svc.PutMetricAlarm(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_PutMetricData() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.PutMetricDataInput{ MetricData: []*cloudwatch.MetricDatum{ // Required @@ -377,26 +304,18 @@ func ExampleCloudWatch_PutMetricData() { resp, err := svc.PutMetricData(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleCloudWatch_SetAlarmState() { - svc := cloudwatch.New(nil) + svc := cloudwatch.New(session.New()) params := &cloudwatch.SetAlarmStateInput{ AlarmName: aws.String("AlarmName"), // Required @@ -407,20 +326,12 @@ func ExampleCloudWatch_SetAlarmState() { resp, err := svc.SetAlarmState(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go index eadc454e2a3..e6f85068460 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/cloudwatch/service.go @@ -4,8 +4,11 @@ package cloudwatch import ( "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" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/query" + "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the Amazon CloudWatch API Reference. This guide provides detailed @@ -48,44 +51,70 @@ import ( // Center (http://aws.amazon.com/php/) AWS Python Developer Center (http://aws.amazon.com/python/) // AWS Ruby Developer Center (http://aws.amazon.com/ruby/) AWS Windows and .NET // Developer Center (http://aws.amazon.com/net/) +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. type CloudWatch struct { - *aws.Service + *client.Client } -// Used for custom service initialization logic -var initService func(*aws.Service) +// Used for custom client initialization logic +var initClient func(*client.Client) // Used for custom request initialization logic -var initRequest func(*aws.Request) +var initRequest func(*request.Request) -// New returns a new CloudWatch client. -func New(config *aws.Config) *CloudWatch { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "monitoring", - APIVersion: "2010-08-01", +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "monitoring" + +// New creates a new instance of the CloudWatch client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a CloudWatch client from just a session. +// svc := cloudwatch.New(mySession) +// +// // Create a CloudWatch client with additional configuration +// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch { + c := p.ClientConfig(ServiceName, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *CloudWatch { + svc := &CloudWatch{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2010-08-01", + }, + handlers, + ), } - service.Initialize() // Handlers - service.Handlers.Sign.PushBack(v4.Sign) - service.Handlers.Build.PushBack(query.Build) - service.Handlers.Unmarshal.PushBack(query.Unmarshal) - service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) - service.Handlers.UnmarshalError.PushBack(query.UnmarshalError) + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(query.Build) + svc.Handlers.Unmarshal.PushBack(query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError) - // Run custom service initialization if present - if initService != nil { - initService(service) + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) } - return &CloudWatch{service} + return svc } // newRequest creates a new request for a CloudWatch operation and runs any // custom request initialization. -func (c *CloudWatch) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *CloudWatch) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) // Run custom request initialization if present if initRequest != nil { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go index b6e84b4b43d..337392a86f2 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -6,26 +6,26 @@ package ec2 import ( "time" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" ) -const opAcceptVPCPeeringConnection = "AcceptVpcPeeringConnection" +const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" -// AcceptVPCPeeringConnectionRequest generates a request for the AcceptVPCPeeringConnection operation. -func (c *EC2) AcceptVPCPeeringConnectionRequest(input *AcceptVPCPeeringConnectionInput) (req *aws.Request, output *AcceptVPCPeeringConnectionOutput) { - op := &aws.Operation{ - Name: opAcceptVPCPeeringConnection, +// AcceptVpcPeeringConnectionRequest generates a request for the AcceptVpcPeeringConnection operation. +func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectionInput) (req *request.Request, output *AcceptVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opAcceptVpcPeeringConnection, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &AcceptVPCPeeringConnectionInput{} + input = &AcceptVpcPeeringConnectionInput{} } req = c.newRequest(op, input, output) - output = &AcceptVPCPeeringConnectionOutput{} + output = &AcceptVpcPeeringConnectionOutput{} req.Data = output return } @@ -34,8 +34,8 @@ 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) (*AcceptVPCPeeringConnectionOutput, error) { - req, out := c.AcceptVPCPeeringConnectionRequest(input) +func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error) { + req, out := c.AcceptVpcPeeringConnectionRequest(input) err := req.Send() return out, err } @@ -43,8 +43,8 @@ func (c *EC2) AcceptVPCPeeringConnection(input *AcceptVPCPeeringConnectionInput) const opAllocateAddress = "AllocateAddress" // AllocateAddressRequest generates a request for the AllocateAddress operation. -func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *aws.Request, output *AllocateAddressOutput) { - op := &aws.Operation{ +func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.Request, output *AllocateAddressOutput) { + op := &request.Operation{ Name: opAllocateAddress, HTTPMethod: "POST", HTTPPath: "/", @@ -71,22 +71,22 @@ func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutp return out, err } -const opAssignPrivateIPAddresses = "AssignPrivateIpAddresses" +const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" -// AssignPrivateIPAddressesRequest generates a request for the AssignPrivateIPAddresses operation. -func (c *EC2) AssignPrivateIPAddressesRequest(input *AssignPrivateIPAddressesInput) (req *aws.Request, output *AssignPrivateIPAddressesOutput) { - op := &aws.Operation{ - Name: opAssignPrivateIPAddresses, +// AssignPrivateIpAddressesRequest generates a request for the AssignPrivateIpAddresses operation. +func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInput) (req *request.Request, output *AssignPrivateIpAddressesOutput) { + op := &request.Operation{ + Name: opAssignPrivateIpAddresses, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &AssignPrivateIPAddressesInput{} + input = &AssignPrivateIpAddressesInput{} } req = c.newRequest(op, input, output) - output = &AssignPrivateIPAddressesOutput{} + output = &AssignPrivateIpAddressesOutput{} req.Data = output return } @@ -102,8 +102,8 @@ 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) (*AssignPrivateIPAddressesOutput, error) { - req, out := c.AssignPrivateIPAddressesRequest(input) +func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error) { + req, out := c.AssignPrivateIpAddressesRequest(input) err := req.Send() return out, err } @@ -111,8 +111,8 @@ func (c *EC2) AssignPrivateIPAddresses(input *AssignPrivateIPAddressesInput) (*A const opAssociateAddress = "AssociateAddress" // AssociateAddressRequest generates a request for the AssociateAddress operation. -func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *aws.Request, output *AssociateAddressOutput) { - op := &aws.Operation{ +func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *request.Request, output *AssociateAddressOutput) { + op := &request.Operation{ Name: opAssociateAddress, HTTPMethod: "POST", HTTPPath: "/", @@ -151,22 +151,22 @@ func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressO return out, err } -const opAssociateDHCPOptions = "AssociateDhcpOptions" +const opAssociateDhcpOptions = "AssociateDhcpOptions" -// AssociateDHCPOptionsRequest generates a request for the AssociateDHCPOptions operation. -func (c *EC2) AssociateDHCPOptionsRequest(input *AssociateDHCPOptionsInput) (req *aws.Request, output *AssociateDHCPOptionsOutput) { - op := &aws.Operation{ - Name: opAssociateDHCPOptions, +// AssociateDhcpOptionsRequest generates a request for the AssociateDhcpOptions operation. +func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req *request.Request, output *AssociateDhcpOptionsOutput) { + op := &request.Operation{ + Name: opAssociateDhcpOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &AssociateDHCPOptionsInput{} + input = &AssociateDhcpOptionsInput{} } req = c.newRequest(op, input, output) - output = &AssociateDHCPOptionsOutput{} + output = &AssociateDhcpOptionsOutput{} req.Data = output return } @@ -183,8 +183,8 @@ 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) (*AssociateDHCPOptionsOutput, error) { - req, out := c.AssociateDHCPOptionsRequest(input) +func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error) { + req, out := c.AssociateDhcpOptionsRequest(input) err := req.Send() return out, err } @@ -192,8 +192,8 @@ func (c *EC2) AssociateDHCPOptions(input *AssociateDHCPOptionsInput) (*Associate const opAssociateRouteTable = "AssociateRouteTable" // AssociateRouteTableRequest generates a request for the AssociateRouteTable operation. -func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *aws.Request, output *AssociateRouteTableOutput) { - op := &aws.Operation{ +func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *request.Request, output *AssociateRouteTableOutput) { + op := &request.Operation{ Name: opAssociateRouteTable, HTTPMethod: "POST", HTTPPath: "/", @@ -223,22 +223,22 @@ func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRo return out, err } -const opAttachClassicLinkVPC = "AttachClassicLinkVpc" +const opAttachClassicLinkVpc = "AttachClassicLinkVpc" -// AttachClassicLinkVPCRequest generates a request for the AttachClassicLinkVPC operation. -func (c *EC2) AttachClassicLinkVPCRequest(input *AttachClassicLinkVPCInput) (req *aws.Request, output *AttachClassicLinkVPCOutput) { - op := &aws.Operation{ - Name: opAttachClassicLinkVPC, +// AttachClassicLinkVpcRequest generates a request for the AttachClassicLinkVpc operation. +func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req *request.Request, output *AttachClassicLinkVpcOutput) { + op := &request.Operation{ + Name: opAttachClassicLinkVpc, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &AttachClassicLinkVPCInput{} + input = &AttachClassicLinkVpcInput{} } req = c.newRequest(op, input, output) - output = &AttachClassicLinkVPCOutput{} + output = &AttachClassicLinkVpcOutput{} req.Data = output return } @@ -255,8 +255,8 @@ 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) (*AttachClassicLinkVPCOutput, error) { - req, out := c.AttachClassicLinkVPCRequest(input) +func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error) { + req, out := c.AttachClassicLinkVpcRequest(input) err := req.Send() return out, err } @@ -264,8 +264,8 @@ func (c *EC2) AttachClassicLinkVPC(input *AttachClassicLinkVPCInput) (*AttachCla const opAttachInternetGateway = "AttachInternetGateway" // AttachInternetGatewayRequest generates a request for the AttachInternetGateway operation. -func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *aws.Request, output *AttachInternetGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *request.Request, output *AttachInternetGatewayOutput) { + op := &request.Operation{ Name: opAttachInternetGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -293,8 +293,8 @@ func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachI const opAttachNetworkInterface = "AttachNetworkInterface" // AttachNetworkInterfaceRequest generates a request for the AttachNetworkInterface operation. -func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *aws.Request, output *AttachNetworkInterfaceOutput) { - op := &aws.Operation{ +func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *request.Request, output *AttachNetworkInterfaceOutput) { + op := &request.Operation{ Name: opAttachNetworkInterface, HTTPMethod: "POST", HTTPPath: "/", @@ -317,40 +317,11 @@ func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*Attac return out, err } -const opAttachVPNGateway = "AttachVpnGateway" - -// AttachVPNGatewayRequest generates a request for the AttachVPNGateway operation. -func (c *EC2) AttachVPNGatewayRequest(input *AttachVPNGatewayInput) (req *aws.Request, output *AttachVPNGatewayOutput) { - op := &aws.Operation{ - Name: opAttachVPNGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachVPNGatewayInput{} - } - - req = c.newRequest(op, input, output) - output = &AttachVPNGatewayOutput{} - req.Data = output - return -} - -// 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) (*AttachVPNGatewayOutput, error) { - req, out := c.AttachVPNGatewayRequest(input) - err := req.Send() - return out, err -} - const opAttachVolume = "AttachVolume" // AttachVolumeRequest generates a request for the AttachVolume operation. -func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *aws.Request, output *VolumeAttachment) { - op := &aws.Operation{ +func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Request, output *VolumeAttachment) { + op := &request.Operation{ Name: opAttachVolume, HTTPMethod: "POST", HTTPPath: "/", @@ -397,11 +368,40 @@ func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) return out, err } +const opAttachVpnGateway = "AttachVpnGateway" + +// AttachVpnGatewayRequest generates a request for the AttachVpnGateway operation. +func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *request.Request, output *AttachVpnGatewayOutput) { + op := &request.Operation{ + Name: opAttachVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AttachVpnGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &AttachVpnGatewayOutput{} + req.Data = output + return +} + +// 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) (*AttachVpnGatewayOutput, error) { + req, out := c.AttachVpnGatewayRequest(input) + err := req.Send() + return out, err +} + const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" // AuthorizeSecurityGroupEgressRequest generates a request for the AuthorizeSecurityGroupEgress operation. -func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *aws.Request, output *AuthorizeSecurityGroupEgressOutput) { - op := &aws.Operation{ +func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *request.Request, output *AuthorizeSecurityGroupEgressOutput) { + op := &request.Operation{ Name: opAuthorizeSecurityGroupEgress, HTTPMethod: "POST", HTTPPath: "/", @@ -447,8 +447,8 @@ func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressIn const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" // AuthorizeSecurityGroupIngressRequest generates a request for the AuthorizeSecurityGroupIngress operation. -func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *aws.Request, output *AuthorizeSecurityGroupIngressOutput) { - op := &aws.Operation{ +func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *request.Request, output *AuthorizeSecurityGroupIngressOutput) { + op := &request.Operation{ Name: opAuthorizeSecurityGroupIngress, HTTPMethod: "POST", HTTPPath: "/", @@ -492,8 +492,8 @@ func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngress const opBundleInstance = "BundleInstance" // BundleInstanceRequest generates a request for the BundleInstance operation. -func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *aws.Request, output *BundleInstanceOutput) { - op := &aws.Operation{ +func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Request, output *BundleInstanceOutput) { + op := &request.Operation{ Name: opBundleInstance, HTTPMethod: "POST", HTTPPath: "/", @@ -528,8 +528,8 @@ func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, const opCancelBundleTask = "CancelBundleTask" // CancelBundleTaskRequest generates a request for the CancelBundleTask operation. -func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *aws.Request, output *CancelBundleTaskOutput) { - op := &aws.Operation{ +func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *request.Request, output *CancelBundleTaskOutput) { + op := &request.Operation{ Name: opCancelBundleTask, HTTPMethod: "POST", HTTPPath: "/", @@ -555,8 +555,8 @@ func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskO const opCancelConversionTask = "CancelConversionTask" // CancelConversionTaskRequest generates a request for the CancelConversionTask operation. -func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *aws.Request, output *CancelConversionTaskOutput) { - op := &aws.Operation{ +func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *request.Request, output *CancelConversionTaskOutput) { + op := &request.Operation{ Name: opCancelConversionTask, HTTPMethod: "POST", HTTPPath: "/", @@ -590,8 +590,8 @@ func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelCon const opCancelExportTask = "CancelExportTask" // CancelExportTaskRequest generates a request for the CancelExportTask operation. -func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *aws.Request, output *CancelExportTaskOutput) { - op := &aws.Operation{ +func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) { + op := &request.Operation{ Name: opCancelExportTask, HTTPMethod: "POST", HTTPPath: "/", @@ -620,8 +620,8 @@ func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskO const opCancelImportTask = "CancelImportTask" // CancelImportTaskRequest generates a request for the CancelImportTask operation. -func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *aws.Request, output *CancelImportTaskOutput) { - op := &aws.Operation{ +func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *request.Request, output *CancelImportTaskOutput) { + op := &request.Operation{ Name: opCancelImportTask, HTTPMethod: "POST", HTTPPath: "/", @@ -647,8 +647,8 @@ func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskO const opCancelReservedInstancesListing = "CancelReservedInstancesListing" // CancelReservedInstancesListingRequest generates a request for the CancelReservedInstancesListing operation. -func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *aws.Request, output *CancelReservedInstancesListingOutput) { - op := &aws.Operation{ +func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *request.Request, output *CancelReservedInstancesListingOutput) { + op := &request.Operation{ Name: opCancelReservedInstancesListing, HTTPMethod: "POST", HTTPPath: "/", @@ -678,8 +678,8 @@ func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListi const opCancelSpotFleetRequests = "CancelSpotFleetRequests" // CancelSpotFleetRequestsRequest generates a request for the CancelSpotFleetRequests operation. -func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *aws.Request, output *CancelSpotFleetRequestsOutput) { - op := &aws.Operation{ +func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *request.Request, output *CancelSpotFleetRequestsOutput) { + op := &request.Operation{ Name: opCancelSpotFleetRequests, HTTPMethod: "POST", HTTPPath: "/", @@ -696,6 +696,13 @@ func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput } // Cancels the specified Spot fleet requests. +// +// After you cancel a Spot fleet request, the Spot fleet launches no new Spot +// instances. You must specify whether the Spot fleet should also terminate +// its Spot instances. If you terminate the instances, the Spot fleet request +// enters the cancelled_terminating state. Otherwise, the Spot fleet request +// enters the cancelled_running state and the instances continue to run until +// they are interrupted or you terminate them manually. func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error) { req, out := c.CancelSpotFleetRequestsRequest(input) err := req.Send() @@ -705,8 +712,8 @@ func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*Can const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" // CancelSpotInstanceRequestsRequest generates a request for the CancelSpotInstanceRequests operation. -func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *aws.Request, output *CancelSpotInstanceRequestsOutput) { - op := &aws.Operation{ +func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *request.Request, output *CancelSpotInstanceRequestsOutput) { + op := &request.Operation{ Name: opCancelSpotInstanceRequests, HTTPMethod: "POST", HTTPPath: "/", @@ -722,14 +729,14 @@ func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequest return } -// Cancels one or more Spot Instance requests. Spot Instances are instances +// Cancels one or more Spot instance requests. Spot instances are instances // that Amazon EC2 starts on your behalf when the bid price that you specify -// exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price -// based on available Spot Instance capacity and current Spot Instance requests. +// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price +// based on available Spot 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. // -// Canceling a Spot Instance request does not terminate running Spot Instances +// Canceling a Spot instance request does not terminate running Spot instances // associated with the request. func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { req, out := c.CancelSpotInstanceRequestsRequest(input) @@ -740,8 +747,8 @@ func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) const opConfirmProductInstance = "ConfirmProductInstance" // ConfirmProductInstanceRequest generates a request for the ConfirmProductInstance operation. -func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *aws.Request, output *ConfirmProductInstanceOutput) { - op := &aws.Operation{ +func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *request.Request, output *ConfirmProductInstanceOutput) { + op := &request.Operation{ Name: opConfirmProductInstance, HTTPMethod: "POST", HTTPPath: "/", @@ -770,8 +777,8 @@ func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*Confi const opCopyImage = "CopyImage" // CopyImageRequest generates a request for the CopyImage operation. -func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *aws.Request, output *CopyImageOutput) { - op := &aws.Operation{ +func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, output *CopyImageOutput) { + op := &request.Operation{ Name: opCopyImage, HTTPMethod: "POST", HTTPPath: "/", @@ -803,8 +810,8 @@ func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { const opCopySnapshot = "CopySnapshot" // CopySnapshotRequest generates a request for the CopySnapshot operation. -func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *aws.Request, output *CopySnapshotOutput) { - op := &aws.Operation{ +func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput) { + op := &request.Operation{ Name: opCopySnapshot, HTTPMethod: "POST", HTTPPath: "/", @@ -843,8 +850,8 @@ func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error const opCreateCustomerGateway = "CreateCustomerGateway" // CreateCustomerGatewayRequest generates a request for the CreateCustomerGateway operation. -func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *aws.Request, output *CreateCustomerGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *request.Request, output *CreateCustomerGatewayOutput) { + op := &request.Operation{ Name: opCreateCustomerGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -864,7 +871,7 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // gateway is the appliance at your end of the VPN connection. (The device on // the AWS side of the VPN connection is the virtual private gateway.) You must // provide the Internet-routable IP address of the customer gateway's external -// interface. The IP address must be static and can't be behind a device performing +// interface. The IP address must be static and may be behind a device performing // network address translation (NAT). // // For devices that use Border Gateway Protocol (BGP), you can also provide @@ -891,22 +898,22 @@ func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateC return out, err } -const opCreateDHCPOptions = "CreateDhcpOptions" +const opCreateDhcpOptions = "CreateDhcpOptions" -// CreateDHCPOptionsRequest generates a request for the CreateDHCPOptions operation. -func (c *EC2) CreateDHCPOptionsRequest(input *CreateDHCPOptionsInput) (req *aws.Request, output *CreateDHCPOptionsOutput) { - op := &aws.Operation{ - Name: opCreateDHCPOptions, +// CreateDhcpOptionsRequest generates a request for the CreateDhcpOptions operation. +func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *request.Request, output *CreateDhcpOptionsOutput) { + op := &request.Operation{ + Name: opCreateDhcpOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &CreateDHCPOptionsInput{} + input = &CreateDhcpOptionsInput{} } req = c.newRequest(op, input, output) - output = &CreateDHCPOptionsOutput{} + output = &CreateDhcpOptionsOutput{} req.Data = output return } @@ -940,8 +947,8 @@ 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) (*CreateDHCPOptionsOutput, error) { - req, out := c.CreateDHCPOptionsRequest(input) +func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error) { + req, out := c.CreateDhcpOptionsRequest(input) err := req.Send() return out, err } @@ -949,8 +956,8 @@ func (c *EC2) CreateDHCPOptions(input *CreateDHCPOptionsInput) (*CreateDHCPOptio const opCreateFlowLogs = "CreateFlowLogs" // CreateFlowLogsRequest generates a request for the CreateFlowLogs operation. -func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *aws.Request, output *CreateFlowLogsOutput) { - op := &aws.Operation{ +func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Request, output *CreateFlowLogsOutput) { + op := &request.Operation{ Name: opCreateFlowLogs, HTTPMethod: "POST", HTTPPath: "/", @@ -985,8 +992,8 @@ func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, const opCreateImage = "CreateImage" // CreateImageRequest generates a request for the CreateImage operation. -func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *aws.Request, output *CreateImageOutput) { - op := &aws.Operation{ +func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { + op := &request.Operation{ Name: opCreateImage, HTTPMethod: "POST", HTTPPath: "/", @@ -1021,8 +1028,8 @@ func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { const opCreateInstanceExportTask = "CreateInstanceExportTask" // CreateInstanceExportTaskRequest generates a request for the CreateInstanceExportTask operation. -func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *aws.Request, output *CreateInstanceExportTaskOutput) { - op := &aws.Operation{ +func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *request.Request, output *CreateInstanceExportTaskOutput) { + op := &request.Operation{ Name: opCreateInstanceExportTask, HTTPMethod: "POST", HTTPPath: "/", @@ -1053,8 +1060,8 @@ func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*C const opCreateInternetGateway = "CreateInternetGateway" // CreateInternetGatewayRequest generates a request for the CreateInternetGateway operation. -func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *aws.Request, output *CreateInternetGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *request.Request, output *CreateInternetGatewayOutput) { + op := &request.Operation{ Name: opCreateInternetGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -1084,8 +1091,8 @@ func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateI const opCreateKeyPair = "CreateKeyPair" // CreateKeyPairRequest generates a request for the CreateKeyPair operation. -func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *aws.Request, output *CreateKeyPairOutput) { - op := &aws.Operation{ +func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput) { + op := &request.Operation{ Name: opCreateKeyPair, HTTPMethod: "POST", HTTPPath: "/", @@ -1119,22 +1126,22 @@ func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, er return out, err } -const opCreateNetworkACL = "CreateNetworkAcl" +const opCreateNetworkAcl = "CreateNetworkAcl" -// CreateNetworkACLRequest generates a request for the CreateNetworkACL operation. -func (c *EC2) CreateNetworkACLRequest(input *CreateNetworkACLInput) (req *aws.Request, output *CreateNetworkACLOutput) { - op := &aws.Operation{ - Name: opCreateNetworkACL, +// CreateNetworkAclRequest generates a request for the CreateNetworkAcl operation. +func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *request.Request, output *CreateNetworkAclOutput) { + op := &request.Operation{ + Name: opCreateNetworkAcl, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &CreateNetworkACLInput{} + input = &CreateNetworkAclInput{} } req = c.newRequest(op, input, output) - output = &CreateNetworkACLOutput{} + output = &CreateNetworkAclOutput{} req.Data = output return } @@ -1144,28 +1151,28 @@ 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) (*CreateNetworkACLOutput, error) { - req, out := c.CreateNetworkACLRequest(input) +func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error) { + req, out := c.CreateNetworkAclRequest(input) err := req.Send() return out, err } -const opCreateNetworkACLEntry = "CreateNetworkAclEntry" +const opCreateNetworkAclEntry = "CreateNetworkAclEntry" -// CreateNetworkACLEntryRequest generates a request for the CreateNetworkACLEntry operation. -func (c *EC2) CreateNetworkACLEntryRequest(input *CreateNetworkACLEntryInput) (req *aws.Request, output *CreateNetworkACLEntryOutput) { - op := &aws.Operation{ - Name: opCreateNetworkACLEntry, +// CreateNetworkAclEntryRequest generates a request for the CreateNetworkAclEntry operation. +func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (req *request.Request, output *CreateNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opCreateNetworkAclEntry, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &CreateNetworkACLEntryInput{} + input = &CreateNetworkAclEntryInput{} } req = c.newRequest(op, input, output) - output = &CreateNetworkACLEntryOutput{} + output = &CreateNetworkAclEntryOutput{} req.Data = output return } @@ -1187,8 +1194,8 @@ 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) (*CreateNetworkACLEntryOutput, error) { - req, out := c.CreateNetworkACLEntryRequest(input) +func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error) { + req, out := c.CreateNetworkAclEntryRequest(input) err := req.Send() return out, err } @@ -1196,8 +1203,8 @@ func (c *EC2) CreateNetworkACLEntry(input *CreateNetworkACLEntryInput) (*CreateN const opCreateNetworkInterface = "CreateNetworkInterface" // CreateNetworkInterfaceRequest generates a request for the CreateNetworkInterface operation. -func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *aws.Request, output *CreateNetworkInterfaceOutput) { - op := &aws.Operation{ +func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *request.Request, output *CreateNetworkInterfaceOutput) { + op := &request.Operation{ Name: opCreateNetworkInterface, HTTPMethod: "POST", HTTPPath: "/", @@ -1227,8 +1234,8 @@ func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*Creat const opCreatePlacementGroup = "CreatePlacementGroup" // CreatePlacementGroupRequest generates a request for the CreatePlacementGroup operation. -func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *aws.Request, output *CreatePlacementGroupOutput) { - op := &aws.Operation{ +func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *request.Request, output *CreatePlacementGroupOutput) { + op := &request.Operation{ Name: opCreatePlacementGroup, HTTPMethod: "POST", HTTPPath: "/", @@ -1259,8 +1266,8 @@ func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePla const opCreateReservedInstancesListing = "CreateReservedInstancesListing" // CreateReservedInstancesListingRequest generates a request for the CreateReservedInstancesListing operation. -func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *aws.Request, output *CreateReservedInstancesListingOutput) { - op := &aws.Operation{ +func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *request.Request, output *CreateReservedInstancesListingOutput) { + op := &request.Operation{ Name: opCreateReservedInstancesListing, HTTPMethod: "POST", HTTPPath: "/", @@ -1305,8 +1312,8 @@ func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListi const opCreateRoute = "CreateRoute" // CreateRouteRequest generates a request for the CreateRoute operation. -func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *aws.Request, output *CreateRouteOutput) { - op := &aws.Operation{ +func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, output *CreateRouteOutput) { + op := &request.Operation{ Name: opCreateRoute, HTTPMethod: "POST", HTTPPath: "/", @@ -1350,8 +1357,8 @@ func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { const opCreateRouteTable = "CreateRouteTable" // CreateRouteTableRequest generates a request for the CreateRouteTable operation. -func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *aws.Request, output *CreateRouteTableOutput) { - op := &aws.Operation{ +func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *request.Request, output *CreateRouteTableOutput) { + op := &request.Operation{ Name: opCreateRouteTable, HTTPMethod: "POST", HTTPPath: "/", @@ -1381,8 +1388,8 @@ func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableO const opCreateSecurityGroup = "CreateSecurityGroup" // CreateSecurityGroupRequest generates a request for the CreateSecurityGroup operation. -func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *aws.Request, output *CreateSecurityGroupOutput) { - op := &aws.Operation{ +func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *request.Request, output *CreateSecurityGroupOutput) { + op := &request.Operation{ Name: opCreateSecurityGroup, HTTPMethod: "POST", HTTPPath: "/", @@ -1434,8 +1441,8 @@ func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecur const opCreateSnapshot = "CreateSnapshot" // CreateSnapshotRequest generates a request for the CreateSnapshot operation. -func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *aws.Request, output *Snapshot) { - op := &aws.Operation{ +func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *Snapshot) { + op := &request.Operation{ Name: opCreateSnapshot, HTTPMethod: "POST", HTTPPath: "/", @@ -1488,8 +1495,8 @@ func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" // CreateSpotDatafeedSubscriptionRequest generates a request for the CreateSpotDatafeedSubscription operation. -func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *aws.Request, output *CreateSpotDatafeedSubscriptionOutput) { - op := &aws.Operation{ +func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *request.Request, output *CreateSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ Name: opCreateSpotDatafeedSubscription, HTTPMethod: "POST", HTTPPath: "/", @@ -1505,7 +1512,7 @@ func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSub return } -// Creates a data feed for Spot Instances, enabling you to view Spot Instance +// Creates a data feed for Spot instances, enabling you to view Spot instance // 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. @@ -1518,8 +1525,8 @@ func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscripti const opCreateSubnet = "CreateSubnet" // CreateSubnetRequest generates a request for the CreateSubnet operation. -func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *aws.Request, output *CreateSubnetOutput) { - op := &aws.Operation{ +func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Request, output *CreateSubnetOutput) { + op := &request.Operation{ Name: opCreateSubnet, HTTPMethod: "POST", HTTPPath: "/", @@ -1569,8 +1576,8 @@ func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error const opCreateTags = "CreateTags" // CreateTagsRequest generates a request for the CreateTags operation. -func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *aws.Request, output *CreateTagsOutput) { - op := &aws.Operation{ +func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { + op := &request.Operation{ Name: opCreateTags, HTTPMethod: "POST", HTTPPath: "/", @@ -1591,6 +1598,9 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *aws.Request, outpu // of a key and optional value. Tag keys must be unique per resource. // // 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. For more information about +// creating IAM policies that control users' access to resources based on tags, +// see Supported Resource-Level Permissions for Amazon EC2 API Actions (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) @@ -1598,228 +1608,11 @@ func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { return out, err } -const opCreateVPC = "CreateVpc" - -// CreateVPCRequest generates a request for the CreateVPC operation. -func (c *EC2) CreateVPCRequest(input *CreateVPCInput) (req *aws.Request, output *CreateVPCOutput) { - op := &aws.Operation{ - Name: opCreateVPC, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPCInput{} - } - - req = c.newRequest(op, input, output) - output = &CreateVPCOutput{} - req.Data = output - return -} - -// Creates a VPC with the specified CIDR block. -// -// The smallest VPC you can create uses a /28 netmask (16 IP addresses), and -// the largest uses a /16 netmask (65,536 IP addresses). To help you decide -// how big to make your VPC, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// By default, each instance you launch in the VPC has the default DHCP options, -// 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) (*CreateVPCOutput, error) { - req, out := c.CreateVPCRequest(input) - err := req.Send() - return out, err -} - -const opCreateVPCEndpoint = "CreateVpcEndpoint" - -// CreateVPCEndpointRequest generates a request for the CreateVPCEndpoint operation. -func (c *EC2) CreateVPCEndpointRequest(input *CreateVPCEndpointInput) (req *aws.Request, output *CreateVPCEndpointOutput) { - op := &aws.Operation{ - Name: opCreateVPCEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPCEndpointInput{} - } - - req = c.newRequest(op, 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 -} - -const opCreateVPCPeeringConnection = "CreateVpcPeeringConnection" - -// CreateVPCPeeringConnectionRequest generates a request for the CreateVPCPeeringConnection operation. -func (c *EC2) CreateVPCPeeringConnectionRequest(input *CreateVPCPeeringConnectionInput) (req *aws.Request, output *CreateVPCPeeringConnectionOutput) { - op := &aws.Operation{ - Name: opCreateVPCPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPCPeeringConnectionInput{} - } - - req = c.newRequest(op, input, output) - output = &CreateVPCPeeringConnectionOutput{} - req.Data = output - return -} - -// Requests a VPC peering connection between two VPCs: a requester VPC that -// you own and a peer VPC with which to create the connection. The peer VPC -// can belong to another AWS account. The requester VPC and peer VPC cannot -// have overlapping CIDR blocks. -// -// The owner of the peer VPC must accept the peering request to activate the -// peering connection. The VPC peering connection request expires after 7 days, -// after which it cannot be accepted or rejected. -// -// 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) (*CreateVPCPeeringConnectionOutput, error) { - req, out := c.CreateVPCPeeringConnectionRequest(input) - err := req.Send() - return out, err -} - -const opCreateVPNConnection = "CreateVpnConnection" - -// CreateVPNConnectionRequest generates a request for the CreateVPNConnection operation. -func (c *EC2) CreateVPNConnectionRequest(input *CreateVPNConnectionInput) (req *aws.Request, output *CreateVPNConnectionOutput) { - op := &aws.Operation{ - Name: opCreateVPNConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPNConnectionInput{} - } - - req = c.newRequest(op, input, output) - output = &CreateVPNConnectionOutput{} - req.Data = output - return -} - -// Creates a VPN connection between an existing virtual private gateway and -// a VPN customer gateway. The only supported connection type is ipsec.1. -// -// The response includes information that you need to give to your network -// administrator to configure your customer gateway. -// -// We strongly recommend that you use HTTPS when calling this operation because -// the response contains sensitive cryptographic information for configuring -// your customer gateway. -// -// If you decide to shut down your VPN connection for any reason and later -// create a new VPN connection, you must reconfigure your customer gateway with -// the new information returned from this call. -// -// 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) (*CreateVPNConnectionOutput, error) { - req, out := c.CreateVPNConnectionRequest(input) - err := req.Send() - return out, err -} - -const opCreateVPNConnectionRoute = "CreateVpnConnectionRoute" - -// CreateVPNConnectionRouteRequest generates a request for the CreateVPNConnectionRoute operation. -func (c *EC2) CreateVPNConnectionRouteRequest(input *CreateVPNConnectionRouteInput) (req *aws.Request, output *CreateVPNConnectionRouteOutput) { - op := &aws.Operation{ - Name: opCreateVPNConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPNConnectionRouteInput{} - } - - req = c.newRequest(op, input, output) - output = &CreateVPNConnectionRouteOutput{} - req.Data = output - return -} - -// Creates a static route associated with a VPN connection between 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. -// -// 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) (*CreateVPNConnectionRouteOutput, error) { - req, out := c.CreateVPNConnectionRouteRequest(input) - err := req.Send() - return out, err -} - -const opCreateVPNGateway = "CreateVpnGateway" - -// CreateVPNGatewayRequest generates a request for the CreateVPNGateway operation. -func (c *EC2) CreateVPNGatewayRequest(input *CreateVPNGatewayInput) (req *aws.Request, output *CreateVPNGatewayOutput) { - op := &aws.Operation{ - Name: opCreateVPNGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVPNGatewayInput{} - } - - req = c.newRequest(op, input, output) - output = &CreateVPNGatewayOutput{} - req.Data = output - return -} - -// Creates a virtual private gateway. A virtual private gateway is the endpoint -// on the VPC side of your VPN connection. You can create a virtual private -// gateway before creating the VPC itself. -// -// 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) (*CreateVPNGatewayOutput, error) { - req, out := c.CreateVPNGatewayRequest(input) - err := req.Send() - return out, err -} - const opCreateVolume = "CreateVolume" // CreateVolumeRequest generates a request for the CreateVolume operation. -func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *aws.Request, output *Volume) { - op := &aws.Operation{ +func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Request, output *Volume) { + op := &request.Operation{ Name: opCreateVolume, HTTPMethod: "POST", HTTPPath: "/", @@ -1857,11 +1650,228 @@ func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { return out, err } +const opCreateVpc = "CreateVpc" + +// CreateVpcRequest generates a request for the CreateVpc operation. +func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, output *CreateVpcOutput) { + op := &request.Operation{ + Name: opCreateVpc, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpcInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateVpcOutput{} + req.Data = output + return +} + +// Creates a VPC with the specified CIDR block. +// +// The smallest VPC you can create uses a /28 netmask (16 IP addresses), and +// the largest uses a /16 netmask (65,536 IP addresses). To help you decide +// how big to make your VPC, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) +// in the Amazon Virtual Private Cloud User Guide. +// +// By default, each instance you launch in the VPC has the default DHCP options, +// 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) (*CreateVpcOutput, error) { + req, out := c.CreateVpcRequest(input) + err := req.Send() + return out, err +} + +const opCreateVpcEndpoint = "CreateVpcEndpoint" + +// CreateVpcEndpointRequest generates a request for the CreateVpcEndpoint operation. +func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput) { + op := &request.Operation{ + Name: opCreateVpcEndpoint, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpcEndpointInput{} + } + + req = c.newRequest(op, 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 +} + +const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" + +// CreateVpcPeeringConnectionRequest generates a request for the CreateVpcPeeringConnection operation. +func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectionInput) (req *request.Request, output *CreateVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opCreateVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpcPeeringConnectionInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateVpcPeeringConnectionOutput{} + req.Data = output + return +} + +// Requests a VPC peering connection between two VPCs: a requester VPC that +// you own and a peer VPC with which to create the connection. The peer VPC +// can belong to another AWS account. The requester VPC and peer VPC cannot +// have overlapping CIDR blocks. +// +// The owner of the peer VPC must accept the peering request to activate the +// peering connection. The VPC peering connection request expires after 7 days, +// after which it cannot be accepted or rejected. +// +// 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) (*CreateVpcPeeringConnectionOutput, error) { + req, out := c.CreateVpcPeeringConnectionRequest(input) + err := req.Send() + return out, err +} + +const opCreateVpnConnection = "CreateVpnConnection" + +// CreateVpnConnectionRequest generates a request for the CreateVpnConnection operation. +func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *request.Request, output *CreateVpnConnectionOutput) { + op := &request.Operation{ + Name: opCreateVpnConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpnConnectionInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateVpnConnectionOutput{} + req.Data = output + return +} + +// Creates a VPN connection between an existing virtual private gateway and +// a VPN customer gateway. The only supported connection type is ipsec.1. +// +// The response includes information that you need to give to your network +// administrator to configure your customer gateway. +// +// We strongly recommend that you use HTTPS when calling this operation because +// the response contains sensitive cryptographic information for configuring +// your customer gateway. +// +// If you decide to shut down your VPN connection for any reason and later +// create a new VPN connection, you must reconfigure your customer gateway with +// the new information returned from this call. +// +// 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) (*CreateVpnConnectionOutput, error) { + req, out := c.CreateVpnConnectionRequest(input) + err := req.Send() + return out, err +} + +const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" + +// CreateVpnConnectionRouteRequest generates a request for the CreateVpnConnectionRoute operation. +func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInput) (req *request.Request, output *CreateVpnConnectionRouteOutput) { + op := &request.Operation{ + Name: opCreateVpnConnectionRoute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpnConnectionRouteInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateVpnConnectionRouteOutput{} + req.Data = output + return +} + +// Creates a static route associated with a VPN connection between 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. +// +// 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) (*CreateVpnConnectionRouteOutput, error) { + req, out := c.CreateVpnConnectionRouteRequest(input) + err := req.Send() + return out, err +} + +const opCreateVpnGateway = "CreateVpnGateway" + +// CreateVpnGatewayRequest generates a request for the CreateVpnGateway operation. +func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *request.Request, output *CreateVpnGatewayOutput) { + op := &request.Operation{ + Name: opCreateVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateVpnGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &CreateVpnGatewayOutput{} + req.Data = output + return +} + +// Creates a virtual private gateway. A virtual private gateway is the endpoint +// on the VPC side of your VPN connection. You can create a virtual private +// gateway before creating the VPC itself. +// +// 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) (*CreateVpnGatewayOutput, error) { + req, out := c.CreateVpnGatewayRequest(input) + err := req.Send() + return out, err +} + const opDeleteCustomerGateway = "DeleteCustomerGateway" // DeleteCustomerGatewayRequest generates a request for the DeleteCustomerGateway operation. -func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *aws.Request, output *DeleteCustomerGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *request.Request, output *DeleteCustomerGatewayOutput) { + op := &request.Operation{ Name: opDeleteCustomerGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -1885,22 +1895,22 @@ func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteC return out, err } -const opDeleteDHCPOptions = "DeleteDhcpOptions" +const opDeleteDhcpOptions = "DeleteDhcpOptions" -// DeleteDHCPOptionsRequest generates a request for the DeleteDHCPOptions operation. -func (c *EC2) DeleteDHCPOptionsRequest(input *DeleteDHCPOptionsInput) (req *aws.Request, output *DeleteDHCPOptionsOutput) { - op := &aws.Operation{ - Name: opDeleteDHCPOptions, +// DeleteDhcpOptionsRequest generates a request for the DeleteDhcpOptions operation. +func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *request.Request, output *DeleteDhcpOptionsOutput) { + op := &request.Operation{ + Name: opDeleteDhcpOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteDHCPOptionsInput{} + input = &DeleteDhcpOptionsInput{} } req = c.newRequest(op, input, output) - output = &DeleteDHCPOptionsOutput{} + output = &DeleteDhcpOptionsOutput{} req.Data = output return } @@ -1909,8 +1919,8 @@ 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) (*DeleteDHCPOptionsOutput, error) { - req, out := c.DeleteDHCPOptionsRequest(input) +func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error) { + req, out := c.DeleteDhcpOptionsRequest(input) err := req.Send() return out, err } @@ -1918,8 +1928,8 @@ func (c *EC2) DeleteDHCPOptions(input *DeleteDHCPOptionsInput) (*DeleteDHCPOptio const opDeleteFlowLogs = "DeleteFlowLogs" // DeleteFlowLogsRequest generates a request for the DeleteFlowLogs operation. -func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *aws.Request, output *DeleteFlowLogsOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Request, output *DeleteFlowLogsOutput) { + op := &request.Operation{ Name: opDeleteFlowLogs, HTTPMethod: "POST", HTTPPath: "/", @@ -1945,8 +1955,8 @@ func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, const opDeleteInternetGateway = "DeleteInternetGateway" // DeleteInternetGatewayRequest generates a request for the DeleteInternetGateway operation. -func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *aws.Request, output *DeleteInternetGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *request.Request, output *DeleteInternetGatewayOutput) { + op := &request.Operation{ Name: opDeleteInternetGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -1973,8 +1983,8 @@ func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteI const opDeleteKeyPair = "DeleteKeyPair" // DeleteKeyPairRequest generates a request for the DeleteKeyPair operation. -func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *aws.Request, output *DeleteKeyPairOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Request, output *DeleteKeyPairOutput) { + op := &request.Operation{ Name: opDeleteKeyPair, HTTPMethod: "POST", HTTPPath: "/", @@ -1997,58 +2007,58 @@ func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, er return out, err } -const opDeleteNetworkACL = "DeleteNetworkAcl" +const opDeleteNetworkAcl = "DeleteNetworkAcl" -// DeleteNetworkACLRequest generates a request for the DeleteNetworkACL operation. -func (c *EC2) DeleteNetworkACLRequest(input *DeleteNetworkACLInput) (req *aws.Request, output *DeleteNetworkACLOutput) { - op := &aws.Operation{ - Name: opDeleteNetworkACL, +// DeleteNetworkAclRequest generates a request for the DeleteNetworkAcl operation. +func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *request.Request, output *DeleteNetworkAclOutput) { + op := &request.Operation{ + Name: opDeleteNetworkAcl, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteNetworkACLInput{} + input = &DeleteNetworkAclInput{} } req = c.newRequest(op, input, output) - output = &DeleteNetworkACLOutput{} + output = &DeleteNetworkAclOutput{} req.Data = output return } // 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) (*DeleteNetworkACLOutput, error) { - req, out := c.DeleteNetworkACLRequest(input) +func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error) { + req, out := c.DeleteNetworkAclRequest(input) err := req.Send() return out, err } -const opDeleteNetworkACLEntry = "DeleteNetworkAclEntry" +const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" -// DeleteNetworkACLEntryRequest generates a request for the DeleteNetworkACLEntry operation. -func (c *EC2) DeleteNetworkACLEntryRequest(input *DeleteNetworkACLEntryInput) (req *aws.Request, output *DeleteNetworkACLEntryOutput) { - op := &aws.Operation{ - Name: opDeleteNetworkACLEntry, +// DeleteNetworkAclEntryRequest generates a request for the DeleteNetworkAclEntry operation. +func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (req *request.Request, output *DeleteNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opDeleteNetworkAclEntry, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteNetworkACLEntryInput{} + input = &DeleteNetworkAclEntryInput{} } req = c.newRequest(op, input, output) - output = &DeleteNetworkACLEntryOutput{} + output = &DeleteNetworkAclEntryOutput{} req.Data = output return } // Deletes the specified ingress or egress entry (rule) from the specified network // ACL. -func (c *EC2) DeleteNetworkACLEntry(input *DeleteNetworkACLEntryInput) (*DeleteNetworkACLEntryOutput, error) { - req, out := c.DeleteNetworkACLEntryRequest(input) +func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error) { + req, out := c.DeleteNetworkAclEntryRequest(input) err := req.Send() return out, err } @@ -2056,8 +2066,8 @@ func (c *EC2) DeleteNetworkACLEntry(input *DeleteNetworkACLEntryInput) (*DeleteN const opDeleteNetworkInterface = "DeleteNetworkInterface" // DeleteNetworkInterfaceRequest generates a request for the DeleteNetworkInterface operation. -func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *aws.Request, output *DeleteNetworkInterfaceOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *request.Request, output *DeleteNetworkInterfaceOutput) { + op := &request.Operation{ Name: opDeleteNetworkInterface, HTTPMethod: "POST", HTTPPath: "/", @@ -2084,8 +2094,8 @@ func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*Delet const opDeletePlacementGroup = "DeletePlacementGroup" // DeletePlacementGroupRequest generates a request for the DeletePlacementGroup operation. -func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *aws.Request, output *DeletePlacementGroupOutput) { - op := &aws.Operation{ +func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *request.Request, output *DeletePlacementGroupOutput) { + op := &request.Operation{ Name: opDeletePlacementGroup, HTTPMethod: "POST", HTTPPath: "/", @@ -2114,8 +2124,8 @@ func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePla const opDeleteRoute = "DeleteRoute" // DeleteRouteRequest generates a request for the DeleteRoute operation. -func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *aws.Request, output *DeleteRouteOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, output *DeleteRouteOutput) { + op := &request.Operation{ Name: opDeleteRoute, HTTPMethod: "POST", HTTPPath: "/", @@ -2141,8 +2151,8 @@ func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { const opDeleteRouteTable = "DeleteRouteTable" // DeleteRouteTableRequest generates a request for the DeleteRouteTable operation. -func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *aws.Request, output *DeleteRouteTableOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *request.Request, output *DeleteRouteTableOutput) { + op := &request.Operation{ Name: opDeleteRouteTable, HTTPMethod: "POST", HTTPPath: "/", @@ -2170,8 +2180,8 @@ func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableO const opDeleteSecurityGroup = "DeleteSecurityGroup" // DeleteSecurityGroupRequest generates a request for the DeleteSecurityGroup operation. -func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *aws.Request, output *DeleteSecurityGroupOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *request.Request, output *DeleteSecurityGroupOutput) { + op := &request.Operation{ Name: opDeleteSecurityGroup, HTTPMethod: "POST", HTTPPath: "/", @@ -2201,8 +2211,8 @@ func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecur const opDeleteSnapshot = "DeleteSnapshot" // DeleteSnapshotRequest generates a request for the DeleteSnapshot operation. -func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *aws.Request, output *DeleteSnapshotOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput) { + op := &request.Operation{ Name: opDeleteSnapshot, HTTPMethod: "POST", HTTPPath: "/", @@ -2242,8 +2252,8 @@ func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" // DeleteSpotDatafeedSubscriptionRequest generates a request for the DeleteSpotDatafeedSubscription operation. -func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *aws.Request, output *DeleteSpotDatafeedSubscriptionOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *request.Request, output *DeleteSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ Name: opDeleteSpotDatafeedSubscription, HTTPMethod: "POST", HTTPPath: "/", @@ -2259,9 +2269,7 @@ func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSub return } -// 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. +// Deletes the data feed for Spot instances. func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) err := req.Send() @@ -2271,8 +2279,8 @@ func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscripti const opDeleteSubnet = "DeleteSubnet" // DeleteSubnetRequest generates a request for the DeleteSubnet operation. -func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *aws.Request, output *DeleteSubnetOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Request, output *DeleteSubnetOutput) { + op := &request.Operation{ Name: opDeleteSubnet, HTTPMethod: "POST", HTTPPath: "/", @@ -2299,8 +2307,8 @@ func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error const opDeleteTags = "DeleteTags" // DeleteTagsRequest generates a request for the DeleteTags operation. -func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *aws.Request, output *DeleteTagsOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { + op := &request.Operation{ Name: opDeleteTags, HTTPMethod: "POST", HTTPPath: "/", @@ -2327,197 +2335,11 @@ func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { return out, err } -const opDeleteVPC = "DeleteVpc" - -// DeleteVPCRequest generates a request for the DeleteVPC operation. -func (c *EC2) DeleteVPCRequest(input *DeleteVPCInput) (req *aws.Request, output *DeleteVPCOutput) { - op := &aws.Operation{ - Name: opDeleteVPC, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPCInput{} - } - - req = c.newRequest(op, input, output) - output = &DeleteVPCOutput{} - req.Data = output - return -} - -// Deletes the specified VPC. You must detach or delete all gateways and resources -// that are associated with the VPC before you can delete it. For example, you -// 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) (*DeleteVPCOutput, error) { - req, out := c.DeleteVPCRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVPCEndpoints = "DeleteVpcEndpoints" - -// DeleteVPCEndpointsRequest generates a request for the DeleteVPCEndpoints operation. -func (c *EC2) DeleteVPCEndpointsRequest(input *DeleteVPCEndpointsInput) (req *aws.Request, output *DeleteVPCEndpointsOutput) { - op := &aws.Operation{ - Name: opDeleteVPCEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPCEndpointsInput{} - } - - req = c.newRequest(op, 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 -} - -const opDeleteVPCPeeringConnection = "DeleteVpcPeeringConnection" - -// DeleteVPCPeeringConnectionRequest generates a request for the DeleteVPCPeeringConnection operation. -func (c *EC2) DeleteVPCPeeringConnectionRequest(input *DeleteVPCPeeringConnectionInput) (req *aws.Request, output *DeleteVPCPeeringConnectionOutput) { - op := &aws.Operation{ - Name: opDeleteVPCPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPCPeeringConnectionInput{} - } - - req = c.newRequest(op, input, output) - output = &DeleteVPCPeeringConnectionOutput{} - req.Data = output - return -} - -// Deletes a VPC peering connection. Either the owner of the requester VPC or -// 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) (*DeleteVPCPeeringConnectionOutput, error) { - req, out := c.DeleteVPCPeeringConnectionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVPNConnection = "DeleteVpnConnection" - -// DeleteVPNConnectionRequest generates a request for the DeleteVPNConnection operation. -func (c *EC2) DeleteVPNConnectionRequest(input *DeleteVPNConnectionInput) (req *aws.Request, output *DeleteVPNConnectionOutput) { - op := &aws.Operation{ - Name: opDeleteVPNConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPNConnectionInput{} - } - - req = c.newRequest(op, input, output) - output = &DeleteVPNConnectionOutput{} - req.Data = output - return -} - -// Deletes the specified VPN connection. -// -// If you're deleting the VPC and its associated components, we recommend that -// you detach the virtual private gateway from the VPC and delete the VPC before -// deleting the VPN connection. If you believe that the tunnel credentials for -// your VPN connection have been compromised, you can delete the VPN connection -// and create a new one that has new keys, without needing to delete the VPC -// 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) (*DeleteVPNConnectionOutput, error) { - req, out := c.DeleteVPNConnectionRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVPNConnectionRoute = "DeleteVpnConnectionRoute" - -// DeleteVPNConnectionRouteRequest generates a request for the DeleteVPNConnectionRoute operation. -func (c *EC2) DeleteVPNConnectionRouteRequest(input *DeleteVPNConnectionRouteInput) (req *aws.Request, output *DeleteVPNConnectionRouteOutput) { - op := &aws.Operation{ - Name: opDeleteVPNConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPNConnectionRouteInput{} - } - - req = c.newRequest(op, input, output) - output = &DeleteVPNConnectionRouteOutput{} - req.Data = output - return -} - -// Deletes the specified static route associated with a VPN connection between -// 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) (*DeleteVPNConnectionRouteOutput, error) { - req, out := c.DeleteVPNConnectionRouteRequest(input) - err := req.Send() - return out, err -} - -const opDeleteVPNGateway = "DeleteVpnGateway" - -// DeleteVPNGatewayRequest generates a request for the DeleteVPNGateway operation. -func (c *EC2) DeleteVPNGatewayRequest(input *DeleteVPNGatewayInput) (req *aws.Request, output *DeleteVPNGatewayOutput) { - op := &aws.Operation{ - Name: opDeleteVPNGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVPNGatewayInput{} - } - - req = c.newRequest(op, input, output) - output = &DeleteVPNGatewayOutput{} - req.Data = output - return -} - -// Deletes the specified virtual private gateway. We recommend that before you -// delete a virtual private gateway, you detach it from the VPC and delete the -// 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) (*DeleteVPNGatewayOutput, error) { - req, out := c.DeleteVPNGatewayRequest(input) - err := req.Send() - return out, err -} - const opDeleteVolume = "DeleteVolume" // DeleteVolumeRequest generates a request for the DeleteVolume operation. -func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *aws.Request, output *DeleteVolumeOutput) { - op := &aws.Operation{ +func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Request, output *DeleteVolumeOutput) { + op := &request.Operation{ Name: opDeleteVolume, HTTPMethod: "POST", HTTPPath: "/", @@ -2546,11 +2368,197 @@ func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error return out, err } +const opDeleteVpc = "DeleteVpc" + +// DeleteVpcRequest generates a request for the DeleteVpc operation. +func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, output *DeleteVpcOutput) { + op := &request.Operation{ + Name: opDeleteVpc, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpcInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVpcOutput{} + req.Data = output + return +} + +// Deletes the specified VPC. You must detach or delete all gateways and resources +// that are associated with the VPC before you can delete it. For example, you +// 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) (*DeleteVpcOutput, error) { + req, out := c.DeleteVpcRequest(input) + err := req.Send() + return out, err +} + +const opDeleteVpcEndpoints = "DeleteVpcEndpoints" + +// DeleteVpcEndpointsRequest generates a request for the DeleteVpcEndpoints operation. +func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *request.Request, output *DeleteVpcEndpointsOutput) { + op := &request.Operation{ + Name: opDeleteVpcEndpoints, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpcEndpointsInput{} + } + + req = c.newRequest(op, 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 +} + +const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" + +// DeleteVpcPeeringConnectionRequest generates a request for the DeleteVpcPeeringConnection operation. +func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectionInput) (req *request.Request, output *DeleteVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opDeleteVpcPeeringConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpcPeeringConnectionInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVpcPeeringConnectionOutput{} + req.Data = output + return +} + +// Deletes a VPC peering connection. Either the owner of the requester VPC or +// 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) (*DeleteVpcPeeringConnectionOutput, error) { + req, out := c.DeleteVpcPeeringConnectionRequest(input) + err := req.Send() + return out, err +} + +const opDeleteVpnConnection = "DeleteVpnConnection" + +// DeleteVpnConnectionRequest generates a request for the DeleteVpnConnection operation. +func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *request.Request, output *DeleteVpnConnectionOutput) { + op := &request.Operation{ + Name: opDeleteVpnConnection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpnConnectionInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVpnConnectionOutput{} + req.Data = output + return +} + +// Deletes the specified VPN connection. +// +// If you're deleting the VPC and its associated components, we recommend that +// you detach the virtual private gateway from the VPC and delete the VPC before +// deleting the VPN connection. If you believe that the tunnel credentials for +// your VPN connection have been compromised, you can delete the VPN connection +// and create a new one that has new keys, without needing to delete the VPC +// 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) (*DeleteVpnConnectionOutput, error) { + req, out := c.DeleteVpnConnectionRequest(input) + err := req.Send() + return out, err +} + +const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" + +// DeleteVpnConnectionRouteRequest generates a request for the DeleteVpnConnectionRoute operation. +func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInput) (req *request.Request, output *DeleteVpnConnectionRouteOutput) { + op := &request.Operation{ + Name: opDeleteVpnConnectionRoute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpnConnectionRouteInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVpnConnectionRouteOutput{} + req.Data = output + return +} + +// Deletes the specified static route associated with a VPN connection between +// 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) (*DeleteVpnConnectionRouteOutput, error) { + req, out := c.DeleteVpnConnectionRouteRequest(input) + err := req.Send() + return out, err +} + +const opDeleteVpnGateway = "DeleteVpnGateway" + +// DeleteVpnGatewayRequest generates a request for the DeleteVpnGateway operation. +func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *request.Request, output *DeleteVpnGatewayOutput) { + op := &request.Operation{ + Name: opDeleteVpnGateway, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteVpnGatewayInput{} + } + + req = c.newRequest(op, input, output) + output = &DeleteVpnGatewayOutput{} + req.Data = output + return +} + +// Deletes the specified virtual private gateway. We recommend that before you +// delete a virtual private gateway, you detach it from the VPC and delete the +// 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) (*DeleteVpnGatewayOutput, error) { + req, out := c.DeleteVpnGatewayRequest(input) + err := req.Send() + return out, err +} + const opDeregisterImage = "DeregisterImage" // DeregisterImageRequest generates a request for the DeregisterImage operation. -func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *aws.Request, output *DeregisterImageOutput) { - op := &aws.Operation{ +func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.Request, output *DeregisterImageOutput) { + op := &request.Operation{ Name: opDeregisterImage, HTTPMethod: "POST", HTTPPath: "/", @@ -2579,8 +2587,8 @@ func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutp const opDescribeAccountAttributes = "DescribeAccountAttributes" // DescribeAccountAttributesRequest generates a request for the DescribeAccountAttributes operation. -func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *aws.Request, output *DescribeAccountAttributesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *request.Request, output *DescribeAccountAttributesOutput) { + op := &request.Operation{ Name: opDescribeAccountAttributes, HTTPMethod: "POST", HTTPPath: "/", @@ -2624,8 +2632,8 @@ func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) ( const opDescribeAddresses = "DescribeAddresses" // DescribeAddressesRequest generates a request for the DescribeAddresses operation. -func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *aws.Request, output *DescribeAddressesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *request.Request, output *DescribeAddressesOutput) { + op := &request.Operation{ Name: opDescribeAddresses, HTTPMethod: "POST", HTTPPath: "/", @@ -2655,8 +2663,8 @@ func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddress const opDescribeAvailabilityZones = "DescribeAvailabilityZones" // DescribeAvailabilityZonesRequest generates a request for the DescribeAvailabilityZones operation. -func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *aws.Request, output *DescribeAvailabilityZonesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *request.Request, output *DescribeAvailabilityZonesOutput) { + op := &request.Operation{ Name: opDescribeAvailabilityZones, HTTPMethod: "POST", HTTPPath: "/", @@ -2688,8 +2696,8 @@ func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) ( const opDescribeBundleTasks = "DescribeBundleTasks" // DescribeBundleTasksRequest generates a request for the DescribeBundleTasks operation. -func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *aws.Request, output *DescribeBundleTasksOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *request.Request, output *DescribeBundleTasksOutput) { + op := &request.Operation{ Name: opDescribeBundleTasks, HTTPMethod: "POST", HTTPPath: "/", @@ -2720,8 +2728,8 @@ func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBun const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" // DescribeClassicLinkInstancesRequest generates a request for the DescribeClassicLinkInstances operation. -func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *aws.Request, output *DescribeClassicLinkInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *request.Request, output *DescribeClassicLinkInstancesOutput) { + op := &request.Operation{ Name: opDescribeClassicLinkInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -2750,8 +2758,8 @@ func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesIn const opDescribeConversionTasks = "DescribeConversionTasks" // DescribeConversionTasksRequest generates a request for the DescribeConversionTasks operation. -func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *aws.Request, output *DescribeConversionTasksOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *request.Request, output *DescribeConversionTasksOutput) { + op := &request.Operation{ Name: opDescribeConversionTasks, HTTPMethod: "POST", HTTPPath: "/", @@ -2780,8 +2788,8 @@ func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*Des const opDescribeCustomerGateways = "DescribeCustomerGateways" // DescribeCustomerGatewaysRequest generates a request for the DescribeCustomerGateways operation. -func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *aws.Request, output *DescribeCustomerGatewaysOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *request.Request, output *DescribeCustomerGatewaysOutput) { + op := &request.Operation{ Name: opDescribeCustomerGateways, HTTPMethod: "POST", HTTPPath: "/", @@ -2808,22 +2816,22 @@ func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*D return out, err } -const opDescribeDHCPOptions = "DescribeDhcpOptions" +const opDescribeDhcpOptions = "DescribeDhcpOptions" -// DescribeDHCPOptionsRequest generates a request for the DescribeDHCPOptions operation. -func (c *EC2) DescribeDHCPOptionsRequest(input *DescribeDHCPOptionsInput) (req *aws.Request, output *DescribeDHCPOptionsOutput) { - op := &aws.Operation{ - Name: opDescribeDHCPOptions, +// DescribeDhcpOptionsRequest generates a request for the DescribeDhcpOptions operation. +func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *request.Request, output *DescribeDhcpOptionsOutput) { + op := &request.Operation{ + Name: opDescribeDhcpOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeDHCPOptionsInput{} + input = &DescribeDhcpOptionsInput{} } req = c.newRequest(op, input, output) - output = &DescribeDHCPOptionsOutput{} + output = &DescribeDhcpOptionsOutput{} req.Data = output return } @@ -2832,8 +2840,8 @@ 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) (*DescribeDHCPOptionsOutput, error) { - req, out := c.DescribeDHCPOptionsRequest(input) +func (c *EC2) DescribeDhcpOptions(input *DescribeDhcpOptionsInput) (*DescribeDhcpOptionsOutput, error) { + req, out := c.DescribeDhcpOptionsRequest(input) err := req.Send() return out, err } @@ -2841,8 +2849,8 @@ func (c *EC2) DescribeDHCPOptions(input *DescribeDHCPOptionsInput) (*DescribeDHC const opDescribeExportTasks = "DescribeExportTasks" // DescribeExportTasksRequest generates a request for the DescribeExportTasks operation. -func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *aws.Request, output *DescribeExportTasksOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) { + op := &request.Operation{ Name: opDescribeExportTasks, HTTPMethod: "POST", HTTPPath: "/", @@ -2868,8 +2876,8 @@ func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExp const opDescribeFlowLogs = "DescribeFlowLogs" // DescribeFlowLogsRequest generates a request for the DescribeFlowLogs operation. -func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *aws.Request, output *DescribeFlowLogsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *request.Request, output *DescribeFlowLogsOutput) { + op := &request.Operation{ Name: opDescribeFlowLogs, HTTPMethod: "POST", HTTPPath: "/", @@ -2897,8 +2905,8 @@ func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsO const opDescribeImageAttribute = "DescribeImageAttribute" // DescribeImageAttributeRequest generates a request for the DescribeImageAttribute operation. -func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *aws.Request, output *DescribeImageAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *request.Request, output *DescribeImageAttributeOutput) { + op := &request.Operation{ Name: opDescribeImageAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -2925,8 +2933,8 @@ func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*Descr const opDescribeImages = "DescribeImages" // DescribeImagesRequest generates a request for the DescribeImages operation. -func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *aws.Request, output *DescribeImagesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { + op := &request.Operation{ Name: opDescribeImages, HTTPMethod: "POST", HTTPPath: "/", @@ -2958,8 +2966,8 @@ func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, const opDescribeImportImageTasks = "DescribeImportImageTasks" // DescribeImportImageTasksRequest generates a request for the DescribeImportImageTasks operation. -func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *aws.Request, output *DescribeImportImageTasksOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *request.Request, output *DescribeImportImageTasksOutput) { + op := &request.Operation{ Name: opDescribeImportImageTasks, HTTPMethod: "POST", HTTPPath: "/", @@ -2986,8 +2994,8 @@ func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*D const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" // DescribeImportSnapshotTasksRequest generates a request for the DescribeImportSnapshotTasks operation. -func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *aws.Request, output *DescribeImportSnapshotTasksOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *request.Request, output *DescribeImportSnapshotTasksOutput) { + op := &request.Operation{ Name: opDescribeImportSnapshotTasks, HTTPMethod: "POST", HTTPPath: "/", @@ -3013,8 +3021,8 @@ func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInpu const opDescribeInstanceAttribute = "DescribeInstanceAttribute" // DescribeInstanceAttributeRequest generates a request for the DescribeInstanceAttribute operation. -func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *aws.Request, output *DescribeInstanceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *request.Request, output *DescribeInstanceAttributeOutput) { + op := &request.Operation{ Name: opDescribeInstanceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -3044,12 +3052,12 @@ func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) ( const opDescribeInstanceStatus = "DescribeInstanceStatus" // DescribeInstanceStatusRequest generates a request for the DescribeInstanceStatus operation. -func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *aws.Request, output *DescribeInstanceStatusOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *request.Request, output *DescribeInstanceStatusOutput) { + op := &request.Operation{ Name: opDescribeInstanceStatus, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -3095,6 +3103,7 @@ func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*Descr func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(p *DescribeInstanceStatusOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeInstanceStatusRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeInstanceStatusOutput), lastPage) }) @@ -3103,12 +3112,12 @@ func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn const opDescribeInstances = "DescribeInstances" // DescribeInstancesRequest generates a request for the DescribeInstances operation. -func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *aws.Request, output *DescribeInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { + op := &request.Operation{ Name: opDescribeInstances, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -3144,6 +3153,7 @@ func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstanc func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *DescribeInstancesOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeInstancesRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeInstancesOutput), lastPage) }) @@ -3152,8 +3162,8 @@ func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(p *D const opDescribeInternetGateways = "DescribeInternetGateways" // DescribeInternetGatewaysRequest generates a request for the DescribeInternetGateways operation. -func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *aws.Request, output *DescribeInternetGatewaysOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *request.Request, output *DescribeInternetGatewaysOutput) { + op := &request.Operation{ Name: opDescribeInternetGateways, HTTPMethod: "POST", HTTPPath: "/", @@ -3179,8 +3189,8 @@ func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*D const opDescribeKeyPairs = "DescribeKeyPairs" // DescribeKeyPairsRequest generates a request for the DescribeKeyPairs operation. -func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *aws.Request, output *DescribeKeyPairsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *request.Request, output *DescribeKeyPairsOutput) { + op := &request.Operation{ Name: opDescribeKeyPairs, HTTPMethod: "POST", HTTPPath: "/", @@ -3209,8 +3219,8 @@ func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsO const opDescribeMovingAddresses = "DescribeMovingAddresses" // DescribeMovingAddressesRequest generates a request for the DescribeMovingAddresses operation. -func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *aws.Request, output *DescribeMovingAddressesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *request.Request, output *DescribeMovingAddressesOutput) { + op := &request.Operation{ Name: opDescribeMovingAddresses, HTTPMethod: "POST", HTTPPath: "/", @@ -3235,22 +3245,22 @@ func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*Des return out, err } -const opDescribeNetworkACLs = "DescribeNetworkAcls" +const opDescribeNetworkAcls = "DescribeNetworkAcls" -// DescribeNetworkACLsRequest generates a request for the DescribeNetworkACLs operation. -func (c *EC2) DescribeNetworkACLsRequest(input *DescribeNetworkACLsInput) (req *aws.Request, output *DescribeNetworkACLsOutput) { - op := &aws.Operation{ - Name: opDescribeNetworkACLs, +// DescribeNetworkAclsRequest generates a request for the DescribeNetworkAcls operation. +func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) { + op := &request.Operation{ + Name: opDescribeNetworkAcls, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeNetworkACLsInput{} + input = &DescribeNetworkAclsInput{} } req = c.newRequest(op, input, output) - output = &DescribeNetworkACLsOutput{} + output = &DescribeNetworkAclsOutput{} req.Data = output return } @@ -3259,8 +3269,8 @@ 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) (*DescribeNetworkACLsOutput, error) { - req, out := c.DescribeNetworkACLsRequest(input) +func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { + req, out := c.DescribeNetworkAclsRequest(input) err := req.Send() return out, err } @@ -3268,8 +3278,8 @@ func (c *EC2) DescribeNetworkACLs(input *DescribeNetworkACLsInput) (*DescribeNet const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" // DescribeNetworkInterfaceAttributeRequest generates a request for the DescribeNetworkInterfaceAttribute operation. -func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *aws.Request, output *DescribeNetworkInterfaceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *request.Request, output *DescribeNetworkInterfaceAttributeOutput) { + op := &request.Operation{ Name: opDescribeNetworkInterfaceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -3296,8 +3306,8 @@ func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceA const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" // DescribeNetworkInterfacesRequest generates a request for the DescribeNetworkInterfaces operation. -func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *aws.Request, output *DescribeNetworkInterfacesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *request.Request, output *DescribeNetworkInterfacesOutput) { + op := &request.Operation{ Name: opDescribeNetworkInterfaces, HTTPMethod: "POST", HTTPPath: "/", @@ -3323,8 +3333,8 @@ func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) ( const opDescribePlacementGroups = "DescribePlacementGroups" // DescribePlacementGroupsRequest generates a request for the DescribePlacementGroups operation. -func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *aws.Request, output *DescribePlacementGroupsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *request.Request, output *DescribePlacementGroupsOutput) { + op := &request.Operation{ Name: opDescribePlacementGroups, HTTPMethod: "POST", HTTPPath: "/", @@ -3352,8 +3362,8 @@ func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*Des const opDescribePrefixLists = "DescribePrefixLists" // DescribePrefixListsRequest generates a request for the DescribePrefixLists operation. -func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *aws.Request, output *DescribePrefixListsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *request.Request, output *DescribePrefixListsOutput) { + op := &request.Operation{ Name: opDescribePrefixLists, HTTPMethod: "POST", HTTPPath: "/", @@ -3383,8 +3393,8 @@ func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePre const opDescribeRegions = "DescribeRegions" // DescribeRegionsRequest generates a request for the DescribeRegions operation. -func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *aws.Request, output *DescribeRegionsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.Request, output *DescribeRegionsOutput) { + op := &request.Operation{ Name: opDescribeRegions, HTTPMethod: "POST", HTTPPath: "/", @@ -3413,8 +3423,8 @@ func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutp const opDescribeReservedInstances = "DescribeReservedInstances" // DescribeReservedInstancesRequest generates a request for the DescribeReservedInstances operation. -func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *aws.Request, output *DescribeReservedInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *request.Request, output *DescribeReservedInstancesOutput) { + op := &request.Operation{ Name: opDescribeReservedInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -3443,8 +3453,8 @@ func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) ( const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" // DescribeReservedInstancesListingsRequest generates a request for the DescribeReservedInstancesListings operation. -func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *aws.Request, output *DescribeReservedInstancesListingsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *request.Request, output *DescribeReservedInstancesListingsOutput) { + op := &request.Operation{ Name: opDescribeReservedInstancesListings, HTTPMethod: "POST", HTTPPath: "/", @@ -3491,12 +3501,12 @@ func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstances const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" // DescribeReservedInstancesModificationsRequest generates a request for the DescribeReservedInstancesModifications operation. -func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *aws.Request, output *DescribeReservedInstancesModificationsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *request.Request, output *DescribeReservedInstancesModificationsOutput) { + op := &request.Operation{ Name: opDescribeReservedInstancesModifications, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "", @@ -3529,6 +3539,7 @@ func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInst func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(p *DescribeReservedInstancesModificationsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeReservedInstancesModificationsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeReservedInstancesModificationsOutput), lastPage) }) @@ -3537,12 +3548,12 @@ func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReserve const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" // DescribeReservedInstancesOfferingsRequest generates a request for the DescribeReservedInstancesOfferings operation. -func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *aws.Request, output *DescribeReservedInstancesOfferingsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *request.Request, output *DescribeReservedInstancesOfferingsOutput) { + op := &request.Operation{ Name: opDescribeReservedInstancesOfferings, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -3576,6 +3587,7 @@ func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstance func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(p *DescribeReservedInstancesOfferingsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeReservedInstancesOfferingsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeReservedInstancesOfferingsOutput), lastPage) }) @@ -3584,8 +3596,8 @@ func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedIns const opDescribeRouteTables = "DescribeRouteTables" // DescribeRouteTablesRequest generates a request for the DescribeRouteTables operation. -func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *aws.Request, output *DescribeRouteTablesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *request.Request, output *DescribeRouteTablesOutput) { + op := &request.Operation{ Name: opDescribeRouteTables, HTTPMethod: "POST", HTTPPath: "/", @@ -3619,8 +3631,8 @@ func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRou const opDescribeSecurityGroups = "DescribeSecurityGroups" // DescribeSecurityGroupsRequest generates a request for the DescribeSecurityGroups operation. -func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *aws.Request, output *DescribeSecurityGroupsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *request.Request, output *DescribeSecurityGroupsOutput) { + op := &request.Operation{ Name: opDescribeSecurityGroups, HTTPMethod: "POST", HTTPPath: "/", @@ -3653,8 +3665,8 @@ func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*Descr const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" // DescribeSnapshotAttributeRequest generates a request for the DescribeSnapshotAttribute operation. -func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *aws.Request, output *DescribeSnapshotAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *request.Request, output *DescribeSnapshotAttributeOutput) { + op := &request.Operation{ Name: opDescribeSnapshotAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -3684,15 +3696,15 @@ func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) ( const opDescribeSnapshots = "DescribeSnapshots" // DescribeSnapshotsRequest generates a request for the DescribeSnapshots operation. -func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *aws.Request, output *DescribeSnapshotsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { + op := &request.Operation{ Name: opDescribeSnapshots, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, - LimitToken: "", + LimitToken: "MaxResults", TruncationToken: "", }, } @@ -3755,6 +3767,7 @@ func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapsho func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *DescribeSnapshotsOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeSnapshotsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeSnapshotsOutput), lastPage) }) @@ -3763,8 +3776,8 @@ func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(p *D const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" // DescribeSpotDatafeedSubscriptionRequest generates a request for the DescribeSpotDatafeedSubscription operation. -func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *aws.Request, output *DescribeSpotDatafeedSubscriptionOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *request.Request, output *DescribeSpotDatafeedSubscriptionOutput) { + op := &request.Operation{ Name: opDescribeSpotDatafeedSubscription, HTTPMethod: "POST", HTTPPath: "/", @@ -3780,7 +3793,7 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee return } -// Describes the data feed for Spot Instances. For more information, see Spot +// 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) (*DescribeSpotDatafeedSubscriptionOutput, error) { @@ -3792,8 +3805,8 @@ func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscr const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" // DescribeSpotFleetInstancesRequest generates a request for the DescribeSpotFleetInstances operation. -func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *aws.Request, output *DescribeSpotFleetInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *request.Request, output *DescribeSpotFleetInstancesOutput) { + op := &request.Operation{ Name: opDescribeSpotFleetInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -3819,8 +3832,8 @@ func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" // DescribeSpotFleetRequestHistoryRequest generates a request for the DescribeSpotFleetRequestHistory operation. -func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *aws.Request, output *DescribeSpotFleetRequestHistoryOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *request.Request, output *DescribeSpotFleetRequestHistoryOutput) { + op := &request.Operation{ Name: opDescribeSpotFleetRequestHistory, HTTPMethod: "POST", HTTPPath: "/", @@ -3851,8 +3864,8 @@ func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHis const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" // DescribeSpotFleetRequestsRequest generates a request for the DescribeSpotFleetRequests operation. -func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *aws.Request, output *DescribeSpotFleetRequestsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *request.Request, output *DescribeSpotFleetRequestsOutput) { + op := &request.Operation{ Name: opDescribeSpotFleetRequests, HTTPMethod: "POST", HTTPPath: "/", @@ -3878,8 +3891,8 @@ func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) ( const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" // DescribeSpotInstanceRequestsRequest generates a request for the DescribeSpotInstanceRequests operation. -func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *aws.Request, output *DescribeSpotInstanceRequestsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *request.Request, output *DescribeSpotInstanceRequestsOutput) { + op := &request.Operation{ Name: opDescribeSpotInstanceRequests, HTTPMethod: "POST", HTTPPath: "/", @@ -3895,15 +3908,15 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq return } -// Describes the Spot Instance requests that belong to your account. Spot Instances +// Describes the Spot instance requests that belong to your account. Spot instances // are instances that Amazon EC2 launches when the bid price that you specify -// exceeds the current Spot Price. Amazon EC2 periodically sets the Spot Price -// based on available Spot Instance capacity and current Spot Instance requests. +// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price +// based on available Spot 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. // -// You can use DescribeSpotInstanceRequests to find a running Spot Instance -// by examining the response. If the status of the Spot Instance is fulfilled, +// You can use DescribeSpotInstanceRequests to find a running Spot instance +// by examining the response. If the status of the Spot instance is fulfilled, // 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. @@ -3916,12 +3929,12 @@ func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsIn const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" // DescribeSpotPriceHistoryRequest generates a request for the DescribeSpotPriceHistory operation. -func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *aws.Request, output *DescribeSpotPriceHistoryOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *request.Request, output *DescribeSpotPriceHistoryOutput) { + op := &request.Operation{ Name: opDescribeSpotPriceHistory, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -3939,7 +3952,7 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp return } -// Describes the Spot Price history. The prices returned are listed in chronological +// Describes the Spot price history. The prices returned are listed in chronological // order, from the oldest to the most recent, for up to the past 90 days. For // more information, see Spot Instance Pricing History (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) // in the Amazon Elastic Compute Cloud User Guide. @@ -3956,6 +3969,7 @@ func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*D func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(p *DescribeSpotPriceHistoryOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeSpotPriceHistoryRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeSpotPriceHistoryOutput), lastPage) }) @@ -3964,8 +3978,8 @@ func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput const opDescribeSubnets = "DescribeSubnets" // DescribeSubnetsRequest generates a request for the DescribeSubnets operation. -func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *aws.Request, output *DescribeSubnetsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.Request, output *DescribeSubnetsOutput) { + op := &request.Operation{ Name: opDescribeSubnets, HTTPMethod: "POST", HTTPPath: "/", @@ -3994,11 +4008,17 @@ func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutp const opDescribeTags = "DescribeTags" // DescribeTagsRequest generates a request for the DescribeTags operation. -func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *aws.Request, output *DescribeTagsOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + op := &request.Operation{ Name: opDescribeTags, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -4021,237 +4041,19 @@ func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error return out, err } -const opDescribeVPCAttribute = "DescribeVpcAttribute" - -// DescribeVPCAttributeRequest generates a request for the DescribeVPCAttribute operation. -func (c *EC2) DescribeVPCAttributeRequest(input *DescribeVPCAttributeInput) (req *aws.Request, output *DescribeVPCAttributeOutput) { - op := &aws.Operation{ - Name: opDescribeVPCAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCAttributeInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPCAttributeOutput{} - req.Data = output - return -} - -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. -func (c *EC2) DescribeVPCAttribute(input *DescribeVPCAttributeInput) (*DescribeVPCAttributeOutput, error) { - req, out := c.DescribeVPCAttributeRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVPCClassicLink = "DescribeVpcClassicLink" - -// DescribeVPCClassicLinkRequest generates a request for the DescribeVPCClassicLink operation. -func (c *EC2) DescribeVPCClassicLinkRequest(input *DescribeVPCClassicLinkInput) (req *aws.Request, output *DescribeVPCClassicLinkOutput) { - op := &aws.Operation{ - Name: opDescribeVPCClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCClassicLinkInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPCClassicLinkOutput{} - req.Data = output - return -} - -// Describes the ClassicLink status of one or more VPCs. -func (c *EC2) DescribeVPCClassicLink(input *DescribeVPCClassicLinkInput) (*DescribeVPCClassicLinkOutput, error) { - req, out := c.DescribeVPCClassicLinkRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVPCEndpointServices = "DescribeVpcEndpointServices" - -// DescribeVPCEndpointServicesRequest generates a request for the DescribeVPCEndpointServices operation. -func (c *EC2) DescribeVPCEndpointServicesRequest(input *DescribeVPCEndpointServicesInput) (req *aws.Request, output *DescribeVPCEndpointServicesOutput) { - op := &aws.Operation{ - Name: opDescribeVPCEndpointServices, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCEndpointServicesInput{} - } - - req = c.newRequest(op, 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 -} - -const opDescribeVPCEndpoints = "DescribeVpcEndpoints" - -// DescribeVPCEndpointsRequest generates a request for the DescribeVPCEndpoints operation. -func (c *EC2) DescribeVPCEndpointsRequest(input *DescribeVPCEndpointsInput) (req *aws.Request, output *DescribeVPCEndpointsOutput) { - op := &aws.Operation{ - Name: opDescribeVPCEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCEndpointsInput{} - } - - req = c.newRequest(op, 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 -} - -const opDescribeVPCPeeringConnections = "DescribeVpcPeeringConnections" - -// DescribeVPCPeeringConnectionsRequest generates a request for the DescribeVPCPeeringConnections operation. -func (c *EC2) DescribeVPCPeeringConnectionsRequest(input *DescribeVPCPeeringConnectionsInput) (req *aws.Request, output *DescribeVPCPeeringConnectionsOutput) { - op := &aws.Operation{ - Name: opDescribeVPCPeeringConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCPeeringConnectionsInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPCPeeringConnectionsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPC peering connections. -func (c *EC2) DescribeVPCPeeringConnections(input *DescribeVPCPeeringConnectionsInput) (*DescribeVPCPeeringConnectionsOutput, error) { - req, out := c.DescribeVPCPeeringConnectionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVPCs = "DescribeVpcs" - -// DescribeVPCsRequest generates a request for the DescribeVPCs operation. -func (c *EC2) DescribeVPCsRequest(input *DescribeVPCsInput) (req *aws.Request, output *DescribeVPCsOutput) { - op := &aws.Operation{ - Name: opDescribeVPCs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPCsInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPCsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPCs. -func (c *EC2) DescribeVPCs(input *DescribeVPCsInput) (*DescribeVPCsOutput, error) { - req, out := c.DescribeVPCsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVPNConnections = "DescribeVpnConnections" - -// DescribeVPNConnectionsRequest generates a request for the DescribeVPNConnections operation. -func (c *EC2) DescribeVPNConnectionsRequest(input *DescribeVPNConnectionsInput) (req *aws.Request, output *DescribeVPNConnectionsOutput) { - op := &aws.Operation{ - Name: opDescribeVPNConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPNConnectionsInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPNConnectionsOutput{} - req.Data = output - return -} - -// Describes one or more of your VPN connections. -// -// 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) (*DescribeVPNConnectionsOutput, error) { - req, out := c.DescribeVPNConnectionsRequest(input) - err := req.Send() - return out, err -} - -const opDescribeVPNGateways = "DescribeVpnGateways" - -// DescribeVPNGatewaysRequest generates a request for the DescribeVPNGateways operation. -func (c *EC2) DescribeVPNGatewaysRequest(input *DescribeVPNGatewaysInput) (req *aws.Request, output *DescribeVPNGatewaysOutput) { - op := &aws.Operation{ - Name: opDescribeVPNGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVPNGatewaysInput{} - } - - req = c.newRequest(op, input, output) - output = &DescribeVPNGatewaysOutput{} - req.Data = output - return -} - -// Describes one or more of your virtual private gateways. -// -// 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) (*DescribeVPNGatewaysOutput, error) { - req, out := c.DescribeVPNGatewaysRequest(input) - err := req.Send() - return out, err +func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(p *DescribeTagsOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeTagsRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeTagsOutput), lastPage) + }) } const opDescribeVolumeAttribute = "DescribeVolumeAttribute" // DescribeVolumeAttributeRequest generates a request for the DescribeVolumeAttribute operation. -func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *aws.Request, output *DescribeVolumeAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *request.Request, output *DescribeVolumeAttributeOutput) { + op := &request.Operation{ Name: opDescribeVolumeAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -4281,12 +4083,12 @@ func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*Des const opDescribeVolumeStatus = "DescribeVolumeStatus" // DescribeVolumeStatusRequest generates a request for the DescribeVolumeStatus operation. -func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *aws.Request, output *DescribeVolumeStatusOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *request.Request, output *DescribeVolumeStatusOutput) { + op := &request.Operation{ Name: opDescribeVolumeStatus, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -4347,6 +4149,7 @@ func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeV func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(p *DescribeVolumeStatusOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeVolumeStatusRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeVolumeStatusOutput), lastPage) }) @@ -4355,12 +4158,12 @@ func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn fun const opDescribeVolumes = "DescribeVolumes" // DescribeVolumesRequest generates a request for the DescribeVolumes operation. -func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *aws.Request, output *DescribeVolumesOutput) { - op := &aws.Operation{ +func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { + op := &request.Operation{ Name: opDescribeVolumes, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &aws.Paginator{ + Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", @@ -4397,27 +4200,254 @@ func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutp func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *DescribeVolumesOutput, lastPage bool) (shouldContinue bool)) error { page, _ := c.DescribeVolumesRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) return page.EachPage(func(p interface{}, lastPage bool) bool { return fn(p.(*DescribeVolumesOutput), lastPage) }) } -const opDetachClassicLinkVPC = "DetachClassicLinkVpc" +const opDescribeVpcAttribute = "DescribeVpcAttribute" -// DetachClassicLinkVPCRequest generates a request for the DetachClassicLinkVPC operation. -func (c *EC2) DetachClassicLinkVPCRequest(input *DetachClassicLinkVPCInput) (req *aws.Request, output *DetachClassicLinkVPCOutput) { - op := &aws.Operation{ - Name: opDetachClassicLinkVPC, +// DescribeVpcAttributeRequest generates a request for the DescribeVpcAttribute operation. +func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req *request.Request, output *DescribeVpcAttributeOutput) { + op := &request.Operation{ + Name: opDescribeVpcAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DetachClassicLinkVPCInput{} + input = &DescribeVpcAttributeInput{} } req = c.newRequest(op, input, output) - output = &DetachClassicLinkVPCOutput{} + output = &DescribeVpcAttributeOutput{} + req.Data = output + return +} + +// Describes the specified attribute of the specified VPC. You can specify only +// one attribute at a time. +func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { + req, out := c.DescribeVpcAttributeRequest(input) + err := req.Send() + return out, err +} + +const opDescribeVpcClassicLink = "DescribeVpcClassicLink" + +// DescribeVpcClassicLinkRequest generates a request for the DescribeVpcClassicLink operation. +func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) (req *request.Request, output *DescribeVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opDescribeVpcClassicLink, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpcClassicLinkInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeVpcClassicLinkOutput{} + req.Data = output + return +} + +// Describes the ClassicLink status of one or more VPCs. +func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { + req, out := c.DescribeVpcClassicLinkRequest(input) + err := req.Send() + return out, err +} + +const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" + +// DescribeVpcEndpointServicesRequest generates a request for the DescribeVpcEndpointServices operation. +func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServicesInput) (req *request.Request, output *DescribeVpcEndpointServicesOutput) { + op := &request.Operation{ + Name: opDescribeVpcEndpointServices, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpcEndpointServicesInput{} + } + + req = c.newRequest(op, 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 +} + +const opDescribeVpcEndpoints = "DescribeVpcEndpoints" + +// DescribeVpcEndpointsRequest generates a request for the DescribeVpcEndpoints operation. +func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req *request.Request, output *DescribeVpcEndpointsOutput) { + op := &request.Operation{ + Name: opDescribeVpcEndpoints, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpcEndpointsInput{} + } + + req = c.newRequest(op, 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 +} + +const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" + +// DescribeVpcPeeringConnectionsRequest generates a request for the DescribeVpcPeeringConnections operation. +func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConnectionsInput) (req *request.Request, output *DescribeVpcPeeringConnectionsOutput) { + op := &request.Operation{ + Name: opDescribeVpcPeeringConnections, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpcPeeringConnectionsInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeVpcPeeringConnectionsOutput{} + req.Data = output + return +} + +// Describes one or more of your VPC peering connections. +func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { + req, out := c.DescribeVpcPeeringConnectionsRequest(input) + err := req.Send() + return out, err +} + +const opDescribeVpcs = "DescribeVpcs" + +// DescribeVpcsRequest generates a request for the DescribeVpcs operation. +func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Request, output *DescribeVpcsOutput) { + op := &request.Operation{ + Name: opDescribeVpcs, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpcsInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeVpcsOutput{} + req.Data = output + return +} + +// Describes one or more of your VPCs. +func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { + req, out := c.DescribeVpcsRequest(input) + err := req.Send() + return out, err +} + +const opDescribeVpnConnections = "DescribeVpnConnections" + +// DescribeVpnConnectionsRequest generates a request for the DescribeVpnConnections operation. +func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) (req *request.Request, output *DescribeVpnConnectionsOutput) { + op := &request.Operation{ + Name: opDescribeVpnConnections, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpnConnectionsInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeVpnConnectionsOutput{} + req.Data = output + return +} + +// Describes one or more of your VPN connections. +// +// 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) (*DescribeVpnConnectionsOutput, error) { + req, out := c.DescribeVpnConnectionsRequest(input) + err := req.Send() + return out, err +} + +const opDescribeVpnGateways = "DescribeVpnGateways" + +// DescribeVpnGatewaysRequest generates a request for the DescribeVpnGateways operation. +func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *request.Request, output *DescribeVpnGatewaysOutput) { + op := &request.Operation{ + Name: opDescribeVpnGateways, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVpnGatewaysInput{} + } + + req = c.newRequest(op, input, output) + output = &DescribeVpnGatewaysOutput{} + req.Data = output + return +} + +// Describes one or more of your virtual private gateways. +// +// 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) (*DescribeVpnGatewaysOutput, error) { + req, out := c.DescribeVpnGatewaysRequest(input) + err := req.Send() + return out, err +} + +const opDetachClassicLinkVpc = "DetachClassicLinkVpc" + +// DetachClassicLinkVpcRequest generates a request for the DetachClassicLinkVpc operation. +func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) (req *request.Request, output *DetachClassicLinkVpcOutput) { + op := &request.Operation{ + Name: opDetachClassicLinkVpc, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetachClassicLinkVpcInput{} + } + + req = c.newRequest(op, input, output) + output = &DetachClassicLinkVpcOutput{} req.Data = output return } @@ -4425,8 +4455,8 @@ 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) (*DetachClassicLinkVPCOutput, error) { - req, out := c.DetachClassicLinkVPCRequest(input) +func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { + req, out := c.DetachClassicLinkVpcRequest(input) err := req.Send() return out, err } @@ -4434,8 +4464,8 @@ func (c *EC2) DetachClassicLinkVPC(input *DetachClassicLinkVPCInput) (*DetachCla const opDetachInternetGateway = "DetachInternetGateway" // DetachInternetGatewayRequest generates a request for the DetachInternetGateway operation. -func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *aws.Request, output *DetachInternetGatewayOutput) { - op := &aws.Operation{ +func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *request.Request, output *DetachInternetGatewayOutput) { + op := &request.Operation{ Name: opDetachInternetGateway, HTTPMethod: "POST", HTTPPath: "/", @@ -4463,8 +4493,8 @@ func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachI const opDetachNetworkInterface = "DetachNetworkInterface" // DetachNetworkInterfaceRequest generates a request for the DetachNetworkInterface operation. -func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *aws.Request, output *DetachNetworkInterfaceOutput) { - op := &aws.Operation{ +func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *request.Request, output *DetachNetworkInterfaceOutput) { + op := &request.Operation{ Name: opDetachNetworkInterface, HTTPMethod: "POST", HTTPPath: "/", @@ -4487,45 +4517,11 @@ func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*Detac return out, err } -const opDetachVPNGateway = "DetachVpnGateway" - -// DetachVPNGatewayRequest generates a request for the DetachVPNGateway operation. -func (c *EC2) DetachVPNGatewayRequest(input *DetachVPNGatewayInput) (req *aws.Request, output *DetachVPNGatewayOutput) { - op := &aws.Operation{ - Name: opDetachVPNGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachVPNGatewayInput{} - } - - req = c.newRequest(op, input, output) - output = &DetachVPNGatewayOutput{} - req.Data = output - return -} - -// Detaches a virtual private gateway from a VPC. You do this if you're planning -// to turn off the VPC and not use it anymore. You can confirm a virtual private -// gateway has been completely detached from a VPC by describing the virtual -// private gateway (any attachments to the virtual private gateway are also -// described). -// -// 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) (*DetachVPNGatewayOutput, error) { - req, out := c.DetachVPNGatewayRequest(input) - err := req.Send() - return out, err -} - const opDetachVolume = "DetachVolume" // DetachVolumeRequest generates a request for the DetachVolume operation. -func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *aws.Request, output *VolumeAttachment) { - op := &aws.Operation{ +func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Request, output *VolumeAttachment) { + op := &request.Operation{ Name: opDetachVolume, HTTPMethod: "POST", HTTPPath: "/", @@ -4560,58 +4556,92 @@ func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) return out, err } -const opDisableVGWRoutePropagation = "DisableVgwRoutePropagation" +const opDetachVpnGateway = "DetachVpnGateway" -// DisableVGWRoutePropagationRequest generates a request for the DisableVGWRoutePropagation operation. -func (c *EC2) DisableVGWRoutePropagationRequest(input *DisableVGWRoutePropagationInput) (req *aws.Request, output *DisableVGWRoutePropagationOutput) { - op := &aws.Operation{ - Name: opDisableVGWRoutePropagation, +// DetachVpnGatewayRequest generates a request for the DetachVpnGateway operation. +func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *request.Request, output *DetachVpnGatewayOutput) { + op := &request.Operation{ + Name: opDetachVpnGateway, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableVGWRoutePropagationInput{} + input = &DetachVpnGatewayInput{} } req = c.newRequest(op, input, output) - output = &DisableVGWRoutePropagationOutput{} + output = &DetachVpnGatewayOutput{} + req.Data = output + return +} + +// Detaches a virtual private gateway from a VPC. You do this if you're planning +// to turn off the VPC and not use it anymore. You can confirm a virtual private +// gateway has been completely detached from a VPC by describing the virtual +// private gateway (any attachments to the virtual private gateway are also +// described). +// +// 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) (*DetachVpnGatewayOutput, error) { + req, out := c.DetachVpnGatewayRequest(input) + err := req.Send() + return out, err +} + +const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" + +// DisableVgwRoutePropagationRequest generates a request for the DisableVgwRoutePropagation operation. +func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagationInput) (req *request.Request, output *DisableVgwRoutePropagationOutput) { + op := &request.Operation{ + Name: opDisableVgwRoutePropagation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisableVgwRoutePropagationInput{} + } + + req = c.newRequest(op, input, output) + output = &DisableVgwRoutePropagationOutput{} req.Data = output return } // Disables a virtual private gateway (VGW) from propagating routes to a specified // route table of a VPC. -func (c *EC2) DisableVGWRoutePropagation(input *DisableVGWRoutePropagationInput) (*DisableVGWRoutePropagationOutput, error) { - req, out := c.DisableVGWRoutePropagationRequest(input) +func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { + req, out := c.DisableVgwRoutePropagationRequest(input) err := req.Send() return out, err } -const opDisableVPCClassicLink = "DisableVpcClassicLink" +const opDisableVpcClassicLink = "DisableVpcClassicLink" -// DisableVPCClassicLinkRequest generates a request for the DisableVPCClassicLink operation. -func (c *EC2) DisableVPCClassicLinkRequest(input *DisableVPCClassicLinkInput) (req *aws.Request, output *DisableVPCClassicLinkOutput) { - op := &aws.Operation{ - Name: opDisableVPCClassicLink, +// DisableVpcClassicLinkRequest generates a request for the DisableVpcClassicLink operation. +func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (req *request.Request, output *DisableVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opDisableVpcClassicLink, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableVPCClassicLinkInput{} + input = &DisableVpcClassicLinkInput{} } req = c.newRequest(op, input, output) - output = &DisableVPCClassicLinkOutput{} + output = &DisableVpcClassicLinkOutput{} req.Data = output return } // 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) (*DisableVPCClassicLinkOutput, error) { - req, out := c.DisableVPCClassicLinkRequest(input) +func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { + req, out := c.DisableVpcClassicLinkRequest(input) err := req.Send() return out, err } @@ -4619,8 +4649,8 @@ func (c *EC2) DisableVPCClassicLink(input *DisableVPCClassicLinkInput) (*Disable const opDisassociateAddress = "DisassociateAddress" // DisassociateAddressRequest generates a request for the DisassociateAddress operation. -func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *aws.Request, output *DisassociateAddressOutput) { - op := &aws.Operation{ +func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *request.Request, output *DisassociateAddressOutput) { + op := &request.Operation{ Name: opDisassociateAddress, HTTPMethod: "POST", HTTPPath: "/", @@ -4654,8 +4684,8 @@ func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*Disassociat const opDisassociateRouteTable = "DisassociateRouteTable" // DisassociateRouteTableRequest generates a request for the DisassociateRouteTable operation. -func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *aws.Request, output *DisassociateRouteTableOutput) { - op := &aws.Operation{ +func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *request.Request, output *DisassociateRouteTableOutput) { + op := &request.Operation{ Name: opDisassociateRouteTable, HTTPMethod: "POST", HTTPPath: "/", @@ -4683,63 +4713,30 @@ func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*Disas return out, err } -const opEnableVGWRoutePropagation = "EnableVgwRoutePropagation" +const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" -// EnableVGWRoutePropagationRequest generates a request for the EnableVGWRoutePropagation operation. -func (c *EC2) EnableVGWRoutePropagationRequest(input *EnableVGWRoutePropagationInput) (req *aws.Request, output *EnableVGWRoutePropagationOutput) { - op := &aws.Operation{ - Name: opEnableVGWRoutePropagation, +// EnableVgwRoutePropagationRequest generates a request for the EnableVgwRoutePropagation operation. +func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationInput) (req *request.Request, output *EnableVgwRoutePropagationOutput) { + op := &request.Operation{ + Name: opEnableVgwRoutePropagation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableVGWRoutePropagationInput{} + input = &EnableVgwRoutePropagationInput{} } req = c.newRequest(op, input, output) - output = &EnableVGWRoutePropagationOutput{} + output = &EnableVgwRoutePropagationOutput{} req.Data = output return } // Enables a virtual private gateway (VGW) to propagate routes to the specified // route table of a VPC. -func (c *EC2) EnableVGWRoutePropagation(input *EnableVGWRoutePropagationInput) (*EnableVGWRoutePropagationOutput, error) { - req, out := c.EnableVGWRoutePropagationRequest(input) - err := req.Send() - return out, err -} - -const opEnableVPCClassicLink = "EnableVpcClassicLink" - -// EnableVPCClassicLinkRequest generates a request for the EnableVPCClassicLink operation. -func (c *EC2) EnableVPCClassicLinkRequest(input *EnableVPCClassicLinkInput) (req *aws.Request, output *EnableVPCClassicLinkOutput) { - op := &aws.Operation{ - Name: opEnableVPCClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVPCClassicLinkInput{} - } - - req = c.newRequest(op, input, output) - output = &EnableVPCClassicLinkOutput{} - req.Data = output - return -} - -// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to -// your ClassicLink-enabled VPC to allow communication over private IP addresses. -// You cannot enable your VPC for ClassicLink if any of your VPC's route tables -// have existing routes for address ranges within the 10.0.0.0/8 IP address -// 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) (*EnableVPCClassicLinkOutput, error) { - req, out := c.EnableVPCClassicLinkRequest(input) +func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { + req, out := c.EnableVgwRoutePropagationRequest(input) err := req.Send() return out, err } @@ -4747,8 +4744,8 @@ func (c *EC2) EnableVPCClassicLink(input *EnableVPCClassicLinkInput) (*EnableVPC const opEnableVolumeIO = "EnableVolumeIO" // EnableVolumeIORequest generates a request for the EnableVolumeIO operation. -func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *aws.Request, output *EnableVolumeIOOutput) { - op := &aws.Operation{ +func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Request, output *EnableVolumeIOOutput) { + op := &request.Operation{ Name: opEnableVolumeIO, HTTPMethod: "POST", HTTPPath: "/", @@ -4772,11 +4769,44 @@ func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, return out, err } +const opEnableVpcClassicLink = "EnableVpcClassicLink" + +// EnableVpcClassicLinkRequest generates a request for the EnableVpcClassicLink operation. +func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req *request.Request, output *EnableVpcClassicLinkOutput) { + op := &request.Operation{ + Name: opEnableVpcClassicLink, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableVpcClassicLinkInput{} + } + + req = c.newRequest(op, input, output) + output = &EnableVpcClassicLinkOutput{} + req.Data = output + return +} + +// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to +// your ClassicLink-enabled VPC to allow communication over private IP addresses. +// You cannot enable your VPC for ClassicLink if any of your VPC's route tables +// have existing routes for address ranges within the 10.0.0.0/8 IP address +// 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) (*EnableVpcClassicLinkOutput, error) { + req, out := c.EnableVpcClassicLinkRequest(input) + err := req.Send() + return out, err +} + const opGetConsoleOutput = "GetConsoleOutput" // GetConsoleOutputRequest generates a request for the GetConsoleOutput operation. -func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *aws.Request, output *GetConsoleOutputOutput) { - op := &aws.Operation{ +func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *request.Request, output *GetConsoleOutputOutput) { + op := &request.Operation{ Name: opGetConsoleOutput, HTTPMethod: "POST", HTTPPath: "/", @@ -4819,8 +4849,8 @@ func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputO const opGetPasswordData = "GetPasswordData" // GetPasswordDataRequest generates a request for the GetPasswordData operation. -func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *aws.Request, output *GetPasswordDataOutput) { - op := &aws.Operation{ +func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.Request, output *GetPasswordDataOutput) { + op := &request.Operation{ Name: opGetPasswordData, HTTPMethod: "POST", HTTPPath: "/", @@ -4859,8 +4889,8 @@ func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutp const opImportImage = "ImportImage" // ImportImageRequest generates a request for the ImportImage operation. -func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *aws.Request, output *ImportImageOutput) { - op := &aws.Operation{ +func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { + op := &request.Operation{ Name: opImportImage, HTTPMethod: "POST", HTTPPath: "/", @@ -4887,8 +4917,8 @@ func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { const opImportInstance = "ImportInstance" // ImportInstanceRequest generates a request for the ImportInstance operation. -func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *aws.Request, output *ImportInstanceOutput) { - op := &aws.Operation{ +func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Request, output *ImportInstanceOutput) { + op := &request.Operation{ Name: opImportInstance, HTTPMethod: "POST", HTTPPath: "/", @@ -4920,8 +4950,8 @@ func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, const opImportKeyPair = "ImportKeyPair" // ImportKeyPairRequest generates a request for the ImportKeyPair operation. -func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *aws.Request, output *ImportKeyPairOutput) { - op := &aws.Operation{ +func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { + op := &request.Operation{ Name: opImportKeyPair, HTTPMethod: "POST", HTTPPath: "/", @@ -4954,8 +4984,8 @@ func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, er const opImportSnapshot = "ImportSnapshot" // ImportSnapshotRequest generates a request for the ImportSnapshot operation. -func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *aws.Request, output *ImportSnapshotOutput) { - op := &aws.Operation{ +func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Request, output *ImportSnapshotOutput) { + op := &request.Operation{ Name: opImportSnapshot, HTTPMethod: "POST", HTTPPath: "/", @@ -4981,8 +5011,8 @@ func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, const opImportVolume = "ImportVolume" // ImportVolumeRequest generates a request for the ImportVolume operation. -func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *aws.Request, output *ImportVolumeOutput) { - op := &aws.Operation{ +func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Request, output *ImportVolumeOutput) { + op := &request.Operation{ Name: opImportVolume, HTTPMethod: "POST", HTTPPath: "/", @@ -5013,8 +5043,8 @@ func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error const opModifyImageAttribute = "ModifyImageAttribute" // ModifyImageAttributeRequest generates a request for the ModifyImageAttribute operation. -func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *aws.Request, output *ModifyImageAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *request.Request, output *ModifyImageAttributeOutput) { + op := &request.Operation{ Name: opModifyImageAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5044,8 +5074,8 @@ func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyIma const opModifyInstanceAttribute = "ModifyInstanceAttribute" // ModifyInstanceAttributeRequest generates a request for the ModifyInstanceAttribute operation. -func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *aws.Request, output *ModifyInstanceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { + op := &request.Operation{ Name: opModifyInstanceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5076,8 +5106,8 @@ func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*Mod const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" // ModifyNetworkInterfaceAttributeRequest generates a request for the ModifyNetworkInterfaceAttribute operation. -func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *aws.Request, output *ModifyNetworkInterfaceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *request.Request, output *ModifyNetworkInterfaceAttributeOutput) { + op := &request.Operation{ Name: opModifyNetworkInterfaceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5104,8 +5134,8 @@ func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttri const opModifyReservedInstances = "ModifyReservedInstances" // ModifyReservedInstancesRequest generates a request for the ModifyReservedInstances operation. -func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *aws.Request, output *ModifyReservedInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *request.Request, output *ModifyReservedInstancesOutput) { + op := &request.Operation{ Name: opModifyReservedInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -5137,8 +5167,8 @@ func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*Mod const opModifySnapshotAttribute = "ModifySnapshotAttribute" // ModifySnapshotAttributeRequest generates a request for the ModifySnapshotAttribute operation. -func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *aws.Request, output *ModifySnapshotAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *request.Request, output *ModifySnapshotAttributeOutput) { + op := &request.Operation{ Name: opModifySnapshotAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5171,11 +5201,57 @@ func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*Mod return out, err } +const opModifySpotFleetRequest = "ModifySpotFleetRequest" + +// ModifySpotFleetRequestRequest generates a request for the ModifySpotFleetRequest operation. +func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) (req *request.Request, output *ModifySpotFleetRequestOutput) { + op := &request.Operation{ + Name: opModifySpotFleetRequest, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifySpotFleetRequestInput{} + } + + req = c.newRequest(op, input, output) + output = &ModifySpotFleetRequestOutput{} + req.Data = output + return +} + +// Modifies the specified Spot fleet request. +// +// While the Spot fleet request is being modified, it is in the modifying state. +// +// To scale up your Spot fleet, increase its target capacity. The Spot fleet +// launches the additional Spot instances according to the allocation strategy +// for the Spot fleet request. If the allocation strategy is lowestPrice, the +// Spot fleet launches instances using the Spot pool with the lowest price. +// If the allocation strategy is diversified, the Spot fleet distributes the +// instances across the Spot pools. +// +// To scale down your Spot fleet, decrease its target capacity. First, the +// Spot fleet cancels any open bids that exceed the new target capacity. You +// can request that the Spot fleet terminate Spot instances until the size of +// the fleet no longer exceeds the new target capacity. If the allocation strategy +// is lowestPrice, the Spot fleet terminates the instances with the highest +// price per unit. If the allocation strategy is diversified, the Spot fleet +// terminates instances across the Spot pools. Alternatively, you can request +// that the Spot fleet keep the fleet at its current size, but not replace any +// Spot instances that are interrupted or that you terminate manually. +func (c *EC2) ModifySpotFleetRequest(input *ModifySpotFleetRequestInput) (*ModifySpotFleetRequestOutput, error) { + req, out := c.ModifySpotFleetRequestRequest(input) + err := req.Send() + return out, err +} + const opModifySubnetAttribute = "ModifySubnetAttribute" // ModifySubnetAttributeRequest generates a request for the ModifySubnetAttribute operation. -func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *aws.Request, output *ModifySubnetAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *request.Request, output *ModifySubnetAttributeOutput) { + op := &request.Operation{ Name: opModifySubnetAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5198,67 +5274,11 @@ func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifyS return out, err } -const opModifyVPCAttribute = "ModifyVpcAttribute" - -// ModifyVPCAttributeRequest generates a request for the ModifyVPCAttribute operation. -func (c *EC2) ModifyVPCAttributeRequest(input *ModifyVPCAttributeInput) (req *aws.Request, output *ModifyVPCAttributeOutput) { - op := &aws.Operation{ - Name: opModifyVPCAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVPCAttributeInput{} - } - - req = c.newRequest(op, input, output) - output = &ModifyVPCAttributeOutput{} - req.Data = output - return -} - -// Modifies the specified attribute of the specified VPC. -func (c *EC2) ModifyVPCAttribute(input *ModifyVPCAttributeInput) (*ModifyVPCAttributeOutput, error) { - req, out := c.ModifyVPCAttributeRequest(input) - err := req.Send() - return out, err -} - -const opModifyVPCEndpoint = "ModifyVpcEndpoint" - -// ModifyVPCEndpointRequest generates a request for the ModifyVPCEndpoint operation. -func (c *EC2) ModifyVPCEndpointRequest(input *ModifyVPCEndpointInput) (req *aws.Request, output *ModifyVPCEndpointOutput) { - op := &aws.Operation{ - Name: opModifyVPCEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVPCEndpointInput{} - } - - req = c.newRequest(op, 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 -} - const opModifyVolumeAttribute = "ModifyVolumeAttribute" // ModifyVolumeAttributeRequest generates a request for the ModifyVolumeAttribute operation. -func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *aws.Request, output *ModifyVolumeAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *request.Request, output *ModifyVolumeAttributeOutput) { + op := &request.Operation{ Name: opModifyVolumeAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5290,11 +5310,67 @@ func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyV return out, err } +const opModifyVpcAttribute = "ModifyVpcAttribute" + +// ModifyVpcAttributeRequest generates a request for the ModifyVpcAttribute operation. +func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *request.Request, output *ModifyVpcAttributeOutput) { + op := &request.Operation{ + Name: opModifyVpcAttribute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyVpcAttributeInput{} + } + + req = c.newRequest(op, input, output) + output = &ModifyVpcAttributeOutput{} + req.Data = output + return +} + +// Modifies the specified attribute of the specified VPC. +func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { + req, out := c.ModifyVpcAttributeRequest(input) + err := req.Send() + return out, err +} + +const opModifyVpcEndpoint = "ModifyVpcEndpoint" + +// ModifyVpcEndpointRequest generates a request for the ModifyVpcEndpoint operation. +func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *request.Request, output *ModifyVpcEndpointOutput) { + op := &request.Operation{ + Name: opModifyVpcEndpoint, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyVpcEndpointInput{} + } + + req = c.newRequest(op, 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 +} + const opMonitorInstances = "MonitorInstances" // MonitorInstancesRequest generates a request for the MonitorInstances operation. -func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *aws.Request, output *MonitorInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *request.Request, output *MonitorInstancesOutput) { + op := &request.Operation{ Name: opMonitorInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -5319,22 +5395,22 @@ func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesO return out, err } -const opMoveAddressToVPC = "MoveAddressToVpc" +const opMoveAddressToVpc = "MoveAddressToVpc" -// MoveAddressToVPCRequest generates a request for the MoveAddressToVPC operation. -func (c *EC2) MoveAddressToVPCRequest(input *MoveAddressToVPCInput) (req *aws.Request, output *MoveAddressToVPCOutput) { - op := &aws.Operation{ - Name: opMoveAddressToVPC, +// MoveAddressToVpcRequest generates a request for the MoveAddressToVpc operation. +func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *request.Request, output *MoveAddressToVpcOutput) { + op := &request.Operation{ + Name: opMoveAddressToVpc, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &MoveAddressToVPCInput{} + input = &MoveAddressToVpcInput{} } req = c.newRequest(op, input, output) - output = &MoveAddressToVPCOutput{} + output = &MoveAddressToVpcOutput{} req.Data = output return } @@ -5346,8 +5422,8 @@ func (c *EC2) MoveAddressToVPCRequest(input *MoveAddressToVPCInput) (req *aws.Re // 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) +func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { + req, out := c.MoveAddressToVpcRequest(input) err := req.Send() return out, err } @@ -5355,8 +5431,8 @@ func (c *EC2) MoveAddressToVPC(input *MoveAddressToVPCInput) (*MoveAddressToVPCO const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" // PurchaseReservedInstancesOfferingRequest generates a request for the PurchaseReservedInstancesOffering operation. -func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *aws.Request, output *PurchaseReservedInstancesOfferingOutput) { - op := &aws.Operation{ +func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *request.Request, output *PurchaseReservedInstancesOfferingOutput) { + op := &request.Operation{ Name: opPurchaseReservedInstancesOffering, HTTPMethod: "POST", HTTPPath: "/", @@ -5393,8 +5469,8 @@ func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstances const opRebootInstances = "RebootInstances" // RebootInstancesRequest generates a request for the RebootInstances operation. -func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *aws.Request, output *RebootInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { + op := &request.Operation{ Name: opRebootInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -5430,8 +5506,8 @@ func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutp const opRegisterImage = "RegisterImage" // RegisterImageRequest generates a request for the RegisterImage operation. -func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *aws.Request, output *RegisterImageOutput) { - op := &aws.Operation{ +func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Request, output *RegisterImageOutput) { + op := &request.Operation{ Name: opRegisterImage, HTTPMethod: "POST", HTTPPath: "/", @@ -5448,23 +5524,32 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *aws.Request, } // Registers an AMI. When you're creating an AMI, this is the final step you -// must complete before you can launch an instance from the AMI. This step is -// required if you're creating an instance store-backed Linux or Windows AMI. -// For more information, see Creating an Instance Store-Backed Linux AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-instance-store.html) -// and Creating an Instance Store-Backed Windows AMI (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html) +// must complete before you can launch an instance from the AMI. For more information +// about creating AMIs, see Creating Your Own AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) // in the Amazon Elastic Compute Cloud User Guide. // // For Amazon EBS-backed instances, CreateImage creates and registers the AMI // in a single request, so you don't have to register the AMI yourself. // -// You can also use RegisterImage to create an Amazon EBS-backed AMI from a -// snapshot of a root device volume. For more information, see Launching an -// Instance from a Backup (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. Note that although you can -// create a Windows AMI from a snapshot, you can't launch an instance from the -// AMI - use the CreateImage command instead. +// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI +// from a snapshot of a root device volume. For more information, see Launching +// an Instance from a Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_LaunchingInstanceFromSnapshot.html) +// in the Amazon Elastic Compute Cloud User Guide. // -// If needed, you can deregister an AMI at any time. Any modifications you +// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE +// Linux Enterprise Server (SLES), use the EC2 billingProduct code associated +// with an AMI to verify subscription status for package updates. Creating an +// AMI from an EBS snapshot does not maintain this billing code, and subsequent +// instances launched from such an AMI will not be able to connect to package +// update infrastructure. +// +// Similarly, although you can create a Windows AMI from a snapshot, you can't +// successfully launch an instance from the AMI. +// +// To create Windows AMIs or to create AMIs for Linux operating systems that +// must retain AMI billing codes to work properly, see CreateImage. +// +// If needed, you can deregister an AMI at any time. Any modifications you // make to an AMI backed by an instance store volume invalidates its registration. // If you make changes to an image, deregister the previous image and register // the new image. @@ -5477,22 +5562,22 @@ func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, er return out, err } -const opRejectVPCPeeringConnection = "RejectVpcPeeringConnection" +const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" -// RejectVPCPeeringConnectionRequest generates a request for the RejectVPCPeeringConnection operation. -func (c *EC2) RejectVPCPeeringConnectionRequest(input *RejectVPCPeeringConnectionInput) (req *aws.Request, output *RejectVPCPeeringConnectionOutput) { - op := &aws.Operation{ - Name: opRejectVPCPeeringConnection, +// RejectVpcPeeringConnectionRequest generates a request for the RejectVpcPeeringConnection operation. +func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectionInput) (req *request.Request, output *RejectVpcPeeringConnectionOutput) { + op := &request.Operation{ + Name: opRejectVpcPeeringConnection, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RejectVPCPeeringConnectionInput{} + input = &RejectVpcPeeringConnectionInput{} } req = c.newRequest(op, input, output) - output = &RejectVPCPeeringConnectionOutput{} + output = &RejectVpcPeeringConnectionOutput{} req.Data = output return } @@ -5502,8 +5587,8 @@ 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) (*RejectVPCPeeringConnectionOutput, error) { - req, out := c.RejectVPCPeeringConnectionRequest(input) +func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { + req, out := c.RejectVpcPeeringConnectionRequest(input) err := req.Send() return out, err } @@ -5511,8 +5596,8 @@ func (c *EC2) RejectVPCPeeringConnection(input *RejectVPCPeeringConnectionInput) const opReleaseAddress = "ReleaseAddress" // ReleaseAddressRequest generates a request for the ReleaseAddress operation. -func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *aws.Request, output *ReleaseAddressOutput) { - op := &aws.Operation{ +func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Request, output *ReleaseAddressOutput) { + op := &request.Operation{ Name: opReleaseAddress, HTTPMethod: "POST", HTTPPath: "/", @@ -5549,22 +5634,22 @@ func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, return out, err } -const opReplaceNetworkACLAssociation = "ReplaceNetworkAclAssociation" +const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" -// ReplaceNetworkACLAssociationRequest generates a request for the ReplaceNetworkACLAssociation operation. -func (c *EC2) ReplaceNetworkACLAssociationRequest(input *ReplaceNetworkACLAssociationInput) (req *aws.Request, output *ReplaceNetworkACLAssociationOutput) { - op := &aws.Operation{ - Name: opReplaceNetworkACLAssociation, +// ReplaceNetworkAclAssociationRequest generates a request for the ReplaceNetworkAclAssociation operation. +func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssociationInput) (req *request.Request, output *ReplaceNetworkAclAssociationOutput) { + op := &request.Operation{ + Name: opReplaceNetworkAclAssociation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkACLAssociationInput{} + input = &ReplaceNetworkAclAssociationInput{} } req = c.newRequest(op, input, output) - output = &ReplaceNetworkACLAssociationOutput{} + output = &ReplaceNetworkAclAssociationOutput{} req.Data = output return } @@ -5573,28 +5658,28 @@ 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) (*ReplaceNetworkACLAssociationOutput, error) { - req, out := c.ReplaceNetworkACLAssociationRequest(input) +func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { + req, out := c.ReplaceNetworkAclAssociationRequest(input) err := req.Send() return out, err } -const opReplaceNetworkACLEntry = "ReplaceNetworkAclEntry" +const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" -// ReplaceNetworkACLEntryRequest generates a request for the ReplaceNetworkACLEntry operation. -func (c *EC2) ReplaceNetworkACLEntryRequest(input *ReplaceNetworkACLEntryInput) (req *aws.Request, output *ReplaceNetworkACLEntryOutput) { - op := &aws.Operation{ - Name: opReplaceNetworkACLEntry, +// ReplaceNetworkAclEntryRequest generates a request for the ReplaceNetworkAclEntry operation. +func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) (req *request.Request, output *ReplaceNetworkAclEntryOutput) { + op := &request.Operation{ + Name: opReplaceNetworkAclEntry, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkACLEntryInput{} + input = &ReplaceNetworkAclEntryInput{} } req = c.newRequest(op, input, output) - output = &ReplaceNetworkACLEntryOutput{} + output = &ReplaceNetworkAclEntryOutput{} req.Data = output return } @@ -5602,8 +5687,8 @@ 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) (*ReplaceNetworkACLEntryOutput, error) { - req, out := c.ReplaceNetworkACLEntryRequest(input) +func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { + req, out := c.ReplaceNetworkAclEntryRequest(input) err := req.Send() return out, err } @@ -5611,8 +5696,8 @@ func (c *EC2) ReplaceNetworkACLEntry(input *ReplaceNetworkACLEntryInput) (*Repla const opReplaceRoute = "ReplaceRoute" // ReplaceRouteRequest generates a request for the ReplaceRoute operation. -func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *aws.Request, output *ReplaceRouteOutput) { - op := &aws.Operation{ +func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Request, output *ReplaceRouteOutput) { + op := &request.Operation{ Name: opReplaceRoute, HTTPMethod: "POST", HTTPPath: "/", @@ -5643,8 +5728,8 @@ func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" // ReplaceRouteTableAssociationRequest generates a request for the ReplaceRouteTableAssociation operation. -func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *aws.Request, output *ReplaceRouteTableAssociationOutput) { - op := &aws.Operation{ +func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *request.Request, output *ReplaceRouteTableAssociationOutput) { + op := &request.Operation{ Name: opReplaceRouteTableAssociation, HTTPMethod: "POST", HTTPPath: "/", @@ -5678,8 +5763,8 @@ func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationIn const opReportInstanceStatus = "ReportInstanceStatus" // ReportInstanceStatusRequest generates a request for the ReportInstanceStatus operation. -func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *aws.Request, output *ReportInstanceStatusOutput) { - op := &aws.Operation{ +func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *request.Request, output *ReportInstanceStatusOutput) { + op := &request.Operation{ Name: opReportInstanceStatus, HTTPMethod: "POST", HTTPPath: "/", @@ -5711,8 +5796,8 @@ func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportIns const opRequestSpotFleet = "RequestSpotFleet" // RequestSpotFleetRequest generates a request for the RequestSpotFleet operation. -func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *aws.Request, output *RequestSpotFleetOutput) { - op := &aws.Operation{ +func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *request.Request, output *RequestSpotFleetOutput) { + op := &request.Operation{ Name: opRequestSpotFleet, HTTPMethod: "POST", HTTPPath: "/", @@ -5730,7 +5815,20 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *aws.Re // Creates a Spot fleet request. // -// For more information, see Spot Fleets (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet.html) +// You can submit a single request that includes multiple launch specifications +// that vary by instance type, AMI, Availability Zone, or subnet. +// +// By default, the Spot fleet requests Spot instances in the Spot pool where +// the price per unit is the lowest. Each launch specification can include its +// own instance weighting that reflects the value of the instance type to your +// application workload. +// +// Alternatively, you can specify that the Spot fleet distribute the target +// capacity across the Spot pools included in its launch specifications. By +// ensuring that the Spot instances in your Spot fleet are in different Spot +// pools, you can improve the availability of your fleet. +// +// For more information, see Spot Fleet Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { req, out := c.RequestSpotFleetRequest(input) @@ -5741,8 +5839,8 @@ func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetO const opRequestSpotInstances = "RequestSpotInstances" // RequestSpotInstancesRequest generates a request for the RequestSpotInstances operation. -func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *aws.Request, output *RequestSpotInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *request.Request, output *RequestSpotInstancesOutput) { + op := &request.Operation{ Name: opRequestSpotInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -5758,10 +5856,10 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req return } -// Creates a Spot Instance request. Spot Instances are instances that Amazon +// Creates a Spot instance request. Spot instances are instances that Amazon // EC2 launches when the bid price that you specify exceeds the current Spot -// Price. Amazon EC2 periodically sets the Spot Price based on available Spot -// Instance capacity and current Spot Instance requests. For more information, +// price. Amazon EC2 periodically sets the Spot price based on available Spot +// 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) (*RequestSpotInstancesOutput, error) { @@ -5773,8 +5871,8 @@ func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSp const opResetImageAttribute = "ResetImageAttribute" // ResetImageAttributeRequest generates a request for the ResetImageAttribute operation. -func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *aws.Request, output *ResetImageAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *request.Request, output *ResetImageAttributeOutput) { + op := &request.Operation{ Name: opResetImageAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5802,8 +5900,8 @@ func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageA const opResetInstanceAttribute = "ResetInstanceAttribute" // ResetInstanceAttributeRequest generates a request for the ResetInstanceAttribute operation. -func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *aws.Request, output *ResetInstanceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *request.Request, output *ResetInstanceAttributeOutput) { + op := &request.Operation{ Name: opResetInstanceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5837,8 +5935,8 @@ func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*Reset const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" // ResetNetworkInterfaceAttributeRequest generates a request for the ResetNetworkInterfaceAttribute operation. -func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *aws.Request, output *ResetNetworkInterfaceAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *request.Request, output *ResetNetworkInterfaceAttributeOutput) { + op := &request.Operation{ Name: opResetNetworkInterfaceAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5865,8 +5963,8 @@ func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttribu const opResetSnapshotAttribute = "ResetSnapshotAttribute" // ResetSnapshotAttributeRequest generates a request for the ResetSnapshotAttribute operation. -func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *aws.Request, output *ResetSnapshotAttributeOutput) { - op := &aws.Operation{ +func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *request.Request, output *ResetSnapshotAttributeOutput) { + op := &request.Operation{ Name: opResetSnapshotAttribute, HTTPMethod: "POST", HTTPPath: "/", @@ -5896,8 +5994,8 @@ func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*Reset const opRestoreAddressToClassic = "RestoreAddressToClassic" // RestoreAddressToClassicRequest generates a request for the RestoreAddressToClassic operation. -func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *aws.Request, output *RestoreAddressToClassicOutput) { - op := &aws.Operation{ +func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *request.Request, output *RestoreAddressToClassicOutput) { + op := &request.Operation{ Name: opRestoreAddressToClassic, HTTPMethod: "POST", HTTPPath: "/", @@ -5926,8 +6024,8 @@ func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*Res const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" // RevokeSecurityGroupEgressRequest generates a request for the RevokeSecurityGroupEgress operation. -func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *aws.Request, output *RevokeSecurityGroupEgressOutput) { - op := &aws.Operation{ +func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *request.Request, output *RevokeSecurityGroupEgressOutput) { + op := &request.Operation{ Name: opRevokeSecurityGroupEgress, HTTPMethod: "POST", HTTPPath: "/", @@ -5963,8 +6061,8 @@ func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) ( const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" // RevokeSecurityGroupIngressRequest generates a request for the RevokeSecurityGroupIngress operation. -func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *aws.Request, output *RevokeSecurityGroupIngressOutput) { - op := &aws.Operation{ +func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *request.Request, output *RevokeSecurityGroupIngressOutput) { + op := &request.Operation{ Name: opRevokeSecurityGroupIngress, HTTPMethod: "POST", HTTPPath: "/", @@ -6000,8 +6098,8 @@ func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) const opRunInstances = "RunInstances" // RunInstancesRequest generates a request for the RunInstances operation. -func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *aws.Request, output *Reservation) { - op := &aws.Operation{ +func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *Reservation) { + op := &request.Operation{ Name: opRunInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -6029,6 +6127,12 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *aws.Request, o // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) // in the Amazon Elastic Compute Cloud User Guide. // +// [EC2-VPC only accounts] If you don't specify a subnet in the request, we +// choose a default subnet from your default VPC for you. +// +// [EC2-Classic accounts] If you're launching into EC2-Classic and you don't +// specify an Availability Zone, we choose one for you. +// // Linux instances have access to the public key of the key pair at boot. You // can use this key to provide secure access to the instance. Amazon EC2 public // images use this feature to provide secure access without passwords. For more @@ -6059,8 +6163,8 @@ func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { const opStartInstances = "StartInstances" // StartInstancesRequest generates a request for the StartInstances operation. -func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *aws.Request, output *StartInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { + op := &request.Operation{ Name: opStartInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -6104,8 +6208,8 @@ func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, const opStopInstances = "StopInstances" // StopInstancesRequest generates a request for the StopInstances operation. -func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *aws.Request, output *StopInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { + op := &request.Operation{ Name: opStopInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -6161,8 +6265,8 @@ func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, er const opTerminateInstances = "TerminateInstances" // TerminateInstancesRequest generates a request for the TerminateInstances operation. -func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aws.Request, output *TerminateInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *request.Request, output *TerminateInstancesOutput) { + op := &request.Operation{ Name: opTerminateInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -6191,9 +6295,10 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *aw // instance store-backed instances. What happens to an instance differs if you // stop it or terminate it. For example, when you stop an instance, the root // device and any other devices attached to the instance persist. When you terminate -// an instance, the root device and any other devices attached during the instance -// launch are automatically deleted. For more information about the differences -// between stopping and terminating instances, see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) +// an instance, any attached EBS volumes with the DeleteOnTermination block +// device mapping parameter set to true are automatically deleted. For more +// information about the differences between stopping and terminating instances, +// see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) // in the Amazon Elastic Compute Cloud User Guide. // // For more information about troubleshooting, see Troubleshooting Terminating @@ -6205,29 +6310,29 @@ func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInst return out, err } -const opUnassignPrivateIPAddresses = "UnassignPrivateIpAddresses" +const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" -// UnassignPrivateIPAddressesRequest generates a request for the UnassignPrivateIPAddresses operation. -func (c *EC2) UnassignPrivateIPAddressesRequest(input *UnassignPrivateIPAddressesInput) (req *aws.Request, output *UnassignPrivateIPAddressesOutput) { - op := &aws.Operation{ - Name: opUnassignPrivateIPAddresses, +// UnassignPrivateIpAddressesRequest generates a request for the UnassignPrivateIpAddresses operation. +func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddressesInput) (req *request.Request, output *UnassignPrivateIpAddressesOutput) { + op := &request.Operation{ + Name: opUnassignPrivateIpAddresses, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UnassignPrivateIPAddressesInput{} + input = &UnassignPrivateIpAddressesInput{} } req = c.newRequest(op, input, output) - output = &UnassignPrivateIPAddressesOutput{} + output = &UnassignPrivateIpAddressesOutput{} req.Data = output return } // Unassigns one or more secondary private IP addresses from a network interface. -func (c *EC2) UnassignPrivateIPAddresses(input *UnassignPrivateIPAddressesInput) (*UnassignPrivateIPAddressesOutput, error) { - req, out := c.UnassignPrivateIPAddressesRequest(input) +func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { + req, out := c.UnassignPrivateIpAddressesRequest(input) err := req.Send() return out, err } @@ -6235,8 +6340,8 @@ func (c *EC2) UnassignPrivateIPAddresses(input *UnassignPrivateIPAddressesInput) const opUnmonitorInstances = "UnmonitorInstances" // UnmonitorInstancesRequest generates a request for the UnmonitorInstances operation. -func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *aws.Request, output *UnmonitorInstancesOutput) { - op := &aws.Operation{ +func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *request.Request, output *UnmonitorInstancesOutput) { + op := &request.Operation{ Name: opUnmonitorInstances, HTTPMethod: "POST", HTTPPath: "/", @@ -6261,7 +6366,7 @@ func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInst return out, err } -type AcceptVPCPeeringConnectionInput struct { +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, @@ -6269,43 +6374,43 @@ type AcceptVPCPeeringConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` - metadataAcceptVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataAcceptVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataAcceptVPCPeeringConnectionInput struct { +type metadataAcceptVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AcceptVPCPeeringConnectionInput) String() string { +func (s AcceptVpcPeeringConnectionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVPCPeeringConnectionInput) GoString() string { +func (s AcceptVpcPeeringConnectionInput) GoString() string { return s.String() } -type AcceptVPCPeeringConnectionOutput struct { +type AcceptVpcPeeringConnectionOutput struct { // Information about the VPC peering connection. - VPCPeeringConnection *VPCPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` - metadataAcceptVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataAcceptVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataAcceptVPCPeeringConnectionOutput struct { +type metadataAcceptVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AcceptVPCPeeringConnectionOutput) String() string { +func (s AcceptVpcPeeringConnectionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVPCPeeringConnectionOutput) GoString() string { +func (s AcceptVpcPeeringConnectionOutput) GoString() string { return s.String() } @@ -6359,13 +6464,13 @@ func (s AccountAttributeValue) GoString() string { // Describes a running instance in a Spot fleet. type ActiveInstance struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + 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"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` metadataActiveInstance `json:"-" xml:"-"` } @@ -6387,30 +6492,30 @@ func (s ActiveInstance) GoString() string { // Describes an Elastic IP address. type Address struct { // The ID representing the allocation of the address for use with EC2-VPC. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The ID representing the association of the address with an instance in a // VPC. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` // Indicates whether this Elastic IP address is for use with instances in EC2-Classic // (standard) or instances in a VPC (vpc). Domain *string `locationName:"domain" type:"string" enum:"DomainType"` // The ID of the instance that the address is associated with (if any). - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the AWS account that owns the network interface. - NetworkInterfaceOwnerID *string `locationName:"networkInterfaceOwnerId" type:"string"` + NetworkInterfaceOwnerId *string `locationName:"networkInterfaceOwnerId" type:"string"` // The private IP address associated with the Elastic IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataAddress `json:"-" xml:"-"` } @@ -6461,14 +6566,14 @@ func (s AllocateAddressInput) GoString() string { type AllocateAddressOutput struct { // [EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic // IP address for use with instances in a VPC. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // Indicates whether this Elastic IP address is for use with instances in EC2-Classic // (standard) or instances in a VPC (vpc). Domain *string `locationName:"domain" type:"string" enum:"DomainType"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataAllocateAddressOutput `json:"-" xml:"-"` } @@ -6487,13 +6592,13 @@ func (s AllocateAddressOutput) GoString() string { return s.String() } -type AssignPrivateIPAddressesInput struct { +type AssignPrivateIpAddressesInput struct { // Indicates whether to allow an IP address that is already assigned to another // network interface or instance to be reassigned to the specified network interface. AllowReassignment *bool `locationName:"allowReassignment" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // One or more IP addresses to be assigned as a secondary private IP address // to the network interface. You can't specify this parameter when also specifying @@ -6501,50 +6606,50 @@ type AssignPrivateIPAddressesInput struct { // // If you don't specify an IP address, Amazon EC2 automatically selects an // IP address within the subnet range. - PrivateIPAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` + PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` // The number of secondary IP addresses to assign to the network interface. // You can't specify this parameter when also specifying private IP addresses. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - metadataAssignPrivateIPAddressesInput `json:"-" xml:"-"` + metadataAssignPrivateIpAddressesInput `json:"-" xml:"-"` } -type metadataAssignPrivateIPAddressesInput struct { +type metadataAssignPrivateIpAddressesInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AssignPrivateIPAddressesInput) String() string { +func (s AssignPrivateIpAddressesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignPrivateIPAddressesInput) GoString() string { +func (s AssignPrivateIpAddressesInput) GoString() string { return s.String() } -type AssignPrivateIPAddressesOutput struct { - metadataAssignPrivateIPAddressesOutput `json:"-" xml:"-"` +type AssignPrivateIpAddressesOutput struct { + metadataAssignPrivateIpAddressesOutput `json:"-" xml:"-"` } -type metadataAssignPrivateIPAddressesOutput struct { +type metadataAssignPrivateIpAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AssignPrivateIPAddressesOutput) String() string { +func (s AssignPrivateIpAddressesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignPrivateIPAddressesOutput) GoString() string { +func (s AssignPrivateIpAddressesOutput) GoString() string { return s.String() } type AssociateAddressInput struct { // [EC2-VPC] The allocation ID. This is required for EC2-VPC. - AllocationID *string `locationName:"AllocationId" type:"string"` + AllocationId *string `type:"string"` // [EC2-VPC] Allows an Elastic IP address that is already associated with an // instance or network interface to be re-associated with the specified instance @@ -6563,19 +6668,19 @@ type AssociateAddressInput struct { // can specify either the instance ID or the network interface ID, but not both. // The operation fails if you specify an instance ID unless exactly one network // interface is attached. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` // [EC2-VPC] The ID of the network interface. If the instance has more than // one network interface, you must specify a network interface ID. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // [EC2-VPC] The primary or secondary private IP address to associate with the // Elastic IP address. If no private IP address is specified, the Elastic IP // address is associated with the primary private IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The Elastic IP address. This is required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataAssociateAddressInput `json:"-" xml:"-"` } @@ -6597,7 +6702,7 @@ func (s AssociateAddressInput) GoString() string { type AssociateAddressOutput struct { // [EC2-VPC] The ID that represents the association of the Elastic IP address // with an instance. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` metadataAssociateAddressOutput `json:"-" xml:"-"` } @@ -6616,10 +6721,10 @@ func (s AssociateAddressOutput) GoString() string { return s.String() } -type AssociateDHCPOptionsInput struct { +type AssociateDhcpOptionsInput struct { // The ID of the DHCP options set, or default to associate no DHCP options with // the VPC. - DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + DhcpOptionsId *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 @@ -6628,40 +6733,40 @@ type AssociateDHCPOptionsInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` - metadataAssociateDHCPOptionsInput `json:"-" xml:"-"` + metadataAssociateDhcpOptionsInput `json:"-" xml:"-"` } -type metadataAssociateDHCPOptionsInput struct { +type metadataAssociateDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AssociateDHCPOptionsInput) String() string { +func (s AssociateDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateDHCPOptionsInput) GoString() string { +func (s AssociateDhcpOptionsInput) GoString() string { return s.String() } -type AssociateDHCPOptionsOutput struct { - metadataAssociateDHCPOptionsOutput `json:"-" xml:"-"` +type AssociateDhcpOptionsOutput struct { + metadataAssociateDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataAssociateDHCPOptionsOutput struct { +type metadataAssociateDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AssociateDHCPOptionsOutput) String() string { +func (s AssociateDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateDHCPOptionsOutput) GoString() string { +func (s AssociateDhcpOptionsOutput) GoString() string { return s.String() } @@ -6673,10 +6778,10 @@ type AssociateRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataAssociateRouteTableInput `json:"-" xml:"-"` } @@ -6697,7 +6802,7 @@ func (s AssociateRouteTableInput) GoString() string { type AssociateRouteTableOutput struct { // The route table association ID (needed to disassociate the route table). - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` metadataAssociateRouteTableOutput `json:"-" xml:"-"` } @@ -6716,7 +6821,7 @@ func (s AssociateRouteTableOutput) GoString() string { return s.String() } -type AttachClassicLinkVPCInput 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, @@ -6728,46 +6833,46 @@ type AttachClassicLinkVPCInput struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"groupId" type:"list" required:"true"` // The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The ID of a ClassicLink-enabled VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataAttachClassicLinkVPCInput `json:"-" xml:"-"` + metadataAttachClassicLinkVpcInput `json:"-" xml:"-"` } -type metadataAttachClassicLinkVPCInput struct { +type metadataAttachClassicLinkVpcInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AttachClassicLinkVPCInput) String() string { +func (s AttachClassicLinkVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachClassicLinkVPCInput) GoString() string { +func (s AttachClassicLinkVpcInput) GoString() string { return s.String() } -type AttachClassicLinkVPCOutput struct { +type AttachClassicLinkVpcOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataAttachClassicLinkVPCOutput `json:"-" xml:"-"` + metadataAttachClassicLinkVpcOutput `json:"-" xml:"-"` } -type metadataAttachClassicLinkVPCOutput struct { +type metadataAttachClassicLinkVpcOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s AttachClassicLinkVPCOutput) String() string { +func (s AttachClassicLinkVpcOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachClassicLinkVPCOutput) GoString() string { +func (s AttachClassicLinkVpcOutput) GoString() string { return s.String() } @@ -6779,10 +6884,10 @@ type AttachInternetGatewayInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` metadataAttachInternetGatewayInput `json:"-" xml:"-"` } @@ -6830,10 +6935,10 @@ type AttachNetworkInterfaceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataAttachNetworkInterfaceInput `json:"-" xml:"-"` } @@ -6854,7 +6959,7 @@ func (s AttachNetworkInterfaceInput) GoString() string { type AttachNetworkInterfaceOutput struct { // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` metadataAttachNetworkInterfaceOutput `json:"-" xml:"-"` } @@ -6873,57 +6978,6 @@ func (s AttachNetworkInterfaceOutput) GoString() string { return s.String() } -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. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` - - metadataAttachVPNGatewayInput `json:"-" xml:"-"` -} - -type metadataAttachVPNGatewayInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s AttachVPNGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVPNGatewayInput) GoString() string { - return s.String() -} - -type AttachVPNGatewayOutput struct { - // Information about the attachment. - VPCAttachment *VPCAttachment `locationName:"attachment" type:"structure"` - - metadataAttachVPNGatewayOutput `json:"-" xml:"-"` -} - -type metadataAttachVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s AttachVPNGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVPNGatewayOutput) GoString() string { - return s.String() -} - type AttachVolumeInput struct { // The device name to expose to the instance (for example, /dev/sdh or xvdh). Device *string `type:"string" required:"true"` @@ -6935,11 +6989,11 @@ type AttachVolumeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` // 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"` + VolumeId *string `type:"string" required:"true"` metadataAttachVolumeInput `json:"-" xml:"-"` } @@ -6958,6 +7012,57 @@ func (s AttachVolumeInput) GoString() string { return s.String() } +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. + VpcId *string `type:"string" required:"true"` + + // The ID of the virtual private gateway. + VpnGatewayId *string `type:"string" required:"true"` + + metadataAttachVpnGatewayInput `json:"-" xml:"-"` +} + +type metadataAttachVpnGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AttachVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachVpnGatewayInput) GoString() string { + return s.String() +} + +type AttachVpnGatewayOutput struct { + // Information about the attachment. + VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` + + metadataAttachVpnGatewayOutput `json:"-" xml:"-"` +} + +type metadataAttachVpnGatewayOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s AttachVpnGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttachVpnGatewayOutput) GoString() string { + return s.String() +} + // The value to use when a resource attribute accepts a Boolean value. type AttributeBooleanValue struct { // Valid values are true or false. @@ -7005,7 +7110,7 @@ func (s AttributeValue) GoString() string { type AuthorizeSecurityGroupEgressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"cidrIp" type:"string"` + 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 @@ -7018,15 +7123,15 @@ type AuthorizeSecurityGroupEgressInput struct { FromPort *int64 `locationName:"fromPort" type:"integer"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string" required:"true"` + GroupId *string `locationName:"groupId" type:"string" required:"true"` // A set of IP permissions. You can't specify a destination security group and // a CIDR IP address range. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` + IpProtocol *string `locationName:"ipProtocol" type:"string"` // The name of a destination security group. To authorize outbound access to // a destination security group, we recommend that you use a set of IP permissions @@ -7036,7 +7141,7 @@ type AuthorizeSecurityGroupEgressInput struct { // The AWS account number for a destination security group. To authorize outbound // access to a destination security group, we recommend that you use a set of // IP permissions instead. - SourceSecurityGroupOwnerID *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -7080,7 +7185,7 @@ func (s AuthorizeSecurityGroupEgressOutput) GoString() string { type AuthorizeSecurityGroupIngressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"CidrIp" type:"string"` + CidrIp *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 @@ -7093,18 +7198,18 @@ type AuthorizeSecurityGroupIngressInput struct { FromPort *int64 `type:"integer"` // The ID of the security group. Required for a nondefault VPC. - GroupID *string `locationName:"GroupId" type:"string"` + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. GroupName *string `type:"string"` // A set of IP permissions. Can be used to specify multiple rules in a single // command. - IPPermissions []*IPPermission `locationName:"IpPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // (VPC only) Use -1 to specify all. - IPProtocol *string `locationName:"IpProtocol" type:"string"` + IpProtocol *string `type:"string"` // [EC2-Classic, default VPC] The name of the source security group. You can't // specify this parameter in combination with the following parameters: the @@ -7120,7 +7225,7 @@ type AuthorizeSecurityGroupIngressInput struct { // and the end of the port range. Creates rules that grant full ICMP, UDP, and // TCP access. To create a rule with a specific IP protocol and port range, // use a set of IP permissions instead. - SourceSecurityGroupOwnerID *string `locationName:"SourceSecurityGroupOwnerId" type:"string"` + SourceSecurityGroupOwnerId *string `type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -7169,7 +7274,7 @@ type AvailabilityZone struct { // The name of the region. RegionName *string `locationName:"regionName" type:"string"` - // The state of the Availability Zone (available | impaired | unavailable). + // The state of the Availability Zone. State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` // The name of the Availability Zone. @@ -7241,7 +7346,7 @@ type BlockDeviceMapping struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSBlockDevice `locationName:"ebs" type:"structure"` + Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` // Suppresses the specified device included in the block device mapping of the // AMI. @@ -7290,7 +7395,7 @@ type BundleInstanceInput struct { // Default: None // // Required: Yes - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` // The bucket in which to store the AMI. You can specify a bucket that you already // own or a new bucket that Amazon EC2 creates on your behalf. If you specify @@ -7338,13 +7443,13 @@ func (s BundleInstanceOutput) GoString() string { // Describes a bundle task. type BundleTask struct { // The ID of the bundle task. - BundleID *string `locationName:"bundleId" type:"string"` + BundleId *string `locationName:"bundleId" type:"string"` // If the task fails, a description of the error. BundleTaskError *BundleTaskError `locationName:"error" type:"structure"` // The ID of the instance associated with this bundle task. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The level of task completion, as a percent (for example, 20%). Progress *string `locationName:"progress" type:"string"` @@ -7405,7 +7510,7 @@ func (s BundleTaskError) GoString() string { type CancelBundleTaskInput struct { // The ID of the bundle task. - BundleID *string `locationName:"BundleId" type:"string" required:"true"` + BundleId *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 @@ -7453,7 +7558,7 @@ func (s CancelBundleTaskOutput) GoString() string { type CancelConversionTaskInput struct { // The ID of the conversion task. - ConversionTaskID *string `locationName:"conversionTaskId" type:"string" required:"true"` + 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 @@ -7501,7 +7606,7 @@ func (s CancelConversionTaskOutput) GoString() string { type CancelExportTaskInput struct { // The ID of the export task. This is the ID returned by CreateInstanceExportTask. - ExportTaskID *string `locationName:"exportTaskId" type:"string" required:"true"` + ExportTaskId *string `locationName:"exportTaskId" type:"string" required:"true"` metadataCancelExportTaskInput `json:"-" xml:"-"` } @@ -7549,7 +7654,7 @@ type CancelImportTaskInput struct { DryRun *bool `type:"boolean"` // The ID of the import image or import snapshot task to be canceled. - ImportTaskID *string `locationName:"ImportTaskId" type:"string"` + ImportTaskId *string `type:"string"` metadataCancelImportTaskInput `json:"-" xml:"-"` } @@ -7570,7 +7675,7 @@ func (s CancelImportTaskInput) GoString() string { type CancelImportTaskOutput struct { // The ID of the task being canceled. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The current state of the task being canceled. PreviousState *string `locationName:"previousState" type:"string"` @@ -7597,7 +7702,7 @@ func (s CancelImportTaskOutput) GoString() string { type CancelReservedInstancesListingInput struct { // The ID of the Reserved Instance listing. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` metadataCancelReservedInstancesListingInput `json:"-" xml:"-"` } @@ -7668,7 +7773,7 @@ type CancelSpotFleetRequestsErrorItem struct { Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataCancelSpotFleetRequestsErrorItem `json:"-" xml:"-"` } @@ -7696,7 +7801,7 @@ type CancelSpotFleetRequestsInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The IDs of the Spot fleet requests. - SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` + 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. @@ -7753,7 +7858,7 @@ type CancelSpotFleetRequestsSuccessItem struct { PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataCancelSpotFleetRequestsSuccessItem `json:"-" xml:"-"` } @@ -7780,8 +7885,8 @@ type CancelSpotInstanceRequestsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more Spot Instance request IDs. - SpotInstanceRequestIDs []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` + // One or more Spot instance request IDs. + SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` metadataCancelSpotInstanceRequestsInput `json:"-" xml:"-"` } @@ -7802,7 +7907,7 @@ func (s CancelSpotInstanceRequestsInput) GoString() string { // Contains the output of CancelSpotInstanceRequests. type CancelSpotInstanceRequestsOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataCancelSpotInstanceRequestsOutput `json:"-" xml:"-"` @@ -7822,12 +7927,12 @@ func (s CancelSpotInstanceRequestsOutput) GoString() string { return s.String() } -// Describes a request to cancel a Spot Instance. +// Describes a request to cancel a Spot instance. type CancelledSpotInstanceRequest struct { - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - // The state of the Spot Instance request. + // The state of the Spot instance request. State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` metadataCancelledSpotInstanceRequest `json:"-" xml:"-"` @@ -7853,13 +7958,13 @@ type ClassicLinkInstance struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Any tags assigned to the instance. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataClassicLinkInstance `json:"-" xml:"-"` } @@ -7917,7 +8022,7 @@ type ConfirmProductInstanceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` // The product code. This must be a product code that you own. ProductCode *string `type:"string" required:"true"` @@ -7942,7 +8047,7 @@ func (s ConfirmProductInstanceInput) GoString() string { type ConfirmProductInstanceOutput struct { // The AWS account ID of the instance owner. This is only present if the product // code is attached to the instance. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The return value of the request. Returns true if the specified product code // is owned by the requester and associated with the specified instance. @@ -7968,7 +8073,7 @@ func (s ConfirmProductInstanceOutput) GoString() string { // Describes a conversion task. type ConversionTask struct { // The ID of the conversion task. - ConversionTaskID *string `locationName:"conversionTaskId" type:"string" required:"true"` + ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` // The time when the task expires. If the upload isn't complete before the expiration // time, we automatically cancel the task. @@ -8027,7 +8132,7 @@ type CopyImageInput struct { Name *string `type:"string" required:"true"` // The ID of the AMI to copy. - SourceImageID *string `locationName:"SourceImageId" type:"string" required:"true"` + SourceImageId *string `type:"string" required:"true"` // The name of the region that contains the AMI to copy. SourceRegion *string `type:"string" required:"true"` @@ -8051,7 +8156,7 @@ func (s CopyImageInput) GoString() string { type CopyImageOutput struct { // The ID of the new AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataCopyImageOutput `json:"-" xml:"-"` } @@ -8107,7 +8212,7 @@ type CopySnapshotInput struct { // and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. // The specified CMK must exist in the region that the snapshot is being copied // to. If a KmsKeyId is specified, the Encrypted flag must also be set. - KMSKeyID *string `locationName:"kmsKeyId" type:"string"` + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` // The pre-signed URL that facilitates copying an encrypted snapshot. This parameter // is only required when copying an encrypted snapshot with the Amazon EC2 Query @@ -8121,13 +8226,13 @@ type CopySnapshotInput struct { // 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. - PresignedURL *string `locationName:"presignedUrl" type:"string"` + PresignedUrl *string `locationName:"presignedUrl" type:"string"` // The ID of the region that contains the snapshot to be copied. SourceRegion *string `type:"string" required:"true"` // The ID of the EBS snapshot to copy. - SourceSnapshotID *string `locationName:"SourceSnapshotId" type:"string" required:"true"` + SourceSnapshotId *string `type:"string" required:"true"` metadataCopySnapshotInput `json:"-" xml:"-"` } @@ -8148,7 +8253,7 @@ func (s CopySnapshotInput) GoString() string { type CopySnapshotOutput struct { // The ID of the new snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` metadataCopySnapshotOutput `json:"-" xml:"-"` } @@ -8171,7 +8276,7 @@ type CreateCustomerGatewayInput struct { // For devices that support BGP, the customer gateway's BGP ASN. // // Default: 65000 - BGPASN *int64 `locationName:"BgpAsn" type:"integer" required:"true"` + BgpAsn *int64 `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 @@ -8181,7 +8286,7 @@ type CreateCustomerGatewayInput struct { // The Internet-routable IP address for the customer gateway's outside interface. // The address must be static. - PublicIP *string `locationName:"IpAddress" type:"string" required:"true"` + PublicIp *string `locationName:"IpAddress" type:"string" required:"true"` // The type of VPN connection that this customer gateway supports (ipsec.1). Type *string `type:"string" required:"true" enum:"GatewayType"` @@ -8224,9 +8329,9 @@ func (s CreateCustomerGatewayOutput) GoString() string { return s.String() } -type CreateDHCPOptionsInput struct { +type CreateDhcpOptionsInput struct { // A DHCP configuration option. - DHCPConfigurations []*NewDHCPConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` + 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 @@ -8234,41 +8339,41 @@ type CreateDHCPOptionsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - metadataCreateDHCPOptionsInput `json:"-" xml:"-"` + metadataCreateDhcpOptionsInput `json:"-" xml:"-"` } -type metadataCreateDHCPOptionsInput struct { +type metadataCreateDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateDHCPOptionsInput) String() string { +func (s CreateDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDHCPOptionsInput) GoString() string { +func (s CreateDhcpOptionsInput) GoString() string { return s.String() } -type CreateDHCPOptionsOutput struct { +type CreateDhcpOptionsOutput struct { // A set of DHCP options. - DHCPOptions *DHCPOptions `locationName:"dhcpOptions" type:"structure"` + DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` - metadataCreateDHCPOptionsOutput `json:"-" xml:"-"` + metadataCreateDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataCreateDHCPOptionsOutput struct { +type metadataCreateDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateDHCPOptionsOutput) String() string { +func (s CreateDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDHCPOptionsOutput) GoString() string { +func (s CreateDhcpOptionsOutput) GoString() string { return s.String() } @@ -8279,13 +8384,13 @@ type CreateFlowLogsInput struct { // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs // log group. - DeliverLogsPermissionARN *string `locationName:"DeliverLogsPermissionArn" type:"string" required:"true"` + DeliverLogsPermissionArn *string `type:"string" required:"true"` // The name of the CloudWatch log group. LogGroupName *string `type:"string" required:"true"` // One or more subnet, network interface, or VPC IDs. - ResourceIDs []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` + ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` // The type of resource on which to create the flow log. ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` @@ -8316,7 +8421,7 @@ type CreateFlowLogsOutput struct { ClientToken *string `locationName:"clientToken" type:"string"` // The IDs of the flow logs. - FlowLogIDs []*string `locationName:"flowLogIdSet" locationNameList:"item" type:"list"` + FlowLogIds []*string `locationName:"flowLogIdSet" locationNameList:"item" type:"list"` // Information about the flow logs that could not be created successfully. Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` @@ -8352,7 +8457,7 @@ type CreateImageInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // A name for the new image. // @@ -8387,7 +8492,7 @@ func (s CreateImageInput) GoString() string { type CreateImageOutput struct { // The ID of the new AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataCreateImageOutput `json:"-" xml:"-"` } @@ -8415,7 +8520,7 @@ type CreateInstanceExportTaskInput struct { ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The target virtualization environment. TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` @@ -8560,9 +8665,9 @@ func (s CreateKeyPairOutput) GoString() string { return s.String() } -type CreateNetworkACLEntryInput struct { +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"` + 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 @@ -8576,10 +8681,10 @@ type CreateNetworkACLEntryInput struct { // ICMP protocol: The ICMP type and code. Required if specifying ICMP for the // protocol. - ICMPTypeCode *ICMPTypeCode `locationName:"Icmp" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // TCP or UDP protocols: The range of ports the rule applies to. PortRange *PortRange `locationName:"portRange" type:"structure"` @@ -8596,42 +8701,42 @@ type CreateNetworkACLEntryInput struct { // Constraints: Positive integer from 1 to 32766 RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataCreateNetworkACLEntryInput `json:"-" xml:"-"` + metadataCreateNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataCreateNetworkACLEntryInput struct { +type metadataCreateNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateNetworkACLEntryInput) String() string { +func (s CreateNetworkAclEntryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkACLEntryInput) GoString() string { +func (s CreateNetworkAclEntryInput) GoString() string { return s.String() } -type CreateNetworkACLEntryOutput struct { - metadataCreateNetworkACLEntryOutput `json:"-" xml:"-"` +type CreateNetworkAclEntryOutput struct { + metadataCreateNetworkAclEntryOutput `json:"-" xml:"-"` } -type metadataCreateNetworkACLEntryOutput struct { +type metadataCreateNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateNetworkACLEntryOutput) String() string { +func (s CreateNetworkAclEntryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkACLEntryOutput) GoString() string { +func (s CreateNetworkAclEntryOutput) GoString() string { return s.String() } -type CreateNetworkACLInput 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, @@ -8639,43 +8744,43 @@ type CreateNetworkACLInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataCreateNetworkACLInput `json:"-" xml:"-"` + metadataCreateNetworkAclInput `json:"-" xml:"-"` } -type metadataCreateNetworkACLInput struct { +type metadataCreateNetworkAclInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateNetworkACLInput) String() string { +func (s CreateNetworkAclInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkACLInput) GoString() string { +func (s CreateNetworkAclInput) GoString() string { return s.String() } -type CreateNetworkACLOutput struct { +type CreateNetworkAclOutput struct { // Information about the network ACL. - NetworkACL *NetworkACL `locationName:"networkAcl" type:"structure"` + NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` - metadataCreateNetworkACLOutput `json:"-" xml:"-"` + metadataCreateNetworkAclOutput `json:"-" xml:"-"` } -type metadataCreateNetworkACLOutput struct { +type metadataCreateNetworkAclOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s CreateNetworkACLOutput) String() string { +func (s CreateNetworkAclOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkACLOutput) GoString() string { +func (s CreateNetworkAclOutput) GoString() string { return s.String() } @@ -8696,10 +8801,10 @@ type CreateNetworkInterfaceInput struct { // an IP address, Amazon EC2 selects one for you from the subnet range. If you // specify an IP address, you cannot indicate any IP addresses specified in // privateIpAddresses as primary (only one IP address can be designated as primary). - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // One or more private IP addresses. - PrivateIPAddresses []*PrivateIPAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` + PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` // The number of secondary private IP addresses to assign to a network interface. // When you specify a number of secondary IP addresses, Amazon EC2 selects these @@ -8710,10 +8815,10 @@ type CreateNetworkInterfaceInput struct { // by instance type. For more information, see Private IP Addresses Per ENI // Per Instance Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) // in the Amazon Elastic Compute Cloud User Guide. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` // The ID of the subnet to associate with the network interface. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataCreateNetworkInterfaceInput `json:"-" xml:"-"` } @@ -8820,7 +8925,7 @@ type CreateReservedInstancesListingInput struct { PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` // The ID of the active Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string" required:"true"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` metadataCreateReservedInstancesListingInput `json:"-" xml:"-"` } @@ -8863,7 +8968,7 @@ func (s CreateReservedInstancesListingOutput) GoString() string { type CreateRouteInput struct { // 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"` + 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 @@ -8873,20 +8978,20 @@ type CreateRouteInput struct { // The ID of an Internet gateway or virtual private gateway attached to your // VPC. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. The operation fails if you specify // an instance ID unless exactly one network interface is attached. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of a network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the route table for the route. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of a VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataCreateRouteInput `json:"-" xml:"-"` } @@ -8934,7 +9039,7 @@ type CreateRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` metadataCreateRouteTableInput `json:"-" xml:"-"` } @@ -9000,7 +9105,7 @@ type CreateSecurityGroupInput struct { GroupName *string `type:"string" required:"true"` // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. - VPCID *string `locationName:"VpcId" type:"string"` + VpcId *string `type:"string"` metadataCreateSecurityGroupInput `json:"-" xml:"-"` } @@ -9021,7 +9126,7 @@ func (s CreateSecurityGroupInput) GoString() string { type CreateSecurityGroupOutput struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` metadataCreateSecurityGroupOutput `json:"-" xml:"-"` } @@ -9051,7 +9156,7 @@ type CreateSnapshotInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataCreateSnapshotInput `json:"-" xml:"-"` } @@ -9072,7 +9177,7 @@ func (s CreateSnapshotInput) GoString() string { // Contains the parameters for CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionInput struct { - // The Amazon S3 bucket in which to store the Spot Instance data feed. + // 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 @@ -9103,7 +9208,7 @@ func (s CreateSpotDatafeedSubscriptionInput) GoString() string { // Contains the output of CreateSpotDatafeedSubscription. type CreateSpotDatafeedSubscriptionOutput struct { - // The Spot Instance data feed subscription. + // The Spot instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` metadataCreateSpotDatafeedSubscriptionOutput `json:"-" xml:"-"` @@ -9126,11 +9231,12 @@ func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { type CreateSubnetInput struct { // The Availability Zone for the subnet. // - // Default: Amazon EC2 selects one for you (recommended). + // Default: AWS selects one for you. If you create more than one subnet in + // your VPC, we may not necessarily select a different zone for each subnet. AvailabilityZone *string `type:"string"` // The network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. - CIDRBlock *string `locationName:"CidrBlock" type:"string" required:"true"` + CidrBlock *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 @@ -9139,7 +9245,7 @@ type CreateSubnetInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` metadataCreateSubnetInput `json:"-" xml:"-"` } @@ -9229,341 +9335,6 @@ func (s CreateTagsOutput) GoString() string { return s.String() } -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.region.service. 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"` -} - -// String returns the string representation -func (s CreateVPCEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCEndpointInput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s CreateVPCEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCEndpointOutput) GoString() string { - return s.String() -} - -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 - // of default means that instances can be launched with any tenancy; a value - // of dedicated means all instances launched into the VPC are launched as dedicated - // tenancy instances regardless of the tenancy assigned to the instance at launch. - // Dedicated tenancy instances run on single-tenant hardware. - // - // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - metadataCreateVPCInput `json:"-" xml:"-"` -} - -type metadataCreateVPCInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPCInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCInput) GoString() string { - return s.String() -} - -type CreateVPCOutput struct { - // Information about the VPC. - VPC *VPC `locationName:"vpc" type:"structure"` - - metadataCreateVPCOutput `json:"-" xml:"-"` -} - -type metadataCreateVPCOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPCOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCOutput) GoString() string { - return s.String() -} - -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. - // - // Default: Your AWS account ID - PeerOwnerID *string `locationName:"peerOwnerId" type:"string"` - - // The ID of the VPC with which you are creating the VPC peering connection. - PeerVPCID *string `locationName:"peerVpcId" type:"string"` - - // The ID of the requester VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataCreateVPCPeeringConnectionInput `json:"-" xml:"-"` -} - -type metadataCreateVPCPeeringConnectionInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPCPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCPeeringConnectionInput) GoString() string { - return s.String() -} - -type CreateVPCPeeringConnectionOutput struct { - // Information about the VPC peering connection. - VPCPeeringConnection *VPCPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` - - metadataCreateVPCPeeringConnectionOutput `json:"-" xml:"-"` -} - -type metadataCreateVPCPeeringConnectionOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPCPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCPeeringConnectionOutput) GoString() string { - return s.String() -} - -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 - // a VPN connection for a device that does not support BGP, you must specify - // true. - // - // Default: false - Options *VPNConnectionOptionsSpecification `locationName:"options" type:"structure"` - - // The type of VPN connection (ipsec.1). - Type *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` - - metadataCreateVPNConnectionInput `json:"-" xml:"-"` -} - -type metadataCreateVPNConnectionInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNConnectionInput) GoString() string { - return s.String() -} - -type CreateVPNConnectionOutput struct { - // Information about the VPN connection. - VPNConnection *VPNConnection `locationName:"vpnConnection" type:"structure"` - - metadataCreateVPNConnectionOutput `json:"-" xml:"-"` -} - -type metadataCreateVPNConnectionOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNConnectionOutput) GoString() string { - return s.String() -} - -type CreateVPNConnectionRouteInput struct { - // The CIDR block associated with the local subnet of the customer network. - DestinationCIDRBlock *string `locationName:"DestinationCidrBlock" type:"string" required:"true"` - - // The ID of the VPN connection. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` - - metadataCreateVPNConnectionRouteInput `json:"-" xml:"-"` -} - -type metadataCreateVPNConnectionRouteInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNConnectionRouteInput) GoString() string { - return s.String() -} - -type CreateVPNConnectionRouteOutput struct { - metadataCreateVPNConnectionRouteOutput `json:"-" xml:"-"` -} - -type metadataCreateVPNConnectionRouteOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNConnectionRouteOutput) GoString() string { - return s.String() -} - -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. - Type *string `type:"string" required:"true" enum:"GatewayType"` - - metadataCreateVPNGatewayInput `json:"-" xml:"-"` -} - -type metadataCreateVPNGatewayInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNGatewayInput) GoString() string { - return s.String() -} - -type CreateVPNGatewayOutput struct { - // Information about the virtual private gateway. - VPNGateway *VPNGateway `locationName:"vpnGateway" type:"structure"` - - metadataCreateVPNGatewayOutput `json:"-" xml:"-"` -} - -type metadataCreateVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s CreateVPNGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPNGatewayOutput) GoString() string { - return s.String() -} - type CreateVolumeInput struct { // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones // to list the Availability Zones that are currently available to you. @@ -9589,7 +9360,7 @@ type CreateVolumeInput struct { // IOPS/GiB. // // Constraint: Range is 100 to 20000 for Provisioned IOPS (SSD) volumes - IOPS *int64 `locationName:"Iops" type:"integer"` + Iops *int64 `type:"integer"` // The full ARN of the AWS Key Management Service (AWS KMS) customer master // key (CMK) to use when creating the encrypted volume. This parameter is only @@ -9598,7 +9369,7 @@ type CreateVolumeInput struct { // followed by the region of the CMK, the AWS account ID of the CMK owner, the // key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. // If a KmsKeyId is specified, the Encrypted flag must also be set. - KMSKeyID *string `locationName:"KmsKeyId" type:"string"` + KmsKeyId *string `type:"string"` // The size of the volume, in GiBs. // @@ -9611,7 +9382,7 @@ type CreateVolumeInput struct { Size *int64 `type:"integer"` // The snapshot from which to create the volume. - SnapshotID *string `locationName:"SnapshotId" type:"string"` + SnapshotId *string `type:"string"` // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. @@ -9645,7 +9416,7 @@ type CreateVolumePermission struct { // The specific AWS account ID that is to be added or removed from a volume's // list of create volume permissions. - UserID *string `locationName:"userId" type:"string"` + UserId *string `locationName:"userId" type:"string"` metadataCreateVolumePermission `json:"-" xml:"-"` } @@ -9691,17 +9462,352 @@ func (s CreateVolumePermissionModifications) GoString() string { return s.String() } +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.region.service. 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 `type:"string" required:"true"` + + metadataCreateVpcEndpointInput `json:"-" xml:"-"` +} + +type metadataCreateVpcEndpointInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpcEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcEndpointInput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s CreateVpcEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcEndpointOutput) GoString() string { + return s.String() +} + +type CreateVpcInput struct { + // The network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. + CidrBlock *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 supported tenancy options for instances launched into the VPC. A value + // of default means that instances can be launched with any tenancy; a value + // of dedicated means all instances launched into the VPC are launched as dedicated + // tenancy instances regardless of the tenancy assigned to the instance at launch. + // Dedicated tenancy instances run on single-tenant hardware. + // + // Default: default + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` + + metadataCreateVpcInput `json:"-" xml:"-"` +} + +type metadataCreateVpcInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcInput) GoString() string { + return s.String() +} + +type CreateVpcOutput struct { + // Information about the VPC. + Vpc *Vpc `locationName:"vpc" type:"structure"` + + metadataCreateVpcOutput `json:"-" xml:"-"` +} + +type metadataCreateVpcOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcOutput) GoString() string { + return s.String() +} + +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. + // + // Default: Your AWS account ID + PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` + + // The ID of the VPC with which you are creating the VPC peering connection. + PeerVpcId *string `locationName:"peerVpcId" type:"string"` + + // The ID of the requester VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataCreateVpcPeeringConnectionInput `json:"-" xml:"-"` +} + +type metadataCreateVpcPeeringConnectionInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type CreateVpcPeeringConnectionOutput struct { + // Information about the VPC peering connection. + VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + + metadataCreateVpcPeeringConnectionOutput `json:"-" xml:"-"` +} + +type metadataCreateVpcPeeringConnectionOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + +type CreateVpnConnectionInput struct { + // The ID of the customer gateway. + CustomerGatewayId *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"` + + // Indicates whether the VPN connection requires static routes. If you are creating + // a VPN connection for a device that does not support BGP, you must specify + // true. + // + // Default: false + Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` + + // The type of VPN connection (ipsec.1). + Type *string `type:"string" required:"true"` + + // The ID of the virtual private gateway. + VpnGatewayId *string `type:"string" required:"true"` + + metadataCreateVpnConnectionInput `json:"-" xml:"-"` +} + +type metadataCreateVpnConnectionInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionInput) GoString() string { + return s.String() +} + +type CreateVpnConnectionOutput struct { + // Information about the VPN connection. + VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` + + metadataCreateVpnConnectionOutput `json:"-" xml:"-"` +} + +type metadataCreateVpnConnectionOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionOutput) GoString() string { + return s.String() +} + +type CreateVpnConnectionRouteInput struct { + // The CIDR block associated with the local subnet of the customer network. + DestinationCidrBlock *string `type:"string" required:"true"` + + // The ID of the VPN connection. + VpnConnectionId *string `type:"string" required:"true"` + + metadataCreateVpnConnectionRouteInput `json:"-" xml:"-"` +} + +type metadataCreateVpnConnectionRouteInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnConnectionRouteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionRouteInput) GoString() string { + return s.String() +} + +type CreateVpnConnectionRouteOutput struct { + metadataCreateVpnConnectionRouteOutput `json:"-" xml:"-"` +} + +type metadataCreateVpnConnectionRouteOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnConnectionRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnConnectionRouteOutput) GoString() string { + return s.String() +} + +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. + Type *string `type:"string" required:"true" enum:"GatewayType"` + + metadataCreateVpnGatewayInput `json:"-" xml:"-"` +} + +type metadataCreateVpnGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnGatewayInput) GoString() string { + return s.String() +} + +type CreateVpnGatewayOutput struct { + // Information about the virtual private gateway. + VpnGateway *VpnGateway `locationName:"vpnGateway" type:"structure"` + + metadataCreateVpnGatewayOutput `json:"-" xml:"-"` +} + +type metadataCreateVpnGatewayOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s CreateVpnGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateVpnGatewayOutput) GoString() string { + return s.String() +} + // Describes a customer gateway. type CustomerGateway struct { // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number // (ASN). - BGPASN *string `locationName:"bgpAsn" type:"string"` + BgpAsn *string `locationName:"bgpAsn" type:"string"` // The ID of the customer gateway. - CustomerGatewayID *string `locationName:"customerGatewayId" type:"string"` + CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` // The Internet-routable IP address of the customer gateway's outside interface. - IPAddress *string `locationName:"ipAddress" type:"string"` + IpAddress *string `locationName:"ipAddress" type:"string"` // The current state of the customer gateway (pending | available | deleting // | deleted). @@ -9730,62 +9836,9 @@ func (s CustomerGateway) GoString() string { return s.String() } -// Describes a DHCP configuration option. -type DHCPConfiguration struct { - // The name of a DHCP option. - Key *string `locationName:"key" type:"string"` - - // One or more values for the DHCP option. - Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` - - metadataDHCPConfiguration `json:"-" xml:"-"` -} - -type metadataDHCPConfiguration struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DHCPConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DHCPConfiguration) GoString() string { - return s.String() -} - -// Describes a set of DHCP options. -type DHCPOptions struct { - // One or more DHCP options in the set. - DHCPConfigurations []*DHCPConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` - - // The ID of the set of DHCP options. - DHCPOptionsID *string `locationName:"dhcpOptionsId" type:"string"` - - // Any tags assigned to the DHCP options set. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - metadataDHCPOptions `json:"-" xml:"-"` -} - -type metadataDHCPOptions struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DHCPOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DHCPOptions) GoString() string { - return s.String() -} - type DeleteCustomerGatewayInput struct { // The ID of the customer gateway. - CustomerGatewayID *string `locationName:"CustomerGatewayId" type:"string" required:"true"` + CustomerGatewayId *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 @@ -9828,9 +9881,9 @@ func (s DeleteCustomerGatewayOutput) GoString() string { return s.String() } -type DeleteDHCPOptionsInput struct { +type DeleteDhcpOptionsInput struct { // The ID of the DHCP options set. - DHCPOptionsID *string `locationName:"DhcpOptionsId" type:"string" required:"true"` + DhcpOptionsId *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 @@ -9838,44 +9891,44 @@ type DeleteDHCPOptionsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - metadataDeleteDHCPOptionsInput `json:"-" xml:"-"` + metadataDeleteDhcpOptionsInput `json:"-" xml:"-"` } -type metadataDeleteDHCPOptionsInput struct { +type metadataDeleteDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteDHCPOptionsInput) String() string { +func (s DeleteDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDHCPOptionsInput) GoString() string { +func (s DeleteDhcpOptionsInput) GoString() string { return s.String() } -type DeleteDHCPOptionsOutput struct { - metadataDeleteDHCPOptionsOutput `json:"-" xml:"-"` +type DeleteDhcpOptionsOutput struct { + metadataDeleteDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataDeleteDHCPOptionsOutput struct { +type metadataDeleteDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteDHCPOptionsOutput) String() string { +func (s DeleteDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDHCPOptionsOutput) GoString() string { +func (s DeleteDhcpOptionsOutput) GoString() string { return s.String() } type DeleteFlowLogsInput struct { // One or more flow log IDs. - FlowLogIDs []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` metadataDeleteFlowLogsInput `json:"-" xml:"-"` } @@ -9923,7 +9976,7 @@ type DeleteInternetGatewayInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` metadataDeleteInternetGatewayInput `json:"-" xml:"-"` } @@ -10005,7 +10058,7 @@ func (s DeleteKeyPairOutput) GoString() string { return s.String() } -type DeleteNetworkACLEntryInput 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, @@ -10016,47 +10069,47 @@ type DeleteNetworkACLEntryInput struct { Egress *bool `locationName:"egress" type:"boolean" required:"true"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // The rule number of the entry to delete. RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataDeleteNetworkACLEntryInput `json:"-" xml:"-"` + metadataDeleteNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLEntryInput struct { +type metadataDeleteNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteNetworkACLEntryInput) String() string { +func (s DeleteNetworkAclEntryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkACLEntryInput) GoString() string { +func (s DeleteNetworkAclEntryInput) GoString() string { return s.String() } -type DeleteNetworkACLEntryOutput struct { - metadataDeleteNetworkACLEntryOutput `json:"-" xml:"-"` +type DeleteNetworkAclEntryOutput struct { + metadataDeleteNetworkAclEntryOutput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLEntryOutput struct { +type metadataDeleteNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteNetworkACLEntryOutput) String() string { +func (s DeleteNetworkAclEntryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkACLEntryOutput) GoString() string { +func (s DeleteNetworkAclEntryOutput) GoString() string { return s.String() } -type DeleteNetworkACLInput 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, @@ -10064,40 +10117,40 @@ type DeleteNetworkACLInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - metadataDeleteNetworkACLInput `json:"-" xml:"-"` + metadataDeleteNetworkAclInput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLInput struct { +type metadataDeleteNetworkAclInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteNetworkACLInput) String() string { +func (s DeleteNetworkAclInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkACLInput) GoString() string { +func (s DeleteNetworkAclInput) GoString() string { return s.String() } -type DeleteNetworkACLOutput struct { - metadataDeleteNetworkACLOutput `json:"-" xml:"-"` +type DeleteNetworkAclOutput struct { + metadataDeleteNetworkAclOutput `json:"-" xml:"-"` } -type metadataDeleteNetworkACLOutput struct { +type metadataDeleteNetworkAclOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DeleteNetworkACLOutput) String() string { +func (s DeleteNetworkAclOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkACLOutput) GoString() string { +func (s DeleteNetworkAclOutput) GoString() string { return s.String() } @@ -10109,7 +10162,7 @@ type DeleteNetworkInterfaceInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataDeleteNetworkInterfaceInput `json:"-" xml:"-"` } @@ -10194,7 +10247,7 @@ func (s DeletePlacementGroupOutput) GoString() string { type DeleteRouteInput struct { // The CIDR range for the route. The value you specify must match the CIDR for // the route exactly. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + 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 @@ -10203,7 +10256,7 @@ type DeleteRouteInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataDeleteRouteInput `json:"-" xml:"-"` } @@ -10248,7 +10301,7 @@ type DeleteRouteTableInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataDeleteRouteTableInput `json:"-" xml:"-"` } @@ -10293,7 +10346,7 @@ type DeleteSecurityGroupInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the security group. Required for a nondefault VPC. - GroupID *string `locationName:"GroupId" type:"string"` + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. You can specify // either the security group name or the security group ID. @@ -10342,7 +10395,7 @@ type DeleteSnapshotInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataDeleteSnapshotInput `json:"-" xml:"-"` } @@ -10430,7 +10483,7 @@ type DeleteSubnetInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the subnet. - SubnetID *string `locationName:"SubnetId" type:"string" required:"true"` + SubnetId *string `type:"string" required:"true"` metadataDeleteSubnetInput `json:"-" xml:"-"` } @@ -10518,279 +10571,6 @@ func (s DeleteTagsOutput) GoString() string { return s.String() } -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"` -} - -// String returns the string representation -func (s DeleteVPCEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCEndpointsInput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s DeleteVPCEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCEndpointsOutput) GoString() string { - return s.String() -} - -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. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - metadataDeleteVPCInput `json:"-" xml:"-"` -} - -type metadataDeleteVPCInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPCInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCInput) GoString() string { - return s.String() -} - -type DeleteVPCOutput struct { - metadataDeleteVPCOutput `json:"-" xml:"-"` -} - -type metadataDeleteVPCOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPCOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCOutput) GoString() string { - return s.String() -} - -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. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` - - metadataDeleteVPCPeeringConnectionInput `json:"-" xml:"-"` -} - -type metadataDeleteVPCPeeringConnectionInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPCPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCPeeringConnectionInput) GoString() string { - return s.String() -} - -type DeleteVPCPeeringConnectionOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` - - metadataDeleteVPCPeeringConnectionOutput `json:"-" xml:"-"` -} - -type metadataDeleteVPCPeeringConnectionOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPCPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCPeeringConnectionOutput) GoString() string { - return s.String() -} - -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. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` - - metadataDeleteVPNConnectionInput `json:"-" xml:"-"` -} - -type metadataDeleteVPNConnectionInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNConnectionInput) GoString() string { - return s.String() -} - -type DeleteVPNConnectionOutput struct { - metadataDeleteVPNConnectionOutput `json:"-" xml:"-"` -} - -type metadataDeleteVPNConnectionOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNConnectionOutput) GoString() string { - return s.String() -} - -type DeleteVPNConnectionRouteInput struct { - // The CIDR block associated with the local subnet of the customer network. - DestinationCIDRBlock *string `locationName:"DestinationCidrBlock" type:"string" required:"true"` - - // The ID of the VPN connection. - VPNConnectionID *string `locationName:"VpnConnectionId" type:"string" required:"true"` - - metadataDeleteVPNConnectionRouteInput `json:"-" xml:"-"` -} - -type metadataDeleteVPNConnectionRouteInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNConnectionRouteInput) GoString() string { - return s.String() -} - -type DeleteVPNConnectionRouteOutput struct { - metadataDeleteVPNConnectionRouteOutput `json:"-" xml:"-"` -} - -type metadataDeleteVPNConnectionRouteOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNConnectionRouteOutput) GoString() string { - return s.String() -} - -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. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` - - metadataDeleteVPNGatewayInput `json:"-" xml:"-"` -} - -type metadataDeleteVPNGatewayInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNGatewayInput) GoString() string { - return s.String() -} - -type DeleteVPNGatewayOutput struct { - metadataDeleteVPNGatewayOutput `json:"-" xml:"-"` -} - -type metadataDeleteVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPNGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPNGatewayOutput) GoString() string { - return s.String() -} - 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 @@ -10799,7 +10579,7 @@ type DeleteVolumeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataDeleteVolumeInput `json:"-" xml:"-"` } @@ -10836,6 +10616,279 @@ func (s DeleteVolumeOutput) GoString() string { return s.String() } +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"` +} + +// String returns the string representation +func (s DeleteVpcEndpointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcEndpointsInput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s DeleteVpcEndpointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcEndpointsOutput) GoString() string { + return s.String() +} + +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. + VpcId *string `type:"string" required:"true"` + + metadataDeleteVpcInput `json:"-" xml:"-"` +} + +type metadataDeleteVpcInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpcInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcInput) GoString() string { + return s.String() +} + +type DeleteVpcOutput struct { + metadataDeleteVpcOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpcOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpcOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcOutput) GoString() string { + return s.String() +} + +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. + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` + + metadataDeleteVpcPeeringConnectionInput `json:"-" xml:"-"` +} + +type metadataDeleteVpcPeeringConnectionInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpcPeeringConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcPeeringConnectionInput) GoString() string { + return s.String() +} + +type DeleteVpcPeeringConnectionOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataDeleteVpcPeeringConnectionOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpcPeeringConnectionOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpcPeeringConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpcPeeringConnectionOutput) GoString() string { + return s.String() +} + +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. + VpnConnectionId *string `type:"string" required:"true"` + + metadataDeleteVpnConnectionInput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnConnectionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionInput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionOutput struct { + metadataDeleteVpnConnectionOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnConnectionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionOutput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionRouteInput struct { + // The CIDR block associated with the local subnet of the customer network. + DestinationCidrBlock *string `type:"string" required:"true"` + + // The ID of the VPN connection. + VpnConnectionId *string `type:"string" required:"true"` + + metadataDeleteVpnConnectionRouteInput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionRouteInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnConnectionRouteInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionRouteInput) GoString() string { + return s.String() +} + +type DeleteVpnConnectionRouteOutput struct { + metadataDeleteVpnConnectionRouteOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpnConnectionRouteOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnConnectionRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnConnectionRouteOutput) GoString() string { + return s.String() +} + +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. + VpnGatewayId *string `type:"string" required:"true"` + + metadataDeleteVpnGatewayInput `json:"-" xml:"-"` +} + +type metadataDeleteVpnGatewayInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnGatewayInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnGatewayInput) GoString() string { + return s.String() +} + +type DeleteVpnGatewayOutput struct { + metadataDeleteVpnGatewayOutput `json:"-" xml:"-"` +} + +type metadataDeleteVpnGatewayOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DeleteVpnGatewayOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVpnGatewayOutput) GoString() string { + return s.String() +} + 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 @@ -10844,7 +10897,7 @@ type DeregisterImageInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataDeregisterImageInput `json:"-" xml:"-"` } @@ -10933,7 +10986,7 @@ type DescribeAddressesInput struct { // [EC2-VPC] One or more allocation IDs. // // Default: Describes all your Elastic IP addresses. - AllocationIDs []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` + 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 @@ -10967,7 +11020,7 @@ type DescribeAddressesInput struct { // [EC2-Classic] One or more Elastic IP addresses. // // Default: Describes all your Elastic IP addresses. - PublicIPs []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` + PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` metadataDescribeAddressesInput `json:"-" xml:"-"` } @@ -11021,7 +11074,8 @@ type DescribeAvailabilityZonesInput struct { // region-name - The name of the region for the Availability Zone (for example, // us-east-1). // - // state - The state of the Availability Zone (available | impaired | unavailable). + // state - The state of the Availability Zone (available | information | + // impaired | unavailable). // // zone-name - The name of the Availability Zone (for example, us-east-1a). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` @@ -11071,7 +11125,7 @@ type DescribeBundleTasksInput struct { // One or more bundle task IDs. // // Default: Describes all your bundle tasks. - BundleIDs []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` + 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 @@ -11171,7 +11225,7 @@ type DescribeClassicLinkInstancesInput struct { Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" 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 @@ -11230,7 +11284,7 @@ func (s DescribeClassicLinkInstancesOutput) GoString() string { type DescribeConversionTasksInput struct { // One or more conversion task IDs. - ConversionTaskIDs []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` + 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 @@ -11283,7 +11337,7 @@ type DescribeCustomerGatewaysInput struct { // One or more customer gateway IDs. // // Default: Describes all your customer gateways. - CustomerGatewayIDs []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` + 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 @@ -11358,11 +11412,11 @@ func (s DescribeCustomerGatewaysOutput) GoString() string { return s.String() } -type DescribeDHCPOptionsInput struct { +type DescribeDhcpOptionsInput struct { // The IDs of one or more DHCP options sets. // // Default: Describes all your DHCP options sets. - DHCPOptionsIDs []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` + 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 @@ -11391,47 +11445,47 @@ type DescribeDHCPOptionsInput struct { // independent of the tag-key filter. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - metadataDescribeDHCPOptionsInput `json:"-" xml:"-"` + metadataDescribeDhcpOptionsInput `json:"-" xml:"-"` } -type metadataDescribeDHCPOptionsInput struct { +type metadataDescribeDhcpOptionsInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DescribeDHCPOptionsInput) String() string { +func (s DescribeDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDHCPOptionsInput) GoString() string { +func (s DescribeDhcpOptionsInput) GoString() string { return s.String() } -type DescribeDHCPOptionsOutput struct { +type DescribeDhcpOptionsOutput struct { // Information about one or more DHCP options sets. - DHCPOptions []*DHCPOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` + DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` - metadataDescribeDHCPOptionsOutput `json:"-" xml:"-"` + metadataDescribeDhcpOptionsOutput `json:"-" xml:"-"` } -type metadataDescribeDHCPOptionsOutput struct { +type metadataDescribeDhcpOptionsOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DescribeDHCPOptionsOutput) String() string { +func (s DescribeDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDHCPOptionsOutput) GoString() string { +func (s DescribeDhcpOptionsOutput) GoString() string { return s.String() } type DescribeExportTasksInput struct { // One or more export task IDs. - ExportTaskIDs []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` + ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` metadataDescribeExportTasksInput `json:"-" xml:"-"` } @@ -11486,7 +11540,7 @@ type DescribeFlowLogsInput struct { Filter []*Filter `locationNameList:"Filter" type:"list"` // One or more flow log IDs. - FlowLogIDs []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` // The maximum number of results to return for the request in a single page. // The remaining results can be seen by sending another request with the returned @@ -11555,7 +11609,7 @@ type DescribeImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataDescribeImageAttributeInput `json:"-" xml:"-"` } @@ -11583,10 +11637,10 @@ type DescribeImageAttributeOutput struct { Description *AttributeValue `locationName:"description" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The kernel ID. - KernelID *AttributeValue `locationName:"kernel" type:"structure"` + KernelId *AttributeValue `locationName:"kernel" type:"structure"` // One or more launch permissions. LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` @@ -11595,10 +11649,10 @@ type DescribeImageAttributeOutput struct { ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The RAM disk ID. - RAMDiskID *AttributeValue `locationName:"ramdisk" type:"structure"` + RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` // The value to use for a resource attribute. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` metadataDescribeImageAttributeOutput `json:"-" xml:"-"` } @@ -11703,7 +11757,7 @@ type DescribeImagesInput struct { // One or more image IDs. // // Default: Describes all images available to you. - ImageIDs []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` + ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` // Filters the images by the owner. Specify an AWS account ID, amazon (owner // is Amazon), aws-marketplace (owner is AWS Marketplace), self (owner is the @@ -11760,7 +11814,7 @@ type DescribeImportImageTasksInput struct { Filters []*Filter `locationNameList:"Filter" type:"list"` // A list of import image task IDs. - ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` @@ -11822,7 +11876,7 @@ type DescribeImportSnapshotTasksInput struct { Filters []*Filter `locationNameList:"Filter" type:"list"` // A list of import snapshot task IDs. - ImportTaskIDs []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` // The maximum number of results to return in a single request. MaxResults *int64 `type:"integer"` @@ -11884,7 +11938,7 @@ type DescribeInstanceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` metadataDescribeInstanceAttributeInput `json:"-" xml:"-"` } @@ -11910,16 +11964,16 @@ type DescribeInstanceAttributeOutput struct { // If the value is true, you can't terminate the instance through the Amazon // EC2 console, CLI, or API; otherwise, you can. - DisableAPITermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` + DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` // Indicates whether the instance is optimized for EBS I/O. - EBSOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` + EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` // The security groups associated with the instance. Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Indicates whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). @@ -11929,25 +11983,25 @@ type DescribeInstanceAttributeOutput struct { InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` // The kernel ID. - KernelID *AttributeValue `locationName:"kernel" type:"structure"` + KernelId *AttributeValue `locationName:"kernel" type:"structure"` // A list of product codes. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The RAM disk ID. - RAMDiskID *AttributeValue `locationName:"ramdisk" type:"structure"` + RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` // The name of the root device (for example, /dev/sda1 or /dev/xvda). RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` - // The value to use for a resource attribute. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - // Indicates whether source/destination checking is enabled. A value of true // means checking is enabled, and false means checking is disabled. This value // must be false for a NAT instance to perform NAT. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` + // The value to use for a resource attribute. + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` + // The Base64-encoded MIME user data. UserData *AttributeValue `locationName:"userData" type:"structure"` @@ -12023,7 +12077,7 @@ type DescribeInstanceStatusInput struct { // Default: Describes all your instances. // // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" 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 @@ -12234,7 +12288,7 @@ type DescribeInstancesInput struct { // // network-interface.vpc-id - The ID of the VPC for the network interface. // - // network-interface.network-interface.id - The ID of the network interface. + // network-interface.network-interface-id - The ID of the network interface. // // network-interface.owner-id - The ID of the owner of the network interface. // @@ -12313,7 +12367,7 @@ type DescribeInstancesInput struct { // One or more instance IDs. // // Default: Describes all your instances. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" 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 @@ -12400,7 +12454,7 @@ type DescribeInternetGatewaysInput struct { // One or more Internet gateway IDs. // // Default: Describes all your Internet gateways. - InternetGatewayIDs []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` + InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` metadataDescribeInternetGatewaysInput `json:"-" xml:"-"` } @@ -12521,7 +12575,7 @@ type DescribeMovingAddressesInput struct { NextToken *string `locationName:"nextToken" type:"string"` // One or more Elastic IP addresses. - PublicIPs []*string `locationName:"publicIp" locationNameList:"item" type:"list"` + PublicIps []*string `locationName:"publicIp" locationNameList:"item" type:"list"` metadataDescribeMovingAddressesInput `json:"-" xml:"-"` } @@ -12565,7 +12619,7 @@ func (s DescribeMovingAddressesOutput) GoString() string { return s.String() } -type DescribeNetworkACLsInput struct { +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, @@ -12624,43 +12678,43 @@ type DescribeNetworkACLsInput struct { // One or more network ACL IDs. // // Default: Describes all your network ACLs. - NetworkACLIDs []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` + NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` - metadataDescribeNetworkACLsInput `json:"-" xml:"-"` + metadataDescribeNetworkAclsInput `json:"-" xml:"-"` } -type metadataDescribeNetworkACLsInput struct { +type metadataDescribeNetworkAclsInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DescribeNetworkACLsInput) String() string { +func (s DescribeNetworkAclsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeNetworkACLsInput) GoString() string { +func (s DescribeNetworkAclsInput) GoString() string { return s.String() } -type DescribeNetworkACLsOutput struct { +type DescribeNetworkAclsOutput struct { // Information about one or more network ACLs. - NetworkACLs []*NetworkACL `locationName:"networkAclSet" locationNameList:"item" type:"list"` + NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` - metadataDescribeNetworkACLsOutput `json:"-" xml:"-"` + metadataDescribeNetworkAclsOutput `json:"-" xml:"-"` } -type metadataDescribeNetworkACLsOutput struct { +type metadataDescribeNetworkAclsOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DescribeNetworkACLsOutput) String() string { +func (s DescribeNetworkAclsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeNetworkACLsOutput) GoString() string { +func (s DescribeNetworkAclsOutput) GoString() string { return s.String() } @@ -12675,7 +12729,7 @@ type DescribeNetworkInterfaceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` metadataDescribeNetworkInterfaceAttributeInput `json:"-" xml:"-"` } @@ -12705,7 +12759,7 @@ type DescribeNetworkInterfaceAttributeOutput struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // Indicates whether source/destination checking is enabled. SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` @@ -12838,7 +12892,7 @@ type DescribeNetworkInterfacesInput struct { // One or more network interface IDs. // // Default: Describes all your network interfaces. - NetworkInterfaceIDs []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` + NetworkInterfaceIds []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` metadataDescribeNetworkInterfacesInput `json:"-" xml:"-"` } @@ -12965,7 +13019,7 @@ type DescribePrefixListsInput struct { NextToken *string `type:"string"` // One or more prefix list IDs. - PrefixListIDs []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` + PrefixListIds []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` metadataDescribePrefixListsInput `json:"-" xml:"-"` } @@ -13130,7 +13184,7 @@ type DescribeReservedInstancesInput struct { // // Default: Describes all your Reserved Instances, or only those otherwise // specified. - ReservedInstancesIDs []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` + ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` metadataDescribeReservedInstancesInput `json:"-" xml:"-"` } @@ -13163,10 +13217,10 @@ type DescribeReservedInstancesListingsInput struct { Filters []*Filter `locationName:"filters" locationNameList:"Filter" type:"list"` // One or more Reserved Instance IDs. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // One or more Reserved Instance Listing IDs. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` metadataDescribeReservedInstancesListingsInput `json:"-" xml:"-"` } @@ -13247,7 +13301,7 @@ type DescribeReservedInstancesModificationsInput struct { NextToken *string `locationName:"nextToken" type:"string"` // IDs for the submitted modification request. - ReservedInstancesModificationIDs []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` + ReservedInstancesModificationIds []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` metadataDescribeReservedInstancesModificationsInput `json:"-" xml:"-"` } @@ -13385,7 +13439,7 @@ type DescribeReservedInstancesOfferingsInput struct { ProductDescription *string `type:"string" enum:"RIProductDescription"` // One or more Reserved Instances offering IDs. - ReservedInstancesOfferingIDs []*string `locationName:"ReservedInstancesOfferingId" type:"list"` + ReservedInstancesOfferingIds []*string `locationName:"ReservedInstancesOfferingId" type:"list"` metadataDescribeReservedInstancesOfferingsInput `json:"-" xml:"-"` } @@ -13515,7 +13569,7 @@ type DescribeRouteTablesInput struct { // One or more route table IDs. // // Default: Describes all your route tables. - RouteTableIDs []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` + RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` metadataDescribeRouteTablesInput `json:"-" xml:"-"` } @@ -13562,7 +13616,9 @@ type DescribeSecurityGroupsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // One or more filters. If using multiple filters for rules, the results include + // security groups for which any combination of rules - not necessarily a single + // rule - match all filters. // // description - The description of the security group. // @@ -13606,7 +13662,7 @@ type DescribeSecurityGroupsInput struct { // VPC. // // Default: Describes all your security groups. - GroupIDs []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` + GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` // [EC2-Classic and default VPC only] One or more security group names. You // can specify either the security group name or the security group ID. For @@ -13665,7 +13721,7 @@ type DescribeSnapshotAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataDescribeSnapshotAttributeInput `json:"-" xml:"-"` } @@ -13692,7 +13748,7 @@ type DescribeSnapshotAttributeOutput struct { ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The ID of the EBS snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` metadataDescribeSnapshotAttributeOutput `json:"-" xml:"-"` } @@ -13773,15 +13829,15 @@ type DescribeSnapshotsInput struct { // Returns the snapshots owned by the specified owner. Multiple owners can be // specified. - OwnerIDs []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` + OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` // One or more AWS accounts IDs that can create volumes from the snapshot. - RestorableByUserIDs []*string `locationName:"RestorableBy" type:"list"` + RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"` // One or more snapshot IDs. // // Default: Describes snapshots for which you have launch permissions. - SnapshotIDs []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` + SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` metadataDescribeSnapshotsInput `json:"-" xml:"-"` } @@ -13854,7 +13910,7 @@ func (s DescribeSpotDatafeedSubscriptionInput) GoString() string { // Contains the output of DescribeSpotDatafeedSubscription. type DescribeSpotDatafeedSubscriptionOutput struct { - // The Spot Instance data feed subscription. + // The Spot instance data feed subscription. SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` metadataDescribeSpotDatafeedSubscriptionOutput `json:"-" xml:"-"` @@ -13891,7 +13947,7 @@ type DescribeSpotFleetInstancesInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataDescribeSpotFleetInstancesInput `json:"-" xml:"-"` } @@ -13921,7 +13977,7 @@ type DescribeSpotFleetInstancesOutput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataDescribeSpotFleetInstancesOutput `json:"-" xml:"-"` } @@ -13960,7 +14016,7 @@ type DescribeSpotFleetRequestHistoryInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + 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"` @@ -13998,7 +14054,7 @@ type DescribeSpotFleetRequestHistoryOutput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + 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"` @@ -14037,7 +14093,7 @@ type DescribeSpotFleetRequestsInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The IDs of the Spot fleet requests. - SpotFleetRequestIDs []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` + SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` metadataDescribeSpotFleetRequestsInput `json:"-" xml:"-"` } @@ -14094,7 +14150,7 @@ type DescribeSpotInstanceRequestsInput struct { // // availability-zone-group - The Availability Zone group. // - // create-time - The time stamp when the Spot Instance request was created. + // create-time - The time stamp when the Spot instance request was created. // // fault-code - The fault code related to the request. // @@ -14102,7 +14158,7 @@ type DescribeSpotInstanceRequestsInput struct { // // instance-id - The ID of the instance that fulfilled the request. // - // launch-group - The Spot Instance launch group. + // launch-group - The Spot instance launch group. // // launch.block-device-mapping.delete-on-termination - Indicates whether // the Amazon EBS volume is deleted on instance termination. @@ -14123,14 +14179,14 @@ type DescribeSpotInstanceRequestsInput struct { // // launch.image-id - The ID of the AMI. // - // launch.instance-type - The type of instance (for example, m1.small). + // launch.instance-type - The type of instance (for example, m3.medium). // // launch.kernel-id - The kernel ID. // // launch.key-name - The name of the key pair the instance launched with. // // launch.monitoring-enabled - Whether monitoring is enabled for the Spot - // Instance. + // instance. // // launch.ramdisk-id - The RAM disk ID. // @@ -14161,21 +14217,21 @@ type DescribeSpotInstanceRequestsInput struct { // product-description - The product description associated with the instance // (Linux/UNIX | Windows). // - // spot-instance-request-id - The Spot Instance request ID. + // spot-instance-request-id - The Spot instance request ID. // - // spot-price - The maximum hourly price for any Spot Instance launched to + // spot-price - The maximum hourly price for any Spot instance launched to // fulfill the request. // - // state - The state of the Spot Instance request (open | active | closed + // state - The state of the Spot instance request (open | active | closed // | cancelled | failed). Spot bid status information can help you track your - // Amazon EC2 Spot Instance requests. For more information, see Spot Bid Status + // Amazon EC2 Spot instance requests. For more information, see Spot Bid Status // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon Elastic Compute Cloud User Guide. // // status-code - The short code describing the most recent evaluation of - // your Spot Instance request. + // your Spot instance request. // - // status-message - The message explaining the status of the Spot Instance + // status-message - The message explaining the status of the Spot instance // request. // // tag:key=value - The key/value combination of a tag assigned to the resource. @@ -14190,7 +14246,7 @@ type DescribeSpotInstanceRequestsInput struct { // tag-value - The value of a tag assigned to the resource. This filter is // independent of the tag-key filter. // - // type - The type of Spot Instance request (one-time | persistent). + // type - The type of Spot instance request (one-time | persistent). // // launched-availability-zone - The Availability Zone in which the bid is // launched. @@ -14200,8 +14256,8 @@ type DescribeSpotInstanceRequestsInput struct { // valid-until - The end date of the request. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more Spot Instance request IDs. - SpotInstanceRequestIDs []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` + // One or more Spot instance request IDs. + SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` metadataDescribeSpotInstanceRequestsInput `json:"-" xml:"-"` } @@ -14222,7 +14278,7 @@ func (s DescribeSpotInstanceRequestsInput) GoString() string { // Contains the output of DescribeSpotInstanceRequests. type DescribeSpotInstanceRequestsOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataDescribeSpotInstanceRequestsOutput `json:"-" xml:"-"` @@ -14261,16 +14317,16 @@ type DescribeSpotPriceHistoryInput struct { // // availability-zone - The Availability Zone for which prices should be returned. // - // instance-type - The type of instance (for example, m1.small). + // instance-type - The type of instance (for example, m3.medium). // - // product-description - The product description for the Spot Price (Linux/UNIX + // product-description - The product description for the Spot price (Linux/UNIX // | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon VPC) // | Windows (Amazon VPC)). // - // spot-price - The Spot Price. The value must match exactly (or use wildcards; + // 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, in UTC format (for + // 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"` @@ -14316,7 +14372,7 @@ type DescribeSpotPriceHistoryOutput struct { // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` - // The historical Spot Prices. + // The historical Spot prices. SpotPriceHistory []*SpotPrice `locationName:"spotPriceHistorySet" locationNameList:"item" type:"list"` metadataDescribeSpotPriceHistoryOutput `json:"-" xml:"-"` @@ -14380,7 +14436,7 @@ type DescribeSubnetsInput struct { // One or more subnet IDs. // // Default: Describes all your subnets. - SubnetIDs []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` + SubnetIds []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` metadataDescribeSubnetsInput `json:"-" xml:"-"` } @@ -14493,606 +14549,6 @@ func (s DescribeTagsOutput) GoString() string { return s.String() } -type DescribeVPCAttributeInput struct { - // The VPC attribute. - Attribute *string `type:"string" enum:"VpcAttributeName"` - - // 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. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - metadataDescribeVPCAttributeInput `json:"-" xml:"-"` -} - -type metadataDescribeVPCAttributeInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCAttributeInput) GoString() string { - return s.String() -} - -type DescribeVPCAttributeOutput struct { - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // this attribute is true, instances in the VPC get DNS hostnames; otherwise, - // they do not. - EnableDNSHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` - - // Indicates whether DNS resolution is enabled for the VPC. If this attribute - // is true, the Amazon DNS server resolves DNS hostnames for your instances - // to their corresponding IP addresses; otherwise, it does not. - EnableDNSSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataDescribeVPCAttributeOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPCAttributeOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCAttributeOutput) GoString() string { - return s.String() -} - -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. - // - // is-classic-link-enabled - Whether the VPC is enabled for ClassicLink (true - // | false). - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPCs for which you want to describe the ClassicLink status. - VPCIDs []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` - - metadataDescribeVPCClassicLinkInput `json:"-" xml:"-"` -} - -type metadataDescribeVPCClassicLinkInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCClassicLinkInput) GoString() string { - return s.String() -} - -type DescribeVPCClassicLinkOutput struct { - // The ClassicLink status of one or more VPCs. - VPCs []*VPCClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCClassicLinkOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPCClassicLinkOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCClassicLinkOutput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s DescribeVPCEndpointServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCEndpointServicesInput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s DescribeVPCEndpointServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCEndpointServicesOutput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s DescribeVPCEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCEndpointsInput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s DescribeVPCEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCEndpointsOutput) GoString() string { - return s.String() -} - -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. - // - // accepter-vpc-info.cidr-block - The CIDR block of the peer VPC. - // - // accepter-vpc-info.owner-id - The AWS account ID of the owner of the peer - // VPC. - // - // accepter-vpc-info.vpc-id - The ID of the peer VPC. - // - // expiration-time - The expiration date and time for the VPC peering connection. - // - // requester-vpc-info.cidr-block - The CIDR block of the requester's VPC. - // - // requester-vpc-info.owner-id - The AWS account ID of the owner of the requester - // VPC. - // - // requester-vpc-info.vpc-id - The ID of the requester VPC. - // - // status-code - The status of the VPC peering connection (pending-acceptance - // | failed | expired | provisioning | active | deleted | rejected). - // - // status-message - A message that provides more information about the status - // of the VPC peering connection, if applicable. - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // vpc-peering-connection-id - The ID of the VPC peering connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC peering connection IDs. - // - // Default: Describes all your VPC peering connections. - VPCPeeringConnectionIDs []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` - - metadataDescribeVPCPeeringConnectionsInput `json:"-" xml:"-"` -} - -type metadataDescribeVPCPeeringConnectionsInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCPeeringConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCPeeringConnectionsInput) GoString() string { - return s.String() -} - -type DescribeVPCPeeringConnectionsOutput struct { - // Information about the VPC peering connections. - VPCPeeringConnections []*VPCPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCPeeringConnectionsOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPCPeeringConnectionsOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCPeeringConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCPeeringConnectionsOutput) GoString() string { - return s.String() -} - -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. - // - // cidr - The CIDR block of the VPC. The CIDR block you specify must exactly - // match the VPC's CIDR block for information to be returned for the VPC. Must - // contain the slash followed by one or two digits (for example, /28). - // - // dhcp-options-id - The ID of a set of DHCP options. - // - // isDefault - Indicates whether the VPC is the default VPC. - // - // state - The state of the VPC (pending | available). - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // vpc-id - The ID of the VPC. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC IDs. - // - // Default: Describes all your VPCs. - VPCIDs []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` - - metadataDescribeVPCsInput `json:"-" xml:"-"` -} - -type metadataDescribeVPCsInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCsInput) GoString() string { - return s.String() -} - -type DescribeVPCsOutput struct { - // Information about one or more VPCs. - VPCs []*VPC `locationName:"vpcSet" locationNameList:"item" type:"list"` - - metadataDescribeVPCsOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPCsOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPCsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPCsOutput) GoString() string { - return s.String() -} - -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. - // - // customer-gateway-configuration - The configuration information for the - // customer gateway. - // - // customer-gateway-id - The ID of a customer gateway associated with the - // VPN connection. - // - // state - The state of the VPN connection (pending | available | deleting - // | deleted). - // - // option.static-routes-only - Indicates whether the connection has static - // routes only. Used for devices that do not support Border Gateway Protocol - // (BGP). - // - // route.destination-cidr-block - The destination CIDR block. This corresponds - // to the subnet used in a customer data center. - // - // bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP - // device. - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // type - The type of VPN connection. Currently the only supported type is - // ipsec.1. - // - // vpn-connection-id - The ID of the VPN connection. - // - // vpn-gateway-id - The ID of a virtual private gateway associated with the - // VPN connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPN connection IDs. - // - // Default: Describes your VPN connections. - VPNConnectionIDs []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` - - metadataDescribeVPNConnectionsInput `json:"-" xml:"-"` -} - -type metadataDescribeVPNConnectionsInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPNConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPNConnectionsInput) GoString() string { - return s.String() -} - -type DescribeVPNConnectionsOutput struct { - // Information about one or more VPN connections. - VPNConnections []*VPNConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` - - metadataDescribeVPNConnectionsOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPNConnectionsOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPNConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPNConnectionsOutput) GoString() string { - return s.String() -} - -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. - // - // attachment.state - The current state of the attachment between the gateway - // and the VPC (attaching | attached | detaching | detached). - // - // attachment.vpc-id - The ID of an attached VPC. - // - // availability-zone - The Availability Zone for the virtual private gateway. - // - // state - The state of the virtual private gateway (pending | available - // | deleting | deleted). - // - // tag:key=value - The key/value combination of a tag assigned to the resource. - // - // tag-key - The key of a tag assigned to the resource. This filter is independent - // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" - // and the filter "tag-value=X", you get any resources assigned both the tag - // key Purpose (regardless of what the tag's value is), and the tag value X - // (regardless of what the tag's key is). If you want to list only resources - // where Purpose is X, see the tag:key=value filter. - // - // tag-value - The value of a tag assigned to the resource. This filter is - // independent of the tag-key filter. - // - // type - The type of virtual private gateway. Currently the only supported - // type is ipsec.1. - // - // vpn-gateway-id - The ID of the virtual private gateway. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more virtual private gateway IDs. - // - // Default: Describes all your virtual private gateways. - VPNGatewayIDs []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` - - metadataDescribeVPNGatewaysInput `json:"-" xml:"-"` -} - -type metadataDescribeVPNGatewaysInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPNGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPNGatewaysInput) GoString() string { - return s.String() -} - -type DescribeVPNGatewaysOutput struct { - // Information about one or more virtual private gateways. - VPNGateways []*VPNGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` - - metadataDescribeVPNGatewaysOutput `json:"-" xml:"-"` -} - -type metadataDescribeVPNGatewaysOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DescribeVPNGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVPNGatewaysOutput) GoString() string { - return s.String() -} - type DescribeVolumeAttributeInput struct { // The instance attribute. Attribute *string `type:"string" enum:"VolumeAttributeName"` @@ -15104,7 +14560,7 @@ type DescribeVolumeAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataDescribeVolumeAttributeInput `json:"-" xml:"-"` } @@ -15131,7 +14587,7 @@ type DescribeVolumeAttributeOutput struct { ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` metadataDescribeVolumeAttributeOutput `json:"-" xml:"-"` } @@ -15209,7 +14665,7 @@ type DescribeVolumeStatusInput struct { // One or more volume IDs. // // Default: Describes all your volumes. - VolumeIDs []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` + VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` metadataDescribeVolumeStatusInput `json:"-" xml:"-"` } @@ -15326,7 +14782,7 @@ type DescribeVolumesInput struct { NextToken *string `locationName:"nextToken" type:"string"` // One or more volume IDs. - VolumeIDs []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` + VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` metadataDescribeVolumesInput `json:"-" xml:"-"` } @@ -15372,7 +14828,607 @@ func (s DescribeVolumesOutput) GoString() string { return s.String() } -type DetachClassicLinkVPCInput struct { +type DescribeVpcAttributeInput struct { + // The VPC attribute. + Attribute *string `type:"string" enum:"VpcAttributeName"` + + // 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. + VpcId *string `type:"string" required:"true"` + + metadataDescribeVpcAttributeInput `json:"-" xml:"-"` +} + +type metadataDescribeVpcAttributeInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcAttributeInput) GoString() string { + return s.String() +} + +type DescribeVpcAttributeOutput struct { + // Indicates whether the instances launched in the VPC get DNS hostnames. If + // this attribute is true, instances in the VPC get DNS hostnames; otherwise, + // they do not. + EnableDnsHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` + + // Indicates whether DNS resolution is enabled for the VPC. If this attribute + // is true, the Amazon DNS server resolves DNS hostnames for your instances + // to their corresponding IP addresses; otherwise, it does not. + EnableDnsSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataDescribeVpcAttributeOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpcAttributeOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcAttributeOutput) GoString() string { + return s.String() +} + +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. + // + // is-classic-link-enabled - Whether the VPC is enabled for ClassicLink (true + // | false). + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more VPCs for which you want to describe the ClassicLink status. + VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` + + metadataDescribeVpcClassicLinkInput `json:"-" xml:"-"` +} + +type metadataDescribeVpcClassicLinkInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcClassicLinkInput) GoString() string { + return s.String() +} + +type DescribeVpcClassicLinkOutput struct { + // The ClassicLink status of one or more VPCs. + Vpcs []*VpcClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` + + metadataDescribeVpcClassicLinkOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpcClassicLinkOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcClassicLinkOutput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s DescribeVpcEndpointServicesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointServicesInput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s DescribeVpcEndpointServicesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointServicesOutput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s DescribeVpcEndpointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointsInput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s DescribeVpcEndpointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcEndpointsOutput) GoString() string { + return s.String() +} + +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. + // + // accepter-vpc-info.cidr-block - The CIDR block of the peer VPC. + // + // accepter-vpc-info.owner-id - The AWS account ID of the owner of the peer + // VPC. + // + // accepter-vpc-info.vpc-id - The ID of the peer VPC. + // + // expiration-time - The expiration date and time for the VPC peering connection. + // + // requester-vpc-info.cidr-block - The CIDR block of the requester's VPC. + // + // requester-vpc-info.owner-id - The AWS account ID of the owner of the requester + // VPC. + // + // requester-vpc-info.vpc-id - The ID of the requester VPC. + // + // status-code - The status of the VPC peering connection (pending-acceptance + // | failed | expired | provisioning | active | deleted | rejected). + // + // status-message - A message that provides more information about the status + // of the VPC peering connection, if applicable. + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // vpc-peering-connection-id - The ID of the VPC peering connection. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more VPC peering connection IDs. + // + // Default: Describes all your VPC peering connections. + VpcPeeringConnectionIds []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` + + metadataDescribeVpcPeeringConnectionsInput `json:"-" xml:"-"` +} + +type metadataDescribeVpcPeeringConnectionsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcPeeringConnectionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcPeeringConnectionsInput) GoString() string { + return s.String() +} + +type DescribeVpcPeeringConnectionsOutput struct { + // Information about the VPC peering connections. + VpcPeeringConnections []*VpcPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` + + metadataDescribeVpcPeeringConnectionsOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpcPeeringConnectionsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcPeeringConnectionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcPeeringConnectionsOutput) GoString() string { + return s.String() +} + +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. + // + // cidr - The CIDR block of the VPC. The CIDR block you specify must exactly + // match the VPC's CIDR block for information to be returned for the VPC. Must + // contain the slash followed by one or two digits (for example, /28). + // + // dhcp-options-id - The ID of a set of DHCP options. + // + // isDefault - Indicates whether the VPC is the default VPC. + // + // state - The state of the VPC (pending | available). + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // vpc-id - The ID of the VPC. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more VPC IDs. + // + // Default: Describes all your VPCs. + VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` + + metadataDescribeVpcsInput `json:"-" xml:"-"` +} + +type metadataDescribeVpcsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcsInput) GoString() string { + return s.String() +} + +type DescribeVpcsOutput struct { + // Information about one or more VPCs. + Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` + + metadataDescribeVpcsOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpcsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpcsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpcsOutput) GoString() string { + return s.String() +} + +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. + // + // customer-gateway-configuration - The configuration information for the + // customer gateway. + // + // customer-gateway-id - The ID of a customer gateway associated with the + // VPN connection. + // + // state - The state of the VPN connection (pending | available | deleting + // | deleted). + // + // option.static-routes-only - Indicates whether the connection has static + // routes only. Used for devices that do not support Border Gateway Protocol + // (BGP). + // + // route.destination-cidr-block - The destination CIDR block. This corresponds + // to the subnet used in a customer data center. + // + // bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP + // device. + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // type - The type of VPN connection. Currently the only supported type is + // ipsec.1. + // + // vpn-connection-id - The ID of the VPN connection. + // + // vpn-gateway-id - The ID of a virtual private gateway associated with the + // VPN connection. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more VPN connection IDs. + // + // Default: Describes your VPN connections. + VpnConnectionIds []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` + + metadataDescribeVpnConnectionsInput `json:"-" xml:"-"` +} + +type metadataDescribeVpnConnectionsInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnConnectionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnConnectionsInput) GoString() string { + return s.String() +} + +type DescribeVpnConnectionsOutput struct { + // Information about one or more VPN connections. + VpnConnections []*VpnConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` + + metadataDescribeVpnConnectionsOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpnConnectionsOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnConnectionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnConnectionsOutput) GoString() string { + return s.String() +} + +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. + // + // attachment.state - The current state of the attachment between the gateway + // and the VPC (attaching | attached | detaching | detached). + // + // attachment.vpc-id - The ID of an attached VPC. + // + // availability-zone - The Availability Zone for the virtual private gateway. + // + // state - The state of the virtual private gateway (pending | available + // | deleting | deleted). + // + // tag:key=value - The key/value combination of a tag assigned to the resource. + // + // tag-key - The key of a tag assigned to the resource. This filter is independent + // of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" + // and the filter "tag-value=X", you get any resources assigned both the tag + // key Purpose (regardless of what the tag's value is), and the tag value X + // (regardless of what the tag's key is). If you want to list only resources + // where Purpose is X, see the tag:key=value filter. + // + // tag-value - The value of a tag assigned to the resource. This filter is + // independent of the tag-key filter. + // + // type - The type of virtual private gateway. Currently the only supported + // type is ipsec.1. + // + // vpn-gateway-id - The ID of the virtual private gateway. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more virtual private gateway IDs. + // + // Default: Describes all your virtual private gateways. + VpnGatewayIds []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` + + metadataDescribeVpnGatewaysInput `json:"-" xml:"-"` +} + +type metadataDescribeVpnGatewaysInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnGatewaysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnGatewaysInput) GoString() string { + return s.String() +} + +type DescribeVpnGatewaysOutput struct { + // Information about one or more virtual private gateways. + VpnGateways []*VpnGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` + + metadataDescribeVpnGatewaysOutput `json:"-" xml:"-"` +} + +type metadataDescribeVpnGatewaysOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DescribeVpnGatewaysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVpnGatewaysOutput) GoString() string { + return s.String() +} + +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, @@ -15380,46 +15436,46 @@ type DetachClassicLinkVPCInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance to unlink from the VPC. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // The ID of the VPC to which the instance is linked. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` - metadataDetachClassicLinkVPCInput `json:"-" xml:"-"` + metadataDetachClassicLinkVpcInput `json:"-" xml:"-"` } -type metadataDetachClassicLinkVPCInput struct { +type metadataDetachClassicLinkVpcInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DetachClassicLinkVPCInput) String() string { +func (s DetachClassicLinkVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetachClassicLinkVPCInput) GoString() string { +func (s DetachClassicLinkVpcInput) GoString() string { return s.String() } -type DetachClassicLinkVPCOutput struct { +type DetachClassicLinkVpcOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataDetachClassicLinkVPCOutput `json:"-" xml:"-"` + metadataDetachClassicLinkVpcOutput `json:"-" xml:"-"` } -type metadataDetachClassicLinkVPCOutput struct { +type metadataDetachClassicLinkVpcOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DetachClassicLinkVPCOutput) String() string { +func (s DetachClassicLinkVpcOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetachClassicLinkVPCOutput) GoString() string { +func (s DetachClassicLinkVpcOutput) GoString() string { return s.String() } @@ -15431,10 +15487,10 @@ type DetachInternetGatewayInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string" required:"true"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `locationName:"vpcId" type:"string" required:"true"` metadataDetachInternetGatewayInput `json:"-" xml:"-"` } @@ -15473,7 +15529,7 @@ func (s DetachInternetGatewayOutput) GoString() string { type DetachNetworkInterfaceInput struct { // The ID of the attachment. - AttachmentID *string `locationName:"attachmentId" type:"string" required:"true"` + 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 @@ -15519,54 +15575,6 @@ func (s DetachNetworkInterfaceOutput) GoString() string { return s.String() } -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. - VPCID *string `locationName:"VpcId" type:"string" required:"true"` - - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"VpnGatewayId" type:"string" required:"true"` - - metadataDetachVPNGatewayInput `json:"-" xml:"-"` -} - -type metadataDetachVPNGatewayInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DetachVPNGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVPNGatewayInput) GoString() string { - return s.String() -} - -type DetachVPNGatewayOutput struct { - metadataDetachVPNGatewayOutput `json:"-" xml:"-"` -} - -type metadataDetachVPNGatewayOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DetachVPNGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVPNGatewayOutput) GoString() string { - return s.String() -} - type DetachVolumeInput struct { // The device name. Device *string `type:"string"` @@ -15587,10 +15595,10 @@ type DetachVolumeInput struct { Force *bool `type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string"` + InstanceId *string `type:"string"` // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataDetachVolumeInput `json:"-" xml:"-"` } @@ -15609,49 +15617,7 @@ func (s DetachVolumeInput) GoString() string { return s.String() } -type DisableVGWRoutePropagationInput struct { - // The ID of the virtual private gateway. - GatewayID *string `locationName:"GatewayId" type:"string" required:"true"` - - // The ID of the route table. - RouteTableID *string `locationName:"RouteTableId" type:"string" required:"true"` - - metadataDisableVGWRoutePropagationInput `json:"-" xml:"-"` -} - -type metadataDisableVGWRoutePropagationInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DisableVGWRoutePropagationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVGWRoutePropagationInput) GoString() string { - return s.String() -} - -type DisableVGWRoutePropagationOutput struct { - metadataDisableVGWRoutePropagationOutput `json:"-" xml:"-"` -} - -type metadataDisableVGWRoutePropagationOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s DisableVGWRoutePropagationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVGWRoutePropagationOutput) GoString() string { - return s.String() -} - -type DisableVPCClassicLinkInput 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, @@ -15659,49 +15625,192 @@ type DisableVPCClassicLinkInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` + VpcId *string `type:"string" required:"true"` - metadataDisableVPCClassicLinkInput `json:"-" xml:"-"` + // The ID of the virtual private gateway. + VpnGatewayId *string `type:"string" required:"true"` + + metadataDetachVpnGatewayInput `json:"-" xml:"-"` } -type metadataDisableVPCClassicLinkInput struct { +type metadataDetachVpnGatewayInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DisableVPCClassicLinkInput) String() string { +func (s DetachVpnGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisableVPCClassicLinkInput) GoString() string { +func (s DetachVpnGatewayInput) GoString() string { return s.String() } -type DisableVPCClassicLinkOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` - - metadataDisableVPCClassicLinkOutput `json:"-" xml:"-"` +type DetachVpnGatewayOutput struct { + metadataDetachVpnGatewayOutput `json:"-" xml:"-"` } -type metadataDisableVPCClassicLinkOutput struct { +type metadataDetachVpnGatewayOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s DisableVPCClassicLinkOutput) String() string { +func (s DetachVpnGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisableVPCClassicLinkOutput) GoString() string { +func (s DetachVpnGatewayOutput) GoString() string { + return s.String() +} + +// Describes a DHCP configuration option. +type DhcpConfiguration struct { + // The name of a DHCP option. + Key *string `locationName:"key" type:"string"` + + // One or more values for the DHCP option. + Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` + + metadataDhcpConfiguration `json:"-" xml:"-"` +} + +type metadataDhcpConfiguration struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DhcpConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DhcpConfiguration) GoString() string { + return s.String() +} + +// Describes a set of DHCP options. +type DhcpOptions struct { + // One or more DHCP options in the set. + DhcpConfigurations []*DhcpConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` + + // The ID of the set of DHCP options. + DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` + + // Any tags assigned to the DHCP options set. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + metadataDhcpOptions `json:"-" xml:"-"` +} + +type metadataDhcpOptions struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DhcpOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DhcpOptions) GoString() string { + return s.String() +} + +type DisableVgwRoutePropagationInput struct { + // The ID of the virtual private gateway. + GatewayId *string `type:"string" required:"true"` + + // The ID of the route table. + RouteTableId *string `type:"string" required:"true"` + + metadataDisableVgwRoutePropagationInput `json:"-" xml:"-"` +} + +type metadataDisableVgwRoutePropagationInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DisableVgwRoutePropagationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVgwRoutePropagationInput) GoString() string { + return s.String() +} + +type DisableVgwRoutePropagationOutput struct { + metadataDisableVgwRoutePropagationOutput `json:"-" xml:"-"` +} + +type metadataDisableVgwRoutePropagationOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DisableVgwRoutePropagationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVgwRoutePropagationOutput) GoString() string { + return s.String() +} + +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. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` + + metadataDisableVpcClassicLinkInput `json:"-" xml:"-"` +} + +type metadataDisableVpcClassicLinkInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DisableVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVpcClassicLinkInput) GoString() string { + return s.String() +} + +type DisableVpcClassicLinkOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataDisableVpcClassicLinkOutput `json:"-" xml:"-"` +} + +type metadataDisableVpcClassicLinkOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s DisableVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableVpcClassicLinkOutput) GoString() string { return s.String() } type DisassociateAddressInput struct { // [EC2-VPC] The association ID. Required for EC2-VPC. - AssociationID *string `locationName:"AssociationId" type:"string"` + AssociationId *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 @@ -15710,7 +15819,7 @@ type DisassociateAddressInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataDisassociateAddressInput `json:"-" xml:"-"` } @@ -15750,7 +15859,7 @@ func (s DisassociateAddressOutput) GoString() string { type DisassociateRouteTableInput struct { // The association ID representing the current association between the route // table and subnet. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + 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 @@ -15834,7 +15943,7 @@ type DiskImageDescription struct { // Request Authentication Alternative" section of the Authenticating REST Requests // (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) // topic in the Amazon Simple Storage Service Developer Guide. - ImportManifestURL *string `locationName:"importManifestUrl" type:"string" required:"true"` + ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` // The size of the disk image, in GiB. Size *int64 `locationName:"size" type:"long" required:"true"` @@ -15869,7 +15978,7 @@ type DiskImageDetail struct { // URL for an Amazon S3 object, read the "Query String Request Authentication // Alternative" section of the Authenticating REST Requests (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) // topic in the Amazon Simple Storage Service Developer Guide. - ImportManifestURL *string `locationName:"importManifestUrl" type:"string" required:"true"` + ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` metadataDiskImageDetail `json:"-" xml:"-"` } @@ -15891,7 +16000,7 @@ func (s DiskImageDetail) GoString() string { // Describes a disk image volume. type DiskImageVolumeDescription struct { // The volume identifier. - ID *string `locationName:"id" type:"string" required:"true"` + Id *string `locationName:"id" type:"string" required:"true"` // The size of the volume, in GiB. Size *int64 `locationName:"size" type:"long"` @@ -15914,7 +16023,7 @@ func (s DiskImageVolumeDescription) GoString() string { } // Describes a block device for an EBS volume. -type EBSBlockDevice struct { +type EbsBlockDevice struct { // Indicates whether the EBS volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -15935,10 +16044,10 @@ type EBSBlockDevice struct { // // Condition: This parameter is required for requests to create io1 volumes; // it is not used in requests to create standard or gp2 volumes. - IOPS *int64 `locationName:"iops" type:"integer"` + Iops *int64 `locationName:"iops" type:"integer"` // The ID of the snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // The size of the volume, in GiB. // @@ -15956,25 +16065,25 @@ type EBSBlockDevice struct { // Default: standard VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` - metadataEBSBlockDevice `json:"-" xml:"-"` + metadataEbsBlockDevice `json:"-" xml:"-"` } -type metadataEBSBlockDevice struct { +type metadataEbsBlockDevice struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s EBSBlockDevice) String() string { +func (s EbsBlockDevice) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EBSBlockDevice) GoString() string { +func (s EbsBlockDevice) GoString() string { return s.String() } // Describes a parameter used to set up an EBS volume in a block device mapping. -type EBSInstanceBlockDevice struct { +type EbsInstanceBlockDevice struct { // The time stamp when the attachment initiated. AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` @@ -15985,136 +16094,88 @@ type EBSInstanceBlockDevice struct { Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` // The ID of the EBS volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` - metadataEBSInstanceBlockDevice `json:"-" xml:"-"` + metadataEbsInstanceBlockDevice `json:"-" xml:"-"` } -type metadataEBSInstanceBlockDevice struct { +type metadataEbsInstanceBlockDevice struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s EBSInstanceBlockDevice) String() string { +func (s EbsInstanceBlockDevice) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EBSInstanceBlockDevice) GoString() string { +func (s EbsInstanceBlockDevice) GoString() string { return s.String() } -type EBSInstanceBlockDeviceSpecification struct { +type EbsInstanceBlockDeviceSpecification struct { // Indicates whether the volume is deleted on instance termination. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // The ID of the EBS volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` - metadataEBSInstanceBlockDeviceSpecification `json:"-" xml:"-"` + metadataEbsInstanceBlockDeviceSpecification `json:"-" xml:"-"` } -type metadataEBSInstanceBlockDeviceSpecification struct { +type metadataEbsInstanceBlockDeviceSpecification struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s EBSInstanceBlockDeviceSpecification) String() string { +func (s EbsInstanceBlockDeviceSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EBSInstanceBlockDeviceSpecification) GoString() string { +func (s EbsInstanceBlockDeviceSpecification) GoString() string { return s.String() } -type EnableVGWRoutePropagationInput struct { +type EnableVgwRoutePropagationInput struct { // The ID of the virtual private gateway. - GatewayID *string `locationName:"GatewayId" type:"string" required:"true"` + GatewayId *string `type:"string" required:"true"` // The ID of the route table. - RouteTableID *string `locationName:"RouteTableId" type:"string" required:"true"` + RouteTableId *string `type:"string" required:"true"` - metadataEnableVGWRoutePropagationInput `json:"-" xml:"-"` + metadataEnableVgwRoutePropagationInput `json:"-" xml:"-"` } -type metadataEnableVGWRoutePropagationInput struct { +type metadataEnableVgwRoutePropagationInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s EnableVGWRoutePropagationInput) String() string { +func (s EnableVgwRoutePropagationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnableVGWRoutePropagationInput) GoString() string { +func (s EnableVgwRoutePropagationInput) GoString() string { return s.String() } -type EnableVGWRoutePropagationOutput struct { - metadataEnableVGWRoutePropagationOutput `json:"-" xml:"-"` +type EnableVgwRoutePropagationOutput struct { + metadataEnableVgwRoutePropagationOutput `json:"-" xml:"-"` } -type metadataEnableVGWRoutePropagationOutput struct { +type metadataEnableVgwRoutePropagationOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s EnableVGWRoutePropagationOutput) String() string { +func (s EnableVgwRoutePropagationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnableVGWRoutePropagationOutput) GoString() string { - return s.String() -} - -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. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` - - metadataEnableVPCClassicLinkInput `json:"-" xml:"-"` -} - -type metadataEnableVPCClassicLinkInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s EnableVPCClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVPCClassicLinkInput) GoString() string { - return s.String() -} - -type EnableVPCClassicLinkOutput struct { - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` - - metadataEnableVPCClassicLinkOutput `json:"-" xml:"-"` -} - -type metadataEnableVPCClassicLinkOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s EnableVPCClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVPCClassicLinkOutput) GoString() string { +func (s EnableVgwRoutePropagationOutput) GoString() string { return s.String() } @@ -16126,7 +16187,7 @@ type EnableVolumeIOInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string" required:"true"` + VolumeId *string `locationName:"volumeId" type:"string" required:"true"` metadataEnableVolumeIOInput `json:"-" xml:"-"` } @@ -16163,6 +16224,54 @@ func (s EnableVolumeIOOutput) GoString() string { return s.String() } +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. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` + + metadataEnableVpcClassicLinkInput `json:"-" xml:"-"` +} + +type metadataEnableVpcClassicLinkInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s EnableVpcClassicLinkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVpcClassicLinkInput) GoString() string { + return s.String() +} + +type EnableVpcClassicLinkOutput struct { + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` + + metadataEnableVpcClassicLinkOutput `json:"-" xml:"-"` +} + +type metadataEnableVpcClassicLinkOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s EnableVpcClassicLinkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableVpcClassicLinkOutput) GoString() string { + return s.String() +} + // Describes a Spot fleet event. type EventInformation struct { // The description of the event. @@ -16172,39 +16281,48 @@ type EventInformation struct { // // The following are the error events. // - // iamFleetRoleInvalid - Spot fleet did not have the required permissions + // iamFleetRoleInvalid - The Spot fleet did not have the required permissions // either to launch or terminate an instance. // + // launchSpecTemporarilyBlacklisted - The configuration is not valid and + // several attempts to launch instances have failed. For more information, see + // the description of the event. + // // spotFleetRequestConfigurationInvalid - The configuration is not valid. - // For more information, see the description. + // For more information, see the description of the event. // // spotInstanceCountLimitExceeded - You've reached the limit on the number - // of Spot Instances that you can launch. + // 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. + // to maintain the target number of running Spot instances. // - // cancelled - The Spot fleet is canceled and has no 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. + // Spot instances, but its existing Spot instances continue to run until they + // are interrupted or terminated. // - // cancelled_terminating - The Spot fleet is canceled and its Spot Instances + // 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 + // that the instances were terminated, if the request was created with TerminateInstancesWithExpiration // set. // + // modify_in_progress - A request to modify the Spot fleet request was accepted + // and is in progress. + // + // modify_successful - The Spot fleet request was modified. + // // 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. + // preparing to launch the target number of Spot instances. // // The following are the instanceChange events. // @@ -16215,7 +16333,7 @@ type EventInformation struct { // The ID of the instance. This information is available only for instanceChange // events. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` metadataEventInformation `json:"-" xml:"-"` } @@ -16240,7 +16358,7 @@ type ExportTask struct { Description *string `locationName:"description" type:"string"` // The ID of the export task. - ExportTaskID *string `locationName:"exportTaskId" type:"string"` + ExportTaskId *string `locationName:"exportTaskId" type:"string"` // Information about the export task. ExportToS3Task *ExportToS3Task `locationName:"exportToS3" type:"structure"` @@ -16378,13 +16496,13 @@ type FlowLog struct { DeliverLogsErrorMessage *string `locationName:"deliverLogsErrorMessage" type:"string"` // The ARN of the IAM role that posts logs to CloudWatch Logs. - DeliverLogsPermissionARN *string `locationName:"deliverLogsPermissionArn" type:"string"` + DeliverLogsPermissionArn *string `locationName:"deliverLogsPermissionArn" type:"string"` // The status of the logs delivery (SUCCESS | FAILED). DeliverLogsStatus *string `locationName:"deliverLogsStatus" type:"string"` // The flow log ID. - FlowLogID *string `locationName:"flowLogId" type:"string"` + FlowLogId *string `locationName:"flowLogId" type:"string"` // The status of the flow log (ACTIVE). FlowLogStatus *string `locationName:"flowLogStatus" type:"string"` @@ -16393,7 +16511,7 @@ type FlowLog struct { LogGroupName *string `locationName:"logGroupName" type:"string"` // The ID of the resource on which the flow log was created. - ResourceID *string `locationName:"resourceId" type:"string"` + ResourceId *string `locationName:"resourceId" type:"string"` // The type of traffic captured for the flow log. TrafficType *string `locationName:"trafficType" type:"string" enum:"TrafficType"` @@ -16423,7 +16541,7 @@ type GetConsoleOutputInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` metadataGetConsoleOutputInput `json:"-" xml:"-"` } @@ -16444,7 +16562,7 @@ func (s GetConsoleOutputInput) GoString() string { type GetConsoleOutputOutput struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The console output, Base64 encoded. Output *string `locationName:"output" type:"string"` @@ -16477,7 +16595,7 @@ type GetPasswordDataInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the Windows instance. - InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` + InstanceId *string `type:"string" required:"true"` metadataGetPasswordDataInput `json:"-" xml:"-"` } @@ -16498,7 +16616,7 @@ func (s GetPasswordDataInput) GoString() string { type GetPasswordDataOutput struct { // The ID of the Windows instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The password of the instance. PasswordData *string `locationName:"passwordData" type:"string"` @@ -16526,7 +16644,7 @@ func (s GetPasswordDataOutput) GoString() string { // Describes a security group. type GroupIdentifier struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. GroupName *string `locationName:"groupName" type:"string"` @@ -16584,149 +16702,77 @@ func (s HistoryRecord) GoString() string { } // Describes an IAM instance profile. -type IAMInstanceProfile struct { +type IamInstanceProfile struct { // The Amazon Resource Name (ARN) of the instance profile. - ARN *string `locationName:"arn" type:"string"` + Arn *string `locationName:"arn" type:"string"` // The ID of the instance profile. - ID *string `locationName:"id" type:"string"` + Id *string `locationName:"id" type:"string"` - metadataIAMInstanceProfile `json:"-" xml:"-"` + metadataIamInstanceProfile `json:"-" xml:"-"` } -type metadataIAMInstanceProfile struct { +type metadataIamInstanceProfile struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s IAMInstanceProfile) String() string { +func (s IamInstanceProfile) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IAMInstanceProfile) GoString() string { +func (s IamInstanceProfile) GoString() string { return s.String() } // Describes an IAM instance profile. -type IAMInstanceProfileSpecification struct { +type IamInstanceProfileSpecification struct { // The Amazon Resource Name (ARN) of the instance profile. - ARN *string `locationName:"arn" type:"string"` + Arn *string `locationName:"arn" type:"string"` // The name of the instance profile. Name *string `locationName:"name" type:"string"` - metadataIAMInstanceProfileSpecification `json:"-" xml:"-"` + metadataIamInstanceProfileSpecification `json:"-" xml:"-"` } -type metadataIAMInstanceProfileSpecification struct { +type metadataIamInstanceProfileSpecification struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s IAMInstanceProfileSpecification) String() string { +func (s IamInstanceProfileSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IAMInstanceProfileSpecification) GoString() string { +func (s IamInstanceProfileSpecification) GoString() string { return s.String() } // Describes the ICMP type and code. -type ICMPTypeCode struct { +type IcmpTypeCode struct { // The ICMP type. A value of -1 means all types. Code *int64 `locationName:"code" type:"integer"` // The ICMP code. A value of -1 means all codes for the specified ICMP type. Type *int64 `locationName:"type" type:"integer"` - metadataICMPTypeCode `json:"-" xml:"-"` + metadataIcmpTypeCode `json:"-" xml:"-"` } -type metadataICMPTypeCode struct { +type metadataIcmpTypeCode struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ICMPTypeCode) String() string { +func (s IcmpTypeCode) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ICMPTypeCode) GoString() string { - return s.String() -} - -// Describes a security group rule. -type IPPermission struct { - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // A value of -1 indicates all ICMP types. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The protocol. - // - // When you call DescribeSecurityGroups, the protocol value returned is the - // number. Exception: For TCP, UDP, and ICMP, the value returned is the name - // (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol - // Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). - // (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to - // specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` - - // 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"` - - // One or more security group and AWS account ID pairs. - UserIDGroupPairs []*UserIDGroupPair `locationName:"groups" locationNameList:"item" type:"list"` - - metadataIPPermission `json:"-" xml:"-"` -} - -type metadataIPPermission struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s IPPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPPermission) GoString() string { - return s.String() -} - -// Describes an IP range. -type IPRange struct { - // The CIDR range. You can either specify a CIDR range or a source security - // group, not both. - CIDRIP *string `locationName:"cidrIp" type:"string"` - - metadataIPRange `json:"-" xml:"-"` -} - -type metadataIPRange struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s IPRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IPRange) GoString() string { +func (s IcmpTypeCode) GoString() string { return s.String() } @@ -16748,7 +16794,7 @@ type Image struct { Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The location of the AMI. ImageLocation *string `locationName:"imageLocation" type:"string"` @@ -16762,13 +16808,13 @@ type Image struct { // The kernel associated with the image, if any. Only applicable for machine // images. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the AMI that was provided during image creation. Name *string `locationName:"name" type:"string"` // The AWS account ID of the image owner. - OwnerID *string `locationName:"imageOwnerId" type:"string"` + OwnerId *string `locationName:"imageOwnerId" type:"string"` // The value is Windows for Windows AMIs; otherwise blank. Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` @@ -16783,7 +16829,7 @@ type Image struct { // The RAM disk associated with the image, if any. Only applicable for machine // images. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The device name of the root device (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` @@ -16793,7 +16839,7 @@ type Image struct { RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` // Specifies whether enhanced networking is enabled. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The current state of the AMI. If the state is available, the image is successfully // registered and can be used to launch an instance. @@ -16839,11 +16885,11 @@ type ImageDiskContainer struct { Format *string `type:"string"` // The ID of the EBS snapshot to be used for importing the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string"` + SnapshotId *string `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"` + Url *string `type:"string"` // The S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` @@ -16940,10 +16986,10 @@ type ImportImageOutput struct { Hypervisor *string `locationName:"hypervisor" type:"string"` // The ID of the Amazon Machine Image (AMI) created by the import task. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The task ID of the import image task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -16996,10 +17042,10 @@ type ImportImageTask struct { Hypervisor *string `locationName:"hypervisor" type:"string"` // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The ID of the import image task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -17081,7 +17127,7 @@ type ImportInstanceLaunchSpecification struct { Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` // One or more security group IDs. - GroupIDs []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` + GroupIds []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` // One or more security group names. GroupNames []*string `locationName:"GroupName" locationNameList:"SecurityGroup" type:"list"` @@ -17102,10 +17148,10 @@ type ImportInstanceLaunchSpecification struct { Placement *Placement `locationName:"placement" type:"structure"` // [EC2-VPC] An available IP address from the IP address range of the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // [EC2-VPC] The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to be made available to the instance. UserData *UserData `locationName:"userData" type:"structure"` @@ -17154,7 +17200,7 @@ type ImportInstanceTaskDetails struct { Description *string `locationName:"description" type:"string"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The instance operating system. Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` @@ -17318,7 +17364,7 @@ type ImportSnapshotOutput struct { Description *string `locationName:"description" type:"string"` // The ID of the import snapshot task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // Information about the import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` @@ -17346,7 +17392,7 @@ type ImportSnapshotTask struct { Description *string `locationName:"description" type:"string"` // The ID of the import snapshot task. - ImportTaskID *string `locationName:"importTaskId" type:"string"` + ImportTaskId *string `locationName:"importTaskId" type:"string"` // Describes an import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` @@ -17463,7 +17509,7 @@ func (s ImportVolumeTaskDetails) GoString() string { type Instance struct { // The AMI launch index, which can be used to find this instance in the launch // group. - AMILaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` + AmiLaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` // The architecture of the image. Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` @@ -17471,7 +17517,7 @@ type Instance struct { // Any block device mapping entries for the instance. BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - // The idempotency token you provided when you launched the instance. + // The idempotency token you provided when you launched the instance, if applicable. ClientToken *string `locationName:"clientToken" type:"string"` // Indicates whether the instance is optimized for EBS I/O. This optimization @@ -17479,19 +17525,19 @@ type Instance struct { // stack to provide optimal I/O performance. This optimization isn't available // with all instance types. Additional usage charges apply when using an EBS // Optimized instance. - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The hypervisor type of the instance. Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` - // The IAM instance profile associated with the instance. - IAMInstanceProfile *IAMInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` + // The IAM instance profile associated with the instance, if applicable. + IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI used to launch the instance. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // Indicates whether this is a Spot Instance. InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string" enum:"InstanceLifecycleType"` @@ -17499,8 +17545,8 @@ type Instance struct { // The instance type. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - // The kernel associated with this instance. - KernelID *string `locationName:"kernelId" type:"string"` + // The kernel associated with this instance, if applicable. + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair, if this instance was launched with an associated // key pair. @@ -17515,7 +17561,7 @@ type Instance struct { // [EC2-VPC] One or more network interfaces for the instance. NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - // The location where the instance launched. + // The location where the instance launched, if applicable. Placement *Placement `locationName:"placement" type:"structure"` // The value is Windows for Windows instances; otherwise blank. @@ -17523,24 +17569,26 @@ type Instance struct { // The private DNS name assigned to the instance. This DNS name can only be // used inside the Amazon EC2 network. This name is not available until the - // instance enters the running state. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + // instance enters the running state. For EC2-VPC, this name is only available + // if you've enabled DNS hostnames for your VPC. + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address assigned to the instance. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - // The product codes attached to this instance. + // The product codes attached to this instance, if applicable. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` // The public DNS name assigned to the instance. This name is not available - // until the instance enters the running state. - PublicDNSName *string `locationName:"dnsName" type:"string"` + // until the instance enters the running state. For EC2-VPC, this name is only + // available if you've enabled DNS hostnames for your VPC. + PublicDnsName *string `locationName:"dnsName" type:"string"` - // The public IP address assigned to the instance. - PublicIPAddress *string `locationName:"ipAddress" type:"string"` + // The public IP address assigned to the instance, if applicable. + PublicIpAddress *string `locationName:"ipAddress" type:"string"` - // The RAM disk associated with this instance. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + // The RAM disk associated with this instance, if applicable. + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The root device name (for example, /dev/sda1 or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` @@ -17549,9 +17597,6 @@ type Instance struct { // instance store volume. RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - // Specifies whether enhanced networking is enabled. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` - // One or more security groups for the instance. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` @@ -17563,8 +17608,11 @@ type Instance struct { // in the Amazon Virtual Private Cloud User Guide. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // If the request is a Spot instance request, the ID of the request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` + + // Specifies whether enhanced networking is enabled. + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The current state of the instance. State *InstanceState `locationName:"instanceState" type:"structure"` @@ -17575,18 +17623,18 @@ type Instance struct { // The reason for the most recent state transition. This might be an empty string. StateTransitionReason *string `locationName:"reason" type:"string"` - // The ID of the subnet in which the instance is running. - SubnetID *string `locationName:"subnetId" type:"string"` + // [EC2-VPC] The ID of the subnet in which the instance is running. + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the instance. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the VPC in which the instance is running. - VPCID *string `locationName:"vpcId" type:"string"` - // The virtualization type of the instance. VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` + // [EC2-VPC] The ID of the VPC in which the instance is running. + VpcId *string `locationName:"vpcId" type:"string"` + metadataInstance `json:"-" xml:"-"` } @@ -17611,7 +17659,7 @@ type InstanceBlockDeviceMapping struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSInstanceBlockDevice `locationName:"ebs" type:"structure"` + Ebs *EbsInstanceBlockDevice `locationName:"ebs" type:"structure"` metadataInstanceBlockDeviceMapping `json:"-" xml:"-"` } @@ -17637,7 +17685,7 @@ type InstanceBlockDeviceMappingSpecification struct { // Parameters used to automatically set up EBS volumes when the instance is // launched. - EBS *EBSInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` + Ebs *EbsInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` // suppress the specified device included in the block device mapping. NoDevice *string `locationName:"noDevice" type:"string"` @@ -17690,7 +17738,7 @@ func (s InstanceCount) GoString() string { // Describes an instance to export. type InstanceExportDetails struct { // The ID of the resource being exported. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The target virtualization environment. TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` @@ -17715,7 +17763,7 @@ func (s InstanceExportDetails) GoString() string { // Describes the monitoring information of the instance. type InstanceMonitoring struct { // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The monitoring information. Monitoring *Monitoring `locationName:"monitoring" type:"structure"` @@ -17753,22 +17801,22 @@ type InstanceNetworkInterface struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The MAC address. - MACAddress *string `locationName:"macAddress" type:"string"` + MacAddress *string `locationName:"macAddress" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the AWS account that created the network interface. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The IP address of the network interface within the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The private IP addresses associated with the network interface. - PrivateIPAddresses []*InstancePrivateIPAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` + PrivateIpAddresses []*InstancePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` // Indicates whether to validate network traffic to or from this network interface. SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` @@ -17777,10 +17825,10 @@ type InstanceNetworkInterface struct { Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataInstanceNetworkInterface `json:"-" xml:"-"` } @@ -17802,13 +17850,13 @@ func (s InstanceNetworkInterface) GoString() string { // Describes association information for an Elastic IP address. type InstanceNetworkInterfaceAssociation struct { // The ID of the owner of the Elastic IP address. - IPOwnerID *string `locationName:"ipOwnerId" type:"string"` + IpOwnerId *string `locationName:"ipOwnerId" type:"string"` // The public DNS name. - PublicDNSName *string `locationName:"publicDnsName" type:"string"` + PublicDnsName *string `locationName:"publicDnsName" type:"string"` // The public IP address or Elastic IP address bound to the network interface. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataInstanceNetworkInterfaceAssociation `json:"-" xml:"-"` } @@ -17833,7 +17881,7 @@ type InstanceNetworkInterfaceAttachment struct { AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -17868,7 +17916,7 @@ type InstanceNetworkInterfaceSpecification struct { // for eth0, and can only be assigned to a new network interface, not an existing // one. You cannot specify more than one network interface in the request. If // launching into a default subnet, the default value is true. - AssociatePublicIPAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` + AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` // If set to true, the interface is deleted when the instance is terminated. // You can specify true only if creating a new network interface when launching @@ -17889,24 +17937,24 @@ type InstanceNetworkInterfaceSpecification struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The private IP address of the network interface. Applies only if creating // a network interface when launching an instance. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // One or more private IP addresses to assign to the network interface. Only // one private IP address can be designated as primary. - PrivateIPAddresses []*PrivateIPAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` + PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` // The number of secondary private IP addresses. You can't specify this option // and specify more than one private IP address using the private IP addresses // option. - SecondaryPrivateIPAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` + SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` // The ID of the subnet associated with the network string. Applies only if // creating a network interface when launching an instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` metadataInstanceNetworkInterfaceSpecification `json:"-" xml:"-"` } @@ -17926,7 +17974,7 @@ func (s InstanceNetworkInterfaceSpecification) GoString() string { } // Describes a private IP address. -type InstancePrivateIPAddress struct { +type InstancePrivateIpAddress struct { // The association information for an Elastic IP address for the network interface. Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` @@ -17935,25 +17983,25 @@ type InstancePrivateIPAddress struct { Primary *bool `locationName:"primary" type:"boolean"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address of the network interface. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - metadataInstancePrivateIPAddress `json:"-" xml:"-"` + metadataInstancePrivateIpAddress `json:"-" xml:"-"` } -type metadataInstancePrivateIPAddress struct { +type metadataInstancePrivateIpAddress struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s InstancePrivateIPAddress) String() string { +func (s InstancePrivateIpAddress) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstancePrivateIPAddress) GoString() string { +func (s InstancePrivateIpAddress) GoString() string { return s.String() } @@ -18001,7 +18049,7 @@ type InstanceStateChange struct { CurrentState *InstanceState `locationName:"currentState" type:"structure"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The previous state of the instance. PreviousState *InstanceState `locationName:"previousState" type:"structure"` @@ -18032,7 +18080,7 @@ type InstanceStatus struct { Events []*InstanceStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The intended state of the instance. DescribeInstanceStatus requires that // an instance be in the running state. @@ -18159,7 +18207,7 @@ type InternetGateway struct { Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` // The ID of the Internet gateway. - InternetGatewayID *string `locationName:"internetGatewayId" type:"string"` + InternetGatewayId *string `locationName:"internetGatewayId" type:"string"` // Any tags assigned to the Internet gateway. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` @@ -18187,7 +18235,7 @@ type InternetGatewayAttachment struct { State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataInternetGatewayAttachment `json:"-" xml:"-"` } @@ -18206,6 +18254,78 @@ func (s InternetGatewayAttachment) GoString() string { return s.String() } +// Describes a security group rule. +type IpPermission struct { + // The start of port range for the TCP and UDP protocols, or an ICMP type number. + // A value of -1 indicates all ICMP types. + FromPort *int64 `locationName:"fromPort" type:"integer"` + + // The protocol. + // + // When you call DescribeSecurityGroups, the protocol value returned is the + // number. Exception: For TCP, UDP, and ICMP, the value returned is the name + // (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol + // Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). + // (VPC only) When you call AuthorizeSecurityGroupIngress, you can use -1 to + // specify all. + IpProtocol *string `locationName:"ipProtocol" type:"string"` + + // 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"` + + // One or more security group and AWS account ID pairs. + UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` + + metadataIpPermission `json:"-" xml:"-"` +} + +type metadataIpPermission struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s IpPermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IpPermission) GoString() string { + return s.String() +} + +// Describes an IP range. +type IpRange struct { + // The CIDR range. You can either specify a CIDR range or a source security + // group, not both. + CidrIp *string `locationName:"cidrIp" type:"string"` + + metadataIpRange `json:"-" xml:"-"` +} + +type metadataIpRange struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s IpRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IpRange) GoString() string { + return s.String() +} + // Describes a key pair. type KeyPairInfo struct { // If you used CreateKeyPair to create the key pair, this is the SHA-1 digest @@ -18240,7 +18360,7 @@ type LaunchPermission struct { Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` // The AWS account ID. - UserID *string `locationName:"userId" type:"string"` + UserId *string `locationName:"userId" type:"string"` metadataLaunchPermission `json:"-" xml:"-"` } @@ -18300,19 +18420,19 @@ type LaunchSpecification struct { // Optimized instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The instance type. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` @@ -18327,16 +18447,15 @@ type LaunchSpecification struct { Placement *SpotPlacement `locationName:"placement" type:"structure"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` - // One or more security groups. To request an instance in a nondefault VPC, - // you must specify the ID of the security group. To request an instance in - // EC2-Classic or a default VPC, you can specify the name or the ID of the security - // group. + // One or more security groups. When requesting instances in a VPC, you must + // specify the IDs of the security groups. When requesting instances in EC2-Classic, + // you can specify the names or the IDs of the security groups. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to make available to the instances. UserData *string `locationName:"userData" type:"string"` @@ -18372,13 +18491,13 @@ type ModifyImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` // A launch permission modification. LaunchPermission *LaunchPermissionModifications `type:"structure"` // The operation type. - OperationType *string `type:"string"` + OperationType *string `type:"string" enum:"OperationType"` // One or more product codes. After you add a product code to an AMI, it can't // be removed. This is only valid when modifying the productCodes attribute. @@ -18390,7 +18509,7 @@ type ModifyImageAttributeInput struct { // One or more AWS account IDs. This is only valid when modifying the launchPermission // attribute. - UserIDs []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` + UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` // The value of the attribute being modified. This is only valid when modifying // the description attribute. @@ -18447,8 +18566,9 @@ type ModifyInstanceAttributeInput struct { BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` // If the value is true, you can't terminate the instance using the Amazon EC2 - // console, CLI, or API; otherwise, you can. - DisableAPITermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` + // console, CLI, or API; otherwise, you can. You cannot use this paramater for + // Spot Instances. + 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 @@ -18461,7 +18581,7 @@ type ModifyInstanceAttributeInput struct { // 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. - EBSOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` + EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` // [EC2-VPC] Changes the security groups of the instance. You must specify at // least one security group, even if it's just the default security group for @@ -18469,7 +18589,7 @@ type ModifyInstanceAttributeInput struct { Groups []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` // Specifies whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). @@ -18488,7 +18608,12 @@ type ModifyInstanceAttributeInput struct { // Changes the instance's RAM disk to the specified value. We recommend that // you use PV-GRUB instead of kernels and RAM disks. For more information, see // PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - RAMDisk *AttributeValue `locationName:"ramdisk" type:"structure"` + Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"` + + // Specifies whether source/destination checking is enabled. A value of true + // means that checking is enabled, and false means checking is disabled. This + // value must be false for a NAT instance to perform NAT. + SourceDestCheck *AttributeBooleanValue `type:"structure"` // Set to simple to enable enhanced networking for the instance. // @@ -18496,18 +18621,13 @@ type ModifyInstanceAttributeInput struct { // // This option is supported only for HVM instances. Specifying this option // with a PV instance can make it unreachable. - SRIOVNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // Specifies whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means checking is disabled. This - // value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `type:"structure"` + SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` // Changes the instance's user data to the specified value. UserData *BlobAttributeValue `locationName:"userData" type:"structure"` // A new value for the attribute. Use only with the kernel, ramdisk, userData, - // disableApiTermination, or intanceInitiateShutdownBehavior attribute. + // disableApiTermination, or instanceInitiatedShutdownBehavior attribute. Value *string `locationName:"value" type:"string"` metadataModifyInstanceAttributeInput `json:"-" xml:"-"` @@ -18566,7 +18686,7 @@ type ModifyNetworkInterfaceAttributeInput struct { Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // Indicates whether source/destination checking is enabled. A value of true // means checking is enabled, and false means checking is disabled. This value @@ -18616,7 +18736,7 @@ type ModifyReservedInstancesInput struct { ClientToken *string `locationName:"clientToken" type:"string"` // The IDs of the Reserved Instances to modify. - ReservedInstancesIDs []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` + ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` // The configuration settings for the Reserved Instances to modify. TargetConfigurations []*ReservedInstancesConfiguration `locationName:"ReservedInstancesConfigurationSetItemType" locationNameList:"item" type:"list" required:"true"` @@ -18640,7 +18760,7 @@ func (s ModifyReservedInstancesInput) GoString() string { type ModifyReservedInstancesOutput struct { // The ID for the modification. - ReservedInstancesModificationID *string `locationName:"reservedInstancesModificationId" type:"string"` + ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` metadataModifyReservedInstancesOutput `json:"-" xml:"-"` } @@ -18678,13 +18798,13 @@ type ModifySnapshotAttributeInput struct { GroupNames []*string `locationName:"UserGroup" locationNameList:"GroupName" type:"list"` // The type of operation to perform to the attribute. - OperationType *string `type:"string"` + OperationType *string `type:"string" enum:"OperationType"` // The ID of the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` // The account ID to modify for the snapshot. - UserIDs []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` + UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` metadataModifySnapshotAttributeInput `json:"-" xml:"-"` } @@ -18721,13 +18841,65 @@ func (s ModifySnapshotAttributeOutput) GoString() string { return s.String() } +// Contains the parameters for ModifySpotFleetRequest. +type ModifySpotFleetRequestInput struct { + // Indicates whether running Spot instances should be terminated if the target + // capacity of the Spot fleet request is decreased below the current size of + // the Spot fleet. + ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` + + // The ID of the Spot fleet request. + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + + // The size of the fleet. + TargetCapacity *int64 `locationName:"targetCapacity" type:"integer"` + + metadataModifySpotFleetRequestInput `json:"-" xml:"-"` +} + +type metadataModifySpotFleetRequestInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifySpotFleetRequestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySpotFleetRequestInput) GoString() string { + return s.String() +} + +// Contains the output of ModifySpotFleetRequest. +type ModifySpotFleetRequestOutput struct { + // Is true if the request succeeds, and an error otherwise. + Return *bool `locationName:"return" type:"boolean"` + + metadataModifySpotFleetRequestOutput `json:"-" xml:"-"` +} + +type metadataModifySpotFleetRequestOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifySpotFleetRequestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifySpotFleetRequestOutput) GoString() string { + return s.String() +} + type ModifySubnetAttributeInput struct { // Specify true to indicate that instances launched into the specified subnet // should be assigned public IP address. - MapPublicIPOnLaunch *AttributeBooleanValue `locationName:"MapPublicIpOnLaunch" type:"structure"` + MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string" required:"true"` + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` metadataModifySubnetAttributeInput `json:"-" xml:"-"` } @@ -18764,120 +18936,6 @@ func (s ModifySubnetAttributeOutput) GoString() string { return s.String() } -type ModifyVPCAttributeInput struct { - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. - // - // You can only enable DNS hostnames if you also enable DNS support. - EnableDNSHostnames *AttributeBooleanValue `locationName:"EnableDnsHostnames" type:"structure"` - - // Indicates whether the DNS resolution is supported for the VPC. If enabled, - // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, - // or the reserved IP address at the base of the VPC network range "plus two" - // will succeed. If disabled, the Amazon provided DNS service in the VPC that - // resolves public DNS hostnames to IP addresses is not enabled. - EnableDNSSupport *AttributeBooleanValue `locationName:"EnableDnsSupport" type:"structure"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string" required:"true"` - - metadataModifyVPCAttributeInput `json:"-" xml:"-"` -} - -type metadataModifyVPCAttributeInput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s ModifyVPCAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVPCAttributeInput) GoString() string { - return s.String() -} - -type ModifyVPCAttributeOutput struct { - metadataModifyVPCAttributeOutput `json:"-" xml:"-"` -} - -type metadataModifyVPCAttributeOutput struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s ModifyVPCAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVPCAttributeOutput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s ModifyVPCEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVPCEndpointInput) GoString() string { - return s.String() -} - -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"` -} - -// String returns the string representation -func (s ModifyVPCEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVPCEndpointOutput) GoString() string { - return s.String() -} - type ModifyVolumeAttributeInput struct { // Indicates whether the volume should be auto-enabled for I/O operations. AutoEnableIO *AttributeBooleanValue `type:"structure"` @@ -18889,7 +18947,7 @@ type ModifyVolumeAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the volume. - VolumeID *string `locationName:"VolumeId" type:"string" required:"true"` + VolumeId *string `type:"string" required:"true"` metadataModifyVolumeAttributeInput `json:"-" xml:"-"` } @@ -18926,6 +18984,125 @@ func (s ModifyVolumeAttributeOutput) GoString() string { return s.String() } +type ModifyVpcAttributeInput struct { + // Indicates whether the instances launched in the VPC get DNS hostnames. If + // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. + // + // You cannot modify the DNS resolution and DNS hostnames attributes in the + // same request. Use separate requests for each attribute. You can only enable + // DNS hostnames if you've enabled DNS support. + EnableDnsHostnames *AttributeBooleanValue `type:"structure"` + + // Indicates whether the DNS resolution is supported for the VPC. If enabled, + // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, + // or the reserved IP address at the base of the VPC network range "plus two" + // will succeed. If disabled, the Amazon provided DNS service in the VPC that + // resolves public DNS hostnames to IP addresses is not enabled. + // + // You cannot modify the DNS resolution and DNS hostnames attributes in the + // same request. Use separate requests for each attribute. + EnableDnsSupport *AttributeBooleanValue `type:"structure"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string" required:"true"` + + metadataModifyVpcAttributeInput `json:"-" xml:"-"` +} + +type metadataModifyVpcAttributeInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVpcAttributeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpcAttributeInput) GoString() string { + return s.String() +} + +type ModifyVpcAttributeOutput struct { + metadataModifyVpcAttributeOutput `json:"-" xml:"-"` +} + +type metadataModifyVpcAttributeOutput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVpcAttributeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpcAttributeOutput) GoString() string { + return s.String() +} + +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 `type:"string" required:"true"` + + metadataModifyVpcEndpointInput `json:"-" xml:"-"` +} + +type metadataModifyVpcEndpointInput struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s ModifyVpcEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpcEndpointInput) GoString() string { + return s.String() +} + +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"` +} + +// String returns the string representation +func (s ModifyVpcEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVpcEndpointOutput) GoString() string { + return s.String() +} + 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 @@ -18934,7 +19111,7 @@ type MonitorInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataMonitorInstancesInput `json:"-" xml:"-"` } @@ -18996,7 +19173,7 @@ func (s Monitoring) GoString() string { return s.String() } -type MoveAddressToVPCInput struct { +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, @@ -19004,46 +19181,46 @@ type MoveAddressToVPCInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + PublicIp *string `locationName:"publicIp" type:"string" required:"true"` - metadataMoveAddressToVPCInput `json:"-" xml:"-"` + metadataMoveAddressToVpcInput `json:"-" xml:"-"` } -type metadataMoveAddressToVPCInput struct { +type metadataMoveAddressToVpcInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s MoveAddressToVPCInput) String() string { +func (s MoveAddressToVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MoveAddressToVPCInput) GoString() string { +func (s MoveAddressToVpcInput) GoString() string { return s.String() } -type MoveAddressToVPCOutput struct { +type MoveAddressToVpcOutput struct { // The allocation ID for the Elastic IP address. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The status of the move of the IP address. Status *string `locationName:"status" type:"string" enum:"Status"` - metadataMoveAddressToVPCOutput `json:"-" xml:"-"` + metadataMoveAddressToVpcOutput `json:"-" xml:"-"` } -type metadataMoveAddressToVPCOutput struct { +type metadataMoveAddressToVpcOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s MoveAddressToVPCOutput) String() string { +func (s MoveAddressToVpcOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MoveAddressToVPCOutput) GoString() string { +func (s MoveAddressToVpcOutput) GoString() string { return s.String() } @@ -19054,7 +19231,7 @@ type MovingAddressStatus struct { MoveStatus *string `locationName:"moveStatus" type:"string" enum:"MoveStatus"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataMovingAddressStatus `json:"-" xml:"-"` } @@ -19074,81 +19251,81 @@ func (s MovingAddressStatus) GoString() string { } // Describes a network ACL. -type NetworkACL struct { +type NetworkAcl struct { // Any associations between the network ACL and one or more subnets - Associations []*NetworkACLAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` + Associations []*NetworkAclAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` // One or more entries (rules) in the network ACL. - Entries []*NetworkACLEntry `locationName:"entrySet" locationNameList:"item" type:"list"` + Entries []*NetworkAclEntry `locationName:"entrySet" locationNameList:"item" type:"list"` // Indicates whether this is the default network ACL for the VPC. IsDefault *bool `locationName:"default" type:"boolean"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string"` + NetworkAclId *string `locationName:"networkAclId" type:"string"` // Any tags assigned to the network ACL. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC for the network ACL. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` - metadataNetworkACL `json:"-" xml:"-"` + metadataNetworkAcl `json:"-" xml:"-"` } -type metadataNetworkACL struct { +type metadataNetworkAcl struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s NetworkACL) String() string { +func (s NetworkAcl) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NetworkACL) GoString() string { +func (s NetworkAcl) GoString() string { return s.String() } // Describes an association between a network ACL and a subnet. -type NetworkACLAssociation struct { +type NetworkAclAssociation struct { // The ID of the association between a network ACL and a subnet. - NetworkACLAssociationID *string `locationName:"networkAclAssociationId" type:"string"` + NetworkAclAssociationId *string `locationName:"networkAclAssociationId" type:"string"` // The ID of the network ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string"` + NetworkAclId *string `locationName:"networkAclId" type:"string"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` - metadataNetworkACLAssociation `json:"-" xml:"-"` + metadataNetworkAclAssociation `json:"-" xml:"-"` } -type metadataNetworkACLAssociation struct { +type metadataNetworkAclAssociation struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s NetworkACLAssociation) String() string { +func (s NetworkAclAssociation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NetworkACLAssociation) GoString() string { +func (s NetworkAclAssociation) GoString() string { return s.String() } // Describes an entry in a network ACL. -type NetworkACLEntry struct { +type NetworkAclEntry struct { // The network range to allow or deny, in CIDR notation. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` + CidrBlock *string `locationName:"cidrBlock" type:"string"` // Indicates whether the rule is an egress rule (applied to traffic leaving // the subnet). Egress *bool `locationName:"egress" type:"boolean"` // ICMP protocol: The ICMP type and code. - ICMPTypeCode *ICMPTypeCode `locationName:"icmpTypeCode" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"icmpTypeCode" type:"structure"` // TCP or UDP protocols: The range of ports the rule applies to. PortRange *PortRange `locationName:"portRange" type:"structure"` @@ -19163,20 +19340,20 @@ type NetworkACLEntry struct { // by rule number. RuleNumber *int64 `locationName:"ruleNumber" type:"integer"` - metadataNetworkACLEntry `json:"-" xml:"-"` + metadataNetworkAclEntry `json:"-" xml:"-"` } -type metadataNetworkACLEntry struct { +type metadataNetworkAclEntry struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s NetworkACLEntry) String() string { +func (s NetworkAclEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NetworkACLEntry) GoString() string { +func (s NetworkAclEntry) GoString() string { return s.String() } @@ -19199,26 +19376,26 @@ type NetworkInterface struct { Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` // The MAC address. - MACAddress *string `locationName:"macAddress" type:"string"` + MacAddress *string `locationName:"macAddress" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The AWS account ID of the owner of the network interface. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The IP address of the network interface within the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The private IP addresses associated with the network interface. - PrivateIPAddresses []*NetworkInterfacePrivateIPAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` + PrivateIpAddresses []*NetworkInterfacePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` // The ID of the entity that launched the instance on your behalf (for example, // AWS Management Console or Auto Scaling). - RequesterID *string `locationName:"requesterId" type:"string"` + RequesterId *string `locationName:"requesterId" type:"string"` // Indicates whether the network interface is being managed by AWS. RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` @@ -19230,13 +19407,13 @@ type NetworkInterface struct { Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the network interface. TagSet []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataNetworkInterface `json:"-" xml:"-"` } @@ -19258,19 +19435,19 @@ func (s NetworkInterface) GoString() string { // Describes association information for an Elastic IP address. type NetworkInterfaceAssociation struct { // The allocation ID. - AllocationID *string `locationName:"allocationId" type:"string"` + AllocationId *string `locationName:"allocationId" type:"string"` // The association ID. - AssociationID *string `locationName:"associationId" type:"string"` + AssociationId *string `locationName:"associationId" type:"string"` // The ID of the Elastic IP address owner. - IPOwnerID *string `locationName:"ipOwnerId" type:"string"` + IpOwnerId *string `locationName:"ipOwnerId" type:"string"` // The public DNS name. - PublicDNSName *string `locationName:"publicDnsName" type:"string"` + PublicDnsName *string `locationName:"publicDnsName" type:"string"` // The address of the Elastic IP address bound to the network interface. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` metadataNetworkInterfaceAssociation `json:"-" xml:"-"` } @@ -19295,7 +19472,7 @@ type NetworkInterfaceAttachment struct { AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -19304,10 +19481,10 @@ type NetworkInterfaceAttachment struct { DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The AWS account ID of the owner of the instance. - InstanceOwnerID *string `locationName:"instanceOwnerId" type:"string"` + InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` // The attachment state. Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` @@ -19332,7 +19509,7 @@ func (s NetworkInterfaceAttachment) GoString() string { // Describes an attachment change. type NetworkInterfaceAttachmentChanges struct { // The ID of the network interface attachment. - AttachmentID *string `locationName:"attachmentId" type:"string"` + AttachmentId *string `locationName:"attachmentId" type:"string"` // Indicates whether the network interface is deleted when the instance is terminated. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` @@ -19355,7 +19532,7 @@ func (s NetworkInterfaceAttachmentChanges) GoString() string { } // Describes the private IP address of a network interface. -type NetworkInterfacePrivateIPAddress struct { +type NetworkInterfacePrivateIpAddress struct { // The association information for an Elastic IP address associated with the // network interface. Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` @@ -19365,47 +19542,47 @@ type NetworkInterfacePrivateIPAddress struct { Primary *bool `locationName:"primary" type:"boolean"` // The private DNS name. - PrivateDNSName *string `locationName:"privateDnsName" type:"string"` + PrivateDnsName *string `locationName:"privateDnsName" type:"string"` // The private IP address. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - metadataNetworkInterfacePrivateIPAddress `json:"-" xml:"-"` + metadataNetworkInterfacePrivateIpAddress `json:"-" xml:"-"` } -type metadataNetworkInterfacePrivateIPAddress struct { +type metadataNetworkInterfacePrivateIpAddress struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s NetworkInterfacePrivateIPAddress) String() string { +func (s NetworkInterfacePrivateIpAddress) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NetworkInterfacePrivateIPAddress) GoString() string { +func (s NetworkInterfacePrivateIpAddress) GoString() string { return s.String() } -type NewDHCPConfiguration struct { +type NewDhcpConfiguration struct { Key *string `locationName:"key" type:"string"` Values []*string `locationName:"Value" locationNameList:"item" type:"list"` - metadataNewDHCPConfiguration `json:"-" xml:"-"` + metadataNewDhcpConfiguration `json:"-" xml:"-"` } -type metadataNewDHCPConfiguration struct { +type metadataNewDhcpConfiguration struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s NewDHCPConfiguration) String() string { +func (s NewDhcpConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NewDHCPConfiguration) GoString() string { +func (s NewDhcpConfiguration) GoString() string { return s.String() } @@ -19494,10 +19671,10 @@ func (s PortRange) GoString() string { // Describes prefixes for AWS services. type PrefixList struct { // The IP address range of the AWS service. - CIDRs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` + Cidrs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` // The ID of the prefix. - PrefixListID *string `locationName:"prefixListId" type:"string"` + PrefixListId *string `locationName:"prefixListId" type:"string"` // The name of the prefix. PrefixListName *string `locationName:"prefixListName" type:"string"` @@ -19520,24 +19697,24 @@ func (s PrefixList) GoString() string { } // The ID of the prefix. -type PrefixListID struct { +type PrefixListId struct { // The ID of the prefix. - PrefixListID *string `locationName:"prefixListId" type:"string"` + PrefixListId *string `locationName:"prefixListId" type:"string"` - metadataPrefixListID `json:"-" xml:"-"` + metadataPrefixListId `json:"-" xml:"-"` } -type metadataPrefixListID struct { +type metadataPrefixListId struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s PrefixListID) String() string { +func (s PrefixListId) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PrefixListID) GoString() string { +func (s PrefixListId) GoString() string { return s.String() } @@ -19639,35 +19816,35 @@ func (s PricingDetail) GoString() string { } // Describes a secondary private IP address for a network interface. -type PrivateIPAddressSpecification struct { +type PrivateIpAddressSpecification struct { // Indicates whether the private IP address is the primary private IP address. // Only one IP address can be designated as primary. Primary *bool `locationName:"primary" type:"boolean"` // The private IP addresses. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` - metadataPrivateIPAddressSpecification `json:"-" xml:"-"` + metadataPrivateIpAddressSpecification `json:"-" xml:"-"` } -type metadataPrivateIPAddressSpecification struct { +type metadataPrivateIpAddressSpecification struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s PrivateIPAddressSpecification) String() string { +func (s PrivateIpAddressSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PrivateIPAddressSpecification) GoString() string { +func (s PrivateIpAddressSpecification) GoString() string { return s.String() } // Describes a product code. type ProductCode struct { // The product code. - ProductCodeID *string `locationName:"productCode" type:"string"` + ProductCodeId *string `locationName:"productCode" type:"string"` // The type of product code. ProductCodeType *string `locationName:"type" type:"string" enum:"ProductCodeValues"` @@ -19690,24 +19867,24 @@ func (s ProductCode) GoString() string { } // Describes a virtual private gateway propagating route. -type PropagatingVGW struct { +type PropagatingVgw struct { // The ID of the virtual private gateway (VGW). - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` - metadataPropagatingVGW `json:"-" xml:"-"` + metadataPropagatingVgw `json:"-" xml:"-"` } -type metadataPropagatingVGW struct { +type metadataPropagatingVgw struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s PropagatingVGW) String() string { +func (s PropagatingVgw) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PropagatingVGW) GoString() string { +func (s PropagatingVgw) GoString() string { return s.String() } @@ -19727,7 +19904,7 @@ type PurchaseReservedInstancesOfferingInput struct { LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` // The ID of the Reserved Instance offering to purchase. - ReservedInstancesOfferingID *string `locationName:"ReservedInstancesOfferingId" type:"string" required:"true"` + ReservedInstancesOfferingId *string `type:"string" required:"true"` metadataPurchaseReservedInstancesOfferingInput `json:"-" xml:"-"` } @@ -19748,7 +19925,7 @@ func (s PurchaseReservedInstancesOfferingInput) GoString() string { type PurchaseReservedInstancesOfferingOutput struct { // The IDs of the purchased Reserved Instances. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` metadataPurchaseReservedInstancesOfferingOutput `json:"-" xml:"-"` } @@ -19775,7 +19952,7 @@ type RebootInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataRebootInstancesInput `json:"-" xml:"-"` } @@ -19885,7 +20062,7 @@ type RegisterImageInput struct { ImageLocation *string `type:"string"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // A name for your AMI. // @@ -19895,7 +20072,7 @@ type RegisterImageInput struct { Name *string `locationName:"name" type:"string" required:"true"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` // The name of the root device (for example, /dev/sda1, or /dev/xvda). RootDeviceName *string `locationName:"rootDeviceName" type:"string"` @@ -19907,7 +20084,7 @@ type RegisterImageInput struct { // // This option is supported only for HVM AMIs. Specifying this option with // a PV AMI can make instances launched from the AMI unreachable. - SRIOVNetSupport *string `locationName:"sriovNetSupport" type:"string"` + SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` // The type of virtualization. // @@ -19933,7 +20110,7 @@ func (s RegisterImageInput) GoString() string { type RegisterImageOutput struct { // The ID of the newly registered AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` metadataRegisterImageOutput `json:"-" xml:"-"` } @@ -19952,7 +20129,7 @@ func (s RegisterImageOutput) GoString() string { return s.String() } -type RejectVPCPeeringConnectionInput 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, @@ -19960,49 +20137,49 @@ type RejectVPCPeeringConnectionInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` - metadataRejectVPCPeeringConnectionInput `json:"-" xml:"-"` + metadataRejectVpcPeeringConnectionInput `json:"-" xml:"-"` } -type metadataRejectVPCPeeringConnectionInput struct { +type metadataRejectVpcPeeringConnectionInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s RejectVPCPeeringConnectionInput) String() string { +func (s RejectVpcPeeringConnectionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RejectVPCPeeringConnectionInput) GoString() string { +func (s RejectVpcPeeringConnectionInput) GoString() string { return s.String() } -type RejectVPCPeeringConnectionOutput struct { +type RejectVpcPeeringConnectionOutput struct { // Returns true if the request succeeds; otherwise, it returns an error. Return *bool `locationName:"return" type:"boolean"` - metadataRejectVPCPeeringConnectionOutput `json:"-" xml:"-"` + metadataRejectVpcPeeringConnectionOutput `json:"-" xml:"-"` } -type metadataRejectVPCPeeringConnectionOutput struct { +type metadataRejectVpcPeeringConnectionOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s RejectVPCPeeringConnectionOutput) String() string { +func (s RejectVpcPeeringConnectionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RejectVPCPeeringConnectionOutput) GoString() string { +func (s RejectVpcPeeringConnectionOutput) GoString() string { return s.String() } type ReleaseAddressInput struct { // [EC2-VPC] The allocation ID. Required for EC2-VPC. - AllocationID *string `locationName:"AllocationId" type:"string"` + AllocationId *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 @@ -20011,7 +20188,7 @@ type ReleaseAddressInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIP *string `locationName:"PublicIp" type:"string"` + PublicIp *string `type:"string"` metadataReleaseAddressInput `json:"-" xml:"-"` } @@ -20048,10 +20225,10 @@ func (s ReleaseAddressOutput) GoString() string { return s.String() } -type ReplaceNetworkACLAssociationInput struct { +type ReplaceNetworkAclAssociationInput struct { // The ID of the current association between the original network ACL and the // subnet. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + 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 @@ -20060,49 +20237,49 @@ type ReplaceNetworkACLAssociationInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new network ACL to associate with the subnet. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - metadataReplaceNetworkACLAssociationInput `json:"-" xml:"-"` + metadataReplaceNetworkAclAssociationInput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLAssociationInput struct { +type metadataReplaceNetworkAclAssociationInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ReplaceNetworkACLAssociationInput) String() string { +func (s ReplaceNetworkAclAssociationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplaceNetworkACLAssociationInput) GoString() string { +func (s ReplaceNetworkAclAssociationInput) GoString() string { return s.String() } -type ReplaceNetworkACLAssociationOutput struct { +type ReplaceNetworkAclAssociationOutput struct { // The ID of the new association. - NewAssociationID *string `locationName:"newAssociationId" type:"string"` + NewAssociationId *string `locationName:"newAssociationId" type:"string"` - metadataReplaceNetworkACLAssociationOutput `json:"-" xml:"-"` + metadataReplaceNetworkAclAssociationOutput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLAssociationOutput struct { +type metadataReplaceNetworkAclAssociationOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ReplaceNetworkACLAssociationOutput) String() string { +func (s ReplaceNetworkAclAssociationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplaceNetworkACLAssociationOutput) GoString() string { +func (s ReplaceNetworkAclAssociationOutput) GoString() string { return s.String() } -type ReplaceNetworkACLEntryInput struct { +type ReplaceNetworkAclEntryInput struct { // The network range to allow or deny, in CIDR notation. - CIDRBlock *string `locationName:"cidrBlock" type:"string" required:"true"` + 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 @@ -20117,10 +20294,10 @@ type ReplaceNetworkACLEntryInput struct { // ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for // the protocol. - ICMPTypeCode *ICMPTypeCode `locationName:"Icmp" type:"structure"` + IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` // The ID of the ACL. - NetworkACLID *string `locationName:"networkAclId" type:"string" required:"true"` + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` // TCP or UDP protocols: The range of ports the rule applies to. Required if // specifying 6 (TCP) or 17 (UDP) for the protocol. @@ -20135,45 +20312,45 @@ type ReplaceNetworkACLEntryInput struct { // The rule number of the entry to replace. RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` - metadataReplaceNetworkACLEntryInput `json:"-" xml:"-"` + metadataReplaceNetworkAclEntryInput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLEntryInput struct { +type metadataReplaceNetworkAclEntryInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ReplaceNetworkACLEntryInput) String() string { +func (s ReplaceNetworkAclEntryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplaceNetworkACLEntryInput) GoString() string { +func (s ReplaceNetworkAclEntryInput) GoString() string { return s.String() } -type ReplaceNetworkACLEntryOutput struct { - metadataReplaceNetworkACLEntryOutput `json:"-" xml:"-"` +type ReplaceNetworkAclEntryOutput struct { + metadataReplaceNetworkAclEntryOutput `json:"-" xml:"-"` } -type metadataReplaceNetworkACLEntryOutput struct { +type metadataReplaceNetworkAclEntryOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ReplaceNetworkACLEntryOutput) String() string { +func (s ReplaceNetworkAclEntryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplaceNetworkACLEntryOutput) GoString() string { +func (s ReplaceNetworkAclEntryOutput) GoString() string { return s.String() } type ReplaceRouteInput struct { // The CIDR address block used for the destination match. The value you provide // must match the CIDR of an existing route in the table. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string" required:"true"` + 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 @@ -20182,19 +20359,19 @@ type ReplaceRouteInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of an Internet gateway or virtual private gateway. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The ID of a network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` // The ID of a VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataReplaceRouteInput `json:"-" xml:"-"` } @@ -20233,7 +20410,7 @@ func (s ReplaceRouteOutput) GoString() string { type ReplaceRouteTableAssociationInput struct { // The association ID. - AssociationID *string `locationName:"associationId" type:"string" required:"true"` + 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 @@ -20242,7 +20419,7 @@ type ReplaceRouteTableAssociationInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the new route table to associate with the subnet. - RouteTableID *string `locationName:"routeTableId" type:"string" required:"true"` + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` metadataReplaceRouteTableAssociationInput `json:"-" xml:"-"` } @@ -20263,7 +20440,7 @@ func (s ReplaceRouteTableAssociationInput) GoString() string { type ReplaceRouteTableAssociationOutput struct { // The ID of the new association. - NewAssociationID *string `locationName:"newAssociationId" type:"string"` + NewAssociationId *string `locationName:"newAssociationId" type:"string"` metadataReplaceRouteTableAssociationOutput `json:"-" xml:"-"` } @@ -20394,7 +20571,7 @@ func (s RequestSpotFleetInput) GoString() string { // Contains the output of RequestSpotFleet. type RequestSpotFleetOutput struct { // The ID of the Spot fleet request. - SpotFleetRequestID *string `locationName:"spotFleetRequestId" type:"string" required:"true"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` metadataRequestSpotFleetOutput `json:"-" xml:"-"` } @@ -20418,24 +20595,36 @@ type RequestSpotInstancesInput struct { // The user-specified name for a logical grouping of bids. // // When you specify an Availability Zone group in a Spot Instance request, - // all Spot Instances in the request are launched in the same Availability Zone. + // all Spot instances in the request are launched in the same Availability Zone. // Instance proximity is maintained with this parameter, but the choice of Availability // Zone is not. The group applies only to bids for Spot Instances of the same - // instance type. Any additional Spot Instance requests that are specified with + // instance type. Any additional Spot instance requests that are specified with // the same Availability Zone group name are launched in that same Availability // Zone, as long as at least one instance from the group is still active. // // If there is no active instance running in the Availability Zone group that - // you specify for a new Spot Instance request (all instances are terminated, + // you specify for a new Spot instance request (all instances are terminated, // the bid is expired, or the bid falls below current market), then Amazon EC2 // launches the instance in any Availability Zone where the constraint can be - // met. Consequently, the subsequent set of Spot Instances could be placed in + // met. Consequently, the subsequent set of Spot instances could be placed in // a different zone from the original request, even if you specified the same // Availability Zone group. // // Default: Instances are launched in any available Availability Zone. AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` + // The required duration for the Spot instances, in minutes. This value must + // be a multiple of 60 (60, 120, 180, 240, 300, or 360). + // + // The duration period starts as soon as your Spot instance receives its instance + // ID. At the end of the duration period, Amazon EC2 marks the Spot instance + // for termination and provides a Spot instance termination notice, which gives + // the instance a two-minute warning before it terminates. + // + // Note that you can't specify an Availability Zone group or a launch group + // if you specify a duration. + BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` + // 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. @@ -20447,12 +20636,12 @@ type RequestSpotInstancesInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The maximum number of Spot Instances to launch. + // The maximum number of Spot instances to launch. // // Default: 1 InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - // The instance launch group. Launch groups are Spot Instances that launch together + // The instance launch group. Launch groups are Spot instances that launch together // and terminate together. // // Default: Instances are launched and terminated individually @@ -20461,11 +20650,11 @@ type RequestSpotInstancesInput struct { // Describes the launch specification for an instance. LaunchSpecification *RequestSpotLaunchSpecification `type:"structure"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill + // The maximum hourly price (bid) for any Spot instance launched to fulfill // the request. SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - // The Spot Instance request type. + // The Spot instance request type. // // Default: one-time Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` @@ -20506,7 +20695,7 @@ func (s RequestSpotInstancesInput) GoString() string { // Contains the output of RequestSpotInstances. type RequestSpotInstancesOutput struct { - // One or more Spot Instance requests. + // One or more Spot instance requests. SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` metadataRequestSpotInstancesOutput `json:"-" xml:"-"` @@ -20541,19 +20730,19 @@ type RequestSpotLaunchSpecification struct { // Optimized instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The instance type. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` @@ -20568,14 +20757,14 @@ type RequestSpotLaunchSpecification struct { Placement *SpotPlacement `locationName:"placement" type:"structure"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` - SecurityGroupIDs []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"item" type:"list"` // The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to make available to the instances. UserData *string `locationName:"userData" type:"string"` @@ -20606,14 +20795,14 @@ type Reservation struct { Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"` // The ID of the AWS account that owns the reservation. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The ID of the requester that launched the instances on your behalf (for example, // AWS Management Console or Auto Scaling). - RequesterID *string `locationName:"requesterId" type:"string"` + RequesterId *string `locationName:"requesterId" type:"string"` // The ID of the reservation. - ReservationID *string `locationName:"reservationId" type:"string"` + ReservationId *string `locationName:"reservationId" type:"string"` metadataReservation `json:"-" xml:"-"` } @@ -20696,7 +20885,7 @@ type ReservedInstances struct { RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The date and time the Reserved Instance started. Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` @@ -20760,24 +20949,24 @@ func (s ReservedInstancesConfiguration) GoString() string { } // Describes the ID of a Reserved Instance. -type ReservedInstancesID struct { +type ReservedInstancesId struct { // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - metadataReservedInstancesID `json:"-" xml:"-"` + metadataReservedInstancesId `json:"-" xml:"-"` } -type metadataReservedInstancesID struct { +type metadataReservedInstancesId struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s ReservedInstancesID) String() string { +func (s ReservedInstancesId) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReservedInstancesID) GoString() string { +func (s ReservedInstancesId) GoString() string { return s.String() } @@ -20797,10 +20986,10 @@ type ReservedInstancesListing struct { PriceSchedules []*PriceSchedule `locationName:"priceSchedules" locationNameList:"item" type:"list"` // The ID of the Reserved Instance. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The ID of the Reserved Instance listing. - ReservedInstancesListingID *string `locationName:"reservedInstancesListingId" type:"string"` + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` // The status of the Reserved Instance listing. Status *string `locationName:"status" type:"string" enum:"ListingStatus"` @@ -20849,10 +21038,10 @@ type ReservedInstancesModification struct { ModificationResults []*ReservedInstancesModificationResult `locationName:"modificationResultSet" locationNameList:"item" type:"list"` // The IDs of one or more Reserved Instances. - ReservedInstancesIDs []*ReservedInstancesID `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` + ReservedInstancesIds []*ReservedInstancesId `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` // A unique ID for the Reserved Instance modification. - ReservedInstancesModificationID *string `locationName:"reservedInstancesModificationId" type:"string"` + ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` // The status of the Reserved Instances modification request. Status *string `locationName:"status" type:"string"` @@ -20883,7 +21072,7 @@ func (s ReservedInstancesModification) GoString() string { type ReservedInstancesModificationResult struct { // The ID for the Reserved Instances that were created as part of the modification // request. This field is only available when the modification is fulfilled. - ReservedInstancesID *string `locationName:"reservedInstancesId" type:"string"` + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The target Reserved Instances configurations supplied as part of the modification // request. @@ -20946,7 +21135,7 @@ type ReservedInstancesOffering struct { RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` // The ID of the Reserved Instance offering. - ReservedInstancesOfferingID *string `locationName:"reservedInstancesOfferingId" type:"string"` + ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"` // The usage price of the Reserved Instance, per hour. UsagePrice *float64 `locationName:"usagePrice" type:"float"` @@ -20980,7 +21169,7 @@ type ResetImageAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the AMI. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` metadataResetImageAttributeInput `json:"-" xml:"-"` } @@ -21028,7 +21217,7 @@ type ResetInstanceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` metadataResetInstanceAttributeInput `json:"-" xml:"-"` } @@ -21073,7 +21262,7 @@ type ResetNetworkInterfaceAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // The source/destination checking attribute. Resets the value to true. SourceDestCheck *string `locationName:"sourceDestCheck" type:"string"` @@ -21125,7 +21314,7 @@ type ResetSnapshotAttributeInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The ID of the snapshot. - SnapshotID *string `locationName:"SnapshotId" type:"string" required:"true"` + SnapshotId *string `type:"string" required:"true"` metadataResetSnapshotAttributeInput `json:"-" xml:"-"` } @@ -21170,7 +21359,7 @@ type RestoreAddressToClassicInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string" required:"true"` + PublicIp *string `locationName:"publicIp" type:"string" required:"true"` metadataRestoreAddressToClassicInput `json:"-" xml:"-"` } @@ -21191,7 +21380,7 @@ func (s RestoreAddressToClassicInput) GoString() string { type RestoreAddressToClassicOutput struct { // The Elastic IP address. - PublicIP *string `locationName:"publicIp" type:"string"` + PublicIp *string `locationName:"publicIp" type:"string"` // The move status for the IP address. Status *string `locationName:"status" type:"string" enum:"Status"` @@ -21216,7 +21405,7 @@ func (s RestoreAddressToClassicOutput) GoString() string { 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"` + 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 @@ -21229,15 +21418,15 @@ type RevokeSecurityGroupEgressInput struct { FromPort *int64 `locationName:"fromPort" type:"integer"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string" required:"true"` + GroupId *string `locationName:"groupId" type:"string" required:"true"` // A set of IP permissions. You can't specify a destination security group and // a CIDR IP address range. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"ipProtocol" type:"string"` + IpProtocol *string `locationName:"ipProtocol" type:"string"` // The name of a destination security group. To revoke outbound access to a // destination security group, we recommend that you use a set of IP permissions @@ -21247,7 +21436,7 @@ type RevokeSecurityGroupEgressInput struct { // The AWS account number for a destination security group. To revoke outbound // access to a destination security group, we recommend that you use a set of // IP permissions instead. - SourceSecurityGroupOwnerID *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -21291,7 +21480,7 @@ func (s RevokeSecurityGroupEgressOutput) GoString() string { type RevokeSecurityGroupIngressInput struct { // The CIDR IP address range. You can't specify this parameter when specifying // a source security group. - CIDRIP *string `locationName:"CidrIp" type:"string"` + CidrIp *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 @@ -21305,18 +21494,18 @@ type RevokeSecurityGroupIngressInput struct { // The ID of the security group. Required for a security group in a nondefault // VPC. - GroupID *string `locationName:"GroupId" type:"string"` + GroupId *string `type:"string"` // [EC2-Classic, default VPC] The name of the security group. GroupName *string `type:"string"` // A set of IP permissions. You can't specify a source security group and a // CIDR IP address range. - IPPermissions []*IPPermission `locationName:"IpPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationNameList:"item" type:"list"` // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). // Use -1 to specify all. - IPProtocol *string `locationName:"IpProtocol" type:"string"` + IpProtocol *string `type:"string"` // [EC2-Classic, default VPC] The name of the source security group. You can't // specify this parameter in combination with the following parameters: the @@ -21331,7 +21520,7 @@ type RevokeSecurityGroupIngressInput struct { // CIDR IP address range, the IP protocol, the start of the port range, and // the end of the port range. To revoke a specific rule for an IP protocol and // port range, use a set of IP permissions instead. - SourceSecurityGroupOwnerID *string `locationName:"SourceSecurityGroupOwnerId" type:"string"` + SourceSecurityGroupOwnerId *string `type:"string"` // The end of port range for the TCP and UDP protocols, or an ICMP code number. // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. @@ -21375,22 +21564,22 @@ func (s RevokeSecurityGroupIngressOutput) GoString() string { // Describes a route in a route table. type Route struct { // The CIDR block used for the destination match. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string"` + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` // The prefix of the AWS service. - DestinationPrefixListID *string `locationName:"destinationPrefixListId" type:"string"` + DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"` // The ID of a gateway attached to your VPC. - GatewayID *string `locationName:"gatewayId" type:"string"` + GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of a NAT instance in your VPC. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The AWS account ID of the owner of the instance. - InstanceOwnerID *string `locationName:"instanceOwnerId" type:"string"` + InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // Describes how the route was created. // @@ -21406,7 +21595,7 @@ type Route struct { State *string `locationName:"state" type:"string" enum:"RouteState"` // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` metadataRoute `json:"-" xml:"-"` } @@ -21431,10 +21620,10 @@ type RouteTable struct { Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` // Any virtual private gateway (VGW) propagating routes. - PropagatingVGWs []*PropagatingVGW `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` + PropagatingVgws []*PropagatingVgw `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string"` + RouteTableId *string `locationName:"routeTableId" type:"string"` // The routes in the route table. Routes []*Route `locationName:"routeSet" locationNameList:"item" type:"list"` @@ -21443,7 +21632,7 @@ type RouteTable struct { Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataRouteTable `json:"-" xml:"-"` } @@ -21468,13 +21657,13 @@ type RouteTableAssociation struct { Main *bool `locationName:"main" type:"boolean"` // The ID of the association between a route table and a subnet. - RouteTableAssociationID *string `locationName:"routeTableAssociationId" type:"string"` + RouteTableAssociationId *string `locationName:"routeTableAssociationId" type:"string"` // The ID of the route table. - RouteTableID *string `locationName:"routeTableId" type:"string"` + RouteTableId *string `locationName:"routeTableId" type:"string"` // The ID of the subnet. A subnet ID is not returned for an implicit association. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` metadataRouteTableAssociation `json:"-" xml:"-"` } @@ -21515,7 +21704,7 @@ type RunInstancesInput struct { // from the instance. // // Default: false - DisableAPITermination *bool `locationName:"disableApiTermination" type:"boolean"` + 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 @@ -21530,13 +21719,13 @@ type RunInstancesInput struct { // instance. // // Default: false - EBSOptimized *bool `locationName:"ebsOptimized" type:"boolean"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` // The IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI, which you can get by calling DescribeImages. - ImageID *string `locationName:"ImageId" type:"string" required:"true"` + ImageId *string `type:"string" required:"true"` // Indicates whether an instance stops or terminates when you initiate shutdown // from the instance (using the operating system command for system shutdown). @@ -21555,7 +21744,7 @@ type RunInstancesInput struct { // We recommend that you use PV-GRUB instead of kernels and RAM disks. For // more information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) // in the Amazon Elastic Compute Cloud User Guide. - KernelID *string `locationName:"KernelId" type:"string"` + KernelId *string `type:"string"` // The name of the key pair. You can create a key pair using CreateKeyPair or // ImportKeyPair. @@ -21601,19 +21790,19 @@ type RunInstancesInput struct { // and PrivateIpAddresses.n.PrivateIpAddress is set to an IP address. // // Default: We select an IP address from the IP address range of the subnet. - PrivateIPAddress *string `locationName:"privateIpAddress" type:"string"` + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` // The ID of the RAM disk. // // We recommend that you use PV-GRUB instead of kernels and RAM disks. For // more information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) // in the Amazon Elastic Compute Cloud User Guide. - RAMDiskID *string `locationName:"RamdiskId" type:"string"` + RamdiskId *string `type:"string"` // One or more security group IDs. You can create a security group using CreateSecurityGroup. // // Default: Amazon EC2 uses the default security group. - SecurityGroupIDs []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` // [EC2-Classic, default VPC] One or more security group names. For a nondefault // VPC, you must use security group IDs instead. @@ -21622,7 +21811,7 @@ type RunInstancesInput struct { SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"` // [EC2-VPC] The ID of the subnet to launch the instance into. - SubnetID *string `locationName:"SubnetId" type:"string"` + SubnetId *string `type:"string"` // The Base64-encoded MIME user data for the instances. UserData *string `type:"string"` @@ -21672,7 +21861,7 @@ type S3Storage struct { // The access key ID of the owner of the bucket. Before you specify a value // for your access key ID, review and follow the guidance in Best Practices // for Managing AWS Access Keys (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). - AWSAccessKeyID *string `locationName:"AWSAccessKeyId" type:"string"` + AWSAccessKeyId *string `type:"string"` // The bucket in which to store the AMI. You can specify a bucket that you already // own or a new bucket that Amazon EC2 creates on your behalf. If you specify @@ -21712,25 +21901,25 @@ type SecurityGroup struct { Description *string `locationName:"groupDescription" type:"string"` // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. GroupName *string `locationName:"groupName" type:"string"` // One or more inbound rules associated with the security group. - IPPermissions []*IPPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` // [EC2-VPC] One or more outbound rules associated with the security group. - IPPermissionsEgress []*IPPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` + IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` // The AWS account ID of the owner of the security group. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // Any tags assigned to the security group. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // [EC2-VPC] The ID of the VPC for the security group. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataSecurityGroup `json:"-" xml:"-"` } @@ -21751,6 +21940,14 @@ func (s SecurityGroup) GoString() string { // Describes a snapshot. type Snapshot struct { + // The data encryption key identifier for the snapshot. This value is a unique + // identifier that corresponds to the data encryption key that was used to encrypt + // the original volume or snapshot copy. Because data encryption keys are inherited + // by volumes created from snapshots, and vice versa, if snapshots share the + // same data encryption key identifier, then they belong to the same volume/snapshot + // lineage. This parameter is only returned by the DescribeSnapshots API operation. + DataEncryptionKeyId *string `locationName:"dataEncryptionKeyId" type:"string"` + // The description for the snapshot. Description *string `locationName:"description" type:"string"` @@ -21760,20 +21957,21 @@ type Snapshot struct { // The full ARN of the AWS Key Management Service (AWS KMS) customer master // key (CMK) that was used to protect the volume encryption key for the parent // volume. - KMSKeyID *string `locationName:"kmsKeyId" type:"string"` + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` // The AWS account alias (for example, amazon, self) or AWS account ID that // owns the snapshot. OwnerAlias *string `locationName:"ownerAlias" type:"string"` // The AWS account ID of the EBS snapshot owner. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The progress of the snapshot, as a percentage. Progress *string `locationName:"progress" type:"string"` - // The ID of the snapshot. - SnapshotID *string `locationName:"snapshotId" type:"string"` + // The ID of the snapshot. Each snapshot receives a unique identifier when it + // is created. + SnapshotId *string `locationName:"snapshotId" type:"string"` // The time stamp when the snapshot was initiated. StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` @@ -21781,11 +21979,18 @@ type Snapshot struct { // The snapshot state. State *string `locationName:"status" type:"string" enum:"SnapshotState"` + // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy + // operation fails (for example, if the proper AWS Key Management Service (AWS + // KMS) permissions are not obtained) this field displays error state details + // to help you diagnose why the error occurred. This parameter is only returned + // by the DescribeSnapshots API operation. + StateMessage *string `locationName:"statusMessage" type:"string"` + // Any tags assigned to the snapshot. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` + // The ID of the volume that was used to create the snapshot. + VolumeId *string `locationName:"volumeId" type:"string"` // The size of the volume, in GiB. VolumeSize *int64 `locationName:"volumeSize" type:"integer"` @@ -21825,7 +22030,7 @@ type SnapshotDetail struct { Progress *string `locationName:"progress" type:"string"` // The snapshot ID of the disk being imported. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // A brief status of the snapshot creation. Status *string `locationName:"status" type:"string"` @@ -21834,7 +22039,7 @@ type SnapshotDetail struct { StatusMessage *string `locationName:"statusMessage" type:"string"` // The URL used to access the disk image. - URL *string `locationName:"url" type:"string"` + Url *string `locationName:"url" type:"string"` // Describes the S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` @@ -21868,7 +22073,7 @@ type SnapshotDiskContainer struct { // 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"` + Url *string `type:"string"` // Describes the S3 bucket for the disk image. UserBucket *UserBucket `type:"structure"` @@ -21905,7 +22110,7 @@ type SnapshotTaskDetail struct { Progress *string `locationName:"progress" type:"string"` // The snapshot ID of the disk being imported. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // A brief status for the import snapshot task. Status *string `locationName:"status" type:"string"` @@ -21914,7 +22119,7 @@ type SnapshotTaskDetail struct { StatusMessage *string `locationName:"statusMessage" type:"string"` // The URL of the disk image from which the snapshot is created. - URL *string `locationName:"url" type:"string"` + Url *string `locationName:"url" type:"string"` // The S3 bucket for the disk image. UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` @@ -21936,21 +22141,21 @@ func (s SnapshotTaskDetail) GoString() string { return s.String() } -// Describes the data feed for a Spot Instance. +// Describes the data feed for a Spot instance. type SpotDatafeedSubscription struct { - // The Amazon S3 bucket where the Spot Instance data feed is located. + // The Amazon S3 bucket where the Spot instance data feed is located. Bucket *string `locationName:"bucket" type:"string"` - // The fault codes for the Spot Instance request, if any. + // The fault codes for the Spot instance request, if any. Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` // The AWS account ID of the account. - OwnerID *string `locationName:"ownerId" type:"string"` + OwnerId *string `locationName:"ownerId" type:"string"` // The prefix that is prepended to data feed files. Prefix *string `locationName:"prefix" type:"string"` - // The state of the Spot Instance data feed subscription. + // The state of the Spot instance data feed subscription. State *string `locationName:"state" type:"string" enum:"DatafeedSubscriptionState"` metadataSpotDatafeedSubscription `json:"-" xml:"-"` @@ -21970,7 +22175,7 @@ func (s SpotDatafeedSubscription) GoString() string { return s.String() } -// Describes the launch specification for an instance. +// Describes the launch specification for one or more Spot instances. type SpotFleetLaunchSpecification struct { // Deprecated. AddressingType *string `locationName:"addressingType" type:"string"` @@ -21978,54 +22183,68 @@ type SpotFleetLaunchSpecification struct { // One or more block device mapping entries. BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - // Indicates whether the instance is optimized for EBS I/O. This optimization + // Indicates whether the instances are optimized for EBS I/O. This optimization // provides dedicated throughput to Amazon EBS and an optimized configuration // 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"` + EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - // Describes an IAM instance profile. - IAMInstanceProfile *IAMInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` + // The IAM instance profile. + IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` // The ID of the AMI. - ImageID *string `locationName:"imageId" type:"string"` + ImageId *string `locationName:"imageId" type:"string"` // The instance type. InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` // The ID of the kernel. - KernelID *string `locationName:"kernelId" type:"string"` + KernelId *string `locationName:"kernelId" type:"string"` // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` - // Enable or disable monitoring for the instance. + // Enable or disable monitoring for the instances. Monitoring *SpotFleetMonitoring `locationName:"monitoring" type:"structure"` // One or more network interfaces. NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - // Describes Spot Instance placement. + // The placement information. Placement *SpotPlacement `locationName:"placement" type:"structure"` // The ID of the RAM disk. - RAMDiskID *string `locationName:"ramdiskId" type:"string"` + RamdiskId *string `locationName:"ramdiskId" type:"string"` - // One or more security groups. To request an instance in a nondefault VPC, - // you must specify the ID of the security group. To request an instance in - // EC2-Classic or a default VPC, you can specify the name or the ID of the security - // group. + // One or more security groups. When requesting instances in a VPC, you must + // specify the IDs of the security groups. When requesting instances in EC2-Classic, + // you can specify the names or the IDs of the security groups. SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - // The ID of the subnet in which to launch the instance. - SubnetID *string `locationName:"subnetId" type:"string"` + // The bid price per unit hour for the specified instance type. If this value + // is not specified, the default is the Spot bid price specified for the fleet. + // To determine the bid price per unit hour, divide the Spot bid price by the + // value of WeightedCapacity. + SpotPrice *string `locationName:"spotPrice" type:"string"` + + // The ID of the subnet in which to launch the instances. + SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded MIME user data to make available to the instances. UserData *string `locationName:"userData" type:"string"` + // The number of units provided by the specified instance type. These are the + // same units that you chose to set the target capacity in terms (instances + // or a performance characteristic such as vCPUs, memory, or I/O). + // + // If the target capacity divided by this value is not a whole number, we round + // the number of instances to the next whole number. If this value is not specified, + // the default is 1. + WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` + metadataSpotFleetLaunchSpecification `json:"-" xml:"-"` } @@ -22069,11 +22288,14 @@ func (s SpotFleetMonitoring) GoString() string { // Describes a Spot fleet request. type SpotFleetRequestConfig struct { + // The creation date and time of the request. + CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` + // 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"` + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` // The state of the Spot fleet request. SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true" enum:"BatchState"` @@ -22097,28 +22319,38 @@ func (s SpotFleetRequestConfig) GoString() string { // Describes the configuration of a Spot fleet request. type SpotFleetRequestConfigData struct { + // Indicates how to allocate the target capacity across the Spot pools specified + // by the Spot fleet request. The default is lowestPrice. + AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"AllocationStrategy"` + // 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 + // Indicates whether running Spot instances should be terminated if the target + // capacity of the Spot fleet request is decreased below the current size of + // the Spot fleet. + ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` + + // Grants the Spot fleet permission to terminate Spot instances on your behalf + // when you cancel its Spot fleet request using CancelSpotFleetRequests or when // the Spot fleet request expires, if you set terminateInstancesWithExpiration. - IAMFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` + IamFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` - // Information about the launch specifications for the instances. - LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list" required:"true"` + // Information about the launch specifications for the Spot fleet request. + LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" min:"1" type:"list" required:"true"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill - // the request. + // The bid price per unit hour. SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - // The maximum number of Spot Instances to launch. + // The number of units to request. You can choose to set the target capacity + // in terms of instances or a performance characteristic that is important to + // your application workload, such as vCPUs, memory, or I/O. TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"` - // Indicates whether running instances should be terminated when the Spot fleet - // request expires. + // Indicates whether running Spot 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). @@ -22126,7 +22358,7 @@ type SpotFleetRequestConfigData struct { 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 + // 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"` @@ -22147,25 +22379,32 @@ func (s SpotFleetRequestConfigData) GoString() string { return s.String() } -// Describe a Spot Instance request. +// Describes a Spot instance request. type SpotInstanceRequest struct { + // If you specified a duration and your Spot instance request was fulfilled, + // this is the fixed hourly price in effect for the Spot instance while it runs. + ActualBlockHourlyPrice *string `locationName:"actualBlockHourlyPrice" type:"string"` + // The Availability Zone group. If you specify the same Availability Zone group - // for all Spot Instance requests, all Spot Instances are launched in the same + // for all Spot instance requests, all Spot instances are launched in the same // Availability Zone. AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - // The date and time when the Spot Instance request was created, in UTC format + // The duration for the Spot instance, in minutes. + BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` + + // 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. + // The fault codes for the Spot instance request, if any. Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - // The instance ID, if an instance has been launched to fulfill the Spot Instance + // The instance ID, if an instance has been launched to fulfill the Spot instance // request. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` - // The instance launch group. Launch groups are Spot Instances that launch together + // The instance launch group. Launch groups are Spot instances that launch together // and terminate together. LaunchGroup *string `locationName:"launchGroup" type:"string"` @@ -22175,42 +22414,39 @@ type SpotInstanceRequest struct { // The Availability Zone in which the bid is launched. LaunchedAvailabilityZone *string `locationName:"launchedAvailabilityZone" type:"string"` - // The product description associated with the Spot Instance. + // The product description associated with the Spot instance. ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - // The ID of the Spot Instance request. - SpotInstanceRequestID *string `locationName:"spotInstanceRequestId" type:"string"` + // The ID of the Spot instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - // The maximum hourly price (bid) for any Spot Instance launched to fulfill + // The maximum hourly price (bid) for the Spot instance launched to fulfill // the request. SpotPrice *string `locationName:"spotPrice" type:"string"` - // The state of the Spot Instance request. Spot bid status information can help - // you track your Spot Instance requests. For more information, see Spot Bid + // The state of the Spot instance request. Spot bid status information can help + // you track your Spot instance requests. For more information, see Spot Bid // Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) // in the Amazon Elastic Compute Cloud User Guide. State *string `locationName:"state" type:"string" enum:"SpotInstanceState"` - // The status code and status message describing the Spot Instance request. + // The status code and status message describing the Spot instance request. Status *SpotInstanceStatus `locationName:"status" type:"structure"` // Any tags assigned to the resource. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // The Spot Instance request type. + // The Spot instance request type. Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` // 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. + // The request becomes active at this date and time. ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` // 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. + // If this is a one-time request, it 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:"-"` @@ -22230,12 +22466,12 @@ func (s SpotInstanceRequest) GoString() string { return s.String() } -// Describes a Spot Instance state change. +// Describes a Spot instance state change. type SpotInstanceStateFault struct { - // The reason code for the Spot Instance state change. + // The reason code for the Spot instance state change. Code *string `locationName:"code" type:"string"` - // The message for the Spot Instance state change. + // The message for the Spot instance state change. Message *string `locationName:"message" type:"string"` metadataSpotInstanceStateFault `json:"-" xml:"-"` @@ -22255,9 +22491,10 @@ func (s SpotInstanceStateFault) GoString() string { return s.String() } -// Describes the status of a Spot Instance request. +// Describes the status of a Spot instance request. type SpotInstanceStatus struct { - // The status code. + // The status code. For a list of status codes, see Spot Bid Status Codes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand) + // in the Amazon Elastic Compute Cloud User Guide. Code *string `locationName:"code" type:"string"` // The description for the status code. @@ -22284,7 +22521,7 @@ func (s SpotInstanceStatus) GoString() string { return s.String() } -// Describes Spot Instance placement. +// Describes Spot instance placement. type SpotPlacement struct { // The Availability Zone. AvailabilityZone *string `locationName:"availabilityZone" type:"string"` @@ -22309,7 +22546,7 @@ func (s SpotPlacement) GoString() string { return s.String() } -// Describes the maximum hourly price (bid) for any Spot Instance launched to +// Describes the maximum hourly price (bid) for any Spot instance launched to // fulfill the request. type SpotPrice struct { // The Availability Zone. @@ -22321,7 +22558,7 @@ type SpotPrice struct { // A general description of the AMI. ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - // The maximum price (bid) that you are willing to pay for a Spot Instance. + // 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, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). @@ -22355,7 +22592,7 @@ type StartInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataStartInstancesInput `json:"-" xml:"-"` } @@ -22458,7 +22695,7 @@ type StopInstancesInput struct { Force *bool `locationName:"force" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataStopInstancesInput `json:"-" xml:"-"` } @@ -22527,28 +22764,28 @@ type Subnet struct { // The number of unused IP addresses in the subnet. Note that the IP addresses // for any stopped instances are considered unavailable. - AvailableIPAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` + AvailableIpAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` // The CIDR block assigned to the subnet. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` + CidrBlock *string `locationName:"cidrBlock" type:"string"` // Indicates whether this is the default subnet for the Availability Zone. - DefaultForAZ *bool `locationName:"defaultForAz" type:"boolean"` + DefaultForAz *bool `locationName:"defaultForAz" type:"boolean"` // Indicates whether instances launched in this subnet receive a public IP address. - MapPublicIPOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` + MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` // The current state of the subnet. State *string `locationName:"state" type:"string" enum:"SubnetState"` // The ID of the subnet. - SubnetID *string `locationName:"subnetId" type:"string"` + SubnetId *string `locationName:"subnetId" type:"string"` // Any tags assigned to the subnet. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the VPC the subnet is in. - VPCID *string `locationName:"vpcId" type:"string"` + VpcId *string `locationName:"vpcId" type:"string"` metadataSubnet `json:"-" xml:"-"` } @@ -22604,7 +22841,7 @@ type TagDescription struct { Key *string `locationName:"key" type:"string"` // The ID of the resource. For example, ami-1a2b3c4d. - ResourceID *string `locationName:"resourceId" type:"string"` + ResourceId *string `locationName:"resourceId" type:"string"` // The resource type. ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` @@ -22637,7 +22874,7 @@ type TerminateInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataTerminateInstancesInput `json:"-" xml:"-"` } @@ -22677,46 +22914,46 @@ func (s TerminateInstancesOutput) GoString() string { return s.String() } -type UnassignPrivateIPAddressesInput struct { +type UnassignPrivateIpAddressesInput struct { // The ID of the network interface. - NetworkInterfaceID *string `locationName:"networkInterfaceId" type:"string" required:"true"` + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` // The secondary private IP addresses to unassign from the network interface. // You can specify this option multiple times to unassign more than one IP address. - PrivateIPAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` + PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` - metadataUnassignPrivateIPAddressesInput `json:"-" xml:"-"` + metadataUnassignPrivateIpAddressesInput `json:"-" xml:"-"` } -type metadataUnassignPrivateIPAddressesInput struct { +type metadataUnassignPrivateIpAddressesInput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s UnassignPrivateIPAddressesInput) String() string { +func (s UnassignPrivateIpAddressesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UnassignPrivateIPAddressesInput) GoString() string { +func (s UnassignPrivateIpAddressesInput) GoString() string { return s.String() } -type UnassignPrivateIPAddressesOutput struct { - metadataUnassignPrivateIPAddressesOutput `json:"-" xml:"-"` +type UnassignPrivateIpAddressesOutput struct { + metadataUnassignPrivateIpAddressesOutput `json:"-" xml:"-"` } -type metadataUnassignPrivateIPAddressesOutput struct { +type metadataUnassignPrivateIpAddressesOutput struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s UnassignPrivateIPAddressesOutput) String() string { +func (s UnassignPrivateIpAddressesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UnassignPrivateIPAddressesOutput) GoString() string { +func (s UnassignPrivateIpAddressesOutput) GoString() string { return s.String() } @@ -22728,7 +22965,7 @@ type UnmonitorInstancesInput struct { DryRun *bool `locationName:"dryRun" type:"boolean"` // One or more instance IDs. - InstanceIDs []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` metadataUnmonitorInstancesInput `json:"-" xml:"-"` } @@ -22774,7 +23011,7 @@ type UnsuccessfulItem struct { Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"` // The ID of the resource. - ResourceID *string `locationName:"resourceId" type:"string"` + ResourceId *string `locationName:"resourceId" type:"string"` metadataUnsuccessfulItem `json:"-" xml:"-"` } @@ -22793,7 +23030,7 @@ func (s UnsuccessfulItem) GoString() string { return s.String() } -// Information about the error that occured. For more information about errors, +// Information about the error that occurred. 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. @@ -22892,9 +23129,9 @@ func (s UserData) GoString() string { } // Describes a security group and AWS account ID pair. -type UserIDGroupPair struct { +type UserIdGroupPair struct { // The ID of the security group. - GroupID *string `locationName:"groupId" type:"string"` + GroupId *string `locationName:"groupId" type:"string"` // The name of the security group. In a request, use this parameter for a security // group in EC2-Classic or a default VPC only. For a security group in a nondefault @@ -22902,27 +23139,27 @@ type UserIDGroupPair struct { GroupName *string `locationName:"groupName" type:"string"` // The ID of an AWS account. EC2-Classic only. - UserID *string `locationName:"userId" type:"string"` + UserId *string `locationName:"userId" type:"string"` - metadataUserIDGroupPair `json:"-" xml:"-"` + metadataUserIdGroupPair `json:"-" xml:"-"` } -type metadataUserIDGroupPair struct { +type metadataUserIdGroupPair struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s UserIDGroupPair) String() string { +func (s UserIdGroupPair) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UserIDGroupPair) GoString() string { +func (s UserIdGroupPair) GoString() string { return s.String() } // Describes telemetry for a VPN tunnel. -type VGWTelemetry struct { +type VgwTelemetry struct { // The number of accepted routes. AcceptedRouteCount *int64 `locationName:"acceptedRouteCount" type:"integer"` @@ -22931,7 +23168,7 @@ type VGWTelemetry struct { // The Internet-routable IP address of the virtual private gateway's outside // interface. - OutsideIPAddress *string `locationName:"outsideIpAddress" type:"string"` + OutsideIpAddress *string `locationName:"outsideIpAddress" type:"string"` // The status of the VPN tunnel. Status *string `locationName:"status" type:"string" enum:"TelemetryStatus"` @@ -22939,407 +23176,20 @@ type VGWTelemetry struct { // If an error occurs, a description of the error. StatusMessage *string `locationName:"statusMessage" type:"string"` - metadataVGWTelemetry `json:"-" xml:"-"` + metadataVgwTelemetry `json:"-" xml:"-"` } -type metadataVGWTelemetry struct { +type metadataVgwTelemetry struct { SDKShapeTraits bool `type:"structure"` } // String returns the string representation -func (s VGWTelemetry) String() string { +func (s VgwTelemetry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s VGWTelemetry) GoString() string { - return s.String() -} - -// Describes a VPC. -type VPC struct { - // The CIDR block for the VPC. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` - - // The ID of the set of DHCP options you've associated with the VPC (or default - // if the default options are associated with the VPC). - DHCPOptionsID *string `locationName:"dhcpOptionsId" type:"string"` - - // The allowed tenancy of instances launched into the VPC. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // Indicates whether the VPC is the default VPC. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The current state of the VPC. - State *string `locationName:"state" type:"string" enum:"VpcState"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataVPC `json:"-" xml:"-"` -} - -type metadataVPC struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPC) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPC) GoString() string { - return s.String() -} - -// Describes an attachment between a virtual private gateway and a VPC. -type VPCAttachment struct { - // The current state of the attachment. - State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataVPCAttachment `json:"-" xml:"-"` -} - -type metadataVPCAttachment struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPCAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCAttachment) GoString() string { - return s.String() -} - -// Describes whether a VPC is enabled for ClassicLink. -type VPCClassicLink struct { - // Indicates whether the VPC is enabled for ClassicLink. - ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataVPCClassicLink `json:"-" xml:"-"` -} - -type metadataVPCClassicLink struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPCClassicLink) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCClassicLink) GoString() string { - return s.String() -} - -// 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" enum:"State"` - - // 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"` -} - -// String returns the string representation -func (s VPCEndpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCEndpoint) GoString() string { - return s.String() -} - -// Describes a VPC peering connection. -type VPCPeeringConnection struct { - // The information of the peer VPC. - AccepterVPCInfo *VPCPeeringConnectionVPCInfo `locationName:"accepterVpcInfo" type:"structure"` - - // The time that an unaccepted VPC peering connection will expire. - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The information of the requester VPC. - RequesterVPCInfo *VPCPeeringConnectionVPCInfo `locationName:"requesterVpcInfo" type:"structure"` - - // The status of the VPC peering connection. - Status *VPCPeeringConnectionStateReason `locationName:"status" type:"structure"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC peering connection. - VPCPeeringConnectionID *string `locationName:"vpcPeeringConnectionId" type:"string"` - - metadataVPCPeeringConnection `json:"-" xml:"-"` -} - -type metadataVPCPeeringConnection struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPCPeeringConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCPeeringConnection) GoString() string { - return s.String() -} - -// Describes the status of a VPC peering connection. -type VPCPeeringConnectionStateReason struct { - // The status of the VPC peering connection. - Code *string `locationName:"code" type:"string" enum:"VpcPeeringConnectionStateReasonCode"` - - // A message that provides more information about the status, if applicable. - Message *string `locationName:"message" type:"string"` - - metadataVPCPeeringConnectionStateReason `json:"-" xml:"-"` -} - -type metadataVPCPeeringConnectionStateReason struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPCPeeringConnectionStateReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCPeeringConnectionStateReason) GoString() string { - return s.String() -} - -// Describes a VPC in a VPC peering connection. -type VPCPeeringConnectionVPCInfo struct { - // The CIDR block for the VPC. - CIDRBlock *string `locationName:"cidrBlock" type:"string"` - - // The AWS account ID of the VPC owner. - OwnerID *string `locationName:"ownerId" type:"string"` - - // The ID of the VPC. - VPCID *string `locationName:"vpcId" type:"string"` - - metadataVPCPeeringConnectionVPCInfo `json:"-" xml:"-"` -} - -type metadataVPCPeeringConnectionVPCInfo struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPCPeeringConnectionVPCInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPCPeeringConnectionVPCInfo) GoString() string { - return s.String() -} - -// Describes a VPN connection. -type VPNConnection struct { - // The configuration information for the VPN connection's customer gateway (in - // the native XML format). This element is always present in the CreateVpnConnection - // response; however, it's present in the DescribeVpnConnections response only - // if the VPN connection is in the pending or available state. - CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayID *string `locationName:"customerGatewayId" type:"string"` - - // The VPN connection options. - Options *VPNConnectionOptions `locationName:"options" type:"structure"` - - // The static routes associated with the VPN connection. - Routes []*VPNStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` - - // The current state of the VPN connection. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the VPN connection. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Information about the VPN tunnel. - VGWTelemetry []*VGWTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` - - // The ID of the VPN connection. - VPNConnectionID *string `locationName:"vpnConnectionId" type:"string"` - - // The ID of the virtual private gateway at the AWS side of the VPN connection. - VPNGatewayID *string `locationName:"vpnGatewayId" type:"string"` - - metadataVPNConnection `json:"-" xml:"-"` -} - -type metadataVPNConnection struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPNConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPNConnection) GoString() string { - return s.String() -} - -// Describes VPN connection options. -type VPNConnectionOptions struct { - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` - - metadataVPNConnectionOptions `json:"-" xml:"-"` -} - -type metadataVPNConnectionOptions struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPNConnectionOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPNConnectionOptions) GoString() string { - return s.String() -} - -// Describes VPN connection options. -type VPNConnectionOptionsSpecification struct { - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` - - metadataVPNConnectionOptionsSpecification `json:"-" xml:"-"` -} - -type metadataVPNConnectionOptionsSpecification struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPNConnectionOptionsSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPNConnectionOptionsSpecification) GoString() string { - return s.String() -} - -// Describes a virtual private gateway. -type VPNGateway struct { - // The Availability Zone where the virtual private gateway was created. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The current state of the virtual private gateway. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the virtual private gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection the virtual private gateway supports. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Any VPCs attached to the virtual private gateway. - VPCAttachments []*VPCAttachment `locationName:"attachments" locationNameList:"item" type:"list"` - - // The ID of the virtual private gateway. - VPNGatewayID *string `locationName:"vpnGatewayId" type:"string"` - - metadataVPNGateway `json:"-" xml:"-"` -} - -type metadataVPNGateway struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPNGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPNGateway) GoString() string { - return s.String() -} - -// Describes a static route for a VPN connection. -type VPNStaticRoute struct { - // The CIDR block associated with the local subnet of the customer data center. - DestinationCIDRBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // Indicates how the routes were provided. - Source *string `locationName:"source" type:"string" enum:"VpnStaticRouteSource"` - - // The current state of the static route. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - metadataVPNStaticRoute `json:"-" xml:"-"` -} - -type metadataVPNStaticRoute struct { - SDKShapeTraits bool `type:"structure"` -} - -// String returns the string representation -func (s VPNStaticRoute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPNStaticRoute) GoString() string { +func (s VgwTelemetry) GoString() string { return s.String() } @@ -23370,17 +23220,17 @@ type Volume struct { // // Condition: This parameter is required for requests to create io1 volumes; // it is not used in requests to create standard or gp2 volumes. - IOPS *int64 `locationName:"iops" type:"integer"` + Iops *int64 `locationName:"iops" type:"integer"` // The full ARN of the AWS Key Management Service (AWS KMS) customer master // key (CMK) that was used to protect the volume encryption key for the volume. - KMSKeyID *string `locationName:"kmsKeyId" type:"string"` + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` // The size of the volume, in GiBs. Size *int64 `locationName:"size" type:"integer"` // The snapshot from which the volume was created, if applicable. - SnapshotID *string `locationName:"snapshotId" type:"string"` + SnapshotId *string `locationName:"snapshotId" type:"string"` // The volume state. State *string `locationName:"status" type:"string" enum:"VolumeState"` @@ -23389,7 +23239,7 @@ type Volume struct { Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` // The volume type. This can be gp2 for General Purpose (SSD) volumes, io1 for // Provisioned IOPS (SSD) volumes, or standard for Magnetic volumes. @@ -23424,13 +23274,13 @@ type VolumeAttachment struct { Device *string `locationName:"device" type:"string"` // The ID of the instance. - InstanceID *string `locationName:"instanceId" type:"string"` + InstanceId *string `locationName:"instanceId" type:"string"` // The attachment state of the volume. State *string `locationName:"status" type:"string" enum:"VolumeAttachmentState"` // The ID of the volume. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` metadataVolumeAttachment `json:"-" xml:"-"` } @@ -23480,7 +23330,7 @@ type VolumeStatusAction struct { Description *string `locationName:"description" type:"string"` // The ID of the event associated with this operation. - EventID *string `locationName:"eventId" type:"string"` + EventId *string `locationName:"eventId" type:"string"` // The event type associated with this operation. EventType *string `locationName:"eventType" type:"string"` @@ -23533,7 +23383,7 @@ type VolumeStatusEvent struct { Description *string `locationName:"description" type:"string"` // The ID of this event. - EventID *string `locationName:"eventId" type:"string"` + EventId *string `locationName:"eventId" type:"string"` // The type of this event. EventType *string `locationName:"eventType" type:"string"` @@ -23598,7 +23448,7 @@ type VolumeStatusItem struct { Events []*VolumeStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` // The volume ID. - VolumeID *string `locationName:"volumeId" type:"string"` + VolumeId *string `locationName:"volumeId" type:"string"` // The volume status. VolumeStatus *VolumeStatusInfo `locationName:"volumeStatus" type:"structure"` @@ -23620,6 +23470,393 @@ func (s VolumeStatusItem) GoString() string { return s.String() } +// Describes a VPC. +type Vpc struct { + // The CIDR block for the VPC. + CidrBlock *string `locationName:"cidrBlock" type:"string"` + + // The ID of the set of DHCP options you've associated with the VPC (or default + // if the default options are associated with the VPC). + DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` + + // The allowed tenancy of instances launched into the VPC. + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` + + // Indicates whether the VPC is the default VPC. + IsDefault *bool `locationName:"isDefault" type:"boolean"` + + // The current state of the VPC. + State *string `locationName:"state" type:"string" enum:"VpcState"` + + // Any tags assigned to the VPC. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpc `json:"-" xml:"-"` +} + +type metadataVpc struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s Vpc) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Vpc) GoString() string { + return s.String() +} + +// Describes an attachment between a virtual private gateway and a VPC. +type VpcAttachment struct { + // The current state of the attachment. + State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcAttachment `json:"-" xml:"-"` +} + +type metadataVpcAttachment struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcAttachment) GoString() string { + return s.String() +} + +// Describes whether a VPC is enabled for ClassicLink. +type VpcClassicLink struct { + // Indicates whether the VPC is enabled for ClassicLink. + ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` + + // Any tags assigned to the VPC. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcClassicLink `json:"-" xml:"-"` +} + +type metadataVpcClassicLink struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcClassicLink) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcClassicLink) GoString() string { + return s.String() +} + +// 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" enum:"State"` + + // 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"` +} + +// String returns the string representation +func (s VpcEndpoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcEndpoint) GoString() string { + return s.String() +} + +// Describes a VPC peering connection. +type VpcPeeringConnection struct { + // The information of the peer VPC. + AccepterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"accepterVpcInfo" type:"structure"` + + // The time that an unaccepted VPC peering connection will expire. + ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` + + // The information of the requester VPC. + RequesterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"requesterVpcInfo" type:"structure"` + + // The status of the VPC peering connection. + Status *VpcPeeringConnectionStateReason `locationName:"status" type:"structure"` + + // Any tags assigned to the resource. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VPC peering connection. + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` + + metadataVpcPeeringConnection `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnection struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnection) GoString() string { + return s.String() +} + +// Describes the status of a VPC peering connection. +type VpcPeeringConnectionStateReason struct { + // The status of the VPC peering connection. + Code *string `locationName:"code" type:"string" enum:"VpcPeeringConnectionStateReasonCode"` + + // A message that provides more information about the status, if applicable. + Message *string `locationName:"message" type:"string"` + + metadataVpcPeeringConnectionStateReason `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnectionStateReason struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnectionStateReason) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnectionStateReason) GoString() string { + return s.String() +} + +// Describes a VPC in a VPC peering connection. +type VpcPeeringConnectionVpcInfo struct { + // The CIDR block for the VPC. + CidrBlock *string `locationName:"cidrBlock" type:"string"` + + // The AWS account ID of the VPC owner. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` + + metadataVpcPeeringConnectionVpcInfo `json:"-" xml:"-"` +} + +type metadataVpcPeeringConnectionVpcInfo struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpcPeeringConnectionVpcInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcPeeringConnectionVpcInfo) GoString() string { + return s.String() +} + +// Describes a VPN connection. +type VpnConnection struct { + // The configuration information for the VPN connection's customer gateway (in + // the native XML format). This element is always present in the CreateVpnConnection + // response; however, it's present in the DescribeVpnConnections response only + // if the VPN connection is in the pending or available state. + CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` + + // The ID of the customer gateway at your end of the VPN connection. + CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` + + // The VPN connection options. + Options *VpnConnectionOptions `locationName:"options" type:"structure"` + + // The static routes associated with the VPN connection. + Routes []*VpnStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` + + // The current state of the VPN connection. + State *string `locationName:"state" type:"string" enum:"VpnState"` + + // Any tags assigned to the VPN connection. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The type of VPN connection. + Type *string `locationName:"type" type:"string" enum:"GatewayType"` + + // Information about the VPN tunnel. + VgwTelemetry []*VgwTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` + + // The ID of the VPN connection. + VpnConnectionId *string `locationName:"vpnConnectionId" type:"string"` + + // The ID of the virtual private gateway at the AWS side of the VPN connection. + VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` + + metadataVpnConnection `json:"-" xml:"-"` +} + +type metadataVpnConnection struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpnConnection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnection) GoString() string { + return s.String() +} + +// Describes VPN connection options. +type VpnConnectionOptions struct { + // Indicates whether the VPN connection uses static routes only. Static routes + // must be used for devices that don't support BGP. + StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` + + metadataVpnConnectionOptions `json:"-" xml:"-"` +} + +type metadataVpnConnectionOptions struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpnConnectionOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnectionOptions) GoString() string { + return s.String() +} + +// Describes VPN connection options. +type VpnConnectionOptionsSpecification struct { + // Indicates whether the VPN connection uses static routes only. Static routes + // must be used for devices that don't support BGP. + StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` + + metadataVpnConnectionOptionsSpecification `json:"-" xml:"-"` +} + +type metadataVpnConnectionOptionsSpecification struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpnConnectionOptionsSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnConnectionOptionsSpecification) GoString() string { + return s.String() +} + +// Describes a virtual private gateway. +type VpnGateway struct { + // The Availability Zone where the virtual private gateway was created. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The current state of the virtual private gateway. + State *string `locationName:"state" type:"string" enum:"VpnState"` + + // Any tags assigned to the virtual private gateway. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The type of VPN connection the virtual private gateway supports. + Type *string `locationName:"type" type:"string" enum:"GatewayType"` + + // Any VPCs attached to the virtual private gateway. + VpcAttachments []*VpcAttachment `locationName:"attachments" locationNameList:"item" type:"list"` + + // The ID of the virtual private gateway. + VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` + + metadataVpnGateway `json:"-" xml:"-"` +} + +type metadataVpnGateway struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpnGateway) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnGateway) GoString() string { + return s.String() +} + +// Describes a static route for a VPN connection. +type VpnStaticRoute struct { + // The CIDR block associated with the local subnet of the customer data center. + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` + + // Indicates how the routes were provided. + Source *string `locationName:"source" type:"string" enum:"VpnStaticRouteSource"` + + // The current state of the static route. + State *string `locationName:"state" type:"string" enum:"VpnState"` + + metadataVpnStaticRoute `json:"-" xml:"-"` +} + +type metadataVpnStaticRoute struct { + SDKShapeTraits bool `type:"structure"` +} + +// String returns the string representation +func (s VpnStaticRoute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnStaticRoute) GoString() string { + return s.String() +} + const ( // @enum AccountAttributeName AccountAttributeNameSupportedPlatforms = "supported-platforms" @@ -23627,6 +23864,13 @@ const ( AccountAttributeNameDefaultVpc = "default-vpc" ) +const ( + // @enum AllocationStrategy + AllocationStrategyLowestPrice = "lowestPrice" + // @enum AllocationStrategy + AllocationStrategyDiversified = "diversified" +) + const ( // @enum ArchitectureValues ArchitectureValuesI386 = "i386" @@ -23648,6 +23892,12 @@ const ( const ( // @enum AvailabilityZoneState AvailabilityZoneStateAvailable = "available" + // @enum AvailabilityZoneState + AvailabilityZoneStateInformation = "information" + // @enum AvailabilityZoneState + AvailabilityZoneStateImpaired = "impaired" + // @enum AvailabilityZoneState + AvailabilityZoneStateUnavailable = "unavailable" ) const ( @@ -23663,6 +23913,8 @@ const ( BatchStateCancelledRunning = "cancelled_running" // @enum BatchState BatchStateCancelledTerminating = "cancelled_terminating" + // @enum BatchState + BatchStateModifying = "modifying" ) const ( @@ -23779,6 +24031,13 @@ const ( EventTypeError = "error" ) +const ( + // @enum ExcessCapacityTerminationPolicy + ExcessCapacityTerminationPolicyNoTermination = "noTermination" + // @enum ExcessCapacityTerminationPolicy + ExcessCapacityTerminationPolicyDefault = "default" +) + const ( // @enum ExportEnvironment ExportEnvironmentCitrix = "citrix" @@ -24098,6 +24357,13 @@ const ( OfferingTypeValuesAllUpfront = "All Upfront" ) +const ( + // @enum OperationType + OperationTypeAdd = "add" + // @enum OperationType + OperationTypeRemove = "remove" +) + const ( // @enum PermissionGroup PermissionGroupAll = "all" diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go index f3233e42e27..9e94fe671ce 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations.go @@ -5,53 +5,51 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/endpoints" ) func init() { - initRequest = func(r *aws.Request) { + initRequest = func(r *request.Request) { if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter r.Handlers.Build.PushFront(fillPresignedURL) } } } -func fillPresignedURL(r *aws.Request) { +func fillPresignedURL(r *request.Request) { if !r.ParamsFilled() { return } - params := r.Params.(*CopySnapshotInput) + origParams := r.Params.(*CopySnapshotInput) // Stop if PresignedURL/DestinationRegion is set - if params.PresignedURL != nil || params.DestinationRegion != nil { + if origParams.PresignedUrl != nil || origParams.DestinationRegion != nil { return } - // First generate a copy of parameters - r.Params = awsutil.CopyOf(r.Params) - params = r.Params.(*CopySnapshotInput) + origParams.DestinationRegion = r.Config.Region + newParams := awsutil.CopyOf(r.Params).(*CopySnapshotInput) - // Set destination region. Avoids infinite handler loop. - // Also needed to sign sub-request. - params.DestinationRegion = r.Service.Config.Region - - // Create a new client pointing at source region. - // We will use this to presign the CopySnapshot request against - // the source region - config := r.Service.Config.Copy(). + // Create a new request based on the existing request. We will use this to + // presign the CopySnapshot request against the source region. + cfg := r.Config.Copy(aws.NewConfig(). WithEndpoint(""). - WithRegion(*params.SourceRegion) + WithRegion(aws.StringValue(origParams.SourceRegion))) - client := New(config) + clientInfo := r.ClientInfo + clientInfo.Endpoint, clientInfo.SigningRegion = endpoints.EndpointForRegion( + clientInfo.ServiceName, aws.StringValue(cfg.Region), aws.BoolValue(cfg.DisableSSL)) // Presign a CopySnapshot request with modified params - req, _ := client.CopySnapshotRequest(params) - url, err := req.Presign(300 * time.Second) // 5 minutes should be enough. - - if err != nil { // bubble error back up to original request + req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data) + url, err := req.Presign(5 * time.Minute) // 5 minutes should be enough. + if err != nil { // bubble error back up to original request r.Error = err + return } // We have our URL, set it on params - params.PresignedURL = &url + origParams.PresignedUrl = &url } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go index 2233ba7a295..195d9b55b8d 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go @@ -6,15 +6,13 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/internal/test/unit" + "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/ec2" "github.com/stretchr/testify/assert" ) -var _ = unit.Imported - func TestCopySnapshotPresignedURL(t *testing.T) { - svc := ec2.New(&aws.Config{Region: aws.String("us-west-2")}) + svc := ec2.New(unit.Session, &aws.Config{Region: aws.String("us-west-2")}) assert.NotPanics(t, func() { // Doesn't panic on nil input @@ -24,13 +22,14 @@ func TestCopySnapshotPresignedURL(t *testing.T) { req, _ := svc.CopySnapshotRequest(&ec2.CopySnapshotInput{ SourceRegion: aws.String("us-west-1"), - SourceSnapshotID: aws.String("snap-id"), + SourceSnapshotId: aws.String("snap-id"), }) req.Sign() b, _ := ioutil.ReadAll(req.HTTPRequest.Body) q, _ := url.ParseQuery(string(b)) - url, _ := url.QueryUnescape(q.Get("PresignedUrl")) + u, _ := url.QueryUnescape(q.Get("PresignedUrl")) assert.Equal(t, "us-west-2", q.Get("DestinationRegion")) - assert.Regexp(t, `^https://ec2\.us-west-1\.amazon.+&DestinationRegion=us-west-2`, url) + assert.Equal(t, "us-west-1", q.Get("SourceRegion")) + assert.Regexp(t, `^https://ec2\.us-west-1\.amazonaws\.com/.+&DestinationRegion=us-west-2`, u) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go index cf5ed743131..5bcf93248ae 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go @@ -4,753 +4,761 @@ package ec2iface import ( - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ec2" ) // EC2API is the interface type for ec2.EC2. type EC2API interface { - AcceptVPCPeeringConnectionRequest(*ec2.AcceptVPCPeeringConnectionInput) (*aws.Request, *ec2.AcceptVPCPeeringConnectionOutput) + AcceptVpcPeeringConnectionRequest(*ec2.AcceptVpcPeeringConnectionInput) (*request.Request, *ec2.AcceptVpcPeeringConnectionOutput) - AcceptVPCPeeringConnection(*ec2.AcceptVPCPeeringConnectionInput) (*ec2.AcceptVPCPeeringConnectionOutput, error) + AcceptVpcPeeringConnection(*ec2.AcceptVpcPeeringConnectionInput) (*ec2.AcceptVpcPeeringConnectionOutput, error) - AllocateAddressRequest(*ec2.AllocateAddressInput) (*aws.Request, *ec2.AllocateAddressOutput) + AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput) AllocateAddress(*ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error) - AssignPrivateIPAddressesRequest(*ec2.AssignPrivateIPAddressesInput) (*aws.Request, *ec2.AssignPrivateIPAddressesOutput) + AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) - AssignPrivateIPAddresses(*ec2.AssignPrivateIPAddressesInput) (*ec2.AssignPrivateIPAddressesOutput, error) + AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) - AssociateAddressRequest(*ec2.AssociateAddressInput) (*aws.Request, *ec2.AssociateAddressOutput) + AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput) AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error) - AssociateDHCPOptionsRequest(*ec2.AssociateDHCPOptionsInput) (*aws.Request, *ec2.AssociateDHCPOptionsOutput) + AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) - AssociateDHCPOptions(*ec2.AssociateDHCPOptionsInput) (*ec2.AssociateDHCPOptionsOutput, error) + AssociateDhcpOptions(*ec2.AssociateDhcpOptionsInput) (*ec2.AssociateDhcpOptionsOutput, error) - AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*aws.Request, *ec2.AssociateRouteTableOutput) + AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*request.Request, *ec2.AssociateRouteTableOutput) AssociateRouteTable(*ec2.AssociateRouteTableInput) (*ec2.AssociateRouteTableOutput, error) - AttachClassicLinkVPCRequest(*ec2.AttachClassicLinkVPCInput) (*aws.Request, *ec2.AttachClassicLinkVPCOutput) + AttachClassicLinkVpcRequest(*ec2.AttachClassicLinkVpcInput) (*request.Request, *ec2.AttachClassicLinkVpcOutput) - AttachClassicLinkVPC(*ec2.AttachClassicLinkVPCInput) (*ec2.AttachClassicLinkVPCOutput, error) + AttachClassicLinkVpc(*ec2.AttachClassicLinkVpcInput) (*ec2.AttachClassicLinkVpcOutput, error) - AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*aws.Request, *ec2.AttachInternetGatewayOutput) + AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput) AttachInternetGateway(*ec2.AttachInternetGatewayInput) (*ec2.AttachInternetGatewayOutput, error) - AttachNetworkInterfaceRequest(*ec2.AttachNetworkInterfaceInput) (*aws.Request, *ec2.AttachNetworkInterfaceOutput) + AttachNetworkInterfaceRequest(*ec2.AttachNetworkInterfaceInput) (*request.Request, *ec2.AttachNetworkInterfaceOutput) AttachNetworkInterface(*ec2.AttachNetworkInterfaceInput) (*ec2.AttachNetworkInterfaceOutput, error) - AttachVPNGatewayRequest(*ec2.AttachVPNGatewayInput) (*aws.Request, *ec2.AttachVPNGatewayOutput) - - AttachVPNGateway(*ec2.AttachVPNGatewayInput) (*ec2.AttachVPNGatewayOutput, error) - - AttachVolumeRequest(*ec2.AttachVolumeInput) (*aws.Request, *ec2.VolumeAttachment) + AttachVolumeRequest(*ec2.AttachVolumeInput) (*request.Request, *ec2.VolumeAttachment) AttachVolume(*ec2.AttachVolumeInput) (*ec2.VolumeAttachment, error) - AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*aws.Request, *ec2.AuthorizeSecurityGroupEgressOutput) + AttachVpnGatewayRequest(*ec2.AttachVpnGatewayInput) (*request.Request, *ec2.AttachVpnGatewayOutput) + + AttachVpnGateway(*ec2.AttachVpnGatewayInput) (*ec2.AttachVpnGatewayOutput, error) + + AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*request.Request, *ec2.AuthorizeSecurityGroupEgressOutput) AuthorizeSecurityGroupEgress(*ec2.AuthorizeSecurityGroupEgressInput) (*ec2.AuthorizeSecurityGroupEgressOutput, error) - AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*aws.Request, *ec2.AuthorizeSecurityGroupIngressOutput) + AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*request.Request, *ec2.AuthorizeSecurityGroupIngressOutput) AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error) - BundleInstanceRequest(*ec2.BundleInstanceInput) (*aws.Request, *ec2.BundleInstanceOutput) + BundleInstanceRequest(*ec2.BundleInstanceInput) (*request.Request, *ec2.BundleInstanceOutput) BundleInstance(*ec2.BundleInstanceInput) (*ec2.BundleInstanceOutput, error) - CancelBundleTaskRequest(*ec2.CancelBundleTaskInput) (*aws.Request, *ec2.CancelBundleTaskOutput) + CancelBundleTaskRequest(*ec2.CancelBundleTaskInput) (*request.Request, *ec2.CancelBundleTaskOutput) CancelBundleTask(*ec2.CancelBundleTaskInput) (*ec2.CancelBundleTaskOutput, error) - CancelConversionTaskRequest(*ec2.CancelConversionTaskInput) (*aws.Request, *ec2.CancelConversionTaskOutput) + CancelConversionTaskRequest(*ec2.CancelConversionTaskInput) (*request.Request, *ec2.CancelConversionTaskOutput) CancelConversionTask(*ec2.CancelConversionTaskInput) (*ec2.CancelConversionTaskOutput, error) - CancelExportTaskRequest(*ec2.CancelExportTaskInput) (*aws.Request, *ec2.CancelExportTaskOutput) + CancelExportTaskRequest(*ec2.CancelExportTaskInput) (*request.Request, *ec2.CancelExportTaskOutput) CancelExportTask(*ec2.CancelExportTaskInput) (*ec2.CancelExportTaskOutput, error) - CancelImportTaskRequest(*ec2.CancelImportTaskInput) (*aws.Request, *ec2.CancelImportTaskOutput) + CancelImportTaskRequest(*ec2.CancelImportTaskInput) (*request.Request, *ec2.CancelImportTaskOutput) CancelImportTask(*ec2.CancelImportTaskInput) (*ec2.CancelImportTaskOutput, error) - CancelReservedInstancesListingRequest(*ec2.CancelReservedInstancesListingInput) (*aws.Request, *ec2.CancelReservedInstancesListingOutput) + CancelReservedInstancesListingRequest(*ec2.CancelReservedInstancesListingInput) (*request.Request, *ec2.CancelReservedInstancesListingOutput) CancelReservedInstancesListing(*ec2.CancelReservedInstancesListingInput) (*ec2.CancelReservedInstancesListingOutput, error) - CancelSpotFleetRequestsRequest(*ec2.CancelSpotFleetRequestsInput) (*aws.Request, *ec2.CancelSpotFleetRequestsOutput) + CancelSpotFleetRequestsRequest(*ec2.CancelSpotFleetRequestsInput) (*request.Request, *ec2.CancelSpotFleetRequestsOutput) CancelSpotFleetRequests(*ec2.CancelSpotFleetRequestsInput) (*ec2.CancelSpotFleetRequestsOutput, error) - CancelSpotInstanceRequestsRequest(*ec2.CancelSpotInstanceRequestsInput) (*aws.Request, *ec2.CancelSpotInstanceRequestsOutput) + CancelSpotInstanceRequestsRequest(*ec2.CancelSpotInstanceRequestsInput) (*request.Request, *ec2.CancelSpotInstanceRequestsOutput) CancelSpotInstanceRequests(*ec2.CancelSpotInstanceRequestsInput) (*ec2.CancelSpotInstanceRequestsOutput, error) - ConfirmProductInstanceRequest(*ec2.ConfirmProductInstanceInput) (*aws.Request, *ec2.ConfirmProductInstanceOutput) + ConfirmProductInstanceRequest(*ec2.ConfirmProductInstanceInput) (*request.Request, *ec2.ConfirmProductInstanceOutput) ConfirmProductInstance(*ec2.ConfirmProductInstanceInput) (*ec2.ConfirmProductInstanceOutput, error) - CopyImageRequest(*ec2.CopyImageInput) (*aws.Request, *ec2.CopyImageOutput) + CopyImageRequest(*ec2.CopyImageInput) (*request.Request, *ec2.CopyImageOutput) CopyImage(*ec2.CopyImageInput) (*ec2.CopyImageOutput, error) - CopySnapshotRequest(*ec2.CopySnapshotInput) (*aws.Request, *ec2.CopySnapshotOutput) + CopySnapshotRequest(*ec2.CopySnapshotInput) (*request.Request, *ec2.CopySnapshotOutput) CopySnapshot(*ec2.CopySnapshotInput) (*ec2.CopySnapshotOutput, error) - CreateCustomerGatewayRequest(*ec2.CreateCustomerGatewayInput) (*aws.Request, *ec2.CreateCustomerGatewayOutput) + CreateCustomerGatewayRequest(*ec2.CreateCustomerGatewayInput) (*request.Request, *ec2.CreateCustomerGatewayOutput) CreateCustomerGateway(*ec2.CreateCustomerGatewayInput) (*ec2.CreateCustomerGatewayOutput, error) - CreateDHCPOptionsRequest(*ec2.CreateDHCPOptionsInput) (*aws.Request, *ec2.CreateDHCPOptionsOutput) + CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput) - CreateDHCPOptions(*ec2.CreateDHCPOptionsInput) (*ec2.CreateDHCPOptionsOutput, error) + CreateDhcpOptions(*ec2.CreateDhcpOptionsInput) (*ec2.CreateDhcpOptionsOutput, error) - CreateFlowLogsRequest(*ec2.CreateFlowLogsInput) (*aws.Request, *ec2.CreateFlowLogsOutput) + CreateFlowLogsRequest(*ec2.CreateFlowLogsInput) (*request.Request, *ec2.CreateFlowLogsOutput) CreateFlowLogs(*ec2.CreateFlowLogsInput) (*ec2.CreateFlowLogsOutput, error) - CreateImageRequest(*ec2.CreateImageInput) (*aws.Request, *ec2.CreateImageOutput) + CreateImageRequest(*ec2.CreateImageInput) (*request.Request, *ec2.CreateImageOutput) CreateImage(*ec2.CreateImageInput) (*ec2.CreateImageOutput, error) - CreateInstanceExportTaskRequest(*ec2.CreateInstanceExportTaskInput) (*aws.Request, *ec2.CreateInstanceExportTaskOutput) + CreateInstanceExportTaskRequest(*ec2.CreateInstanceExportTaskInput) (*request.Request, *ec2.CreateInstanceExportTaskOutput) CreateInstanceExportTask(*ec2.CreateInstanceExportTaskInput) (*ec2.CreateInstanceExportTaskOutput, error) - CreateInternetGatewayRequest(*ec2.CreateInternetGatewayInput) (*aws.Request, *ec2.CreateInternetGatewayOutput) + CreateInternetGatewayRequest(*ec2.CreateInternetGatewayInput) (*request.Request, *ec2.CreateInternetGatewayOutput) CreateInternetGateway(*ec2.CreateInternetGatewayInput) (*ec2.CreateInternetGatewayOutput, error) - CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*aws.Request, *ec2.CreateKeyPairOutput) + CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Request, *ec2.CreateKeyPairOutput) CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error) - CreateNetworkACLRequest(*ec2.CreateNetworkACLInput) (*aws.Request, *ec2.CreateNetworkACLOutput) + CreateNetworkAclRequest(*ec2.CreateNetworkAclInput) (*request.Request, *ec2.CreateNetworkAclOutput) - CreateNetworkACL(*ec2.CreateNetworkACLInput) (*ec2.CreateNetworkACLOutput, error) + CreateNetworkAcl(*ec2.CreateNetworkAclInput) (*ec2.CreateNetworkAclOutput, error) - CreateNetworkACLEntryRequest(*ec2.CreateNetworkACLEntryInput) (*aws.Request, *ec2.CreateNetworkACLEntryOutput) + CreateNetworkAclEntryRequest(*ec2.CreateNetworkAclEntryInput) (*request.Request, *ec2.CreateNetworkAclEntryOutput) - CreateNetworkACLEntry(*ec2.CreateNetworkACLEntryInput) (*ec2.CreateNetworkACLEntryOutput, error) + CreateNetworkAclEntry(*ec2.CreateNetworkAclEntryInput) (*ec2.CreateNetworkAclEntryOutput, error) - CreateNetworkInterfaceRequest(*ec2.CreateNetworkInterfaceInput) (*aws.Request, *ec2.CreateNetworkInterfaceOutput) + CreateNetworkInterfaceRequest(*ec2.CreateNetworkInterfaceInput) (*request.Request, *ec2.CreateNetworkInterfaceOutput) CreateNetworkInterface(*ec2.CreateNetworkInterfaceInput) (*ec2.CreateNetworkInterfaceOutput, error) - CreatePlacementGroupRequest(*ec2.CreatePlacementGroupInput) (*aws.Request, *ec2.CreatePlacementGroupOutput) + CreatePlacementGroupRequest(*ec2.CreatePlacementGroupInput) (*request.Request, *ec2.CreatePlacementGroupOutput) CreatePlacementGroup(*ec2.CreatePlacementGroupInput) (*ec2.CreatePlacementGroupOutput, error) - CreateReservedInstancesListingRequest(*ec2.CreateReservedInstancesListingInput) (*aws.Request, *ec2.CreateReservedInstancesListingOutput) + CreateReservedInstancesListingRequest(*ec2.CreateReservedInstancesListingInput) (*request.Request, *ec2.CreateReservedInstancesListingOutput) CreateReservedInstancesListing(*ec2.CreateReservedInstancesListingInput) (*ec2.CreateReservedInstancesListingOutput, error) - CreateRouteRequest(*ec2.CreateRouteInput) (*aws.Request, *ec2.CreateRouteOutput) + CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput) CreateRoute(*ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error) - CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*aws.Request, *ec2.CreateRouteTableOutput) + CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput) CreateRouteTable(*ec2.CreateRouteTableInput) (*ec2.CreateRouteTableOutput, error) - CreateSecurityGroupRequest(*ec2.CreateSecurityGroupInput) (*aws.Request, *ec2.CreateSecurityGroupOutput) + CreateSecurityGroupRequest(*ec2.CreateSecurityGroupInput) (*request.Request, *ec2.CreateSecurityGroupOutput) CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error) - CreateSnapshotRequest(*ec2.CreateSnapshotInput) (*aws.Request, *ec2.Snapshot) + CreateSnapshotRequest(*ec2.CreateSnapshotInput) (*request.Request, *ec2.Snapshot) CreateSnapshot(*ec2.CreateSnapshotInput) (*ec2.Snapshot, error) - CreateSpotDatafeedSubscriptionRequest(*ec2.CreateSpotDatafeedSubscriptionInput) (*aws.Request, *ec2.CreateSpotDatafeedSubscriptionOutput) + CreateSpotDatafeedSubscriptionRequest(*ec2.CreateSpotDatafeedSubscriptionInput) (*request.Request, *ec2.CreateSpotDatafeedSubscriptionOutput) CreateSpotDatafeedSubscription(*ec2.CreateSpotDatafeedSubscriptionInput) (*ec2.CreateSpotDatafeedSubscriptionOutput, error) - CreateSubnetRequest(*ec2.CreateSubnetInput) (*aws.Request, *ec2.CreateSubnetOutput) + CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput) CreateSubnet(*ec2.CreateSubnetInput) (*ec2.CreateSubnetOutput, error) - CreateTagsRequest(*ec2.CreateTagsInput) (*aws.Request, *ec2.CreateTagsOutput) + CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) - CreateVPCRequest(*ec2.CreateVPCInput) (*aws.Request, *ec2.CreateVPCOutput) - - CreateVPC(*ec2.CreateVPCInput) (*ec2.CreateVPCOutput, error) - - CreateVPCEndpointRequest(*ec2.CreateVPCEndpointInput) (*aws.Request, *ec2.CreateVPCEndpointOutput) - - CreateVPCEndpoint(*ec2.CreateVPCEndpointInput) (*ec2.CreateVPCEndpointOutput, error) - - CreateVPCPeeringConnectionRequest(*ec2.CreateVPCPeeringConnectionInput) (*aws.Request, *ec2.CreateVPCPeeringConnectionOutput) - - CreateVPCPeeringConnection(*ec2.CreateVPCPeeringConnectionInput) (*ec2.CreateVPCPeeringConnectionOutput, error) - - CreateVPNConnectionRequest(*ec2.CreateVPNConnectionInput) (*aws.Request, *ec2.CreateVPNConnectionOutput) - - CreateVPNConnection(*ec2.CreateVPNConnectionInput) (*ec2.CreateVPNConnectionOutput, error) - - CreateVPNConnectionRouteRequest(*ec2.CreateVPNConnectionRouteInput) (*aws.Request, *ec2.CreateVPNConnectionRouteOutput) - - CreateVPNConnectionRoute(*ec2.CreateVPNConnectionRouteInput) (*ec2.CreateVPNConnectionRouteOutput, error) - - CreateVPNGatewayRequest(*ec2.CreateVPNGatewayInput) (*aws.Request, *ec2.CreateVPNGatewayOutput) - - CreateVPNGateway(*ec2.CreateVPNGatewayInput) (*ec2.CreateVPNGatewayOutput, error) - - CreateVolumeRequest(*ec2.CreateVolumeInput) (*aws.Request, *ec2.Volume) + CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, error) - DeleteCustomerGatewayRequest(*ec2.DeleteCustomerGatewayInput) (*aws.Request, *ec2.DeleteCustomerGatewayOutput) + CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) + + CreateVpc(*ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error) + + CreateVpcEndpointRequest(*ec2.CreateVpcEndpointInput) (*request.Request, *ec2.CreateVpcEndpointOutput) + + CreateVpcEndpoint(*ec2.CreateVpcEndpointInput) (*ec2.CreateVpcEndpointOutput, error) + + CreateVpcPeeringConnectionRequest(*ec2.CreateVpcPeeringConnectionInput) (*request.Request, *ec2.CreateVpcPeeringConnectionOutput) + + CreateVpcPeeringConnection(*ec2.CreateVpcPeeringConnectionInput) (*ec2.CreateVpcPeeringConnectionOutput, error) + + CreateVpnConnectionRequest(*ec2.CreateVpnConnectionInput) (*request.Request, *ec2.CreateVpnConnectionOutput) + + CreateVpnConnection(*ec2.CreateVpnConnectionInput) (*ec2.CreateVpnConnectionOutput, error) + + CreateVpnConnectionRouteRequest(*ec2.CreateVpnConnectionRouteInput) (*request.Request, *ec2.CreateVpnConnectionRouteOutput) + + CreateVpnConnectionRoute(*ec2.CreateVpnConnectionRouteInput) (*ec2.CreateVpnConnectionRouteOutput, error) + + CreateVpnGatewayRequest(*ec2.CreateVpnGatewayInput) (*request.Request, *ec2.CreateVpnGatewayOutput) + + CreateVpnGateway(*ec2.CreateVpnGatewayInput) (*ec2.CreateVpnGatewayOutput, error) + + DeleteCustomerGatewayRequest(*ec2.DeleteCustomerGatewayInput) (*request.Request, *ec2.DeleteCustomerGatewayOutput) DeleteCustomerGateway(*ec2.DeleteCustomerGatewayInput) (*ec2.DeleteCustomerGatewayOutput, error) - DeleteDHCPOptionsRequest(*ec2.DeleteDHCPOptionsInput) (*aws.Request, *ec2.DeleteDHCPOptionsOutput) + DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput) - DeleteDHCPOptions(*ec2.DeleteDHCPOptionsInput) (*ec2.DeleteDHCPOptionsOutput, error) + DeleteDhcpOptions(*ec2.DeleteDhcpOptionsInput) (*ec2.DeleteDhcpOptionsOutput, error) - DeleteFlowLogsRequest(*ec2.DeleteFlowLogsInput) (*aws.Request, *ec2.DeleteFlowLogsOutput) + DeleteFlowLogsRequest(*ec2.DeleteFlowLogsInput) (*request.Request, *ec2.DeleteFlowLogsOutput) DeleteFlowLogs(*ec2.DeleteFlowLogsInput) (*ec2.DeleteFlowLogsOutput, error) - DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*aws.Request, *ec2.DeleteInternetGatewayOutput) + DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput) DeleteInternetGateway(*ec2.DeleteInternetGatewayInput) (*ec2.DeleteInternetGatewayOutput, error) - DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*aws.Request, *ec2.DeleteKeyPairOutput) + DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput) DeleteKeyPair(*ec2.DeleteKeyPairInput) (*ec2.DeleteKeyPairOutput, error) - DeleteNetworkACLRequest(*ec2.DeleteNetworkACLInput) (*aws.Request, *ec2.DeleteNetworkACLOutput) + DeleteNetworkAclRequest(*ec2.DeleteNetworkAclInput) (*request.Request, *ec2.DeleteNetworkAclOutput) - DeleteNetworkACL(*ec2.DeleteNetworkACLInput) (*ec2.DeleteNetworkACLOutput, error) + DeleteNetworkAcl(*ec2.DeleteNetworkAclInput) (*ec2.DeleteNetworkAclOutput, error) - DeleteNetworkACLEntryRequest(*ec2.DeleteNetworkACLEntryInput) (*aws.Request, *ec2.DeleteNetworkACLEntryOutput) + DeleteNetworkAclEntryRequest(*ec2.DeleteNetworkAclEntryInput) (*request.Request, *ec2.DeleteNetworkAclEntryOutput) - DeleteNetworkACLEntry(*ec2.DeleteNetworkACLEntryInput) (*ec2.DeleteNetworkACLEntryOutput, error) + DeleteNetworkAclEntry(*ec2.DeleteNetworkAclEntryInput) (*ec2.DeleteNetworkAclEntryOutput, error) - DeleteNetworkInterfaceRequest(*ec2.DeleteNetworkInterfaceInput) (*aws.Request, *ec2.DeleteNetworkInterfaceOutput) + DeleteNetworkInterfaceRequest(*ec2.DeleteNetworkInterfaceInput) (*request.Request, *ec2.DeleteNetworkInterfaceOutput) DeleteNetworkInterface(*ec2.DeleteNetworkInterfaceInput) (*ec2.DeleteNetworkInterfaceOutput, error) - DeletePlacementGroupRequest(*ec2.DeletePlacementGroupInput) (*aws.Request, *ec2.DeletePlacementGroupOutput) + DeletePlacementGroupRequest(*ec2.DeletePlacementGroupInput) (*request.Request, *ec2.DeletePlacementGroupOutput) DeletePlacementGroup(*ec2.DeletePlacementGroupInput) (*ec2.DeletePlacementGroupOutput, error) - DeleteRouteRequest(*ec2.DeleteRouteInput) (*aws.Request, *ec2.DeleteRouteOutput) + DeleteRouteRequest(*ec2.DeleteRouteInput) (*request.Request, *ec2.DeleteRouteOutput) DeleteRoute(*ec2.DeleteRouteInput) (*ec2.DeleteRouteOutput, error) - DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*aws.Request, *ec2.DeleteRouteTableOutput) + DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput) DeleteRouteTable(*ec2.DeleteRouteTableInput) (*ec2.DeleteRouteTableOutput, error) - DeleteSecurityGroupRequest(*ec2.DeleteSecurityGroupInput) (*aws.Request, *ec2.DeleteSecurityGroupOutput) + DeleteSecurityGroupRequest(*ec2.DeleteSecurityGroupInput) (*request.Request, *ec2.DeleteSecurityGroupOutput) DeleteSecurityGroup(*ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error) - DeleteSnapshotRequest(*ec2.DeleteSnapshotInput) (*aws.Request, *ec2.DeleteSnapshotOutput) + DeleteSnapshotRequest(*ec2.DeleteSnapshotInput) (*request.Request, *ec2.DeleteSnapshotOutput) DeleteSnapshot(*ec2.DeleteSnapshotInput) (*ec2.DeleteSnapshotOutput, error) - DeleteSpotDatafeedSubscriptionRequest(*ec2.DeleteSpotDatafeedSubscriptionInput) (*aws.Request, *ec2.DeleteSpotDatafeedSubscriptionOutput) + DeleteSpotDatafeedSubscriptionRequest(*ec2.DeleteSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DeleteSpotDatafeedSubscriptionOutput) DeleteSpotDatafeedSubscription(*ec2.DeleteSpotDatafeedSubscriptionInput) (*ec2.DeleteSpotDatafeedSubscriptionOutput, error) - DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*aws.Request, *ec2.DeleteSubnetOutput) + DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*request.Request, *ec2.DeleteSubnetOutput) DeleteSubnet(*ec2.DeleteSubnetInput) (*ec2.DeleteSubnetOutput, error) - DeleteTagsRequest(*ec2.DeleteTagsInput) (*aws.Request, *ec2.DeleteTagsOutput) + DeleteTagsRequest(*ec2.DeleteTagsInput) (*request.Request, *ec2.DeleteTagsOutput) DeleteTags(*ec2.DeleteTagsInput) (*ec2.DeleteTagsOutput, error) - DeleteVPCRequest(*ec2.DeleteVPCInput) (*aws.Request, *ec2.DeleteVPCOutput) - - DeleteVPC(*ec2.DeleteVPCInput) (*ec2.DeleteVPCOutput, error) - - DeleteVPCEndpointsRequest(*ec2.DeleteVPCEndpointsInput) (*aws.Request, *ec2.DeleteVPCEndpointsOutput) - - DeleteVPCEndpoints(*ec2.DeleteVPCEndpointsInput) (*ec2.DeleteVPCEndpointsOutput, error) - - DeleteVPCPeeringConnectionRequest(*ec2.DeleteVPCPeeringConnectionInput) (*aws.Request, *ec2.DeleteVPCPeeringConnectionOutput) - - DeleteVPCPeeringConnection(*ec2.DeleteVPCPeeringConnectionInput) (*ec2.DeleteVPCPeeringConnectionOutput, error) - - DeleteVPNConnectionRequest(*ec2.DeleteVPNConnectionInput) (*aws.Request, *ec2.DeleteVPNConnectionOutput) - - DeleteVPNConnection(*ec2.DeleteVPNConnectionInput) (*ec2.DeleteVPNConnectionOutput, error) - - DeleteVPNConnectionRouteRequest(*ec2.DeleteVPNConnectionRouteInput) (*aws.Request, *ec2.DeleteVPNConnectionRouteOutput) - - DeleteVPNConnectionRoute(*ec2.DeleteVPNConnectionRouteInput) (*ec2.DeleteVPNConnectionRouteOutput, error) - - DeleteVPNGatewayRequest(*ec2.DeleteVPNGatewayInput) (*aws.Request, *ec2.DeleteVPNGatewayOutput) - - DeleteVPNGateway(*ec2.DeleteVPNGatewayInput) (*ec2.DeleteVPNGatewayOutput, error) - - DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*aws.Request, *ec2.DeleteVolumeOutput) + DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput) DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error) - DeregisterImageRequest(*ec2.DeregisterImageInput) (*aws.Request, *ec2.DeregisterImageOutput) + DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput) + + DeleteVpc(*ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput, error) + + DeleteVpcEndpointsRequest(*ec2.DeleteVpcEndpointsInput) (*request.Request, *ec2.DeleteVpcEndpointsOutput) + + DeleteVpcEndpoints(*ec2.DeleteVpcEndpointsInput) (*ec2.DeleteVpcEndpointsOutput, error) + + DeleteVpcPeeringConnectionRequest(*ec2.DeleteVpcPeeringConnectionInput) (*request.Request, *ec2.DeleteVpcPeeringConnectionOutput) + + DeleteVpcPeeringConnection(*ec2.DeleteVpcPeeringConnectionInput) (*ec2.DeleteVpcPeeringConnectionOutput, error) + + DeleteVpnConnectionRequest(*ec2.DeleteVpnConnectionInput) (*request.Request, *ec2.DeleteVpnConnectionOutput) + + DeleteVpnConnection(*ec2.DeleteVpnConnectionInput) (*ec2.DeleteVpnConnectionOutput, error) + + DeleteVpnConnectionRouteRequest(*ec2.DeleteVpnConnectionRouteInput) (*request.Request, *ec2.DeleteVpnConnectionRouteOutput) + + DeleteVpnConnectionRoute(*ec2.DeleteVpnConnectionRouteInput) (*ec2.DeleteVpnConnectionRouteOutput, error) + + DeleteVpnGatewayRequest(*ec2.DeleteVpnGatewayInput) (*request.Request, *ec2.DeleteVpnGatewayOutput) + + DeleteVpnGateway(*ec2.DeleteVpnGatewayInput) (*ec2.DeleteVpnGatewayOutput, error) + + DeregisterImageRequest(*ec2.DeregisterImageInput) (*request.Request, *ec2.DeregisterImageOutput) DeregisterImage(*ec2.DeregisterImageInput) (*ec2.DeregisterImageOutput, error) - DescribeAccountAttributesRequest(*ec2.DescribeAccountAttributesInput) (*aws.Request, *ec2.DescribeAccountAttributesOutput) + DescribeAccountAttributesRequest(*ec2.DescribeAccountAttributesInput) (*request.Request, *ec2.DescribeAccountAttributesOutput) DescribeAccountAttributes(*ec2.DescribeAccountAttributesInput) (*ec2.DescribeAccountAttributesOutput, error) - DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*aws.Request, *ec2.DescribeAddressesOutput) + DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput) DescribeAddresses(*ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error) - DescribeAvailabilityZonesRequest(*ec2.DescribeAvailabilityZonesInput) (*aws.Request, *ec2.DescribeAvailabilityZonesOutput) + DescribeAvailabilityZonesRequest(*ec2.DescribeAvailabilityZonesInput) (*request.Request, *ec2.DescribeAvailabilityZonesOutput) DescribeAvailabilityZones(*ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error) - DescribeBundleTasksRequest(*ec2.DescribeBundleTasksInput) (*aws.Request, *ec2.DescribeBundleTasksOutput) + DescribeBundleTasksRequest(*ec2.DescribeBundleTasksInput) (*request.Request, *ec2.DescribeBundleTasksOutput) DescribeBundleTasks(*ec2.DescribeBundleTasksInput) (*ec2.DescribeBundleTasksOutput, error) - DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*aws.Request, *ec2.DescribeClassicLinkInstancesOutput) + DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput) DescribeClassicLinkInstances(*ec2.DescribeClassicLinkInstancesInput) (*ec2.DescribeClassicLinkInstancesOutput, error) - DescribeConversionTasksRequest(*ec2.DescribeConversionTasksInput) (*aws.Request, *ec2.DescribeConversionTasksOutput) + DescribeConversionTasksRequest(*ec2.DescribeConversionTasksInput) (*request.Request, *ec2.DescribeConversionTasksOutput) DescribeConversionTasks(*ec2.DescribeConversionTasksInput) (*ec2.DescribeConversionTasksOutput, error) - DescribeCustomerGatewaysRequest(*ec2.DescribeCustomerGatewaysInput) (*aws.Request, *ec2.DescribeCustomerGatewaysOutput) + DescribeCustomerGatewaysRequest(*ec2.DescribeCustomerGatewaysInput) (*request.Request, *ec2.DescribeCustomerGatewaysOutput) DescribeCustomerGateways(*ec2.DescribeCustomerGatewaysInput) (*ec2.DescribeCustomerGatewaysOutput, error) - DescribeDHCPOptionsRequest(*ec2.DescribeDHCPOptionsInput) (*aws.Request, *ec2.DescribeDHCPOptionsOutput) + DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput) - DescribeDHCPOptions(*ec2.DescribeDHCPOptionsInput) (*ec2.DescribeDHCPOptionsOutput, error) + DescribeDhcpOptions(*ec2.DescribeDhcpOptionsInput) (*ec2.DescribeDhcpOptionsOutput, error) - DescribeExportTasksRequest(*ec2.DescribeExportTasksInput) (*aws.Request, *ec2.DescribeExportTasksOutput) + DescribeExportTasksRequest(*ec2.DescribeExportTasksInput) (*request.Request, *ec2.DescribeExportTasksOutput) DescribeExportTasks(*ec2.DescribeExportTasksInput) (*ec2.DescribeExportTasksOutput, error) - DescribeFlowLogsRequest(*ec2.DescribeFlowLogsInput) (*aws.Request, *ec2.DescribeFlowLogsOutput) + DescribeFlowLogsRequest(*ec2.DescribeFlowLogsInput) (*request.Request, *ec2.DescribeFlowLogsOutput) DescribeFlowLogs(*ec2.DescribeFlowLogsInput) (*ec2.DescribeFlowLogsOutput, error) - DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*aws.Request, *ec2.DescribeImageAttributeOutput) + DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput) DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error) - DescribeImagesRequest(*ec2.DescribeImagesInput) (*aws.Request, *ec2.DescribeImagesOutput) + DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput) DescribeImages(*ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error) - DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*aws.Request, *ec2.DescribeImportImageTasksOutput) + DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput) DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error) - DescribeImportSnapshotTasksRequest(*ec2.DescribeImportSnapshotTasksInput) (*aws.Request, *ec2.DescribeImportSnapshotTasksOutput) + DescribeImportSnapshotTasksRequest(*ec2.DescribeImportSnapshotTasksInput) (*request.Request, *ec2.DescribeImportSnapshotTasksOutput) DescribeImportSnapshotTasks(*ec2.DescribeImportSnapshotTasksInput) (*ec2.DescribeImportSnapshotTasksOutput, error) - DescribeInstanceAttributeRequest(*ec2.DescribeInstanceAttributeInput) (*aws.Request, *ec2.DescribeInstanceAttributeOutput) + DescribeInstanceAttributeRequest(*ec2.DescribeInstanceAttributeInput) (*request.Request, *ec2.DescribeInstanceAttributeOutput) DescribeInstanceAttribute(*ec2.DescribeInstanceAttributeInput) (*ec2.DescribeInstanceAttributeOutput, error) - DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) (*aws.Request, *ec2.DescribeInstanceStatusOutput) + DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) (*request.Request, *ec2.DescribeInstanceStatusOutput) DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error) DescribeInstanceStatusPages(*ec2.DescribeInstanceStatusInput, func(*ec2.DescribeInstanceStatusOutput, bool) bool) error - DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*aws.Request, *ec2.DescribeInstancesOutput) + DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error) DescribeInstancesPages(*ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool) error - DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*aws.Request, *ec2.DescribeInternetGatewaysOutput) + DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput) DescribeInternetGateways(*ec2.DescribeInternetGatewaysInput) (*ec2.DescribeInternetGatewaysOutput, error) - DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*aws.Request, *ec2.DescribeKeyPairsOutput) + DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput) DescribeKeyPairs(*ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error) - DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*aws.Request, *ec2.DescribeMovingAddressesOutput) + DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput) DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error) - DescribeNetworkACLsRequest(*ec2.DescribeNetworkACLsInput) (*aws.Request, *ec2.DescribeNetworkACLsOutput) + DescribeNetworkAclsRequest(*ec2.DescribeNetworkAclsInput) (*request.Request, *ec2.DescribeNetworkAclsOutput) - DescribeNetworkACLs(*ec2.DescribeNetworkACLsInput) (*ec2.DescribeNetworkACLsOutput, error) + DescribeNetworkAcls(*ec2.DescribeNetworkAclsInput) (*ec2.DescribeNetworkAclsOutput, error) - DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) (*aws.Request, *ec2.DescribeNetworkInterfaceAttributeOutput) + DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) (*request.Request, *ec2.DescribeNetworkInterfaceAttributeOutput) DescribeNetworkInterfaceAttribute(*ec2.DescribeNetworkInterfaceAttributeInput) (*ec2.DescribeNetworkInterfaceAttributeOutput, error) - DescribeNetworkInterfacesRequest(*ec2.DescribeNetworkInterfacesInput) (*aws.Request, *ec2.DescribeNetworkInterfacesOutput) + DescribeNetworkInterfacesRequest(*ec2.DescribeNetworkInterfacesInput) (*request.Request, *ec2.DescribeNetworkInterfacesOutput) DescribeNetworkInterfaces(*ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error) - DescribePlacementGroupsRequest(*ec2.DescribePlacementGroupsInput) (*aws.Request, *ec2.DescribePlacementGroupsOutput) + DescribePlacementGroupsRequest(*ec2.DescribePlacementGroupsInput) (*request.Request, *ec2.DescribePlacementGroupsOutput) DescribePlacementGroups(*ec2.DescribePlacementGroupsInput) (*ec2.DescribePlacementGroupsOutput, error) - DescribePrefixListsRequest(*ec2.DescribePrefixListsInput) (*aws.Request, *ec2.DescribePrefixListsOutput) + DescribePrefixListsRequest(*ec2.DescribePrefixListsInput) (*request.Request, *ec2.DescribePrefixListsOutput) DescribePrefixLists(*ec2.DescribePrefixListsInput) (*ec2.DescribePrefixListsOutput, error) - DescribeRegionsRequest(*ec2.DescribeRegionsInput) (*aws.Request, *ec2.DescribeRegionsOutput) + DescribeRegionsRequest(*ec2.DescribeRegionsInput) (*request.Request, *ec2.DescribeRegionsOutput) DescribeRegions(*ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error) - DescribeReservedInstancesRequest(*ec2.DescribeReservedInstancesInput) (*aws.Request, *ec2.DescribeReservedInstancesOutput) + DescribeReservedInstancesRequest(*ec2.DescribeReservedInstancesInput) (*request.Request, *ec2.DescribeReservedInstancesOutput) DescribeReservedInstances(*ec2.DescribeReservedInstancesInput) (*ec2.DescribeReservedInstancesOutput, error) - DescribeReservedInstancesListingsRequest(*ec2.DescribeReservedInstancesListingsInput) (*aws.Request, *ec2.DescribeReservedInstancesListingsOutput) + DescribeReservedInstancesListingsRequest(*ec2.DescribeReservedInstancesListingsInput) (*request.Request, *ec2.DescribeReservedInstancesListingsOutput) DescribeReservedInstancesListings(*ec2.DescribeReservedInstancesListingsInput) (*ec2.DescribeReservedInstancesListingsOutput, error) - DescribeReservedInstancesModificationsRequest(*ec2.DescribeReservedInstancesModificationsInput) (*aws.Request, *ec2.DescribeReservedInstancesModificationsOutput) + DescribeReservedInstancesModificationsRequest(*ec2.DescribeReservedInstancesModificationsInput) (*request.Request, *ec2.DescribeReservedInstancesModificationsOutput) DescribeReservedInstancesModifications(*ec2.DescribeReservedInstancesModificationsInput) (*ec2.DescribeReservedInstancesModificationsOutput, error) DescribeReservedInstancesModificationsPages(*ec2.DescribeReservedInstancesModificationsInput, func(*ec2.DescribeReservedInstancesModificationsOutput, bool) bool) error - DescribeReservedInstancesOfferingsRequest(*ec2.DescribeReservedInstancesOfferingsInput) (*aws.Request, *ec2.DescribeReservedInstancesOfferingsOutput) + DescribeReservedInstancesOfferingsRequest(*ec2.DescribeReservedInstancesOfferingsInput) (*request.Request, *ec2.DescribeReservedInstancesOfferingsOutput) DescribeReservedInstancesOfferings(*ec2.DescribeReservedInstancesOfferingsInput) (*ec2.DescribeReservedInstancesOfferingsOutput, error) DescribeReservedInstancesOfferingsPages(*ec2.DescribeReservedInstancesOfferingsInput, func(*ec2.DescribeReservedInstancesOfferingsOutput, bool) bool) error - DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) (*aws.Request, *ec2.DescribeRouteTablesOutput) + DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) (*request.Request, *ec2.DescribeRouteTablesOutput) DescribeRouteTables(*ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error) - DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*aws.Request, *ec2.DescribeSecurityGroupsOutput) + DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*request.Request, *ec2.DescribeSecurityGroupsOutput) DescribeSecurityGroups(*ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error) - DescribeSnapshotAttributeRequest(*ec2.DescribeSnapshotAttributeInput) (*aws.Request, *ec2.DescribeSnapshotAttributeOutput) + DescribeSnapshotAttributeRequest(*ec2.DescribeSnapshotAttributeInput) (*request.Request, *ec2.DescribeSnapshotAttributeOutput) DescribeSnapshotAttribute(*ec2.DescribeSnapshotAttributeInput) (*ec2.DescribeSnapshotAttributeOutput, error) - DescribeSnapshotsRequest(*ec2.DescribeSnapshotsInput) (*aws.Request, *ec2.DescribeSnapshotsOutput) + DescribeSnapshotsRequest(*ec2.DescribeSnapshotsInput) (*request.Request, *ec2.DescribeSnapshotsOutput) DescribeSnapshots(*ec2.DescribeSnapshotsInput) (*ec2.DescribeSnapshotsOutput, error) DescribeSnapshotsPages(*ec2.DescribeSnapshotsInput, func(*ec2.DescribeSnapshotsOutput, bool) bool) error - DescribeSpotDatafeedSubscriptionRequest(*ec2.DescribeSpotDatafeedSubscriptionInput) (*aws.Request, *ec2.DescribeSpotDatafeedSubscriptionOutput) + DescribeSpotDatafeedSubscriptionRequest(*ec2.DescribeSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DescribeSpotDatafeedSubscriptionOutput) DescribeSpotDatafeedSubscription(*ec2.DescribeSpotDatafeedSubscriptionInput) (*ec2.DescribeSpotDatafeedSubscriptionOutput, error) - DescribeSpotFleetInstancesRequest(*ec2.DescribeSpotFleetInstancesInput) (*aws.Request, *ec2.DescribeSpotFleetInstancesOutput) + DescribeSpotFleetInstancesRequest(*ec2.DescribeSpotFleetInstancesInput) (*request.Request, *ec2.DescribeSpotFleetInstancesOutput) DescribeSpotFleetInstances(*ec2.DescribeSpotFleetInstancesInput) (*ec2.DescribeSpotFleetInstancesOutput, error) - DescribeSpotFleetRequestHistoryRequest(*ec2.DescribeSpotFleetRequestHistoryInput) (*aws.Request, *ec2.DescribeSpotFleetRequestHistoryOutput) + DescribeSpotFleetRequestHistoryRequest(*ec2.DescribeSpotFleetRequestHistoryInput) (*request.Request, *ec2.DescribeSpotFleetRequestHistoryOutput) DescribeSpotFleetRequestHistory(*ec2.DescribeSpotFleetRequestHistoryInput) (*ec2.DescribeSpotFleetRequestHistoryOutput, error) - DescribeSpotFleetRequestsRequest(*ec2.DescribeSpotFleetRequestsInput) (*aws.Request, *ec2.DescribeSpotFleetRequestsOutput) + DescribeSpotFleetRequestsRequest(*ec2.DescribeSpotFleetRequestsInput) (*request.Request, *ec2.DescribeSpotFleetRequestsOutput) DescribeSpotFleetRequests(*ec2.DescribeSpotFleetRequestsInput) (*ec2.DescribeSpotFleetRequestsOutput, error) - DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) (*aws.Request, *ec2.DescribeSpotInstanceRequestsOutput) + DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) (*request.Request, *ec2.DescribeSpotInstanceRequestsOutput) DescribeSpotInstanceRequests(*ec2.DescribeSpotInstanceRequestsInput) (*ec2.DescribeSpotInstanceRequestsOutput, error) - DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) (*aws.Request, *ec2.DescribeSpotPriceHistoryOutput) + DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) (*request.Request, *ec2.DescribeSpotPriceHistoryOutput) DescribeSpotPriceHistory(*ec2.DescribeSpotPriceHistoryInput) (*ec2.DescribeSpotPriceHistoryOutput, error) DescribeSpotPriceHistoryPages(*ec2.DescribeSpotPriceHistoryInput, func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool) error - DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*aws.Request, *ec2.DescribeSubnetsOutput) + DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) - DescribeTagsRequest(*ec2.DescribeTagsInput) (*aws.Request, *ec2.DescribeTagsOutput) + DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput) DescribeTags(*ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) - DescribeVPCAttributeRequest(*ec2.DescribeVPCAttributeInput) (*aws.Request, *ec2.DescribeVPCAttributeOutput) + DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error - DescribeVPCAttribute(*ec2.DescribeVPCAttributeInput) (*ec2.DescribeVPCAttributeOutput, error) - - DescribeVPCClassicLinkRequest(*ec2.DescribeVPCClassicLinkInput) (*aws.Request, *ec2.DescribeVPCClassicLinkOutput) - - DescribeVPCClassicLink(*ec2.DescribeVPCClassicLinkInput) (*ec2.DescribeVPCClassicLinkOutput, error) - - DescribeVPCEndpointServicesRequest(*ec2.DescribeVPCEndpointServicesInput) (*aws.Request, *ec2.DescribeVPCEndpointServicesOutput) - - DescribeVPCEndpointServices(*ec2.DescribeVPCEndpointServicesInput) (*ec2.DescribeVPCEndpointServicesOutput, error) - - DescribeVPCEndpointsRequest(*ec2.DescribeVPCEndpointsInput) (*aws.Request, *ec2.DescribeVPCEndpointsOutput) - - DescribeVPCEndpoints(*ec2.DescribeVPCEndpointsInput) (*ec2.DescribeVPCEndpointsOutput, error) - - DescribeVPCPeeringConnectionsRequest(*ec2.DescribeVPCPeeringConnectionsInput) (*aws.Request, *ec2.DescribeVPCPeeringConnectionsOutput) - - DescribeVPCPeeringConnections(*ec2.DescribeVPCPeeringConnectionsInput) (*ec2.DescribeVPCPeeringConnectionsOutput, error) - - DescribeVPCsRequest(*ec2.DescribeVPCsInput) (*aws.Request, *ec2.DescribeVPCsOutput) - - DescribeVPCs(*ec2.DescribeVPCsInput) (*ec2.DescribeVPCsOutput, error) - - DescribeVPNConnectionsRequest(*ec2.DescribeVPNConnectionsInput) (*aws.Request, *ec2.DescribeVPNConnectionsOutput) - - DescribeVPNConnections(*ec2.DescribeVPNConnectionsInput) (*ec2.DescribeVPNConnectionsOutput, error) - - DescribeVPNGatewaysRequest(*ec2.DescribeVPNGatewaysInput) (*aws.Request, *ec2.DescribeVPNGatewaysOutput) - - DescribeVPNGateways(*ec2.DescribeVPNGatewaysInput) (*ec2.DescribeVPNGatewaysOutput, error) - - DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*aws.Request, *ec2.DescribeVolumeAttributeOutput) + DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error) - DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*aws.Request, *ec2.DescribeVolumeStatusOutput) + DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput) DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error) DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error - DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*aws.Request, *ec2.DescribeVolumesOutput) + DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput) DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error) DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool) error - DetachClassicLinkVPCRequest(*ec2.DetachClassicLinkVPCInput) (*aws.Request, *ec2.DetachClassicLinkVPCOutput) + DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) - DetachClassicLinkVPC(*ec2.DetachClassicLinkVPCInput) (*ec2.DetachClassicLinkVPCOutput, error) + DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) - DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*aws.Request, *ec2.DetachInternetGatewayOutput) + DescribeVpcClassicLinkRequest(*ec2.DescribeVpcClassicLinkInput) (*request.Request, *ec2.DescribeVpcClassicLinkOutput) + + DescribeVpcClassicLink(*ec2.DescribeVpcClassicLinkInput) (*ec2.DescribeVpcClassicLinkOutput, error) + + DescribeVpcEndpointServicesRequest(*ec2.DescribeVpcEndpointServicesInput) (*request.Request, *ec2.DescribeVpcEndpointServicesOutput) + + DescribeVpcEndpointServices(*ec2.DescribeVpcEndpointServicesInput) (*ec2.DescribeVpcEndpointServicesOutput, error) + + DescribeVpcEndpointsRequest(*ec2.DescribeVpcEndpointsInput) (*request.Request, *ec2.DescribeVpcEndpointsOutput) + + DescribeVpcEndpoints(*ec2.DescribeVpcEndpointsInput) (*ec2.DescribeVpcEndpointsOutput, error) + + DescribeVpcPeeringConnectionsRequest(*ec2.DescribeVpcPeeringConnectionsInput) (*request.Request, *ec2.DescribeVpcPeeringConnectionsOutput) + + DescribeVpcPeeringConnections(*ec2.DescribeVpcPeeringConnectionsInput) (*ec2.DescribeVpcPeeringConnectionsOutput, error) + + DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) + + DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) + + DescribeVpnConnectionsRequest(*ec2.DescribeVpnConnectionsInput) (*request.Request, *ec2.DescribeVpnConnectionsOutput) + + DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error) + + DescribeVpnGatewaysRequest(*ec2.DescribeVpnGatewaysInput) (*request.Request, *ec2.DescribeVpnGatewaysOutput) + + DescribeVpnGateways(*ec2.DescribeVpnGatewaysInput) (*ec2.DescribeVpnGatewaysOutput, error) + + DetachClassicLinkVpcRequest(*ec2.DetachClassicLinkVpcInput) (*request.Request, *ec2.DetachClassicLinkVpcOutput) + + DetachClassicLinkVpc(*ec2.DetachClassicLinkVpcInput) (*ec2.DetachClassicLinkVpcOutput, error) + + DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput) DetachInternetGateway(*ec2.DetachInternetGatewayInput) (*ec2.DetachInternetGatewayOutput, error) - DetachNetworkInterfaceRequest(*ec2.DetachNetworkInterfaceInput) (*aws.Request, *ec2.DetachNetworkInterfaceOutput) + DetachNetworkInterfaceRequest(*ec2.DetachNetworkInterfaceInput) (*request.Request, *ec2.DetachNetworkInterfaceOutput) DetachNetworkInterface(*ec2.DetachNetworkInterfaceInput) (*ec2.DetachNetworkInterfaceOutput, error) - DetachVPNGatewayRequest(*ec2.DetachVPNGatewayInput) (*aws.Request, *ec2.DetachVPNGatewayOutput) - - DetachVPNGateway(*ec2.DetachVPNGatewayInput) (*ec2.DetachVPNGatewayOutput, error) - - DetachVolumeRequest(*ec2.DetachVolumeInput) (*aws.Request, *ec2.VolumeAttachment) + DetachVolumeRequest(*ec2.DetachVolumeInput) (*request.Request, *ec2.VolumeAttachment) DetachVolume(*ec2.DetachVolumeInput) (*ec2.VolumeAttachment, error) - DisableVGWRoutePropagationRequest(*ec2.DisableVGWRoutePropagationInput) (*aws.Request, *ec2.DisableVGWRoutePropagationOutput) + DetachVpnGatewayRequest(*ec2.DetachVpnGatewayInput) (*request.Request, *ec2.DetachVpnGatewayOutput) - DisableVGWRoutePropagation(*ec2.DisableVGWRoutePropagationInput) (*ec2.DisableVGWRoutePropagationOutput, error) + DetachVpnGateway(*ec2.DetachVpnGatewayInput) (*ec2.DetachVpnGatewayOutput, error) - DisableVPCClassicLinkRequest(*ec2.DisableVPCClassicLinkInput) (*aws.Request, *ec2.DisableVPCClassicLinkOutput) + DisableVgwRoutePropagationRequest(*ec2.DisableVgwRoutePropagationInput) (*request.Request, *ec2.DisableVgwRoutePropagationOutput) - DisableVPCClassicLink(*ec2.DisableVPCClassicLinkInput) (*ec2.DisableVPCClassicLinkOutput, error) + DisableVgwRoutePropagation(*ec2.DisableVgwRoutePropagationInput) (*ec2.DisableVgwRoutePropagationOutput, error) - DisassociateAddressRequest(*ec2.DisassociateAddressInput) (*aws.Request, *ec2.DisassociateAddressOutput) + DisableVpcClassicLinkRequest(*ec2.DisableVpcClassicLinkInput) (*request.Request, *ec2.DisableVpcClassicLinkOutput) + + DisableVpcClassicLink(*ec2.DisableVpcClassicLinkInput) (*ec2.DisableVpcClassicLinkOutput, error) + + DisassociateAddressRequest(*ec2.DisassociateAddressInput) (*request.Request, *ec2.DisassociateAddressOutput) DisassociateAddress(*ec2.DisassociateAddressInput) (*ec2.DisassociateAddressOutput, error) - DisassociateRouteTableRequest(*ec2.DisassociateRouteTableInput) (*aws.Request, *ec2.DisassociateRouteTableOutput) + DisassociateRouteTableRequest(*ec2.DisassociateRouteTableInput) (*request.Request, *ec2.DisassociateRouteTableOutput) DisassociateRouteTable(*ec2.DisassociateRouteTableInput) (*ec2.DisassociateRouteTableOutput, error) - EnableVGWRoutePropagationRequest(*ec2.EnableVGWRoutePropagationInput) (*aws.Request, *ec2.EnableVGWRoutePropagationOutput) + EnableVgwRoutePropagationRequest(*ec2.EnableVgwRoutePropagationInput) (*request.Request, *ec2.EnableVgwRoutePropagationOutput) - EnableVGWRoutePropagation(*ec2.EnableVGWRoutePropagationInput) (*ec2.EnableVGWRoutePropagationOutput, error) + EnableVgwRoutePropagation(*ec2.EnableVgwRoutePropagationInput) (*ec2.EnableVgwRoutePropagationOutput, error) - EnableVPCClassicLinkRequest(*ec2.EnableVPCClassicLinkInput) (*aws.Request, *ec2.EnableVPCClassicLinkOutput) - - EnableVPCClassicLink(*ec2.EnableVPCClassicLinkInput) (*ec2.EnableVPCClassicLinkOutput, error) - - EnableVolumeIORequest(*ec2.EnableVolumeIOInput) (*aws.Request, *ec2.EnableVolumeIOOutput) + EnableVolumeIORequest(*ec2.EnableVolumeIOInput) (*request.Request, *ec2.EnableVolumeIOOutput) EnableVolumeIO(*ec2.EnableVolumeIOInput) (*ec2.EnableVolumeIOOutput, error) - GetConsoleOutputRequest(*ec2.GetConsoleOutputInput) (*aws.Request, *ec2.GetConsoleOutputOutput) + EnableVpcClassicLinkRequest(*ec2.EnableVpcClassicLinkInput) (*request.Request, *ec2.EnableVpcClassicLinkOutput) + + EnableVpcClassicLink(*ec2.EnableVpcClassicLinkInput) (*ec2.EnableVpcClassicLinkOutput, error) + + GetConsoleOutputRequest(*ec2.GetConsoleOutputInput) (*request.Request, *ec2.GetConsoleOutputOutput) GetConsoleOutput(*ec2.GetConsoleOutputInput) (*ec2.GetConsoleOutputOutput, error) - GetPasswordDataRequest(*ec2.GetPasswordDataInput) (*aws.Request, *ec2.GetPasswordDataOutput) + GetPasswordDataRequest(*ec2.GetPasswordDataInput) (*request.Request, *ec2.GetPasswordDataOutput) GetPasswordData(*ec2.GetPasswordDataInput) (*ec2.GetPasswordDataOutput, error) - ImportImageRequest(*ec2.ImportImageInput) (*aws.Request, *ec2.ImportImageOutput) + ImportImageRequest(*ec2.ImportImageInput) (*request.Request, *ec2.ImportImageOutput) ImportImage(*ec2.ImportImageInput) (*ec2.ImportImageOutput, error) - ImportInstanceRequest(*ec2.ImportInstanceInput) (*aws.Request, *ec2.ImportInstanceOutput) + ImportInstanceRequest(*ec2.ImportInstanceInput) (*request.Request, *ec2.ImportInstanceOutput) ImportInstance(*ec2.ImportInstanceInput) (*ec2.ImportInstanceOutput, error) - ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*aws.Request, *ec2.ImportKeyPairOutput) + ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput) ImportKeyPair(*ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error) - ImportSnapshotRequest(*ec2.ImportSnapshotInput) (*aws.Request, *ec2.ImportSnapshotOutput) + ImportSnapshotRequest(*ec2.ImportSnapshotInput) (*request.Request, *ec2.ImportSnapshotOutput) ImportSnapshot(*ec2.ImportSnapshotInput) (*ec2.ImportSnapshotOutput, error) - ImportVolumeRequest(*ec2.ImportVolumeInput) (*aws.Request, *ec2.ImportVolumeOutput) + ImportVolumeRequest(*ec2.ImportVolumeInput) (*request.Request, *ec2.ImportVolumeOutput) ImportVolume(*ec2.ImportVolumeInput) (*ec2.ImportVolumeOutput, error) - ModifyImageAttributeRequest(*ec2.ModifyImageAttributeInput) (*aws.Request, *ec2.ModifyImageAttributeOutput) + ModifyImageAttributeRequest(*ec2.ModifyImageAttributeInput) (*request.Request, *ec2.ModifyImageAttributeOutput) ModifyImageAttribute(*ec2.ModifyImageAttributeInput) (*ec2.ModifyImageAttributeOutput, error) - ModifyInstanceAttributeRequest(*ec2.ModifyInstanceAttributeInput) (*aws.Request, *ec2.ModifyInstanceAttributeOutput) + ModifyInstanceAttributeRequest(*ec2.ModifyInstanceAttributeInput) (*request.Request, *ec2.ModifyInstanceAttributeOutput) ModifyInstanceAttribute(*ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error) - ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*aws.Request, *ec2.ModifyNetworkInterfaceAttributeOutput) + ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*request.Request, *ec2.ModifyNetworkInterfaceAttributeOutput) ModifyNetworkInterfaceAttribute(*ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error) - ModifyReservedInstancesRequest(*ec2.ModifyReservedInstancesInput) (*aws.Request, *ec2.ModifyReservedInstancesOutput) + ModifyReservedInstancesRequest(*ec2.ModifyReservedInstancesInput) (*request.Request, *ec2.ModifyReservedInstancesOutput) ModifyReservedInstances(*ec2.ModifyReservedInstancesInput) (*ec2.ModifyReservedInstancesOutput, error) - ModifySnapshotAttributeRequest(*ec2.ModifySnapshotAttributeInput) (*aws.Request, *ec2.ModifySnapshotAttributeOutput) + ModifySnapshotAttributeRequest(*ec2.ModifySnapshotAttributeInput) (*request.Request, *ec2.ModifySnapshotAttributeOutput) ModifySnapshotAttribute(*ec2.ModifySnapshotAttributeInput) (*ec2.ModifySnapshotAttributeOutput, error) - ModifySubnetAttributeRequest(*ec2.ModifySubnetAttributeInput) (*aws.Request, *ec2.ModifySubnetAttributeOutput) + ModifySpotFleetRequestRequest(*ec2.ModifySpotFleetRequestInput) (*request.Request, *ec2.ModifySpotFleetRequestOutput) + + ModifySpotFleetRequest(*ec2.ModifySpotFleetRequestInput) (*ec2.ModifySpotFleetRequestOutput, error) + + ModifySubnetAttributeRequest(*ec2.ModifySubnetAttributeInput) (*request.Request, *ec2.ModifySubnetAttributeOutput) ModifySubnetAttribute(*ec2.ModifySubnetAttributeInput) (*ec2.ModifySubnetAttributeOutput, error) - ModifyVPCAttributeRequest(*ec2.ModifyVPCAttributeInput) (*aws.Request, *ec2.ModifyVPCAttributeOutput) - - ModifyVPCAttribute(*ec2.ModifyVPCAttributeInput) (*ec2.ModifyVPCAttributeOutput, error) - - ModifyVPCEndpointRequest(*ec2.ModifyVPCEndpointInput) (*aws.Request, *ec2.ModifyVPCEndpointOutput) - - ModifyVPCEndpoint(*ec2.ModifyVPCEndpointInput) (*ec2.ModifyVPCEndpointOutput, error) - - ModifyVolumeAttributeRequest(*ec2.ModifyVolumeAttributeInput) (*aws.Request, *ec2.ModifyVolumeAttributeOutput) + ModifyVolumeAttributeRequest(*ec2.ModifyVolumeAttributeInput) (*request.Request, *ec2.ModifyVolumeAttributeOutput) ModifyVolumeAttribute(*ec2.ModifyVolumeAttributeInput) (*ec2.ModifyVolumeAttributeOutput, error) - MonitorInstancesRequest(*ec2.MonitorInstancesInput) (*aws.Request, *ec2.MonitorInstancesOutput) + ModifyVpcAttributeRequest(*ec2.ModifyVpcAttributeInput) (*request.Request, *ec2.ModifyVpcAttributeOutput) + + ModifyVpcAttribute(*ec2.ModifyVpcAttributeInput) (*ec2.ModifyVpcAttributeOutput, error) + + ModifyVpcEndpointRequest(*ec2.ModifyVpcEndpointInput) (*request.Request, *ec2.ModifyVpcEndpointOutput) + + ModifyVpcEndpoint(*ec2.ModifyVpcEndpointInput) (*ec2.ModifyVpcEndpointOutput, error) + + MonitorInstancesRequest(*ec2.MonitorInstancesInput) (*request.Request, *ec2.MonitorInstancesOutput) MonitorInstances(*ec2.MonitorInstancesInput) (*ec2.MonitorInstancesOutput, error) - MoveAddressToVPCRequest(*ec2.MoveAddressToVPCInput) (*aws.Request, *ec2.MoveAddressToVPCOutput) + MoveAddressToVpcRequest(*ec2.MoveAddressToVpcInput) (*request.Request, *ec2.MoveAddressToVpcOutput) - MoveAddressToVPC(*ec2.MoveAddressToVPCInput) (*ec2.MoveAddressToVPCOutput, error) + MoveAddressToVpc(*ec2.MoveAddressToVpcInput) (*ec2.MoveAddressToVpcOutput, error) - PurchaseReservedInstancesOfferingRequest(*ec2.PurchaseReservedInstancesOfferingInput) (*aws.Request, *ec2.PurchaseReservedInstancesOfferingOutput) + PurchaseReservedInstancesOfferingRequest(*ec2.PurchaseReservedInstancesOfferingInput) (*request.Request, *ec2.PurchaseReservedInstancesOfferingOutput) PurchaseReservedInstancesOffering(*ec2.PurchaseReservedInstancesOfferingInput) (*ec2.PurchaseReservedInstancesOfferingOutput, error) - RebootInstancesRequest(*ec2.RebootInstancesInput) (*aws.Request, *ec2.RebootInstancesOutput) + RebootInstancesRequest(*ec2.RebootInstancesInput) (*request.Request, *ec2.RebootInstancesOutput) RebootInstances(*ec2.RebootInstancesInput) (*ec2.RebootInstancesOutput, error) - RegisterImageRequest(*ec2.RegisterImageInput) (*aws.Request, *ec2.RegisterImageOutput) + RegisterImageRequest(*ec2.RegisterImageInput) (*request.Request, *ec2.RegisterImageOutput) RegisterImage(*ec2.RegisterImageInput) (*ec2.RegisterImageOutput, error) - RejectVPCPeeringConnectionRequest(*ec2.RejectVPCPeeringConnectionInput) (*aws.Request, *ec2.RejectVPCPeeringConnectionOutput) + RejectVpcPeeringConnectionRequest(*ec2.RejectVpcPeeringConnectionInput) (*request.Request, *ec2.RejectVpcPeeringConnectionOutput) - RejectVPCPeeringConnection(*ec2.RejectVPCPeeringConnectionInput) (*ec2.RejectVPCPeeringConnectionOutput, error) + RejectVpcPeeringConnection(*ec2.RejectVpcPeeringConnectionInput) (*ec2.RejectVpcPeeringConnectionOutput, error) - ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*aws.Request, *ec2.ReleaseAddressOutput) + ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) - ReplaceNetworkACLAssociationRequest(*ec2.ReplaceNetworkACLAssociationInput) (*aws.Request, *ec2.ReplaceNetworkACLAssociationOutput) + ReplaceNetworkAclAssociationRequest(*ec2.ReplaceNetworkAclAssociationInput) (*request.Request, *ec2.ReplaceNetworkAclAssociationOutput) - ReplaceNetworkACLAssociation(*ec2.ReplaceNetworkACLAssociationInput) (*ec2.ReplaceNetworkACLAssociationOutput, error) + ReplaceNetworkAclAssociation(*ec2.ReplaceNetworkAclAssociationInput) (*ec2.ReplaceNetworkAclAssociationOutput, error) - ReplaceNetworkACLEntryRequest(*ec2.ReplaceNetworkACLEntryInput) (*aws.Request, *ec2.ReplaceNetworkACLEntryOutput) + ReplaceNetworkAclEntryRequest(*ec2.ReplaceNetworkAclEntryInput) (*request.Request, *ec2.ReplaceNetworkAclEntryOutput) - ReplaceNetworkACLEntry(*ec2.ReplaceNetworkACLEntryInput) (*ec2.ReplaceNetworkACLEntryOutput, error) + ReplaceNetworkAclEntry(*ec2.ReplaceNetworkAclEntryInput) (*ec2.ReplaceNetworkAclEntryOutput, error) - ReplaceRouteRequest(*ec2.ReplaceRouteInput) (*aws.Request, *ec2.ReplaceRouteOutput) + ReplaceRouteRequest(*ec2.ReplaceRouteInput) (*request.Request, *ec2.ReplaceRouteOutput) ReplaceRoute(*ec2.ReplaceRouteInput) (*ec2.ReplaceRouteOutput, error) - ReplaceRouteTableAssociationRequest(*ec2.ReplaceRouteTableAssociationInput) (*aws.Request, *ec2.ReplaceRouteTableAssociationOutput) + ReplaceRouteTableAssociationRequest(*ec2.ReplaceRouteTableAssociationInput) (*request.Request, *ec2.ReplaceRouteTableAssociationOutput) ReplaceRouteTableAssociation(*ec2.ReplaceRouteTableAssociationInput) (*ec2.ReplaceRouteTableAssociationOutput, error) - ReportInstanceStatusRequest(*ec2.ReportInstanceStatusInput) (*aws.Request, *ec2.ReportInstanceStatusOutput) + ReportInstanceStatusRequest(*ec2.ReportInstanceStatusInput) (*request.Request, *ec2.ReportInstanceStatusOutput) ReportInstanceStatus(*ec2.ReportInstanceStatusInput) (*ec2.ReportInstanceStatusOutput, error) - RequestSpotFleetRequest(*ec2.RequestSpotFleetInput) (*aws.Request, *ec2.RequestSpotFleetOutput) + RequestSpotFleetRequest(*ec2.RequestSpotFleetInput) (*request.Request, *ec2.RequestSpotFleetOutput) RequestSpotFleet(*ec2.RequestSpotFleetInput) (*ec2.RequestSpotFleetOutput, error) - RequestSpotInstancesRequest(*ec2.RequestSpotInstancesInput) (*aws.Request, *ec2.RequestSpotInstancesOutput) + RequestSpotInstancesRequest(*ec2.RequestSpotInstancesInput) (*request.Request, *ec2.RequestSpotInstancesOutput) RequestSpotInstances(*ec2.RequestSpotInstancesInput) (*ec2.RequestSpotInstancesOutput, error) - ResetImageAttributeRequest(*ec2.ResetImageAttributeInput) (*aws.Request, *ec2.ResetImageAttributeOutput) + ResetImageAttributeRequest(*ec2.ResetImageAttributeInput) (*request.Request, *ec2.ResetImageAttributeOutput) ResetImageAttribute(*ec2.ResetImageAttributeInput) (*ec2.ResetImageAttributeOutput, error) - ResetInstanceAttributeRequest(*ec2.ResetInstanceAttributeInput) (*aws.Request, *ec2.ResetInstanceAttributeOutput) + ResetInstanceAttributeRequest(*ec2.ResetInstanceAttributeInput) (*request.Request, *ec2.ResetInstanceAttributeOutput) ResetInstanceAttribute(*ec2.ResetInstanceAttributeInput) (*ec2.ResetInstanceAttributeOutput, error) - ResetNetworkInterfaceAttributeRequest(*ec2.ResetNetworkInterfaceAttributeInput) (*aws.Request, *ec2.ResetNetworkInterfaceAttributeOutput) + ResetNetworkInterfaceAttributeRequest(*ec2.ResetNetworkInterfaceAttributeInput) (*request.Request, *ec2.ResetNetworkInterfaceAttributeOutput) ResetNetworkInterfaceAttribute(*ec2.ResetNetworkInterfaceAttributeInput) (*ec2.ResetNetworkInterfaceAttributeOutput, error) - ResetSnapshotAttributeRequest(*ec2.ResetSnapshotAttributeInput) (*aws.Request, *ec2.ResetSnapshotAttributeOutput) + ResetSnapshotAttributeRequest(*ec2.ResetSnapshotAttributeInput) (*request.Request, *ec2.ResetSnapshotAttributeOutput) ResetSnapshotAttribute(*ec2.ResetSnapshotAttributeInput) (*ec2.ResetSnapshotAttributeOutput, error) - RestoreAddressToClassicRequest(*ec2.RestoreAddressToClassicInput) (*aws.Request, *ec2.RestoreAddressToClassicOutput) + RestoreAddressToClassicRequest(*ec2.RestoreAddressToClassicInput) (*request.Request, *ec2.RestoreAddressToClassicOutput) RestoreAddressToClassic(*ec2.RestoreAddressToClassicInput) (*ec2.RestoreAddressToClassicOutput, error) - RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*aws.Request, *ec2.RevokeSecurityGroupEgressOutput) + RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*request.Request, *ec2.RevokeSecurityGroupEgressOutput) RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error) - RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*aws.Request, *ec2.RevokeSecurityGroupIngressOutput) + RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*request.Request, *ec2.RevokeSecurityGroupIngressOutput) RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error) - RunInstancesRequest(*ec2.RunInstancesInput) (*aws.Request, *ec2.Reservation) + RunInstancesRequest(*ec2.RunInstancesInput) (*request.Request, *ec2.Reservation) RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error) - StartInstancesRequest(*ec2.StartInstancesInput) (*aws.Request, *ec2.StartInstancesOutput) + StartInstancesRequest(*ec2.StartInstancesInput) (*request.Request, *ec2.StartInstancesOutput) StartInstances(*ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error) - StopInstancesRequest(*ec2.StopInstancesInput) (*aws.Request, *ec2.StopInstancesOutput) + StopInstancesRequest(*ec2.StopInstancesInput) (*request.Request, *ec2.StopInstancesOutput) StopInstances(*ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error) - TerminateInstancesRequest(*ec2.TerminateInstancesInput) (*aws.Request, *ec2.TerminateInstancesOutput) + TerminateInstancesRequest(*ec2.TerminateInstancesInput) (*request.Request, *ec2.TerminateInstancesOutput) TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error) - UnassignPrivateIPAddressesRequest(*ec2.UnassignPrivateIPAddressesInput) (*aws.Request, *ec2.UnassignPrivateIPAddressesOutput) + UnassignPrivateIpAddressesRequest(*ec2.UnassignPrivateIpAddressesInput) (*request.Request, *ec2.UnassignPrivateIpAddressesOutput) - UnassignPrivateIPAddresses(*ec2.UnassignPrivateIPAddressesInput) (*ec2.UnassignPrivateIPAddressesOutput, error) + UnassignPrivateIpAddresses(*ec2.UnassignPrivateIpAddressesInput) (*ec2.UnassignPrivateIpAddressesOutput, error) - UnmonitorInstancesRequest(*ec2.UnmonitorInstancesInput) (*aws.Request, *ec2.UnmonitorInstancesOutput) + UnmonitorInstancesRequest(*ec2.UnmonitorInstancesInput) (*request.Request, *ec2.UnmonitorInstancesOutput) UnmonitorInstances(*ec2.UnmonitorInstancesInput) (*ec2.UnmonitorInstancesOutput, error) } + +var _ EC2API = (*ec2.EC2)(nil) 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 deleted file mode 100644 index 3941d260db0..00000000000 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface_test.go +++ /dev/null @@ -1,15 +0,0 @@ -// 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 index 01840e53938..86557fc15d0 100644 --- 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 @@ -8,44 +8,35 @@ import ( "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/aws/session" "github.com/aws/aws-sdk-go/service/ec2" ) var _ time.Duration var _ bytes.Buffer -func ExampleEC2_AcceptVPCPeeringConnection() { - svc := ec2.New(nil) +func ExampleEC2_AcceptVpcPeeringConnection() { + svc := ec2.New(session.New()) - params := &ec2.AcceptVPCPeeringConnectionInput{ + params := &ec2.AcceptVpcPeeringConnectionInput{ DryRun: aws.Bool(true), - VPCPeeringConnectionID: aws.String("String"), + VpcPeeringConnectionId: aws.String("String"), } - resp, err := svc.AcceptVPCPeeringConnection(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AllocateAddress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AllocateAddressInput{ Domain: aws.String("DomainType"), @@ -54,432 +45,336 @@ func ExampleEC2_AllocateAddress() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_AssignPrivateIPAddresses() { - svc := ec2.New(nil) +func ExampleEC2_AssignPrivateIpAddresses() { + svc := ec2.New(session.New()) - params := &ec2.AssignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required + params := &ec2.AssignPrivateIpAddressesInput{ + NetworkInterfaceId: aws.String("String"), // Required AllowReassignment: aws.Bool(true), - PrivateIPAddresses: []*string{ + PrivateIpAddresses: []*string{ aws.String("String"), // Required // More values... }, - SecondaryPrivateIPAddressCount: aws.Int64(1), + SecondaryPrivateIpAddressCount: aws.Int64(1), } - resp, err := svc.AssignPrivateIPAddresses(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AssociateAddress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AssociateAddressInput{ - AllocationID: aws.String("String"), + AllocationId: aws.String("String"), AllowReassociation: aws.Bool(true), DryRun: aws.Bool(true), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PublicIP: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_AssociateDHCPOptions() { - svc := ec2.New(nil) +func ExampleEC2_AssociateDhcpOptions() { + svc := ec2.New(session.New()) - params := &ec2.AssociateDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + params := &ec2.AssociateDhcpOptionsInput{ + DhcpOptionsId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.AssociateDHCPOptions(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AssociateRouteTable() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AssociateRouteTableInput{ - RouteTableID: aws.String("String"), // Required - SubnetID: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + SubnetId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_AttachClassicLinkVPC() { - svc := ec2.New(nil) +func ExampleEC2_AttachClassicLinkVpc() { + svc := ec2.New(session.New()) - params := &ec2.AttachClassicLinkVPCInput{ + params := &ec2.AttachClassicLinkVpcInput{ Groups: []*string{ // Required aws.String("String"), // Required // More values... }, - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.AttachClassicLinkVPC(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AttachInternetGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AttachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + InternetGatewayId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AttachNetworkInterface() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AttachNetworkInterfaceInput{ DeviceIndex: aws.Int64(1), // Required - InstanceID: aws.String("String"), // Required - NetworkInterfaceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_AttachVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.AttachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AttachVolume() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AttachVolumeInput{ Device: aws.String("String"), // Required - InstanceID: aws.String("String"), // Required - VolumeID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_AttachVpnGateway() { + svc := ec2.New(session.New()) + + params := &ec2.AttachVpnGatewayInput{ + VpcId: aws.String("String"), // Required + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.AttachVpnGateway(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_AuthorizeSecurityGroupEgress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), + GroupId: aws.String("String"), // Required + CidrIp: aws.String("String"), DryRun: aws.Bool(true), FromPort: aws.Int64(1), - IPPermissions: []*ec2.IPPermission{ + IpPermissions: []*ec2.IpPermission{ { // Required FromPort: aws.Int64(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ { // Required - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ + PrefixListIds: []*ec2.PrefixListId{ { // Required - PrefixListID: aws.String("String"), + PrefixListId: aws.String("String"), }, // More values... }, ToPort: aws.Int64(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ { // Required - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), + SourceSecurityGroupOwnerId: aws.String("String"), ToPort: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_AuthorizeSecurityGroupIngress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.AuthorizeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), DryRun: aws.Bool(true), FromPort: aws.Int64(1), - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ + IpPermissions: []*ec2.IpPermission{ { // Required FromPort: aws.Int64(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ { // Required - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ + PrefixListIds: []*ec2.PrefixListId{ { // Required - PrefixListID: aws.String("String"), + PrefixListId: aws.String("String"), }, // More values... }, ToPort: aws.Int64(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ { // Required - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), + SourceSecurityGroupOwnerId: aws.String("String"), ToPort: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_BundleInstance() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.BundleInstanceInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Storage: &ec2.Storage{ // Required S3: &ec2.S3Storage{ - AWSAccessKeyID: aws.String("String"), + AWSAccessKeyId: aws.String("String"), Bucket: aws.String("String"), Prefix: aws.String("String"), UploadPolicy: []byte("PAYLOAD"), @@ -491,169 +386,121 @@ func ExampleEC2_BundleInstance() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelBundleTask() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelBundleTaskInput{ - BundleID: aws.String("String"), // Required + BundleId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelConversionTask() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelConversionTaskInput{ - ConversionTaskID: aws.String("String"), // Required + ConversionTaskId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelExportTask() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelExportTaskInput{ - ExportTaskID: aws.String("String"), // Required + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelImportTask() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelImportTaskInput{ CancelReason: aws.String("String"), DryRun: aws.Bool(true), - ImportTaskID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelReservedInstancesListing() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelReservedInstancesListingInput{ - ReservedInstancesListingID: aws.String("String"), // Required + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelSpotFleetRequests() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelSpotFleetRequestsInput{ - SpotFleetRequestIDs: []*string{ // Required + SpotFleetRequestIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -663,29 +510,21 @@ func ExampleEC2_CancelSpotFleetRequests() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CancelSpotInstanceRequests() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CancelSpotInstanceRequestsInput{ - SpotInstanceRequestIDs: []*string{ // Required + SpotInstanceRequestIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -694,59 +533,43 @@ func ExampleEC2_CancelSpotInstanceRequests() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ConfirmProductInstance() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ConfirmProductInstanceInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required ProductCode: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CopyImage() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CopyImageInput{ Name: aws.String("String"), // Required - SourceImageID: aws.String("String"), // Required + SourceImageId: aws.String("String"), // Required SourceRegion: aws.String("String"), // Required ClientToken: aws.String("String"), Description: aws.String("String"), @@ -755,93 +578,69 @@ func ExampleEC2_CopyImage() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CopySnapshot() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CopySnapshotInput{ SourceRegion: aws.String("String"), // Required - SourceSnapshotID: aws.String("String"), // Required + SourceSnapshotId: aws.String("String"), // Required Description: aws.String("String"), DestinationRegion: aws.String("String"), DryRun: aws.Bool(true), Encrypted: aws.Bool(true), - KMSKeyID: aws.String("String"), - PresignedURL: aws.String("String"), + KmsKeyId: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateCustomerGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateCustomerGatewayInput{ - BGPASN: aws.Int64(1), // Required - PublicIP: aws.String("String"), // Required + BgpAsn: aws.Int64(1), // Required + PublicIp: aws.String("String"), // Required Type: aws.String("GatewayType"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateDHCPOptions() { - svc := ec2.New(nil) +func ExampleEC2_CreateDhcpOptions() { + svc := ec2.New(session.New()) - params := &ec2.CreateDHCPOptionsInput{ - DHCPConfigurations: []*ec2.NewDHCPConfiguration{ // Required + params := &ec2.CreateDhcpOptionsInput{ + DhcpConfigurations: []*ec2.NewDhcpConfiguration{ // Required { // Required Key: aws.String("String"), Values: []*string{ @@ -853,34 +652,26 @@ func ExampleEC2_CreateDHCPOptions() { }, DryRun: aws.Bool(true), } - resp, err := svc.CreateDHCPOptions(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateFlowLogs() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateFlowLogsInput{ - DeliverLogsPermissionARN: aws.String("String"), // Required + DeliverLogsPermissionArn: aws.String("String"), // Required LogGroupName: aws.String("String"), // Required - ResourceIDs: []*string{ // Required + ResourceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -891,38 +682,30 @@ func ExampleEC2_CreateFlowLogs() { resp, err := svc.CreateFlowLogs(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateImage() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateImageInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Name: aws.String("String"), // Required BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ + Ebs: &ec2.EbsBlockDevice{ DeleteOnTermination: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - SnapshotID: aws.String("String"), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, @@ -938,29 +721,21 @@ func ExampleEC2_CreateImage() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateInstanceExportTask() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateInstanceExportTaskInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Description: aws.String("String"), ExportToS3Task: &ec2.ExportToS3TaskSpecification{ ContainerFormat: aws.String("ContainerFormat"), @@ -973,26 +748,18 @@ func ExampleEC2_CreateInstanceExportTask() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateInternetGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateInternetGatewayInput{ DryRun: aws.Bool(true), @@ -1000,26 +767,18 @@ func ExampleEC2_CreateInternetGateway() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateKeyPair() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateKeyPairInput{ KeyName: aws.String("String"), // Required @@ -1028,64 +787,48 @@ func ExampleEC2_CreateKeyPair() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateNetworkACL() { - svc := ec2.New(nil) +func ExampleEC2_CreateNetworkAcl() { + svc := ec2.New(session.New()) - params := &ec2.CreateNetworkACLInput{ - VPCID: aws.String("String"), // Required + params := &ec2.CreateNetworkAclInput{ + VpcId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.CreateNetworkACL(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_CreateNetworkACLEntry() { - svc := ec2.New(nil) +func ExampleEC2_CreateNetworkAclEntry() { + svc := ec2.New(session.New()) - params := &ec2.CreateNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required + params := &ec2.CreateNetworkAclEntryInput{ + CidrBlock: aws.String("String"), // Required Egress: aws.Bool(true), // Required - NetworkACLID: aws.String("String"), // Required + NetworkAclId: aws.String("String"), // Required Protocol: aws.String("String"), // Required RuleAction: aws.String("RuleAction"), // Required RuleNumber: aws.Int64(1), // Required DryRun: aws.Bool(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ + IcmpTypeCode: &ec2.IcmpTypeCode{ Code: aws.Int64(1), Type: aws.Int64(1), }, @@ -1094,71 +837,55 @@ func ExampleEC2_CreateNetworkACLEntry() { To: aws.Int64(1), }, } - resp, err := svc.CreateNetworkACLEntry(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateNetworkInterface() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateNetworkInterfaceInput{ - SubnetID: aws.String("String"), // Required + SubnetId: aws.String("String"), // Required Description: aws.String("String"), DryRun: aws.Bool(true), Groups: []*string{ aws.String("String"), // Required // More values... }, - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ { // Required - PrivateIPAddress: aws.String("String"), // Required + PrivateIpAddress: aws.String("String"), // Required Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Int64(1), + SecondaryPrivateIpAddressCount: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreatePlacementGroup() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreatePlacementGroupInput{ GroupName: aws.String("String"), // Required @@ -1168,26 +895,18 @@ func ExampleEC2_CreatePlacementGroup() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateReservedInstancesListing() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateReservedInstancesListingInput{ ClientToken: aws.String("String"), // Required @@ -1200,151 +919,111 @@ func ExampleEC2_CreateReservedInstancesListing() { }, // More values... }, - ReservedInstancesID: aws.String("String"), // Required + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateRoute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required DryRun: aws.Bool(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateRouteTable() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateRouteTableInput{ - VPCID: aws.String("String"), // Required + VpcId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSecurityGroup() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateSecurityGroupInput{ Description: aws.String("String"), // Required GroupName: aws.String("String"), // Required DryRun: aws.Bool(true), - VPCID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSnapshot() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateSnapshotInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required Description: aws.String("String"), DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSpotDatafeedSubscription() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateSpotDatafeedSubscriptionInput{ Bucket: aws.String("String"), // Required @@ -1354,56 +1033,40 @@ func ExampleEC2_CreateSpotDatafeedSubscription() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateSubnet() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateSubnetInput{ - CIDRBlock: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + CidrBlock: aws.String("String"), // Required + VpcId: aws.String("String"), // Required AvailabilityZone: aws.String("String"), DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateTags() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateTagsInput{ Resources: []*string{ // Required @@ -1422,303 +1085,223 @@ func ExampleEC2_CreateTags() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_CreateVPC() { - svc := ec2.New(nil) - - params := &ec2.CreateVPCInput{ - CIDRBlock: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(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.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_CreateVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.CreateVPCPeeringConnectionInput{ - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(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.Bool(true), - Options: &ec2.VPNConnectionOptionsSpecification{ - StaticRoutesOnly: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_CreateVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.CreateVPNGatewayInput{ - Type: aws.String("GatewayType"), // Required - AvailabilityZone: aws.String("String"), - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_CreateVolume() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.CreateVolumeInput{ AvailabilityZone: aws.String("String"), // Required DryRun: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - KMSKeyID: aws.String("String"), + Iops: aws.Int64(1), + KmsKeyId: aws.String("String"), Size: aws.Int64(1), - SnapshotID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_CreateVpc() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpcInput{ + CidrBlock: aws.String("String"), // Required + DryRun: aws.Bool(true), + InstanceTenancy: aws.String("Tenancy"), + } + resp, err := svc.CreateVpc(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVpcEndpoint() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpcEndpointInput{ + ServiceName: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + ClientToken: aws.String("String"), + DryRun: aws.Bool(true), + PolicyDocument: aws.String("String"), + RouteTableIds: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.CreateVpcEndpoint(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVpcPeeringConnection() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpcPeeringConnectionInput{ + DryRun: aws.Bool(true), + PeerOwnerId: aws.String("String"), + PeerVpcId: aws.String("String"), + VpcId: aws.String("String"), + } + resp, err := svc.CreateVpcPeeringConnection(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVpnConnection() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpnConnectionInput{ + CustomerGatewayId: aws.String("String"), // Required + Type: aws.String("String"), // Required + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), + Options: &ec2.VpnConnectionOptionsSpecification{ + StaticRoutesOnly: aws.Bool(true), + }, + } + resp, err := svc.CreateVpnConnection(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVpnConnectionRoute() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpnConnectionRouteInput{ + DestinationCidrBlock: aws.String("String"), // Required + VpnConnectionId: aws.String("String"), // Required + } + resp, err := svc.CreateVpnConnectionRoute(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_CreateVpnGateway() { + svc := ec2.New(session.New()) + + params := &ec2.CreateVpnGatewayInput{ + Type: aws.String("GatewayType"), // Required + AvailabilityZone: aws.String("String"), + DryRun: aws.Bool(true), + } + resp, err := svc.CreateVpnGateway(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_DeleteCustomerGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteCustomerGatewayInput{ - CustomerGatewayID: aws.String("String"), // Required + CustomerGatewayId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteDHCPOptions() { - svc := ec2.New(nil) +func ExampleEC2_DeleteDhcpOptions() { + svc := ec2.New(session.New()) - params := &ec2.DeleteDHCPOptionsInput{ - DHCPOptionsID: aws.String("String"), // Required + params := &ec2.DeleteDhcpOptionsInput{ + DhcpOptionsId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.DeleteDHCPOptions(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteFlowLogs() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteFlowLogsInput{ - FlowLogIDs: []*string{ // Required + FlowLogIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -1726,54 +1309,38 @@ func ExampleEC2_DeleteFlowLogs() { resp, err := svc.DeleteFlowLogs(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteInternetGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required + InternetGatewayId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteKeyPair() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteKeyPairInput{ KeyName: aws.String("String"), // Required @@ -1782,112 +1349,80 @@ func ExampleEC2_DeleteKeyPair() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteNetworkACL() { - svc := ec2.New(nil) +func ExampleEC2_DeleteNetworkAcl() { + svc := ec2.New(session.New()) - params := &ec2.DeleteNetworkACLInput{ - NetworkACLID: aws.String("String"), // Required + params := &ec2.DeleteNetworkAclInput{ + NetworkAclId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.DeleteNetworkACL(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DeleteNetworkACLEntry() { - svc := ec2.New(nil) +func ExampleEC2_DeleteNetworkAclEntry() { + svc := ec2.New(session.New()) - params := &ec2.DeleteNetworkACLEntryInput{ + params := &ec2.DeleteNetworkAclEntryInput{ Egress: aws.Bool(true), // Required - NetworkACLID: aws.String("String"), // Required + NetworkAclId: aws.String("String"), // Required RuleNumber: aws.Int64(1), // Required DryRun: aws.Bool(true), } - resp, err := svc.DeleteNetworkACLEntry(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteNetworkInterface() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeletePlacementGroup() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeletePlacementGroupInput{ GroupName: aws.String("String"), // Required @@ -1896,140 +1431,100 @@ func ExampleEC2_DeletePlacementGroup() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteRoute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteRouteTable() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteRouteTableInput{ - RouteTableID: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSecurityGroup() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteSecurityGroupInput{ DryRun: aws.Bool(true), - GroupID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSnapshot() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteSnapshotInput{ - SnapshotID: aws.String("String"), // Required + SnapshotId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSpotDatafeedSubscription() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteSpotDatafeedSubscriptionInput{ DryRun: aws.Bool(true), @@ -2037,54 +1532,38 @@ func ExampleEC2_DeleteSpotDatafeedSubscription() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteSubnet() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteSubnetInput{ - SubnetID: aws.String("String"), // Required + SubnetId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteTags() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteTagsInput{ Resources: []*string{ // Required @@ -2103,253 +1582,181 @@ func ExampleEC2_DeleteTags() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DeleteVPC() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPCInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DeleteVPCEndpoints() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPCEndpointsInput{ - VPCEndpointIDs: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DeleteVPCPeeringConnection() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DeleteVPNConnection() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPNConnectionInput{ - VPNConnectionID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DeleteVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.DeleteVPNGatewayInput{ - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DeleteVolume() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeleteVolumeInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpc() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpcInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.DeleteVpc(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpcEndpoints() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpcEndpointsInput{ + VpcEndpointIds: []*string{ // Required + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Bool(true), + } + resp, err := svc.DeleteVpcEndpoints(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpcPeeringConnection() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpcPeeringConnectionInput{ + VpcPeeringConnectionId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.DeleteVpcPeeringConnection(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpnConnection() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpnConnectionInput{ + VpnConnectionId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.DeleteVpnConnection(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpnConnectionRoute() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpnConnectionRouteInput{ + DestinationCidrBlock: aws.String("String"), // Required + VpnConnectionId: aws.String("String"), // Required + } + resp, err := svc.DeleteVpnConnectionRoute(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DeleteVpnGateway() { + svc := ec2.New(session.New()) + + params := &ec2.DeleteVpnGatewayInput{ + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.DeleteVpnGateway(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_DeregisterImage() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DeregisterImageInput{ - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAccountAttributes() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeAccountAttributesInput{ AttributeNames: []*string{ @@ -2361,29 +1768,21 @@ func ExampleEC2_DescribeAccountAttributes() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAddresses() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeAddressesInput{ - AllocationIDs: []*string{ + AllocationIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2398,7 +1797,7 @@ func ExampleEC2_DescribeAddresses() { }, // More values... }, - PublicIPs: []*string{ + PublicIps: []*string{ aws.String("String"), // Required // More values... }, @@ -2406,26 +1805,18 @@ func ExampleEC2_DescribeAddresses() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeAvailabilityZones() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeAvailabilityZonesInput{ DryRun: aws.Bool(true), @@ -2447,29 +1838,21 @@ func ExampleEC2_DescribeAvailabilityZones() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeBundleTasks() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeBundleTasksInput{ - BundleIDs: []*string{ + BundleIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2488,26 +1871,18 @@ func ExampleEC2_DescribeBundleTasks() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeClassicLinkInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeClassicLinkInstancesInput{ DryRun: aws.Bool(true), @@ -2521,7 +1896,7 @@ func ExampleEC2_DescribeClassicLinkInstances() { }, // More values... }, - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2531,29 +1906,21 @@ func ExampleEC2_DescribeClassicLinkInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeConversionTasks() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeConversionTasksInput{ - ConversionTaskIDs: []*string{ + ConversionTaskIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2572,29 +1939,21 @@ func ExampleEC2_DescribeConversionTasks() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeCustomerGateways() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeCustomerGatewaysInput{ - CustomerGatewayIDs: []*string{ + CustomerGatewayIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2613,29 +1972,21 @@ func ExampleEC2_DescribeCustomerGateways() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeDHCPOptions() { - svc := ec2.New(nil) +func ExampleEC2_DescribeDhcpOptions() { + svc := ec2.New(session.New()) - params := &ec2.DescribeDHCPOptionsInput{ - DHCPOptionsIDs: []*string{ + params := &ec2.DescribeDhcpOptionsInput{ + DhcpOptionsIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2651,32 +2002,24 @@ func ExampleEC2_DescribeDHCPOptions() { // More values... }, } - resp, err := svc.DescribeDHCPOptions(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeExportTasks() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeExportTasksInput{ - ExportTaskIDs: []*string{ + ExportTaskIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2684,26 +2027,18 @@ func ExampleEC2_DescribeExportTasks() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeFlowLogs() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeFlowLogsInput{ Filter: []*ec2.Filter{ @@ -2716,7 +2051,7 @@ func ExampleEC2_DescribeFlowLogs() { }, // More values... }, - FlowLogIDs: []*string{ + FlowLogIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2726,55 +2061,39 @@ func ExampleEC2_DescribeFlowLogs() { resp, err := svc.DescribeFlowLogs(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImageAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeImageAttributeInput{ Attribute: aws.String("ImageAttributeName"), // Required - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImages() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeImagesInput{ DryRun: aws.Bool(true), @@ -2792,7 +2111,7 @@ func ExampleEC2_DescribeImages() { }, // More values... }, - ImageIDs: []*string{ + ImageIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2804,26 +2123,18 @@ func ExampleEC2_DescribeImages() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImportImageTasks() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeImportImageTasksInput{ DryRun: aws.Bool(true), @@ -2837,7 +2148,7 @@ func ExampleEC2_DescribeImportImageTasks() { }, // More values... }, - ImportTaskIDs: []*string{ + ImportTaskIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2847,26 +2158,18 @@ func ExampleEC2_DescribeImportImageTasks() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeImportSnapshotTasks() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeImportSnapshotTasksInput{ DryRun: aws.Bool(true), @@ -2880,7 +2183,7 @@ func ExampleEC2_DescribeImportSnapshotTasks() { }, // More values... }, - ImportTaskIDs: []*string{ + ImportTaskIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2890,55 +2193,39 @@ func ExampleEC2_DescribeImportSnapshotTasks() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstanceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstanceStatus() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeInstanceStatusInput{ DryRun: aws.Bool(true), @@ -2953,7 +2240,7 @@ func ExampleEC2_DescribeInstanceStatus() { // More values... }, IncludeAllInstances: aws.Bool(true), - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, @@ -2963,26 +2250,18 @@ func ExampleEC2_DescribeInstanceStatus() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeInstancesInput{ DryRun: aws.Bool(true), @@ -2996,7 +2275,7 @@ func ExampleEC2_DescribeInstances() { }, // More values... }, - InstanceIDs: []*string{ + InstanceIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3006,26 +2285,18 @@ func ExampleEC2_DescribeInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeInternetGateways() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeInternetGatewaysInput{ DryRun: aws.Bool(true), @@ -3039,7 +2310,7 @@ func ExampleEC2_DescribeInternetGateways() { }, // More values... }, - InternetGatewayIDs: []*string{ + InternetGatewayIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3047,26 +2318,18 @@ func ExampleEC2_DescribeInternetGateways() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeKeyPairs() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeKeyPairsInput{ DryRun: aws.Bool(true), @@ -3088,26 +2351,18 @@ func ExampleEC2_DescribeKeyPairs() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeMovingAddresses() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeMovingAddressesInput{ DryRun: aws.Bool(true), @@ -3123,7 +2378,7 @@ func ExampleEC2_DescribeMovingAddresses() { }, MaxResults: aws.Int64(1), NextToken: aws.String("String"), - PublicIPs: []*string{ + PublicIps: []*string{ aws.String("String"), // Required // More values... }, @@ -3131,28 +2386,20 @@ func ExampleEC2_DescribeMovingAddresses() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DescribeNetworkACLs() { - svc := ec2.New(nil) +func ExampleEC2_DescribeNetworkAcls() { + svc := ec2.New(session.New()) - params := &ec2.DescribeNetworkACLsInput{ + params := &ec2.DescribeNetworkAclsInput{ DryRun: aws.Bool(true), Filters: []*ec2.Filter{ { // Required @@ -3164,63 +2411,47 @@ func ExampleEC2_DescribeNetworkACLs() { }, // More values... }, - NetworkACLIDs: []*string{ + NetworkAclIds: []*string{ aws.String("String"), // Required // More values... }, } - resp, err := svc.DescribeNetworkACLs(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeNetworkInterfaceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required Attribute: aws.String("NetworkInterfaceAttribute"), DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeNetworkInterfaces() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeNetworkInterfacesInput{ DryRun: aws.Bool(true), @@ -3234,7 +2465,7 @@ func ExampleEC2_DescribeNetworkInterfaces() { }, // More values... }, - NetworkInterfaceIDs: []*string{ + NetworkInterfaceIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3242,26 +2473,18 @@ func ExampleEC2_DescribeNetworkInterfaces() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribePlacementGroups() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribePlacementGroupsInput{ DryRun: aws.Bool(true), @@ -3283,26 +2506,18 @@ func ExampleEC2_DescribePlacementGroups() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribePrefixLists() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribePrefixListsInput{ DryRun: aws.Bool(true), @@ -3318,7 +2533,7 @@ func ExampleEC2_DescribePrefixLists() { }, MaxResults: aws.Int64(1), NextToken: aws.String("String"), - PrefixListIDs: []*string{ + PrefixListIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3326,26 +2541,18 @@ func ExampleEC2_DescribePrefixLists() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeRegions() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeRegionsInput{ DryRun: aws.Bool(true), @@ -3367,26 +2574,18 @@ func ExampleEC2_DescribeRegions() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeReservedInstancesInput{ DryRun: aws.Bool(true), @@ -3401,7 +2600,7 @@ func ExampleEC2_DescribeReservedInstances() { // More values... }, OfferingType: aws.String("OfferingTypeValues"), - ReservedInstancesIDs: []*string{ + ReservedInstancesIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3409,26 +2608,18 @@ func ExampleEC2_DescribeReservedInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesListings() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeReservedInstancesListingsInput{ Filters: []*ec2.Filter{ @@ -3441,32 +2632,24 @@ func ExampleEC2_DescribeReservedInstancesListings() { }, // More values... }, - ReservedInstancesID: aws.String("String"), - ReservedInstancesListingID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesModifications() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeReservedInstancesModificationsInput{ Filters: []*ec2.Filter{ @@ -3480,7 +2663,7 @@ func ExampleEC2_DescribeReservedInstancesModifications() { // More values... }, NextToken: aws.String("String"), - ReservedInstancesModificationIDs: []*string{ + ReservedInstancesModificationIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3488,26 +2671,18 @@ func ExampleEC2_DescribeReservedInstancesModifications() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeReservedInstancesOfferings() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeReservedInstancesOfferingsInput{ AvailabilityZone: aws.String("String"), @@ -3532,7 +2707,7 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { NextToken: aws.String("String"), OfferingType: aws.String("OfferingTypeValues"), ProductDescription: aws.String("RIProductDescription"), - ReservedInstancesOfferingIDs: []*string{ + ReservedInstancesOfferingIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3540,26 +2715,18 @@ func ExampleEC2_DescribeReservedInstancesOfferings() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeRouteTables() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeRouteTablesInput{ DryRun: aws.Bool(true), @@ -3573,7 +2740,7 @@ func ExampleEC2_DescribeRouteTables() { }, // More values... }, - RouteTableIDs: []*string{ + RouteTableIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3581,26 +2748,18 @@ func ExampleEC2_DescribeRouteTables() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSecurityGroups() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSecurityGroupsInput{ DryRun: aws.Bool(true), @@ -3614,7 +2773,7 @@ func ExampleEC2_DescribeSecurityGroups() { }, // More values... }, - GroupIDs: []*string{ + GroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3626,55 +2785,39 @@ func ExampleEC2_DescribeSecurityGroups() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSnapshotAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required + SnapshotId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSnapshots() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSnapshotsInput{ DryRun: aws.Bool(true), @@ -3690,15 +2833,15 @@ func ExampleEC2_DescribeSnapshots() { }, MaxResults: aws.Int64(1), NextToken: aws.String("String"), - OwnerIDs: []*string{ + OwnerIds: []*string{ aws.String("String"), // Required // More values... }, - RestorableByUserIDs: []*string{ + RestorableByUserIds: []*string{ aws.String("String"), // Required // More values... }, - SnapshotIDs: []*string{ + SnapshotIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3706,26 +2849,18 @@ func ExampleEC2_DescribeSnapshots() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotDatafeedSubscription() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotDatafeedSubscriptionInput{ DryRun: aws.Bool(true), @@ -3733,29 +2868,21 @@ func ExampleEC2_DescribeSpotDatafeedSubscription() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotFleetInstancesInput{ - SpotFleetRequestID: aws.String("String"), // Required + SpotFleetRequestId: aws.String("String"), // Required DryRun: aws.Bool(true), MaxResults: aws.Int64(1), NextToken: aws.String("String"), @@ -3763,29 +2890,21 @@ func ExampleEC2_DescribeSpotFleetInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetRequestHistory() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotFleetRequestHistoryInput{ - SpotFleetRequestID: aws.String("String"), // Required + SpotFleetRequestId: aws.String("String"), // Required StartTime: aws.Time(time.Now()), // Required DryRun: aws.Bool(true), EventType: aws.String("EventType"), @@ -3795,32 +2914,24 @@ func ExampleEC2_DescribeSpotFleetRequestHistory() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotFleetRequests() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotFleetRequestsInput{ DryRun: aws.Bool(true), MaxResults: aws.Int64(1), NextToken: aws.String("String"), - SpotFleetRequestIDs: []*string{ + SpotFleetRequestIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3828,26 +2939,18 @@ func ExampleEC2_DescribeSpotFleetRequests() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotInstanceRequests() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotInstanceRequestsInput{ DryRun: aws.Bool(true), @@ -3861,7 +2964,7 @@ func ExampleEC2_DescribeSpotInstanceRequests() { }, // More values... }, - SpotInstanceRequestIDs: []*string{ + SpotInstanceRequestIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3869,26 +2972,18 @@ func ExampleEC2_DescribeSpotInstanceRequests() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSpotPriceHistory() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSpotPriceHistoryInput{ AvailabilityZone: aws.String("String"), @@ -3919,26 +3014,18 @@ func ExampleEC2_DescribeSpotPriceHistory() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeSubnets() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeSubnetsInput{ DryRun: aws.Bool(true), @@ -3952,7 +3039,7 @@ func ExampleEC2_DescribeSubnets() { }, // More values... }, - SubnetIDs: []*string{ + SubnetIds: []*string{ aws.String("String"), // Required // More values... }, @@ -3960,26 +3047,18 @@ func ExampleEC2_DescribeSubnets() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeTags() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeTagsInput{ DryRun: aws.Bool(true), @@ -3999,361 +3078,39 @@ func ExampleEC2_DescribeTags() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCAttribute() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCAttributeInput{ - VPCID: aws.String("String"), // Required - Attribute: aws.String("VpcAttributeName"), - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCClassicLink() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCClassicLinkInput{ - DryRun: aws.Bool(true), - Filters: []*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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCEndpointServices() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCEndpointServicesInput{ - DryRun: aws.Bool(true), - MaxResults: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCEndpoints() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCEndpointsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCPeeringConnections() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCPeeringConnectionsInput{ - DryRun: aws.Bool(true), - Filters: []*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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPCs() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPCsInput{ - DryRun: aws.Bool(true), - Filters: []*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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPNConnections() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPNConnectionsInput{ - DryRun: aws.Bool(true), - Filters: []*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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DescribeVPNGateways() { - svc := ec2.New(nil) - - params := &ec2.DescribeVPNGatewaysInput{ - DryRun: aws.Bool(true), - Filters: []*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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeVolumeAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required Attribute: aws.String("VolumeAttributeName"), DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeVolumeStatus() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeVolumeStatusInput{ DryRun: aws.Bool(true), @@ -4369,7 +3126,7 @@ func ExampleEC2_DescribeVolumeStatus() { }, MaxResults: aws.Int64(1), NextToken: aws.String("String"), - VolumeIDs: []*string{ + VolumeIds: []*string{ aws.String("String"), // Required // More values... }, @@ -4377,26 +3134,18 @@ func ExampleEC2_DescribeVolumeStatus() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DescribeVolumes() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DescribeVolumesInput{ DryRun: aws.Bool(true), @@ -4412,7 +3161,7 @@ func ExampleEC2_DescribeVolumes() { }, MaxResults: aws.Int64(1), NextToken: aws.String("String"), - VolumeIDs: []*string{ + VolumeIds: []*string{ aws.String("String"), // Required // More values... }, @@ -4420,426 +3169,548 @@ func ExampleEC2_DescribeVolumes() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DetachClassicLinkVPC() { - svc := ec2.New(nil) +func ExampleEC2_DescribeVpcAttribute() { + svc := ec2.New(session.New()) - params := &ec2.DetachClassicLinkVPCInput{ - InstanceID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required - DryRun: aws.Bool(true), + params := &ec2.DescribeVpcAttributeInput{ + VpcId: aws.String("String"), // Required + Attribute: aws.String("VpcAttributeName"), + DryRun: aws.Bool(true), } - resp, err := svc.DetachClassicLinkVPC(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcClassicLink() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpcClassicLinkInput{ + DryRun: aws.Bool(true), + Filters: []*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 { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcEndpointServices() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpcEndpointServicesInput{ + DryRun: aws.Bool(true), + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + } + resp, err := svc.DescribeVpcEndpointServices(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcEndpoints() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpcEndpointsInput{ + DryRun: aws.Bool(true), + Filters: []*ec2.Filter{ + { // Required + Name: aws.String("String"), + Values: []*string{ + aws.String("String"), // Required + // More values... + }, + }, + // More values... + }, + MaxResults: aws.Int64(1), + NextToken: aws.String("String"), + VpcEndpointIds: []*string{ + aws.String("String"), // Required + // More values... + }, + } + resp, err := svc.DescribeVpcEndpoints(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcPeeringConnections() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpcPeeringConnectionsInput{ + DryRun: aws.Bool(true), + Filters: []*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 { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpcs() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpcsInput{ + DryRun: aws.Bool(true), + Filters: []*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 { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpnConnections() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpnConnectionsInput{ + DryRun: aws.Bool(true), + Filters: []*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 { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DescribeVpnGateways() { + svc := ec2.New(session.New()) + + params := &ec2.DescribeVpnGatewaysInput{ + DryRun: aws.Bool(true), + Filters: []*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 { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DetachClassicLinkVpc() { + svc := ec2.New(session.New()) + + params := &ec2.DetachClassicLinkVpcInput{ + InstanceId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.DetachClassicLinkVpc(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_DetachInternetGateway() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DetachInternetGatewayInput{ - InternetGatewayID: aws.String("String"), // Required - VPCID: aws.String("String"), // Required + InternetGatewayId: aws.String("String"), // Required + VpcId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DetachNetworkInterface() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DetachNetworkInterfaceInput{ - AttachmentID: aws.String("String"), // Required + AttachmentId: aws.String("String"), // Required DryRun: aws.Bool(true), Force: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_DetachVPNGateway() { - svc := ec2.New(nil) - - params := &ec2.DetachVPNGatewayInput{ - VPCID: aws.String("String"), // Required - VPNGatewayID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DetachVolume() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DetachVolumeInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required Device: aws.String("String"), DryRun: aws.Bool(true), Force: aws.Bool(true), - InstanceID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DisableVGWRoutePropagation() { - svc := ec2.New(nil) +func ExampleEC2_DetachVpnGateway() { + svc := ec2.New(session.New()) - params := &ec2.DisableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + params := &ec2.DetachVpnGatewayInput{ + VpcId: aws.String("String"), // Required + VpnGatewayId: aws.String("String"), // Required + DryRun: aws.Bool(true), } - resp, err := svc.DisableVGWRoutePropagation(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_DisableVPCClassicLink() { - svc := ec2.New(nil) +func ExampleEC2_DisableVgwRoutePropagation() { + svc := ec2.New(session.New()) - params := &ec2.DisableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required + params := &ec2.DisableVgwRoutePropagationInput{ + GatewayId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required + } + resp, err := svc.DisableVgwRoutePropagation(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_DisableVpcClassicLink() { + svc := ec2.New(session.New()) + + params := &ec2.DisableVpcClassicLinkInput{ + VpcId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.DisableVPCClassicLink(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DisassociateAddress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DisassociateAddressInput{ - AssociationID: aws.String("String"), + AssociationId: aws.String("String"), DryRun: aws.Bool(true), - PublicIP: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_DisassociateRouteTable() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.DisassociateRouteTableInput{ - AssociationID: aws.String("String"), // Required + AssociationId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_EnableVGWRoutePropagation() { - svc := ec2.New(nil) +func ExampleEC2_EnableVgwRoutePropagation() { + svc := ec2.New(session.New()) - params := &ec2.EnableVGWRoutePropagationInput{ - GatewayID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + params := &ec2.EnableVgwRoutePropagationInput{ + GatewayId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required } - resp, err := svc.EnableVGWRoutePropagation(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_EnableVPCClassicLink() { - svc := ec2.New(nil) - - params := &ec2.EnableVPCClassicLinkInput{ - VPCID: aws.String("String"), // Required - DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_EnableVolumeIO() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.EnableVolumeIOInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_EnableVpcClassicLink() { + svc := ec2.New(session.New()) + + params := &ec2.EnableVpcClassicLinkInput{ + VpcId: aws.String("String"), // Required + DryRun: aws.Bool(true), + } + resp, err := svc.EnableVpcClassicLink(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_GetConsoleOutput() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.GetConsoleOutputInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_GetPasswordData() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.GetPasswordDataInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ImportImage() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ImportImageInput{ Architecture: aws.String("String"), @@ -4856,8 +3727,8 @@ func ExampleEC2_ImportImage() { Description: aws.String("String"), DeviceName: aws.String("String"), Format: aws.String("String"), - SnapshotID: aws.String("String"), - URL: aws.String("String"), + SnapshotId: aws.String("String"), + Url: aws.String("String"), UserBucket: &ec2.UserBucket{ S3Bucket: aws.String("String"), S3Key: aws.String("String"), @@ -4874,26 +3745,18 @@ func ExampleEC2_ImportImage() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ImportInstance() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ImportInstanceInput{ Platform: aws.String("PlatformValues"), // Required @@ -4904,7 +3767,7 @@ func ExampleEC2_ImportInstance() { Image: &ec2.DiskImageDetail{ Bytes: aws.Int64(1), // Required Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required + ImportManifestUrl: aws.String("String"), // Required }, Volume: &ec2.VolumeDetail{ Size: aws.Int64(1), // Required @@ -4916,7 +3779,7 @@ func ExampleEC2_ImportInstance() { LaunchSpecification: &ec2.ImportInstanceLaunchSpecification{ AdditionalInfo: aws.String("String"), Architecture: aws.String("ArchitectureValues"), - GroupIDs: []*string{ + GroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -4932,8 +3795,8 @@ func ExampleEC2_ImportInstance() { GroupName: aws.String("String"), Tenancy: aws.String("Tenancy"), }, - PrivateIPAddress: aws.String("String"), - SubnetID: aws.String("String"), + PrivateIpAddress: aws.String("String"), + SubnetId: aws.String("String"), UserData: &ec2.UserData{ Data: aws.String("String"), }, @@ -4942,26 +3805,18 @@ func ExampleEC2_ImportInstance() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ImportKeyPair() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ImportKeyPairInput{ KeyName: aws.String("String"), // Required @@ -4971,26 +3826,18 @@ func ExampleEC2_ImportKeyPair() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ImportSnapshot() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ImportSnapshotInput{ ClientData: &ec2.ClientData{ @@ -5004,7 +3851,7 @@ func ExampleEC2_ImportSnapshot() { DiskContainer: &ec2.SnapshotDiskContainer{ Description: aws.String("String"), Format: aws.String("String"), - URL: aws.String("String"), + Url: aws.String("String"), UserBucket: &ec2.UserBucket{ S3Bucket: aws.String("String"), S3Key: aws.String("String"), @@ -5016,33 +3863,25 @@ func ExampleEC2_ImportSnapshot() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ImportVolume() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ImportVolumeInput{ AvailabilityZone: aws.String("String"), // Required Image: &ec2.DiskImageDetail{ // Required Bytes: aws.Int64(1), // Required Format: aws.String("DiskImageFormat"), // Required - ImportManifestURL: aws.String("String"), // Required + ImportManifestUrl: aws.String("String"), // Required }, Volume: &ec2.VolumeDetail{ // Required Size: aws.Int64(1), // Required @@ -5053,29 +3892,21 @@ func ExampleEC2_ImportVolume() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyImageAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifyImageAttributeInput{ - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required Attribute: aws.String("String"), Description: &ec2.AttributeValue{ Value: aws.String("String"), @@ -5085,19 +3916,19 @@ func ExampleEC2_ModifyImageAttribute() { Add: []*ec2.LaunchPermission{ { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, Remove: []*ec2.LaunchPermission{ { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, - OperationType: aws.String("String"), + OperationType: aws.String("OperationType"), ProductCodes: []*string{ aws.String("String"), // Required // More values... @@ -5106,7 +3937,7 @@ func ExampleEC2_ModifyImageAttribute() { aws.String("String"), // Required // More values... }, - UserIDs: []*string{ + UserIds: []*string{ aws.String("String"), // Required // More values... }, @@ -5115,47 +3946,39 @@ func ExampleEC2_ModifyImageAttribute() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyInstanceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifyInstanceAttributeInput{ - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required Attribute: aws.String("InstanceAttributeName"), BlockDeviceMappings: []*ec2.InstanceBlockDeviceMappingSpecification{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSInstanceBlockDeviceSpecification{ + Ebs: &ec2.EbsInstanceBlockDeviceSpecification{ DeleteOnTermination: aws.Bool(true), - VolumeID: aws.String("String"), + VolumeId: aws.String("String"), }, NoDevice: aws.String("String"), VirtualName: aws.String("String"), }, // More values... }, - DisableAPITermination: &ec2.AttributeBooleanValue{ + DisableApiTermination: &ec2.AttributeBooleanValue{ Value: aws.Bool(true), }, DryRun: aws.Bool(true), - EBSOptimized: &ec2.AttributeBooleanValue{ + EbsOptimized: &ec2.AttributeBooleanValue{ Value: aws.Bool(true), }, Groups: []*string{ @@ -5171,15 +3994,15 @@ func ExampleEC2_ModifyInstanceAttribute() { Kernel: &ec2.AttributeValue{ Value: aws.String("String"), }, - RAMDisk: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - SRIOVNetSupport: &ec2.AttributeValue{ + Ramdisk: &ec2.AttributeValue{ Value: aws.String("String"), }, SourceDestCheck: &ec2.AttributeBooleanValue{ Value: aws.Bool(true), }, + SriovNetSupport: &ec2.AttributeValue{ + Value: aws.String("String"), + }, UserData: &ec2.BlobAttributeValue{ Value: []byte("PAYLOAD"), }, @@ -5188,31 +4011,23 @@ func ExampleEC2_ModifyInstanceAttribute() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyNetworkInterfaceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required Attachment: &ec2.NetworkInterfaceAttachmentChanges{ - AttachmentID: aws.String("String"), + AttachmentId: aws.String("String"), DeleteOnTermination: aws.Bool(true), }, Description: &ec2.AttributeValue{ @@ -5230,29 +4045,21 @@ func ExampleEC2_ModifyNetworkInterfaceAttribute() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyReservedInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifyReservedInstancesInput{ - ReservedInstancesIDs: []*string{ // Required + ReservedInstancesIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -5270,42 +4077,34 @@ func ExampleEC2_ModifyReservedInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifySnapshotAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifySnapshotAttributeInput{ - SnapshotID: aws.String("String"), // Required + SnapshotId: aws.String("String"), // Required Attribute: aws.String("SnapshotAttributeName"), CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ Add: []*ec2.CreateVolumePermission{ { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, Remove: []*ec2.CreateVolumePermission{ { // Required Group: aws.String("PermissionGroup"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, @@ -5315,8 +4114,8 @@ func ExampleEC2_ModifySnapshotAttribute() { aws.String("String"), // Required // More values... }, - OperationType: aws.String("String"), - UserIDs: []*string{ + OperationType: aws.String("OperationType"), + UserIds: []*string{ aws.String("String"), // Required // More values... }, @@ -5324,130 +4123,64 @@ func ExampleEC2_ModifySnapshotAttribute() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_ModifySpotFleetRequest() { + svc := ec2.New(session.New()) + + params := &ec2.ModifySpotFleetRequestInput{ + SpotFleetRequestId: aws.String("String"), // Required + ExcessCapacityTerminationPolicy: aws.String("ExcessCapacityTerminationPolicy"), + TargetCapacity: aws.Int64(1), + } + resp, err := svc.ModifySpotFleetRequest(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_ModifySubnetAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifySubnetAttributeInput{ - SubnetID: aws.String("String"), // Required - MapPublicIPOnLaunch: &ec2.AttributeBooleanValue{ + SubnetId: aws.String("String"), // Required + MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{ Value: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) -} - -func ExampleEC2_ModifyVPCAttribute() { - svc := ec2.New(nil) - - params := &ec2.ModifyVPCAttributeInput{ - VPCID: aws.String("String"), // Required - EnableDNSHostnames: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - EnableDNSSupport: &ec2.AttributeBooleanValue{ - Value: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(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.Bool(true), - PolicyDocument: aws.String("String"), - RemoveRouteTableIDs: []*string{ - aws.String("String"), // Required - // More values... - }, - ResetPolicy: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } - } - - // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ModifyVolumeAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ModifyVolumeAttributeInput{ - VolumeID: aws.String("String"), // Required + VolumeId: aws.String("String"), // Required AutoEnableIO: &ec2.AttributeBooleanValue{ Value: aws.Bool(true), }, @@ -5456,29 +4189,76 @@ func ExampleEC2_ModifyVolumeAttribute() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) +} + +func ExampleEC2_ModifyVpcAttribute() { + svc := ec2.New(session.New()) + + params := &ec2.ModifyVpcAttributeInput{ + VpcId: aws.String("String"), // Required + EnableDnsHostnames: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + EnableDnsSupport: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + } + resp, err := svc.ModifyVpcAttribute(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + +func ExampleEC2_ModifyVpcEndpoint() { + svc := ec2.New(session.New()) + + params := &ec2.ModifyVpcEndpointInput{ + VpcEndpointId: aws.String("String"), // Required + AddRouteTableIds: []*string{ + aws.String("String"), // Required + // More values... + }, + DryRun: aws.Bool(true), + PolicyDocument: aws.String("String"), + RemoveRouteTableIds: []*string{ + aws.String("String"), // Required + // More values... + }, + ResetPolicy: aws.Bool(true), + } + resp, err := svc.ModifyVpcEndpoint(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) } func ExampleEC2_MonitorInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.MonitorInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -5487,58 +4267,42 @@ func ExampleEC2_MonitorInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_MoveAddressToVPC() { - svc := ec2.New(nil) +func ExampleEC2_MoveAddressToVpc() { + svc := ec2.New(session.New()) - params := &ec2.MoveAddressToVPCInput{ - PublicIP: aws.String("String"), // Required + params := &ec2.MoveAddressToVpcInput{ + PublicIp: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.MoveAddressToVPC(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_PurchaseReservedInstancesOffering() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.PurchaseReservedInstancesOfferingInput{ InstanceCount: aws.Int64(1), // Required - ReservedInstancesOfferingID: aws.String("String"), // Required + ReservedInstancesOfferingId: aws.String("String"), // Required DryRun: aws.Bool(true), LimitPrice: &ec2.ReservedInstanceLimitPrice{ Amount: aws.Float64(1.0), @@ -5548,29 +4312,21 @@ func ExampleEC2_PurchaseReservedInstancesOffering() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RebootInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RebootInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -5579,26 +4335,18 @@ func ExampleEC2_RebootInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RegisterImage() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RegisterImageInput{ Name: aws.String("String"), // Required @@ -5606,11 +4354,11 @@ func ExampleEC2_RegisterImage() { BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ + Ebs: &ec2.EbsBlockDevice{ DeleteOnTermination: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - SnapshotID: aws.String("String"), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, @@ -5622,131 +4370,99 @@ func ExampleEC2_RegisterImage() { Description: aws.String("String"), DryRun: aws.Bool(true), ImageLocation: aws.String("String"), - KernelID: aws.String("String"), - RAMDiskID: aws.String("String"), + KernelId: aws.String("String"), + RamdiskId: aws.String("String"), RootDeviceName: aws.String("String"), - SRIOVNetSupport: 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_RejectVPCPeeringConnection() { - svc := ec2.New(nil) +func ExampleEC2_RejectVpcPeeringConnection() { + svc := ec2.New(session.New()) - params := &ec2.RejectVPCPeeringConnectionInput{ - VPCPeeringConnectionID: aws.String("String"), // Required + params := &ec2.RejectVpcPeeringConnectionInput{ + VpcPeeringConnectionId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.RejectVPCPeeringConnection(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ReleaseAddress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ReleaseAddressInput{ - AllocationID: aws.String("String"), + AllocationId: aws.String("String"), DryRun: aws.Bool(true), - PublicIP: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_ReplaceNetworkACLAssociation() { - svc := ec2.New(nil) +func ExampleEC2_ReplaceNetworkAclAssociation() { + svc := ec2.New(session.New()) - params := &ec2.ReplaceNetworkACLAssociationInput{ - AssociationID: aws.String("String"), // Required - NetworkACLID: aws.String("String"), // Required + params := &ec2.ReplaceNetworkAclAssociationInput{ + AssociationId: aws.String("String"), // Required + NetworkAclId: aws.String("String"), // Required DryRun: aws.Bool(true), } - resp, err := svc.ReplaceNetworkACLAssociation(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_ReplaceNetworkACLEntry() { - svc := ec2.New(nil) +func ExampleEC2_ReplaceNetworkAclEntry() { + svc := ec2.New(session.New()) - params := &ec2.ReplaceNetworkACLEntryInput{ - CIDRBlock: aws.String("String"), // Required + params := &ec2.ReplaceNetworkAclEntryInput{ + CidrBlock: aws.String("String"), // Required Egress: aws.Bool(true), // Required - NetworkACLID: aws.String("String"), // Required + NetworkAclId: aws.String("String"), // Required Protocol: aws.String("String"), // Required RuleAction: aws.String("RuleAction"), // Required RuleNumber: aws.Int64(1), // Required DryRun: aws.Bool(true), - ICMPTypeCode: &ec2.ICMPTypeCode{ + IcmpTypeCode: &ec2.IcmpTypeCode{ Code: aws.Int64(1), Type: aws.Int64(1), }, @@ -5755,91 +4471,67 @@ func ExampleEC2_ReplaceNetworkACLEntry() { To: aws.Int64(1), }, } - resp, err := svc.ReplaceNetworkACLEntry(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ReplaceRoute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ReplaceRouteInput{ - DestinationCIDRBlock: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + DestinationCidrBlock: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required DryRun: aws.Bool(true), - GatewayID: aws.String("String"), - InstanceID: aws.String("String"), - NetworkInterfaceID: aws.String("String"), - VPCPeeringConnectionID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ReplaceRouteTableAssociation() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ReplaceRouteTableAssociationInput{ - AssociationID: aws.String("String"), // Required - RouteTableID: aws.String("String"), // Required + AssociationId: aws.String("String"), // Required + RouteTableId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ReportInstanceStatus() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ReportInstanceStatusInput{ Instances: []*string{ // Required @@ -5859,41 +4551,33 @@ func ExampleEC2_ReportInstanceStatus() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RequestSpotFleet() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RequestSpotFleetInput{ SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required - IAMFleetRole: aws.String("String"), // Required + IamFleetRole: aws.String("String"), // Required LaunchSpecifications: []*ec2.SpotFleetLaunchSpecification{ // Required { // Required AddressingType: aws.String("String"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ + Ebs: &ec2.EbsBlockDevice{ DeleteOnTermination: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - SnapshotID: aws.String("String"), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, @@ -5902,21 +4586,21 @@ func ExampleEC2_RequestSpotFleet() { }, // More values... }, - EBSOptimized: aws.Bool(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, - ImageID: aws.String("String"), + ImageId: aws.String("String"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), Monitoring: &ec2.SpotFleetMonitoring{ Enabled: aws.Bool(true), }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ { // Required - AssociatePublicIPAddress: aws.Bool(true), + AssociatePublicIpAddress: aws.Bool(true), DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), DeviceIndex: aws.Int64(1), @@ -5924,17 +4608,17 @@ func ExampleEC2_RequestSpotFleet() { aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ { // Required - PrivateIPAddress: aws.String("String"), // Required + PrivateIpAddress: aws.String("String"), // Required Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Int64(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -5942,22 +4626,26 @@ func ExampleEC2_RequestSpotFleet() { AvailabilityZone: aws.String("String"), GroupName: aws.String("String"), }, - RAMDiskID: aws.String("String"), + RamdiskId: aws.String("String"), SecurityGroups: []*ec2.GroupIdentifier{ { // Required - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), }, // More values... }, - SubnetID: aws.String("String"), - UserData: aws.String("String"), + SpotPrice: aws.String("String"), + SubnetId: aws.String("String"), + UserData: aws.String("String"), + WeightedCapacity: aws.Float64(1.0), }, // More values... }, SpotPrice: aws.String("String"), // Required TargetCapacity: aws.Int64(1), // Required + AllocationStrategy: aws.String("AllocationStrategy"), ClientToken: aws.String("String"), + ExcessCapacityTerminationPolicy: aws.String("ExcessCapacityTerminationPolicy"), TerminateInstancesWithExpiration: aws.Bool(true), ValidFrom: aws.Time(time.Now()), ValidUntil: aws.Time(time.Now()), @@ -5967,30 +4655,23 @@ func ExampleEC2_RequestSpotFleet() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RequestSpotInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RequestSpotInstancesInput{ SpotPrice: aws.String("String"), // Required AvailabilityZoneGroup: aws.String("String"), + BlockDurationMinutes: aws.Int64(1), ClientToken: aws.String("String"), DryRun: aws.Bool(true), InstanceCount: aws.Int64(1), @@ -6000,11 +4681,11 @@ func ExampleEC2_RequestSpotInstances() { BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ + Ebs: &ec2.EbsBlockDevice{ DeleteOnTermination: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - SnapshotID: aws.String("String"), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, @@ -6013,21 +4694,21 @@ func ExampleEC2_RequestSpotInstances() { }, // More values... }, - EBSOptimized: aws.Bool(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, - ImageID: aws.String("String"), + ImageId: aws.String("String"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), Monitoring: &ec2.RunInstancesMonitoringEnabled{ Enabled: aws.Bool(true), // Required }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ { // Required - AssociatePublicIPAddress: aws.Bool(true), + AssociatePublicIpAddress: aws.Bool(true), DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), DeviceIndex: aws.Int64(1), @@ -6035,17 +4716,17 @@ func ExampleEC2_RequestSpotInstances() { aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ { // Required - PrivateIPAddress: aws.String("String"), // Required + PrivateIpAddress: aws.String("String"), // Required Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Int64(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -6053,8 +4734,8 @@ func ExampleEC2_RequestSpotInstances() { AvailabilityZone: aws.String("String"), GroupName: aws.String("String"), }, - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ + RamdiskId: aws.String("String"), + SecurityGroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -6062,7 +4743,7 @@ func ExampleEC2_RequestSpotInstances() { aws.String("String"), // Required // More values... }, - SubnetID: aws.String("String"), + SubnetId: aws.String("String"), UserData: aws.String("String"), }, Type: aws.String("SpotInstanceType"), @@ -6072,309 +4753,245 @@ func ExampleEC2_RequestSpotInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ResetImageAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ResetImageAttributeInput{ Attribute: aws.String("ResetImageAttributeName"), // Required - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ResetInstanceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ResetInstanceAttributeInput{ Attribute: aws.String("InstanceAttributeName"), // Required - InstanceID: aws.String("String"), // Required + InstanceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ResetNetworkInterfaceAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ResetNetworkInterfaceAttributeInput{ - NetworkInterfaceID: aws.String("String"), // Required + NetworkInterfaceId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_ResetSnapshotAttribute() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.ResetSnapshotAttributeInput{ Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotID: aws.String("String"), // Required + SnapshotId: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RestoreAddressToClassic() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RestoreAddressToClassicInput{ - PublicIP: aws.String("String"), // Required + PublicIp: aws.String("String"), // Required DryRun: aws.Bool(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RevokeSecurityGroupEgress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RevokeSecurityGroupEgressInput{ - GroupID: aws.String("String"), // Required - CIDRIP: aws.String("String"), + GroupId: aws.String("String"), // Required + CidrIp: aws.String("String"), DryRun: aws.Bool(true), FromPort: aws.Int64(1), - IPPermissions: []*ec2.IPPermission{ + IpPermissions: []*ec2.IpPermission{ { // Required FromPort: aws.Int64(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ { // Required - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ + PrefixListIds: []*ec2.PrefixListId{ { // Required - PrefixListID: aws.String("String"), + PrefixListId: aws.String("String"), }, // More values... }, ToPort: aws.Int64(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ { // Required - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), + SourceSecurityGroupOwnerId: aws.String("String"), ToPort: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RevokeSecurityGroupIngress() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RevokeSecurityGroupIngressInput{ - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), DryRun: aws.Bool(true), FromPort: aws.Int64(1), - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - IPPermissions: []*ec2.IPPermission{ + IpPermissions: []*ec2.IpPermission{ { // Required FromPort: aws.Int64(1), - IPProtocol: aws.String("String"), - IPRanges: []*ec2.IPRange{ + IpProtocol: aws.String("String"), + IpRanges: []*ec2.IpRange{ { // Required - CIDRIP: aws.String("String"), + CidrIp: aws.String("String"), }, // More values... }, - PrefixListIDs: []*ec2.PrefixListID{ + PrefixListIds: []*ec2.PrefixListId{ { // Required - PrefixListID: aws.String("String"), + PrefixListId: aws.String("String"), }, // More values... }, ToPort: aws.Int64(1), - UserIDGroupPairs: []*ec2.UserIDGroupPair{ + UserIdGroupPairs: []*ec2.UserIdGroupPair{ { // Required - GroupID: aws.String("String"), + GroupId: aws.String("String"), GroupName: aws.String("String"), - UserID: aws.String("String"), + UserId: aws.String("String"), }, // More values... }, }, // More values... }, - IPProtocol: aws.String("String"), + IpProtocol: aws.String("String"), SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerID: aws.String("String"), + SourceSecurityGroupOwnerId: aws.String("String"), ToPort: aws.Int64(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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_RunInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.RunInstancesInput{ - ImageID: aws.String("String"), // Required + ImageId: aws.String("String"), // Required MaxCount: aws.Int64(1), // Required MinCount: aws.Int64(1), // Required AdditionalInfo: aws.String("String"), BlockDeviceMappings: []*ec2.BlockDeviceMapping{ { // Required DeviceName: aws.String("String"), - EBS: &ec2.EBSBlockDevice{ + Ebs: &ec2.EbsBlockDevice{ DeleteOnTermination: aws.Bool(true), Encrypted: aws.Bool(true), - IOPS: aws.Int64(1), - SnapshotID: aws.String("String"), + Iops: aws.Int64(1), + SnapshotId: aws.String("String"), VolumeSize: aws.Int64(1), VolumeType: aws.String("VolumeType"), }, @@ -6384,23 +5001,23 @@ func ExampleEC2_RunInstances() { // More values... }, ClientToken: aws.String("String"), - DisableAPITermination: aws.Bool(true), + DisableApiTermination: aws.Bool(true), DryRun: aws.Bool(true), - EBSOptimized: aws.Bool(true), - IAMInstanceProfile: &ec2.IAMInstanceProfileSpecification{ - ARN: aws.String("String"), + EbsOptimized: aws.Bool(true), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Arn: aws.String("String"), Name: aws.String("String"), }, InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), InstanceType: aws.String("InstanceType"), - KernelID: aws.String("String"), + KernelId: aws.String("String"), KeyName: aws.String("String"), Monitoring: &ec2.RunInstancesMonitoringEnabled{ Enabled: aws.Bool(true), // Required }, NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ { // Required - AssociatePublicIPAddress: aws.Bool(true), + AssociatePublicIpAddress: aws.Bool(true), DeleteOnTermination: aws.Bool(true), Description: aws.String("String"), DeviceIndex: aws.Int64(1), @@ -6408,17 +5025,17 @@ func ExampleEC2_RunInstances() { aws.String("String"), // Required // More values... }, - NetworkInterfaceID: aws.String("String"), - PrivateIPAddress: aws.String("String"), - PrivateIPAddresses: []*ec2.PrivateIPAddressSpecification{ + NetworkInterfaceId: aws.String("String"), + PrivateIpAddress: aws.String("String"), + PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ { // Required - PrivateIPAddress: aws.String("String"), // Required + PrivateIpAddress: aws.String("String"), // Required Primary: aws.Bool(true), }, // More values... }, - SecondaryPrivateIPAddressCount: aws.Int64(1), - SubnetID: aws.String("String"), + SecondaryPrivateIpAddressCount: aws.Int64(1), + SubnetId: aws.String("String"), }, // More values... }, @@ -6427,9 +5044,9 @@ func ExampleEC2_RunInstances() { GroupName: aws.String("String"), Tenancy: aws.String("Tenancy"), }, - PrivateIPAddress: aws.String("String"), - RAMDiskID: aws.String("String"), - SecurityGroupIDs: []*string{ + PrivateIpAddress: aws.String("String"), + RamdiskId: aws.String("String"), + SecurityGroupIds: []*string{ aws.String("String"), // Required // More values... }, @@ -6437,35 +5054,27 @@ func ExampleEC2_RunInstances() { aws.String("String"), // Required // More values... }, - SubnetID: aws.String("String"), + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_StartInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.StartInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -6475,29 +5084,21 @@ func ExampleEC2_StartInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_StopInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.StopInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -6507,29 +5108,21 @@ func ExampleEC2_StopInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_TerminateInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.TerminateInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -6538,60 +5131,44 @@ func ExampleEC2_TerminateInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } -func ExampleEC2_UnassignPrivateIPAddresses() { - svc := ec2.New(nil) +func ExampleEC2_UnassignPrivateIpAddresses() { + svc := ec2.New(session.New()) - params := &ec2.UnassignPrivateIPAddressesInput{ - NetworkInterfaceID: aws.String("String"), // Required - PrivateIPAddresses: []*string{ // Required + params := &ec2.UnassignPrivateIpAddressesInput{ + NetworkInterfaceId: aws.String("String"), // Required + PrivateIpAddresses: []*string{ // Required aws.String("String"), // Required // More values... }, } - resp, err := svc.UnassignPrivateIPAddresses(params) + 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } func ExampleEC2_UnmonitorInstances() { - svc := ec2.New(nil) + svc := ec2.New(session.New()) params := &ec2.UnmonitorInstancesInput{ - InstanceIDs: []*string{ // Required + InstanceIds: []*string{ // Required aws.String("String"), // Required // More values... }, @@ -6600,20 +5177,12 @@ func ExampleEC2_UnmonitorInstances() { 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 always return an - // error which satisfies the awserr.Error interface. - fmt.Println(err.Error()) - } + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return } // Pretty-print the response data. - fmt.Println(awsutil.Prettify(resp)) + fmt.Println(resp) } diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go index b9767171118..2ff4220f7da 100644 --- a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/service.go @@ -4,52 +4,81 @@ package ec2 import ( "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" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/ec2query" + "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity // in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your // need to invest in hardware up front, so you can develop and deploy applications // faster. +//The service client's operations are safe to be used concurrently. +// It is not safe to mutate any of the client's properties though. type EC2 struct { - *aws.Service + *client.Client } -// Used for custom service initialization logic -var initService func(*aws.Service) +// Used for custom client initialization logic +var initClient func(*client.Client) // Used for custom request initialization logic -var initRequest func(*aws.Request) +var initRequest func(*request.Request) -// New returns a new EC2 client. -func New(config *aws.Config) *EC2 { - service := &aws.Service{ - Config: aws.DefaultConfig.Merge(config), - ServiceName: "ec2", - APIVersion: "2015-04-15", +// A ServiceName is the name of the service the client will make API calls to. +const ServiceName = "ec2" + +// New creates a new instance of the EC2 client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// // Create a EC2 client from just a session. +// svc := ec2.New(mySession) +// +// // Create a EC2 client with additional configuration +// svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 { + c := p.ClientConfig(ServiceName, cfgs...) + return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *EC2 { + svc := &EC2{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + SigningRegion: signingRegion, + Endpoint: endpoint, + APIVersion: "2015-10-01", + }, + handlers, + ), } - service.Initialize() // Handlers - service.Handlers.Sign.PushBack(v4.Sign) - service.Handlers.Build.PushBack(ec2query.Build) - service.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) - service.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) - service.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) + svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Build.PushBack(ec2query.Build) + svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal) + svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta) + svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError) - // Run custom service initialization if present - if initService != nil { - initService(service) + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) } - return &EC2{service} + return svc } // newRequest creates a new request for a EC2 operation and runs any // custom request initialization. -func (c *EC2) newRequest(op *aws.Operation, params, data interface{}) *aws.Request { - req := aws.NewRequest(c.Service, op, params, data) +func (c *EC2) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) // Run custom request initialization if present if initRequest != nil { diff --git a/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go new file mode 100644 index 00000000000..1b28317a18b --- /dev/null +++ b/Godeps/_workspace/src/github.com/aws/aws-sdk-go/service/ec2/waiters.go @@ -0,0 +1,761 @@ +// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. + +package ec2 + +import ( + "github.com/aws/aws-sdk-go/private/waiter" +) + +func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeBundleTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "BundleTasks[].State", + Expected: "complete", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "BundleTasks[].State", + Expected: "failed", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeConversionTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "ConversionTasks[].State", + Expected: "cancelled", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeConversionTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "ConversionTasks[].State", + Expected: "completed", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "ConversionTasks[].State", + Expected: "cancelled", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "ConversionTasks[].State", + Expected: "cancelling", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeConversionTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "ConversionTasks[].State", + Expected: "deleted", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeCustomerGateways", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "CustomerGateways[].State", + Expected: "available", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "CustomerGateways[].State", + Expected: "deleted", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "CustomerGateways[].State", + Expected: "deleting", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeExportTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "ExportTasks[].State", + Expected: "cancelled", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeExportTasks", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "ExportTasks[].State", + Expected: "completed", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeImages", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Images[].State", + Expected: "available", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Images[].State", + Expected: "failed", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstances", + Delay: 5, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "status", + Argument: "", + Expected: 200, + }, + { + State: "retry", + Matcher: "error", + Argument: "", + Expected: "InvalidInstanceIDNotFound", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstances", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Reservations[].Instances[].State.Name", + Expected: "running", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "shutting-down", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "terminated", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "stopping", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstanceStatus", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "InstanceStatuses[].InstanceStatus.Status", + Expected: "ok", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstances", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Reservations[].Instances[].State.Name", + Expected: "stopped", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "pending", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "terminated", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstances", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Reservations[].Instances[].State.Name", + Expected: "terminated", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "pending", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Reservations[].Instances[].State.Name", + Expected: "stopping", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeKeyPairs", + Delay: 5, + MaxAttempts: 6, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "length(KeyPairs[].KeyName) > `0`", + Expected: true, + }, + { + State: "retry", + Matcher: "error", + Argument: "", + Expected: "InvalidKeyPairNotFound", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeNetworkInterfaces", + Delay: 20, + MaxAttempts: 10, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "NetworkInterfaces[].Status", + Expected: "available", + }, + { + State: "failure", + Matcher: "error", + Argument: "", + Expected: "InvalidNetworkInterfaceIDNotFound", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error { + waiterCfg := waiter.Config{ + Operation: "GetPasswordData", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "path", + Argument: "length(PasswordData) > `0`", + Expected: true, + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeSnapshots", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Snapshots[].State", + Expected: "completed", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeSpotInstanceRequests", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "SpotInstanceRequests[].Status.Code", + Expected: "fulfilled", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "SpotInstanceRequests[].Status.Code", + Expected: "schedule-expired", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "SpotInstanceRequests[].Status.Code", + Expected: "canceled-before-fulfillment", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "SpotInstanceRequests[].Status.Code", + Expected: "bad-parameters", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "SpotInstanceRequests[].Status.Code", + Expected: "system-error", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeSubnets", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Subnets[].State", + Expected: "available", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeInstanceStatus", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "InstanceStatuses[].SystemStatus.Status", + Expected: "ok", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVolumes", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Volumes[].State", + Expected: "available", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Volumes[].State", + Expected: "deleted", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVolumes", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Volumes[].State", + Expected: "deleted", + }, + { + State: "success", + Matcher: "error", + Argument: "", + Expected: "InvalidVolumeNotFound", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVolumes", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Volumes[].State", + Expected: "in-use", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "Volumes[].State", + Expected: "deleted", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVpcs", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "Vpcs[].State", + Expected: "available", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVpnConnections", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "VpnConnections[].State", + Expected: "available", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "VpnConnections[].State", + Expected: "deleting", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "VpnConnections[].State", + Expected: "deleted", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + +func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVpnConnections", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "VpnConnections[].State", + Expected: "deleted", + }, + { + State: "failure", + Matcher: "pathAny", + Argument: "VpnConnections[].State", + Expected: "pending", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore b/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore new file mode 100644 index 00000000000..7adca9439c5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/.gitignore @@ -0,0 +1,4 @@ +testdata/conf_out.ini +ini.sublime-project +ini.sublime-workspace +testdata/conf_reflect.ini diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE b/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE new file mode 100644 index 00000000000..37ec93a14fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/README.md b/Godeps/_workspace/src/github.com/go-ini/ini/README.md new file mode 100644 index 00000000000..1272038a9e3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/README.md @@ -0,0 +1,560 @@ +ini [![Build Status](https://drone.io/github.com/go-ini/ini/status.png)](https://drone.io/github.com/go-ini/ini/latest) [![](http://gocover.io/_badge/github.com/go-ini/ini)](http://gocover.io/github.com/go-ini/ini) +=== + +![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200) + +Package ini provides INI file read and write functionality in Go. + +[简体中文](README_ZH.md) + +## Feature + +- Load multiple data sources(`[]byte` or file) with overwrites. +- Read with recursion values. +- Read with parent-child sections. +- Read with auto-increment key names. +- Read with multiple-line values. +- Read with tons of helper methods. +- Read and convert values to Go types. +- Read and **WRITE** comments of sections and keys. +- Manipulate sections, keys and comments with ease. +- Keep sections and keys in order as you parse and save. + +## Installation + + go get gopkg.in/ini.v1 + +## Getting Started + +### Loading from data sources + +A **Data Source** is either raw data in type `[]byte` or a file name with type `string` and you can load **as many as** data sources you want. Passing other types will simply return an error. + +```go +cfg, err := ini.Load([]byte("raw data"), "filename") +``` + +Or start with an empty object: + +```go +cfg := ini.Empty() +``` + +When you cannot decide how many data sources to load at the beginning, you still able to **Append()** them later. + +```go +err := cfg.Append("other file", []byte("other raw data")) +``` + +### Working with sections + +To get a section, you would need to: + +```go +section, err := cfg.GetSection("section name") +``` + +For a shortcut for default section, just give an empty string as name: + +```go +section, err := cfg.GetSection("") +``` + +When you're pretty sure the section exists, following code could make your life easier: + +```go +section := cfg.Section("") +``` + +What happens when the section somehow does not exist? Don't panic, it automatically creates and returns a new section to you. + +To create a new section: + +```go +err := cfg.NewSection("new section") +``` + +To get a list of sections or section names: + +```go +sections := cfg.Sections() +names := cfg.SectionStrings() +``` + +### Working with keys + +To get a key under a section: + +```go +key, err := cfg.Section("").GetKey("key name") +``` + +Same rule applies to key operations: + +```go +key := cfg.Section("").Key("key name") +``` + +To create a new key: + +```go +err := cfg.Section("").NewKey("name", "value") +``` + +To get a list of keys or key names: + +```go +keys := cfg.Section("").Keys() +names := cfg.Section("").KeyStrings() +``` + +To get a clone hash of keys and corresponding values: + +```go +hash := cfg.GetSection("").KeysHash() +``` + +### Working with values + +To get a string value: + +```go +val := cfg.Section("").Key("key name").String() +``` + +To validate key value on the fly: + +```go +val := cfg.Section("").Key("key name").Validate(func(in string) string { + if len(in) == 0 { + return "default" + } + return in +}) +``` + +To get value with types: + +```go +// For boolean values: +// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On +// false when value is: 0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off +v, err = cfg.Section("").Key("BOOL").Bool() +v, err = cfg.Section("").Key("FLOAT64").Float64() +v, err = cfg.Section("").Key("INT").Int() +v, err = cfg.Section("").Key("INT64").Int64() +v, err = cfg.Section("").Key("UINT").Uint() +v, err = cfg.Section("").Key("UINT64").Uint64() +v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339) +v, err = cfg.Section("").Key("TIME").Time() // RFC3339 + +v = cfg.Section("").Key("BOOL").MustBool() +v = cfg.Section("").Key("FLOAT64").MustFloat64() +v = cfg.Section("").Key("INT").MustInt() +v = cfg.Section("").Key("INT64").MustInt64() +v = cfg.Section("").Key("UINT").MustUint() +v = cfg.Section("").Key("UINT64").MustUint64() +v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339) +v = cfg.Section("").Key("TIME").MustTime() // RFC3339 + +// Methods start with Must also accept one argument for default value +// when key not found or fail to parse value to given type. +// Except method MustString, which you have to pass a default value. + +v = cfg.Section("").Key("String").MustString("default") +v = cfg.Section("").Key("BOOL").MustBool(true) +v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25) +v = cfg.Section("").Key("INT").MustInt(10) +v = cfg.Section("").Key("INT64").MustInt64(99) +v = cfg.Section("").Key("UINT").MustUint(3) +v = cfg.Section("").Key("UINT64").MustUint64(6) +v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now()) +v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339 +``` + +What if my value is three-line long? + +```ini +[advance] +ADDRESS = """404 road, +NotFound, State, 5000 +Earth""" +``` + +Not a problem! + +```go +cfg.Section("advance").Key("ADDRESS").String() + +/* --- start --- +404 road, +NotFound, State, 5000 +Earth +------ end --- */ +``` + +That's cool, how about continuation lines? + +```ini +[advance] +two_lines = how about \ + continuation lines? +lots_of_lines = 1 \ + 2 \ + 3 \ + 4 +``` + +Piece of cake! + +```go +cfg.Section("advance").Key("two_lines").String() // how about continuation lines? +cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4 +``` + +Note that single quotes around values will be stripped: + +```ini +foo = "some value" // foo: some value +bar = 'some value' // bar: some value +``` + +That's all? Hmm, no. + +#### Helper methods of working with values + +To get value with given candidates: + +```go +v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"}) +v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75}) +v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30}) +v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30}) +v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9}) +v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9}) +v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3}) +v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339 +``` + +Default value will be presented if value of key is not in candidates you given, and default value does not need be one of candidates. + +To validate value in a given range: + +```go +vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2) +vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20) +vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20) +vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9) +vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9) +vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime) +vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339 +``` + +To auto-split value into slice: + +```go +vals = cfg.Section("").Key("STRINGS").Strings(",") +vals = cfg.Section("").Key("FLOAT64S").Float64s(",") +vals = cfg.Section("").Key("INTS").Ints(",") +vals = cfg.Section("").Key("INT64S").Int64s(",") +vals = cfg.Section("").Key("UINTS").Uints(",") +vals = cfg.Section("").Key("UINT64S").Uint64s(",") +vals = cfg.Section("").Key("TIMES").Times(",") +``` + +### Save your configuration + +Finally, it's time to save your configuration to somewhere. + +A typical way to save configuration is writing it to a file: + +```go +// ... +err = cfg.SaveTo("my.ini") +err = cfg.SaveToIndent("my.ini", "\t") +``` + +Another way to save is writing to a `io.Writer` interface: + +```go +// ... +cfg.WriteTo(writer) +cfg.WriteToIndent(writer, "\t") +``` + +## Advanced Usage + +### Recursive Values + +For all value of keys, there is a special syntax `%()s`, where `` is the key name in same section or default section, and `%()s` will be replaced by corresponding value(empty string if key not found). You can use this syntax at most 99 level of recursions. + +```ini +NAME = ini + +[author] +NAME = Unknwon +GITHUB = https://github.com/%(NAME)s + +[package] +FULL_NAME = github.com/go-ini/%(NAME)s +``` + +```go +cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon +cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini +``` + +### Parent-child Sections + +You can use `.` in section name to indicate parent-child relationship between two or more sections. If the key not found in the child section, library will try again on its parent section until there is no parent section. + +```ini +NAME = ini +VERSION = v1 +IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s + +[package] +CLONE_URL = https://%(IMPORT_PATH)s + +[package.sub] +``` + +```go +cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1 +``` + +### Auto-increment Key Names + +If key name is `-` in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter. + +```ini +[features] +-: Support read/write comments of keys and sections +-: Support auto-increment of key names +-: Support load multiple files to overwrite key values +``` + +```go +cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"} +``` + +### Map To Struct + +Want more objective way to play with INI? Cool. + +```ini +Name = Unknwon +age = 21 +Male = true +Born = 1993-01-01T20:17:05Z + +[Note] +Content = Hi is a good man! +Cities = HangZhou, Boston +``` + +```go +type Note struct { + Content string + Cities []string +} + +type Person struct { + Name string + Age int `ini:"age"` + Male bool + Born time.Time + Note + Created time.Time `ini:"-"` +} + +func main() { + cfg, err := ini.Load("path/to/ini") + // ... + p := new(Person) + err = cfg.MapTo(p) + // ... + + // Things can be simpler. + err = ini.MapTo(p, "path/to/ini") + // ... + + // Just map a section? Fine. + n := new(Note) + err = cfg.Section("Note").MapTo(n) + // ... +} +``` + +Can I have default value for field? Absolutely. + +Assign it before you map to struct. It will keep the value as it is if the key is not presented or got wrong type. + +```go +// ... +p := &Person{ + Name: "Joe", +} +// ... +``` + +It's really cool, but what's the point if you can't give me my file back from struct? + +### Reflect From Struct + +Why not? + +```go +type Embeded struct { + Dates []time.Time `delim:"|"` + Places []string + None []int +} + +type Author struct { + Name string `ini:"NAME"` + Male bool + Age int + GPA float64 + NeverMind string `ini:"-"` + *Embeded +} + +func main() { + a := &Author{"Unknwon", true, 21, 2.8, "", + &Embeded{ + []time.Time{time.Now(), time.Now()}, + []string{"HangZhou", "Boston"}, + []int{}, + }} + cfg := ini.Empty() + err = ini.ReflectFrom(cfg, a) + // ... +} +``` + +So, what do I get? + +```ini +NAME = Unknwon +Male = true +Age = 21 +GPA = 2.8 + +[Embeded] +Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00 +Places = HangZhou,Boston +None = +``` + +#### Name Mapper + +To save your time and make your code cleaner, this library supports [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) between struct field and actual section and key name. + +There are 2 built-in name mappers: + +- `AllCapsUnderscore`: it converts to format `ALL_CAPS_UNDERSCORE` then match section or key. +- `TitleUnderscore`: it converts to format `title_underscore` then match section or key. + +To use them: + +```go +type Info struct { + PackageName string +} + +func main() { + err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("packag_name=ini")) + // ... + + cfg, err := ini.Load([]byte("PACKAGE_NAME=ini")) + // ... + info := new(Info) + cfg.NameMapper = ini.AllCapsUnderscore + err = cfg.MapTo(info) + // ... +} +``` + +Same rules of name mapper apply to `ini.ReflectFromWithMapper` function. + +#### Other Notes On Map/Reflect + +Any embedded struct is treated as a section by default, and there is no automatic parent-child relations in map/reflect feature: + +```go +type Child struct { + Age string +} + +type Parent struct { + Name string + Child +} + +type Config struct { + City string + Parent +} +``` + +Example configuration: + +```ini +City = Boston + +[Parent] +Name = Unknwon + +[Child] +Age = 21 +``` + +What if, yes, I'm paranoid, I want embedded struct to be in the same section. Well, all roads lead to Rome. + +```go +type Child struct { + Age string +} + +type Parent struct { + Name string + Child `ini:"Parent"` +} + +type Config struct { + City string + Parent +} +``` + +Example configuration: + +```ini +City = Boston + +[Parent] +Name = Unknwon +Age = 21 +``` + +## Getting Help + +- [API Documentation](https://gowalker.org/gopkg.in/ini.v1) +- [File An Issue](https://github.com/go-ini/ini/issues/new) + +## FAQs + +### What does `BlockMode` field do? + +By default, library lets you read and write values so we need a locker to make sure your data is safe. But in cases that you are very sure about only reading data through the library, you can set `cfg.BlockMode = false` to speed up read operations about **50-70%** faster. + +### Why another INI library? + +Many people are using my another INI library [goconfig](https://github.com/Unknwon/goconfig), so the reason for this one is I would like to make more Go style code. Also when you set `cfg.BlockMode = false`, this one is about **10-30%** faster. + +To make those changes I have to confirm API broken, so it's safer to keep it in another place and start using `gopkg.in` to version my package at this time.(PS: shorter import path) + +## License + +This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md b/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md new file mode 100644 index 00000000000..45e19edddff --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/README_ZH.md @@ -0,0 +1,547 @@ +本包提供了 Go 语言中读写 INI 文件的功能。 + +## 功能特性 + +- 支持覆盖加载多个数据源(`[]byte` 或文件) +- 支持递归读取键值 +- 支持读取父子分区 +- 支持读取自增键名 +- 支持读取多行的键值 +- 支持大量辅助方法 +- 支持在读取时直接转换为 Go 语言类型 +- 支持读取和 **写入** 分区和键的注释 +- 轻松操作分区、键值和注释 +- 在保存文件时分区和键值会保持原有的顺序 + +## 下载安装 + + go get gopkg.in/ini.v1 + +## 开始使用 + +### 从数据源加载 + +一个 **数据源** 可以是 `[]byte` 类型的原始数据,或 `string` 类型的文件路径。您可以加载 **任意多个** 数据源。如果您传递其它类型的数据源,则会直接返回错误。 + +```go +cfg, err := ini.Load([]byte("raw data"), "filename") +``` + +或者从一个空白的文件开始: + +```go +cfg := ini.Empty() +``` + +当您在一开始无法决定需要加载哪些数据源时,仍可以使用 **Append()** 在需要的时候加载它们。 + +```go +err := cfg.Append("other file", []byte("other raw data")) +``` + +### 操作分区(Section) + +获取指定分区: + +```go +section, err := cfg.GetSection("section name") +``` + +如果您想要获取默认分区,则可以用空字符串代替分区名: + +```go +section, err := cfg.GetSection("") +``` + +当您非常确定某个分区是存在的,可以使用以下简便方法: + +```go +section := cfg.Section("") +``` + +如果不小心判断错了,要获取的分区其实是不存在的,那会发生什么呢?没事的,它会自动创建并返回一个对应的分区对象给您。 + +创建一个分区: + +```go +err := cfg.NewSection("new section") +``` + +获取所有分区对象或名称: + +```go +sections := cfg.Sections() +names := cfg.SectionStrings() +``` + +### 操作键(Key) + +获取某个分区下的键: + +```go +key, err := cfg.Section("").GetKey("key name") +``` + +和分区一样,您也可以直接获取键而忽略错误处理: + +```go +key := cfg.Section("").Key("key name") +``` + +创建一个新的键: + +```go +err := cfg.Section("").NewKey("name", "value") +``` + +获取分区下的所有键或键名: + +```go +keys := cfg.Section("").Keys() +names := cfg.Section("").KeyStrings() +``` + +获取分区下的所有键值对的克隆: + +```go +hash := cfg.GetSection("").KeysHash() +``` + +### 操作键值(Value) + +获取一个类型为字符串(string)的值: + +```go +val := cfg.Section("").Key("key name").String() +``` + +获取值的同时通过自定义函数进行处理验证: + +```go +val := cfg.Section("").Key("key name").Validate(func(in string) string { + if len(in) == 0 { + return "default" + } + return in +}) +``` + +获取其它类型的值: + +```go +// 布尔值的规则: +// true 当值为:1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On +// false 当值为:0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off +v, err = cfg.Section("").Key("BOOL").Bool() +v, err = cfg.Section("").Key("FLOAT64").Float64() +v, err = cfg.Section("").Key("INT").Int() +v, err = cfg.Section("").Key("INT64").Int64() +v, err = cfg.Section("").Key("UINT").Uint() +v, err = cfg.Section("").Key("UINT64").Uint64() +v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339) +v, err = cfg.Section("").Key("TIME").Time() // RFC3339 + +v = cfg.Section("").Key("BOOL").MustBool() +v = cfg.Section("").Key("FLOAT64").MustFloat64() +v = cfg.Section("").Key("INT").MustInt() +v = cfg.Section("").Key("INT64").MustInt64() +v = cfg.Section("").Key("UINT").MustUint() +v = cfg.Section("").Key("UINT64").MustUint64() +v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339) +v = cfg.Section("").Key("TIME").MustTime() // RFC3339 + +// 由 Must 开头的方法名允许接收一个相同类型的参数来作为默认值, +// 当键不存在或者转换失败时,则会直接返回该默认值。 +// 但是,MustString 方法必须传递一个默认值。 + +v = cfg.Seciont("").Key("String").MustString("default") +v = cfg.Section("").Key("BOOL").MustBool(true) +v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25) +v = cfg.Section("").Key("INT").MustInt(10) +v = cfg.Section("").Key("INT64").MustInt64(99) +v = cfg.Section("").Key("UINT").MustUint(3) +v = cfg.Section("").Key("UINT64").MustUint64(6) +v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now()) +v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339 +``` + +如果我的值有好多行怎么办? + +```ini +[advance] +ADDRESS = """404 road, +NotFound, State, 5000 +Earth""" +``` + +嗯哼?小 case! + +```go +cfg.Section("advance").Key("ADDRESS").String() + +/* --- start --- +404 road, +NotFound, State, 5000 +Earth +------ end --- */ +``` + +赞爆了!那要是我属于一行的内容写不下想要写到第二行怎么办? + +```ini +[advance] +two_lines = how about \ + continuation lines? +lots_of_lines = 1 \ + 2 \ + 3 \ + 4 +``` + +简直是小菜一碟! + +```go +cfg.Section("advance").Key("two_lines").String() // how about continuation lines? +cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4 +``` + +需要注意的是,值两侧的单引号会被自动剔除: + +```ini +foo = "some value" // foo: some value +bar = 'some value' // bar: some value +``` + +这就是全部了?哈哈,当然不是。 + +#### 操作键值的辅助方法 + +获取键值时设定候选值: + +```go +v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"}) +v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75}) +v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30}) +v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30}) +v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9}) +v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9}) +v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3}) +v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339 +``` + +如果获取到的值不是候选值的任意一个,则会返回默认值,而默认值不需要是候选值中的一员。 + +验证获取的值是否在指定范围内: + +```go +vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2) +vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20) +vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20) +vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9) +vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9) +vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime) +vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339 +``` + +自动分割键值为切片(slice): + +```go +vals = cfg.Section("").Key("STRINGS").Strings(",") +vals = cfg.Section("").Key("FLOAT64S").Float64s(",") +vals = cfg.Section("").Key("INTS").Ints(",") +vals = cfg.Section("").Key("INT64S").Int64s(",") +vals = cfg.Section("").Key("UINTS").Uints(",") +vals = cfg.Section("").Key("UINT64S").Uint64s(",") +vals = cfg.Section("").Key("TIMES").Times(",") +``` + +### 保存配置 + +终于到了这个时刻,是时候保存一下配置了。 + +比较原始的做法是输出配置到某个文件: + +```go +// ... +err = cfg.SaveTo("my.ini") +err = cfg.SaveToIndent("my.ini", "\t") +``` + +另一个比较高级的做法是写入到任何实现 `io.Writer` 接口的对象中: + +```go +// ... +cfg.WriteTo(writer) +cfg.WriteToIndent(writer, "\t") +``` + +### 高级用法 + +#### 递归读取键值 + +在获取所有键值的过程中,特殊语法 `%()s` 会被应用,其中 `` 可以是相同分区或者默认分区下的键名。字符串 `%()s` 会被相应的键值所替代,如果指定的键不存在,则会用空字符串替代。您可以最多使用 99 层的递归嵌套。 + +```ini +NAME = ini + +[author] +NAME = Unknwon +GITHUB = https://github.com/%(NAME)s + +[package] +FULL_NAME = github.com/go-ini/%(NAME)s +``` + +```go +cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon +cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini +``` + +#### 读取父子分区 + +您可以在分区名称中使用 `.` 来表示两个或多个分区之间的父子关系。如果某个键在子分区中不存在,则会去它的父分区中再次寻找,直到没有父分区为止。 + +```ini +NAME = ini +VERSION = v1 +IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s + +[package] +CLONE_URL = https://%(IMPORT_PATH)s + +[package.sub] +``` + +```go +cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1 +``` + +#### 读取自增键名 + +如果数据源中的键名为 `-`,则认为该键使用了自增键名的特殊语法。计数器从 1 开始,并且分区之间是相互独立的。 + +```ini +[features] +-: Support read/write comments of keys and sections +-: Support auto-increment of key names +-: Support load multiple files to overwrite key values +``` + +```go +cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"} +``` + +### 映射到结构 + +想要使用更加面向对象的方式玩转 INI 吗?好主意。 + +```ini +Name = Unknwon +age = 21 +Male = true +Born = 1993-01-01T20:17:05Z + +[Note] +Content = Hi is a good man! +Cities = HangZhou, Boston +``` + +```go +type Note struct { + Content string + Cities []string +} + +type Person struct { + Name string + Age int `ini:"age"` + Male bool + Born time.Time + Note + Created time.Time `ini:"-"` +} + +func main() { + cfg, err := ini.Load("path/to/ini") + // ... + p := new(Person) + err = cfg.MapTo(p) + // ... + + // 一切竟可以如此的简单。 + err = ini.MapTo(p, "path/to/ini") + // ... + + // 嗯哼?只需要映射一个分区吗? + n := new(Note) + err = cfg.Section("Note").MapTo(n) + // ... +} +``` + +结构的字段怎么设置默认值呢?很简单,只要在映射之前对指定字段进行赋值就可以了。如果键未找到或者类型错误,该值不会发生改变。 + +```go +// ... +p := &Person{ + Name: "Joe", +} +// ... +``` + +这样玩 INI 真的好酷啊!然而,如果不能还给我原来的配置文件,有什么卵用? + +### 从结构反射 + +可是,我有说不能吗? + +```go +type Embeded struct { + Dates []time.Time `delim:"|"` + Places []string + None []int +} + +type Author struct { + Name string `ini:"NAME"` + Male bool + Age int + GPA float64 + NeverMind string `ini:"-"` + *Embeded +} + +func main() { + a := &Author{"Unknwon", true, 21, 2.8, "", + &Embeded{ + []time.Time{time.Now(), time.Now()}, + []string{"HangZhou", "Boston"}, + []int{}, + }} + cfg := ini.Empty() + err = ini.ReflectFrom(cfg, a) + // ... +} +``` + +瞧瞧,奇迹发生了。 + +```ini +NAME = Unknwon +Male = true +Age = 21 +GPA = 2.8 + +[Embeded] +Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00 +Places = HangZhou,Boston +None = +``` + +#### 名称映射器(Name Mapper) + +为了节省您的时间并简化代码,本库支持类型为 [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) 的名称映射器,该映射器负责结构字段名与分区名和键名之间的映射。 + +目前有 2 款内置的映射器: + +- `AllCapsUnderscore`:该映射器将字段名转换至格式 `ALL_CAPS_UNDERSCORE` 后再去匹配分区名和键名。 +- `TitleUnderscore`:该映射器将字段名转换至格式 `title_underscore` 后再去匹配分区名和键名。 + +使用方法: + +```go +type Info struct{ + PackageName string +} + +func main() { + err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("packag_name=ini")) + // ... + + cfg, err := ini.Load([]byte("PACKAGE_NAME=ini")) + // ... + info := new(Info) + cfg.NameMapper = ini.AllCapsUnderscore + err = cfg.MapTo(info) + // ... +} +``` + +使用函数 `ini.ReflectFromWithMapper` 时也可应用相同的规则。 + +#### 映射/反射的其它说明 + +任何嵌入的结构都会被默认认作一个不同的分区,并且不会自动产生所谓的父子分区关联: + +```go +type Child struct { + Age string +} + +type Parent struct { + Name string + Child +} + +type Config struct { + City string + Parent +} +``` + +示例配置文件: + +```ini +City = Boston + +[Parent] +Name = Unknwon + +[Child] +Age = 21 +``` + +很好,但是,我就是要嵌入结构也在同一个分区。好吧,你爹是李刚! + +```go +type Child struct { + Age string +} + +type Parent struct { + Name string + Child `ini:"Parent"` +} + +type Config struct { + City string + Parent +} +``` + +示例配置文件: + +```ini +City = Boston + +[Parent] +Name = Unknwon +Age = 21 +``` + +## 获取帮助 + +- [API 文档](https://gowalker.org/gopkg.in/ini.v1) +- [创建工单](https://github.com/go-ini/ini/issues/new) + +## 常见问题 + +### 字段 `BlockMode` 是什么? + +默认情况下,本库会在您进行读写操作时采用锁机制来确保数据时间。但在某些情况下,您非常确定只进行读操作。此时,您可以通过设置 `cfg.BlockMode = false` 来将读操作提升大约 **50-70%** 的性能。 + +### 为什么要写另一个 INI 解析库? + +许多人都在使用我的 [goconfig](https://github.com/Unknwon/goconfig) 来完成对 INI 文件的操作,但我希望使用更加 Go 风格的代码。并且当您设置 `cfg.BlockMode = false` 时,会有大约 **10-30%** 的性能提升。 + +为了做出这些改变,我必须对 API 进行破坏,所以新开一个仓库是最安全的做法。除此之外,本库直接使用 `gopkg.in` 来进行版本化发布。(其实真相是导入路径更短了) diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/ini.go b/Godeps/_workspace/src/github.com/go-ini/ini/ini.go new file mode 100644 index 00000000000..1fee789a1d6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/ini.go @@ -0,0 +1,1226 @@ +// Copyright 2014 Unknwon +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +// Package ini provides INI file read and write functionality in Go. +package ini + +import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" + "os" + "regexp" + "runtime" + "strconv" + "strings" + "sync" + "time" +) + +const ( + DEFAULT_SECTION = "DEFAULT" + // Maximum allowed depth when recursively substituing variable names. + _DEPTH_VALUES = 99 + + _VERSION = "1.6.0" +) + +func Version() string { + return _VERSION +} + +var ( + LineBreak = "\n" + + // Variable regexp pattern: %(variable)s + varPattern = regexp.MustCompile(`%\(([^\)]+)\)s`) + + // Write spaces around "=" to look better. + PrettyFormat = true +) + +func init() { + if runtime.GOOS == "windows" { + LineBreak = "\r\n" + } +} + +func inSlice(str string, s []string) bool { + for _, v := range s { + if str == v { + return true + } + } + return false +} + +// dataSource is a interface that returns file content. +type dataSource interface { + ReadCloser() (io.ReadCloser, error) +} + +type sourceFile struct { + name string +} + +func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) { + return os.Open(s.name) +} + +type bytesReadCloser struct { + reader io.Reader +} + +func (rc *bytesReadCloser) Read(p []byte) (n int, err error) { + return rc.reader.Read(p) +} + +func (rc *bytesReadCloser) Close() error { + return nil +} + +type sourceData struct { + data []byte +} + +func (s *sourceData) ReadCloser() (io.ReadCloser, error) { + return &bytesReadCloser{bytes.NewReader(s.data)}, nil +} + +// ____ __. +// | |/ _|____ ___.__. +// | <_/ __ < | | +// | | \ ___/\___ | +// |____|__ \___ > ____| +// \/ \/\/ + +// Key represents a key under a section. +type Key struct { + s *Section + Comment string + name string + value string + isAutoIncr bool +} + +// Name returns name of key. +func (k *Key) Name() string { + return k.name +} + +// Value returns raw value of key for performance purpose. +func (k *Key) Value() string { + return k.value +} + +// String returns string representation of value. +func (k *Key) String() string { + val := k.value + if strings.Index(val, "%") == -1 { + return val + } + + for i := 0; i < _DEPTH_VALUES; i++ { + vr := varPattern.FindString(val) + if len(vr) == 0 { + break + } + + // Take off leading '%(' and trailing ')s'. + noption := strings.TrimLeft(vr, "%(") + noption = strings.TrimRight(noption, ")s") + + // Search in the same section. + nk, err := k.s.GetKey(noption) + if err != nil { + // Search again in default section. + nk, _ = k.s.f.Section("").GetKey(noption) + } + + // Substitute by new value and take off leading '%(' and trailing ')s'. + val = strings.Replace(val, vr, nk.value, -1) + } + return val +} + +// Validate accepts a validate function which can +// return modifed result as key value. +func (k *Key) Validate(fn func(string) string) string { + return fn(k.String()) +} + +// parseBool returns the boolean value represented by the string. +// +// It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, ON, on, On, +// 0, f, F, FALSE, false, False, NO, no, No, OFF, off, Off. +// Any other value returns an error. +func parseBool(str string) (value bool, err error) { + switch str { + case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "ON", "on", "On": + return true, nil + case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "OFF", "off", "Off": + return false, nil + } + return false, fmt.Errorf("parsing \"%s\": invalid syntax", str) +} + +// Bool returns bool type value. +func (k *Key) Bool() (bool, error) { + return parseBool(k.String()) +} + +// Float64 returns float64 type value. +func (k *Key) Float64() (float64, error) { + return strconv.ParseFloat(k.String(), 64) +} + +// Int returns int type value. +func (k *Key) Int() (int, error) { + return strconv.Atoi(k.String()) +} + +// Int64 returns int64 type value. +func (k *Key) Int64() (int64, error) { + return strconv.ParseInt(k.String(), 10, 64) +} + +// Uint returns uint type valued. +func (k *Key) Uint() (uint, error) { + u, e := strconv.ParseUint(k.String(), 10, 64) + return uint(u), e +} + +// Uint64 returns uint64 type value. +func (k *Key) Uint64() (uint64, error) { + return strconv.ParseUint(k.String(), 10, 64) +} + +// Duration returns time.Duration type value. +func (k *Key) Duration() (time.Duration, error) { + return time.ParseDuration(k.String()) +} + +// TimeFormat parses with given format and returns time.Time type value. +func (k *Key) TimeFormat(format string) (time.Time, error) { + return time.Parse(format, k.String()) +} + +// Time parses with RFC3339 format and returns time.Time type value. +func (k *Key) Time() (time.Time, error) { + return k.TimeFormat(time.RFC3339) +} + +// MustString returns default value if key value is empty. +func (k *Key) MustString(defaultVal string) string { + val := k.String() + if len(val) == 0 { + return defaultVal + } + return val +} + +// MustBool always returns value without error, +// it returns false if error occurs. +func (k *Key) MustBool(defaultVal ...bool) bool { + val, err := k.Bool() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustFloat64 always returns value without error, +// it returns 0.0 if error occurs. +func (k *Key) MustFloat64(defaultVal ...float64) float64 { + val, err := k.Float64() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustInt always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustInt(defaultVal ...int) int { + val, err := k.Int() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustInt64 always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustInt64(defaultVal ...int64) int64 { + val, err := k.Int64() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustUint always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustUint(defaultVal ...uint) uint { + val, err := k.Uint() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustUint64 always returns value without error, +// it returns 0 if error occurs. +func (k *Key) MustUint64(defaultVal ...uint64) uint64 { + val, err := k.Uint64() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustDuration always returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration { + val, err := k.Duration() + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustTimeFormat always parses with given format and returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time { + val, err := k.TimeFormat(format) + if len(defaultVal) > 0 && err != nil { + return defaultVal[0] + } + return val +} + +// MustTime always parses with RFC3339 format and returns value without error, +// it returns zero value if error occurs. +func (k *Key) MustTime(defaultVal ...time.Time) time.Time { + return k.MustTimeFormat(time.RFC3339, defaultVal...) +} + +// In always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) In(defaultVal string, candidates []string) string { + val := k.String() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InFloat64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 { + val := k.MustFloat64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InInt always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InInt(defaultVal int, candidates []int) int { + val := k.MustInt() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InInt64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 { + val := k.MustInt64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InUint always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InUint(defaultVal uint, candidates []uint) uint { + val := k.MustUint() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InUint64 always returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 { + val := k.MustUint64() + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InTimeFormat always parses with given format and returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time { + val := k.MustTimeFormat(format) + for _, cand := range candidates { + if val == cand { + return val + } + } + return defaultVal +} + +// InTime always parses with RFC3339 format and returns value without error, +// it returns default value if error occurs or doesn't fit into candidates. +func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time { + return k.InTimeFormat(time.RFC3339, defaultVal, candidates) +} + +// RangeFloat64 checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 { + val := k.MustFloat64() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeInt checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeInt(defaultVal, min, max int) int { + val := k.MustInt() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeInt64 checks if value is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeInt64(defaultVal, min, max int64) int64 { + val := k.MustInt64() + if val < min || val > max { + return defaultVal + } + return val +} + +// RangeTimeFormat checks if value with given format is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time { + val := k.MustTimeFormat(format) + if val.Unix() < min.Unix() || val.Unix() > max.Unix() { + return defaultVal + } + return val +} + +// RangeTime checks if value with RFC3339 format is in given range inclusively, +// and returns default value if it's not. +func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time { + return k.RangeTimeFormat(time.RFC3339, defaultVal, min, max) +} + +// Strings returns list of string devide by given delimiter. +func (k *Key) Strings(delim string) []string { + str := k.String() + if len(str) == 0 { + return []string{} + } + + vals := strings.Split(str, delim) + for i := range vals { + vals[i] = strings.TrimSpace(vals[i]) + } + return vals +} + +// Float64s returns list of float64 devide by given delimiter. +func (k *Key) Float64s(delim string) []float64 { + strs := k.Strings(delim) + vals := make([]float64, len(strs)) + for i := range strs { + vals[i], _ = strconv.ParseFloat(strs[i], 64) + } + return vals +} + +// Ints returns list of int devide by given delimiter. +func (k *Key) Ints(delim string) []int { + strs := k.Strings(delim) + vals := make([]int, len(strs)) + for i := range strs { + vals[i], _ = strconv.Atoi(strs[i]) + } + return vals +} + +// Int64s returns list of int64 devide by given delimiter. +func (k *Key) Int64s(delim string) []int64 { + strs := k.Strings(delim) + vals := make([]int64, len(strs)) + for i := range strs { + vals[i], _ = strconv.ParseInt(strs[i], 10, 64) + } + return vals +} + +// Uints returns list of uint devide by given delimiter. +func (k *Key) Uints(delim string) []uint { + strs := k.Strings(delim) + vals := make([]uint, len(strs)) + for i := range strs { + u, _ := strconv.ParseUint(strs[i], 10, 64) + vals[i] = uint(u) + } + return vals +} + +// Uint64s returns list of uint64 devide by given delimiter. +func (k *Key) Uint64s(delim string) []uint64 { + strs := k.Strings(delim) + vals := make([]uint64, len(strs)) + for i := range strs { + vals[i], _ = strconv.ParseUint(strs[i], 10, 64) + } + return vals +} + +// TimesFormat parses with given format and returns list of time.Time devide by given delimiter. +func (k *Key) TimesFormat(format, delim string) []time.Time { + strs := k.Strings(delim) + vals := make([]time.Time, len(strs)) + for i := range strs { + vals[i], _ = time.Parse(format, strs[i]) + } + return vals +} + +// Times parses with RFC3339 format and returns list of time.Time devide by given delimiter. +func (k *Key) Times(delim string) []time.Time { + return k.TimesFormat(time.RFC3339, delim) +} + +// SetValue changes key value. +func (k *Key) SetValue(v string) { + k.value = v +} + +// _________ __ .__ +// / _____/ ____ _____/ |_|__| ____ ____ +// \_____ \_/ __ \_/ ___\ __\ |/ _ \ / \ +// / \ ___/\ \___| | | ( <_> ) | \ +// /_______ /\___ >\___ >__| |__|\____/|___| / +// \/ \/ \/ \/ + +// Section represents a config section. +type Section struct { + f *File + Comment string + name string + keys map[string]*Key + keyList []string + keysHash map[string]string +} + +func newSection(f *File, name string) *Section { + return &Section{f, "", name, make(map[string]*Key), make([]string, 0, 10), make(map[string]string)} +} + +// Name returns name of Section. +func (s *Section) Name() string { + return s.name +} + +// NewKey creates a new key to given section. +func (s *Section) NewKey(name, val string) (*Key, error) { + if len(name) == 0 { + return nil, errors.New("error creating new key: empty key name") + } + + if s.f.BlockMode { + s.f.lock.Lock() + defer s.f.lock.Unlock() + } + + if inSlice(name, s.keyList) { + s.keys[name].value = val + return s.keys[name], nil + } + + s.keyList = append(s.keyList, name) + s.keys[name] = &Key{s, "", name, val, false} + s.keysHash[name] = val + return s.keys[name], nil +} + +// GetKey returns key in section by given name. +func (s *Section) GetKey(name string) (*Key, error) { + // FIXME: change to section level lock? + if s.f.BlockMode { + s.f.lock.RLock() + } + key := s.keys[name] + if s.f.BlockMode { + s.f.lock.RUnlock() + } + + if key == nil { + // Check if it is a child-section. + sname := s.name + for { + if i := strings.LastIndex(sname, "."); i > -1 { + sname = sname[:i] + sec, err := s.f.GetSection(sname) + if err != nil { + continue + } + return sec.GetKey(name) + } else { + break + } + } + return nil, fmt.Errorf("error when getting key of section '%s': key '%s' not exists", s.name, name) + } + return key, nil +} + +// Key assumes named Key exists in section and returns a zero-value when not. +func (s *Section) Key(name string) *Key { + key, err := s.GetKey(name) + if err != nil { + // It's OK here because the only possible error is empty key name, + // but if it's empty, this piece of code won't be executed. + key, _ = s.NewKey(name, "") + return key + } + return key +} + +// Keys returns list of keys of section. +func (s *Section) Keys() []*Key { + keys := make([]*Key, len(s.keyList)) + for i := range s.keyList { + keys[i] = s.Key(s.keyList[i]) + } + return keys +} + +// KeyStrings returns list of key names of section. +func (s *Section) KeyStrings() []string { + list := make([]string, len(s.keyList)) + copy(list, s.keyList) + return list +} + +// KeysHash returns keys hash consisting of names and values. +func (s *Section) KeysHash() map[string]string { + if s.f.BlockMode { + s.f.lock.RLock() + defer s.f.lock.RUnlock() + } + + hash := map[string]string{} + for key, value := range s.keysHash { + hash[key] = value + } + return hash +} + +// DeleteKey deletes a key from section. +func (s *Section) DeleteKey(name string) { + if s.f.BlockMode { + s.f.lock.Lock() + defer s.f.lock.Unlock() + } + + for i, k := range s.keyList { + if k == name { + s.keyList = append(s.keyList[:i], s.keyList[i+1:]...) + delete(s.keys, name) + return + } + } +} + +// ___________.__.__ +// \_ _____/|__| | ____ +// | __) | | | _/ __ \ +// | \ | | |_\ ___/ +// \___ / |__|____/\___ > +// \/ \/ + +// File represents a combination of a or more INI file(s) in memory. +type File struct { + // Should make things safe, but sometimes doesn't matter. + BlockMode bool + // Make sure data is safe in multiple goroutines. + lock sync.RWMutex + + // Allow combination of multiple data sources. + dataSources []dataSource + // Actual data is stored here. + sections map[string]*Section + + // To keep data in order. + sectionList []string + + NameMapper +} + +// newFile initializes File object with given data sources. +func newFile(dataSources []dataSource) *File { + return &File{ + BlockMode: true, + dataSources: dataSources, + sections: make(map[string]*Section), + sectionList: make([]string, 0, 10), + } +} + +func parseDataSource(source interface{}) (dataSource, error) { + switch s := source.(type) { + case string: + return sourceFile{s}, nil + case []byte: + return &sourceData{s}, nil + default: + return nil, fmt.Errorf("error parsing data source: unknown type '%s'", s) + } +} + +// Load loads and parses from INI data sources. +// Arguments can be mixed of file name with string type, or raw data in []byte. +func Load(source interface{}, others ...interface{}) (_ *File, err error) { + sources := make([]dataSource, len(others)+1) + sources[0], err = parseDataSource(source) + if err != nil { + return nil, err + } + for i := range others { + sources[i+1], err = parseDataSource(others[i]) + if err != nil { + return nil, err + } + } + f := newFile(sources) + return f, f.Reload() +} + +// Empty returns an empty file object. +func Empty() *File { + // Ignore error here, we sure our data is good. + f, _ := Load([]byte("")) + return f +} + +// NewSection creates a new section. +func (f *File) NewSection(name string) (*Section, error) { + if len(name) == 0 { + return nil, errors.New("error creating new section: empty section name") + } + + if f.BlockMode { + f.lock.Lock() + defer f.lock.Unlock() + } + + if inSlice(name, f.sectionList) { + return f.sections[name], nil + } + + f.sectionList = append(f.sectionList, name) + f.sections[name] = newSection(f, name) + return f.sections[name], nil +} + +// NewSections creates a list of sections. +func (f *File) NewSections(names ...string) (err error) { + for _, name := range names { + if _, err = f.NewSection(name); err != nil { + return err + } + } + return nil +} + +// GetSection returns section by given name. +func (f *File) GetSection(name string) (*Section, error) { + if len(name) == 0 { + name = DEFAULT_SECTION + } + + if f.BlockMode { + f.lock.RLock() + defer f.lock.RUnlock() + } + + sec := f.sections[name] + if sec == nil { + return nil, fmt.Errorf("error when getting section: section '%s' not exists", name) + } + return sec, nil +} + +// Section assumes named section exists and returns a zero-value when not. +func (f *File) Section(name string) *Section { + sec, err := f.GetSection(name) + if err != nil { + // Note: It's OK here because the only possible error is empty section name, + // but if it's empty, this piece of code won't be executed. + sec, _ = f.NewSection(name) + return sec + } + return sec +} + +// Section returns list of Section. +func (f *File) Sections() []*Section { + sections := make([]*Section, len(f.sectionList)) + for i := range f.sectionList { + sections[i] = f.Section(f.sectionList[i]) + } + return sections +} + +// SectionStrings returns list of section names. +func (f *File) SectionStrings() []string { + list := make([]string, len(f.sectionList)) + copy(list, f.sectionList) + return list +} + +// DeleteSection deletes a section. +func (f *File) DeleteSection(name string) { + if f.BlockMode { + f.lock.Lock() + defer f.lock.Unlock() + } + + if len(name) == 0 { + name = DEFAULT_SECTION + } + + for i, s := range f.sectionList { + if s == name { + f.sectionList = append(f.sectionList[:i], f.sectionList[i+1:]...) + delete(f.sections, name) + return + } + } +} + +func cutComment(str string) string { + i := strings.Index(str, "#") + if i == -1 { + return str + } + return str[:i] +} + +func checkMultipleLines(buf *bufio.Reader, line, val, valQuote string) (string, error) { + isEnd := false + for { + next, err := buf.ReadString('\n') + if err != nil { + if err != io.EOF { + return "", err + } + isEnd = true + } + pos := strings.LastIndex(next, valQuote) + if pos > -1 { + val += next[:pos] + break + } + val += next + if isEnd { + return "", fmt.Errorf("error parsing line: missing closing key quote from '%s' to '%s'", line, next) + } + } + return val, nil +} + +func checkContinuationLines(buf *bufio.Reader, val string) (string, bool, error) { + isEnd := false + for { + valLen := len(val) + if valLen == 0 || val[valLen-1] != '\\' { + break + } + val = val[:valLen-1] + + next, err := buf.ReadString('\n') + if err != nil { + if err != io.EOF { + return "", isEnd, err + } + isEnd = true + } + + next = strings.TrimSpace(next) + if len(next) == 0 { + break + } + val += next + } + return val, isEnd, nil +} + +// parse parses data through an io.Reader. +func (f *File) parse(reader io.Reader) error { + buf := bufio.NewReader(reader) + + // Handle BOM-UTF8. + // http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding + mask, err := buf.Peek(3) + if err == nil && len(mask) >= 3 && mask[0] == 239 && mask[1] == 187 && mask[2] == 191 { + buf.Read(mask) + } + + count := 1 + comments := "" + isEnd := false + + section, err := f.NewSection(DEFAULT_SECTION) + if err != nil { + return err + } + + for { + line, err := buf.ReadString('\n') + line = strings.TrimSpace(line) + length := len(line) + + // Check error and ignore io.EOF just for a moment. + if err != nil { + if err != io.EOF { + return fmt.Errorf("error reading next line: %v", err) + } + // The last line of file could be an empty line. + if length == 0 { + break + } + isEnd = true + } + + // Skip empty lines. + if length == 0 { + continue + } + + switch { + case line[0] == '#' || line[0] == ';': // Comments. + if len(comments) == 0 { + comments = line + } else { + comments += LineBreak + line + } + continue + case line[0] == '[' && line[length-1] == ']': // New sction. + section, err = f.NewSection(strings.TrimSpace(line[1 : length-1])) + if err != nil { + return err + } + + if len(comments) > 0 { + section.Comment = comments + comments = "" + } + // Reset counter. + count = 1 + continue + } + + // Other possibilities. + var ( + i int + keyQuote string + kname string + valQuote string + val string + ) + + // Key name surrounded by quotes. + if line[0] == '"' { + if length > 6 && line[0:3] == `"""` { + keyQuote = `"""` + } else { + keyQuote = `"` + } + } else if line[0] == '`' { + keyQuote = "`" + } + if len(keyQuote) > 0 { + qLen := len(keyQuote) + pos := strings.Index(line[qLen:], keyQuote) + if pos == -1 { + return fmt.Errorf("error parsing line: missing closing key quote: %s", line) + } + pos = pos + qLen + i = strings.IndexAny(line[pos:], "=:") + if i < 0 { + return fmt.Errorf("error parsing line: key-value delimiter not found: %s", line) + } else if i == pos { + return fmt.Errorf("error parsing line: key is empty: %s", line) + } + i = i + pos + kname = line[qLen:pos] // Just keep spaces inside quotes. + } else { + i = strings.IndexAny(line, "=:") + if i < 0 { + return fmt.Errorf("error parsing line: key-value delimiter not found: %s", line) + } else if i == 0 { + return fmt.Errorf("error parsing line: key is empty: %s", line) + } + kname = strings.TrimSpace(line[0:i]) + } + + isAutoIncr := false + // Auto increment. + if kname == "-" { + isAutoIncr = true + kname = "#" + fmt.Sprint(count) + count++ + } + + lineRight := strings.TrimSpace(line[i+1:]) + lineRightLength := len(lineRight) + firstChar := "" + if lineRightLength >= 2 { + firstChar = lineRight[0:1] + } + if firstChar == "`" { + valQuote = "`" + } else if firstChar == `"` { + if lineRightLength >= 3 && lineRight[0:3] == `"""` { + valQuote = `"""` + } else { + valQuote = `"` + } + } else if firstChar == `'` { + valQuote = `'` + } + + if len(valQuote) > 0 { + qLen := len(valQuote) + pos := strings.LastIndex(lineRight[qLen:], valQuote) + // For multiple-line value check. + if pos == -1 { + if valQuote == `"` || valQuote == `'` { + return fmt.Errorf("error parsing line: single quote does not allow multiple-line value: %s", line) + } + + val = lineRight[qLen:] + "\n" + val, err = checkMultipleLines(buf, line, val, valQuote) + if err != nil { + return err + } + } else { + val = lineRight[qLen : pos+qLen] + } + } else { + val = strings.TrimSpace(cutComment(lineRight)) + val, isEnd, err = checkContinuationLines(buf, val) + if err != nil { + return err + } + } + + k, err := section.NewKey(kname, val) + if err != nil { + return err + } + k.isAutoIncr = isAutoIncr + if len(comments) > 0 { + k.Comment = comments + comments = "" + } + + if isEnd { + break + } + } + return nil +} + +func (f *File) reload(s dataSource) error { + r, err := s.ReadCloser() + if err != nil { + return err + } + defer r.Close() + + return f.parse(r) +} + +// Reload reloads and parses all data sources. +func (f *File) Reload() (err error) { + for _, s := range f.dataSources { + if err = f.reload(s); err != nil { + return err + } + } + return nil +} + +// Append appends one or more data sources and reloads automatically. +func (f *File) Append(source interface{}, others ...interface{}) error { + ds, err := parseDataSource(source) + if err != nil { + return err + } + f.dataSources = append(f.dataSources, ds) + for _, s := range others { + ds, err = parseDataSource(s) + if err != nil { + return err + } + f.dataSources = append(f.dataSources, ds) + } + return f.Reload() +} + +// WriteToIndent writes file content into io.Writer with given value indention. +func (f *File) WriteToIndent(w io.Writer, indent string) (n int64, err error) { + equalSign := "=" + if PrettyFormat { + equalSign = " = " + } + + // Use buffer to make sure target is safe until finish encoding. + buf := bytes.NewBuffer(nil) + for i, sname := range f.sectionList { + sec := f.Section(sname) + if len(sec.Comment) > 0 { + if sec.Comment[0] != '#' && sec.Comment[0] != ';' { + sec.Comment = "; " + sec.Comment + } + if _, err = buf.WriteString(sec.Comment + LineBreak); err != nil { + return 0, err + } + } + + if i > 0 { + if _, err = buf.WriteString("[" + sname + "]" + LineBreak); err != nil { + return 0, err + } + } else { + // Write nothing if default section is empty. + if len(sec.keyList) == 0 { + continue + } + } + + for _, kname := range sec.keyList { + key := sec.Key(kname) + if len(key.Comment) > 0 { + if len(indent) > 0 && sname != DEFAULT_SECTION { + buf.WriteString(indent) + } + if key.Comment[0] != '#' && key.Comment[0] != ';' { + key.Comment = "; " + key.Comment + } + if _, err = buf.WriteString(key.Comment + LineBreak); err != nil { + return 0, err + } + } + + if len(indent) > 0 && sname != DEFAULT_SECTION { + buf.WriteString(indent) + } + + switch { + case key.isAutoIncr: + kname = "-" + case strings.Contains(kname, "`") || strings.Contains(kname, `"`): + kname = `"""` + kname + `"""` + case strings.Contains(kname, `=`) || strings.Contains(kname, `:`): + kname = "`" + kname + "`" + } + + val := key.value + // In case key value contains "\n", "`" or "\"". + if strings.Contains(val, "\n") || strings.Contains(val, "`") || strings.Contains(val, `"`) || + strings.Contains(val, "#") { + val = `"""` + val + `"""` + } + if _, err = buf.WriteString(kname + equalSign + val + LineBreak); err != nil { + return 0, err + } + } + + // Put a line between sections. + if _, err = buf.WriteString(LineBreak); err != nil { + return 0, err + } + } + + return buf.WriteTo(w) +} + +// WriteTo writes file content into io.Writer. +func (f *File) WriteTo(w io.Writer) (int64, error) { + return f.WriteToIndent(w, "") +} + +// SaveToIndent writes content to file system with given value indention. +func (f *File) SaveToIndent(filename, indent string) error { + // Note: Because we are truncating with os.Create, + // so it's safer to save to a temporary file location and rename afte done. + tmpPath := filename + "." + strconv.Itoa(time.Now().Nanosecond()) + ".tmp" + defer os.Remove(tmpPath) + + fw, err := os.Create(tmpPath) + if err != nil { + return err + } + + if _, err = f.WriteToIndent(fw, indent); err != nil { + fw.Close() + return err + } + fw.Close() + + // Remove old file and rename the new one. + os.Remove(filename) + return os.Rename(tmpPath, filename) +} + +// SaveTo writes content to file system. +func (f *File) SaveTo(filename string) error { + return f.SaveToIndent(filename, "") +} diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go b/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go new file mode 100644 index 00000000000..82ff36dd236 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/ini_test.go @@ -0,0 +1,512 @@ +// Copyright 2014 Unknwon +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +package ini + +import ( + "fmt" + "strings" + "testing" + "time" + + . "github.com/smartystreets/goconvey/convey" +) + +func Test_Version(t *testing.T) { + Convey("Get version", t, func() { + So(Version(), ShouldEqual, _VERSION) + }) +} + +const _CONF_DATA = ` +; Package name +NAME = ini +; Package version +VERSION = v1 +; Package import path +IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s + +# Information about package author +# Bio can be written in multiple lines. +[author] +NAME = Unknwon # Succeeding comment +E-MAIL = fake@localhost +GITHUB = https://github.com/%(NAME)s +BIO = """Gopher. +Coding addict. +Good man. +""" # Succeeding comment + +[package] +CLONE_URL = https://%(IMPORT_PATH)s + +[package.sub] +UNUSED_KEY = should be deleted + +[features] +-: Support read/write comments of keys and sections +-: Support auto-increment of key names +-: Support load multiple files to overwrite key values + +[types] +STRING = str +BOOL = true +BOOL_FALSE = false +FLOAT64 = 1.25 +INT = 10 +TIME = 2015-01-01T20:17:05Z +DURATION = 2h45m +UINT = 3 + +[array] +STRINGS = en, zh, de +FLOAT64S = 1.1, 2.2, 3.3 +INTS = 1, 2, 3 +UINTS = 1, 2, 3 +TIMES = 2015-01-01T20:17:05Z,2015-01-01T20:17:05Z,2015-01-01T20:17:05Z + +[note] +empty_lines = next line is empty\ + +[advance] +value with quotes = "some value" +value quote2 again = 'some value' +true = """"2+3=5"""" +"1+1=2" = true +"""6+1=7""" = true +"""` + "`" + `5+5` + "`" + `""" = 10 +""""6+6"""" = 12 +` + "`" + `7-2=4` + "`" + ` = false +ADDRESS = ` + "`" + `404 road, +NotFound, State, 50000` + "`" + ` + +two_lines = how about \ + continuation lines? +lots_of_lines = 1 \ + 2 \ + 3 \ + 4 \ +` + +func Test_Load(t *testing.T) { + Convey("Load from data sources", t, func() { + + Convey("Load with empty data", func() { + So(Empty(), ShouldNotBeNil) + }) + + Convey("Load with multiple data sources", func() { + cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + }) + }) + + Convey("Bad load process", t, func() { + + Convey("Load from invalid data sources", func() { + _, err := Load(_CONF_DATA) + So(err, ShouldNotBeNil) + + _, err = Load("testdata/404.ini") + So(err, ShouldNotBeNil) + + _, err = Load(1) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(""), 1) + So(err, ShouldNotBeNil) + }) + + Convey("Load with empty section name", func() { + _, err := Load([]byte("[]")) + So(err, ShouldNotBeNil) + }) + + Convey("Load with bad keys", func() { + _, err := Load([]byte(`"""name`)) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(`"""name"""`)) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(`""=1`)) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(`=`)) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(`name`)) + So(err, ShouldNotBeNil) + }) + + Convey("Load with bad values", func() { + _, err := Load([]byte(`name="""Unknwon`)) + So(err, ShouldNotBeNil) + + _, err = Load([]byte(`key = "value`)) + So(err, ShouldNotBeNil) + }) + }) +} + +func Test_Values(t *testing.T) { + Convey("Test getting and setting values", t, func() { + cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + Convey("Get values in default section", func() { + sec := cfg.Section("") + So(sec, ShouldNotBeNil) + So(sec.Key("NAME").Value(), ShouldEqual, "ini") + So(sec.Key("NAME").String(), ShouldEqual, "ini") + So(sec.Key("NAME").Validate(func(in string) string { + return in + }), ShouldEqual, "ini") + So(sec.Key("NAME").Comment, ShouldEqual, "; Package name") + So(sec.Key("IMPORT_PATH").String(), ShouldEqual, "gopkg.in/ini.v1") + }) + + Convey("Get values in non-default section", func() { + sec := cfg.Section("author") + So(sec, ShouldNotBeNil) + So(sec.Key("NAME").String(), ShouldEqual, "Unknwon") + So(sec.Key("GITHUB").String(), ShouldEqual, "https://github.com/Unknwon") + + sec = cfg.Section("package") + So(sec, ShouldNotBeNil) + So(sec.Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1") + }) + + Convey("Get auto-increment key names", func() { + keys := cfg.Section("features").Keys() + for i, k := range keys { + So(k.Name(), ShouldEqual, fmt.Sprintf("#%d", i+1)) + } + }) + + Convey("Get overwrite value", func() { + So(cfg.Section("author").Key("E-MAIL").String(), ShouldEqual, "u@gogs.io") + }) + + Convey("Get sections", func() { + sections := cfg.Sections() + for i, name := range []string{DEFAULT_SECTION, "author", "package", "package.sub", "features", "types", "array", "note", "advance"} { + So(sections[i].Name(), ShouldEqual, name) + } + }) + + Convey("Get parent section value", func() { + So(cfg.Section("package.sub").Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1") + }) + + Convey("Get multiple line value", func() { + So(cfg.Section("author").Key("BIO").String(), ShouldEqual, "Gopher.\nCoding addict.\nGood man.\n") + }) + + Convey("Get values with type", func() { + sec := cfg.Section("types") + v1, err := sec.Key("BOOL").Bool() + So(err, ShouldBeNil) + So(v1, ShouldBeTrue) + + v1, err = sec.Key("BOOL_FALSE").Bool() + So(err, ShouldBeNil) + So(v1, ShouldBeFalse) + + v2, err := sec.Key("FLOAT64").Float64() + So(err, ShouldBeNil) + So(v2, ShouldEqual, 1.25) + + v3, err := sec.Key("INT").Int() + So(err, ShouldBeNil) + So(v3, ShouldEqual, 10) + + v4, err := sec.Key("INT").Int64() + So(err, ShouldBeNil) + So(v4, ShouldEqual, 10) + + v5, err := sec.Key("UINT").Uint() + So(err, ShouldBeNil) + So(v5, ShouldEqual, 3) + + v6, err := sec.Key("UINT").Uint64() + So(err, ShouldBeNil) + So(v6, ShouldEqual, 3) + + t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") + So(err, ShouldBeNil) + v7, err := sec.Key("TIME").Time() + So(err, ShouldBeNil) + So(v7.String(), ShouldEqual, t.String()) + + Convey("Must get values with type", func() { + So(sec.Key("STRING").MustString("404"), ShouldEqual, "str") + So(sec.Key("BOOL").MustBool(), ShouldBeTrue) + So(sec.Key("FLOAT64").MustFloat64(), ShouldEqual, 1.25) + So(sec.Key("INT").MustInt(), ShouldEqual, 10) + So(sec.Key("INT").MustInt64(), ShouldEqual, 10) + So(sec.Key("UINT").MustUint(), ShouldEqual, 3) + So(sec.Key("UINT").MustUint64(), ShouldEqual, 3) + So(sec.Key("TIME").MustTime().String(), ShouldEqual, t.String()) + + dur, err := time.ParseDuration("2h45m") + So(err, ShouldBeNil) + So(sec.Key("DURATION").MustDuration().Seconds(), ShouldEqual, dur.Seconds()) + + Convey("Must get values with default value", func() { + So(sec.Key("STRING_404").MustString("404"), ShouldEqual, "404") + So(sec.Key("BOOL_404").MustBool(true), ShouldBeTrue) + So(sec.Key("FLOAT64_404").MustFloat64(2.5), ShouldEqual, 2.5) + So(sec.Key("INT_404").MustInt(15), ShouldEqual, 15) + So(sec.Key("INT_404").MustInt64(15), ShouldEqual, 15) + So(sec.Key("UINT_404").MustUint(6), ShouldEqual, 6) + So(sec.Key("UINT_404").MustUint64(6), ShouldEqual, 6) + + t, err := time.Parse(time.RFC3339, "2014-01-01T20:17:05Z") + So(err, ShouldBeNil) + So(sec.Key("TIME_404").MustTime(t).String(), ShouldEqual, t.String()) + + So(sec.Key("DURATION_404").MustDuration(dur).Seconds(), ShouldEqual, dur.Seconds()) + }) + }) + }) + + Convey("Get value with candidates", func() { + sec := cfg.Section("types") + So(sec.Key("STRING").In("", []string{"str", "arr", "types"}), ShouldEqual, "str") + So(sec.Key("FLOAT64").InFloat64(0, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25) + So(sec.Key("INT").InInt(0, []int{10, 20, 30}), ShouldEqual, 10) + So(sec.Key("INT").InInt64(0, []int64{10, 20, 30}), ShouldEqual, 10) + So(sec.Key("UINT").InUint(0, []uint{3, 6, 9}), ShouldEqual, 3) + So(sec.Key("UINT").InUint64(0, []uint64{3, 6, 9}), ShouldEqual, 3) + + zt, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z") + So(err, ShouldBeNil) + t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") + So(err, ShouldBeNil) + So(sec.Key("TIME").InTime(zt, []time.Time{t, time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String()) + + Convey("Get value with candidates and default value", func() { + So(sec.Key("STRING_404").In("str", []string{"str", "arr", "types"}), ShouldEqual, "str") + So(sec.Key("FLOAT64_404").InFloat64(1.25, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25) + So(sec.Key("INT_404").InInt(10, []int{10, 20, 30}), ShouldEqual, 10) + So(sec.Key("INT64_404").InInt64(10, []int64{10, 20, 30}), ShouldEqual, 10) + So(sec.Key("UINT_404").InUint(3, []uint{3, 6, 9}), ShouldEqual, 3) + So(sec.Key("UINT_404").InUint64(3, []uint64{3, 6, 9}), ShouldEqual, 3) + So(sec.Key("TIME_404").InTime(t, []time.Time{time.Now(), time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String()) + }) + }) + + Convey("Get values in range", func() { + sec := cfg.Section("types") + So(sec.Key("FLOAT64").RangeFloat64(0, 1, 2), ShouldEqual, 1.25) + So(sec.Key("INT").RangeInt(0, 10, 20), ShouldEqual, 10) + So(sec.Key("INT").RangeInt64(0, 10, 20), ShouldEqual, 10) + + minT, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z") + So(err, ShouldBeNil) + midT, err := time.Parse(time.RFC3339, "2013-01-01T01:00:00Z") + So(err, ShouldBeNil) + maxT, err := time.Parse(time.RFC3339, "9999-01-01T01:00:00Z") + So(err, ShouldBeNil) + t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") + So(err, ShouldBeNil) + So(sec.Key("TIME").RangeTime(t, minT, maxT).String(), ShouldEqual, t.String()) + + Convey("Get value in range with default value", func() { + So(sec.Key("FLOAT64").RangeFloat64(5, 0, 1), ShouldEqual, 5) + So(sec.Key("INT").RangeInt(7, 0, 5), ShouldEqual, 7) + So(sec.Key("INT").RangeInt64(7, 0, 5), ShouldEqual, 7) + So(sec.Key("TIME").RangeTime(t, minT, midT).String(), ShouldEqual, t.String()) + }) + }) + + Convey("Get values into slice", func() { + sec := cfg.Section("array") + So(strings.Join(sec.Key("STRINGS").Strings(","), ","), ShouldEqual, "en,zh,de") + So(len(sec.Key("STRINGS_404").Strings(",")), ShouldEqual, 0) + + vals1 := sec.Key("FLOAT64S").Float64s(",") + for i, v := range []float64{1.1, 2.2, 3.3} { + So(vals1[i], ShouldEqual, v) + } + + vals2 := sec.Key("INTS").Ints(",") + for i, v := range []int{1, 2, 3} { + So(vals2[i], ShouldEqual, v) + } + + vals3 := sec.Key("INTS").Int64s(",") + for i, v := range []int64{1, 2, 3} { + So(vals3[i], ShouldEqual, v) + } + + vals4 := sec.Key("UINTS").Uints(",") + for i, v := range []uint{1, 2, 3} { + So(vals4[i], ShouldEqual, v) + } + + vals5 := sec.Key("UINTS").Uint64s(",") + for i, v := range []uint64{1, 2, 3} { + So(vals5[i], ShouldEqual, v) + } + + t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") + So(err, ShouldBeNil) + vals6 := sec.Key("TIMES").Times(",") + for i, v := range []time.Time{t, t, t} { + So(vals6[i].String(), ShouldEqual, v.String()) + } + }) + + Convey("Get key hash", func() { + cfg.Section("").KeysHash() + }) + + Convey("Set key value", func() { + k := cfg.Section("author").Key("NAME") + k.SetValue("无闻") + So(k.String(), ShouldEqual, "无闻") + }) + + Convey("Get key strings", func() { + So(strings.Join(cfg.Section("types").KeyStrings(), ","), ShouldEqual, "STRING,BOOL,BOOL_FALSE,FLOAT64,INT,TIME,DURATION,UINT") + }) + + Convey("Delete a key", func() { + cfg.Section("package.sub").DeleteKey("UNUSED_KEY") + _, err := cfg.Section("package.sub").GetKey("UNUSED_KEY") + So(err, ShouldNotBeNil) + }) + + Convey("Get section strings", func() { + So(strings.Join(cfg.SectionStrings(), ","), ShouldEqual, "DEFAULT,author,package,package.sub,features,types,array,note,advance") + }) + + Convey("Delete a section", func() { + cfg.DeleteSection("") + So(cfg.SectionStrings()[0], ShouldNotEqual, DEFAULT_SECTION) + }) + + Convey("Create new sections", func() { + cfg.NewSections("test", "test2") + _, err := cfg.GetSection("test") + So(err, ShouldBeNil) + _, err = cfg.GetSection("test2") + So(err, ShouldBeNil) + }) + }) + + Convey("Test getting and setting bad values", t, func() { + cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + Convey("Create new key with empty name", func() { + k, err := cfg.Section("").NewKey("", "") + So(err, ShouldNotBeNil) + So(k, ShouldBeNil) + }) + + Convey("Create new section with empty name", func() { + s, err := cfg.NewSection("") + So(err, ShouldNotBeNil) + So(s, ShouldBeNil) + }) + + Convey("Create new sections with empty name", func() { + So(cfg.NewSections(""), ShouldNotBeNil) + }) + + Convey("Get section that not exists", func() { + s, err := cfg.GetSection("404") + So(err, ShouldNotBeNil) + So(s, ShouldBeNil) + + s = cfg.Section("404") + So(s, ShouldNotBeNil) + }) + }) +} + +func Test_File_Append(t *testing.T) { + Convey("Append data sources", t, func() { + cfg, err := Load([]byte("")) + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + So(cfg.Append([]byte(""), []byte("")), ShouldBeNil) + + Convey("Append bad data sources", func() { + So(cfg.Append(1), ShouldNotBeNil) + So(cfg.Append([]byte(""), 1), ShouldNotBeNil) + }) + }) +} + +func Test_File_SaveTo(t *testing.T) { + Convey("Save file", t, func() { + cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + cfg.Section("").Key("NAME").Comment = "Package name" + cfg.Section("author").Comment = `Information about package author +# Bio can be written in multiple lines.` + cfg.Section("advanced").Key("val w/ pound").SetValue("my#password") + So(cfg.SaveTo("testdata/conf_out.ini"), ShouldBeNil) + + cfg.Section("author").Key("NAME").Comment = "This is author name" + So(cfg.SaveToIndent("testdata/conf_out.ini", "\t"), ShouldBeNil) + }) +} + +func Benchmark_Key_Value(b *testing.B) { + c, _ := Load([]byte(_CONF_DATA)) + for i := 0; i < b.N; i++ { + c.Section("").Key("NAME").Value() + } +} + +func Benchmark_Key_String(b *testing.B) { + c, _ := Load([]byte(_CONF_DATA)) + for i := 0; i < b.N; i++ { + c.Section("").Key("NAME").String() + } +} + +func Benchmark_Key_Value_NonBlock(b *testing.B) { + c, _ := Load([]byte(_CONF_DATA)) + c.BlockMode = false + for i := 0; i < b.N; i++ { + c.Section("").Key("NAME").Value() + } +} + +func Benchmark_Key_String_NonBlock(b *testing.B) { + c, _ := Load([]byte(_CONF_DATA)) + c.BlockMode = false + for i := 0; i < b.N; i++ { + c.Section("").Key("NAME").String() + } +} + +func Benchmark_Key_SetValue(b *testing.B) { + c, _ := Load([]byte(_CONF_DATA)) + for i := 0; i < b.N; i++ { + c.Section("").Key("NAME").SetValue("10") + } +} diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/struct.go b/Godeps/_workspace/src/github.com/go-ini/ini/struct.go new file mode 100644 index 00000000000..c1184371010 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/struct.go @@ -0,0 +1,350 @@ +// Copyright 2014 Unknwon +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +package ini + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "time" + "unicode" +) + +// NameMapper represents a ini tag name mapper. +type NameMapper func(string) string + +// Built-in name getters. +var ( + // AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. + AllCapsUnderscore NameMapper = func(raw string) string { + newstr := make([]rune, 0, len(raw)) + for i, chr := range raw { + if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { + if i > 0 { + newstr = append(newstr, '_') + } + } + newstr = append(newstr, unicode.ToUpper(chr)) + } + return string(newstr) + } + // TitleUnderscore converts to format title_underscore. + TitleUnderscore NameMapper = func(raw string) string { + newstr := make([]rune, 0, len(raw)) + for i, chr := range raw { + if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { + if i > 0 { + newstr = append(newstr, '_') + } + chr -= ('A' - 'a') + } + newstr = append(newstr, chr) + } + return string(newstr) + } +) + +func (s *Section) parseFieldName(raw, actual string) string { + if len(actual) > 0 { + return actual + } + if s.f.NameMapper != nil { + return s.f.NameMapper(raw) + } + return raw +} + +func parseDelim(actual string) string { + if len(actual) > 0 { + return actual + } + return "," +} + +var reflectTime = reflect.TypeOf(time.Now()).Kind() + +// setWithProperType sets proper value to field based on its type, +// but it does not return error for failing parsing, +// because we want to use default value that is already assigned to strcut. +func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error { + switch t.Kind() { + case reflect.String: + if len(key.String()) == 0 { + return nil + } + field.SetString(key.String()) + case reflect.Bool: + boolVal, err := key.Bool() + if err != nil { + return nil + } + field.SetBool(boolVal) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + durationVal, err := key.Duration() + if err == nil { + field.Set(reflect.ValueOf(durationVal)) + return nil + } + + intVal, err := key.Int64() + if err != nil { + return nil + } + field.SetInt(intVal) + // byte is an alias for uint8, so supporting uint8 breaks support for byte + case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: + durationVal, err := key.Duration() + if err == nil { + field.Set(reflect.ValueOf(durationVal)) + return nil + } + + uintVal, err := key.Uint64() + if err != nil { + return nil + } + field.SetUint(uintVal) + + case reflect.Float64: + floatVal, err := key.Float64() + if err != nil { + return nil + } + field.SetFloat(floatVal) + case reflectTime: + timeVal, err := key.Time() + if err != nil { + return nil + } + field.Set(reflect.ValueOf(timeVal)) + case reflect.Slice: + vals := key.Strings(delim) + numVals := len(vals) + if numVals == 0 { + return nil + } + + sliceOf := field.Type().Elem().Kind() + + var times []time.Time + if sliceOf == reflectTime { + times = key.Times(delim) + } + + slice := reflect.MakeSlice(field.Type(), numVals, numVals) + for i := 0; i < numVals; i++ { + switch sliceOf { + case reflectTime: + slice.Index(i).Set(reflect.ValueOf(times[i])) + default: + slice.Index(i).Set(reflect.ValueOf(vals[i])) + } + } + field.Set(slice) + default: + return fmt.Errorf("unsupported type '%s'", t) + } + return nil +} + +func (s *Section) mapTo(val reflect.Value) error { + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + typ := val.Type() + + for i := 0; i < typ.NumField(); i++ { + field := val.Field(i) + tpField := typ.Field(i) + + tag := tpField.Tag.Get("ini") + if tag == "-" { + continue + } + + fieldName := s.parseFieldName(tpField.Name, tag) + if len(fieldName) == 0 || !field.CanSet() { + continue + } + + isAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous + isStruct := tpField.Type.Kind() == reflect.Struct + if isAnonymous { + field.Set(reflect.New(tpField.Type.Elem())) + } + + if isAnonymous || isStruct { + if sec, err := s.f.GetSection(fieldName); err == nil { + if err = sec.mapTo(field); err != nil { + return fmt.Errorf("error mapping field(%s): %v", fieldName, err) + } + continue + } + } + + if key, err := s.GetKey(fieldName); err == nil { + if err = setWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim"))); err != nil { + return fmt.Errorf("error mapping field(%s): %v", fieldName, err) + } + } + } + return nil +} + +// MapTo maps section to given struct. +func (s *Section) MapTo(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return errors.New("cannot map to non-pointer struct") + } + + return s.mapTo(val) +} + +// MapTo maps file to given struct. +func (f *File) MapTo(v interface{}) error { + return f.Section("").MapTo(v) +} + +// MapTo maps data sources to given struct with name mapper. +func MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error { + cfg, err := Load(source, others...) + if err != nil { + return err + } + cfg.NameMapper = mapper + return cfg.MapTo(v) +} + +// MapTo maps data sources to given struct. +func MapTo(v, source interface{}, others ...interface{}) error { + return MapToWithMapper(v, nil, source, others...) +} + +// reflectWithProperType does the opposite thing with setWithProperType. +func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error { + switch t.Kind() { + case reflect.String: + key.SetValue(field.String()) + case reflect.Bool, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float64, + reflectTime: + key.SetValue(fmt.Sprint(field)) + case reflect.Slice: + vals := field.Slice(0, field.Len()) + if field.Len() == 0 { + return nil + } + + var buf bytes.Buffer + isTime := fmt.Sprint(field.Type()) == "[]time.Time" + for i := 0; i < field.Len(); i++ { + if isTime { + buf.WriteString(vals.Index(i).Interface().(time.Time).Format(time.RFC3339)) + } else { + buf.WriteString(fmt.Sprint(vals.Index(i))) + } + buf.WriteString(delim) + } + key.SetValue(buf.String()[:buf.Len()-1]) + default: + return fmt.Errorf("unsupported type '%s'", t) + } + return nil +} + +func (s *Section) reflectFrom(val reflect.Value) error { + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + typ := val.Type() + + for i := 0; i < typ.NumField(); i++ { + field := val.Field(i) + tpField := typ.Field(i) + + tag := tpField.Tag.Get("ini") + if tag == "-" { + continue + } + + fieldName := s.parseFieldName(tpField.Name, tag) + if len(fieldName) == 0 || !field.CanSet() { + continue + } + + if (tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous) || + (tpField.Type.Kind() == reflect.Struct) { + // Note: The only error here is section doesn't exist. + sec, err := s.f.GetSection(fieldName) + if err != nil { + // Note: fieldName can never be empty here, ignore error. + sec, _ = s.f.NewSection(fieldName) + } + if err = sec.reflectFrom(field); err != nil { + return fmt.Errorf("error reflecting field(%s): %v", fieldName, err) + } + continue + } + + // Note: Same reason as secion. + key, err := s.GetKey(fieldName) + if err != nil { + key, _ = s.NewKey(fieldName, "") + } + if err = reflectWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim"))); err != nil { + return fmt.Errorf("error reflecting field(%s): %v", fieldName, err) + } + + } + return nil +} + +// ReflectFrom reflects secion from given struct. +func (s *Section) ReflectFrom(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return errors.New("cannot reflect from non-pointer struct") + } + + return s.reflectFrom(val) +} + +// ReflectFrom reflects file from given struct. +func (f *File) ReflectFrom(v interface{}) error { + return f.Section("").ReflectFrom(v) +} + +// ReflectFrom reflects data sources from given struct with name mapper. +func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error { + cfg.NameMapper = mapper + return cfg.ReflectFrom(v) +} + +// ReflectFrom reflects data sources from given struct. +func ReflectFrom(cfg *File, v interface{}) error { + return ReflectFromWithMapper(cfg, v, nil) +} diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go b/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go new file mode 100644 index 00000000000..d865ad78eb7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/struct_test.go @@ -0,0 +1,239 @@ +// Copyright 2014 Unknwon +// +// Licensed under the Apache License, Version 2.0 (the "License"): you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +package ini + +import ( + "strings" + "testing" + "time" + + . "github.com/smartystreets/goconvey/convey" +) + +type testNested struct { + Cities []string `delim:"|"` + Visits []time.Time + Note string + Unused int `ini:"-"` +} + +type testEmbeded struct { + GPA float64 +} + +type testStruct struct { + Name string `ini:"NAME"` + Age int + Male bool + Money float64 + Born time.Time + Time time.Duration `ini:"Duration"` + Others testNested + *testEmbeded `ini:"grade"` + Unused int `ini:"-"` + Unsigned uint +} + +const _CONF_DATA_STRUCT = ` +NAME = Unknwon +Age = 21 +Male = true +Money = 1.25 +Born = 1993-10-07T20:17:05Z +Duration = 2h45m +Unsigned = 3 + +[Others] +Cities = HangZhou|Boston +Visits = 1993-10-07T20:17:05Z, 1993-10-07T20:17:05Z +Note = Hello world! + +[grade] +GPA = 2.8 + +[foo.bar] +Here = there +When = then +` + +type unsupport struct { + Byte byte +} + +type unsupport2 struct { + Others struct { + Cities byte + } +} + +type unsupport3 struct { + Cities byte +} + +type unsupport4 struct { + *unsupport3 `ini:"Others"` +} + +type defaultValue struct { + Name string + Age int + Male bool + Money float64 + Born time.Time + Cities []string +} + +type fooBar struct { + Here, When string +} + +const _INVALID_DATA_CONF_STRUCT = ` +Name = +Age = age +Male = 123 +Money = money +Born = nil +Cities = +` + +func Test_Struct(t *testing.T) { + Convey("Map to struct", t, func() { + Convey("Map file to struct", func() { + ts := new(testStruct) + So(MapTo(ts, []byte(_CONF_DATA_STRUCT)), ShouldBeNil) + + So(ts.Name, ShouldEqual, "Unknwon") + So(ts.Age, ShouldEqual, 21) + So(ts.Male, ShouldBeTrue) + So(ts.Money, ShouldEqual, 1.25) + So(ts.Unsigned, ShouldEqual, 3) + + t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z") + So(err, ShouldBeNil) + So(ts.Born.String(), ShouldEqual, t.String()) + + dur, err := time.ParseDuration("2h45m") + So(err, ShouldBeNil) + So(ts.Time.Seconds(), ShouldEqual, dur.Seconds()) + + So(strings.Join(ts.Others.Cities, ","), ShouldEqual, "HangZhou,Boston") + So(ts.Others.Visits[0].String(), ShouldEqual, t.String()) + So(ts.Others.Note, ShouldEqual, "Hello world!") + So(ts.testEmbeded.GPA, ShouldEqual, 2.8) + }) + + Convey("Map section to struct", func() { + foobar := new(fooBar) + f, err := Load([]byte(_CONF_DATA_STRUCT)) + So(err, ShouldBeNil) + + So(f.Section("foo.bar").MapTo(foobar), ShouldBeNil) + So(foobar.Here, ShouldEqual, "there") + So(foobar.When, ShouldEqual, "then") + }) + + Convey("Map to non-pointer struct", func() { + cfg, err := Load([]byte(_CONF_DATA_STRUCT)) + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + So(cfg.MapTo(testStruct{}), ShouldNotBeNil) + }) + + Convey("Map to unsupported type", func() { + cfg, err := Load([]byte(_CONF_DATA_STRUCT)) + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + cfg.NameMapper = func(raw string) string { + if raw == "Byte" { + return "NAME" + } + return raw + } + So(cfg.MapTo(&unsupport{}), ShouldNotBeNil) + So(cfg.MapTo(&unsupport2{}), ShouldNotBeNil) + So(cfg.MapTo(&unsupport4{}), ShouldNotBeNil) + }) + + Convey("Map from invalid data source", func() { + So(MapTo(&testStruct{}, "hi"), ShouldNotBeNil) + }) + + Convey("Map to wrong types and gain default values", func() { + cfg, err := Load([]byte(_INVALID_DATA_CONF_STRUCT)) + So(err, ShouldBeNil) + + t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z") + So(err, ShouldBeNil) + dv := &defaultValue{"Joe", 10, true, 1.25, t, []string{"HangZhou", "Boston"}} + So(cfg.MapTo(dv), ShouldBeNil) + So(dv.Name, ShouldEqual, "Joe") + So(dv.Age, ShouldEqual, 10) + So(dv.Male, ShouldBeTrue) + So(dv.Money, ShouldEqual, 1.25) + So(dv.Born.String(), ShouldEqual, t.String()) + So(strings.Join(dv.Cities, ","), ShouldEqual, "HangZhou,Boston") + }) + }) + + Convey("Reflect from struct", t, func() { + type Embeded struct { + Dates []time.Time `delim:"|"` + Places []string + None []int + } + type Author struct { + Name string `ini:"NAME"` + Male bool + Age int + GPA float64 + NeverMind string `ini:"-"` + *Embeded `ini:"infos"` + } + a := &Author{"Unknwon", true, 21, 2.8, "", + &Embeded{ + []time.Time{time.Now(), time.Now()}, + []string{"HangZhou", "Boston"}, + []int{}, + }} + cfg := Empty() + So(ReflectFrom(cfg, a), ShouldBeNil) + cfg.SaveTo("testdata/conf_reflect.ini") + + Convey("Reflect from non-point struct", func() { + So(ReflectFrom(cfg, Author{}), ShouldNotBeNil) + }) + }) +} + +type testMapper struct { + PackageName string +} + +func Test_NameGetter(t *testing.T) { + Convey("Test name mappers", t, func() { + So(MapToWithMapper(&testMapper{}, TitleUnderscore, []byte("packag_name=ini")), ShouldBeNil) + + cfg, err := Load([]byte("PACKAGE_NAME=ini")) + So(err, ShouldBeNil) + So(cfg, ShouldNotBeNil) + + cfg.NameMapper = AllCapsUnderscore + tg := new(testMapper) + So(cfg.MapTo(tg), ShouldBeNil) + So(tg.PackageName, ShouldEqual, "ini") + }) +} diff --git a/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini b/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini new file mode 100644 index 00000000000..2ed0ac1d3ac --- /dev/null +++ b/Godeps/_workspace/src/github.com/go-ini/ini/testdata/conf.ini @@ -0,0 +1,2 @@ +[author] +E-MAIL = u@gogs.io \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore new file mode 100644 index 00000000000..531fcc11c70 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.gitignore @@ -0,0 +1,4 @@ +jpgo +jmespath-fuzz.zip +cpu.out +go-jmespath.test diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml new file mode 100644 index 00000000000..1f98077570d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/.travis.yml @@ -0,0 +1,9 @@ +language: go + +sudo: false + +go: + - 1.4 + +install: go get -v -t ./... +script: make test diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE new file mode 100644 index 00000000000..b03310a91fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE @@ -0,0 +1,13 @@ +Copyright 2015 James Saryerwinnie + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile new file mode 100644 index 00000000000..ad17bf0012e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/Makefile @@ -0,0 +1,44 @@ + +CMD = jpgo + +help: + @echo "Please use \`make ' where is one of" + @echo " test to run all the tests" + @echo " build to build the library and jp executable" + @echo " generate to run codegen" + + +generate: + go generate ./... + +build: + rm -f $(CMD) + go build ./... + rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./... + mv cmd/$(CMD)/$(CMD) . + +test: + go test -v ./... + +check: + go vet ./... + @echo "golint ./..." + @lint=`golint ./...`; \ + lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \ + echo "$$lint"; \ + if [ "$$lint" != "" ]; then exit 1; fi + +htmlc: + go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov + +buildfuzz: + go-fuzz-build github.com/jmespath/go-jmespath/fuzz + +fuzz: buildfuzz + go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/corpus + +bench: + go test -bench . -cpuprofile cpu.out + +pprof-cpu: + go tool pprof ./go-jmespath.test ./cpu.out diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md new file mode 100644 index 00000000000..187ef676dc9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/README.md @@ -0,0 +1,7 @@ +# go-jmespath - A JMESPath implementation in Go + +[![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath) + + + +See http://jmespath.org for more info. diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go new file mode 100644 index 00000000000..67df3fc1c87 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/api.go @@ -0,0 +1,12 @@ +package jmespath + +// Search evaluates a JMESPath expression against input data and returns the result. +func Search(expression string, data interface{}) (interface{}, error) { + intr := newInterpreter() + parser := NewParser() + ast, err := parser.Parse(expression) + if err != nil { + return nil, err + } + return intr.Execute(ast, data) +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go new file mode 100644 index 00000000000..1cd2d239c96 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/astnodetype_string.go @@ -0,0 +1,16 @@ +// generated by stringer -type astNodeType; DO NOT EDIT + +package jmespath + +import "fmt" + +const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" + +var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} + +func (i astNodeType) String() string { + if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { + return fmt.Sprintf("astNodeType(%d)", i) + } + return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json new file mode 100644 index 00000000000..d550e969547 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/basic.json @@ -0,0 +1,96 @@ +[{ + "given": + {"foo": {"bar": {"baz": "correct"}}}, + "cases": [ + { + "expression": "foo", + "result": {"bar": {"baz": "correct"}} + }, + { + "expression": "foo.bar", + "result": {"baz": "correct"} + }, + { + "expression": "foo.bar.baz", + "result": "correct" + }, + { + "expression": "foo\n.\nbar\n.baz", + "result": "correct" + }, + { + "expression": "foo.bar.baz.bad", + "result": null + }, + { + "expression": "foo.bar.bad", + "result": null + }, + { + "expression": "foo.bad", + "result": null + }, + { + "expression": "bad", + "result": null + }, + { + "expression": "bad.morebad.morebad", + "result": null + } + ] +}, +{ + "given": + {"foo": {"bar": ["one", "two", "three"]}}, + "cases": [ + { + "expression": "foo", + "result": {"bar": ["one", "two", "three"]} + }, + { + "expression": "foo.bar", + "result": ["one", "two", "three"] + } + ] +}, +{ + "given": ["one", "two", "three"], + "cases": [ + { + "expression": "one", + "result": null + }, + { + "expression": "two", + "result": null + }, + { + "expression": "three", + "result": null + }, + { + "expression": "one.two", + "result": null + } + ] +}, +{ + "given": + {"foo": {"1": ["one", "two", "three"], "-1": "bar"}}, + "cases": [ + { + "expression": "foo.\"1\"", + "result": ["one", "two", "three"] + }, + { + "expression": "foo.\"1\"[0]", + "result": "one" + }, + { + "expression": "foo.\"-1\"", + "result": "bar" + } + ] +} +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json new file mode 100644 index 00000000000..e3fa196b14f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/boolean.json @@ -0,0 +1,257 @@ +[ + { + "given": { + "outer": { + "foo": "foo", + "bar": "bar", + "baz": "baz" + } + }, + "cases": [ + { + "expression": "outer.foo || outer.bar", + "result": "foo" + }, + { + "expression": "outer.foo||outer.bar", + "result": "foo" + }, + { + "expression": "outer.bar || outer.baz", + "result": "bar" + }, + { + "expression": "outer.bar||outer.baz", + "result": "bar" + }, + { + "expression": "outer.bad || outer.foo", + "result": "foo" + }, + { + "expression": "outer.bad||outer.foo", + "result": "foo" + }, + { + "expression": "outer.foo || outer.bad", + "result": "foo" + }, + { + "expression": "outer.foo||outer.bad", + "result": "foo" + }, + { + "expression": "outer.bad || outer.alsobad", + "result": null + }, + { + "expression": "outer.bad||outer.alsobad", + "result": null + } + ] + }, + { + "given": { + "outer": { + "foo": "foo", + "bool": false, + "empty_list": [], + "empty_string": "" + } + }, + "cases": [ + { + "expression": "outer.empty_string || outer.foo", + "result": "foo" + }, + { + "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo", + "result": "foo" + } + ] + }, + { + "given": { + "True": true, + "False": false, + "Number": 5, + "EmptyList": [], + "Zero": 0 + }, + "cases": [ + { + "expression": "True && False", + "result": false + }, + { + "expression": "False && True", + "result": false + }, + { + "expression": "True && True", + "result": true + }, + { + "expression": "False && False", + "result": false + }, + { + "expression": "True && Number", + "result": 5 + }, + { + "expression": "Number && True", + "result": true + }, + { + "expression": "Number && False", + "result": false + }, + { + "expression": "Number && EmptyList", + "result": [] + }, + { + "expression": "Number && True", + "result": true + }, + { + "expression": "EmptyList && True", + "result": [] + }, + { + "expression": "EmptyList && False", + "result": [] + }, + { + "expression": "True || False", + "result": true + }, + { + "expression": "True || True", + "result": true + }, + { + "expression": "False || True", + "result": true + }, + { + "expression": "False || False", + "result": false + }, + { + "expression": "Number || EmptyList", + "result": 5 + }, + { + "expression": "Number || True", + "result": 5 + }, + { + "expression": "Number || True && False", + "result": 5 + }, + { + "expression": "(Number || True) && False", + "result": false + }, + { + "expression": "Number || (True && False)", + "result": 5 + }, + { + "expression": "!True", + "result": false + }, + { + "expression": "!False", + "result": true + }, + { + "expression": "!Number", + "result": false + }, + { + "expression": "!EmptyList", + "result": true + }, + { + "expression": "True && !False", + "result": true + }, + { + "expression": "True && !EmptyList", + "result": true + }, + { + "expression": "!False && !EmptyList", + "result": true + }, + { + "expression": "!(True && False)", + "result": true + }, + { + "expression": "!Zero", + "result": false + }, + { + "expression": "!!Zero", + "result": true + } + ] + }, + { + "given": { + "one": 1, + "two": 2, + "three": 3 + }, + "cases": [ + { + "expression": "one < two", + "result": true + }, + { + "expression": "one <= two", + "result": true + }, + { + "expression": "one == one", + "result": true + }, + { + "expression": "one == two", + "result": false + }, + { + "expression": "one > two", + "result": false + }, + { + "expression": "one >= two", + "result": false + }, + { + "expression": "one != two", + "result": true + }, + { + "expression": "one < two && three > one", + "result": true + }, + { + "expression": "one < two || three > one", + "result": true + }, + { + "expression": "one < two || three < one", + "result": true + }, + { + "expression": "two < one || three < one", + "result": false + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json new file mode 100644 index 00000000000..0c26248d079 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/current.json @@ -0,0 +1,25 @@ +[ + { + "given": { + "foo": [{"name": "a"}, {"name": "b"}], + "bar": {"baz": "qux"} + }, + "cases": [ + { + "expression": "@", + "result": { + "foo": [{"name": "a"}, {"name": "b"}], + "bar": {"baz": "qux"} + } + }, + { + "expression": "@.bar", + "result": {"baz": "qux"} + }, + { + "expression": "@.foo[0]", + "result": {"name": "a"} + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json new file mode 100644 index 00000000000..4a62d951a65 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/escape.json @@ -0,0 +1,46 @@ +[{ + "given": { + "foo.bar": "dot", + "foo bar": "space", + "foo\nbar": "newline", + "foo\"bar": "doublequote", + "c:\\\\windows\\path": "windows", + "/unix/path": "unix", + "\"\"\"": "threequotes", + "bar": {"baz": "qux"} + }, + "cases": [ + { + "expression": "\"foo.bar\"", + "result": "dot" + }, + { + "expression": "\"foo bar\"", + "result": "space" + }, + { + "expression": "\"foo\\nbar\"", + "result": "newline" + }, + { + "expression": "\"foo\\\"bar\"", + "result": "doublequote" + }, + { + "expression": "\"c:\\\\\\\\windows\\\\path\"", + "result": "windows" + }, + { + "expression": "\"/unix/path\"", + "result": "unix" + }, + { + "expression": "\"\\\"\\\"\\\"\"", + "result": "threequotes" + }, + { + "expression": "\"bar\".\"baz\"", + "result": "qux" + } + ] +}] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json new file mode 100644 index 00000000000..5b9f52b1159 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/filters.json @@ -0,0 +1,468 @@ +[ + { + "given": {"foo": [{"name": "a"}, {"name": "b"}]}, + "cases": [ + { + "comment": "Matching a literal", + "expression": "foo[?name == 'a']", + "result": [{"name": "a"}] + } + ] + }, + { + "given": {"foo": [0, 1], "bar": [2, 3]}, + "cases": [ + { + "comment": "Matching a literal", + "expression": "*[?[0] == `0`]", + "result": [[], []] + } + ] + }, + { + "given": {"foo": [{"first": "foo", "last": "bar"}, + {"first": "foo", "last": "foo"}, + {"first": "foo", "last": "baz"}]}, + "cases": [ + { + "comment": "Matching an expression", + "expression": "foo[?first == last]", + "result": [{"first": "foo", "last": "foo"}] + }, + { + "comment": "Verify projection created from filter", + "expression": "foo[?first == last].first", + "result": ["foo"] + } + ] + }, + { + "given": {"foo": [{"age": 20}, + {"age": 25}, + {"age": 30}]}, + "cases": [ + { + "comment": "Greater than with a number", + "expression": "foo[?age > `25`]", + "result": [{"age": 30}] + }, + { + "expression": "foo[?age >= `25`]", + "result": [{"age": 25}, {"age": 30}] + }, + { + "comment": "Greater than with a number", + "expression": "foo[?age > `30`]", + "result": [] + }, + { + "comment": "Greater than with a number", + "expression": "foo[?age < `25`]", + "result": [{"age": 20}] + }, + { + "comment": "Greater than with a number", + "expression": "foo[?age <= `25`]", + "result": [{"age": 20}, {"age": 25}] + }, + { + "comment": "Greater than with a number", + "expression": "foo[?age < `20`]", + "result": [] + }, + { + "expression": "foo[?age == `20`]", + "result": [{"age": 20}] + }, + { + "expression": "foo[?age != `20`]", + "result": [{"age": 25}, {"age": 30}] + } + ] + }, + { + "given": {"foo": [{"top": {"name": "a"}}, + {"top": {"name": "b"}}]}, + "cases": [ + { + "comment": "Filter with subexpression", + "expression": "foo[?top.name == 'a']", + "result": [{"top": {"name": "a"}}] + } + ] + }, + { + "given": {"foo": [{"top": {"first": "foo", "last": "bar"}}, + {"top": {"first": "foo", "last": "foo"}}, + {"top": {"first": "foo", "last": "baz"}}]}, + "cases": [ + { + "comment": "Matching an expression", + "expression": "foo[?top.first == top.last]", + "result": [{"top": {"first": "foo", "last": "foo"}}] + }, + { + "comment": "Matching a JSON array", + "expression": "foo[?top == `{\"first\": \"foo\", \"last\": \"bar\"}`]", + "result": [{"top": {"first": "foo", "last": "bar"}}] + } + ] + }, + { + "given": {"foo": [ + {"key": true}, + {"key": false}, + {"key": 0}, + {"key": 1}, + {"key": [0]}, + {"key": {"bar": [0]}}, + {"key": null}, + {"key": [1]}, + {"key": {"a":2}} + ]}, + "cases": [ + { + "expression": "foo[?key == `true`]", + "result": [{"key": true}] + }, + { + "expression": "foo[?key == `false`]", + "result": [{"key": false}] + }, + { + "expression": "foo[?key == `0`]", + "result": [{"key": 0}] + }, + { + "expression": "foo[?key == `1`]", + "result": [{"key": 1}] + }, + { + "expression": "foo[?key == `[0]`]", + "result": [{"key": [0]}] + }, + { + "expression": "foo[?key == `{\"bar\": [0]}`]", + "result": [{"key": {"bar": [0]}}] + }, + { + "expression": "foo[?key == `null`]", + "result": [{"key": null}] + }, + { + "expression": "foo[?key == `[1]`]", + "result": [{"key": [1]}] + }, + { + "expression": "foo[?key == `{\"a\":2}`]", + "result": [{"key": {"a":2}}] + }, + { + "expression": "foo[?`true` == key]", + "result": [{"key": true}] + }, + { + "expression": "foo[?`false` == key]", + "result": [{"key": false}] + }, + { + "expression": "foo[?`0` == key]", + "result": [{"key": 0}] + }, + { + "expression": "foo[?`1` == key]", + "result": [{"key": 1}] + }, + { + "expression": "foo[?`[0]` == key]", + "result": [{"key": [0]}] + }, + { + "expression": "foo[?`{\"bar\": [0]}` == key]", + "result": [{"key": {"bar": [0]}}] + }, + { + "expression": "foo[?`null` == key]", + "result": [{"key": null}] + }, + { + "expression": "foo[?`[1]` == key]", + "result": [{"key": [1]}] + }, + { + "expression": "foo[?`{\"a\":2}` == key]", + "result": [{"key": {"a":2}}] + }, + { + "expression": "foo[?key != `true`]", + "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `false`]", + "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `0`]", + "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `1`]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `null`]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `[1]`]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}] + }, + { + "expression": "foo[?key != `{\"a\":2}`]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}] + }, + { + "expression": "foo[?`true` != key]", + "result": [{"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`false` != key]", + "result": [{"key": true}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`0` != key]", + "result": [{"key": true}, {"key": false}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`1` != key]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`null` != key]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": [1]}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`[1]` != key]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": {"a":2}}] + }, + { + "expression": "foo[?`{\"a\":2}` != key]", + "result": [{"key": true}, {"key": false}, {"key": 0}, {"key": 1}, {"key": [0]}, + {"key": {"bar": [0]}}, {"key": null}, {"key": [1]}] + } + ] + }, + { + "given": {"reservations": [ + {"instances": [ + {"foo": 1, "bar": 2}, {"foo": 1, "bar": 3}, + {"foo": 1, "bar": 2}, {"foo": 2, "bar": 1}]}]}, + "cases": [ + { + "expression": "reservations[].instances[?bar==`1`]", + "result": [[{"foo": 2, "bar": 1}]] + }, + { + "expression": "reservations[*].instances[?bar==`1`]", + "result": [[{"foo": 2, "bar": 1}]] + }, + { + "expression": "reservations[].instances[?bar==`1`][]", + "result": [{"foo": 2, "bar": 1}] + } + ] + }, + { + "given": { + "baz": "other", + "foo": [ + {"bar": 1}, {"bar": 2}, {"bar": 3}, {"bar": 4}, {"bar": 1, "baz": 2} + ] + }, + "cases": [ + { + "expression": "foo[?bar==`1`].bar[0]", + "result": [] + } + ] + }, + { + "given": { + "foo": [ + {"a": 1, "b": {"c": "x"}}, + {"a": 1, "b": {"c": "y"}}, + {"a": 1, "b": {"c": "z"}}, + {"a": 2, "b": {"c": "z"}}, + {"a": 1, "baz": 2} + ] + }, + "cases": [ + { + "expression": "foo[?a==`1`].b.c", + "result": ["x", "y", "z"] + } + ] + }, + { + "given": {"foo": [{"name": "a"}, {"name": "b"}, {"name": "c"}]}, + "cases": [ + { + "comment": "Filter with or expression", + "expression": "foo[?name == 'a' || name == 'b']", + "result": [{"name": "a"}, {"name": "b"}] + }, + { + "expression": "foo[?name == 'a' || name == 'e']", + "result": [{"name": "a"}] + }, + { + "expression": "foo[?name == 'a' || name == 'b' || name == 'c']", + "result": [{"name": "a"}, {"name": "b"}, {"name": "c"}] + } + ] + }, + { + "given": {"foo": [{"a": 1, "b": 2}, {"a": 1, "b": 3}]}, + "cases": [ + { + "comment": "Filter with and expression", + "expression": "foo[?a == `1` && b == `2`]", + "result": [{"a": 1, "b": 2}] + }, + { + "expression": "foo[?a == `1` && b == `4`]", + "result": [] + } + ] + }, + { + "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]}, + "cases": [ + { + "comment": "Filter with Or and And expressions", + "expression": "foo[?c == `3` || a == `1` && b == `4`]", + "result": [{"a": 1, "b": 2, "c": 3}] + }, + { + "expression": "foo[?b == `2` || a == `3` && b == `4`]", + "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] + }, + { + "expression": "foo[?a == `3` && b == `4` || b == `2`]", + "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] + }, + { + "expression": "foo[?(a == `3` && b == `4`) || b == `2`]", + "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] + }, + { + "expression": "foo[?((a == `3` && b == `4`)) || b == `2`]", + "result": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}] + }, + { + "expression": "foo[?a == `3` && (b == `4` || b == `2`)]", + "result": [{"a": 3, "b": 4}] + }, + { + "expression": "foo[?a == `3` && ((b == `4` || b == `2`))]", + "result": [{"a": 3, "b": 4}] + } + ] + }, + { + "given": {"foo": [{"a": 1, "b": 2, "c": 3}, {"a": 3, "b": 4}]}, + "cases": [ + { + "comment": "Verify precedence of or/and expressions", + "expression": "foo[?a == `1` || b ==`2` && c == `5`]", + "result": [{"a": 1, "b": 2, "c": 3}] + }, + { + "comment": "Parentheses can alter precedence", + "expression": "foo[?(a == `1` || b ==`2`) && c == `5`]", + "result": [] + }, + { + "comment": "Not expressions combined with and/or", + "expression": "foo[?!(a == `1` || b ==`2`)]", + "result": [{"a": 3, "b": 4}] + } + ] + }, + { + "given": { + "foo": [ + {"key": true}, + {"key": false}, + {"key": []}, + {"key": {}}, + {"key": [0]}, + {"key": {"a": "b"}}, + {"key": 0}, + {"key": 1}, + {"key": null}, + {"notkey": true} + ] + }, + "cases": [ + { + "comment": "Unary filter expression", + "expression": "foo[?key]", + "result": [ + {"key": true}, {"key": [0]}, {"key": {"a": "b"}}, + {"key": 0}, {"key": 1} + ] + }, + { + "comment": "Unary not filter expression", + "expression": "foo[?!key]", + "result": [ + {"key": false}, {"key": []}, {"key": {}}, + {"key": null}, {"notkey": true} + ] + }, + { + "comment": "Equality with null RHS", + "expression": "foo[?key == `null`]", + "result": [ + {"key": null}, {"notkey": true} + ] + } + ] + }, + { + "given": { + "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + "cases": [ + { + "comment": "Using @ in a filter expression", + "expression": "foo[?@ < `5`]", + "result": [0, 1, 2, 3, 4] + }, + { + "comment": "Using @ in a filter expression", + "expression": "foo[?`5` > @]", + "result": [0, 1, 2, 3, 4] + }, + { + "comment": "Using @ in a filter expression", + "expression": "foo[?@ == @]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json new file mode 100644 index 00000000000..8b8db363a2b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/functions.json @@ -0,0 +1,825 @@ +[{ + "given": + { + "foo": -1, + "zero": 0, + "numbers": [-1, 3, 4, 5], + "array": [-1, 3, 4, 5, "a", "100"], + "strings": ["a", "b", "c"], + "decimals": [1.01, 1.2, -1.5], + "str": "Str", + "false": false, + "empty_list": [], + "empty_hash": {}, + "objects": {"foo": "bar", "bar": "baz"}, + "null_key": null + }, + "cases": [ + { + "expression": "abs(foo)", + "result": 1 + }, + { + "expression": "abs(foo)", + "result": 1 + }, + { + "expression": "abs(str)", + "error": "invalid-type" + }, + { + "expression": "abs(array[1])", + "result": 3 + }, + { + "expression": "abs(array[1])", + "result": 3 + }, + { + "expression": "abs(`false`)", + "error": "invalid-type" + }, + { + "expression": "abs(`-24`)", + "result": 24 + }, + { + "expression": "abs(`-24`)", + "result": 24 + }, + { + "expression": "abs(`1`, `2`)", + "error": "invalid-arity" + }, + { + "expression": "abs()", + "error": "invalid-arity" + }, + { + "expression": "unknown_function(`1`, `2`)", + "error": "unknown-function" + }, + { + "expression": "avg(numbers)", + "result": 2.75 + }, + { + "expression": "avg(array)", + "error": "invalid-type" + }, + { + "expression": "avg('abc')", + "error": "invalid-type" + }, + { + "expression": "avg(foo)", + "error": "invalid-type" + }, + { + "expression": "avg(@)", + "error": "invalid-type" + }, + { + "expression": "avg(strings)", + "error": "invalid-type" + }, + { + "expression": "ceil(`1.2`)", + "result": 2 + }, + { + "expression": "ceil(decimals[0])", + "result": 2 + }, + { + "expression": "ceil(decimals[1])", + "result": 2 + }, + { + "expression": "ceil(decimals[2])", + "result": -1 + }, + { + "expression": "ceil('string')", + "error": "invalid-type" + }, + { + "expression": "contains('abc', 'a')", + "result": true + }, + { + "expression": "contains('abc', 'd')", + "result": false + }, + { + "expression": "contains(`false`, 'd')", + "error": "invalid-type" + }, + { + "expression": "contains(strings, 'a')", + "result": true + }, + { + "expression": "contains(decimals, `1.2`)", + "result": true + }, + { + "expression": "contains(decimals, `false`)", + "result": false + }, + { + "expression": "ends_with(str, 'r')", + "result": true + }, + { + "expression": "ends_with(str, 'tr')", + "result": true + }, + { + "expression": "ends_with(str, 'Str')", + "result": true + }, + { + "expression": "ends_with(str, 'SStr')", + "result": false + }, + { + "expression": "ends_with(str, 'foo')", + "result": false + }, + { + "expression": "ends_with(str, `0`)", + "error": "invalid-type" + }, + { + "expression": "floor(`1.2`)", + "result": 1 + }, + { + "expression": "floor('string')", + "error": "invalid-type" + }, + { + "expression": "floor(decimals[0])", + "result": 1 + }, + { + "expression": "floor(foo)", + "result": -1 + }, + { + "expression": "floor(str)", + "error": "invalid-type" + }, + { + "expression": "length('abc')", + "result": 3 + }, + { + "expression": "length('✓foo')", + "result": 4 + }, + { + "expression": "length('')", + "result": 0 + }, + { + "expression": "length(@)", + "result": 12 + }, + { + "expression": "length(strings[0])", + "result": 1 + }, + { + "expression": "length(str)", + "result": 3 + }, + { + "expression": "length(array)", + "result": 6 + }, + { + "expression": "length(objects)", + "result": 2 + }, + { + "expression": "length(`false`)", + "error": "invalid-type" + }, + { + "expression": "length(foo)", + "error": "invalid-type" + }, + { + "expression": "length(strings[0])", + "result": 1 + }, + { + "expression": "max(numbers)", + "result": 5 + }, + { + "expression": "max(decimals)", + "result": 1.2 + }, + { + "expression": "max(strings)", + "result": "c" + }, + { + "expression": "max(abc)", + "error": "invalid-type" + }, + { + "expression": "max(array)", + "error": "invalid-type" + }, + { + "expression": "max(decimals)", + "result": 1.2 + }, + { + "expression": "max(empty_list)", + "result": null + }, + { + "expression": "merge(`{}`)", + "result": {} + }, + { + "expression": "merge(`{}`, `{}`)", + "result": {} + }, + { + "expression": "merge(`{\"a\": 1}`, `{\"b\": 2}`)", + "result": {"a": 1, "b": 2} + }, + { + "expression": "merge(`{\"a\": 1}`, `{\"a\": 2}`)", + "result": {"a": 2} + }, + { + "expression": "merge(`{\"a\": 1, \"b\": 2}`, `{\"a\": 2, \"c\": 3}`, `{\"d\": 4}`)", + "result": {"a": 2, "b": 2, "c": 3, "d": 4} + }, + { + "expression": "min(numbers)", + "result": -1 + }, + { + "expression": "min(decimals)", + "result": -1.5 + }, + { + "expression": "min(abc)", + "error": "invalid-type" + }, + { + "expression": "min(array)", + "error": "invalid-type" + }, + { + "expression": "min(empty_list)", + "result": null + }, + { + "expression": "min(decimals)", + "result": -1.5 + }, + { + "expression": "min(strings)", + "result": "a" + }, + { + "expression": "type('abc')", + "result": "string" + }, + { + "expression": "type(`1.0`)", + "result": "number" + }, + { + "expression": "type(`2`)", + "result": "number" + }, + { + "expression": "type(`true`)", + "result": "boolean" + }, + { + "expression": "type(`false`)", + "result": "boolean" + }, + { + "expression": "type(`null`)", + "result": "null" + }, + { + "expression": "type(`[0]`)", + "result": "array" + }, + { + "expression": "type(`{\"a\": \"b\"}`)", + "result": "object" + }, + { + "expression": "type(@)", + "result": "object" + }, + { + "expression": "sort(keys(objects))", + "result": ["bar", "foo"] + }, + { + "expression": "keys(foo)", + "error": "invalid-type" + }, + { + "expression": "keys(strings)", + "error": "invalid-type" + }, + { + "expression": "keys(`false`)", + "error": "invalid-type" + }, + { + "expression": "sort(values(objects))", + "result": ["bar", "baz"] + }, + { + "expression": "keys(empty_hash)", + "result": [] + }, + { + "expression": "values(foo)", + "error": "invalid-type" + }, + { + "expression": "join(', ', strings)", + "result": "a, b, c" + }, + { + "expression": "join(', ', strings)", + "result": "a, b, c" + }, + { + "expression": "join(',', `[\"a\", \"b\"]`)", + "result": "a,b" + }, + { + "expression": "join(',', `[\"a\", 0]`)", + "error": "invalid-type" + }, + { + "expression": "join(', ', str)", + "error": "invalid-type" + }, + { + "expression": "join('|', strings)", + "result": "a|b|c" + }, + { + "expression": "join(`2`, strings)", + "error": "invalid-type" + }, + { + "expression": "join('|', decimals)", + "error": "invalid-type" + }, + { + "expression": "join('|', decimals[].to_string(@))", + "result": "1.01|1.2|-1.5" + }, + { + "expression": "join('|', empty_list)", + "result": "" + }, + { + "expression": "reverse(numbers)", + "result": [5, 4, 3, -1] + }, + { + "expression": "reverse(array)", + "result": ["100", "a", 5, 4, 3, -1] + }, + { + "expression": "reverse(`[]`)", + "result": [] + }, + { + "expression": "reverse('')", + "result": "" + }, + { + "expression": "reverse('hello world')", + "result": "dlrow olleh" + }, + { + "expression": "starts_with(str, 'S')", + "result": true + }, + { + "expression": "starts_with(str, 'St')", + "result": true + }, + { + "expression": "starts_with(str, 'Str')", + "result": true + }, + { + "expression": "starts_with(str, 'String')", + "result": false + }, + { + "expression": "starts_with(str, `0`)", + "error": "invalid-type" + }, + { + "expression": "sum(numbers)", + "result": 11 + }, + { + "expression": "sum(decimals)", + "result": 0.71 + }, + { + "expression": "sum(array)", + "error": "invalid-type" + }, + { + "expression": "sum(array[].to_number(@))", + "result": 111 + }, + { + "expression": "sum(`[]`)", + "result": 0 + }, + { + "expression": "to_array('foo')", + "result": ["foo"] + }, + { + "expression": "to_array(`0`)", + "result": [0] + }, + { + "expression": "to_array(objects)", + "result": [{"foo": "bar", "bar": "baz"}] + }, + { + "expression": "to_array(`[1, 2, 3]`)", + "result": [1, 2, 3] + }, + { + "expression": "to_array(false)", + "result": [false] + }, + { + "expression": "to_string('foo')", + "result": "foo" + }, + { + "expression": "to_string(`1.2`)", + "result": "1.2" + }, + { + "expression": "to_string(`[0, 1]`)", + "result": "[0,1]" + }, + { + "expression": "to_number('1.0')", + "result": 1.0 + }, + { + "expression": "to_number('1.1')", + "result": 1.1 + }, + { + "expression": "to_number('4')", + "result": 4 + }, + { + "expression": "to_number('notanumber')", + "result": null + }, + { + "expression": "to_number(`false`)", + "result": null + }, + { + "expression": "to_number(`null`)", + "result": null + }, + { + "expression": "to_number(`[0]`)", + "result": null + }, + { + "expression": "to_number(`{\"foo\": 0}`)", + "result": null + }, + { + "expression": "\"to_string\"(`1.0`)", + "error": "syntax" + }, + { + "expression": "sort(numbers)", + "result": [-1, 3, 4, 5] + }, + { + "expression": "sort(strings)", + "result": ["a", "b", "c"] + }, + { + "expression": "sort(decimals)", + "result": [-1.5, 1.01, 1.2] + }, + { + "expression": "sort(array)", + "error": "invalid-type" + }, + { + "expression": "sort(abc)", + "error": "invalid-type" + }, + { + "expression": "sort(empty_list)", + "result": [] + }, + { + "expression": "sort(@)", + "error": "invalid-type" + }, + { + "expression": "not_null(unknown_key, str)", + "result": "Str" + }, + { + "expression": "not_null(unknown_key, foo.bar, empty_list, str)", + "result": [] + }, + { + "expression": "not_null(unknown_key, null_key, empty_list, str)", + "result": [] + }, + { + "expression": "not_null(all, expressions, are_null)", + "result": null + }, + { + "expression": "not_null()", + "error": "invalid-arity" + }, + { + "description": "function projection on single arg function", + "expression": "numbers[].to_string(@)", + "result": ["-1", "3", "4", "5"] + }, + { + "description": "function projection on single arg function", + "expression": "array[].to_number(@)", + "result": [-1, 3, 4, 5, 100] + } + ] +}, { + "given": + { + "foo": [ + {"b": "b", "a": "a"}, + {"c": "c", "b": "b"}, + {"d": "d", "c": "c"}, + {"e": "e", "d": "d"}, + {"f": "f", "e": "e"} + ] + }, + "cases": [ + { + "description": "function projection on variadic function", + "expression": "foo[].not_null(f, e, d, c, b, a)", + "result": ["b", "c", "d", "e", "f"] + } + ] +}, { + "given": + { + "people": [ + {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, + {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, + {"age": 30, "age_str": "30", "bool": true, "name": "c"}, + {"age": 50, "age_str": "50", "bool": false, "name": "d"}, + {"age": 10, "age_str": "10", "bool": true, "name": 3} + ] + }, + "cases": [ + { + "description": "sort by field expression", + "expression": "sort_by(people, &age)", + "result": [ + {"age": 10, "age_str": "10", "bool": true, "name": 3}, + {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, + {"age": 30, "age_str": "30", "bool": true, "name": "c"}, + {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, + {"age": 50, "age_str": "50", "bool": false, "name": "d"} + ] + }, + { + "expression": "sort_by(people, &age_str)", + "result": [ + {"age": 10, "age_str": "10", "bool": true, "name": 3}, + {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, + {"age": 30, "age_str": "30", "bool": true, "name": "c"}, + {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, + {"age": 50, "age_str": "50", "bool": false, "name": "d"} + ] + }, + { + "description": "sort by function expression", + "expression": "sort_by(people, &to_number(age_str))", + "result": [ + {"age": 10, "age_str": "10", "bool": true, "name": 3}, + {"age": 20, "age_str": "20", "bool": true, "name": "a", "extra": "foo"}, + {"age": 30, "age_str": "30", "bool": true, "name": "c"}, + {"age": 40, "age_str": "40", "bool": false, "name": "b", "extra": "bar"}, + {"age": 50, "age_str": "50", "bool": false, "name": "d"} + ] + }, + { + "description": "function projection on sort_by function", + "expression": "sort_by(people, &age)[].name", + "result": [3, "a", "c", "b", "d"] + }, + { + "expression": "sort_by(people, &extra)", + "error": "invalid-type" + }, + { + "expression": "sort_by(people, &bool)", + "error": "invalid-type" + }, + { + "expression": "sort_by(people, &name)", + "error": "invalid-type" + }, + { + "expression": "sort_by(people, name)", + "error": "invalid-type" + }, + { + "expression": "sort_by(people, &age)[].extra", + "result": ["foo", "bar"] + }, + { + "expression": "sort_by(`[]`, &age)", + "result": [] + }, + { + "expression": "max_by(people, &age)", + "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} + }, + { + "expression": "max_by(people, &age_str)", + "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} + }, + { + "expression": "max_by(people, &bool)", + "error": "invalid-type" + }, + { + "expression": "max_by(people, &extra)", + "error": "invalid-type" + }, + { + "expression": "max_by(people, &to_number(age_str))", + "result": {"age": 50, "age_str": "50", "bool": false, "name": "d"} + }, + { + "expression": "min_by(people, &age)", + "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} + }, + { + "expression": "min_by(people, &age_str)", + "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} + }, + { + "expression": "min_by(people, &bool)", + "error": "invalid-type" + }, + { + "expression": "min_by(people, &extra)", + "error": "invalid-type" + }, + { + "expression": "min_by(people, &to_number(age_str))", + "result": {"age": 10, "age_str": "10", "bool": true, "name": 3} + } + ] +}, { + "given": + { + "people": [ + {"age": 10, "order": "1"}, + {"age": 10, "order": "2"}, + {"age": 10, "order": "3"}, + {"age": 10, "order": "4"}, + {"age": 10, "order": "5"}, + {"age": 10, "order": "6"}, + {"age": 10, "order": "7"}, + {"age": 10, "order": "8"}, + {"age": 10, "order": "9"}, + {"age": 10, "order": "10"}, + {"age": 10, "order": "11"} + ] + }, + "cases": [ + { + "description": "stable sort order", + "expression": "sort_by(people, &age)", + "result": [ + {"age": 10, "order": "1"}, + {"age": 10, "order": "2"}, + {"age": 10, "order": "3"}, + {"age": 10, "order": "4"}, + {"age": 10, "order": "5"}, + {"age": 10, "order": "6"}, + {"age": 10, "order": "7"}, + {"age": 10, "order": "8"}, + {"age": 10, "order": "9"}, + {"age": 10, "order": "10"}, + {"age": 10, "order": "11"} + ] + } + ] +}, { + "given": + { + "people": [ + {"a": 10, "b": 1, "c": "z"}, + {"a": 10, "b": 2, "c": null}, + {"a": 10, "b": 3}, + {"a": 10, "b": 4, "c": "z"}, + {"a": 10, "b": 5, "c": null}, + {"a": 10, "b": 6}, + {"a": 10, "b": 7, "c": "z"}, + {"a": 10, "b": 8, "c": null}, + {"a": 10, "b": 9} + ], + "empty": [] + }, + "cases": [ + { + "expression": "map(&a, people)", + "result": [10, 10, 10, 10, 10, 10, 10, 10, 10] + }, + { + "expression": "map(&c, people)", + "result": ["z", null, null, "z", null, null, "z", null, null] + }, + { + "expression": "map(&a, badkey)", + "error": "invalid-type" + }, + { + "expression": "map(&foo, empty)", + "result": [] + } + ] +}, { + "given": { + "array": [ + { + "foo": {"bar": "yes1"} + }, + { + "foo": {"bar": "yes2"} + }, + { + "foo1": {"bar": "no"} + } + ]}, + "cases": [ + { + "expression": "map(&foo.bar, array)", + "result": ["yes1", "yes2", null] + }, + { + "expression": "map(&foo1.bar, array)", + "result": [null, null, "no"] + }, + { + "expression": "map(&foo.bar.baz, array)", + "result": [null, null, null] + } + ] +}, { + "given": { + "array": [[1, 2, 3, [4]], [5, 6, 7, [8, 9]]] + }, + "cases": [ + { + "expression": "map(&[], array)", + "result": [[1, 2, 3, 4], [5, 6, 7, 8, 9]] + } + ] +} +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json new file mode 100644 index 00000000000..7998a41ac9d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/identifiers.json @@ -0,0 +1,1377 @@ +[ + { + "given": { + "__L": true + }, + "cases": [ + { + "expression": "__L", + "result": true + } + ] + }, + { + "given": { + "!\r": true + }, + "cases": [ + { + "expression": "\"!\\r\"", + "result": true + } + ] + }, + { + "given": { + "Y_1623": true + }, + "cases": [ + { + "expression": "Y_1623", + "result": true + } + ] + }, + { + "given": { + "x": true + }, + "cases": [ + { + "expression": "x", + "result": true + } + ] + }, + { + "given": { + "\tF\uCebb": true + }, + "cases": [ + { + "expression": "\"\\tF\\uCebb\"", + "result": true + } + ] + }, + { + "given": { + " \t": true + }, + "cases": [ + { + "expression": "\" \\t\"", + "result": true + } + ] + }, + { + "given": { + " ": true + }, + "cases": [ + { + "expression": "\" \"", + "result": true + } + ] + }, + { + "given": { + "v2": true + }, + "cases": [ + { + "expression": "v2", + "result": true + } + ] + }, + { + "given": { + "\t": true + }, + "cases": [ + { + "expression": "\"\\t\"", + "result": true + } + ] + }, + { + "given": { + "_X": true + }, + "cases": [ + { + "expression": "_X", + "result": true + } + ] + }, + { + "given": { + "\t4\ud9da\udd15": true + }, + "cases": [ + { + "expression": "\"\\t4\\ud9da\\udd15\"", + "result": true + } + ] + }, + { + "given": { + "v24_W": true + }, + "cases": [ + { + "expression": "v24_W", + "result": true + } + ] + }, + { + "given": { + "H": true + }, + "cases": [ + { + "expression": "\"H\"", + "result": true + } + ] + }, + { + "given": { + "\f": true + }, + "cases": [ + { + "expression": "\"\\f\"", + "result": true + } + ] + }, + { + "given": { + "E4": true + }, + "cases": [ + { + "expression": "\"E4\"", + "result": true + } + ] + }, + { + "given": { + "!": true + }, + "cases": [ + { + "expression": "\"!\"", + "result": true + } + ] + }, + { + "given": { + "tM": true + }, + "cases": [ + { + "expression": "tM", + "result": true + } + ] + }, + { + "given": { + " [": true + }, + "cases": [ + { + "expression": "\" [\"", + "result": true + } + ] + }, + { + "given": { + "R!": true + }, + "cases": [ + { + "expression": "\"R!\"", + "result": true + } + ] + }, + { + "given": { + "_6W": true + }, + "cases": [ + { + "expression": "_6W", + "result": true + } + ] + }, + { + "given": { + "\uaBA1\r": true + }, + "cases": [ + { + "expression": "\"\\uaBA1\\r\"", + "result": true + } + ] + }, + { + "given": { + "tL7": true + }, + "cases": [ + { + "expression": "tL7", + "result": true + } + ] + }, + { + "given": { + "<": true + }, + "cases": [ + { + "expression": "\">\"", + "result": true + } + ] + }, + { + "given": { + "hvu": true + }, + "cases": [ + { + "expression": "hvu", + "result": true + } + ] + }, + { + "given": { + "; !": true + }, + "cases": [ + { + "expression": "\"; !\"", + "result": true + } + ] + }, + { + "given": { + "hU": true + }, + "cases": [ + { + "expression": "hU", + "result": true + } + ] + }, + { + "given": { + "!I\n\/": true + }, + "cases": [ + { + "expression": "\"!I\\n\\/\"", + "result": true + } + ] + }, + { + "given": { + "\uEEbF": true + }, + "cases": [ + { + "expression": "\"\\uEEbF\"", + "result": true + } + ] + }, + { + "given": { + "U)\t": true + }, + "cases": [ + { + "expression": "\"U)\\t\"", + "result": true + } + ] + }, + { + "given": { + "fa0_9": true + }, + "cases": [ + { + "expression": "fa0_9", + "result": true + } + ] + }, + { + "given": { + "/": true + }, + "cases": [ + { + "expression": "\"/\"", + "result": true + } + ] + }, + { + "given": { + "Gy": true + }, + "cases": [ + { + "expression": "Gy", + "result": true + } + ] + }, + { + "given": { + "\b": true + }, + "cases": [ + { + "expression": "\"\\b\"", + "result": true + } + ] + }, + { + "given": { + "<": true + }, + "cases": [ + { + "expression": "\"<\"", + "result": true + } + ] + }, + { + "given": { + "\t": true + }, + "cases": [ + { + "expression": "\"\\t\"", + "result": true + } + ] + }, + { + "given": { + "\t&\\\r": true + }, + "cases": [ + { + "expression": "\"\\t&\\\\\\r\"", + "result": true + } + ] + }, + { + "given": { + "#": true + }, + "cases": [ + { + "expression": "\"#\"", + "result": true + } + ] + }, + { + "given": { + "B__": true + }, + "cases": [ + { + "expression": "B__", + "result": true + } + ] + }, + { + "given": { + "\nS \n": true + }, + "cases": [ + { + "expression": "\"\\nS \\n\"", + "result": true + } + ] + }, + { + "given": { + "Bp": true + }, + "cases": [ + { + "expression": "Bp", + "result": true + } + ] + }, + { + "given": { + ",\t;": true + }, + "cases": [ + { + "expression": "\",\\t;\"", + "result": true + } + ] + }, + { + "given": { + "B_q": true + }, + "cases": [ + { + "expression": "B_q", + "result": true + } + ] + }, + { + "given": { + "\/+\t\n\b!Z": true + }, + "cases": [ + { + "expression": "\"\\/+\\t\\n\\b!Z\"", + "result": true + } + ] + }, + { + "given": { + "\udadd\udfc7\\ueFAc": true + }, + "cases": [ + { + "expression": "\"\udadd\udfc7\\\\ueFAc\"", + "result": true + } + ] + }, + { + "given": { + ":\f": true + }, + "cases": [ + { + "expression": "\":\\f\"", + "result": true + } + ] + }, + { + "given": { + "\/": true + }, + "cases": [ + { + "expression": "\"\\/\"", + "result": true + } + ] + }, + { + "given": { + "_BW_6Hg_Gl": true + }, + "cases": [ + { + "expression": "_BW_6Hg_Gl", + "result": true + } + ] + }, + { + "given": { + "\udbcf\udc02": true + }, + "cases": [ + { + "expression": "\"\udbcf\udc02\"", + "result": true + } + ] + }, + { + "given": { + "zs1DC": true + }, + "cases": [ + { + "expression": "zs1DC", + "result": true + } + ] + }, + { + "given": { + "__434": true + }, + "cases": [ + { + "expression": "__434", + "result": true + } + ] + }, + { + "given": { + "\udb94\udd41": true + }, + "cases": [ + { + "expression": "\"\udb94\udd41\"", + "result": true + } + ] + }, + { + "given": { + "Z_5": true + }, + "cases": [ + { + "expression": "Z_5", + "result": true + } + ] + }, + { + "given": { + "z_M_": true + }, + "cases": [ + { + "expression": "z_M_", + "result": true + } + ] + }, + { + "given": { + "YU_2": true + }, + "cases": [ + { + "expression": "YU_2", + "result": true + } + ] + }, + { + "given": { + "_0": true + }, + "cases": [ + { + "expression": "_0", + "result": true + } + ] + }, + { + "given": { + "\b+": true + }, + "cases": [ + { + "expression": "\"\\b+\"", + "result": true + } + ] + }, + { + "given": { + "\"": true + }, + "cases": [ + { + "expression": "\"\\\"\"", + "result": true + } + ] + }, + { + "given": { + "D7": true + }, + "cases": [ + { + "expression": "D7", + "result": true + } + ] + }, + { + "given": { + "_62L": true + }, + "cases": [ + { + "expression": "_62L", + "result": true + } + ] + }, + { + "given": { + "\tK\t": true + }, + "cases": [ + { + "expression": "\"\\tK\\t\"", + "result": true + } + ] + }, + { + "given": { + "\n\\\f": true + }, + "cases": [ + { + "expression": "\"\\n\\\\\\f\"", + "result": true + } + ] + }, + { + "given": { + "I_": true + }, + "cases": [ + { + "expression": "I_", + "result": true + } + ] + }, + { + "given": { + "W_a0_": true + }, + "cases": [ + { + "expression": "W_a0_", + "result": true + } + ] + }, + { + "given": { + "BQ": true + }, + "cases": [ + { + "expression": "BQ", + "result": true + } + ] + }, + { + "given": { + "\tX$\uABBb": true + }, + "cases": [ + { + "expression": "\"\\tX$\\uABBb\"", + "result": true + } + ] + }, + { + "given": { + "Z9": true + }, + "cases": [ + { + "expression": "Z9", + "result": true + } + ] + }, + { + "given": { + "\b%\"\uda38\udd0f": true + }, + "cases": [ + { + "expression": "\"\\b%\\\"\uda38\udd0f\"", + "result": true + } + ] + }, + { + "given": { + "_F": true + }, + "cases": [ + { + "expression": "_F", + "result": true + } + ] + }, + { + "given": { + "!,": true + }, + "cases": [ + { + "expression": "\"!,\"", + "result": true + } + ] + }, + { + "given": { + "\"!": true + }, + "cases": [ + { + "expression": "\"\\\"!\"", + "result": true + } + ] + }, + { + "given": { + "Hh": true + }, + "cases": [ + { + "expression": "Hh", + "result": true + } + ] + }, + { + "given": { + "&": true + }, + "cases": [ + { + "expression": "\"&\"", + "result": true + } + ] + }, + { + "given": { + "9\r\\R": true + }, + "cases": [ + { + "expression": "\"9\\r\\\\R\"", + "result": true + } + ] + }, + { + "given": { + "M_k": true + }, + "cases": [ + { + "expression": "M_k", + "result": true + } + ] + }, + { + "given": { + "!\b\n\udb06\ude52\"\"": true + }, + "cases": [ + { + "expression": "\"!\\b\\n\udb06\ude52\\\"\\\"\"", + "result": true + } + ] + }, + { + "given": { + "6": true + }, + "cases": [ + { + "expression": "\"6\"", + "result": true + } + ] + }, + { + "given": { + "_7": true + }, + "cases": [ + { + "expression": "_7", + "result": true + } + ] + }, + { + "given": { + "0": true + }, + "cases": [ + { + "expression": "\"0\"", + "result": true + } + ] + }, + { + "given": { + "\\8\\": true + }, + "cases": [ + { + "expression": "\"\\\\8\\\\\"", + "result": true + } + ] + }, + { + "given": { + "b7eo": true + }, + "cases": [ + { + "expression": "b7eo", + "result": true + } + ] + }, + { + "given": { + "xIUo9": true + }, + "cases": [ + { + "expression": "xIUo9", + "result": true + } + ] + }, + { + "given": { + "5": true + }, + "cases": [ + { + "expression": "\"5\"", + "result": true + } + ] + }, + { + "given": { + "?": true + }, + "cases": [ + { + "expression": "\"?\"", + "result": true + } + ] + }, + { + "given": { + "sU": true + }, + "cases": [ + { + "expression": "sU", + "result": true + } + ] + }, + { + "given": { + "VH2&H\\\/": true + }, + "cases": [ + { + "expression": "\"VH2&H\\\\\\/\"", + "result": true + } + ] + }, + { + "given": { + "_C": true + }, + "cases": [ + { + "expression": "_C", + "result": true + } + ] + }, + { + "given": { + "_": true + }, + "cases": [ + { + "expression": "_", + "result": true + } + ] + }, + { + "given": { + "<\t": true + }, + "cases": [ + { + "expression": "\"<\\t\"", + "result": true + } + ] + }, + { + "given": { + "\uD834\uDD1E": true + }, + "cases": [ + { + "expression": "\"\\uD834\\uDD1E\"", + "result": true + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json new file mode 100644 index 00000000000..aa03b35dd7f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/indices.json @@ -0,0 +1,346 @@ +[{ + "given": + {"foo": {"bar": ["zero", "one", "two"]}}, + "cases": [ + { + "expression": "foo.bar[0]", + "result": "zero" + }, + { + "expression": "foo.bar[1]", + "result": "one" + }, + { + "expression": "foo.bar[2]", + "result": "two" + }, + { + "expression": "foo.bar[3]", + "result": null + }, + { + "expression": "foo.bar[-1]", + "result": "two" + }, + { + "expression": "foo.bar[-2]", + "result": "one" + }, + { + "expression": "foo.bar[-3]", + "result": "zero" + }, + { + "expression": "foo.bar[-4]", + "result": null + } + ] +}, +{ + "given": + {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]}, + "cases": [ + { + "expression": "foo.bar", + "result": null + }, + { + "expression": "foo[0].bar", + "result": "one" + }, + { + "expression": "foo[1].bar", + "result": "two" + }, + { + "expression": "foo[2].bar", + "result": "three" + }, + { + "expression": "foo[3].notbar", + "result": "four" + }, + { + "expression": "foo[3].bar", + "result": null + }, + { + "expression": "foo[0]", + "result": {"bar": "one"} + }, + { + "expression": "foo[1]", + "result": {"bar": "two"} + }, + { + "expression": "foo[2]", + "result": {"bar": "three"} + }, + { + "expression": "foo[3]", + "result": {"notbar": "four"} + }, + { + "expression": "foo[4]", + "result": null + } + ] +}, +{ + "given": [ + "one", "two", "three" + ], + "cases": [ + { + "expression": "[0]", + "result": "one" + }, + { + "expression": "[1]", + "result": "two" + }, + { + "expression": "[2]", + "result": "three" + }, + { + "expression": "[-1]", + "result": "three" + }, + { + "expression": "[-2]", + "result": "two" + }, + { + "expression": "[-3]", + "result": "one" + } + ] +}, +{ + "given": {"reservations": [ + {"instances": [{"foo": 1}, {"foo": 2}]} + ]}, + "cases": [ + { + "expression": "reservations[].instances[].foo", + "result": [1, 2] + }, + { + "expression": "reservations[].instances[].bar", + "result": [] + }, + { + "expression": "reservations[].notinstances[].foo", + "result": [] + }, + { + "expression": "reservations[].notinstances[].foo", + "result": [] + } + ] +}, +{ + "given": {"reservations": [{ + "instances": [ + {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}, + {"foo": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]}, + {"foo": "bar"}, + {"notfoo": [{"bar": 20}, {"bar": 21}, {"notbar": [7]}, {"bar": 22}]}, + {"bar": [{"baz": [1]}, {"baz": [2]}, {"baz": [3]}, {"baz": [4]}]}, + {"baz": [{"baz": [1, 2]}, {"baz": []}, {"baz": []}, {"baz": [3, 4]}]}, + {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]} + ], + "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]} + }, { + "instances": [ + {"a": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]}, + {"b": [{"bar": 5}, {"bar": 6}, {"notbar": [7]}, {"bar": 8}]}, + {"c": "bar"}, + {"notfoo": [{"bar": 23}, {"bar": 24}, {"notbar": [7]}, {"bar": 25}]}, + {"qux": [{"baz": []}, {"baz": [1, 2, 3]}, {"baz": [4]}, {"baz": []}]} + ], + "otherkey": {"foo": [{"bar": 1}, {"bar": 2}, {"notbar": 3}, {"bar": 4}]} + } + ]}, + "cases": [ + { + "expression": "reservations[].instances[].foo[].bar", + "result": [1, 2, 4, 5, 6, 8] + }, + { + "expression": "reservations[].instances[].foo[].baz", + "result": [] + }, + { + "expression": "reservations[].instances[].notfoo[].bar", + "result": [20, 21, 22, 23, 24, 25] + }, + { + "expression": "reservations[].instances[].notfoo[].notbar", + "result": [[7], [7]] + }, + { + "expression": "reservations[].notinstances[].foo", + "result": [] + }, + { + "expression": "reservations[].instances[].foo[].notbar", + "result": [3, [7]] + }, + { + "expression": "reservations[].instances[].bar[].baz", + "result": [[1], [2], [3], [4]] + }, + { + "expression": "reservations[].instances[].baz[].baz", + "result": [[1, 2], [], [], [3, 4]] + }, + { + "expression": "reservations[].instances[].qux[].baz", + "result": [[], [1, 2, 3], [4], [], [], [1, 2, 3], [4], []] + }, + { + "expression": "reservations[].instances[].qux[].baz[]", + "result": [1, 2, 3, 4, 1, 2, 3, 4] + } + ] +}, +{ + "given": { + "foo": [ + [["one", "two"], ["three", "four"]], + [["five", "six"], ["seven", "eight"]], + [["nine"], ["ten"]] + ] + }, + "cases": [ + { + "expression": "foo[]", + "result": [["one", "two"], ["three", "four"], ["five", "six"], + ["seven", "eight"], ["nine"], ["ten"]] + }, + { + "expression": "foo[][0]", + "result": ["one", "three", "five", "seven", "nine", "ten"] + }, + { + "expression": "foo[][1]", + "result": ["two", "four", "six", "eight"] + }, + { + "expression": "foo[][0][0]", + "result": [] + }, + { + "expression": "foo[][2][2]", + "result": [] + }, + { + "expression": "foo[][0][0][100]", + "result": [] + } + ] +}, +{ + "given": { + "foo": [{ + "bar": [ + { + "qux": 2, + "baz": 1 + }, + { + "qux": 4, + "baz": 3 + } + ] + }, + { + "bar": [ + { + "qux": 6, + "baz": 5 + }, + { + "qux": 8, + "baz": 7 + } + ] + } + ] + }, + "cases": [ + { + "expression": "foo", + "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, + {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] + }, + { + "expression": "foo[]", + "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, + {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] + }, + { + "expression": "foo[].bar", + "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}], + [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]] + }, + { + "expression": "foo[].bar[]", + "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}, + {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}] + }, + { + "expression": "foo[].bar[].baz", + "result": [1, 3, 5, 7] + } + ] +}, +{ + "given": { + "string": "string", + "hash": {"foo": "bar", "bar": "baz"}, + "number": 23, + "nullvalue": null + }, + "cases": [ + { + "expression": "string[]", + "result": null + }, + { + "expression": "hash[]", + "result": null + }, + { + "expression": "number[]", + "result": null + }, + { + "expression": "nullvalue[]", + "result": null + }, + { + "expression": "string[].foo", + "result": null + }, + { + "expression": "hash[].foo", + "result": null + }, + { + "expression": "number[].foo", + "result": null + }, + { + "expression": "nullvalue[].foo", + "result": null + }, + { + "expression": "nullvalue[].foo[].bar", + "result": null + } + ] +} +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json new file mode 100644 index 00000000000..c6706b97196 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/literal.json @@ -0,0 +1,185 @@ +[ + { + "given": { + "foo": [{"name": "a"}, {"name": "b"}], + "bar": {"baz": "qux"} + }, + "cases": [ + { + "expression": "`\"foo\"`", + "result": "foo" + }, + { + "comment": "Interpret escaped unicode.", + "expression": "`\"\\u03a6\"`", + "result": "Φ" + }, + { + "expression": "`\"✓\"`", + "result": "✓" + }, + { + "expression": "`[1, 2, 3]`", + "result": [1, 2, 3] + }, + { + "expression": "`{\"a\": \"b\"}`", + "result": {"a": "b"} + }, + { + "expression": "`true`", + "result": true + }, + { + "expression": "`false`", + "result": false + }, + { + "expression": "`null`", + "result": null + }, + { + "expression": "`0`", + "result": 0 + }, + { + "expression": "`1`", + "result": 1 + }, + { + "expression": "`2`", + "result": 2 + }, + { + "expression": "`3`", + "result": 3 + }, + { + "expression": "`4`", + "result": 4 + }, + { + "expression": "`5`", + "result": 5 + }, + { + "expression": "`6`", + "result": 6 + }, + { + "expression": "`7`", + "result": 7 + }, + { + "expression": "`8`", + "result": 8 + }, + { + "expression": "`9`", + "result": 9 + }, + { + "comment": "Escaping a backtick in quotes", + "expression": "`\"foo\\`bar\"`", + "result": "foo`bar" + }, + { + "comment": "Double quote in literal", + "expression": "`\"foo\\\"bar\"`", + "result": "foo\"bar" + }, + { + "expression": "`\"1\\`\"`", + "result": "1`" + }, + { + "comment": "Multiple literal expressions with escapes", + "expression": "`\"\\\\\"`.{a:`\"b\"`}", + "result": {"a": "b"} + }, + { + "comment": "literal . identifier", + "expression": "`{\"a\": \"b\"}`.a", + "result": "b" + }, + { + "comment": "literal . identifier . identifier", + "expression": "`{\"a\": {\"b\": \"c\"}}`.a.b", + "result": "c" + }, + { + "comment": "literal . identifier bracket-expr", + "expression": "`[0, 1, 2]`[1]", + "result": 1 + } + ] + }, + { + "comment": "Literals", + "given": {"type": "object"}, + "cases": [ + { + "comment": "Literal with leading whitespace", + "expression": "` {\"foo\": true}`", + "result": {"foo": true} + }, + { + "comment": "Literal with trailing whitespace", + "expression": "`{\"foo\": true} `", + "result": {"foo": true} + }, + { + "comment": "Literal on RHS of subexpr not allowed", + "expression": "foo.`\"bar\"`", + "error": "syntax" + } + ] + }, + { + "comment": "Raw String Literals", + "given": {}, + "cases": [ + { + "expression": "'foo'", + "result": "foo" + }, + { + "expression": "' foo '", + "result": " foo " + }, + { + "expression": "'0'", + "result": "0" + }, + { + "expression": "'newline\n'", + "result": "newline\n" + }, + { + "expression": "'\n'", + "result": "\n" + }, + { + "expression": "'✓'", + "result": "✓" + }, + { + "expression": "'𝄞'", + "result": "𝄞" + }, + { + "expression": "' [foo] '", + "result": " [foo] " + }, + { + "expression": "'[foo]'", + "result": "[foo]" + }, + { + "comment": "Do not interpret escaped unicode.", + "expression": "'\\u03a6'", + "result": "\\u03a6" + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json new file mode 100644 index 00000000000..8f2a481ed7c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/multiselect.json @@ -0,0 +1,393 @@ +[{ + "given": { + "foo": { + "bar": "bar", + "baz": "baz", + "qux": "qux", + "nested": { + "one": { + "a": "first", + "b": "second", + "c": "third" + }, + "two": { + "a": "first", + "b": "second", + "c": "third" + }, + "three": { + "a": "first", + "b": "second", + "c": {"inner": "third"} + } + } + }, + "bar": 1, + "baz": 2, + "qux\"": 3 + }, + "cases": [ + { + "expression": "foo.{bar: bar}", + "result": {"bar": "bar"} + }, + { + "expression": "foo.{\"bar\": bar}", + "result": {"bar": "bar"} + }, + { + "expression": "foo.{\"foo.bar\": bar}", + "result": {"foo.bar": "bar"} + }, + { + "expression": "foo.{bar: bar, baz: baz}", + "result": {"bar": "bar", "baz": "baz"} + }, + { + "expression": "foo.{\"bar\": bar, \"baz\": baz}", + "result": {"bar": "bar", "baz": "baz"} + }, + { + "expression": "{\"baz\": baz, \"qux\\\"\": \"qux\\\"\"}", + "result": {"baz": 2, "qux\"": 3} + }, + { + "expression": "foo.{bar:bar,baz:baz}", + "result": {"bar": "bar", "baz": "baz"} + }, + { + "expression": "foo.{bar: bar,qux: qux}", + "result": {"bar": "bar", "qux": "qux"} + }, + { + "expression": "foo.{bar: bar, noexist: noexist}", + "result": {"bar": "bar", "noexist": null} + }, + { + "expression": "foo.{noexist: noexist, alsonoexist: alsonoexist}", + "result": {"noexist": null, "alsonoexist": null} + }, + { + "expression": "foo.badkey.{nokey: nokey, alsonokey: alsonokey}", + "result": null + }, + { + "expression": "foo.nested.*.{a: a,b: b}", + "result": [{"a": "first", "b": "second"}, + {"a": "first", "b": "second"}, + {"a": "first", "b": "second"}] + }, + { + "expression": "foo.nested.three.{a: a, cinner: c.inner}", + "result": {"a": "first", "cinner": "third"} + }, + { + "expression": "foo.nested.three.{a: a, c: c.inner.bad.key}", + "result": {"a": "first", "c": null} + }, + { + "expression": "foo.{a: nested.one.a, b: nested.two.b}", + "result": {"a": "first", "b": "second"} + }, + { + "expression": "{bar: bar, baz: baz}", + "result": {"bar": 1, "baz": 2} + }, + { + "expression": "{bar: bar}", + "result": {"bar": 1} + }, + { + "expression": "{otherkey: bar}", + "result": {"otherkey": 1} + }, + { + "expression": "{no: no, exist: exist}", + "result": {"no": null, "exist": null} + }, + { + "expression": "foo.[bar]", + "result": ["bar"] + }, + { + "expression": "foo.[bar,baz]", + "result": ["bar", "baz"] + }, + { + "expression": "foo.[bar,qux]", + "result": ["bar", "qux"] + }, + { + "expression": "foo.[bar,noexist]", + "result": ["bar", null] + }, + { + "expression": "foo.[noexist,alsonoexist]", + "result": [null, null] + } + ] +}, { + "given": { + "foo": {"bar": 1, "baz": [2, 3, 4]} + }, + "cases": [ + { + "expression": "foo.{bar:bar,baz:baz}", + "result": {"bar": 1, "baz": [2, 3, 4]} + }, + { + "expression": "foo.[bar,baz[0]]", + "result": [1, 2] + }, + { + "expression": "foo.[bar,baz[1]]", + "result": [1, 3] + }, + { + "expression": "foo.[bar,baz[2]]", + "result": [1, 4] + }, + { + "expression": "foo.[bar,baz[3]]", + "result": [1, null] + }, + { + "expression": "foo.[bar[0],baz[3]]", + "result": [null, null] + } + ] +}, { + "given": { + "foo": {"bar": 1, "baz": 2} + }, + "cases": [ + { + "expression": "foo.{bar: bar, baz: baz}", + "result": {"bar": 1, "baz": 2} + }, + { + "expression": "foo.[bar,baz]", + "result": [1, 2] + } + ] +}, { + "given": { + "foo": { + "bar": {"baz": [{"common": "first", "one": 1}, + {"common": "second", "two": 2}]}, + "ignoreme": 1, + "includeme": true + } + }, + "cases": [ + { + "expression": "foo.{bar: bar.baz[1],includeme: includeme}", + "result": {"bar": {"common": "second", "two": 2}, "includeme": true} + }, + { + "expression": "foo.{\"bar.baz.two\": bar.baz[1].two, includeme: includeme}", + "result": {"bar.baz.two": 2, "includeme": true} + }, + { + "expression": "foo.[includeme, bar.baz[*].common]", + "result": [true, ["first", "second"]] + }, + { + "expression": "foo.[includeme, bar.baz[*].none]", + "result": [true, []] + }, + { + "expression": "foo.[includeme, bar.baz[].common]", + "result": [true, ["first", "second"]] + } + ] +}, { + "given": { + "reservations": [{ + "instances": [ + {"id": "id1", + "name": "first"}, + {"id": "id2", + "name": "second"} + ]}, { + "instances": [ + {"id": "id3", + "name": "third"}, + {"id": "id4", + "name": "fourth"} + ]} + ]}, + "cases": [ + { + "expression": "reservations[*].instances[*].{id: id, name: name}", + "result": [[{"id": "id1", "name": "first"}, {"id": "id2", "name": "second"}], + [{"id": "id3", "name": "third"}, {"id": "id4", "name": "fourth"}]] + }, + { + "expression": "reservations[].instances[].{id: id, name: name}", + "result": [{"id": "id1", "name": "first"}, + {"id": "id2", "name": "second"}, + {"id": "id3", "name": "third"}, + {"id": "id4", "name": "fourth"}] + }, + { + "expression": "reservations[].instances[].[id, name]", + "result": [["id1", "first"], + ["id2", "second"], + ["id3", "third"], + ["id4", "fourth"]] + } + ] +}, +{ + "given": { + "foo": [{ + "bar": [ + { + "qux": 2, + "baz": 1 + }, + { + "qux": 4, + "baz": 3 + } + ] + }, + { + "bar": [ + { + "qux": 6, + "baz": 5 + }, + { + "qux": 8, + "baz": 7 + } + ] + } + ] + }, + "cases": [ + { + "expression": "foo", + "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, + {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] + }, + { + "expression": "foo[]", + "result": [{"bar": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}]}, + {"bar": [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]}] + }, + { + "expression": "foo[].bar", + "result": [[{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}], + [{"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}]] + }, + { + "expression": "foo[].bar[]", + "result": [{"qux": 2, "baz": 1}, {"qux": 4, "baz": 3}, + {"qux": 6, "baz": 5}, {"qux": 8, "baz": 7}] + }, + { + "expression": "foo[].bar[].[baz, qux]", + "result": [[1, 2], [3, 4], [5, 6], [7, 8]] + }, + { + "expression": "foo[].bar[].[baz]", + "result": [[1], [3], [5], [7]] + }, + { + "expression": "foo[].bar[].[baz, qux][]", + "result": [1, 2, 3, 4, 5, 6, 7, 8] + } + ] +}, +{ + "given": { + "foo": { + "baz": [ + { + "bar": "abc" + }, { + "bar": "def" + } + ], + "qux": ["zero"] + } + }, + "cases": [ + { + "expression": "foo.[baz[*].bar, qux[0]]", + "result": [["abc", "def"], "zero"] + } + ] +}, +{ + "given": { + "foo": { + "baz": [ + { + "bar": "a", + "bam": "b", + "boo": "c" + }, { + "bar": "d", + "bam": "e", + "boo": "f" + } + ], + "qux": ["zero"] + } + }, + "cases": [ + { + "expression": "foo.[baz[*].[bar, boo], qux[0]]", + "result": [[["a", "c" ], ["d", "f" ]], "zero"] + } + ] +}, +{ + "given": { + "foo": { + "baz": [ + { + "bar": "a", + "bam": "b", + "boo": "c" + }, { + "bar": "d", + "bam": "e", + "boo": "f" + } + ], + "qux": ["zero"] + } + }, + "cases": [ + { + "expression": "foo.[baz[*].not_there || baz[*].bar, qux[0]]", + "result": [["a", "d"], "zero"] + } + ] +}, +{ + "given": {"type": "object"}, + "cases": [ + { + "comment": "Nested multiselect", + "expression": "[[*],*]", + "result": [null, ["object"]] + } + ] +}, +{ + "given": [], + "cases": [ + { + "comment": "Nested multiselect", + "expression": "[[*]]", + "result": [[]] + } + ] +} +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json new file mode 100644 index 00000000000..2127cf441ba --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/ormatch.json @@ -0,0 +1,59 @@ +[{ + "given": + {"outer": {"foo": "foo", "bar": "bar", "baz": "baz"}}, + "cases": [ + { + "expression": "outer.foo || outer.bar", + "result": "foo" + }, + { + "expression": "outer.foo||outer.bar", + "result": "foo" + }, + { + "expression": "outer.bar || outer.baz", + "result": "bar" + }, + { + "expression": "outer.bar||outer.baz", + "result": "bar" + }, + { + "expression": "outer.bad || outer.foo", + "result": "foo" + }, + { + "expression": "outer.bad||outer.foo", + "result": "foo" + }, + { + "expression": "outer.foo || outer.bad", + "result": "foo" + }, + { + "expression": "outer.foo||outer.bad", + "result": "foo" + }, + { + "expression": "outer.bad || outer.alsobad", + "result": null + }, + { + "expression": "outer.bad||outer.alsobad", + "result": null + } + ] +}, { + "given": + {"outer": {"foo": "foo", "bool": false, "empty_list": [], "empty_string": ""}}, + "cases": [ + { + "expression": "outer.empty_string || outer.foo", + "result": "foo" + }, + { + "expression": "outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo", + "result": "foo" + } + ] +}] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json new file mode 100644 index 00000000000..b10c0a496d6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/pipe.json @@ -0,0 +1,131 @@ +[{ + "given": { + "foo": { + "bar": { + "baz": "subkey" + }, + "other": { + "baz": "subkey" + }, + "other2": { + "baz": "subkey" + }, + "other3": { + "notbaz": ["a", "b", "c"] + }, + "other4": { + "notbaz": ["a", "b", "c"] + } + } + }, + "cases": [ + { + "expression": "foo.*.baz | [0]", + "result": "subkey" + }, + { + "expression": "foo.*.baz | [1]", + "result": "subkey" + }, + { + "expression": "foo.*.baz | [2]", + "result": "subkey" + }, + { + "expression": "foo.bar.* | [0]", + "result": "subkey" + }, + { + "expression": "foo.*.notbaz | [*]", + "result": [["a", "b", "c"], ["a", "b", "c"]] + }, + { + "expression": "{\"a\": foo.bar, \"b\": foo.other} | *.baz", + "result": ["subkey", "subkey"] + } + ] +}, { + "given": { + "foo": { + "bar": { + "baz": "one" + }, + "other": { + "baz": "two" + }, + "other2": { + "baz": "three" + }, + "other3": { + "notbaz": ["a", "b", "c"] + }, + "other4": { + "notbaz": ["d", "e", "f"] + } + } + }, + "cases": [ + { + "expression": "foo | bar", + "result": {"baz": "one"} + }, + { + "expression": "foo | bar | baz", + "result": "one" + }, + { + "expression": "foo|bar| baz", + "result": "one" + }, + { + "expression": "not_there | [0]", + "result": null + }, + { + "expression": "not_there | [0]", + "result": null + }, + { + "expression": "[foo.bar, foo.other] | [0]", + "result": {"baz": "one"} + }, + { + "expression": "{\"a\": foo.bar, \"b\": foo.other} | a", + "result": {"baz": "one"} + }, + { + "expression": "{\"a\": foo.bar, \"b\": foo.other} | b", + "result": {"baz": "two"} + }, + { + "expression": "foo.bam || foo.bar | baz", + "result": "one" + }, + { + "expression": "foo | not_there || bar", + "result": {"baz": "one"} + } + ] +}, { + "given": { + "foo": [{ + "bar": [{ + "baz": "one" + }, { + "baz": "two" + }] + }, { + "bar": [{ + "baz": "three" + }, { + "baz": "four" + }] + }] + }, + "cases": [ + { + "expression": "foo[*].bar[*] | [0][0]", + "result": {"baz": "one"} + } + ] +}] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json new file mode 100644 index 00000000000..359477278c8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/slice.json @@ -0,0 +1,187 @@ +[{ + "given": { + "foo": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + "bar": { + "baz": 1 + } + }, + "cases": [ + { + "expression": "bar[0:10]", + "result": null + }, + { + "expression": "foo[0:10:1]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[0:10]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[0:10:]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[0::1]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[0::]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[0:]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[:10:1]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[::1]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[:10:]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[::]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[:]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[1:9]", + "result": [1, 2, 3, 4, 5, 6, 7, 8] + }, + { + "expression": "foo[0:10:2]", + "result": [0, 2, 4, 6, 8] + }, + { + "expression": "foo[5:]", + "result": [5, 6, 7, 8, 9] + }, + { + "expression": "foo[5::2]", + "result": [5, 7, 9] + }, + { + "expression": "foo[::2]", + "result": [0, 2, 4, 6, 8] + }, + { + "expression": "foo[::-1]", + "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] + }, + { + "expression": "foo[1::2]", + "result": [1, 3, 5, 7, 9] + }, + { + "expression": "foo[10:0:-1]", + "result": [9, 8, 7, 6, 5, 4, 3, 2, 1] + }, + { + "expression": "foo[10:5:-1]", + "result": [9, 8, 7, 6] + }, + { + "expression": "foo[8:2:-2]", + "result": [8, 6, 4] + }, + { + "expression": "foo[0:20]", + "result": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + }, + { + "expression": "foo[10:-20:-1]", + "result": [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] + }, + { + "expression": "foo[10:-20]", + "result": [] + }, + { + "expression": "foo[-4:-1]", + "result": [6, 7, 8] + }, + { + "expression": "foo[:-5:-1]", + "result": [9, 8, 7, 6] + }, + { + "expression": "foo[8:2:0]", + "error": "invalid-value" + }, + { + "expression": "foo[8:2:0:1]", + "error": "syntax" + }, + { + "expression": "foo[8:2&]", + "error": "syntax" + }, + { + "expression": "foo[2:a:3]", + "error": "syntax" + } + ] +}, { + "given": { + "foo": [{"a": 1}, {"a": 2}, {"a": 3}], + "bar": [{"a": {"b": 1}}, {"a": {"b": 2}}, + {"a": {"b": 3}}], + "baz": 50 + }, + "cases": [ + { + "expression": "foo[:2].a", + "result": [1, 2] + }, + { + "expression": "foo[:2].b", + "result": [] + }, + { + "expression": "foo[:2].a.b", + "result": [] + }, + { + "expression": "bar[::-1].a.b", + "result": [3, 2, 1] + }, + { + "expression": "bar[:2].a.b", + "result": [1, 2] + }, + { + "expression": "baz[:2].a", + "result": null + } + ] +}, { + "given": [{"a": 1}, {"a": 2}, {"a": 3}], + "cases": [ + { + "expression": "[:]", + "result": [{"a": 1}, {"a": 2}, {"a": 3}] + }, + { + "expression": "[:2].a", + "result": [1, 2] + }, + { + "expression": "[::-1].a", + "result": [3, 2, 1] + }, + { + "expression": "[:2].b", + "result": [] + } + ] +}] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json new file mode 100644 index 00000000000..003c2945887 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/syntax.json @@ -0,0 +1,616 @@ +[{ + "comment": "Dot syntax", + "given": {"type": "object"}, + "cases": [ + { + "expression": "foo.bar", + "result": null + }, + { + "expression": "foo.1", + "error": "syntax" + }, + { + "expression": "foo.-11", + "error": "syntax" + }, + { + "expression": "foo", + "result": null + }, + { + "expression": "foo.", + "error": "syntax" + }, + { + "expression": "foo.", + "error": "syntax" + }, + { + "expression": ".foo", + "error": "syntax" + }, + { + "expression": "foo..bar", + "error": "syntax" + }, + { + "expression": "foo.bar.", + "error": "syntax" + }, + { + "expression": "foo[.]", + "error": "syntax" + } + ] +}, + { + "comment": "Simple token errors", + "given": {"type": "object"}, + "cases": [ + { + "expression": ".", + "error": "syntax" + }, + { + "expression": ":", + "error": "syntax" + }, + { + "expression": ",", + "error": "syntax" + }, + { + "expression": "]", + "error": "syntax" + }, + { + "expression": "[", + "error": "syntax" + }, + { + "expression": "}", + "error": "syntax" + }, + { + "expression": "{", + "error": "syntax" + }, + { + "expression": ")", + "error": "syntax" + }, + { + "expression": "(", + "error": "syntax" + }, + { + "expression": "((&", + "error": "syntax" + }, + { + "expression": "a[", + "error": "syntax" + }, + { + "expression": "a]", + "error": "syntax" + }, + { + "expression": "a][", + "error": "syntax" + }, + { + "expression": "!", + "error": "syntax" + } + ] + }, + { + "comment": "Boolean syntax errors", + "given": {"type": "object"}, + "cases": [ + { + "expression": "![!(!", + "error": "syntax" + } + ] + }, + { + "comment": "Wildcard syntax", + "given": {"type": "object"}, + "cases": [ + { + "expression": "*", + "result": ["object"] + }, + { + "expression": "*.*", + "result": [] + }, + { + "expression": "*.foo", + "result": [] + }, + { + "expression": "*[0]", + "result": [] + }, + { + "expression": ".*", + "error": "syntax" + }, + { + "expression": "*foo", + "error": "syntax" + }, + { + "expression": "*0", + "error": "syntax" + }, + { + "expression": "foo[*]bar", + "error": "syntax" + }, + { + "expression": "foo[*]*", + "error": "syntax" + } + ] + }, + { + "comment": "Flatten syntax", + "given": {"type": "object"}, + "cases": [ + { + "expression": "[]", + "result": null + } + ] + }, + { + "comment": "Simple bracket syntax", + "given": {"type": "object"}, + "cases": [ + { + "expression": "[0]", + "result": null + }, + { + "expression": "[*]", + "result": null + }, + { + "expression": "*.[0]", + "error": "syntax" + }, + { + "expression": "*.[\"0\"]", + "result": [[null]] + }, + { + "expression": "[*].bar", + "result": null + }, + { + "expression": "[*][0]", + "result": null + }, + { + "expression": "foo[#]", + "error": "syntax" + } + ] + }, + { + "comment": "Multi-select list syntax", + "given": {"type": "object"}, + "cases": [ + { + "expression": "foo[0]", + "result": null + }, + { + "comment": "Valid multi-select of a list", + "expression": "foo[0, 1]", + "error": "syntax" + }, + { + "expression": "foo.[0]", + "error": "syntax" + }, + { + "expression": "foo.[*]", + "result": null + }, + { + "comment": "Multi-select of a list with trailing comma", + "expression": "foo[0, ]", + "error": "syntax" + }, + { + "comment": "Multi-select of a list with trailing comma and no close", + "expression": "foo[0,", + "error": "syntax" + }, + { + "comment": "Multi-select of a list with trailing comma and no close", + "expression": "foo.[a", + "error": "syntax" + }, + { + "comment": "Multi-select of a list with extra comma", + "expression": "foo[0,, 1]", + "error": "syntax" + }, + { + "comment": "Multi-select of a list using an identifier index", + "expression": "foo[abc]", + "error": "syntax" + }, + { + "comment": "Multi-select of a list using identifier indices", + "expression": "foo[abc, def]", + "error": "syntax" + }, + { + "comment": "Multi-select of a list using an identifier index", + "expression": "foo[abc, 1]", + "error": "syntax" + }, + { + "comment": "Multi-select of a list using an identifier index with trailing comma", + "expression": "foo[abc, ]", + "error": "syntax" + }, + { + "comment": "Valid multi-select of a hash using an identifier index", + "expression": "foo.[abc]", + "result": null + }, + { + "comment": "Valid multi-select of a hash", + "expression": "foo.[abc, def]", + "result": null + }, + { + "comment": "Multi-select of a hash using a numeric index", + "expression": "foo.[abc, 1]", + "error": "syntax" + }, + { + "comment": "Multi-select of a hash with a trailing comma", + "expression": "foo.[abc, ]", + "error": "syntax" + }, + { + "comment": "Multi-select of a hash with extra commas", + "expression": "foo.[abc,, def]", + "error": "syntax" + }, + { + "comment": "Multi-select of a hash using number indices", + "expression": "foo.[0, 1]", + "error": "syntax" + } + ] + }, + { + "comment": "Multi-select hash syntax", + "given": {"type": "object"}, + "cases": [ + { + "comment": "No key or value", + "expression": "a{}", + "error": "syntax" + }, + { + "comment": "No closing token", + "expression": "a{", + "error": "syntax" + }, + { + "comment": "Not a key value pair", + "expression": "a{foo}", + "error": "syntax" + }, + { + "comment": "Missing value and closing character", + "expression": "a{foo:", + "error": "syntax" + }, + { + "comment": "Missing closing character", + "expression": "a{foo: 0", + "error": "syntax" + }, + { + "comment": "Missing value", + "expression": "a{foo:}", + "error": "syntax" + }, + { + "comment": "Trailing comma and no closing character", + "expression": "a{foo: 0, ", + "error": "syntax" + }, + { + "comment": "Missing value with trailing comma", + "expression": "a{foo: ,}", + "error": "syntax" + }, + { + "comment": "Accessing Array using an identifier", + "expression": "a{foo: bar}", + "error": "syntax" + }, + { + "expression": "a{foo: 0}", + "error": "syntax" + }, + { + "comment": "Missing key-value pair", + "expression": "a.{}", + "error": "syntax" + }, + { + "comment": "Not a key-value pair", + "expression": "a.{foo}", + "error": "syntax" + }, + { + "comment": "Missing value", + "expression": "a.{foo:}", + "error": "syntax" + }, + { + "comment": "Missing value with trailing comma", + "expression": "a.{foo: ,}", + "error": "syntax" + }, + { + "comment": "Valid multi-select hash extraction", + "expression": "a.{foo: bar}", + "result": null + }, + { + "comment": "Valid multi-select hash extraction", + "expression": "a.{foo: bar, baz: bam}", + "result": null + }, + { + "comment": "Trailing comma", + "expression": "a.{foo: bar, }", + "error": "syntax" + }, + { + "comment": "Missing key in second key-value pair", + "expression": "a.{foo: bar, baz}", + "error": "syntax" + }, + { + "comment": "Missing value in second key-value pair", + "expression": "a.{foo: bar, baz:}", + "error": "syntax" + }, + { + "comment": "Trailing comma", + "expression": "a.{foo: bar, baz: bam, }", + "error": "syntax" + }, + { + "comment": "Nested multi select", + "expression": "{\"\\\\\":{\" \":*}}", + "result": {"\\": {" ": ["object"]}} + } + ] + }, + { + "comment": "Or expressions", + "given": {"type": "object"}, + "cases": [ + { + "expression": "foo || bar", + "result": null + }, + { + "expression": "foo ||", + "error": "syntax" + }, + { + "expression": "foo.|| bar", + "error": "syntax" + }, + { + "expression": " || foo", + "error": "syntax" + }, + { + "expression": "foo || || foo", + "error": "syntax" + }, + { + "expression": "foo.[a || b]", + "result": null + }, + { + "expression": "foo.[a ||]", + "error": "syntax" + }, + { + "expression": "\"foo", + "error": "syntax" + } + ] + }, + { + "comment": "Filter expressions", + "given": {"type": "object"}, + "cases": [ + { + "expression": "foo[?bar==`\"baz\"`]", + "result": null + }, + { + "expression": "foo[? bar == `\"baz\"` ]", + "result": null + }, + { + "expression": "foo[ ?bar==`\"baz\"`]", + "error": "syntax" + }, + { + "expression": "foo[?bar==]", + "error": "syntax" + }, + { + "expression": "foo[?==]", + "error": "syntax" + }, + { + "expression": "foo[?==bar]", + "error": "syntax" + }, + { + "expression": "foo[?bar==baz?]", + "error": "syntax" + }, + { + "expression": "foo[?a.b.c==d.e.f]", + "result": null + }, + { + "expression": "foo[?bar==`[0, 1, 2]`]", + "result": null + }, + { + "expression": "foo[?bar==`[\"a\", \"b\", \"c\"]`]", + "result": null + }, + { + "comment": "Literal char not escaped", + "expression": "foo[?bar==`[\"foo`bar\"]`]", + "error": "syntax" + }, + { + "comment": "Literal char escaped", + "expression": "foo[?bar==`[\"foo\\`bar\"]`]", + "result": null + }, + { + "comment": "Unknown comparator", + "expression": "foo[?bar<>baz]", + "error": "syntax" + }, + { + "comment": "Unknown comparator", + "expression": "foo[?bar^baz]", + "error": "syntax" + }, + { + "expression": "foo[bar==baz]", + "error": "syntax" + }, + { + "comment": "Quoted identifier in filter expression no spaces", + "expression": "[?\"\\\\\">`\"foo\"`]", + "result": null + }, + { + "comment": "Quoted identifier in filter expression with spaces", + "expression": "[?\"\\\\\" > `\"foo\"`]", + "result": null + } + ] + }, + { + "comment": "Filter expression errors", + "given": {"type": "object"}, + "cases": [ + { + "expression": "bar.`\"anything\"`", + "error": "syntax" + }, + { + "expression": "bar.baz.noexists.`\"literal\"`", + "error": "syntax" + }, + { + "comment": "Literal wildcard projection", + "expression": "foo[*].`\"literal\"`", + "error": "syntax" + }, + { + "expression": "foo[*].name.`\"literal\"`", + "error": "syntax" + }, + { + "expression": "foo[].name.`\"literal\"`", + "error": "syntax" + }, + { + "expression": "foo[].name.`\"literal\"`.`\"subliteral\"`", + "error": "syntax" + }, + { + "comment": "Projecting a literal onto an empty list", + "expression": "foo[*].name.noexist.`\"literal\"`", + "error": "syntax" + }, + { + "expression": "foo[].name.noexist.`\"literal\"`", + "error": "syntax" + }, + { + "expression": "twolen[*].`\"foo\"`", + "error": "syntax" + }, + { + "comment": "Two level projection of a literal", + "expression": "twolen[*].threelen[*].`\"bar\"`", + "error": "syntax" + }, + { + "comment": "Two level flattened projection of a literal", + "expression": "twolen[].threelen[].`\"bar\"`", + "error": "syntax" + } + ] + }, + { + "comment": "Identifiers", + "given": {"type": "object"}, + "cases": [ + { + "expression": "foo", + "result": null + }, + { + "expression": "\"foo\"", + "result": null + }, + { + "expression": "\"\\\\\"", + "result": null + } + ] + }, + { + "comment": "Combined syntax", + "given": [], + "cases": [ + { + "expression": "*||*|*|*", + "result": null + }, + { + "expression": "*[]||[*]", + "result": [] + }, + { + "expression": "[*.*]", + "result": [null] + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json new file mode 100644 index 00000000000..6b07b0b6dae --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/unicode.json @@ -0,0 +1,38 @@ +[ + { + "given": {"foo": [{"✓": "✓"}, {"✓": "✗"}]}, + "cases": [ + { + "expression": "foo[].\"✓\"", + "result": ["✓", "✗"] + } + ] + }, + { + "given": {"☯": true}, + "cases": [ + { + "expression": "\"☯\"", + "result": true + } + ] + }, + { + "given": {"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪": true}, + "cases": [ + { + "expression": "\"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪\"", + "result": true + } + ] + }, + { + "given": {"☃": true}, + "cases": [ + { + "expression": "\"☃\"", + "result": true + } + ] + } +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json new file mode 100644 index 00000000000..3bcec302815 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance/wildcard.json @@ -0,0 +1,460 @@ +[{ + "given": { + "foo": { + "bar": { + "baz": "val" + }, + "other": { + "baz": "val" + }, + "other2": { + "baz": "val" + }, + "other3": { + "notbaz": ["a", "b", "c"] + }, + "other4": { + "notbaz": ["a", "b", "c"] + }, + "other5": { + "other": { + "a": 1, + "b": 1, + "c": 1 + } + } + } + }, + "cases": [ + { + "expression": "foo.*.baz", + "result": ["val", "val", "val"] + }, + { + "expression": "foo.bar.*", + "result": ["val"] + }, + { + "expression": "foo.*.notbaz", + "result": [["a", "b", "c"], ["a", "b", "c"]] + }, + { + "expression": "foo.*.notbaz[0]", + "result": ["a", "a"] + }, + { + "expression": "foo.*.notbaz[-1]", + "result": ["c", "c"] + } + ] +}, { + "given": { + "foo": { + "first-1": { + "second-1": "val" + }, + "first-2": { + "second-1": "val" + }, + "first-3": { + "second-1": "val" + } + } + }, + "cases": [ + { + "expression": "foo.*", + "result": [{"second-1": "val"}, {"second-1": "val"}, + {"second-1": "val"}] + }, + { + "expression": "foo.*.*", + "result": [["val"], ["val"], ["val"]] + }, + { + "expression": "foo.*.*.*", + "result": [[], [], []] + }, + { + "expression": "foo.*.*.*.*", + "result": [[], [], []] + } + ] +}, { + "given": { + "foo": { + "bar": "one" + }, + "other": { + "bar": "one" + }, + "nomatch": { + "notbar": "three" + } + }, + "cases": [ + { + "expression": "*.bar", + "result": ["one", "one"] + } + ] +}, { + "given": { + "top1": { + "sub1": {"foo": "one"} + }, + "top2": { + "sub1": {"foo": "one"} + } + }, + "cases": [ + { + "expression": "*", + "result": [{"sub1": {"foo": "one"}}, + {"sub1": {"foo": "one"}}] + }, + { + "expression": "*.sub1", + "result": [{"foo": "one"}, + {"foo": "one"}] + }, + { + "expression": "*.*", + "result": [[{"foo": "one"}], + [{"foo": "one"}]] + }, + { + "expression": "*.*.foo[]", + "result": ["one", "one"] + }, + { + "expression": "*.sub1.foo", + "result": ["one", "one"] + } + ] +}, +{ + "given": + {"foo": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}]}, + "cases": [ + { + "expression": "foo[*].bar", + "result": ["one", "two", "three"] + }, + { + "expression": "foo[*].notbar", + "result": ["four"] + } + ] +}, +{ + "given": + [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}], + "cases": [ + { + "expression": "[*]", + "result": [{"bar": "one"}, {"bar": "two"}, {"bar": "three"}, {"notbar": "four"}] + }, + { + "expression": "[*].bar", + "result": ["one", "two", "three"] + }, + { + "expression": "[*].notbar", + "result": ["four"] + } + ] +}, +{ + "given": { + "foo": { + "bar": [ + {"baz": ["one", "two", "three"]}, + {"baz": ["four", "five", "six"]}, + {"baz": ["seven", "eight", "nine"]} + ] + } + }, + "cases": [ + { + "expression": "foo.bar[*].baz", + "result": [["one", "two", "three"], ["four", "five", "six"], ["seven", "eight", "nine"]] + }, + { + "expression": "foo.bar[*].baz[0]", + "result": ["one", "four", "seven"] + }, + { + "expression": "foo.bar[*].baz[1]", + "result": ["two", "five", "eight"] + }, + { + "expression": "foo.bar[*].baz[2]", + "result": ["three", "six", "nine"] + }, + { + "expression": "foo.bar[*].baz[3]", + "result": [] + } + ] +}, +{ + "given": { + "foo": { + "bar": [["one", "two"], ["three", "four"]] + } + }, + "cases": [ + { + "expression": "foo.bar[*]", + "result": [["one", "two"], ["three", "four"]] + }, + { + "expression": "foo.bar[0]", + "result": ["one", "two"] + }, + { + "expression": "foo.bar[0][0]", + "result": "one" + }, + { + "expression": "foo.bar[0][0][0]", + "result": null + }, + { + "expression": "foo.bar[0][0][0][0]", + "result": null + }, + { + "expression": "foo[0][0]", + "result": null + } + ] +}, +{ + "given": { + "foo": [ + {"bar": [{"kind": "basic"}, {"kind": "intermediate"}]}, + {"bar": [{"kind": "advanced"}, {"kind": "expert"}]}, + {"bar": "string"} + ] + + }, + "cases": [ + { + "expression": "foo[*].bar[*].kind", + "result": [["basic", "intermediate"], ["advanced", "expert"]] + }, + { + "expression": "foo[*].bar[0].kind", + "result": ["basic", "advanced"] + } + ] +}, +{ + "given": { + "foo": [ + {"bar": {"kind": "basic"}}, + {"bar": {"kind": "intermediate"}}, + {"bar": {"kind": "advanced"}}, + {"bar": {"kind": "expert"}}, + {"bar": "string"} + ] + }, + "cases": [ + { + "expression": "foo[*].bar.kind", + "result": ["basic", "intermediate", "advanced", "expert"] + } + ] +}, +{ + "given": { + "foo": [{"bar": ["one", "two"]}, {"bar": ["three", "four"]}, {"bar": ["five"]}] + }, + "cases": [ + { + "expression": "foo[*].bar[0]", + "result": ["one", "three", "five"] + }, + { + "expression": "foo[*].bar[1]", + "result": ["two", "four"] + }, + { + "expression": "foo[*].bar[2]", + "result": [] + } + ] +}, +{ + "given": { + "foo": [{"bar": []}, {"bar": []}, {"bar": []}] + }, + "cases": [ + { + "expression": "foo[*].bar[0]", + "result": [] + } + ] +}, +{ + "given": { + "foo": [["one", "two"], ["three", "four"], ["five"]] + }, + "cases": [ + { + "expression": "foo[*][0]", + "result": ["one", "three", "five"] + }, + { + "expression": "foo[*][1]", + "result": ["two", "four"] + } + ] +}, +{ + "given": { + "foo": [ + [ + ["one", "two"], ["three", "four"] + ], [ + ["five", "six"], ["seven", "eight"] + ], [ + ["nine"], ["ten"] + ] + ] + }, + "cases": [ + { + "expression": "foo[*][0]", + "result": [["one", "two"], ["five", "six"], ["nine"]] + }, + { + "expression": "foo[*][1]", + "result": [["three", "four"], ["seven", "eight"], ["ten"]] + }, + { + "expression": "foo[*][0][0]", + "result": ["one", "five", "nine"] + }, + { + "expression": "foo[*][1][0]", + "result": ["three", "seven", "ten"] + }, + { + "expression": "foo[*][0][1]", + "result": ["two", "six"] + }, + { + "expression": "foo[*][1][1]", + "result": ["four", "eight"] + }, + { + "expression": "foo[*][2]", + "result": [] + }, + { + "expression": "foo[*][2][2]", + "result": [] + }, + { + "expression": "bar[*]", + "result": null + }, + { + "expression": "bar[*].baz[*]", + "result": null + } + ] +}, +{ + "given": { + "string": "string", + "hash": {"foo": "bar", "bar": "baz"}, + "number": 23, + "nullvalue": null + }, + "cases": [ + { + "expression": "string[*]", + "result": null + }, + { + "expression": "hash[*]", + "result": null + }, + { + "expression": "number[*]", + "result": null + }, + { + "expression": "nullvalue[*]", + "result": null + }, + { + "expression": "string[*].foo", + "result": null + }, + { + "expression": "hash[*].foo", + "result": null + }, + { + "expression": "number[*].foo", + "result": null + }, + { + "expression": "nullvalue[*].foo", + "result": null + }, + { + "expression": "nullvalue[*].foo[*].bar", + "result": null + } + ] +}, +{ + "given": { + "string": "string", + "hash": {"foo": "val", "bar": "val"}, + "number": 23, + "array": [1, 2, 3], + "nullvalue": null + }, + "cases": [ + { + "expression": "string.*", + "result": null + }, + { + "expression": "hash.*", + "result": ["val", "val"] + }, + { + "expression": "number.*", + "result": null + }, + { + "expression": "array.*", + "result": null + }, + { + "expression": "nullvalue.*", + "result": null + } + ] +}, +{ + "given": { + "a": [0, 1, 2], + "b": [0, 1, 2] + }, + "cases": [ + { + "expression": "*[0]", + "result": [0, 0] + } + ] +} +] diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go new file mode 100644 index 00000000000..4ee9c959dc6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/compliance_test.go @@ -0,0 +1,123 @@ +package jmespath + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" +) + +type TestSuite struct { + Given interface{} + TestCases []TestCase `json:"cases"` + Comment string +} +type TestCase struct { + Comment string + Expression string + Result interface{} + Error string +} + +var whiteListed = []string{ + "compliance/basic.json", + "compliance/current.json", + "compliance/escape.json", + "compliance/filters.json", + "compliance/functions.json", + "compliance/identifiers.json", + "compliance/indices.json", + "compliance/literal.json", + "compliance/multiselect.json", + "compliance/ormatch.json", + "compliance/pipe.json", + "compliance/slice.json", + "compliance/syntax.json", + "compliance/unicode.json", + "compliance/wildcard.json", + "compliance/boolean.json", +} + +func allowed(path string) bool { + for _, el := range whiteListed { + if el == path { + return true + } + } + return false +} + +func TestCompliance(t *testing.T) { + assert := assert.New(t) + + var complianceFiles []string + err := filepath.Walk("compliance", func(path string, _ os.FileInfo, _ error) error { + //if strings.HasSuffix(path, ".json") { + if allowed(path) { + complianceFiles = append(complianceFiles, path) + } + return nil + }) + if assert.Nil(err) { + for _, filename := range complianceFiles { + runComplianceTest(assert, filename) + } + } +} + +func runComplianceTest(assert *assert.Assertions, filename string) { + var testSuites []TestSuite + data, err := ioutil.ReadFile(filename) + if assert.Nil(err) { + err := json.Unmarshal(data, &testSuites) + if assert.Nil(err) { + for _, testsuite := range testSuites { + runTestSuite(assert, testsuite, filename) + } + } + } +} + +func runTestSuite(assert *assert.Assertions, testsuite TestSuite, filename string) { + for _, testcase := range testsuite.TestCases { + if testcase.Error != "" { + // This is a test case that verifies we error out properly. + runSyntaxTestCase(assert, testsuite.Given, testcase, filename) + } else { + runTestCase(assert, testsuite.Given, testcase, filename) + } + } +} + +func runSyntaxTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) { + // Anything with an .Error means that we expect that JMESPath should return + // an error when we try to evaluate the expression. + _, err := Search(testcase.Expression, given) + assert.NotNil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) +} + +func runTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) { + lexer := NewLexer() + var err error + _, err = lexer.tokenize(testcase.Expression) + if err != nil { + errMsg := fmt.Sprintf("(%s) Could not lex expression: %s -- %s", filename, testcase.Expression, err.Error()) + assert.Fail(errMsg) + return + } + parser := NewParser() + _, err = parser.Parse(testcase.Expression) + if err != nil { + errMsg := fmt.Sprintf("(%s) Could not parse expression: %s -- %s", filename, testcase.Expression, err.Error()) + assert.Fail(errMsg) + return + } + actual, err := Search(testcase.Expression, given) + if assert.Nil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) { + assert.Equal(testcase.Result, actual, fmt.Sprintf("Expression: %s", testcase.Expression)) + } +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go new file mode 100644 index 00000000000..8a3f2ef0dce --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/functions.go @@ -0,0 +1,840 @@ +package jmespath + +import ( + "encoding/json" + "errors" + "fmt" + "math" + "sort" + "strconv" + "strings" + "unicode/utf8" +) + +type jpFunction func(arguments []interface{}) (interface{}, error) + +type jpType string + +const ( + jpUnknown jpType = "unknown" + jpNumber jpType = "number" + jpString jpType = "string" + jpArray jpType = "array" + jpObject jpType = "object" + jpArrayNumber jpType = "array[number]" + jpArrayString jpType = "array[string]" + jpExpref jpType = "expref" + jpAny jpType = "any" +) + +type functionEntry struct { + name string + arguments []argSpec + handler jpFunction + hasExpRef bool +} + +type argSpec struct { + types []jpType + variadic bool +} + +type byExprString struct { + intr *treeInterpreter + node ASTNode + items []interface{} + hasError bool +} + +func (a *byExprString) Len() int { + return len(a.items) +} +func (a *byExprString) Swap(i, j int) { + a.items[i], a.items[j] = a.items[j], a.items[i] +} +func (a *byExprString) Less(i, j int) bool { + first, err := a.intr.Execute(a.node, a.items[i]) + if err != nil { + a.hasError = true + // Return a dummy value. + return true + } + ith, ok := first.(string) + if !ok { + a.hasError = true + return true + } + second, err := a.intr.Execute(a.node, a.items[j]) + if err != nil { + a.hasError = true + // Return a dummy value. + return true + } + jth, ok := second.(string) + if !ok { + a.hasError = true + return true + } + return ith < jth +} + +type byExprFloat struct { + intr *treeInterpreter + node ASTNode + items []interface{} + hasError bool +} + +func (a *byExprFloat) Len() int { + return len(a.items) +} +func (a *byExprFloat) Swap(i, j int) { + a.items[i], a.items[j] = a.items[j], a.items[i] +} +func (a *byExprFloat) Less(i, j int) bool { + first, err := a.intr.Execute(a.node, a.items[i]) + if err != nil { + a.hasError = true + // Return a dummy value. + return true + } + ith, ok := first.(float64) + if !ok { + a.hasError = true + return true + } + second, err := a.intr.Execute(a.node, a.items[j]) + if err != nil { + a.hasError = true + // Return a dummy value. + return true + } + jth, ok := second.(float64) + if !ok { + a.hasError = true + return true + } + return ith < jth +} + +type functionCaller struct { + functionTable map[string]functionEntry +} + +func newFunctionCaller() *functionCaller { + caller := &functionCaller{} + caller.functionTable = map[string]functionEntry{ + "length": functionEntry{ + name: "length", + arguments: []argSpec{ + argSpec{types: []jpType{jpString, jpArray, jpObject}}, + }, + handler: jpfLength, + }, + "starts_with": functionEntry{ + name: "starts_with", + arguments: []argSpec{ + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, + }, + handler: jpfStartsWith, + }, + "abs": functionEntry{ + name: "abs", + arguments: []argSpec{ + argSpec{types: []jpType{jpNumber}}, + }, + handler: jpfAbs, + }, + "avg": functionEntry{ + name: "avg", + arguments: []argSpec{ + argSpec{types: []jpType{jpArrayNumber}}, + }, + handler: jpfAvg, + }, + "ceil": functionEntry{ + name: "ceil", + arguments: []argSpec{ + argSpec{types: []jpType{jpNumber}}, + }, + handler: jpfCeil, + }, + "contains": functionEntry{ + name: "contains", + arguments: []argSpec{ + argSpec{types: []jpType{jpArray, jpString}}, + argSpec{types: []jpType{jpAny}}, + }, + handler: jpfContains, + }, + "ends_with": functionEntry{ + name: "ends_with", + arguments: []argSpec{ + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpString}}, + }, + handler: jpfEndsWith, + }, + "floor": functionEntry{ + name: "floor", + arguments: []argSpec{ + argSpec{types: []jpType{jpNumber}}, + }, + handler: jpfFloor, + }, + "map": functionEntry{ + name: "amp", + arguments: []argSpec{ + argSpec{types: []jpType{jpExpref}}, + argSpec{types: []jpType{jpArray}}, + }, + handler: jpfMap, + hasExpRef: true, + }, + "max": functionEntry{ + name: "max", + arguments: []argSpec{ + argSpec{types: []jpType{jpArrayNumber, jpArrayString}}, + }, + handler: jpfMax, + }, + "merge": functionEntry{ + name: "merge", + arguments: []argSpec{ + argSpec{types: []jpType{jpObject}, variadic: true}, + }, + handler: jpfMerge, + }, + "max_by": functionEntry{ + name: "max_by", + arguments: []argSpec{ + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, + }, + handler: jpfMaxBy, + hasExpRef: true, + }, + "sum": functionEntry{ + name: "sum", + arguments: []argSpec{ + argSpec{types: []jpType{jpArrayNumber}}, + }, + handler: jpfSum, + }, + "min": functionEntry{ + name: "min", + arguments: []argSpec{ + argSpec{types: []jpType{jpArrayNumber, jpArrayString}}, + }, + handler: jpfMin, + }, + "min_by": functionEntry{ + name: "min_by", + arguments: []argSpec{ + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, + }, + handler: jpfMinBy, + hasExpRef: true, + }, + "type": functionEntry{ + name: "type", + arguments: []argSpec{ + argSpec{types: []jpType{jpAny}}, + }, + handler: jpfType, + }, + "keys": functionEntry{ + name: "keys", + arguments: []argSpec{ + argSpec{types: []jpType{jpObject}}, + }, + handler: jpfKeys, + }, + "values": functionEntry{ + name: "values", + arguments: []argSpec{ + argSpec{types: []jpType{jpObject}}, + }, + handler: jpfValues, + }, + "sort": functionEntry{ + name: "sort", + arguments: []argSpec{ + argSpec{types: []jpType{jpArrayString, jpArrayNumber}}, + }, + handler: jpfSort, + }, + "sort_by": functionEntry{ + name: "sort_by", + arguments: []argSpec{ + argSpec{types: []jpType{jpArray}}, + argSpec{types: []jpType{jpExpref}}, + }, + handler: jpfSortBy, + hasExpRef: true, + }, + "join": functionEntry{ + name: "join", + arguments: []argSpec{ + argSpec{types: []jpType{jpString}}, + argSpec{types: []jpType{jpArrayString}}, + }, + handler: jpfJoin, + }, + "reverse": functionEntry{ + name: "reverse", + arguments: []argSpec{ + argSpec{types: []jpType{jpArray, jpString}}, + }, + handler: jpfReverse, + }, + "to_array": functionEntry{ + name: "to_array", + arguments: []argSpec{ + argSpec{types: []jpType{jpAny}}, + }, + handler: jpfToArray, + }, + "to_string": functionEntry{ + name: "to_string", + arguments: []argSpec{ + argSpec{types: []jpType{jpAny}}, + }, + handler: jpfToString, + }, + "to_number": functionEntry{ + name: "to_number", + arguments: []argSpec{ + argSpec{types: []jpType{jpAny}}, + }, + handler: jpfToNumber, + }, + "not_null": functionEntry{ + name: "not_null", + arguments: []argSpec{ + argSpec{types: []jpType{jpAny}, variadic: true}, + }, + handler: jpfNotNull, + }, + } + return caller +} + +func (e *functionEntry) resolveArgs(arguments []interface{}) ([]interface{}, error) { + if len(e.arguments) == 0 { + return arguments, nil + } + if !e.arguments[len(e.arguments)-1].variadic { + if len(e.arguments) != len(arguments) { + return nil, errors.New("incorrect number of args") + } + for i, spec := range e.arguments { + userArg := arguments[i] + err := spec.typeCheck(userArg) + if err != nil { + return nil, err + } + } + return arguments, nil + } + if len(arguments) < len(e.arguments) { + return nil, errors.New("Invalid arity.") + } + return arguments, nil +} + +func (a *argSpec) typeCheck(arg interface{}) error { + for _, t := range a.types { + switch t { + case jpNumber: + if _, ok := arg.(float64); ok { + return nil + } + case jpString: + if _, ok := arg.(string); ok { + return nil + } + case jpArray: + if _, ok := arg.([]interface{}); ok { + return nil + } + case jpObject: + if _, ok := arg.(map[string]interface{}); ok { + return nil + } + case jpArrayNumber: + if _, ok := toArrayNum(arg); ok { + return nil + } + case jpArrayString: + if _, ok := toArrayStr(arg); ok { + return nil + } + case jpAny: + return nil + case jpExpref: + if _, ok := arg.(expRef); ok { + return nil + } + } + } + return fmt.Errorf("Invalid type for: %v, expected: %#v", arg, a.types) +} + +func (f *functionCaller) CallFunction(name string, arguments []interface{}, intr *treeInterpreter) (interface{}, error) { + entry, ok := f.functionTable[name] + if !ok { + return nil, errors.New("unknown function: " + name) + } + resolvedArgs, err := entry.resolveArgs(arguments) + if err != nil { + return nil, err + } + if entry.hasExpRef { + var extra []interface{} + extra = append(extra, intr) + resolvedArgs = append(extra, resolvedArgs...) + } + return entry.handler(resolvedArgs) +} + +func jpfAbs(arguments []interface{}) (interface{}, error) { + num := arguments[0].(float64) + return math.Abs(num), nil +} + +func jpfLength(arguments []interface{}) (interface{}, error) { + arg := arguments[0] + if c, ok := arg.(string); ok { + return float64(utf8.RuneCountInString(c)), nil + } else if c, ok := arg.([]interface{}); ok { + return float64(len(c)), nil + } else if c, ok := arg.(map[string]interface{}); ok { + return float64(len(c)), nil + } + return nil, errors.New("could not compute length()") +} + +func jpfStartsWith(arguments []interface{}) (interface{}, error) { + search := arguments[0].(string) + prefix := arguments[1].(string) + return strings.HasPrefix(search, prefix), nil +} + +func jpfAvg(arguments []interface{}) (interface{}, error) { + // We've already type checked the value so we can safely use + // type assertions. + args := arguments[0].([]interface{}) + length := float64(len(args)) + numerator := 0.0 + for _, n := range args { + numerator += n.(float64) + } + return numerator / length, nil +} +func jpfCeil(arguments []interface{}) (interface{}, error) { + val := arguments[0].(float64) + return math.Ceil(val), nil +} +func jpfContains(arguments []interface{}) (interface{}, error) { + search := arguments[0] + el := arguments[1] + if searchStr, ok := search.(string); ok { + if elStr, ok := el.(string); ok { + return strings.Index(searchStr, elStr) != -1, nil + } + return false, nil + } + // Otherwise this is a generic contains for []interface{} + general := search.([]interface{}) + for _, item := range general { + if item == el { + return true, nil + } + } + return false, nil +} +func jpfEndsWith(arguments []interface{}) (interface{}, error) { + search := arguments[0].(string) + suffix := arguments[1].(string) + return strings.HasSuffix(search, suffix), nil +} +func jpfFloor(arguments []interface{}) (interface{}, error) { + val := arguments[0].(float64) + return math.Floor(val), nil +} +func jpfMap(arguments []interface{}) (interface{}, error) { + intr := arguments[0].(*treeInterpreter) + exp := arguments[1].(expRef) + node := exp.ref + arr := arguments[2].([]interface{}) + mapped := make([]interface{}, 0, len(arr)) + for _, value := range arr { + current, err := intr.Execute(node, value) + if err != nil { + return nil, err + } + mapped = append(mapped, current) + } + return mapped, nil +} +func jpfMax(arguments []interface{}) (interface{}, error) { + if items, ok := toArrayNum(arguments[0]); ok { + if len(items) == 0 { + return nil, nil + } + if len(items) == 1 { + return items[0], nil + } + best := items[0] + for _, item := range items[1:] { + if item > best { + best = item + } + } + return best, nil + } + // Otherwise we're dealing with a max() of strings. + items, _ := toArrayStr(arguments[0]) + if len(items) == 0 { + return nil, nil + } + if len(items) == 1 { + return items[0], nil + } + best := items[0] + for _, item := range items[1:] { + if item > best { + best = item + } + } + return best, nil +} +func jpfMerge(arguments []interface{}) (interface{}, error) { + final := make(map[string]interface{}) + for _, m := range arguments { + mapped := m.(map[string]interface{}) + for key, value := range mapped { + final[key] = value + } + } + return final, nil +} +func jpfMaxBy(arguments []interface{}) (interface{}, error) { + intr := arguments[0].(*treeInterpreter) + arr := arguments[1].([]interface{}) + exp := arguments[2].(expRef) + node := exp.ref + if len(arr) == 0 { + return nil, nil + } else if len(arr) == 1 { + return arr[0], nil + } + start, err := intr.Execute(node, arr[0]) + if err != nil { + return nil, err + } + switch t := start.(type) { + case float64: + bestVal := t + bestItem := arr[0] + for _, item := range arr[1:] { + result, err := intr.Execute(node, item) + if err != nil { + return nil, err + } + current, ok := result.(float64) + if !ok { + return nil, errors.New("invalid type, must be number") + } + if current > bestVal { + bestVal = current + bestItem = item + } + } + return bestItem, nil + case string: + bestVal := t + bestItem := arr[0] + for _, item := range arr[1:] { + result, err := intr.Execute(node, item) + if err != nil { + return nil, err + } + current, ok := result.(string) + if !ok { + return nil, errors.New("invalid type, must be string") + } + if current > bestVal { + bestVal = current + bestItem = item + } + } + return bestItem, nil + default: + return nil, errors.New("invalid type, must be number of string") + } +} +func jpfSum(arguments []interface{}) (interface{}, error) { + items, _ := toArrayNum(arguments[0]) + sum := 0.0 + for _, item := range items { + sum += item + } + return sum, nil +} + +func jpfMin(arguments []interface{}) (interface{}, error) { + if items, ok := toArrayNum(arguments[0]); ok { + if len(items) == 0 { + return nil, nil + } + if len(items) == 1 { + return items[0], nil + } + best := items[0] + for _, item := range items[1:] { + if item < best { + best = item + } + } + return best, nil + } + items, _ := toArrayStr(arguments[0]) + if len(items) == 0 { + return nil, nil + } + if len(items) == 1 { + return items[0], nil + } + best := items[0] + for _, item := range items[1:] { + if item < best { + best = item + } + } + return best, nil +} + +func jpfMinBy(arguments []interface{}) (interface{}, error) { + intr := arguments[0].(*treeInterpreter) + arr := arguments[1].([]interface{}) + exp := arguments[2].(expRef) + node := exp.ref + if len(arr) == 0 { + return nil, nil + } else if len(arr) == 1 { + return arr[0], nil + } + start, err := intr.Execute(node, arr[0]) + if err != nil { + return nil, err + } + if t, ok := start.(float64); ok { + bestVal := t + bestItem := arr[0] + for _, item := range arr[1:] { + result, err := intr.Execute(node, item) + if err != nil { + return nil, err + } + current, ok := result.(float64) + if !ok { + return nil, errors.New("invalid type, must be number") + } + if current < bestVal { + bestVal = current + bestItem = item + } + } + return bestItem, nil + } else if t, ok := start.(string); ok { + bestVal := t + bestItem := arr[0] + for _, item := range arr[1:] { + result, err := intr.Execute(node, item) + if err != nil { + return nil, err + } + current, ok := result.(string) + if !ok { + return nil, errors.New("invalid type, must be string") + } + if current < bestVal { + bestVal = current + bestItem = item + } + } + return bestItem, nil + } else { + return nil, errors.New("invalid type, must be number of string") + } +} +func jpfType(arguments []interface{}) (interface{}, error) { + arg := arguments[0] + if _, ok := arg.(float64); ok { + return "number", nil + } + if _, ok := arg.(string); ok { + return "string", nil + } + if _, ok := arg.([]interface{}); ok { + return "array", nil + } + if _, ok := arg.(map[string]interface{}); ok { + return "object", nil + } + if arg == nil { + return "null", nil + } + if arg == true || arg == false { + return "boolean", nil + } + return nil, errors.New("unknown type") +} +func jpfKeys(arguments []interface{}) (interface{}, error) { + arg := arguments[0].(map[string]interface{}) + collected := make([]interface{}, 0, len(arg)) + for key := range arg { + collected = append(collected, key) + } + return collected, nil +} +func jpfValues(arguments []interface{}) (interface{}, error) { + arg := arguments[0].(map[string]interface{}) + collected := make([]interface{}, 0, len(arg)) + for _, value := range arg { + collected = append(collected, value) + } + return collected, nil +} +func jpfSort(arguments []interface{}) (interface{}, error) { + if items, ok := toArrayNum(arguments[0]); ok { + d := sort.Float64Slice(items) + sort.Stable(d) + final := make([]interface{}, len(d)) + for i, val := range d { + final[i] = val + } + return final, nil + } + // Otherwise we're dealing with sort()'ing strings. + items, _ := toArrayStr(arguments[0]) + d := sort.StringSlice(items) + sort.Stable(d) + final := make([]interface{}, len(d)) + for i, val := range d { + final[i] = val + } + return final, nil +} +func jpfSortBy(arguments []interface{}) (interface{}, error) { + intr := arguments[0].(*treeInterpreter) + arr := arguments[1].([]interface{}) + exp := arguments[2].(expRef) + node := exp.ref + if len(arr) == 0 { + return arr, nil + } else if len(arr) == 1 { + return arr, nil + } + start, err := intr.Execute(node, arr[0]) + if err != nil { + return nil, err + } + if _, ok := start.(float64); ok { + sortable := &byExprFloat{intr, node, arr, false} + sort.Stable(sortable) + if sortable.hasError { + return nil, errors.New("error in sort_by comparison") + } + return arr, nil + } else if _, ok := start.(string); ok { + sortable := &byExprString{intr, node, arr, false} + sort.Stable(sortable) + if sortable.hasError { + return nil, errors.New("error in sort_by comparison") + } + return arr, nil + } else { + return nil, errors.New("invalid type, must be number of string") + } +} +func jpfJoin(arguments []interface{}) (interface{}, error) { + sep := arguments[0].(string) + // We can't just do arguments[1].([]string), we have to + // manually convert each item to a string. + arrayStr := []string{} + for _, item := range arguments[1].([]interface{}) { + arrayStr = append(arrayStr, item.(string)) + } + return strings.Join(arrayStr, sep), nil +} +func jpfReverse(arguments []interface{}) (interface{}, error) { + if s, ok := arguments[0].(string); ok { + r := []rune(s) + for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { + r[i], r[j] = r[j], r[i] + } + return string(r), nil + } + items := arguments[0].([]interface{}) + length := len(items) + reversed := make([]interface{}, length) + for i, item := range items { + reversed[length-(i+1)] = item + } + return reversed, nil +} +func jpfToArray(arguments []interface{}) (interface{}, error) { + if _, ok := arguments[0].([]interface{}); ok { + return arguments[0], nil + } + return arguments[:1:1], nil +} +func jpfToString(arguments []interface{}) (interface{}, error) { + if v, ok := arguments[0].(string); ok { + return v, nil + } + result, err := json.Marshal(arguments[0]) + if err != nil { + return nil, err + } + return string(result), nil +} +func jpfToNumber(arguments []interface{}) (interface{}, error) { + arg := arguments[0] + if v, ok := arg.(float64); ok { + return v, nil + } + if v, ok := arg.(string); ok { + conv, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil, nil + } + return conv, nil + } + if _, ok := arg.([]interface{}); ok { + return nil, nil + } + if _, ok := arg.(map[string]interface{}); ok { + return nil, nil + } + if arg == nil { + return nil, nil + } + if arg == true || arg == false { + return nil, nil + } + return nil, errors.New("unknown type") +} +func jpfNotNull(arguments []interface{}) (interface{}, error) { + for _, arg := range arguments { + if arg != nil { + return arg, nil + } + } + return nil, nil +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-1 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 new file mode 100644 index 00000000000..4d5f9756e55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-10 @@ -0,0 +1 @@ +foo.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 new file mode 100644 index 00000000000..bc4f6a3f49c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-100 @@ -0,0 +1 @@ +ends_with(str, 'SStr') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 new file mode 100644 index 00000000000..81bf07a7a1b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-101 @@ -0,0 +1 @@ +ends_with(str, 'foo') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 new file mode 100644 index 00000000000..3225de91399 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-102 @@ -0,0 +1 @@ +floor(`1.2`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 new file mode 100644 index 00000000000..8cac9595822 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-103 @@ -0,0 +1 @@ +floor(decimals[0]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 new file mode 100644 index 00000000000..bd76f47e216 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-104 @@ -0,0 +1 @@ +floor(foo) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 new file mode 100644 index 00000000000..c719add3deb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-105 @@ -0,0 +1 @@ +length('abc') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 new file mode 100644 index 00000000000..ff12f04f148 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-106 @@ -0,0 +1 @@ +length('') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 new file mode 100644 index 00000000000..0eccba1d3a0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-107 @@ -0,0 +1 @@ +length(@) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 new file mode 100644 index 00000000000..ab14b0fa8e6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-108 @@ -0,0 +1 @@ +length(strings[0]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 new file mode 100644 index 00000000000..f1514bb7438 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-109 @@ -0,0 +1 @@ +length(str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 new file mode 100644 index 00000000000..09276059a23 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-110 @@ -0,0 +1 @@ +length(array) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 new file mode 100644 index 00000000000..ab14b0fa8e6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-112 @@ -0,0 +1 @@ +length(strings[0]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 new file mode 100644 index 00000000000..bfb41ae9875 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-115 @@ -0,0 +1 @@ +max(strings) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 new file mode 100644 index 00000000000..915ec172ae7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-118 @@ -0,0 +1 @@ +merge(`{}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 new file mode 100644 index 00000000000..5b74e9b593f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-119 @@ -0,0 +1 @@ +merge(`{}`, `{}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 new file mode 100644 index 00000000000..64c5e5885a4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-12 @@ -0,0 +1 @@ +two \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 new file mode 100644 index 00000000000..f34dcd8fade --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-120 @@ -0,0 +1 @@ +merge(`{"a": 1}`, `{"b": 2}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 new file mode 100644 index 00000000000..e335dc96fea --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-121 @@ -0,0 +1 @@ +merge(`{"a": 1}`, `{"a": 2}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 new file mode 100644 index 00000000000..aac28fffeb3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-122 @@ -0,0 +1 @@ +merge(`{"a": 1, "b": 2}`, `{"a": 2, "c": 3}`, `{"d": 4}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 new file mode 100644 index 00000000000..1c6fd67198e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-123 @@ -0,0 +1 @@ +min(numbers) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 new file mode 100644 index 00000000000..93e68db7759 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-126 @@ -0,0 +1 @@ +min(decimals) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 new file mode 100644 index 00000000000..554601ea427 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-128 @@ -0,0 +1 @@ +type('abc') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 new file mode 100644 index 00000000000..1ab2d9834f8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-129 @@ -0,0 +1 @@ +type(`1.0`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 new file mode 100644 index 00000000000..1d19714ffbc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-13 @@ -0,0 +1 @@ +three \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 new file mode 100644 index 00000000000..3cee2f56f15 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-130 @@ -0,0 +1 @@ +type(`2`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 new file mode 100644 index 00000000000..4821f9aefcf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-131 @@ -0,0 +1 @@ +type(`true`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 new file mode 100644 index 00000000000..40b6913a6c0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-132 @@ -0,0 +1 @@ +type(`false`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 new file mode 100644 index 00000000000..c711252be28 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-133 @@ -0,0 +1 @@ +type(`null`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 new file mode 100644 index 00000000000..ec5d07e95cc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-134 @@ -0,0 +1 @@ +type(`[0]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 new file mode 100644 index 00000000000..2080401e1ea --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-135 @@ -0,0 +1 @@ +type(`{"a": "b"}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 new file mode 100644 index 00000000000..c5ee2ba5cb8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-136 @@ -0,0 +1 @@ +type(@) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 new file mode 100644 index 00000000000..1814ca17b87 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-137 @@ -0,0 +1 @@ +keys(objects) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 new file mode 100644 index 00000000000..e03cdb0d640 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-138 @@ -0,0 +1 @@ +values(objects) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 new file mode 100644 index 00000000000..7fea8d2ce5c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-139 @@ -0,0 +1 @@ +keys(empty_hash) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 new file mode 100644 index 00000000000..a17c92f5974 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-14 @@ -0,0 +1 @@ +one.two \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 new file mode 100644 index 00000000000..4f1d882a406 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-140 @@ -0,0 +1 @@ +join(', ', strings) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 new file mode 100644 index 00000000000..4f1d882a406 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-141 @@ -0,0 +1 @@ +join(', ', strings) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 new file mode 100644 index 00000000000..19ec1fe0900 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-142 @@ -0,0 +1 @@ +join(',', `["a", "b"]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 new file mode 100644 index 00000000000..761c68a6b59 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-143 @@ -0,0 +1 @@ +join('|', strings) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 new file mode 100644 index 00000000000..a0dd68eaa90 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-144 @@ -0,0 +1 @@ +join('|', decimals[].to_string(@)) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 new file mode 100644 index 00000000000..a4190b2ba25 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-145 @@ -0,0 +1 @@ +join('|', empty_list) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 new file mode 100644 index 00000000000..f5033c30223 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-146 @@ -0,0 +1 @@ +reverse(numbers) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 new file mode 100644 index 00000000000..822f054d50c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-147 @@ -0,0 +1 @@ +reverse(array) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 new file mode 100644 index 00000000000..a584adcc0c5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-148 @@ -0,0 +1 @@ +reverse(`[]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 new file mode 100644 index 00000000000..fb4cc5dc482 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-149 @@ -0,0 +1 @@ +reverse('') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 new file mode 100644 index 00000000000..693f9549627 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-15 @@ -0,0 +1 @@ +foo."1" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 new file mode 100644 index 00000000000..aa260fabc17 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-150 @@ -0,0 +1 @@ +reverse('hello world') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 new file mode 100644 index 00000000000..d8c58826afd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-151 @@ -0,0 +1 @@ +starts_with(str, 'S') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 new file mode 100644 index 00000000000..32e16b7bb00 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-152 @@ -0,0 +1 @@ +starts_with(str, 'St') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 new file mode 100644 index 00000000000..5f575ae7fc4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-153 @@ -0,0 +1 @@ +starts_with(str, 'Str') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 new file mode 100644 index 00000000000..f31551c62fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-155 @@ -0,0 +1 @@ +sum(numbers) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 new file mode 100644 index 00000000000..18b90446cc9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-156 @@ -0,0 +1 @@ +sum(decimals) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 new file mode 100644 index 00000000000..def4d0bc19c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-157 @@ -0,0 +1 @@ +sum(array[].to_number(@)) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 new file mode 100644 index 00000000000..48e4a7707c7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-158 @@ -0,0 +1 @@ +sum(`[]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 new file mode 100644 index 00000000000..9fb939a0b1b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-159 @@ -0,0 +1 @@ +to_array('foo') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 new file mode 100644 index 00000000000..86155ed7546 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-16 @@ -0,0 +1 @@ +foo."1"[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 new file mode 100644 index 00000000000..74ba7cc67db --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-160 @@ -0,0 +1 @@ +to_array(`0`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 new file mode 100644 index 00000000000..57f8b983f08 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-161 @@ -0,0 +1 @@ +to_array(objects) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 new file mode 100644 index 00000000000..d17c7345faf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-162 @@ -0,0 +1 @@ +to_array(`[1, 2, 3]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 new file mode 100644 index 00000000000..15f70f78399 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-163 @@ -0,0 +1 @@ +to_array(false) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 new file mode 100644 index 00000000000..9b227529b40 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-164 @@ -0,0 +1 @@ +to_string('foo') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 new file mode 100644 index 00000000000..489a42935a6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-165 @@ -0,0 +1 @@ +to_string(`1.2`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 new file mode 100644 index 00000000000..d17106a00f5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-166 @@ -0,0 +1 @@ +to_string(`[0, 1]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 new file mode 100644 index 00000000000..4f4ae9e6890 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-167 @@ -0,0 +1 @@ +to_number('1.0') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 new file mode 100644 index 00000000000..ce932e2e6ac --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-168 @@ -0,0 +1 @@ +to_number('1.1') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 new file mode 100644 index 00000000000..e246fa4dbcb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-169 @@ -0,0 +1 @@ +to_number('4') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 new file mode 100644 index 00000000000..de0b4c39d99 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-17 @@ -0,0 +1 @@ +foo."-1" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 new file mode 100644 index 00000000000..f8c264747e9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-170 @@ -0,0 +1 @@ +to_number('notanumber') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 new file mode 100644 index 00000000000..7d423b1cd19 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-171 @@ -0,0 +1 @@ +to_number(`false`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 new file mode 100644 index 00000000000..503716b687c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-172 @@ -0,0 +1 @@ +to_number(`null`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 new file mode 100644 index 00000000000..7f61dfa157b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-173 @@ -0,0 +1 @@ +to_number(`[0]`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 new file mode 100644 index 00000000000..ee72a8c01ac --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-174 @@ -0,0 +1 @@ +to_number(`{"foo": 0}`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 new file mode 100644 index 00000000000..8d8f1f75906 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-175 @@ -0,0 +1 @@ +sort(numbers) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 new file mode 100644 index 00000000000..8cb54ba47b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-178 @@ -0,0 +1 @@ +sort(empty_list) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 new file mode 100644 index 00000000000..cf2c9b1db2e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-179 @@ -0,0 +1 @@ +not_null(unknown_key, str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 new file mode 100644 index 00000000000..b516b2c489f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-18 @@ -0,0 +1 @@ +@ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 new file mode 100644 index 00000000000..e047d486682 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-180 @@ -0,0 +1 @@ +not_null(unknown_key, foo.bar, empty_list, str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 new file mode 100644 index 00000000000..c4cc87b9c12 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-181 @@ -0,0 +1 @@ +not_null(unknown_key, null_key, empty_list, str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 new file mode 100644 index 00000000000..2c7fa0a9c1e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-182 @@ -0,0 +1 @@ +not_null(all, expressions, are_null) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 new file mode 100644 index 00000000000..eb096e61cdd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-183 @@ -0,0 +1 @@ +numbers[].to_string(@) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 new file mode 100644 index 00000000000..4958abaec45 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-184 @@ -0,0 +1 @@ +array[].to_number(@) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 new file mode 100644 index 00000000000..1027084724d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-185 @@ -0,0 +1 @@ +foo[].not_null(f, e, d, c, b, a) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 new file mode 100644 index 00000000000..83cb9161282 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-186 @@ -0,0 +1 @@ +sort_by(people, &age) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 new file mode 100644 index 00000000000..a494d6c4bf1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-187 @@ -0,0 +1 @@ +sort_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 new file mode 100644 index 00000000000..2294fc54d12 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-188 @@ -0,0 +1 @@ +sort_by(people, &age)[].name \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 new file mode 100644 index 00000000000..bb8c2b46d1f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-189 @@ -0,0 +1 @@ +sort_by(people, &age)[].extra \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 new file mode 100644 index 00000000000..e3ed49ac653 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-19 @@ -0,0 +1 @@ +@.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 new file mode 100644 index 00000000000..3ab0290340a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-190 @@ -0,0 +1 @@ +sort_by(`[]`, &age) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 new file mode 100644 index 00000000000..97db56f7b67 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-191 @@ -0,0 +1 @@ +max_by(people, &age) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 new file mode 100644 index 00000000000..a7e648de963 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-192 @@ -0,0 +1 @@ +max_by(people, &age_str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 new file mode 100644 index 00000000000..be4348d0c1e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-193 @@ -0,0 +1 @@ +max_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 new file mode 100644 index 00000000000..a707283d499 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-194 @@ -0,0 +1 @@ +min_by(people, &age) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 new file mode 100644 index 00000000000..2cd6618d84b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-195 @@ -0,0 +1 @@ +min_by(people, &age_str) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 new file mode 100644 index 00000000000..833e6837382 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-196 @@ -0,0 +1 @@ +min_by(people, &to_number(age_str)) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 new file mode 100644 index 00000000000..706dbda89a8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-198 @@ -0,0 +1 @@ +__L \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 new file mode 100644 index 00000000000..ca593ca93c1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-199 @@ -0,0 +1 @@ +"!\r" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 new file mode 100644 index 00000000000..4d5f9756e55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-2 @@ -0,0 +1 @@ +foo.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 new file mode 100644 index 00000000000..f300ab91782 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-20 @@ -0,0 +1 @@ +@.foo[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 new file mode 100644 index 00000000000..9c93843541d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-200 @@ -0,0 +1 @@ +Y_1623 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 new file mode 100644 index 00000000000..c1b0730e013 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-201 @@ -0,0 +1 @@ +x \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 new file mode 100644 index 00000000000..1552ec63a6f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-202 @@ -0,0 +1 @@ +"\tF\uCebb" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 new file mode 100644 index 00000000000..047041273f0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-203 @@ -0,0 +1 @@ +" \t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 new file mode 100644 index 00000000000..efd782cc325 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-204 @@ -0,0 +1 @@ +" " \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 new file mode 100644 index 00000000000..8494ac27064 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-205 @@ -0,0 +1 @@ +v2 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 new file mode 100644 index 00000000000..c61f7f7ebd8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-206 @@ -0,0 +1 @@ +"\t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 new file mode 100644 index 00000000000..f6055f1898f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-207 @@ -0,0 +1 @@ +_X \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 new file mode 100644 index 00000000000..4f58e0e7bd2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-208 @@ -0,0 +1 @@ +"\t4\ud9da\udd15" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 new file mode 100644 index 00000000000..f536bfbf687 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-209 @@ -0,0 +1 @@ +v24_W \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 new file mode 100644 index 00000000000..ef47ff2c056 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-21 @@ -0,0 +1 @@ +"foo.bar" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 new file mode 100644 index 00000000000..69759281cb4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-210 @@ -0,0 +1 @@ +"H" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 new file mode 100644 index 00000000000..c3e8b5927fb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-211 @@ -0,0 +1 @@ +"\f" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 new file mode 100644 index 00000000000..24ecc222cbf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-212 @@ -0,0 +1 @@ +"E4" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 new file mode 100644 index 00000000000..5693009d2e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-213 @@ -0,0 +1 @@ +"!" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 new file mode 100644 index 00000000000..62dd220e719 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-214 @@ -0,0 +1 @@ +tM \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 new file mode 100644 index 00000000000..3c1e81f55ae --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-215 @@ -0,0 +1 @@ +" [" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 new file mode 100644 index 00000000000..493daa673c4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-216 @@ -0,0 +1 @@ +"R!" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 new file mode 100644 index 00000000000..116b50ab38b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-217 @@ -0,0 +1 @@ +_6W \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 new file mode 100644 index 00000000000..0073fac4520 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-218 @@ -0,0 +1 @@ +"\uaBA1\r" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 new file mode 100644 index 00000000000..00d8fa37eeb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-219 @@ -0,0 +1 @@ +tL7 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 new file mode 100644 index 00000000000..661ebcfa337 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-22 @@ -0,0 +1 @@ +"foo bar" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 new file mode 100644 index 00000000000..c14f16e0264 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-220 @@ -0,0 +1 @@ +"<" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 new file mode 100644 index 00000000000..8a2443e6e90 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-257 @@ -0,0 +1 @@ +hvu \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 new file mode 100644 index 00000000000..c9ddacbb61f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-258 @@ -0,0 +1 @@ +"; !" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 new file mode 100644 index 00000000000..d0209c6df0a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-259 @@ -0,0 +1 @@ +hU \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 new file mode 100644 index 00000000000..82649bd24ee --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-26 @@ -0,0 +1 @@ +"/unix/path" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 new file mode 100644 index 00000000000..c07242aa44b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-260 @@ -0,0 +1 @@ +"!I\n\/" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 new file mode 100644 index 00000000000..7aae4effc7c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-261 @@ -0,0 +1 @@ +"\uEEbF" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 new file mode 100644 index 00000000000..c1574f35ffa --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-262 @@ -0,0 +1 @@ +"U)\t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 new file mode 100644 index 00000000000..5197e3a2bf5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-263 @@ -0,0 +1 @@ +fa0_9 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 new file mode 100644 index 00000000000..320558b0053 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-264 @@ -0,0 +1 @@ +"/" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 new file mode 100644 index 00000000000..4a2cb086527 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-265 @@ -0,0 +1 @@ +Gy \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 new file mode 100644 index 00000000000..9524c83813c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-266 @@ -0,0 +1 @@ +"\b" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 new file mode 100644 index 00000000000..066b8d98b78 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-267 @@ -0,0 +1 @@ +"<" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 new file mode 100644 index 00000000000..c61f7f7ebd8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-268 @@ -0,0 +1 @@ +"\t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 new file mode 100644 index 00000000000..a582f62d282 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-269 @@ -0,0 +1 @@ +"\t&\\\r" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 new file mode 100644 index 00000000000..a1d50731c78 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-27 @@ -0,0 +1 @@ +"\"\"\"" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 new file mode 100644 index 00000000000..e3c5eedeb59 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-270 @@ -0,0 +1 @@ +"#" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 new file mode 100644 index 00000000000..e75309a5241 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-271 @@ -0,0 +1 @@ +B__ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 new file mode 100644 index 00000000000..027177272c5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-272 @@ -0,0 +1 @@ +"\nS \n" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 new file mode 100644 index 00000000000..99432276ec4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-273 @@ -0,0 +1 @@ +Bp \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 new file mode 100644 index 00000000000..d4f8a788b80 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-274 @@ -0,0 +1 @@ +",\t;" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 new file mode 100644 index 00000000000..56c384f7530 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-275 @@ -0,0 +1 @@ +B_q \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 new file mode 100644 index 00000000000..f093d2aa3bc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-276 @@ -0,0 +1 @@ +"\/+\t\n\b!Z" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 new file mode 100644 index 00000000000..11e1229d9e3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-277 @@ -0,0 +1 @@ +"󇟇\\ueFAc" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 new file mode 100644 index 00000000000..90dbfcfcd35 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-278 @@ -0,0 +1 @@ +":\f" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 new file mode 100644 index 00000000000..b06b8302524 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-279 @@ -0,0 +1 @@ +"\/" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 new file mode 100644 index 00000000000..5f55d73af66 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-28 @@ -0,0 +1 @@ +"bar"."baz" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 new file mode 100644 index 00000000000..0e4bf7c113b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-280 @@ -0,0 +1 @@ +_BW_6Hg_Gl \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 new file mode 100644 index 00000000000..81bb45f8059 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-281 @@ -0,0 +1 @@ +"􃰂" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 new file mode 100644 index 00000000000..d0b4de14642 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-282 @@ -0,0 +1 @@ +zs1DC \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 new file mode 100644 index 00000000000..68797580caa --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-283 @@ -0,0 +1 @@ +__434 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 new file mode 100644 index 00000000000..e61be91c4af --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-284 @@ -0,0 +1 @@ +"󵅁" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 new file mode 100644 index 00000000000..026cb9cbb51 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-285 @@ -0,0 +1 @@ +Z_5 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 new file mode 100644 index 00000000000..ca9587d06c0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-286 @@ -0,0 +1 @@ +z_M_ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 new file mode 100644 index 00000000000..67f6d9c42a3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-287 @@ -0,0 +1 @@ +YU_2 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 new file mode 100644 index 00000000000..927ab653a73 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-288 @@ -0,0 +1 @@ +_0 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 new file mode 100644 index 00000000000..39307ab938e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-289 @@ -0,0 +1 @@ +"\b+" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 new file mode 100644 index 00000000000..8b0c5b41bd9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-29 @@ -0,0 +1 @@ +foo[?name == 'a'] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 new file mode 100644 index 00000000000..a3ec2ed7a12 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-290 @@ -0,0 +1 @@ +"\"" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 new file mode 100644 index 00000000000..26bf7e122de --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-291 @@ -0,0 +1 @@ +D7 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 new file mode 100644 index 00000000000..d595c9f43a9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-292 @@ -0,0 +1 @@ +_62L \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 new file mode 100644 index 00000000000..f6869694967 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-293 @@ -0,0 +1 @@ +"\tK\t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 new file mode 100644 index 00000000000..f3a9b7edb50 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-294 @@ -0,0 +1 @@ +"\n\\\f" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 new file mode 100644 index 00000000000..455f00ffc29 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-295 @@ -0,0 +1 @@ +I_ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 new file mode 100644 index 00000000000..ccd5968f9c1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-296 @@ -0,0 +1 @@ +W_a0_ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 new file mode 100644 index 00000000000..ee55c16fc81 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-297 @@ -0,0 +1 @@ +BQ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 new file mode 100644 index 00000000000..0d1a169a67a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-298 @@ -0,0 +1 @@ +"\tX$\uABBb" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 new file mode 100644 index 00000000000..0573cfd73fd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-299 @@ -0,0 +1 @@ +Z9 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 new file mode 100644 index 00000000000..f0fcbd8eaf4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-3 @@ -0,0 +1 @@ +foo.bar.baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 new file mode 100644 index 00000000000..4f8e6a17aab --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-30 @@ -0,0 +1 @@ +*[?[0] == `0`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 new file mode 100644 index 00000000000..a0db02bebf1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-300 @@ -0,0 +1 @@ +"\b%\"򞄏" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 new file mode 100644 index 00000000000..56032f7a248 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-301 @@ -0,0 +1 @@ +_F \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 new file mode 100644 index 00000000000..4a8a3cff369 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-302 @@ -0,0 +1 @@ +"!," \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 new file mode 100644 index 00000000000..7c1efac0004 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-303 @@ -0,0 +1 @@ +"\"!" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 new file mode 100644 index 00000000000..a0f489d532f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-304 @@ -0,0 +1 @@ +Hh \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 new file mode 100644 index 00000000000..c64e8d5ac8b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-305 @@ -0,0 +1 @@ +"&" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 new file mode 100644 index 00000000000..0567e992f14 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-306 @@ -0,0 +1 @@ +"9\r\\R" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 new file mode 100644 index 00000000000..ce8245c5b97 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-307 @@ -0,0 +1 @@ +M_k \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 new file mode 100644 index 00000000000..8f16a5ac048 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-308 @@ -0,0 +1 @@ +"!\b\n󑩒\"\"" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 new file mode 100644 index 00000000000..504ff5ae39f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-309 @@ -0,0 +1 @@ +"6" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 new file mode 100644 index 00000000000..07fb57234b8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-31 @@ -0,0 +1 @@ +foo[?first == last] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 new file mode 100644 index 00000000000..533dd8e5460 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-310 @@ -0,0 +1 @@ +_7 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 new file mode 100644 index 00000000000..1e4a3a34155 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-311 @@ -0,0 +1 @@ +"0" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 new file mode 100644 index 00000000000..37961f6ca42 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-312 @@ -0,0 +1 @@ +"\\8\\" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 new file mode 100644 index 00000000000..23480cff14c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-313 @@ -0,0 +1 @@ +b7eo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 new file mode 100644 index 00000000000..e609f81a3b8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-314 @@ -0,0 +1 @@ +xIUo9 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 new file mode 100644 index 00000000000..d89a25f0b97 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-315 @@ -0,0 +1 @@ +"5" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 new file mode 100644 index 00000000000..5adcf5e7dc5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-316 @@ -0,0 +1 @@ +"?" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 new file mode 100644 index 00000000000..ace4a897d33 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-317 @@ -0,0 +1 @@ +sU \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 new file mode 100644 index 00000000000..feffb7061b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-318 @@ -0,0 +1 @@ +"VH2&H\\\/" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 new file mode 100644 index 00000000000..8223f1e51e3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-319 @@ -0,0 +1 @@ +_C \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 new file mode 100644 index 00000000000..7e85c4bdfe9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-32 @@ -0,0 +1 @@ +foo[?first == last].first \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 new file mode 100644 index 00000000000..c9cdc63b070 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-320 @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 new file mode 100644 index 00000000000..c82f7982ee0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-321 @@ -0,0 +1 @@ +"<\t" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 new file mode 100644 index 00000000000..dae65c51554 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-322 @@ -0,0 +1 @@ +"\uD834\uDD1E" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 new file mode 100644 index 00000000000..b6b3695438a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-323 @@ -0,0 +1 @@ +foo.bar[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 new file mode 100644 index 00000000000..bf06e678c15 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-324 @@ -0,0 +1 @@ +foo.bar[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 new file mode 100644 index 00000000000..5d48e0205ce --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-325 @@ -0,0 +1 @@ +foo.bar[2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 new file mode 100644 index 00000000000..de3af7230f9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-326 @@ -0,0 +1 @@ +foo.bar[3] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 new file mode 100644 index 00000000000..a1c33350841 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-327 @@ -0,0 +1 @@ +foo.bar[-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 new file mode 100644 index 00000000000..ad0fef91cfa --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-328 @@ -0,0 +1 @@ +foo.bar[-2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 new file mode 100644 index 00000000000..3e83c6f7306 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-329 @@ -0,0 +1 @@ +foo.bar[-3] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 new file mode 100644 index 00000000000..72fc0a53e79 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-33 @@ -0,0 +1 @@ +foo[?age > `25`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 new file mode 100644 index 00000000000..433a737d65e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-330 @@ -0,0 +1 @@ +foo.bar[-4] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 new file mode 100644 index 00000000000..4d5f9756e55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-331 @@ -0,0 +1 @@ +foo.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 new file mode 100644 index 00000000000..5e0d9b71772 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-332 @@ -0,0 +1 @@ +foo[0].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 new file mode 100644 index 00000000000..3cd7e9460fe --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-333 @@ -0,0 +1 @@ +foo[1].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 new file mode 100644 index 00000000000..74cb1765558 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-334 @@ -0,0 +1 @@ +foo[2].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 new file mode 100644 index 00000000000..3cf2007f70d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-335 @@ -0,0 +1 @@ +foo[3].notbar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 new file mode 100644 index 00000000000..9674d880375 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-336 @@ -0,0 +1 @@ +foo[3].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 new file mode 100644 index 00000000000..9b0b2f8189b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-337 @@ -0,0 +1 @@ +foo[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 new file mode 100644 index 00000000000..83c639a185b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-338 @@ -0,0 +1 @@ +foo[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 new file mode 100644 index 00000000000..3b76c9f64a4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-339 @@ -0,0 +1 @@ +foo[2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 new file mode 100644 index 00000000000..9a2b0184edf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-34 @@ -0,0 +1 @@ +foo[?age >= `25`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 new file mode 100644 index 00000000000..ff99e045d2e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-340 @@ -0,0 +1 @@ +foo[3] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 new file mode 100644 index 00000000000..040ecb240c8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-341 @@ -0,0 +1 @@ +foo[4] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 new file mode 100644 index 00000000000..6e7ea636eec --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-342 @@ -0,0 +1 @@ +[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 new file mode 100644 index 00000000000..bace2a0be17 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-343 @@ -0,0 +1 @@ +[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 new file mode 100644 index 00000000000..5d50c80c068 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-344 @@ -0,0 +1 @@ +[2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 new file mode 100644 index 00000000000..99d21a2a0f0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-345 @@ -0,0 +1 @@ +[-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 new file mode 100644 index 00000000000..133a9c6272f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-346 @@ -0,0 +1 @@ +[-2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 new file mode 100644 index 00000000000..b7f78c5dc51 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-347 @@ -0,0 +1 @@ +[-3] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 new file mode 100644 index 00000000000..bd9de815f45 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-348 @@ -0,0 +1 @@ +reservations[].instances[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 new file mode 100644 index 00000000000..55e6257352f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-349 @@ -0,0 +1 @@ +reservations[].instances[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 new file mode 100644 index 00000000000..fa83f1da3b7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-35 @@ -0,0 +1 @@ +foo[?age > `30`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 new file mode 100644 index 00000000000..1661747c04d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-350 @@ -0,0 +1 @@ +reservations[].notinstances[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 new file mode 100644 index 00000000000..1661747c04d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-351 @@ -0,0 +1 @@ +reservations[].notinstances[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 new file mode 100644 index 00000000000..3debc70f895 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-352 @@ -0,0 +1 @@ +reservations[].instances[].foo[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 new file mode 100644 index 00000000000..75af2fda069 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-353 @@ -0,0 +1 @@ +reservations[].instances[].foo[].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 new file mode 100644 index 00000000000..4a70cd8a03c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-354 @@ -0,0 +1 @@ +reservations[].instances[].notfoo[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 new file mode 100644 index 00000000000..987985b002f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-355 @@ -0,0 +1 @@ +reservations[].instances[].notfoo[].notbar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 new file mode 100644 index 00000000000..1661747c04d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-356 @@ -0,0 +1 @@ +reservations[].notinstances[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 new file mode 100644 index 00000000000..634f937e555 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-357 @@ -0,0 +1 @@ +reservations[].instances[].foo[].notbar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 new file mode 100644 index 00000000000..09cb7b8bb1b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-358 @@ -0,0 +1 @@ +reservations[].instances[].bar[].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 new file mode 100644 index 00000000000..f5d9ac5b763 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-359 @@ -0,0 +1 @@ +reservations[].instances[].baz[].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 new file mode 100644 index 00000000000..463a2a542db --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-36 @@ -0,0 +1 @@ +foo[?age < `25`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 new file mode 100644 index 00000000000..d1016d6e75b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-360 @@ -0,0 +1 @@ +reservations[].instances[].qux[].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 new file mode 100644 index 00000000000..ef54cf52d67 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-361 @@ -0,0 +1 @@ +reservations[].instances[].qux[].baz[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 new file mode 100644 index 00000000000..bea506ff235 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-362 @@ -0,0 +1 @@ +foo[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 new file mode 100644 index 00000000000..20dd081e0e4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-363 @@ -0,0 +1 @@ +foo[][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 new file mode 100644 index 00000000000..4803734b09e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-364 @@ -0,0 +1 @@ +foo[][1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 new file mode 100644 index 00000000000..1be56598534 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-365 @@ -0,0 +1 @@ +foo[][0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 new file mode 100644 index 00000000000..d2cf6da59fe --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-366 @@ -0,0 +1 @@ +foo[][2][2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 new file mode 100644 index 00000000000..c609ca64b16 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-367 @@ -0,0 +1 @@ +foo[][0][0][100] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-368 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 new file mode 100644 index 00000000000..bea506ff235 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-369 @@ -0,0 +1 @@ +foo[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 new file mode 100644 index 00000000000..10ed5d3f61f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-37 @@ -0,0 +1 @@ +foo[?age <= `25`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 new file mode 100644 index 00000000000..13f2c4a0b4f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-370 @@ -0,0 +1 @@ +foo[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 new file mode 100644 index 00000000000..edf3d92775d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-371 @@ -0,0 +1 @@ +foo[].bar[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 new file mode 100644 index 00000000000..2a3b993af24 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-372 @@ -0,0 +1 @@ +foo[].bar[].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 new file mode 100644 index 00000000000..d5ca878a13b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-373 @@ -0,0 +1 @@ +string[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 new file mode 100644 index 00000000000..fcd255f5d0c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-374 @@ -0,0 +1 @@ +hash[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 new file mode 100644 index 00000000000..2d53bd7cdcd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-375 @@ -0,0 +1 @@ +number[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 new file mode 100644 index 00000000000..cb10d2497e1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-376 @@ -0,0 +1 @@ +nullvalue[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 new file mode 100644 index 00000000000..f6c79ca84ff --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-377 @@ -0,0 +1 @@ +string[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 new file mode 100644 index 00000000000..09bf36e8a90 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-378 @@ -0,0 +1 @@ +hash[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 new file mode 100644 index 00000000000..4c357818919 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-379 @@ -0,0 +1 @@ +number[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 new file mode 100644 index 00000000000..16a4c36acbd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-38 @@ -0,0 +1 @@ +foo[?age < `20`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 new file mode 100644 index 00000000000..2dd8ae21855 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-380 @@ -0,0 +1 @@ +nullvalue[].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 new file mode 100644 index 00000000000..dfed8160389 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-381 @@ -0,0 +1 @@ +nullvalue[].foo[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 new file mode 100644 index 00000000000..d7628e646e1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-382 @@ -0,0 +1 @@ +`"foo"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 new file mode 100644 index 00000000000..49c5269b12e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-383 @@ -0,0 +1 @@ +`"\u03a6"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 new file mode 100644 index 00000000000..d5db721d012 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-384 @@ -0,0 +1 @@ +`"✓"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 new file mode 100644 index 00000000000..a2b6e4ec85d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-385 @@ -0,0 +1 @@ +`[1, 2, 3]` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 new file mode 100644 index 00000000000..f5801bdd680 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-386 @@ -0,0 +1 @@ +`{"a": "b"}` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 new file mode 100644 index 00000000000..f87db59a8b7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-387 @@ -0,0 +1 @@ +`true` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 new file mode 100644 index 00000000000..3b20d905f33 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-388 @@ -0,0 +1 @@ +`false` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 new file mode 100644 index 00000000000..70bcd29a7a8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-389 @@ -0,0 +1 @@ +`null` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 new file mode 100644 index 00000000000..351054d3e61 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-39 @@ -0,0 +1 @@ +foo[?age == `20`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 new file mode 100644 index 00000000000..0918d41559b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-390 @@ -0,0 +1 @@ +`0` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 new file mode 100644 index 00000000000..ef70c4c11e7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-391 @@ -0,0 +1 @@ +`1` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 new file mode 100644 index 00000000000..b39a922f403 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-392 @@ -0,0 +1 @@ +`2` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 new file mode 100644 index 00000000000..7e65687dbfc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-393 @@ -0,0 +1 @@ +`3` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 new file mode 100644 index 00000000000..770d1ece705 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-394 @@ -0,0 +1 @@ +`4` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 new file mode 100644 index 00000000000..a8b81985c76 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-395 @@ -0,0 +1 @@ +`5` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 new file mode 100644 index 00000000000..7f0861065e7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-396 @@ -0,0 +1 @@ +`6` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 new file mode 100644 index 00000000000..495114d919e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-397 @@ -0,0 +1 @@ +`7` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 new file mode 100644 index 00000000000..94f355c46ca --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-398 @@ -0,0 +1 @@ +`8` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 new file mode 100644 index 00000000000..600d2aa3f49 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-399 @@ -0,0 +1 @@ +`9` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 new file mode 100644 index 00000000000..31485223580 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-4 @@ -0,0 +1 @@ +foo.bar.baz.bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 new file mode 100644 index 00000000000..99d9258a625 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-40 @@ -0,0 +1 @@ +foo[?age != `20`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 new file mode 100644 index 00000000000..637015b5fde --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-400 @@ -0,0 +1 @@ +`"foo\`bar"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 new file mode 100644 index 00000000000..6fa7557b8d8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-401 @@ -0,0 +1 @@ +`"foo\"bar"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 new file mode 100644 index 00000000000..5aabeec3419 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-402 @@ -0,0 +1 @@ +`"1\`"` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 new file mode 100644 index 00000000000..8302ea1984d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-403 @@ -0,0 +1 @@ +`"\\"`.{a:`"b"`} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 new file mode 100644 index 00000000000..d88d014a96c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-404 @@ -0,0 +1 @@ +`{"a": "b"}`.a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 new file mode 100644 index 00000000000..47152dddb73 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-405 @@ -0,0 +1 @@ +`{"a": {"b": "c"}}`.a.b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 new file mode 100644 index 00000000000..895d4293878 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-406 @@ -0,0 +1 @@ +`[0, 1, 2]`[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 new file mode 100644 index 00000000000..42500a368cc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-407 @@ -0,0 +1 @@ +` {"foo": true}` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 new file mode 100644 index 00000000000..08b944dad4a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-408 @@ -0,0 +1 @@ +`{"foo": true} ` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 new file mode 100644 index 00000000000..6de163f80bc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-409 @@ -0,0 +1 @@ +'foo' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 new file mode 100644 index 00000000000..5bc357d9fa6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-41 @@ -0,0 +1 @@ +foo[?top.name == 'a'] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 new file mode 100644 index 00000000000..b84bbdb29fb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-410 @@ -0,0 +1 @@ +' foo ' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 new file mode 100644 index 00000000000..bf6a07ace3d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-411 @@ -0,0 +1 @@ +'0' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 new file mode 100644 index 00000000000..c742f5b0c97 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-412 @@ -0,0 +1,2 @@ +'newline +' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 new file mode 100644 index 00000000000..04e9b3ade60 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-413 @@ -0,0 +1,2 @@ +' +' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 new file mode 100644 index 00000000000..ebdaf120d7b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-414 @@ -0,0 +1 @@ +'✓' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 new file mode 100644 index 00000000000..d0ba5d7facb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-415 @@ -0,0 +1 @@ +'𝄞' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 new file mode 100644 index 00000000000..19c2e2ef41c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-416 @@ -0,0 +1 @@ +' [foo] ' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 new file mode 100644 index 00000000000..5faa483b197 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-417 @@ -0,0 +1 @@ +'[foo]' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 new file mode 100644 index 00000000000..e3c05c163a3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-418 @@ -0,0 +1 @@ +'\u03a6' \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 new file mode 100644 index 00000000000..7c13861ac72 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-419 @@ -0,0 +1 @@ +foo.{bar: bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 new file mode 100644 index 00000000000..d037a0a4ddf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-42 @@ -0,0 +1 @@ +foo[?top.first == top.last] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 new file mode 100644 index 00000000000..f795c255219 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-420 @@ -0,0 +1 @@ +foo.{"bar": bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 new file mode 100644 index 00000000000..772c45639cc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-421 @@ -0,0 +1 @@ +foo.{"foo.bar": bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 new file mode 100644 index 00000000000..8808e92bf31 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-422 @@ -0,0 +1 @@ +foo.{bar: bar, baz: baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 new file mode 100644 index 00000000000..3f13757a10c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-423 @@ -0,0 +1 @@ +foo.{"bar": bar, "baz": baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 new file mode 100644 index 00000000000..23cd8903e73 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-424 @@ -0,0 +1 @@ +{"baz": baz, "qux\"": "qux\""} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 new file mode 100644 index 00000000000..fabb6da4fe8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-425 @@ -0,0 +1 @@ +foo.{bar:bar,baz:baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 new file mode 100644 index 00000000000..4c3f615b1cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-426 @@ -0,0 +1 @@ +foo.{bar: bar,qux: qux} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 new file mode 100644 index 00000000000..8bc46535ac5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-427 @@ -0,0 +1 @@ +foo.{bar: bar, noexist: noexist} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 new file mode 100644 index 00000000000..2024b6f118d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-428 @@ -0,0 +1 @@ +foo.{noexist: noexist, alsonoexist: alsonoexist} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 new file mode 100644 index 00000000000..b52191d10a4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-429 @@ -0,0 +1 @@ +foo.badkey.{nokey: nokey, alsonokey: alsonokey} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 new file mode 100644 index 00000000000..8534a5cae9f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-43 @@ -0,0 +1 @@ +foo[?top == `{"first": "foo", "last": "bar"}`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 new file mode 100644 index 00000000000..5cd310b6d24 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-430 @@ -0,0 +1 @@ +foo.nested.*.{a: a,b: b} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 new file mode 100644 index 00000000000..0b24ef53526 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-431 @@ -0,0 +1 @@ +foo.nested.three.{a: a, cinner: c.inner} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 new file mode 100644 index 00000000000..473c1c351b4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-432 @@ -0,0 +1 @@ +foo.nested.three.{a: a, c: c.inner.bad.key} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 new file mode 100644 index 00000000000..44ba735ab10 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-433 @@ -0,0 +1 @@ +foo.{a: nested.one.a, b: nested.two.b} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 new file mode 100644 index 00000000000..f5f89b12b5c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-434 @@ -0,0 +1 @@ +{bar: bar, baz: baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 new file mode 100644 index 00000000000..697764cb306 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-435 @@ -0,0 +1 @@ +{bar: bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 new file mode 100644 index 00000000000..20447fb1054 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-436 @@ -0,0 +1 @@ +{otherkey: bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 new file mode 100644 index 00000000000..310b9b1dd27 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-437 @@ -0,0 +1 @@ +{no: no, exist: exist} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 new file mode 100644 index 00000000000..c79b2e24068 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-438 @@ -0,0 +1 @@ +foo.[bar] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 new file mode 100644 index 00000000000..ab498ef654c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-439 @@ -0,0 +1 @@ +foo.[bar,baz] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 new file mode 100644 index 00000000000..71307c40947 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-44 @@ -0,0 +1 @@ +foo[?key == `true`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 new file mode 100644 index 00000000000..4b8f39a468e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-440 @@ -0,0 +1 @@ +foo.[bar,qux] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 new file mode 100644 index 00000000000..b8f9020f8e7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-441 @@ -0,0 +1 @@ +foo.[bar,noexist] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 new file mode 100644 index 00000000000..b7c7b3f6556 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-442 @@ -0,0 +1 @@ +foo.[noexist,alsonoexist] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 new file mode 100644 index 00000000000..fabb6da4fe8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-443 @@ -0,0 +1 @@ +foo.{bar:bar,baz:baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 new file mode 100644 index 00000000000..c15c39f82c1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-444 @@ -0,0 +1 @@ +foo.[bar,baz[0]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 new file mode 100644 index 00000000000..9cebd89844f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-445 @@ -0,0 +1 @@ +foo.[bar,baz[1]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 new file mode 100644 index 00000000000..c5bbfbf848f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-446 @@ -0,0 +1 @@ +foo.[bar,baz[2]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 new file mode 100644 index 00000000000..d81cb2b9041 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-447 @@ -0,0 +1 @@ +foo.[bar,baz[3]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 new file mode 100644 index 00000000000..3a65aa7d6f1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-448 @@ -0,0 +1 @@ +foo.[bar[0],baz[3]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 new file mode 100644 index 00000000000..8808e92bf31 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-449 @@ -0,0 +1 @@ +foo.{bar: bar, baz: baz} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 new file mode 100644 index 00000000000..e142b22a25f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-45 @@ -0,0 +1 @@ +foo[?key == `false`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 new file mode 100644 index 00000000000..ab498ef654c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-450 @@ -0,0 +1 @@ +foo.[bar,baz] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 new file mode 100644 index 00000000000..8e3d22dc53f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-451 @@ -0,0 +1 @@ +foo.{bar: bar.baz[1],includeme: includeme} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 new file mode 100644 index 00000000000..398c7f8b06e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-452 @@ -0,0 +1 @@ +foo.{"bar.baz.two": bar.baz[1].two, includeme: includeme} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 new file mode 100644 index 00000000000..a1764448785 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-453 @@ -0,0 +1 @@ +foo.[includeme, bar.baz[*].common] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 new file mode 100644 index 00000000000..da5225ddccb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-454 @@ -0,0 +1 @@ +foo.[includeme, bar.baz[*].none] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 new file mode 100644 index 00000000000..a8870b22bcc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-455 @@ -0,0 +1 @@ +foo.[includeme, bar.baz[].common] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 new file mode 100644 index 00000000000..420b1a57c45 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-456 @@ -0,0 +1 @@ +reservations[*].instances[*].{id: id, name: name} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 new file mode 100644 index 00000000000..0761ee16dc0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-457 @@ -0,0 +1 @@ +reservations[].instances[].{id: id, name: name} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 new file mode 100644 index 00000000000..aa1191a48cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-458 @@ -0,0 +1 @@ +reservations[].instances[].[id, name] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-459 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 new file mode 100644 index 00000000000..9a24a464eed --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-46 @@ -0,0 +1 @@ +foo[?key == `0`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 new file mode 100644 index 00000000000..bea506ff235 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-460 @@ -0,0 +1 @@ +foo[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 new file mode 100644 index 00000000000..13f2c4a0b4f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-461 @@ -0,0 +1 @@ +foo[].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 new file mode 100644 index 00000000000..edf3d92775d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-462 @@ -0,0 +1 @@ +foo[].bar[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 new file mode 100644 index 00000000000..d965466e91c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-463 @@ -0,0 +1 @@ +foo[].bar[].[baz, qux] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 new file mode 100644 index 00000000000..f1822a1742b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-464 @@ -0,0 +1 @@ +foo[].bar[].[baz] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 new file mode 100644 index 00000000000..c6f77b80c33 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-465 @@ -0,0 +1 @@ +foo[].bar[].[baz, qux][] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 new file mode 100644 index 00000000000..db56262a4ea --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-466 @@ -0,0 +1 @@ +foo.[baz[*].bar, qux[0]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 new file mode 100644 index 00000000000..b901067d271 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-467 @@ -0,0 +1 @@ +foo.[baz[*].[bar, boo], qux[0]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 new file mode 100644 index 00000000000..738479fa69b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-468 @@ -0,0 +1 @@ +foo.[baz[*].not_there || baz[*].bar, qux[0]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 new file mode 100644 index 00000000000..6926996a7b6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-469 @@ -0,0 +1 @@ +[[*],*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 new file mode 100644 index 00000000000..6d33cc72c4e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-47 @@ -0,0 +1 @@ +foo[?key == `1`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 new file mode 100644 index 00000000000..736be0a31f2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-470 @@ -0,0 +1 @@ +[[*]] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 new file mode 100644 index 00000000000..29e1fb20a55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-471 @@ -0,0 +1 @@ +outer.foo || outer.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 new file mode 100644 index 00000000000..c0070ba783a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-472 @@ -0,0 +1 @@ +outer.foo||outer.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 new file mode 100644 index 00000000000..661b0bec5e3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-473 @@ -0,0 +1 @@ +outer.bar || outer.baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 new file mode 100644 index 00000000000..296d5aeee16 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-474 @@ -0,0 +1 @@ +outer.bar||outer.baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 new file mode 100644 index 00000000000..ca140f8aa33 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-475 @@ -0,0 +1 @@ +outer.bad || outer.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 new file mode 100644 index 00000000000..15d30924274 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-476 @@ -0,0 +1 @@ +outer.bad||outer.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 new file mode 100644 index 00000000000..56148d957b7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-477 @@ -0,0 +1 @@ +outer.foo || outer.bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 new file mode 100644 index 00000000000..6d3cf6d9069 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-478 @@ -0,0 +1 @@ +outer.foo||outer.bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 new file mode 100644 index 00000000000..100fa8339d5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-479 @@ -0,0 +1 @@ +outer.bad || outer.alsobad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 new file mode 100644 index 00000000000..de56fc042cb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-48 @@ -0,0 +1 @@ +foo[?key == `[0]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 new file mode 100644 index 00000000000..64490352bf0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-480 @@ -0,0 +1 @@ +outer.bad||outer.alsobad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 new file mode 100644 index 00000000000..af901bde17e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-481 @@ -0,0 +1 @@ +outer.empty_string || outer.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 new file mode 100644 index 00000000000..36b63e462c4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-482 @@ -0,0 +1 @@ +outer.nokey || outer.bool || outer.empty_list || outer.empty_string || outer.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 new file mode 100644 index 00000000000..aba584f99ed --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-483 @@ -0,0 +1 @@ +foo.*.baz | [0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 new file mode 100644 index 00000000000..4234ac01922 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-484 @@ -0,0 +1 @@ +foo.*.baz | [1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 new file mode 100644 index 00000000000..12330d9902c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-485 @@ -0,0 +1 @@ +foo.*.baz | [2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 new file mode 100644 index 00000000000..1b2d93e1952 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-486 @@ -0,0 +1 @@ +foo.bar.* | [0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 new file mode 100644 index 00000000000..c371fc6457a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-487 @@ -0,0 +1 @@ +foo.*.notbaz | [*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 new file mode 100644 index 00000000000..3c835642eb2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-488 @@ -0,0 +1 @@ +foo | bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 new file mode 100644 index 00000000000..decaa0421d6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-489 @@ -0,0 +1 @@ +foo | bar | baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 new file mode 100644 index 00000000000..49d9c63a390 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-49 @@ -0,0 +1 @@ +foo[?key == `{"bar": [0]}`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 new file mode 100644 index 00000000000..b91068037b1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-490 @@ -0,0 +1 @@ +foo|bar| baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 new file mode 100644 index 00000000000..11df74d8b46 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-491 @@ -0,0 +1 @@ +not_there | [0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 new file mode 100644 index 00000000000..11df74d8b46 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-492 @@ -0,0 +1 @@ +not_there | [0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 new file mode 100644 index 00000000000..37da9fc0b71 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-493 @@ -0,0 +1 @@ +[foo.bar, foo.other] | [0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 new file mode 100644 index 00000000000..1f4fc943d70 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-494 @@ -0,0 +1 @@ +{"a": foo.bar, "b": foo.other} | a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 new file mode 100644 index 00000000000..67c7ea9cfe4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-495 @@ -0,0 +1 @@ +{"a": foo.bar, "b": foo.other} | b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 new file mode 100644 index 00000000000..d87f9bba4cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-496 @@ -0,0 +1 @@ +{"a": foo.bar, "b": foo.other} | *.baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 new file mode 100644 index 00000000000..ebf8e271140 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-497 @@ -0,0 +1 @@ +foo.bam || foo.bar | baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 new file mode 100644 index 00000000000..f32bc6db510 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-498 @@ -0,0 +1 @@ +foo | not_there || bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 new file mode 100644 index 00000000000..d04459d9090 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-499 @@ -0,0 +1 @@ +foo[*].bar[*] | [0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 new file mode 100644 index 00000000000..b537264a1d5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-5 @@ -0,0 +1 @@ +foo.bar.bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 new file mode 100644 index 00000000000..c17c1df1706 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-50 @@ -0,0 +1 @@ +foo[?key == `null`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 new file mode 100644 index 00000000000..3eb869f435b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-500 @@ -0,0 +1 @@ +bar[0:10] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 new file mode 100644 index 00000000000..aa5d6be52c7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-501 @@ -0,0 +1 @@ +foo[0:10:1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 new file mode 100644 index 00000000000..1a4d1682da0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-502 @@ -0,0 +1 @@ +foo[0:10] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 new file mode 100644 index 00000000000..5925a578b52 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-503 @@ -0,0 +1 @@ +foo[0:10:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 new file mode 100644 index 00000000000..081e93abd98 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-504 @@ -0,0 +1 @@ +foo[0::1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 new file mode 100644 index 00000000000..92270014959 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-505 @@ -0,0 +1 @@ +foo[0::] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 new file mode 100644 index 00000000000..fd2294d6646 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-506 @@ -0,0 +1 @@ +foo[0:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 new file mode 100644 index 00000000000..c6b551d5eae --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-507 @@ -0,0 +1 @@ +foo[:10:1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 new file mode 100644 index 00000000000..503f58da6e3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-508 @@ -0,0 +1 @@ +foo[::1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 new file mode 100644 index 00000000000..f78bb770caa --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-509 @@ -0,0 +1 @@ +foo[:10:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 new file mode 100644 index 00000000000..589a214f453 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-51 @@ -0,0 +1 @@ +foo[?key == `[1]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 new file mode 100644 index 00000000000..eb9d2ba881e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-510 @@ -0,0 +1 @@ +foo[::] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 new file mode 100644 index 00000000000..1921a3d9865 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-511 @@ -0,0 +1 @@ +foo[:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 new file mode 100644 index 00000000000..a87afcb1b32 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-512 @@ -0,0 +1 @@ +foo[1:9] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 new file mode 100644 index 00000000000..dbf51d8cde4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-513 @@ -0,0 +1 @@ +foo[0:10:2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 new file mode 100644 index 00000000000..f7288763a71 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-514 @@ -0,0 +1 @@ +foo[5:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 new file mode 100644 index 00000000000..64395761df6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-515 @@ -0,0 +1 @@ +foo[5::2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 new file mode 100644 index 00000000000..706bb14dd7e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-516 @@ -0,0 +1 @@ +foo[::2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 new file mode 100644 index 00000000000..8fcfaee95c6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-517 @@ -0,0 +1 @@ +foo[::-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 new file mode 100644 index 00000000000..f6a00bf9bbc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-518 @@ -0,0 +1 @@ +foo[1::2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 new file mode 100644 index 00000000000..ea068ee06fb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-519 @@ -0,0 +1 @@ +foo[10:0:-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 new file mode 100644 index 00000000000..214917ac068 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-52 @@ -0,0 +1 @@ +foo[?key == `{"a":2}`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 new file mode 100644 index 00000000000..1fe14258edc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-520 @@ -0,0 +1 @@ +foo[10:5:-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 new file mode 100644 index 00000000000..4ba0e130228 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-521 @@ -0,0 +1 @@ +foo[8:2:-2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 new file mode 100644 index 00000000000..25db439ff7d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-522 @@ -0,0 +1 @@ +foo[0:20] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 new file mode 100644 index 00000000000..8a965920af5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-523 @@ -0,0 +1 @@ +foo[10:-20:-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 new file mode 100644 index 00000000000..b1e5ba3734f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-524 @@ -0,0 +1 @@ +foo[10:-20] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 new file mode 100644 index 00000000000..06253112e4e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-525 @@ -0,0 +1 @@ +foo[-4:-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 new file mode 100644 index 00000000000..1e14a6a4c5e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-526 @@ -0,0 +1 @@ +foo[:-5:-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 new file mode 100644 index 00000000000..aef5c2747d2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-527 @@ -0,0 +1 @@ +foo[:2].a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 new file mode 100644 index 00000000000..93c95fcf689 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-528 @@ -0,0 +1 @@ +foo[:2].b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 new file mode 100644 index 00000000000..7e0733e595e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-529 @@ -0,0 +1 @@ +foo[:2].a.b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 new file mode 100644 index 00000000000..4c002ed80d6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-53 @@ -0,0 +1 @@ +foo[?`true` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 new file mode 100644 index 00000000000..2438b25762d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-530 @@ -0,0 +1 @@ +bar[::-1].a.b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 new file mode 100644 index 00000000000..549994b6bc4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-531 @@ -0,0 +1 @@ +bar[:2].a.b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 new file mode 100644 index 00000000000..ab98292b452 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-532 @@ -0,0 +1 @@ +baz[:2].a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 new file mode 100644 index 00000000000..65fca968764 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-533 @@ -0,0 +1 @@ +[:] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 new file mode 100644 index 00000000000..18c5daf7bea --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-534 @@ -0,0 +1 @@ +[:2].a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 new file mode 100644 index 00000000000..1bb84f7d4bd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-535 @@ -0,0 +1 @@ +[::-1].a \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 new file mode 100644 index 00000000000..7a0416f0566 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-536 @@ -0,0 +1 @@ +[:2].b \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 new file mode 100644 index 00000000000..4d5f9756e55 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-537 @@ -0,0 +1 @@ +foo.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-538 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 new file mode 100644 index 00000000000..f59ec20aabf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-539 @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 new file mode 100644 index 00000000000..23d27073e97 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-54 @@ -0,0 +1 @@ +foo[?`false` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 new file mode 100644 index 00000000000..dee5695746e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-540 @@ -0,0 +1 @@ +*.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 new file mode 100644 index 00000000000..1a16f7418d2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-541 @@ -0,0 +1 @@ +*.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 new file mode 100644 index 00000000000..7e8066d39f5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-542 @@ -0,0 +1 @@ +*[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 new file mode 100644 index 00000000000..0637a088a01 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-543 @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 new file mode 100644 index 00000000000..6e7ea636eec --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-544 @@ -0,0 +1 @@ +[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 new file mode 100644 index 00000000000..5a5194647ad --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-545 @@ -0,0 +1 @@ +[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 new file mode 100644 index 00000000000..416127425c2 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-546 @@ -0,0 +1 @@ +*.["0"] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 new file mode 100644 index 00000000000..cd9fb6ba778 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-547 @@ -0,0 +1 @@ +[*].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 new file mode 100644 index 00000000000..9f3ada48077 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-548 @@ -0,0 +1 @@ +[*][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 new file mode 100644 index 00000000000..9b0b2f8189b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-549 @@ -0,0 +1 @@ +foo[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 new file mode 100644 index 00000000000..6d840ee568f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-55 @@ -0,0 +1 @@ +foo[?`0` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 new file mode 100644 index 00000000000..b23413b92af --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-550 @@ -0,0 +1 @@ +foo.[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 new file mode 100644 index 00000000000..08ab2e1c420 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-551 @@ -0,0 +1 @@ +foo.[abc] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 new file mode 100644 index 00000000000..78b05a5c64e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-552 @@ -0,0 +1 @@ +foo.[abc, def] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 new file mode 100644 index 00000000000..1e7b886e79e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-553 @@ -0,0 +1 @@ +a.{foo: bar} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 new file mode 100644 index 00000000000..91b4c9896e1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-554 @@ -0,0 +1 @@ +a.{foo: bar, baz: bam} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 new file mode 100644 index 00000000000..8301ef981ef --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-555 @@ -0,0 +1 @@ +{"\\":{" ":*}} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 new file mode 100644 index 00000000000..8f75cc91334 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-556 @@ -0,0 +1 @@ +foo || bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 new file mode 100644 index 00000000000..e5f122c5691 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-557 @@ -0,0 +1 @@ +foo.[a || b] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 new file mode 100644 index 00000000000..39d1914328b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-558 @@ -0,0 +1 @@ +foo[?bar==`"baz"`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 new file mode 100644 index 00000000000..d08bbe2501e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-559 @@ -0,0 +1 @@ +foo[? bar == `"baz"` ] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 new file mode 100644 index 00000000000..addaf204c5b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-56 @@ -0,0 +1 @@ +foo[?`1` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 new file mode 100644 index 00000000000..a77f355812c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-560 @@ -0,0 +1 @@ +foo[?a.b.c==d.e.f] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 new file mode 100644 index 00000000000..c9697aa4870 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-561 @@ -0,0 +1 @@ +foo[?bar==`[0, 1, 2]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 new file mode 100644 index 00000000000..fd7064a0868 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-562 @@ -0,0 +1 @@ +foo[?bar==`["a", "b", "c"]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 new file mode 100644 index 00000000000..61e5e1b8f71 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-563 @@ -0,0 +1 @@ +foo[?bar==`["foo\`bar"]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 new file mode 100644 index 00000000000..bc9d8af1d92 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-564 @@ -0,0 +1 @@ +[?"\\">`"foo"`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 new file mode 100644 index 00000000000..2dd54dc3904 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-565 @@ -0,0 +1 @@ +[?"\\" > `"foo"`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-566 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 new file mode 100644 index 00000000000..7e9668e7834 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-567 @@ -0,0 +1 @@ +"foo" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 new file mode 100644 index 00000000000..d58ac16bf03 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-568 @@ -0,0 +1 @@ +"\\" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 new file mode 100644 index 00000000000..33ac9fba6ff --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-569 @@ -0,0 +1 @@ +*||*|*|* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 new file mode 100644 index 00000000000..acf2435c7cb --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-57 @@ -0,0 +1 @@ +foo[?`[0]` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 new file mode 100644 index 00000000000..99e19638ce4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-570 @@ -0,0 +1 @@ +*[]||[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 new file mode 100644 index 00000000000..be0845011c3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-571 @@ -0,0 +1 @@ +[*.*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 new file mode 100644 index 00000000000..a84b51e1cda --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-572 @@ -0,0 +1 @@ +foo[]."✓" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 new file mode 100644 index 00000000000..c2de55815f0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-573 @@ -0,0 +1 @@ +"☯" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 new file mode 100644 index 00000000000..dc2dda0bb68 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-574 @@ -0,0 +1 @@ +"♪♫•*¨*•.¸¸❤¸¸.•*¨*•♫♪" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 new file mode 100644 index 00000000000..a2d3d5f6ae0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-575 @@ -0,0 +1 @@ +"☃" \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 new file mode 100644 index 00000000000..0971c37eaf7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-576 @@ -0,0 +1 @@ +foo.*.baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 new file mode 100644 index 00000000000..0e39dfd695d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-577 @@ -0,0 +1 @@ +foo.bar.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 new file mode 100644 index 00000000000..89c1ce22dc7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-578 @@ -0,0 +1 @@ +foo.*.notbaz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 new file mode 100644 index 00000000000..5199b9f95d4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-579 @@ -0,0 +1 @@ +foo.*.notbaz[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 new file mode 100644 index 00000000000..99fe382c6c6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-58 @@ -0,0 +1 @@ +foo[?`{"bar": [0]}` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 new file mode 100644 index 00000000000..5bb6d4ae783 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-580 @@ -0,0 +1 @@ +foo.*.notbaz[-1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 new file mode 100644 index 00000000000..edac73189d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-581 @@ -0,0 +1 @@ +foo.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 new file mode 100644 index 00000000000..458d0a6ddd0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-582 @@ -0,0 +1 @@ +foo.*.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 new file mode 100644 index 00000000000..f757fd53459 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-583 @@ -0,0 +1 @@ +foo.*.*.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 new file mode 100644 index 00000000000..670049d96f7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-584 @@ -0,0 +1 @@ +foo.*.*.*.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 new file mode 100644 index 00000000000..3c88caafe88 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-585 @@ -0,0 +1 @@ +*.bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 new file mode 100644 index 00000000000..f59ec20aabf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-586 @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 new file mode 100644 index 00000000000..0852fcc7895 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-587 @@ -0,0 +1 @@ +*.sub1 \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 new file mode 100644 index 00000000000..dee5695746e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-588 @@ -0,0 +1 @@ +*.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 new file mode 100644 index 00000000000..66781bba40a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-589 @@ -0,0 +1 @@ +*.*.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 new file mode 100644 index 00000000000..4aad20ae69e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-59 @@ -0,0 +1 @@ +foo[?`null` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 new file mode 100644 index 00000000000..0db15d97e44 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-590 @@ -0,0 +1 @@ +*.sub1.foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 new file mode 100644 index 00000000000..b24be9d7d1c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-591 @@ -0,0 +1 @@ +foo[*].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 new file mode 100644 index 00000000000..e6efe133fcd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-592 @@ -0,0 +1 @@ +foo[*].notbar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 new file mode 100644 index 00000000000..5a5194647ad --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-593 @@ -0,0 +1 @@ +[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 new file mode 100644 index 00000000000..cd9fb6ba778 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-594 @@ -0,0 +1 @@ +[*].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 new file mode 100644 index 00000000000..cbf1a5d596a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-595 @@ -0,0 +1 @@ +[*].notbar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 new file mode 100644 index 00000000000..8bd13b7eb49 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-596 @@ -0,0 +1 @@ +foo.bar[*].baz \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 new file mode 100644 index 00000000000..7239f3e887e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-597 @@ -0,0 +1 @@ +foo.bar[*].baz[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 new file mode 100644 index 00000000000..f5e431d9e3f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-598 @@ -0,0 +1 @@ +foo.bar[*].baz[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 new file mode 100644 index 00000000000..d0c25953968 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-599 @@ -0,0 +1 @@ +foo.bar[*].baz[2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 new file mode 100644 index 00000000000..b9749b74897 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-6 @@ -0,0 +1 @@ +foo.bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 new file mode 100644 index 00000000000..dac67509bb4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-60 @@ -0,0 +1 @@ +foo[?`[1]` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 new file mode 100644 index 00000000000..a6388271e41 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-600 @@ -0,0 +1 @@ +foo.bar[*].baz[3] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 new file mode 100644 index 00000000000..2a66ffe93b8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-601 @@ -0,0 +1 @@ +foo.bar[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 new file mode 100644 index 00000000000..b6b3695438a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-602 @@ -0,0 +1 @@ +foo.bar[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 new file mode 100644 index 00000000000..7e57f9e74ce --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-603 @@ -0,0 +1 @@ +foo.bar[0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 new file mode 100644 index 00000000000..c5f8bef0bee --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-604 @@ -0,0 +1 @@ +foo.bar[0][0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 new file mode 100644 index 00000000000..3decf08030f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-605 @@ -0,0 +1 @@ +foo.bar[0][0][0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 new file mode 100644 index 00000000000..655e2959bea --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-606 @@ -0,0 +1 @@ +foo[0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 new file mode 100644 index 00000000000..2aa159718c8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-607 @@ -0,0 +1 @@ +foo[*].bar[*].kind \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 new file mode 100644 index 00000000000..556b380bab1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-608 @@ -0,0 +1 @@ +foo[*].bar[0].kind \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 new file mode 100644 index 00000000000..0de3229b83e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-609 @@ -0,0 +1 @@ +foo[*].bar.kind \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 new file mode 100644 index 00000000000..130ed3b379e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-61 @@ -0,0 +1 @@ +foo[?`{"a":2}` == key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 new file mode 100644 index 00000000000..3b511f13351 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-610 @@ -0,0 +1 @@ +foo[*].bar[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 new file mode 100644 index 00000000000..c8dfa16e6bc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-611 @@ -0,0 +1 @@ +foo[*].bar[1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 new file mode 100644 index 00000000000..69f04ee23ff --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-612 @@ -0,0 +1 @@ +foo[*].bar[2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 new file mode 100644 index 00000000000..3b511f13351 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-613 @@ -0,0 +1 @@ +foo[*].bar[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 new file mode 100644 index 00000000000..03e0c0cb93b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-614 @@ -0,0 +1 @@ +foo[*][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 new file mode 100644 index 00000000000..ac1c8966821 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-615 @@ -0,0 +1 @@ +foo[*][1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 new file mode 100644 index 00000000000..03e0c0cb93b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-616 @@ -0,0 +1 @@ +foo[*][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 new file mode 100644 index 00000000000..ac1c8966821 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-617 @@ -0,0 +1 @@ +foo[*][1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 new file mode 100644 index 00000000000..6494cf1c6a0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-618 @@ -0,0 +1 @@ +foo[*][0][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 new file mode 100644 index 00000000000..1406be5721f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-619 @@ -0,0 +1 @@ +foo[*][1][0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 new file mode 100644 index 00000000000..3d15fcc1697 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-62 @@ -0,0 +1 @@ +foo[?key != `true`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 new file mode 100644 index 00000000000..72b5aa281a9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-620 @@ -0,0 +1 @@ +foo[*][0][1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 new file mode 100644 index 00000000000..02a26491ae4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-621 @@ -0,0 +1 @@ +foo[*][1][1] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 new file mode 100644 index 00000000000..cb08037e209 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-622 @@ -0,0 +1 @@ +foo[*][2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 new file mode 100644 index 00000000000..91d695995a4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-623 @@ -0,0 +1 @@ +foo[*][2][2] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 new file mode 100644 index 00000000000..f40f261ad17 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-624 @@ -0,0 +1 @@ +bar[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 new file mode 100644 index 00000000000..03904b1dece --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-625 @@ -0,0 +1 @@ +bar[*].baz[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 new file mode 100644 index 00000000000..fd7c21c340c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-626 @@ -0,0 +1 @@ +string[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 new file mode 100644 index 00000000000..d7ca4719a99 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-627 @@ -0,0 +1 @@ +hash[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 new file mode 100644 index 00000000000..b3ddffe3cfe --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-628 @@ -0,0 +1 @@ +number[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 new file mode 100644 index 00000000000..c03cd39ebf5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-629 @@ -0,0 +1 @@ +nullvalue[*] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 new file mode 100644 index 00000000000..08731af6908 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-63 @@ -0,0 +1 @@ +foo[?key != `false`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 new file mode 100644 index 00000000000..b3c40cd533f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-630 @@ -0,0 +1 @@ +string[*].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 new file mode 100644 index 00000000000..c5930d543f3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-631 @@ -0,0 +1 @@ +hash[*].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 new file mode 100644 index 00000000000..cc0b1a4896a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-632 @@ -0,0 +1 @@ +number[*].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 new file mode 100644 index 00000000000..d677b965852 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-633 @@ -0,0 +1 @@ +nullvalue[*].foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 new file mode 100644 index 00000000000..c1166640155 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-634 @@ -0,0 +1 @@ +nullvalue[*].foo[*].bar \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 new file mode 100644 index 00000000000..e3399771088 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-635 @@ -0,0 +1 @@ +string.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 new file mode 100644 index 00000000000..76f53453a8a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-636 @@ -0,0 +1 @@ +hash.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 new file mode 100644 index 00000000000..dd485072f26 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-637 @@ -0,0 +1 @@ +number.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 new file mode 100644 index 00000000000..16000c003cd --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-638 @@ -0,0 +1 @@ +array.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 new file mode 100644 index 00000000000..1d0d03ed3b5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-639 @@ -0,0 +1 @@ +nullvalue.* \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 new file mode 100644 index 00000000000..b67aebe98ad --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-64 @@ -0,0 +1 @@ +foo[?key != `0`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 new file mode 100644 index 00000000000..7e8066d39f5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-640 @@ -0,0 +1 @@ +*[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 new file mode 100644 index 00000000000..41ebe5ba9d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-641 @@ -0,0 +1 @@ +`foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 new file mode 100644 index 00000000000..fe0397993c5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-642 @@ -0,0 +1 @@ +`foo\"quote` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 new file mode 100644 index 00000000000..1a27fd80c3c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-643 @@ -0,0 +1 @@ +`✓` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 new file mode 100644 index 00000000000..559a13456be --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-644 @@ -0,0 +1 @@ +`foo\"bar` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 new file mode 100644 index 00000000000..e31621b438e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-645 @@ -0,0 +1 @@ +`1\`` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 new file mode 100644 index 00000000000..6bf7a10362a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-646 @@ -0,0 +1 @@ +`\\`.{a:`b`} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 new file mode 100644 index 00000000000..41ebe5ba9d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-647 @@ -0,0 +1 @@ +`foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 new file mode 100644 index 00000000000..28b9bcbbb52 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-648 @@ -0,0 +1 @@ +` foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 new file mode 100644 index 00000000000..41ebe5ba9d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-649 @@ -0,0 +1 @@ +`foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 new file mode 100644 index 00000000000..d3ac793bb6b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-65 @@ -0,0 +1 @@ +foo[?key != `1`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 new file mode 100644 index 00000000000..fe0397993c5 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-650 @@ -0,0 +1 @@ +`foo\"quote` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 new file mode 100644 index 00000000000..1a27fd80c3c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-651 @@ -0,0 +1 @@ +`✓` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 new file mode 100644 index 00000000000..559a13456be --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-652 @@ -0,0 +1 @@ +`foo\"bar` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 new file mode 100644 index 00000000000..e31621b438e --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-653 @@ -0,0 +1 @@ +`1\`` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 new file mode 100644 index 00000000000..6bf7a10362a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-654 @@ -0,0 +1 @@ +`\\`.{a:`b`} \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 new file mode 100644 index 00000000000..41ebe5ba9d7 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-655 @@ -0,0 +1 @@ +`foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 new file mode 100644 index 00000000000..28b9bcbbb52 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-656 @@ -0,0 +1 @@ +` foo` \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 new file mode 100644 index 00000000000..065295bc17a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-66 @@ -0,0 +1 @@ +foo[?key != `null`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 new file mode 100644 index 00000000000..43d164927d4 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-67 @@ -0,0 +1 @@ +foo[?key != `[1]`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 new file mode 100644 index 00000000000..6b884fa866f --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-68 @@ -0,0 +1 @@ +foo[?key != `{"a":2}`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 new file mode 100644 index 00000000000..d85c779d0a3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-69 @@ -0,0 +1 @@ +foo[?`true` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 new file mode 100644 index 00000000000..44d6628cdc6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-7 @@ -0,0 +1 @@ +bad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 new file mode 100644 index 00000000000..3e6dcf3045a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-70 @@ -0,0 +1 @@ +foo[?`false` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 new file mode 100644 index 00000000000..bdb820b30b3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-71 @@ -0,0 +1 @@ +foo[?`0` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 new file mode 100644 index 00000000000..3f3048a004c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-72 @@ -0,0 +1 @@ +foo[?`1` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 new file mode 100644 index 00000000000..dacc2572451 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-73 @@ -0,0 +1 @@ +foo[?`null` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 new file mode 100644 index 00000000000..32ebae8800b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-74 @@ -0,0 +1 @@ +foo[?`[1]` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 new file mode 100644 index 00000000000..dcd023e0fbc --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-75 @@ -0,0 +1 @@ +foo[?`{"a":2}` != key] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 new file mode 100644 index 00000000000..e08cc13cbe3 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-76 @@ -0,0 +1 @@ +reservations[].instances[?bar==`1`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 new file mode 100644 index 00000000000..1ec43f45fce --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-77 @@ -0,0 +1 @@ +reservations[*].instances[?bar==`1`] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 new file mode 100644 index 00000000000..30387116349 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-78 @@ -0,0 +1 @@ +reservations[].instances[?bar==`1`][] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 new file mode 100644 index 00000000000..e3875746b35 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-79 @@ -0,0 +1 @@ +foo[?bar==`1`].bar[0] \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 new file mode 100644 index 00000000000..da7bc1ccfd0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-8 @@ -0,0 +1 @@ +bad.morebad.morebad \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 new file mode 100644 index 00000000000..5c3d683565d --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-80 @@ -0,0 +1 @@ +foo[?a==`1`].b.c \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 new file mode 100644 index 00000000000..6232808f0ae --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-81 @@ -0,0 +1 @@ +abs(foo) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 new file mode 100644 index 00000000000..6232808f0ae --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-82 @@ -0,0 +1 @@ +abs(foo) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 new file mode 100644 index 00000000000..29497f4ff54 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-83 @@ -0,0 +1 @@ +abs(array[1]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 new file mode 100644 index 00000000000..29497f4ff54 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-84 @@ -0,0 +1 @@ +abs(array[1]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 new file mode 100644 index 00000000000..346696563f8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-85 @@ -0,0 +1 @@ +abs(`-24`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 new file mode 100644 index 00000000000..346696563f8 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-86 @@ -0,0 +1 @@ +abs(`-24`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 new file mode 100644 index 00000000000..c6268f8473b --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-87 @@ -0,0 +1 @@ +avg(numbers) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 new file mode 100644 index 00000000000..7ce703695ee --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-88 @@ -0,0 +1 @@ +ceil(`1.2`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 new file mode 100644 index 00000000000..0561bc26d9a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-89 @@ -0,0 +1 @@ +ceil(decimals[0]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 new file mode 100644 index 00000000000..19102815663 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-9 @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 new file mode 100644 index 00000000000..c78c1fc3002 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-90 @@ -0,0 +1 @@ +ceil(decimals[1]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 new file mode 100644 index 00000000000..ebcb4bbdbb9 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-91 @@ -0,0 +1 @@ +ceil(decimals[2]) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 new file mode 100644 index 00000000000..6edbf1afe4a --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-92 @@ -0,0 +1 @@ +contains('abc', 'a') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 new file mode 100644 index 00000000000..d2b2f070dab --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-93 @@ -0,0 +1 @@ +contains('abc', 'd') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 new file mode 100644 index 00000000000..3535da2eca6 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-94 @@ -0,0 +1 @@ +contains(strings, 'a') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 new file mode 100644 index 00000000000..ba839fe60d1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-95 @@ -0,0 +1 @@ +contains(decimals, `1.2`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 new file mode 100644 index 00000000000..f4358186979 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-96 @@ -0,0 +1 @@ +contains(decimals, `false`) \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 new file mode 100644 index 00000000000..adb65fc01f0 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-97 @@ -0,0 +1 @@ +ends_with(str, 'r') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 new file mode 100644 index 00000000000..93d6901bead --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/corpus/expr-98 @@ -0,0 +1 @@ +ends_with(str, 'tr') \ No newline at end of file diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go new file mode 100644 index 00000000000..c7df08782a1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/fuzz/jmespath.go @@ -0,0 +1,13 @@ +package jmespath + +import "github.com/jmespath/go-jmespath" + +// Fuzz will fuzz test the JMESPath parser. +func Fuzz(data []byte) int { + p := jmespath.NewParser() + _, err := p.Parse(string(data)) + if err != nil { + return 1 + } + return 0 +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go new file mode 100644 index 00000000000..13c74604c2c --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter.go @@ -0,0 +1,418 @@ +package jmespath + +import ( + "errors" + "reflect" + "unicode" + "unicode/utf8" +) + +/* This is a tree based interpreter. It walks the AST and directly + interprets the AST to search through a JSON document. +*/ + +type treeInterpreter struct { + fCall *functionCaller +} + +func newInterpreter() *treeInterpreter { + interpreter := treeInterpreter{} + interpreter.fCall = newFunctionCaller() + return &interpreter +} + +type expRef struct { + ref ASTNode +} + +// Execute takes an ASTNode and input data and interprets the AST directly. +// It will produce the result of applying the JMESPath expression associated +// with the ASTNode to the input data "value". +func (intr *treeInterpreter) Execute(node ASTNode, value interface{}) (interface{}, error) { + switch node.nodeType { + case ASTComparator: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + right, err := intr.Execute(node.children[1], value) + if err != nil { + return nil, err + } + switch node.value { + case tEQ: + return objsEqual(left, right), nil + case tNE: + return !objsEqual(left, right), nil + } + leftNum, ok := left.(float64) + if !ok { + return nil, nil + } + rightNum, ok := right.(float64) + if !ok { + return nil, nil + } + switch node.value { + case tGT: + return leftNum > rightNum, nil + case tGTE: + return leftNum >= rightNum, nil + case tLT: + return leftNum < rightNum, nil + case tLTE: + return leftNum <= rightNum, nil + } + case ASTExpRef: + return expRef{ref: node.children[0]}, nil + case ASTFunctionExpression: + resolvedArgs := []interface{}{} + for _, arg := range node.children { + current, err := intr.Execute(arg, value) + if err != nil { + return nil, err + } + resolvedArgs = append(resolvedArgs, current) + } + return intr.fCall.CallFunction(node.value.(string), resolvedArgs, intr) + case ASTField: + if m, ok := value.(map[string]interface{}); ok { + key := node.value.(string) + return m[key], nil + } + return intr.fieldFromStruct(node.value.(string), value) + case ASTFilterProjection: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, nil + } + sliceType, ok := left.([]interface{}) + if !ok { + if isSliceType(left) { + return intr.filterProjectionWithReflection(node, left) + } + return nil, nil + } + compareNode := node.children[2] + collected := []interface{}{} + for _, element := range sliceType { + result, err := intr.Execute(compareNode, element) + if err != nil { + return nil, err + } + if !isFalse(result) { + current, err := intr.Execute(node.children[1], element) + if err != nil { + return nil, err + } + if current != nil { + collected = append(collected, current) + } + } + } + return collected, nil + case ASTFlatten: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, nil + } + sliceType, ok := left.([]interface{}) + if !ok { + // If we can't type convert to []interface{}, there's + // a chance this could still work via reflection if we're + // dealing with user provided types. + if isSliceType(left) { + return intr.flattenWithReflection(left) + } + return nil, nil + } + flattened := []interface{}{} + for _, element := range sliceType { + if elementSlice, ok := element.([]interface{}); ok { + flattened = append(flattened, elementSlice...) + } else if isSliceType(element) { + reflectFlat := []interface{}{} + v := reflect.ValueOf(element) + for i := 0; i < v.Len(); i++ { + reflectFlat = append(reflectFlat, v.Index(i).Interface()) + } + flattened = append(flattened, reflectFlat...) + } else { + flattened = append(flattened, element) + } + } + return flattened, nil + case ASTIdentity, ASTCurrentNode: + return value, nil + case ASTIndex: + if sliceType, ok := value.([]interface{}); ok { + index := node.value.(int) + if index < 0 { + index += len(sliceType) + } + if index < len(sliceType) && index >= 0 { + return sliceType[index], nil + } + return nil, nil + } + // Otherwise try via reflection. + rv := reflect.ValueOf(value) + if rv.Kind() == reflect.Slice { + index := node.value.(int) + if index < 0 { + index += rv.Len() + } + if index < rv.Len() && index >= 0 { + v := rv.Index(index) + return v.Interface(), nil + } + } + return nil, nil + case ASTKeyValPair: + return intr.Execute(node.children[0], value) + case ASTLiteral: + return node.value, nil + case ASTMultiSelectHash: + if value == nil { + return nil, nil + } + collected := make(map[string]interface{}) + for _, child := range node.children { + current, err := intr.Execute(child, value) + if err != nil { + return nil, err + } + key := child.value.(string) + collected[key] = current + } + return collected, nil + case ASTMultiSelectList: + if value == nil { + return nil, nil + } + collected := []interface{}{} + for _, child := range node.children { + current, err := intr.Execute(child, value) + if err != nil { + return nil, err + } + collected = append(collected, current) + } + return collected, nil + case ASTOrExpression: + matched, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + if isFalse(matched) { + matched, err = intr.Execute(node.children[1], value) + if err != nil { + return nil, err + } + } + return matched, nil + case ASTAndExpression: + matched, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + if isFalse(matched) { + return matched, nil + } + return intr.Execute(node.children[1], value) + case ASTNotExpression: + matched, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + if isFalse(matched) { + return true, nil + } + return false, nil + case ASTPipe: + result := value + var err error + for _, child := range node.children { + result, err = intr.Execute(child, result) + if err != nil { + return nil, err + } + } + return result, nil + case ASTProjection: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + sliceType, ok := left.([]interface{}) + if !ok { + if isSliceType(left) { + return intr.projectWithReflection(node, left) + } + return nil, nil + } + collected := []interface{}{} + var current interface{} + for _, element := range sliceType { + current, err = intr.Execute(node.children[1], element) + if err != nil { + return nil, err + } + if current != nil { + collected = append(collected, current) + } + } + return collected, nil + case ASTSubexpression, ASTIndexExpression: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, err + } + return intr.Execute(node.children[1], left) + case ASTSlice: + sliceType, ok := value.([]interface{}) + if !ok { + if isSliceType(value) { + return intr.sliceWithReflection(node, value) + } + return nil, nil + } + parts := node.value.([]*int) + sliceParams := make([]sliceParam, 3) + for i, part := range parts { + if part != nil { + sliceParams[i].Specified = true + sliceParams[i].N = *part + } + } + return slice(sliceType, sliceParams) + case ASTValueProjection: + left, err := intr.Execute(node.children[0], value) + if err != nil { + return nil, nil + } + mapType, ok := left.(map[string]interface{}) + if !ok { + return nil, nil + } + values := make([]interface{}, len(mapType)) + for _, value := range mapType { + values = append(values, value) + } + collected := []interface{}{} + for _, element := range values { + current, err := intr.Execute(node.children[1], element) + if err != nil { + return nil, err + } + if current != nil { + collected = append(collected, current) + } + } + return collected, nil + } + return nil, errors.New("Unknown AST node: " + node.nodeType.String()) +} + +func (intr *treeInterpreter) fieldFromStruct(key string, value interface{}) (interface{}, error) { + rv := reflect.ValueOf(value) + first, n := utf8.DecodeRuneInString(key) + fieldName := string(unicode.ToUpper(first)) + key[n:] + if rv.Kind() == reflect.Struct { + v := rv.FieldByName(fieldName) + if !v.IsValid() { + return nil, nil + } + return v.Interface(), nil + } else if rv.Kind() == reflect.Ptr { + // Handle multiple levels of indirection? + if rv.IsNil() { + return nil, nil + } + rv = rv.Elem() + v := rv.FieldByName(fieldName) + if !v.IsValid() { + return nil, nil + } + return v.Interface(), nil + } + return nil, nil +} + +func (intr *treeInterpreter) flattenWithReflection(value interface{}) (interface{}, error) { + v := reflect.ValueOf(value) + flattened := []interface{}{} + for i := 0; i < v.Len(); i++ { + element := v.Index(i).Interface() + if reflect.TypeOf(element).Kind() == reflect.Slice { + // Then insert the contents of the element + // slice into the flattened slice, + // i.e flattened = append(flattened, mySlice...) + elementV := reflect.ValueOf(element) + for j := 0; j < elementV.Len(); j++ { + flattened = append( + flattened, elementV.Index(j).Interface()) + } + } else { + flattened = append(flattened, element) + } + } + return flattened, nil +} + +func (intr *treeInterpreter) sliceWithReflection(node ASTNode, value interface{}) (interface{}, error) { + v := reflect.ValueOf(value) + parts := node.value.([]*int) + sliceParams := make([]sliceParam, 3) + for i, part := range parts { + if part != nil { + sliceParams[i].Specified = true + sliceParams[i].N = *part + } + } + final := []interface{}{} + for i := 0; i < v.Len(); i++ { + element := v.Index(i).Interface() + final = append(final, element) + } + return slice(final, sliceParams) +} + +func (intr *treeInterpreter) filterProjectionWithReflection(node ASTNode, value interface{}) (interface{}, error) { + compareNode := node.children[2] + collected := []interface{}{} + v := reflect.ValueOf(value) + for i := 0; i < v.Len(); i++ { + element := v.Index(i).Interface() + result, err := intr.Execute(compareNode, element) + if err != nil { + return nil, err + } + if !isFalse(result) { + current, err := intr.Execute(node.children[1], element) + if err != nil { + return nil, err + } + if current != nil { + collected = append(collected, current) + } + } + } + return collected, nil +} + +func (intr *treeInterpreter) projectWithReflection(node ASTNode, value interface{}) (interface{}, error) { + collected := []interface{}{} + v := reflect.ValueOf(value) + for i := 0; i < v.Len(); i++ { + element := v.Index(i).Interface() + result, err := intr.Execute(node.children[1], element) + if err != nil { + return nil, err + } + if result != nil { + collected = append(collected, result) + } + } + return collected, nil +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go new file mode 100644 index 00000000000..5b529c4f313 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/interpreter_test.go @@ -0,0 +1,213 @@ +package jmespath + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" +) + +type scalars struct { + Foo string + Bar string +} + +type sliceType struct { + A string + B []scalars + C []*scalars +} + +type benchmarkStruct struct { + Fooasdfasdfasdfasdf string +} + +type benchmarkNested struct { + Fooasdfasdfasdfasdf nestedA +} + +type nestedA struct { + Fooasdfasdfasdfasdf nestedB +} + +type nestedB struct { + Fooasdfasdfasdfasdf nestedC +} + +type nestedC struct { + Fooasdfasdfasdfasdf string +} + +type nestedSlice struct { + A []sliceType +} + +func TestCanSupportEmptyInterface(t *testing.T) { + assert := assert.New(t) + data := make(map[string]interface{}) + data["foo"] = "bar" + result, err := Search("foo", data) + assert.Nil(err) + assert.Equal("bar", result) +} + +func TestCanSupportUserDefinedStructsValue(t *testing.T) { + assert := assert.New(t) + s := scalars{Foo: "one", Bar: "bar"} + result, err := Search("Foo", s) + assert.Nil(err) + assert.Equal("one", result) +} + +func TestCanSupportUserDefinedStructsRef(t *testing.T) { + assert := assert.New(t) + s := scalars{Foo: "one", Bar: "bar"} + result, err := Search("Foo", &s) + assert.Nil(err) + assert.Equal("one", result) +} + +func TestCanSupportStructWithSliceAll(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}} + result, err := Search("B[].Foo", data) + assert.Nil(err) + assert.Equal([]interface{}{"f1", "correct"}, result) +} + +func TestCanSupportStructWithSlicingExpression(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}} + result, err := Search("B[:].Foo", data) + assert.Nil(err) + assert.Equal([]interface{}{"f1", "correct"}, result) +} + +func TestCanSupportStructWithFilterProjection(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}} + result, err := Search("B[? `true` ].Foo", data) + assert.Nil(err) + assert.Equal([]interface{}{"f1", "correct"}, result) +} + +func TestCanSupportStructWithSlice(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}} + result, err := Search("B[-1].Foo", data) + assert.Nil(err) + assert.Equal("correct", result) +} + +func TestCanSupportStructWithOrExpressions(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", C: nil} + result, err := Search("C || A", data) + assert.Nil(err) + assert.Equal("foo", result) +} + +func TestCanSupportStructWithSlicePointer(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", C: []*scalars{&scalars{"f1", "b1"}, &scalars{"correct", "b2"}}} + result, err := Search("C[-1].Foo", data) + assert.Nil(err) + assert.Equal("correct", result) +} + +func TestWillAutomaticallyCapitalizeFieldNames(t *testing.T) { + assert := assert.New(t) + s := scalars{Foo: "one", Bar: "bar"} + // Note that there's a lower cased "foo" instead of "Foo", + // but it should still correspond to the Foo field in the + // scalars struct + result, err := Search("foo", &s) + assert.Nil(err) + assert.Equal("one", result) +} + +func TestCanSupportStructWithSliceLowerCased(t *testing.T) { + assert := assert.New(t) + data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}} + result, err := Search("b[-1].foo", data) + assert.Nil(err) + assert.Equal("correct", result) +} + +func TestCanSupportStructWithNestedPointers(t *testing.T) { + assert := assert.New(t) + data := struct{ A *struct{ B int } }{} + result, err := Search("A.B", data) + assert.Nil(err) + assert.Nil(result) +} + +func TestCanSupportFlattenNestedSlice(t *testing.T) { + assert := assert.New(t) + data := nestedSlice{A: []sliceType{ + {B: []scalars{{Foo: "f1a"}, {Foo: "f1b"}}}, + {B: []scalars{{Foo: "f2a"}, {Foo: "f2b"}}}, + }} + result, err := Search("A[].B[].Foo", data) + assert.Nil(err) + assert.Equal([]interface{}{"f1a", "f1b", "f2a", "f2b"}, result) +} + +func TestCanSupportFlattenNestedEmptySlice(t *testing.T) { + assert := assert.New(t) + data := nestedSlice{A: []sliceType{ + {}, {B: []scalars{{Foo: "a"}}}, + }} + result, err := Search("A[].B[].Foo", data) + assert.Nil(err) + assert.Equal([]interface{}{"a"}, result) +} + +func TestCanSupportProjectionsWithStructs(t *testing.T) { + assert := assert.New(t) + data := nestedSlice{A: []sliceType{ + {A: "first"}, {A: "second"}, {A: "third"}, + }} + result, err := Search("A[*].A", data) + assert.Nil(err) + assert.Equal([]interface{}{"first", "second", "third"}, result) +} + +func BenchmarkInterpretSingleFieldStruct(b *testing.B) { + intr := newInterpreter() + parser := NewParser() + ast, _ := parser.Parse("fooasdfasdfasdfasdf") + data := benchmarkStruct{"foobarbazqux"} + for i := 0; i < b.N; i++ { + intr.Execute(ast, &data) + } +} + +func BenchmarkInterpretNestedStruct(b *testing.B) { + intr := newInterpreter() + parser := NewParser() + ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf") + data := benchmarkNested{ + nestedA{ + nestedB{ + nestedC{"foobarbazqux"}, + }, + }, + } + for i := 0; i < b.N; i++ { + intr.Execute(ast, &data) + } +} + +func BenchmarkInterpretNestedMaps(b *testing.B) { + jsonData := []byte(`{"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": "foobarbazqux"}}}}`) + var data interface{} + json.Unmarshal(jsonData, &data) + + intr := newInterpreter() + parser := NewParser() + ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf") + for i := 0; i < b.N; i++ { + intr.Execute(ast, data) + } +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go new file mode 100644 index 00000000000..817900c8f52 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer.go @@ -0,0 +1,420 @@ +package jmespath + +import ( + "bytes" + "encoding/json" + "fmt" + "strconv" + "strings" + "unicode/utf8" +) + +type token struct { + tokenType tokType + value string + position int + length int +} + +type tokType int + +const eof = -1 + +// Lexer contains information about the expression being tokenized. +type Lexer struct { + expression string // The expression provided by the user. + currentPos int // The current position in the string. + lastWidth int // The width of the current rune. This + buf bytes.Buffer // Internal buffer used for building up values. +} + +// SyntaxError is the main error used whenever a lexing or parsing error occurs. +type SyntaxError struct { + msg string // Error message displayed to user + Expression string // Expression that generated a SyntaxError + Offset int // The location in the string where the error occurred +} + +func (e SyntaxError) Error() string { + // In the future, it would be good to underline the specific + // location where the error occurred. + return "SyntaxError: " + e.msg +} + +// HighlightLocation will show where the syntax error occurred. +// It will place a "^" character on a line below the expression +// at the point where the syntax error occurred. +func (e SyntaxError) HighlightLocation() string { + return e.Expression + "\n" + strings.Repeat(" ", e.Offset) + "^" +} + +//go:generate stringer -type=tokType +const ( + tUnknown tokType = iota + tStar + tDot + tFilter + tFlatten + tLparen + tRparen + tLbracket + tRbracket + tLbrace + tRbrace + tOr + tPipe + tNumber + tUnquotedIdentifier + tQuotedIdentifier + tComma + tColon + tLT + tLTE + tGT + tGTE + tEQ + tNE + tJSONLiteral + tStringLiteral + tCurrent + tExpref + tAnd + tNot + tEOF +) + +var basicTokens = map[rune]tokType{ + '.': tDot, + '*': tStar, + ',': tComma, + ':': tColon, + '{': tLbrace, + '}': tRbrace, + ']': tRbracket, // tLbracket not included because it could be "[]" + '(': tLparen, + ')': tRparen, + '@': tCurrent, +} + +// Bit mask for [a-zA-Z_] shifted down 64 bits to fit in a single uint64. +// When using this bitmask just be sure to shift the rune down 64 bits +// before checking against identifierStartBits. +const identifierStartBits uint64 = 576460745995190270 + +// Bit mask for [a-zA-Z0-9], 128 bits -> 2 uint64s. +var identifierTrailingBits = [2]uint64{287948901175001088, 576460745995190270} + +var whiteSpace = map[rune]bool{ + ' ': true, '\t': true, '\n': true, '\r': true, +} + +func (t token) String() string { + return fmt.Sprintf("Token{%+v, %s, %d, %d}", + t.tokenType, t.value, t.position, t.length) +} + +// NewLexer creates a new JMESPath lexer. +func NewLexer() *Lexer { + lexer := Lexer{} + return &lexer +} + +func (lexer *Lexer) next() rune { + if lexer.currentPos >= len(lexer.expression) { + lexer.lastWidth = 0 + return eof + } + r, w := utf8.DecodeRuneInString(lexer.expression[lexer.currentPos:]) + lexer.lastWidth = w + lexer.currentPos += w + return r +} + +func (lexer *Lexer) back() { + lexer.currentPos -= lexer.lastWidth +} + +func (lexer *Lexer) peek() rune { + t := lexer.next() + lexer.back() + return t +} + +// tokenize takes an expression and returns corresponding tokens. +func (lexer *Lexer) tokenize(expression string) ([]token, error) { + var tokens []token + lexer.expression = expression + lexer.currentPos = 0 + lexer.lastWidth = 0 +loop: + for { + r := lexer.next() + if identifierStartBits&(1<<(uint64(r)-64)) > 0 { + t := lexer.consumeUnquotedIdentifier() + tokens = append(tokens, t) + } else if val, ok := basicTokens[r]; ok { + // Basic single char token. + t := token{ + tokenType: val, + value: string(r), + position: lexer.currentPos - lexer.lastWidth, + length: 1, + } + tokens = append(tokens, t) + } else if r == '-' || (r >= '0' && r <= '9') { + t := lexer.consumeNumber() + tokens = append(tokens, t) + } else if r == '[' { + t := lexer.consumeLBracket() + tokens = append(tokens, t) + } else if r == '"' { + t, err := lexer.consumeQuotedIdentifier() + if err != nil { + return tokens, err + } + tokens = append(tokens, t) + } else if r == '\'' { + t, err := lexer.consumeRawStringLiteral() + if err != nil { + return tokens, err + } + tokens = append(tokens, t) + } else if r == '`' { + t, err := lexer.consumeLiteral() + if err != nil { + return tokens, err + } + tokens = append(tokens, t) + } else if r == '|' { + t := lexer.matchOrElse(r, '|', tOr, tPipe) + tokens = append(tokens, t) + } else if r == '<' { + t := lexer.matchOrElse(r, '=', tLTE, tLT) + tokens = append(tokens, t) + } else if r == '>' { + t := lexer.matchOrElse(r, '=', tGTE, tGT) + tokens = append(tokens, t) + } else if r == '!' { + t := lexer.matchOrElse(r, '=', tNE, tNot) + tokens = append(tokens, t) + } else if r == '=' { + t := lexer.matchOrElse(r, '=', tEQ, tUnknown) + tokens = append(tokens, t) + } else if r == '&' { + t := lexer.matchOrElse(r, '&', tAnd, tExpref) + tokens = append(tokens, t) + } else if r == eof { + break loop + } else if _, ok := whiteSpace[r]; ok { + // Ignore whitespace + } else { + return tokens, lexer.syntaxError(fmt.Sprintf("Unknown char: %s", strconv.QuoteRuneToASCII(r))) + } + } + tokens = append(tokens, token{tEOF, "", len(lexer.expression), 0}) + return tokens, nil +} + +// Consume characters until the ending rune "r" is reached. +// If the end of the expression is reached before seeing the +// terminating rune "r", then an error is returned. +// If no error occurs then the matching substring is returned. +// The returned string will not include the ending rune. +func (lexer *Lexer) consumeUntil(end rune) (string, error) { + start := lexer.currentPos + current := lexer.next() + for current != end && current != eof { + if current == '\\' && lexer.peek() != eof { + lexer.next() + } + current = lexer.next() + } + if lexer.lastWidth == 0 { + // Then we hit an EOF so we never reached the closing + // delimiter. + return "", SyntaxError{ + msg: "Unclosed delimiter: " + string(end), + Expression: lexer.expression, + Offset: len(lexer.expression), + } + } + return lexer.expression[start : lexer.currentPos-lexer.lastWidth], nil +} + +func (lexer *Lexer) consumeLiteral() (token, error) { + start := lexer.currentPos + value, err := lexer.consumeUntil('`') + if err != nil { + return token{}, err + } + value = strings.Replace(value, "\\`", "`", -1) + return token{ + tokenType: tJSONLiteral, + value: value, + position: start, + length: len(value), + }, nil +} + +func (lexer *Lexer) consumeRawStringLiteral() (token, error) { + start := lexer.currentPos + currentIndex := start + current := lexer.next() + for current != '\'' && lexer.peek() != eof { + if current == '\\' && lexer.peek() == '\'' { + chunk := lexer.expression[currentIndex : lexer.currentPos-1] + lexer.buf.WriteString(chunk) + lexer.buf.WriteString("'") + lexer.next() + currentIndex = lexer.currentPos + } + current = lexer.next() + } + if lexer.lastWidth == 0 { + // Then we hit an EOF so we never reached the closing + // delimiter. + return token{}, SyntaxError{ + msg: "Unclosed delimiter: '", + Expression: lexer.expression, + Offset: len(lexer.expression), + } + } + if currentIndex < lexer.currentPos { + lexer.buf.WriteString(lexer.expression[currentIndex : lexer.currentPos-1]) + } + value := lexer.buf.String() + // Reset the buffer so it can reused again. + lexer.buf.Reset() + return token{ + tokenType: tStringLiteral, + value: value, + position: start, + length: len(value), + }, nil +} + +func (lexer *Lexer) syntaxError(msg string) SyntaxError { + return SyntaxError{ + msg: msg, + Expression: lexer.expression, + Offset: lexer.currentPos - 1, + } +} + +// Checks for a two char token, otherwise matches a single character +// token. This is used whenever a two char token overlaps a single +// char token, e.g. "||" -> tPipe, "|" -> tOr. +func (lexer *Lexer) matchOrElse(first rune, second rune, matchedType tokType, singleCharType tokType) token { + start := lexer.currentPos - lexer.lastWidth + nextRune := lexer.next() + var t token + if nextRune == second { + t = token{ + tokenType: matchedType, + value: string(first) + string(second), + position: start, + length: 2, + } + } else { + lexer.back() + t = token{ + tokenType: singleCharType, + value: string(first), + position: start, + length: 1, + } + } + return t +} + +func (lexer *Lexer) consumeLBracket() token { + // There's three options here: + // 1. A filter expression "[?" + // 2. A flatten operator "[]" + // 3. A bare rbracket "[" + start := lexer.currentPos - lexer.lastWidth + nextRune := lexer.next() + var t token + if nextRune == '?' { + t = token{ + tokenType: tFilter, + value: "[?", + position: start, + length: 2, + } + } else if nextRune == ']' { + t = token{ + tokenType: tFlatten, + value: "[]", + position: start, + length: 2, + } + } else { + t = token{ + tokenType: tLbracket, + value: "[", + position: start, + length: 1, + } + lexer.back() + } + return t +} + +func (lexer *Lexer) consumeQuotedIdentifier() (token, error) { + start := lexer.currentPos + value, err := lexer.consumeUntil('"') + if err != nil { + return token{}, err + } + var decoded string + asJSON := []byte("\"" + value + "\"") + if err := json.Unmarshal([]byte(asJSON), &decoded); err != nil { + return token{}, err + } + return token{ + tokenType: tQuotedIdentifier, + value: decoded, + position: start - 1, + length: len(decoded), + }, nil +} + +func (lexer *Lexer) consumeUnquotedIdentifier() token { + // Consume runes until we reach the end of an unquoted + // identifier. + start := lexer.currentPos - lexer.lastWidth + for { + r := lexer.next() + if r < 0 || r > 128 || identifierTrailingBits[uint64(r)/64]&(1<<(uint64(r)%64)) == 0 { + lexer.back() + break + } + } + value := lexer.expression[start:lexer.currentPos] + return token{ + tokenType: tUnquotedIdentifier, + value: value, + position: start, + length: lexer.currentPos - start, + } +} + +func (lexer *Lexer) consumeNumber() token { + // Consume runes until we reach something that's not a number. + start := lexer.currentPos - lexer.lastWidth + for { + r := lexer.next() + if r < '0' || r > '9' { + lexer.back() + break + } + } + value := lexer.expression[start:lexer.currentPos] + return token{ + tokenType: tNumber, + value: value, + position: start, + length: lexer.currentPos - start, + } +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go new file mode 100644 index 00000000000..7a9a9ee24bf --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/lexer_test.go @@ -0,0 +1,161 @@ +package jmespath + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var lexingTests = []struct { + expression string + expected []token +}{ + {"*", []token{token{tStar, "*", 0, 1}}}, + {".", []token{token{tDot, ".", 0, 1}}}, + {"[?", []token{token{tFilter, "[?", 0, 2}}}, + {"[]", []token{token{tFlatten, "[]", 0, 2}}}, + {"(", []token{token{tLparen, "(", 0, 1}}}, + {")", []token{token{tRparen, ")", 0, 1}}}, + {"[", []token{token{tLbracket, "[", 0, 1}}}, + {"]", []token{token{tRbracket, "]", 0, 1}}}, + {"{", []token{token{tLbrace, "{", 0, 1}}}, + {"}", []token{token{tRbrace, "}", 0, 1}}}, + {"||", []token{token{tOr, "||", 0, 2}}}, + {"|", []token{token{tPipe, "|", 0, 1}}}, + {"29", []token{token{tNumber, "29", 0, 2}}}, + {"2", []token{token{tNumber, "2", 0, 1}}}, + {"0", []token{token{tNumber, "0", 0, 1}}}, + {"-20", []token{token{tNumber, "-20", 0, 3}}}, + {"foo", []token{token{tUnquotedIdentifier, "foo", 0, 3}}}, + {`"bar"`, []token{token{tQuotedIdentifier, "bar", 0, 3}}}, + // Escaping the delimiter + {`"bar\"baz"`, []token{token{tQuotedIdentifier, `bar"baz`, 0, 7}}}, + {",", []token{token{tComma, ",", 0, 1}}}, + {":", []token{token{tColon, ":", 0, 1}}}, + {"<", []token{token{tLT, "<", 0, 1}}}, + {"<=", []token{token{tLTE, "<=", 0, 2}}}, + {">", []token{token{tGT, ">", 0, 1}}}, + {">=", []token{token{tGTE, ">=", 0, 2}}}, + {"==", []token{token{tEQ, "==", 0, 2}}}, + {"!=", []token{token{tNE, "!=", 0, 2}}}, + {"`[0, 1, 2]`", []token{token{tJSONLiteral, "[0, 1, 2]", 1, 9}}}, + {"'foo'", []token{token{tStringLiteral, "foo", 1, 3}}}, + {"'a'", []token{token{tStringLiteral, "a", 1, 1}}}, + {`'foo\'bar'`, []token{token{tStringLiteral, "foo'bar", 1, 7}}}, + {"@", []token{token{tCurrent, "@", 0, 1}}}, + {"&", []token{token{tExpref, "&", 0, 1}}}, + // Quoted identifier unicode escape sequences + {`"\u2713"`, []token{token{tQuotedIdentifier, "✓", 0, 3}}}, + {`"\\"`, []token{token{tQuotedIdentifier, `\`, 0, 1}}}, + {"`\"foo\"`", []token{token{tJSONLiteral, "\"foo\"", 1, 5}}}, + // Combinations of tokens. + {"foo.bar", []token{ + token{tUnquotedIdentifier, "foo", 0, 3}, + token{tDot, ".", 3, 1}, + token{tUnquotedIdentifier, "bar", 4, 3}, + }}, + {"foo[0]", []token{ + token{tUnquotedIdentifier, "foo", 0, 3}, + token{tLbracket, "[", 3, 1}, + token{tNumber, "0", 4, 1}, + token{tRbracket, "]", 5, 1}, + }}, + {"foo[?a 0 { + output += fmt.Sprintf("%schildren: {\n", strings.Repeat(" ", nextIndent)) + childIndent := nextIndent + 2 + for _, elem := range node.children { + output += elem.PrettyPrint(childIndent) + } + } + output += fmt.Sprintf("%s}\n", spaces) + return output +} + +var bindingPowers = map[tokType]int{ + tEOF: 0, + tUnquotedIdentifier: 0, + tQuotedIdentifier: 0, + tRbracket: 0, + tRparen: 0, + tComma: 0, + tRbrace: 0, + tNumber: 0, + tCurrent: 0, + tExpref: 0, + tColon: 0, + tPipe: 1, + tOr: 2, + tAnd: 3, + tEQ: 5, + tLT: 5, + tLTE: 5, + tGT: 5, + tGTE: 5, + tNE: 5, + tFlatten: 9, + tStar: 20, + tFilter: 21, + tDot: 40, + tNot: 45, + tLbrace: 50, + tLbracket: 55, + tLparen: 60, +} + +// Parser holds state about the current expression being parsed. +type Parser struct { + expression string + tokens []token + index int +} + +// NewParser creates a new JMESPath parser. +func NewParser() *Parser { + p := Parser{} + return &p +} + +// Parse will compile a JMESPath expression. +func (p *Parser) Parse(expression string) (ASTNode, error) { + lexer := NewLexer() + p.expression = expression + p.index = 0 + tokens, err := lexer.tokenize(expression) + if err != nil { + return ASTNode{}, err + } + p.tokens = tokens + parsed, err := p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + if p.current() != tEOF { + return ASTNode{}, p.syntaxError(fmt.Sprintf( + "Unexpected token at the end of the expresssion: %s", p.current())) + } + return parsed, nil +} + +func (p *Parser) parseExpression(bindingPower int) (ASTNode, error) { + var err error + leftToken := p.lookaheadToken(0) + p.advance() + leftNode, err := p.nud(leftToken) + if err != nil { + return ASTNode{}, err + } + currentToken := p.current() + for bindingPower < bindingPowers[currentToken] { + p.advance() + leftNode, err = p.led(currentToken, leftNode) + if err != nil { + return ASTNode{}, err + } + currentToken = p.current() + } + return leftNode, nil +} + +func (p *Parser) parseIndexExpression() (ASTNode, error) { + if p.lookahead(0) == tColon || p.lookahead(1) == tColon { + return p.parseSliceExpression() + } + indexStr := p.lookaheadToken(0).value + parsedInt, err := strconv.Atoi(indexStr) + if err != nil { + return ASTNode{}, err + } + indexNode := ASTNode{nodeType: ASTIndex, value: parsedInt} + p.advance() + if err := p.match(tRbracket); err != nil { + return ASTNode{}, err + } + return indexNode, nil +} + +func (p *Parser) parseSliceExpression() (ASTNode, error) { + parts := []*int{nil, nil, nil} + index := 0 + current := p.current() + for current != tRbracket && index < 3 { + if current == tColon { + index++ + p.advance() + } else if current == tNumber { + parsedInt, err := strconv.Atoi(p.lookaheadToken(0).value) + if err != nil { + return ASTNode{}, err + } + parts[index] = &parsedInt + p.advance() + } else { + return ASTNode{}, p.syntaxError( + "Expected tColon or tNumber" + ", received: " + p.current().String()) + } + current = p.current() + } + if err := p.match(tRbracket); err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTSlice, + value: parts, + }, nil +} + +func (p *Parser) match(tokenType tokType) error { + if p.current() == tokenType { + p.advance() + return nil + } + return p.syntaxError("Expected " + tokenType.String() + ", received: " + p.current().String()) +} + +func (p *Parser) led(tokenType tokType, node ASTNode) (ASTNode, error) { + switch tokenType { + case tDot: + if p.current() != tStar { + right, err := p.parseDotRHS(bindingPowers[tDot]) + return ASTNode{ + nodeType: ASTSubexpression, + children: []ASTNode{node, right}, + }, err + } + p.advance() + right, err := p.parseProjectionRHS(bindingPowers[tDot]) + return ASTNode{ + nodeType: ASTValueProjection, + children: []ASTNode{node, right}, + }, err + case tPipe: + right, err := p.parseExpression(bindingPowers[tPipe]) + return ASTNode{nodeType: ASTPipe, children: []ASTNode{node, right}}, err + case tOr: + right, err := p.parseExpression(bindingPowers[tOr]) + return ASTNode{nodeType: ASTOrExpression, children: []ASTNode{node, right}}, err + case tAnd: + right, err := p.parseExpression(bindingPowers[tAnd]) + return ASTNode{nodeType: ASTAndExpression, children: []ASTNode{node, right}}, err + case tLparen: + name := node.value + var args []ASTNode + for p.current() != tRparen { + expression, err := p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + if p.current() == tComma { + if err := p.match(tComma); err != nil { + return ASTNode{}, err + } + } + args = append(args, expression) + } + if err := p.match(tRparen); err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTFunctionExpression, + value: name, + children: args, + }, nil + case tFilter: + return p.parseFilter(node) + case tFlatten: + left := ASTNode{nodeType: ASTFlatten, children: []ASTNode{node}} + right, err := p.parseProjectionRHS(bindingPowers[tFlatten]) + return ASTNode{ + nodeType: ASTProjection, + children: []ASTNode{left, right}, + }, err + case tEQ, tNE, tGT, tGTE, tLT, tLTE: + right, err := p.parseExpression(bindingPowers[tokenType]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTComparator, + value: tokenType, + children: []ASTNode{node, right}, + }, nil + case tLbracket: + tokenType := p.current() + var right ASTNode + var err error + if tokenType == tNumber || tokenType == tColon { + right, err = p.parseIndexExpression() + if err != nil { + return ASTNode{}, err + } + return p.projectIfSlice(node, right) + } + // Otherwise this is a projection. + if err := p.match(tStar); err != nil { + return ASTNode{}, err + } + if err := p.match(tRbracket); err != nil { + return ASTNode{}, err + } + right, err = p.parseProjectionRHS(bindingPowers[tStar]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTProjection, + children: []ASTNode{node, right}, + }, nil + } + return ASTNode{}, p.syntaxError("Unexpected token: " + tokenType.String()) +} + +func (p *Parser) nud(token token) (ASTNode, error) { + switch token.tokenType { + case tJSONLiteral: + var parsed interface{} + err := json.Unmarshal([]byte(token.value), &parsed) + if err != nil { + return ASTNode{}, err + } + return ASTNode{nodeType: ASTLiteral, value: parsed}, nil + case tStringLiteral: + return ASTNode{nodeType: ASTLiteral, value: token.value}, nil + case tUnquotedIdentifier: + return ASTNode{ + nodeType: ASTField, + value: token.value, + }, nil + case tQuotedIdentifier: + node := ASTNode{nodeType: ASTField, value: token.value} + if p.current() == tLparen { + return ASTNode{}, p.syntaxErrorToken("Can't have quoted identifier as function name.", token) + } + return node, nil + case tStar: + left := ASTNode{nodeType: ASTIdentity} + var right ASTNode + var err error + if p.current() == tRbracket { + right = ASTNode{nodeType: ASTIdentity} + } else { + right, err = p.parseProjectionRHS(bindingPowers[tStar]) + } + return ASTNode{nodeType: ASTValueProjection, children: []ASTNode{left, right}}, err + case tFilter: + return p.parseFilter(ASTNode{nodeType: ASTIdentity}) + case tLbrace: + return p.parseMultiSelectHash() + case tFlatten: + left := ASTNode{ + nodeType: ASTFlatten, + children: []ASTNode{ASTNode{nodeType: ASTIdentity}}, + } + right, err := p.parseProjectionRHS(bindingPowers[tFlatten]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{nodeType: ASTProjection, children: []ASTNode{left, right}}, nil + case tLbracket: + tokenType := p.current() + //var right ASTNode + if tokenType == tNumber || tokenType == tColon { + right, err := p.parseIndexExpression() + if err != nil { + return ASTNode{}, nil + } + return p.projectIfSlice(ASTNode{nodeType: ASTIdentity}, right) + } else if tokenType == tStar && p.lookahead(1) == tRbracket { + p.advance() + p.advance() + right, err := p.parseProjectionRHS(bindingPowers[tStar]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTProjection, + children: []ASTNode{ASTNode{nodeType: ASTIdentity}, right}, + }, nil + } else { + return p.parseMultiSelectList() + } + case tCurrent: + return ASTNode{nodeType: ASTCurrentNode}, nil + case tExpref: + expression, err := p.parseExpression(bindingPowers[tExpref]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{nodeType: ASTExpRef, children: []ASTNode{expression}}, nil + case tNot: + expression, err := p.parseExpression(bindingPowers[tNot]) + if err != nil { + return ASTNode{}, err + } + return ASTNode{nodeType: ASTNotExpression, children: []ASTNode{expression}}, nil + case tLparen: + expression, err := p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + if err := p.match(tRparen); err != nil { + return ASTNode{}, err + } + return expression, nil + case tEOF: + return ASTNode{}, p.syntaxErrorToken("Incomplete expression", token) + } + + return ASTNode{}, p.syntaxErrorToken("Invalid token: "+token.tokenType.String(), token) +} + +func (p *Parser) parseMultiSelectList() (ASTNode, error) { + var expressions []ASTNode + for { + expression, err := p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + expressions = append(expressions, expression) + if p.current() == tRbracket { + break + } + err = p.match(tComma) + if err != nil { + return ASTNode{}, err + } + } + err := p.match(tRbracket) + if err != nil { + return ASTNode{}, err + } + return ASTNode{ + nodeType: ASTMultiSelectList, + children: expressions, + }, nil +} + +func (p *Parser) parseMultiSelectHash() (ASTNode, error) { + var children []ASTNode + for { + keyToken := p.lookaheadToken(0) + if err := p.match(tUnquotedIdentifier); err != nil { + if err := p.match(tQuotedIdentifier); err != nil { + return ASTNode{}, p.syntaxError("Expected tQuotedIdentifier or tUnquotedIdentifier") + } + } + keyName := keyToken.value + err := p.match(tColon) + if err != nil { + return ASTNode{}, err + } + value, err := p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + node := ASTNode{ + nodeType: ASTKeyValPair, + value: keyName, + children: []ASTNode{value}, + } + children = append(children, node) + if p.current() == tComma { + err := p.match(tComma) + if err != nil { + return ASTNode{}, nil + } + } else if p.current() == tRbrace { + err := p.match(tRbrace) + if err != nil { + return ASTNode{}, nil + } + break + } + } + return ASTNode{ + nodeType: ASTMultiSelectHash, + children: children, + }, nil +} + +func (p *Parser) projectIfSlice(left ASTNode, right ASTNode) (ASTNode, error) { + indexExpr := ASTNode{ + nodeType: ASTIndexExpression, + children: []ASTNode{left, right}, + } + if right.nodeType == ASTSlice { + right, err := p.parseProjectionRHS(bindingPowers[tStar]) + return ASTNode{ + nodeType: ASTProjection, + children: []ASTNode{indexExpr, right}, + }, err + } + return indexExpr, nil +} +func (p *Parser) parseFilter(node ASTNode) (ASTNode, error) { + var right, condition ASTNode + var err error + condition, err = p.parseExpression(0) + if err != nil { + return ASTNode{}, err + } + if err := p.match(tRbracket); err != nil { + return ASTNode{}, err + } + if p.current() == tFlatten { + right = ASTNode{nodeType: ASTIdentity} + } else { + right, err = p.parseProjectionRHS(bindingPowers[tFilter]) + if err != nil { + return ASTNode{}, err + } + } + + return ASTNode{ + nodeType: ASTFilterProjection, + children: []ASTNode{node, right, condition}, + }, nil +} + +func (p *Parser) parseDotRHS(bindingPower int) (ASTNode, error) { + lookahead := p.current() + if tokensOneOf([]tokType{tQuotedIdentifier, tUnquotedIdentifier, tStar}, lookahead) { + return p.parseExpression(bindingPower) + } else if lookahead == tLbracket { + if err := p.match(tLbracket); err != nil { + return ASTNode{}, err + } + return p.parseMultiSelectList() + } else if lookahead == tLbrace { + if err := p.match(tLbrace); err != nil { + return ASTNode{}, err + } + return p.parseMultiSelectHash() + } + return ASTNode{}, p.syntaxError("Expected identifier, lbracket, or lbrace") +} + +func (p *Parser) parseProjectionRHS(bindingPower int) (ASTNode, error) { + current := p.current() + if bindingPowers[current] < 10 { + return ASTNode{nodeType: ASTIdentity}, nil + } else if current == tLbracket { + return p.parseExpression(bindingPower) + } else if current == tFilter { + return p.parseExpression(bindingPower) + } else if current == tDot { + err := p.match(tDot) + if err != nil { + return ASTNode{}, err + } + return p.parseDotRHS(bindingPower) + } else { + return ASTNode{}, p.syntaxError("Error") + } +} + +func (p *Parser) lookahead(number int) tokType { + return p.lookaheadToken(number).tokenType +} + +func (p *Parser) current() tokType { + return p.lookahead(0) +} + +func (p *Parser) lookaheadToken(number int) token { + return p.tokens[p.index+number] +} + +func (p *Parser) advance() { + p.index++ +} + +func tokensOneOf(elements []tokType, token tokType) bool { + for _, elem := range elements { + if elem == token { + return true + } + } + return false +} + +func (p *Parser) syntaxError(msg string) SyntaxError { + return SyntaxError{ + msg: msg, + Expression: p.expression, + Offset: p.lookaheadToken(0).position, + } +} + +// Create a SyntaxError based on the provided token. +// This differs from syntaxError() which creates a SyntaxError +// based on the current lookahead token. +func (p *Parser) syntaxErrorToken(msg string, t token) SyntaxError { + return SyntaxError{ + msg: msg, + Expression: p.expression, + Offset: t.position, + } +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go new file mode 100644 index 00000000000..997a0f4d7c1 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/parser_test.go @@ -0,0 +1,136 @@ +package jmespath + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +var parsingErrorTests = []struct { + expression string + msg string +}{ + {"foo.", "Incopmlete expression"}, + {"[foo", "Incopmlete expression"}, + {"]", "Invalid"}, + {")", "Invalid"}, + {"}", "Invalid"}, + {"foo..bar", "Invalid"}, + {`foo."bar`, "Forwards lexer errors"}, + {`{foo: bar`, "Incomplete expression"}, + {`{foo bar}`, "Invalid"}, + {`[foo bar]`, "Invalid"}, + {`foo@`, "Invalid"}, + {`&&&&&&&&&&&&t(`, "Invalid"}, + {`[*][`, "Invalid"}, +} + +func TestParsingErrors(t *testing.T) { + assert := assert.New(t) + parser := NewParser() + for _, tt := range parsingErrorTests { + _, err := parser.Parse(tt.expression) + assert.NotNil(err, fmt.Sprintf("Expected parsing error: %s, for expression: %s", tt.msg, tt.expression)) + } +} + +var prettyPrinted = `ASTProjection { + children: { + ASTField { + value: "foo" + } + ASTSubexpression { + children: { + ASTSubexpression { + children: { + ASTField { + value: "bar" + } + ASTField { + value: "baz" + } + } + ASTField { + value: "qux" + } + } +} +` + +var prettyPrintedCompNode = `ASTFilterProjection { + children: { + ASTField { + value: "a" + } + ASTIdentity { + } + ASTComparator { + value: tLTE + children: { + ASTField { + value: "b" + } + ASTField { + value: "c" + } + } +} +` + +func TestPrettyPrintedAST(t *testing.T) { + assert := assert.New(t) + parser := NewParser() + parsed, _ := parser.Parse("foo[*].bar.baz.qux") + assert.Equal(parsed.PrettyPrint(0), prettyPrinted) +} + +func TestPrettyPrintedCompNode(t *testing.T) { + assert := assert.New(t) + parser := NewParser() + parsed, _ := parser.Parse("a[?b<=c]") + assert.Equal(parsed.PrettyPrint(0), prettyPrintedCompNode) +} + +func BenchmarkParseIdentifier(b *testing.B) { + runParseBenchmark(b, exprIdentifier) +} + +func BenchmarkParseSubexpression(b *testing.B) { + runParseBenchmark(b, exprSubexpr) +} + +func BenchmarkParseDeeplyNested50(b *testing.B) { + runParseBenchmark(b, deeplyNested50) +} + +func BenchmarkParseDeepNested50Pipe(b *testing.B) { + runParseBenchmark(b, deeplyNested50Pipe) +} + +func BenchmarkParseDeepNested50Index(b *testing.B) { + runParseBenchmark(b, deeplyNested50Index) +} + +func BenchmarkParseQuotedIdentifier(b *testing.B) { + runParseBenchmark(b, exprQuotedIdentifier) +} + +func BenchmarkParseQuotedIdentifierEscapes(b *testing.B) { + runParseBenchmark(b, quotedIdentifierEscapes) +} + +func BenchmarkParseRawStringLiteral(b *testing.B) { + runParseBenchmark(b, rawStringLiteral) +} + +func BenchmarkParseDeepProjection104(b *testing.B) { + runParseBenchmark(b, deepProjection104) +} + +func runParseBenchmark(b *testing.B, expression string) { + parser := NewParser() + for i := 0; i < b.N; i++ { + parser.Parse(expression) + } +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go new file mode 100644 index 00000000000..dae79cbdf33 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/toktype_string.go @@ -0,0 +1,16 @@ +// generated by stringer -type=tokType; DO NOT EDIT + +package jmespath + +import "fmt" + +const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" + +var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} + +func (i tokType) String() string { + if i < 0 || i >= tokType(len(_tokType_index)-1) { + return fmt.Sprintf("tokType(%d)", i) + } + return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go new file mode 100644 index 00000000000..ddc1b7d7d46 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util.go @@ -0,0 +1,185 @@ +package jmespath + +import ( + "errors" + "reflect" +) + +// IsFalse determines if an object is false based on the JMESPath spec. +// JMESPath defines false values to be any of: +// - An empty string array, or hash. +// - The boolean value false. +// - nil +func isFalse(value interface{}) bool { + switch v := value.(type) { + case bool: + return !v + case []interface{}: + return len(v) == 0 + case map[string]interface{}: + return len(v) == 0 + case string: + return len(v) == 0 + case nil: + return true + } + // Try the reflection cases before returning false. + rv := reflect.ValueOf(value) + switch rv.Kind() { + case reflect.Struct: + // A struct type will never be false, even if + // all of its values are the zero type. + return false + case reflect.Slice, reflect.Map: + return rv.Len() == 0 + case reflect.Ptr: + if rv.IsNil() { + return true + } + // If it's a pointer type, we'll try to deref the pointer + // and evaluate the pointer value for isFalse. + element := rv.Elem() + return isFalse(element.Interface()) + } + return false +} + +// ObjsEqual is a generic object equality check. +// It will take two arbitrary objects and recursively determine +// if they are equal. +func objsEqual(left interface{}, right interface{}) bool { + return reflect.DeepEqual(left, right) +} + +// SliceParam refers to a single part of a slice. +// A slice consists of a start, a stop, and a step, similar to +// python slices. +type sliceParam struct { + N int + Specified bool +} + +// Slice supports [start:stop:step] style slicing that's supported in JMESPath. +func slice(slice []interface{}, parts []sliceParam) ([]interface{}, error) { + computed, err := computeSliceParams(len(slice), parts) + if err != nil { + return nil, err + } + start, stop, step := computed[0], computed[1], computed[2] + result := []interface{}{} + if step > 0 { + for i := start; i < stop; i += step { + result = append(result, slice[i]) + } + } else { + for i := start; i > stop; i += step { + result = append(result, slice[i]) + } + } + return result, nil +} + +func computeSliceParams(length int, parts []sliceParam) ([]int, error) { + var start, stop, step int + if !parts[2].Specified { + step = 1 + } else if parts[2].N == 0 { + return nil, errors.New("Invalid slice, step cannot be 0") + } else { + step = parts[2].N + } + var stepValueNegative bool + if step < 0 { + stepValueNegative = true + } else { + stepValueNegative = false + } + + if !parts[0].Specified { + if stepValueNegative { + start = length - 1 + } else { + start = 0 + } + } else { + start = capSlice(length, parts[0].N, step) + } + + if !parts[1].Specified { + if stepValueNegative { + stop = -1 + } else { + stop = length + } + } else { + stop = capSlice(length, parts[1].N, step) + } + return []int{start, stop, step}, nil +} + +func capSlice(length int, actual int, step int) int { + if actual < 0 { + actual += length + if actual < 0 { + if step < 0 { + actual = -1 + } else { + actual = 0 + } + } + } else if actual >= length { + if step < 0 { + actual = length - 1 + } else { + actual = length + } + } + return actual +} + +// ToArrayNum converts an empty interface type to a slice of float64. +// If any element in the array cannot be converted, then nil is returned +// along with a second value of false. +func toArrayNum(data interface{}) ([]float64, bool) { + // Is there a better way to do this with reflect? + if d, ok := data.([]interface{}); ok { + result := make([]float64, len(d)) + for i, el := range d { + item, ok := el.(float64) + if !ok { + return nil, false + } + result[i] = item + } + return result, true + } + return nil, false +} + +// ToArrayStr converts an empty interface type to a slice of strings. +// If any element in the array cannot be converted, then nil is returned +// along with a second value of false. If the input data could be entirely +// converted, then the converted data, along with a second value of true, +// will be returned. +func toArrayStr(data interface{}) ([]string, bool) { + // Is there a better way to do this with reflect? + if d, ok := data.([]interface{}); ok { + result := make([]string, len(d)) + for i, el := range d { + item, ok := el.(string) + if !ok { + return nil, false + } + result[i] = item + } + return result, true + } + return nil, false +} + +func isSliceType(v interface{}) bool { + if v == nil { + return false + } + return reflect.TypeOf(v).Kind() == reflect.Slice +} diff --git a/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go new file mode 100644 index 00000000000..1e2cd935206 --- /dev/null +++ b/Godeps/_workspace/src/github.com/jmespath/go-jmespath/util_test.go @@ -0,0 +1,73 @@ +package jmespath + +import ( + "github.com/stretchr/testify/assert" + "testing" +) + +func TestSlicePositiveStep(t *testing.T) { + assert := assert.New(t) + input := make([]interface{}, 5) + input[0] = 0 + input[1] = 1 + input[2] = 2 + input[3] = 3 + input[4] = 4 + result, err := slice(input, []sliceParam{sliceParam{0, true}, sliceParam{3, true}, sliceParam{1, true}}) + assert.Nil(err) + assert.Equal(input[:3], result) +} + +func TestIsFalseJSONTypes(t *testing.T) { + assert := assert.New(t) + assert.True(isFalse(false)) + assert.True(isFalse("")) + var empty []interface{} + assert.True(isFalse(empty)) + m := make(map[string]interface{}) + assert.True(isFalse(m)) + assert.True(isFalse(nil)) + +} + +func TestIsFalseWithUserDefinedStructs(t *testing.T) { + assert := assert.New(t) + type nilStructType struct { + SliceOfPointers []*string + } + nilStruct := nilStructType{SliceOfPointers: nil} + assert.True(isFalse(nilStruct.SliceOfPointers)) + + // A user defined struct will never be false though, + // even if it's fields are the zero type. + assert.False(isFalse(nilStruct)) +} + +func TestIsFalseWithNilInterface(t *testing.T) { + assert := assert.New(t) + var a *int = nil + var nilInterface interface{} + nilInterface = a + assert.True(isFalse(nilInterface)) +} + +func TestIsFalseWithMapOfUserStructs(t *testing.T) { + assert := assert.New(t) + type foo struct { + Bar string + Baz string + } + m := make(map[int]foo) + assert.True(isFalse(m)) +} + +func TestObjsEqual(t *testing.T) { + assert := assert.New(t) + assert.True(objsEqual("foo", "foo")) + assert.True(objsEqual(20, 20)) + assert.True(objsEqual([]int{1, 2, 3}, []int{1, 2, 3})) + assert.True(objsEqual(nil, nil)) + assert.True(!objsEqual(nil, "foo")) + assert.True(objsEqual([]int{}, []int{})) + assert.True(!objsEqual([]int{}, nil)) +} diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE b/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE deleted file mode 100644 index 968b45384d0..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2013 Vaughan Newton - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md b/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md deleted file mode 100644 index d5cd4e74b00..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/README.md +++ /dev/null @@ -1,70 +0,0 @@ -go-ini -====== - -INI parsing library for Go (golang). - -View the API documentation [here](http://godoc.org/github.com/vaughan0/go-ini). - -Usage ------ - -Parse an INI file: - -```go -import "github.com/vaughan0/go-ini" - -file, err := ini.LoadFile("myfile.ini") -``` - -Get data from the parsed file: - -```go -name, ok := file.Get("person", "name") -if !ok { - panic("'name' variable missing from 'person' section") -} -``` - -Iterate through values in a section: - -```go -for key, value := range file["mysection"] { - fmt.Printf("%s => %s\n", key, value) -} -``` - -Iterate through sections in a file: - -```go -for name, section := range file { - fmt.Printf("Section name: %s\n", name) -} -``` - -File Format ------------ - -INI files are parsed by go-ini line-by-line. Each line may be one of the following: - - * A section definition: [section-name] - * A property: key = value - * A comment: #blahblah _or_ ;blahblah - * Blank. The line will be ignored. - -Properties defined before any section headers are placed in the default section, which has -the empty string as it's key. - -Example: - -```ini -# I am a comment -; So am I! - -[apples] -colour = red or green -shape = applish - -[oranges] -shape = square -colour = blue -``` diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go deleted file mode 100644 index 81aeb32f8b2..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini.go +++ /dev/null @@ -1,123 +0,0 @@ -// Package ini provides functions for parsing INI configuration files. -package ini - -import ( - "bufio" - "fmt" - "io" - "os" - "regexp" - "strings" -) - -var ( - sectionRegex = regexp.MustCompile(`^\[(.*)\]$`) - assignRegex = regexp.MustCompile(`^([^=]+)=(.*)$`) -) - -// ErrSyntax is returned when there is a syntax error in an INI file. -type ErrSyntax struct { - Line int - Source string // The contents of the erroneous line, without leading or trailing whitespace -} - -func (e ErrSyntax) Error() string { - return fmt.Sprintf("invalid INI syntax on line %d: %s", e.Line, e.Source) -} - -// A File represents a parsed INI file. -type File map[string]Section - -// A Section represents a single section of an INI file. -type Section map[string]string - -// Returns a named Section. A Section will be created if one does not already exist for the given name. -func (f File) Section(name string) Section { - section := f[name] - if section == nil { - section = make(Section) - f[name] = section - } - return section -} - -// Looks up a value for a key in a section and returns that value, along with a boolean result similar to a map lookup. -func (f File) Get(section, key string) (value string, ok bool) { - if s := f[section]; s != nil { - value, ok = s[key] - } - return -} - -// Loads INI data from a reader and stores the data in the File. -func (f File) Load(in io.Reader) (err error) { - bufin, ok := in.(*bufio.Reader) - if !ok { - bufin = bufio.NewReader(in) - } - return parseFile(bufin, f) -} - -// Loads INI data from a named file and stores the data in the File. -func (f File) LoadFile(file string) (err error) { - in, err := os.Open(file) - if err != nil { - return - } - defer in.Close() - return f.Load(in) -} - -func parseFile(in *bufio.Reader, file File) (err error) { - section := "" - lineNum := 0 - for done := false; !done; { - var line string - if line, err = in.ReadString('\n'); err != nil { - if err == io.EOF { - done = true - } else { - return - } - } - lineNum++ - line = strings.TrimSpace(line) - if len(line) == 0 { - // Skip blank lines - continue - } - if line[0] == ';' || line[0] == '#' { - // Skip comments - continue - } - - if groups := assignRegex.FindStringSubmatch(line); groups != nil { - key, val := groups[1], groups[2] - key, val = strings.TrimSpace(key), strings.TrimSpace(val) - file.Section(section)[key] = val - } else if groups := sectionRegex.FindStringSubmatch(line); groups != nil { - name := strings.TrimSpace(groups[1]) - section = name - // Create the section if it does not exist - file.Section(section) - } else { - return ErrSyntax{lineNum, line} - } - - } - return nil -} - -// Loads and returns a File from a reader. -func Load(in io.Reader) (File, error) { - file := make(File) - err := file.Load(in) - return file, err -} - -// Loads and returns an INI File from a file on disk. -func LoadFile(filename string) (File, error) { - file := make(File) - err := file.LoadFile(filename) - return file, err -} diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go deleted file mode 100644 index 38a6f0004cf..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_linux_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package ini - -import ( - "reflect" - "syscall" - "testing" -) - -func TestLoadFile(t *testing.T) { - originalOpenFiles := numFilesOpen(t) - - file, err := LoadFile("test.ini") - if err != nil { - t.Fatal(err) - } - - if originalOpenFiles != numFilesOpen(t) { - t.Error("test.ini not closed") - } - - if !reflect.DeepEqual(file, File{"default": {"stuff": "things"}}) { - t.Error("file not read correctly") - } -} - -func numFilesOpen(t *testing.T) (num uint64) { - var rlimit syscall.Rlimit - err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rlimit) - if err != nil { - t.Fatal(err) - } - maxFds := int(rlimit.Cur) - - var stat syscall.Stat_t - for i := 0; i < maxFds; i++ { - if syscall.Fstat(i, &stat) == nil { - num++ - } else { - return - } - } - return -} diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go b/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go deleted file mode 100644 index 06a4d05eaf0..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/ini_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package ini - -import ( - "reflect" - "strings" - "testing" -) - -func TestLoad(t *testing.T) { - src := ` - # Comments are ignored - - herp = derp - - [foo] - hello=world - whitespace should = not matter - ; sneaky semicolon-style comment - multiple = equals = signs - - [bar] - this = that` - - file, err := Load(strings.NewReader(src)) - if err != nil { - t.Fatal(err) - } - check := func(section, key, expect string) { - if value, _ := file.Get(section, key); value != expect { - t.Errorf("Get(%q, %q): expected %q, got %q", section, key, expect, value) - } - } - - check("", "herp", "derp") - check("foo", "hello", "world") - check("foo", "whitespace should", "not matter") - check("foo", "multiple", "equals = signs") - check("bar", "this", "that") -} - -func TestSyntaxError(t *testing.T) { - src := ` - # Line 2 - [foo] - bar = baz - # Here's an error on line 6: - wut? - herp = derp` - _, err := Load(strings.NewReader(src)) - t.Logf("%T: %v", err, err) - if err == nil { - t.Fatal("expected an error, got nil") - } - syntaxErr, ok := err.(ErrSyntax) - if !ok { - t.Fatal("expected an error of type ErrSyntax") - } - if syntaxErr.Line != 6 { - t.Fatal("incorrect line number") - } - if syntaxErr.Source != "wut?" { - t.Fatal("incorrect source") - } -} - -func TestDefinedSectionBehaviour(t *testing.T) { - check := func(src string, expect File) { - file, err := Load(strings.NewReader(src)) - if err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(file, expect) { - t.Errorf("expected %v, got %v", expect, file) - } - } - // No sections for an empty file - check("", File{}) - // Default section only if there are actually values for it - check("foo=bar", File{"": {"foo": "bar"}}) - // User-defined sections should always be present, even if empty - check("[a]\n[b]\nfoo=bar", File{ - "a": {}, - "b": {"foo": "bar"}, - }) - check("foo=bar\n[a]\nthis=that", File{ - "": {"foo": "bar"}, - "a": {"this": "that"}, - }) -} diff --git a/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini b/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini deleted file mode 100644 index d13c999e254..00000000000 --- a/Godeps/_workspace/src/github.com/vaughan0/go-ini/test.ini +++ /dev/null @@ -1,2 +0,0 @@ -[default] -stuff = things diff --git a/README.md b/README.md index a346acaaa8a..99854966938 100644 --- a/README.md +++ b/README.md @@ -6,16 +6,14 @@ [Email](mailto:contact@grafana.org) Grafana is an open source, feature rich metrics dashboard and graph editor for -Graphite, InfluxDB & OpenTSDB. +Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB. ![](http://grafana.org/assets/img/start_page_bg.png) -## Grafana 2.0 -The develop branch has now been merged with master. For 1.9 users this is a big change as Grafana is no longer -a standalone frontend only web application. Grafana 2.0 comes with a backend. -- [Install instructions](http://docs.grafana.org/v2.0/installation/) -- [Migrating from 1.x to 2.x](http://docs.grafana.org/v2.0/installation/migrating_to2/) -- [What's New in Grafana 2.0](http://docs.grafana.org/v2.0/guides/whats-new-in-v2/) +- [Install instructions](http://docs.grafana.org/installation/) +- [What's New in Grafana 2.0](http://docs.grafana.org/guides/whats-new-in-v2/) +- [What's New in Grafana 2.1](http://docs.grafana.org/guides/whats-new-in-v2-1/) +- [What's New in Grafana 2.5](http://docs.grafana.org/guides/whats-new-in-v2-5/) ## Features ### Graphite Target Editor @@ -30,7 +28,7 @@ a standalone frontend only web application. Grafana 2.0 comes with a backend. - Click and drag to zoom - Multiple Y-axis, logarithmic scales - Bars, Lines, Points -- Smart Y-axis formating +- Smart Y-axis formatting - Series toggles & color selector - Legend values, and formatting options - Grid thresholds, axis labels @@ -47,6 +45,9 @@ a standalone frontend only web application. Grafana 2.0 comes with a backend. - [Time range controls](http://docs.grafana.org/reference/timerange/) - [Share snapshots publicly](http://docs.grafana.org/v2.0/reference/sharing/) +### Elasticsearch +- Feature rich query editor UI + ### InfluxDB - Use InfluxDB as a metric data source, annotation source - Query editor with series and column typeahead, easy group by and function selection @@ -74,7 +75,7 @@ the latest master builds [here](http://grafana.org/download/builds) ### Dependencies -- Go 1.4 +- Go 1.5 - NodeJS ### Get Code @@ -84,11 +85,12 @@ go get github.com/grafana/grafana ``` ### Building the backend +Replace X.Y.Z by actual version number. ``` cd $GOPATH/src/github.com/grafana/grafana go run build.go setup (only needed once to install godep) godep restore (will pull down all golang lib dependencies in your current GOPATH) -go build . +godep go run build.go build ``` ### Building frontend assets @@ -111,7 +113,7 @@ bra run ### Running ``` -./grafana +./bin/grafana-server ``` Open grafana in your browser (default http://localhost:3000) and login with admin user (default user/pass = admin/admin). @@ -127,13 +129,14 @@ You only need to add the options you want to override. Config files are applied ## Create a pull request Before or after you create a pull request, sign the [contributor license agreement](http://grafana.org/docs/contributing/cla.html). + ## Contribute If you have any idea for an improvement or found a bug do not hesitate to open an issue. And if you have time clone this repo and submit a pull request and help me make Grafana the kickass metrics & devops dashboard we all dream about! Before creating a pull request be sure that "grunt test" runs without any style or unit test errors, also -please [sign the CLA](http://grafana.org/docs/contributing/cla.html) +please [sign the CLA](http://docs.grafana.org/project/cla/) ## License diff --git a/build.go b/build.go index ca6f52ecd89..4a345c5fc73 100644 --- a/build.go +++ b/build.go @@ -89,8 +89,13 @@ func main() { } func makeLatestDistCopies() { + rpmIteration := "-1" + if linuxPackageIteration != "" { + rpmIteration = "-" + linuxPackageIteration + } + runError("cp", "dist/grafana_"+version+"_amd64.deb", "dist/grafana_latest_amd64.deb") - runError("cp", "dist/grafana-"+strings.Replace(version, "-", "_", 5)+"-1.x86_64.rpm", "dist/grafana-latest-1.x86_64.rpm") + runError("cp", "dist/grafana-"+linuxPackageVersion+rpmIteration+".x86_64.rpm", "dist/grafana-latest-1.x86_64.rpm") runError("cp", "dist/grafana-"+version+".linux-x64.tar.gz", "dist/grafana-latest.linux-x64.tar.gz") } @@ -323,9 +328,9 @@ func build(pkg string, tags []string) { func ldflags() string { var b bytes.Buffer b.WriteString("-w") - b.WriteString(fmt.Sprintf(" -X main.version '%s'", version)) - b.WriteString(fmt.Sprintf(" -X main.commit '%s'", getGitSha())) - b.WriteString(fmt.Sprintf(" -X main.buildstamp %d", buildStamp())) + b.WriteString(fmt.Sprintf(" -X main.version=%s", version)) + b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha())) + b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp())) return b.String() } diff --git a/conf/defaults.ini b/conf/defaults.ini index 69d045dc4ae..8b2b34f3fbc 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -225,7 +225,7 @@ level = Info [log.console] level = # Set formatting to "false" to disable color formatting of console logs -formatting = true +formatting = false # For "file" mode only [log.file] diff --git a/conf/ldap.toml b/conf/ldap.toml index 9455c8df3a1..aa8a9679d68 100644 --- a/conf/ldap.toml +++ b/conf/ldap.toml @@ -2,7 +2,7 @@ verbose_logging = false [[servers]] -# Ldap server host +# Ldap server host (specify multiple hosts space separated) host = "127.0.0.1" # Default port is 389 or 636 if use_ssl = true port = 389 @@ -10,17 +10,29 @@ port = 389 use_ssl = false # set to true if you want to skip ssl cert validation ssl_skip_verify = false +# set to the path to your root CA certificate or leave unset to use system defaults +# root_ca_cert = /path/to/certificate.crt # Search user bind dn bind_dn = "cn=admin,dc=grafana,dc=org" # Search user bind password bind_password = 'grafana' -# Search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" +# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" search_filter = "(cn=%s)" + # An array of base dns to search through search_base_dns = ["dc=grafana,dc=org"] +# In POSIX LDAP schemas, without memberOf attribute a secondary query must be made for groups. +# This is done by enabling group_search_filter below. You must also set member_of= "cn" +# in [servers.attributes] below. + +## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available) +# group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" +## An array of the base DNs to search through for groups. Typically uses ou=groups +# group_search_base_dns = ["ou=groups,dc=grafana,dc=org"] + # Specify names of the ldap attributes your ldap uses [servers.attributes] name = "givenName" diff --git a/docker/blocks/prometheus/prometheus.yml b/docker/blocks/prometheus/prometheus.yml index 1d524b1b320..b0fc2a919cd 100644 --- a/docker/blocks/prometheus/prometheus.yml +++ b/docker/blocks/prometheus/prometheus.yml @@ -4,10 +4,6 @@ global: evaluation_interval: 10s # By default, scrape targets every 15 seconds. # scrape_timeout is set to the global default (10s). - # Attach these extra labels to all timeseries collected by this Prometheus instance. - labels: - monitor: 'codelab-monitor' - # Load and evaluate rules in this file every 'evaluation_interval' seconds. rule_files: # - "first.rules" diff --git a/docker/production/README.md b/docker/production/README.md index f6da10e62f6..9b0e23baf75 100644 --- a/docker/production/README.md +++ b/docker/production/README.md @@ -2,7 +2,7 @@ # Grafana docker image This container currently only contains the in development alpha of Grafana 2.0 (ie non production use). The -`#develop` tag is constantly updated as we make progress torwards a beta release. +`#develop` tag is constantly updated as we make progress towards a beta release. ## Running your Grafana image @@ -17,7 +17,7 @@ Try it out, default admin user is admin/admin. ## Configuring your Grafana container -All options defined in conf/grafana.ini can be overriden using environment variables, for example: +All options defined in conf/grafana.ini can be overridden using environment variables, for example: ``` diff --git a/docs/Makefile b/docs/Makefile index fcb1708f916..9fd8cd6399f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -44,7 +44,7 @@ docs-test: docs-build $(DOCKER_RUN_DOCS) "$(DOCKER_DOCS_IMAGE)" ./test.sh docs-build: - git fetch https://github.com/grafana/grafana.git docs-1.x && git diff --name-status FETCH_HEAD...HEAD -- . > changed-files + git fetch https://github.com/grafana/grafana.git docs-2.1 && git diff --name-status FETCH_HEAD...HEAD -- . > changed-files echo "$(GIT_BRANCH)" > GIT_BRANCH echo "$(GITCOMMIT)" > GITCOMMIT docker build -t "$(DOCKER_DOCS_IMAGE)" . diff --git a/docs/VERSION b/docs/VERSION index 7ec1d6db408..437459cd94c 100644 --- a/docs/VERSION +++ b/docs/VERSION @@ -1 +1 @@ -2.1.0 +2.5.0 diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 5081a138963..f965e34c5bd 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -45,8 +45,9 @@ pages: - ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts'] - ['guides/gettingstarted.md', 'User Guides', 'Getting Started'] -- ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"] +- ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"] - ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"] +- ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"] - ['guides/screencasts.md', 'User Guides', 'Screencasts'] - ['reference/graph.md', 'Reference', 'Graph Panel'] @@ -64,8 +65,10 @@ pages: - ['reference/http_api.md', 'Reference', 'HTTP API'] - ['reference/keyboard_shortcuts.md', 'Reference', 'Keyboard Shortcuts'] -- ['datasources/overview.md', 'Data Sources', 'Data Source Overview'] +- ['datasources/overview.md', 'Data Sources', 'Overview'] - ['datasources/graphite.md', 'Data Sources', 'Graphite'] +- ['datasources/elasticsearch.md', 'Data Sources', 'Elasticsearch'] +- ['datasources/cloudwatch.md', 'Data Sources', 'CloudWatch'] - ['datasources/influxdb.md', 'Data Sources', 'InfluxDB'] - ['datasources/opentsdb.md', 'Data Sources', 'OpenTSDB'] - ['datasources/kairosdb.md', 'Data Sources', 'KairosDB'] diff --git a/docs/sources/datasources/cloudwatch.md b/docs/sources/datasources/cloudwatch.md new file mode 100644 index 00000000000..012da9d843a --- /dev/null +++ b/docs/sources/datasources/cloudwatch.md @@ -0,0 +1,84 @@ +---- +page_title: Cloudwatch +page_description: Cloudwatch grafana datasource documentation +page_keywords: Cloudwatch, grafana, documentation, datasource, docs +--- + +# CloudWatch + +Grafana ships with built in support for CloudWatch. You just have to add it as a data source and you will +be ready to build dashboards for you CloudWatch metrics. + +## Adding the data source +![](/img/cloudwatch/cloudwatch_add.png) + +1. Open the side menu by clicking the the Grafana icon in the top header. +2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. + + > NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization. + +3. Click the `Add new` link in the top header. +4. Select `CloudWatch` from the dropdown. + +Name | Description +------------ | ------------- +Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards. +Default | Default data source means that it will be pre-selected for new panels. +Credentials profile name | Specify the name of the profile to use (if you use `~/aws/credentials` file), leave blank for default. This option was introduced in Grafana 2.5.1 +Default Region | Used in query editor to set region (can be changed on per query basis) + +## Authentication + +### IAM Roles + +Currently all access to CloudWatch is done server side by the Grafana backend using the official AWS SDK. If you grafana +server is running on AWS you can use IAM Roles and authentication will be handled automatically. + +Checkout AWS docs on [IAM Roles]](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html) + +### AWS credentials file + +Create a file at `~/.aws/credentials`. That is the `HOME` path for user running grafana-server. + +Example content: + + [default] + aws_access_key_id = asdsadasdasdasd + aws_secret_access_key = dasdasdsadasdasdasdsa + region = us-west-2 + + +## Metric Query Editor + +![](/img/cloudwatch/query_editor.png) + +You need to specify a namespace, metric, at least one stat, and at least one dimension. + +## Templated queries +CloudWatch Datasource Plugin provides the following functions in `Variables values query` field in Templating Editor to query `region`, `namespaces`, `metric names` and `dimension keys/values` on the CloudWatch. + +Name | Description +------- | -------- +`regions()` | Returns a list of regions AWS provides their service. +`namespaces()` | Returns a list of namespaces CloudWatch support. +`metrics(namespace)` | Returns a list of metrics in the namespace. +`dimension_keys(namespace)` | Returns a list of dimension keys in the namespace. +`dimension_values(region, namespace, metric)` | Returns a list of dimension values matching the specified `region`, `namespace` and `metric`. + +For details about the metrics CloudWatch provides, please refer to the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html). + +If you want to filter dimension values by other dimension key/value pair, you can specify optional parameter like this. +```sql +dimension_values(region, namespace, metric, dim_key1=dim_val1,dim_key2=dim_val2,...) +``` + +![](/img/v2/cloudwatch_templating.png) + +## Cost + +It's worth to mention that Amazon will charge you for CloudWatch API usage. CloudWatch costs +$0.01 per 1,000 GetMetricStatistics or ListMetrics requests. For each query Grafana will +issue a GetMetricStatistics request and every time you pick a dimension in the query editor +Grafana will issue a ListMetrics request. + + diff --git a/docs/sources/datasources/elasticsearch.md b/docs/sources/datasources/elasticsearch.md new file mode 100644 index 00000000000..76b0040ecd3 --- /dev/null +++ b/docs/sources/datasources/elasticsearch.md @@ -0,0 +1,58 @@ +---- +page_title: Elasticsearch +page_description: Elasticsearch grafana datasource documentation +page_keywords: Elasticsearch, grafana, kibana, documentation, datasource, docs +--- + +# Elasticsearch + +Grafana ships with advanced support for Elasticsearch. You can do many types of +simple or complex elasticsearch queries to visualize logs or metrics stored in elasticsearch. You can +also annotate your graphs with log events stored in elasticsearch. + +## Adding the data source +![](/img/v2/add_Graphite.jpg) + +1. Open the side menu by clicking the the Grafana icon in the top header. +2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. + + > NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization. + +3. Click the `Add new` link in the top header. +4. Select `Elasticsearch` from the dropdown. + +Name | Description +------------ | ------------- +Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards. +Default | Default data source means that it will be pre-selected for new panels. +Url | The http protocol, ip and port of you elasticsearch server. +Access | Proxy = access via Grafana backend, Direct = access directory from browser. + +Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser. + +Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source. + +### Direct access +If you select direct access you must update your Elasticsearch configuration to allow other domains to access +Elasticsearch from the browser. You do this by specifying these to options in your **elasticsearch.yml** config file. + + http.cors.enabled: true + http.cors.allow-origin: "*" + +### Index settings + +![](/img/elasticsearch/elasticsearch_ds_details.png) + +Here you can specify a default for the `time field` and specify the name of your elasticsearch index. You can use +a time pattern for the index name or a wildcard. + +## Metric Query editor + +![](/img/elasticsearch/query_editor.png) + +The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add / remove +metrics or group bys. Some metrics and group by have options, click the option text to expand the the row to view and edit metric or group by options. + +## Annotations +TODO + diff --git a/docs/sources/datasources/graphite.md b/docs/sources/datasources/graphite.md index dc545af5007..c4cae0b0c65 100644 --- a/docs/sources/datasources/graphite.md +++ b/docs/sources/datasources/graphite.md @@ -10,11 +10,11 @@ Grafana has an advanced Graphite query editor that lets you quickly navigate the change function parameters and much more. The editor can handle all types of graphite queries. It can even handle complex nested queries through the use of query references. -## Adding the data source to Grafana +## Adding the data source ![](/img/v2/add_Graphite.jpg) -1. Open the side menu by clicking the the Grafana icon in the top header. -2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. +1. Open the side menu by clicking the the Grafana icon in the top header. +2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. > NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization. @@ -29,7 +29,7 @@ Url | The http protocol, ip and port of you graphite-web or graphite-api install Access | Proxy = access via Grafana backend, Direct = access directory from browser. -Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the brower. +Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser. Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source. @@ -78,4 +78,4 @@ You can also create nested variables that use other variables in their definitio ## Query Reference -You can reference queries by the row “letter” that they’re on (similar to Microsoft Excel). If you add a second query to graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries. \ No newline at end of file +You can reference queries by the row “letter” that they’re on (similar to Microsoft Excel). If you add a second query to graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries. diff --git a/docs/sources/datasources/influxdb.md b/docs/sources/datasources/influxdb.md index b48b2b0097a..e57d5a63fbc 100644 --- a/docs/sources/datasources/influxdb.md +++ b/docs/sources/datasources/influxdb.md @@ -12,11 +12,11 @@ them as different data sources. InfluxDB 0.9 is rapidly evolving and we continue to track its API. InfluxDB 0.8 is no longer maintained by InfluxDB Inc, but we provide support as a convenience to existing users. -## Adding the data source to Grafana +## Adding the data source ![](/img/v2/add_Influx.jpg) -1. Open the side menu by clicking the the Grafana icon in the top header. -2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. +1. Open the side menu by clicking the the Grafana icon in the top header. +2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`. > NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization. @@ -28,12 +28,12 @@ Name | Description Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards. Default | Default data source means that it will be pre-selected for new panels. Url | The http protocol, ip and port of you influxdb api (influxdb api port is by default 8086) -Access | Proxy = access via Grafana backend, Direct = access directory from browser. +Access | Proxy = access via Grafana backend, Direct = access directly from browser. Database | Name of your influxdb database User | Name of your database user Password | Database user's password - > Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the brower. + > Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser. > Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source. diff --git a/docs/sources/datasources/kairosdb.md b/docs/sources/datasources/kairosdb.md index 7619c8e8b1f..fc9b5682515 100644 --- a/docs/sources/datasources/kairosdb.md +++ b/docs/sources/datasources/kairosdb.md @@ -32,7 +32,7 @@ Open a graph in edit mode by click the title. ![](/img/v2/kairos_query_editor.png) -For details on KairosDB metric queries checkout the offical. +For details on KairosDB metric queries checkout the official. - [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html). ## Templated queries @@ -49,4 +49,4 @@ For details of `metric names`, `tag names`, and `tag values`, please refer to th - [List Metric Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListMetricNames.html) - [List Tag Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagNames.html) - [List Tag Values - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagValues.html) -- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html). \ No newline at end of file +- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html). diff --git a/docs/sources/datasources/opentsdb.md b/docs/sources/datasources/opentsdb.md index 3368c39a0ae..43fcda643ee 100644 --- a/docs/sources/datasources/opentsdb.md +++ b/docs/sources/datasources/opentsdb.md @@ -30,18 +30,23 @@ Open a graph in edit mode by click the title. ![](/img/v2/opentsdb_query_editor.png) ### Auto complete suggestions -You should get auto complete suggestions for tags and tag values. If you do not you need to enable `tsd.core.meta.enable_realtime_ts` in -the OpenTSDB server settings. +As soon as you start typing metric names, tag names and tag values , you should see highlighted auto complete suggestions for them. - > Note: This is required for the OpenTSDB `lookup` api to work. + > Note: This is required for the OpenTSDB `suggest` api to work. ## Templating queries Grafana's OpenTSDB data source now supports template variable values queries. This means you can create template variables that fetch the values from OpenTSDB (for example metric names, tag names, or tag values). The query editor is also enhanced to limiting tags by metric. When using OpenTSDB with a template variable of `query` type you can use following syntax for lookup. - metrics() // returns metric names + metrics(prefix) // returns metric names with specific prefix (can be empty) tag_names(cpu) // return tag names (i.e. keys) for a specific cpu metric tag_values(cpu, hostname) // return tag values for metric cpu and tag key hostname + suggest_tagk(prefix) // return tag names (i.e. keys) for all metrics with specific prefix (can be empty) + suggest_tagv(prefix) // return tag values for all metrics with specific prefix (can be empty) -For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html) \ No newline at end of file +If you do not see template variables being populated in `Preview of values` section, you need to enable `tsd.core.meta.enable_realtime_ts` in the OpenTSDB server settings. Also, to populate metadata of the existing time series data in OpenTSDB, you need to run `tsdb uid metasync` on the OpenTSDB server. + +> Note: This is required for the OpenTSDB `lookup` api to work. + +For details on opentsdb metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html) diff --git a/docs/sources/datasources/overview.md b/docs/sources/datasources/overview.md index 4e1c08fe82b..8fe6538dcd3 100644 --- a/docs/sources/datasources/overview.md +++ b/docs/sources/datasources/overview.md @@ -15,6 +15,8 @@ The query language and capabilities of each Data Source are obviously very diffe The following datasources are officially supported: * [Graphite](/datasources/graphite/) +* [Elasticsearch](/datasources/elasticsearch/) +* [CloudWatch](/datasources/cloudwatch/) * [InfluxDB](/datasources/influxdb/) * [OpenTSDB](/datasources/opentsdb/) * [KairosDB](/datasources/kairosdb) diff --git a/docs/sources/datasources/prometheus.md b/docs/sources/datasources/prometheus.md index e975a5cf8a4..61f6c0d66e8 100644 --- a/docs/sources/datasources/prometheus.md +++ b/docs/sources/datasources/prometheus.md @@ -28,7 +28,7 @@ Basic Auth | Enable basic authentication to the Prometheus datasource. User | Name of your Prometheus user Password | Database user's password - > Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the brower. + > Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser. > Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source. diff --git a/docs/sources/guides/gettingstarted.md b/docs/sources/guides/gettingstarted.md index 93d67048ad6..c92f30098ab 100644 --- a/docs/sources/guides/gettingstarted.md +++ b/docs/sources/guides/gettingstarted.md @@ -5,7 +5,7 @@ page_keywords: grafana, guide, documentation --- # Getting started -This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana 2.x instance, and have added at least one Grafana Data Source. +This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana 2.x instance, and have added at least one [Data Source](/datasources/overview). ## Beginner guides Watch the 10min [beginners guide to building dashboards](https://www.youtube.com/watch?v=sKNZMtoSHN4&index=7&list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2) to get a quick intro to setting up Dashboards and Panels. @@ -29,7 +29,7 @@ The image above shows you the top header for a Dashboard. 6. Settings: Manage Dashboard settings and features such as Templating and Annotations. ## Dashboards, Panels, Rows, the building blocks of Grafana... -Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Gafana makes it easy to construct the right queries, and customize the display properities so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, and KairosDB). The [Core Concepts](/guides/basic_concepts) guide explores these key ideas in detail. +Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, and KairosDB). The [Core Concepts](/guides/basic_concepts) guide explores these key ideas in detail. ## Adding & Editing Graphs and Panels diff --git a/docs/sources/guides/screencasts.md b/docs/sources/guides/screencasts.md index edf3d7b8122..500ca9f9b6a 100644 --- a/docs/sources/guides/screencasts.md +++ b/docs/sources/guides/screencasts.md @@ -32,7 +32,7 @@ no_toc: true

Episode 4 - Installation & Configuration on Ubuntu / Debian

- Learn how to easily install the dependencies and packages to get Grafana 2.0 up and running on Ubuntu or Debian in just a few mintues. + Learn how to easily install the dependencies and packages to get Grafana 2.0 up and running on Ubuntu or Debian in just a few minutes.
diff --git a/docs/sources/guides/whats-new-in-v2-1.md b/docs/sources/guides/whats-new-in-v2-1.md index 6a6ebba98de..10519cb0422 100644 --- a/docs/sources/guides/whats-new-in-v2-1.md +++ b/docs/sources/guides/whats-new-in-v2-1.md @@ -112,7 +112,7 @@ for example make all series that contain the word **CPU** `red` and assigned to ![Define series color using regex rule](/img/v2/regex_color_override.png "Define series color using regex rule") -New series style override, negative-y transform and stack groups. Negative y tranform is +New series style override, negative-y transform and stack groups. Negative y transform is very useful if you want to plot a series on the negative y scale without affecting the legend values like min or max or the values shown in the hover tooltip. @@ -126,5 +126,5 @@ string values. ### Changelog For a detailed list and link to github issues for everything included in the 2.1 release please -view the [CHANGELOG.md]("https://github.com/grafana/grafana/blob/master/CHANGELOG.md") file. +view the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file. diff --git a/docs/sources/guides/whats-new-in-v2-5.md b/docs/sources/guides/whats-new-in-v2-5.md new file mode 100644 index 00000000000..f02d0d43fd0 --- /dev/null +++ b/docs/sources/guides/whats-new-in-v2-5.md @@ -0,0 +1,105 @@ +--- +page_title: What's New in Grafana v2.5 +page_description: What's new in Grafana v2.5 +page_keywords: grafana, new, changes, features, documentation +--- + +# What's new in Grafana v2.5 + +## Release highlights +This is an exciting release, and we want to share some of the highlights. The release includes many +fixes and enhancements to all areas of Grafana, like new Data Sources, a new and improved timepicker, user invites, panel +resize handles and improved InfluxDB and OpenTSDB support. + +### New time range controls +New Time picker + +A new timepicker with room for more quick ranges as well as new types of relative ranges, like `Today`, +`The day so far` and `This day last week`. Also an improved time & calendar picker that now works +correctly in UTC mode. + +### Elasticsearch + +Elasticsearch example +
+ +This release brings a fully featured query editor for Elasticsearch. You will now be able to visualize +logs or any kind of data stored in Elasticserarch. The query editor allows you to build both simple +and complex queries for logs or metrics. + +- Compute metrics from your documents, supported Elasticsearch aggregations: + - Count, Avg, Min, Max, Sum + - Percentiles, Std Dev, etc. +- Group by multiple terms or filters + - Specify group by options like Top 5 based on Avg @value +- Auto completion for field names +- Query only relevant indices based on time pattern +- Alias patterns for short readable series names + +Try the new Elasticsearch query editor on the [play.grafana.org](http://play.grafana.org/dashboard/db/elasticsearch-metrics) site. + +### CloudWatch + +Cloudwatch editor + +Grafana 2.5 ships with a new CloudWatch datasource that will allow you to query and visualize CloudWatch +metrics directly from Grafana. + +- Rich editor with auto completion for metric names, namespaces and dimensions +- Templating queries for generic dashboards +- Alias patterns for short readable series names + +### Prometheus + +Prometheus editor + +Grafana 2.5 ships with a new Prometheus datasource that will allow you to query and visualize data +stored in Prometheus. + + +### Mix different data sources +Mix data sources in the same dashboard or in the same graph! + +In previous releases you have been able to mix different data sources on the same dashboard. In v2.5 you +will be able to mix then on the same graph! You can enable this by selecting the built in `-- Mixed --` data source. +When selected this will allow you to specify data source on a per query basis. This will, for example, allow you +to plot metrics from different Graphite servers on the same Graph or plot data from Elasticsearch alongside +data from Prometheus. Mixing different data sources on the same graph works for any data source, even custom ones. + +### Panel Resize handles + + +This release adds resize handles to the the bottom right corners of panels making is easy to resize both width and height. + +### User invites + + +This version also brings some new features for user management. + +- Organization admins can now invite new users (via email or manually via invite link) +- Users can signup using invite link and get automatically added to invited organization +- User signup workflow can (if enabled) contain an email verification step. +- Check out [#2353](https://github.com/grafana/grafana/issues/2353) for more info. + +### Miscellaneous improvements + +- InfluxDB query editor now supports math and AS expressions +- InfluxDB query editor now supports custom group by interval +- Panel drilldown link is easier to reach +- LDAP improvements (can now search for group membership if your LDAP server does not support memberOf attribute) +- More units for graph and singlestat panel (Length, Volume, Temperature, Pressure, Currency) +- Admin page for all organizations (remove / edit) + +### Breaking changes +There have been some changes to the data source plugin API. If you are using a custom plugin check that there is an update for it before you upgrade. Also +the new time picker does not currently support custom quick ranges like the last one did. This will likely be added in a +future release. + +### Changelog +For a detailed list and link to github issues for everything included in the 2.5 release please +view the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file. + +- - - + +### Download Grafana 2.5 now + diff --git a/docs/sources/installation/configuration.md b/docs/sources/installation/configuration.md index 31d029b1101..e68edcbca0c 100644 --- a/docs/sources/installation/configuration.md +++ b/docs/sources/installation/configuration.md @@ -266,7 +266,7 @@ automatically signed up. ### team_ids Require an active team membership for at least one of the given teams on -GitHub. If the authenticated user isn't a member of at least one the +GitHub. If the authenticated user isn't a member of at least one of the teams they will not be able to register or authenticate with your Grafana instance. For example: @@ -274,7 +274,7 @@ Grafana instance. For example: enabled = true client_id = YOUR_GITHUB_APP_CLIENT_ID client_secret = YOUR_GITHUB_APP_CLIENT_SECRET - scopes = user:email + scopes = user:email,read:org team_ids = 150,300 auth_url = https://github.com/login/oauth/authorize token_url = https://github.com/login/oauth/access_token diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index 048474af3eb..4a734ac4400 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -10,13 +10,13 @@ page_keywords: grafana, installation, debian, ubuntu, guide Description | Download ------------ | ------------- -.deb for Debian-based Linux | [grafana_2.1.3_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_2.1.3_amd64.deb) +.deb for Debian-based Linux | [grafana_2.5.0_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.0_amd64.deb) ## Install - $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.1.3_amd64.deb + $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.0_amd64.deb $ sudo apt-get install -y adduser libfontconfig - $ sudo dpkg -i grafana_2.1.3_amd64.deb + $ sudo dpkg -i grafana_2.5.0_amd64.deb ## APT Repository @@ -122,7 +122,7 @@ To configure Grafana add a configuration file named `custom.ini` to the `conf` folder and override any of the settings defined in `conf/defaults.ini`. -Start Grafana by executing `./grafana web`. The `grafana` binary needs +Start Grafana by executing `./grafana-server web`. The `grafana-server` binary needs the working directory to be the root install directory (where the binary and the `public` folder is located). diff --git a/docs/sources/installation/docker.md b/docs/sources/installation/docker.md index 53366bed44a..18dcf964450 100644 --- a/docs/sources/installation/docker.md +++ b/docs/sources/installation/docker.md @@ -9,7 +9,7 @@ page_keywords: grafana, installation, docker, container, guide > **2.0.2 -> 2.1.0 Upgrade NOTICE!** > The data and log paths were not correct in the previous image. The grafana database was placed by default in /usr/share/grafana/data instead of the correct path /var/lib/grafana. This means it was not in a dir that was marked as a volume. So if you remove the container it will remove the grafana database. So before updating make sure you copy the /usr/share/grafana/data path from inside the container to the host. -## Install from offical docker image +## Install from official docker image Grafana has an official Docker container. diff --git a/docs/sources/installation/ldap.md b/docs/sources/installation/ldap.md index f0325a953fe..82309ec0f19 100644 --- a/docs/sources/installation/ldap.md +++ b/docs/sources/installation/ldap.md @@ -1,6 +1,6 @@ --- page_title: LDAP Integration -page_description: LDAP Integrtaion guide for Grafana. +page_description: LDAP Integration guide for Grafana. page_keywords: grafana, ldap, configuration, documentation, integration --- @@ -21,26 +21,38 @@ specific configuration file (default: `/etc/grafana/ldap.toml`). verbose_logging = false [[servers]] -# LDAP server host +# Ldap server host (specify multiple hosts space separated) host = "127.0.0.1" -# Usual port is 389, or, if TLS is supported, 636 +# Default port is 389 or 636 if use_ssl = true port = 389 -# Set to true if LDAP server supports TLS +# Set to true if ldap server supports TLS use_ssl = false -# set to true if you want to skip SSL cert validation +# set to true if you want to skip ssl cert validation ssl_skip_verify = false +# set to the path to your root CA certificate or leave unset to use system defaults +# root_ca_cert = /path/to/certificate.crt # Search user bind dn bind_dn = "cn=admin,dc=grafana,dc=org" # Search user bind password -bind_password = "grafana" +bind_password = 'grafana' -# Search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" +# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" search_filter = "(cn=%s)" + # An array of base dns to search through search_base_dns = ["dc=grafana,dc=org"] -# Map LDAP user attributes to Grafana user attributes +# In POSIX LDAP schemas, without memberOf attribute a secondary query must be made for groups. +# This is done by enabling group_search_filter below. You must also set member_of= "cn" +# in [servers.attributes] below. + +## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available) +# group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" +## An array of the base DNs to search through for groups. Typically uses ou=groups +# group_search_base_dns = ["ou=groups,dc=grafana,dc=org"] + +# Specify names of the ldap attributes your ldap uses [servers.attributes] name = "givenName" surname = "sn" @@ -48,11 +60,11 @@ username = "cn" member_of = "memberOf" email = "email" -# Map LDAP groups to Grafana org roles +# Map ldap groups to grafana org roles [[servers.group_mappings]] group_dn = "cn=admins,dc=grafana,dc=org" org_role = "Admin" -# The Grafana organization database id, optional, if left out, the default org (id 1) will be used +# The Grafana organization database id, optional, if left out the default org (id 1) will be used # org_id = 1 [[servers.group_mappings]] @@ -60,9 +72,10 @@ group_dn = "cn=users,dc=grafana,dc=org" org_role = "Editor" [[servers.group_mappings]] -# If you want to match all (or no LDAP groups) then you can use wildcard +# If you want to match all (or no ldap groups) then you can use wildcard group_dn = "*" org_role = "Viewer" + ``` ## Bind & Bind Password @@ -85,19 +98,33 @@ bind_dn = "cn=%s,o=users,dc=grafana,dc=org" ``` In this case you skip providing a `bind_password` and instead provide a `bind_dn` value with a `%s` somewhere. This will be replaced with the username entered in on the Grafana login page. -The search filter and search bases settings are still needed to perform the LDAP search to retreive the other LDAP information (like LDAP groups and email). +The search filter and search bases settings are still needed to perform the LDAP search to retrieve the other LDAP information (like LDAP groups and email). + +## POSIX schema (no memberOf attribute) +If your ldap server does not support the memberOf attribute add these options: + +```toml +## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available) +group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" +## An array of the base DNs to search through for groups. Typically uses ou=groups +group_search_base_dns = ["ou=groups,dc=grafana,dc=org"] +``` + +Also change set `member_of = "cn"` in the `[servers.attributes]` section. + ## LDAP to Grafana Org Role Sync -## Group Mappings -In `[[servers.group_mappings]]` you can map an LDAP group to a Grafana organization and role. These will be synced every time the user logs in, with LDAP being the authoratative source. -So, if you change a user's role in the Grafana Org. Users page, this change will be reset the next time the user logs in. If you change the LDAP groups of a user, the change will take effect the next time the user logs in. +### Mappings +In `[[servers.group_mappings]]` you can map an LDAP group to a Grafana organization +and role. These will be synced every time the user logs in, with LDAP being +the authoritative source. So, if you change a user's role in the Grafana Org. +Users page, this change will be reset the next time the user logs in. If you +change the LDAP groups of a user, the change will take effect the next +time the user logs in. -### Priority between Multiple Mappings +### Priority The first group mapping that an LDAP user is matched to will be used for the sync. If you have LDAP users that fit multiple mappings, the topmost mapping in the TOML config will be used. -## Ldap to Grafana Org Role Sync -In the `[[servers.group_mappings]]` you can map a LDAP group to a grafana organization and role. These will be synced every time the user logs in. So -if you change a users role in the Grafana Org. Users page, this change will be reset the next time the user logs in. Similarly if you -can LDAP groups for a user in LDAP the change will take effect the next time the user logs in to Grafana. + diff --git a/docs/sources/installation/performance.md b/docs/sources/installation/performance.md index 51ab747bcd2..f09686687ca 100644 --- a/docs/sources/installation/performance.md +++ b/docs/sources/installation/performance.md @@ -8,7 +8,7 @@ page_keywords: grafana, performance, documentation ## Graphite -Graphite 0.9.13 adds a much needed feature to the JSON rendering API +Graphite 0.9.14 adds a much needed feature to the JSON rendering API that is very important for Grafana. If you are experiencing slow load & rendering times for large time ranges then it is most likely caused by running Graphite 0.9.12 or lower. @@ -17,6 +17,6 @@ The latest version of Graphite adds a `maxDataPoints` parameter to the JSON render API. Without this feature Graphite can return hundreds of thousands of data points per graph, which can hang your browser. Be sure to upgrade to -[0.9.13](http://graphite.readthedocs.org/en/latest/releases/0_9_13.html). +[0.9.14](http://graphite.readthedocs.org/en/latest/releases/0_9_14.html). diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md index c112c4c9fea..464faa09b9d 100644 --- a/docs/sources/installation/rpm.md +++ b/docs/sources/installation/rpm.md @@ -1,6 +1,6 @@ --- page_title: Installing on RPM-based Linux -page_description: Grafana Installation guide for Centos, Fedora, Redhat. +page_description: Grafana Installation guide for Centos, Fedora, OpenSuse, Redhat. page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide --- @@ -10,18 +10,24 @@ page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide Description | Download ------------ | ------------- -.RPM for Fedora / RHEL / CentOS Linux | [grafana-2.1.3-1.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-2.1.3-1.x86_64.rpm) +.RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-2.5.0-1.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm) ## Install from package file You can install Grafana using Yum directly. - $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.1.3-1.x86_64.rpm + $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm Or install manually using `rpm`. +#### On CentOS / Fedora / Redhat: + $ sudo yum install initscripts fontconfig - $ sudo rpm -Uvh grafana-2.1.3-1.x86_64.rpm + $ sudo rpm -Uvh grafana-2.5.0-1.x86_64.rpm + +#### On OpenSuse: + + $ sudo rpm -i --nodeps grafana-2.5.0-1.x86_64.rpm ## Install via YUM Repository diff --git a/docs/sources/installation/windows.md b/docs/sources/installation/windows.md index 1ef98ae4896..1bc2b5a2b92 100644 --- a/docs/sources/installation/windows.md +++ b/docs/sources/installation/windows.md @@ -10,7 +10,7 @@ page_keywords: grafana, installation, windows guide Description | Download ------------ | ------------- -Zip package for Windows | [grafana.2.1.3.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-2.1.3.windows-x64.zip) +Zip package for Windows | [grafana.2.5.0.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-2.5.0.windows-x64.zip) ## Configure diff --git a/docs/sources/project/building_from_source.md b/docs/sources/project/building_from_source.md index 45ab26249c8..71e94b088fb 100644 --- a/docs/sources/project/building_from_source.md +++ b/docs/sources/project/building_from_source.md @@ -25,7 +25,7 @@ go get github.com/grafana/grafana ``` cd $GOPATH/src/github.com/grafana/grafana go run build.go setup # (only needed once to install godep) -$GOPATH/bin/godep restore # (will pull down all golang lib dependecies in your current GOPATH) +$GOPATH/bin/godep restore # (will pull down all golang lib dependencies in your current GOPATH) go run build.go build # (or 'go build .') ``` diff --git a/docs/sources/reference/admin.md b/docs/sources/reference/admin.md index 854147b4240..c5d5073020d 100644 --- a/docs/sources/reference/admin.md +++ b/docs/sources/reference/admin.md @@ -24,7 +24,7 @@ modify Organization details and options. As a Grafana Administrator, you have complete access to any Organization or User in that instance of Grafana. -When performing actions as a Grafana admin, the sidebar will change it's apperance as below to indicate you are performing global server administration. +When performing actions as a Grafana admin, the sidebar will change it's appearance as below to indicate you are performing global server administration. From the Grafana Server Admin page, you can access the System Info page which summarizes all of the backend configuration settings of the Grafana server. diff --git a/docs/sources/reference/dashboard.md b/docs/sources/reference/dashboard.md new file mode 100644 index 00000000000..93adf5cd789 --- /dev/null +++ b/docs/sources/reference/dashboard.md @@ -0,0 +1,422 @@ +---- +page_title: Dashboard JSON +page_description: Dashboard JSON Reference +page_keywords: grafana, dashboard, json, documentation +--- + +# Dashboard JSON + +## Overview + +A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from rows, panels, template variables, panel queries, etc. + +To view the JSON of a dashboard, follow the steps mentioned below: + + 1. Go to a dashboard + 2. Click on `Manage dashboard` menu on the top navigation bar + 3. Select `View JSON` from the dropdown menu + +## JSON fields + +When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields: + +> Note: In the following JSON, id is shown as null which is the default value assigned to it until a dashboard is saved. Once a dashboard is saved, an integer value is assigned to the `id` field. + +``` +{ + "id": null, + "title": "New dashboard", + "originalTitle": "New dashboard", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "hideControls": false, + "sharedCrosshair": false, + "rows": [], + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "time_options": [], + "refresh_intervals": [] + }, + "templating": { + "list": [] + }, + "annotations": { + "list": [] + }, + "schemaVersion": 7, + "version": 0, + "links": [] +} +``` +Each field in the dashboard JSON is explained below with its usage: + +| Name | Usage | +| ---- | ----- | +| **id** | unique dashboard id, an integer | +| **title** | current title of dashboard | +| **originalTitle** | title of dashboard when saved for the first time | +| **tags** | tags associated with dashboard, an array of strings | +| **style** | theme of dashboard, i.e. `dark` or `light` | +| **timezone** | timezone of dashboard, i.e. `utc` or `browser` | +| **editable** | whether a dashboard is editable or not | +| **hideControls** | whether row controls on the left in green are hidden or not | +| **sharedCrosshair** | TODO | +| **rows** | row metadata, see [rows section](/docs/sources/reference/dashboard.md/#rows) for details | +| **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc | +| **timepicker** | timepicker metadata, see [timepicker section](/docs/sources/reference/dashboard.md/#timepicker) for details | +| **templating** | templating metadata, see [templating section](/docs/sources/reference/dashboard.md/#templating) for details | +| **annotations** | annotations metadata, see [annotations section](/docs/sources/reference/dashboard.md/#annotations) for details | +| **schemaVersion** | TODO | +| **version** | TODO | +| **links** | TODO | + +### rows + +`rows` field consists of an array of JSON object representing each row in a dashboard, such as shown below: + +``` + "rows": [ + { + "collapse": false, + "editable": true, + "height": "200px", + "panels": [], + "title": "New row" + }, + { + "collapse": true, + "editable": true, + "height": "300px", + "panels": [], + "title": "New row" + } + ] +``` + +Usage of the fields is explained below: + +| Name | Usage | +| ---- | ----- | +| **collapse** | whether row is collapsed or not | +| **editable** | whether a row is editable or not | +| **height** | height of the row in pixels | +| **panels** | panels metadata, see [panels section](/docs/sources/reference/dashboard.md/#panels) for details | +| **title** | title of row | + +#### panels + +Panels are the building blocks a dashboard. It consists of datasource queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel in a row. Most of the fields are common for all panels but some fields depends on the panel type. Following is an example of panel JSON representing a `graph` panel type: + +``` +"panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "aggregator": "max", + "alias": "$tag_instance_id", + "currentTagKey": "", + "currentTagValue": "", + "downsampleAggregator": "avg", + "downsampleInterval": "", + "errors": {}, + "metric": "memory.percent-used", + "refId": "A", + "shouldComputeRate": false, + "tags": { + "app": "$app", + "env": "stage", + "instance_id": "*" + } + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Memory Utilization", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "percent", + "short" + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 0, + "grid": { + "leftLogBase": 1, + "leftMax": null, + "leftMin": null, + "rightLogBase": 1, + "rightMax": null, + "rightMin": null, + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "aggregator": "avg", + "alias": "$tag_instance_id", + "currentTagKey": "", + "currentTagValue": "", + "downsampleAggregator": "avg", + "downsampleInterval": "", + "errors": {}, + "metric": "memory.percent-cached", + "refId": "A", + "shouldComputeRate": false, + "tags": { + "app": "$app", + "env": "prod", + "instance_id": "*" + } + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Memory Cached", + "tooltip": { + "shared": true, + "value_type": "cumulative" + }, + "type": "graph", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ] + }, +``` + +Usage of each field is explained below: + +| Name | Usage | +| ---- | ----- | +| TODO | TODO | + +### timepicker + +Description: TODO + +``` +"timepicker": { + "collapse": false, + "enable": true, + "notice": false, + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "status": "Stable", + "time_options": [ + "5m", + "15m", + "1h", + "3h", + "6h", + "12h", + "24h", + "2d", + "3d", + "4d", + "7d", + "30d" + ], + "type": "timepicker" + } +``` + +Usage of the fields is explained below: + +| Name | Usage | +| ---- | ----- | +| **collapse** | whether timepicker is collapsed or not | +| **enable** | whether timepicker is enabled or not | +| **notice** | TODO | +| **now** | TODO | +| **refresh_intervals** | TODO | +| **status** | TODO | +| **time_options** | TODO | +| **type** | TODO | + +### templating + +`templating` fields contains array of template variables with their saved values along with some other metadata, for example: + +``` + "templating": { + "enable": true, + "list": [ + { + "allFormat": "wildcard", + "current": { + "tags": [], + "text": "prod", + "value": "prod" + }, + "datasource": null, + "includeAll": true, + "name": "env", + "options": [ + { + "selected": false, + "text": "All", + "value": "*" + }, + { + "selected": false, + "text": "stage", + "value": "stage" + }, + { + "selected": false, + "text": "test", + "value": "test" + } + ], + "query": "tag_values(cpu.utilization.average,env)", + "refresh": false, + "refresh": false, + "type": "query" + }, + { + "allFormat": "wildcard", + "current": { + "text": "apache", + "value": "apache" + }, + "datasource": null, + "includeAll": false, + "multi": false, + "multiFormat": "glob", + "name": "app", + "options": [ + { + "selected": true, + "text": "tomcat", + "value": "tomcat" + }, + { + "selected": false, + "text": "cassandra", + "value": "cassandra" + } + ], + "query": "tag_values(cpu.utilization.average,app)", + "refresh": false, + "regex": "", + "type": "query" + } + ] + } +``` + +Usage of the above mentioned fields in the templating section is explained below: + +| Name | Usage | +| ---- | ----- | +| **enable** | whether templating is enabled or not | +| **list** | an array of objects representing, each representing one template variable | +| **allFormat** | format to use while fetching all values from datasource, eg: `wildcard`, `glob`, `regex`, `pipe`, etc. | +| **current** | shows current selected variable text/value on the dashboard | +| **datasource** | shows datasource for the variables | +| **includeAll** | whether all value option is available or not | +| **multi** | whether multiple values can be selected or not from variable value list | +| **multiFormat** | format to use while fetching timeseries from datasource | +| **name** | name of variable | +| **options** | array of variable text/value pairs available for selection on dashboard | +| **query** | datasource query used to fetch values for a variable | +| **refresh** | TODO | +| **regex** | TODO | +| **type** | type of variable, i.e. `custom`, `query` or `interval` | + +### annotations + +TODO diff --git a/docs/sources/reference/dashlist.md b/docs/sources/reference/dashlist.md index 1f0794dabfc..ea098541da2 100644 --- a/docs/sources/reference/dashlist.md +++ b/docs/sources/reference/dashlist.md @@ -8,7 +8,7 @@ page_keywords: grafana, dashlist, panel, documentation ## Overview -The dashboard list panel allows you to display dynamic links to other dashboards. The list can be configured to use starred dashbaords, a search query and/or dashboard tags. +The dashboard list panel allows you to display dynamic links to other dashboards. The list can be configured to use starred dashboards, a search query and/or dashboard tags. diff --git a/docs/sources/reference/graph.md b/docs/sources/reference/graph.md index 9de23332a99..9c2ab63fbaa 100644 --- a/docs/sources/reference/graph.md +++ b/docs/sources/reference/graph.md @@ -30,7 +30,7 @@ The drilldown section allows adding dynamic links to the panel that can link to or URLs Each link has a title, a type and params. A link can be either a ``dashboard`` or ``absolute`` links. -If it is a dashboard links, the `dashboard` value must be the name of a dashbaord. If it's an +If it is a dashboard links, the `dashboard` value must be the name of a dashboard. If it's an `absolute` link, the URL is the URL to link. ``params`` allows adding additional URL params to the links. The format is the ``name=value`` with @@ -127,7 +127,7 @@ If you have stack enabled you can select what the mouse hover feature should sho ### Rendering - ``Flot`` - Render the graphs in the browser using Flot (default) -- ``Graphite PNG`` - Render the graph on the server using graphites render API. +- ``Graphite PNG`` - Render the graph on the server using graphite's render API. ### Tooltip diff --git a/docs/sources/reference/http_api.md b/docs/sources/reference/http_api.md index 609f12269ca..15e7a06f3b8 100644 --- a/docs/sources/reference/http_api.md +++ b/docs/sources/reference/http_api.md @@ -36,9 +36,9 @@ You use the token in all requests in the `Authorization` header, like this: **Example**: - GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1 - Accept: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET http://your.grafana.com/api/dashboards/db/mydash HTTP/1.1 + Accept: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk The `Authorization` header value should be `Bearer `. @@ -52,26 +52,26 @@ Creates a new dashboard or updates an existing dashboard. **Example Request for new dashboard**: - POST /api/dashboards/db HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + POST /api/dashboards/db HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - { - "dashboard": { - "id": null, - "title": "Production Overview", - "tags": [ "templated" ], - "timezone": "browser", - "rows": [ - { - } - ], - "schemaVersion": 6, - "version": 0 - }, - "overwrite": false - } + { + "dashboard": { + "id": null, + "title": "Production Overview", + "tags": [ "templated" ], + "timezone": "browser", + "rows": [ + { + } + ], + "schemaVersion": 6, + "version": 0 + }, + "overwrite": false + } JSON Body schema: @@ -119,34 +119,34 @@ Will return the dashboard given the dashboard slug. Slug is the url friendly ver **Example Request**: - GET /api/dashboards/db/production-overview HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/dashboards/db/production-overview HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - { - "meta": { - "isStarred": false, - "slug": "production-overview" - }, - "model": { - "id": null, - "title": "Production Overview", - "tags": [ "templated" ], - "timezone": "browser", - "rows": [ - { - } - ] - "schemaVersion": 6, - "version": 0 - }, - } + { + "meta": { + "isStarred": false, + "slug": "production-overview" + }, + "model": { + "id": null, + "title": "Production Overview", + "tags": [ "templated" ], + "timezone": "browser", + "rows": [ + { + } + ], + "schemaVersion": 6, + "version": 0 + } + } ### Delete dashboard @@ -156,17 +156,17 @@ The above will delete the dashboard with the specified slug. The slug is the url **Example Request**: - DELETE /api/dashboards/db/test HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + DELETE /api/dashboards/db/test HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - {"title": "Test"} + {"title": "Test"} ### Gets the home dashboard @@ -176,53 +176,53 @@ Will return the home dashboard. **Example Request**: - GET /api/dashboards/home HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/dashboards/home HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - { - "meta": { - "isHome":true, - "canSave":false, - "canEdit":false, - "canStar":false, - "slug":"", - "expires":"0001-01-01T00:00:00Z", - "created":"0001-01-01T00:00:00Z" - }, - "dashboard": { - "editable":false, - "hideControls":true, - "nav":[ - { - "enable":false, - "type":"timepicker" - } - ], - "rows": [ - { - - } - ], - "style":"dark", - "tags":[], - "templating":{ - "list":[ - ] - }, - "time":{ - }, - "timezone":"browser", - "title":"Home", - "version":5 - } + { + "meta": { + "isHome":true, + "canSave":false, + "canEdit":false, + "canStar":false, + "slug":"", + "expires":"0001-01-01T00:00:00Z", + "created":"0001-01-01T00:00:00Z" + }, + "dashboard": { + "editable":false, + "hideControls":true, + "nav":[ + { + "enable":false, + "type":"timepicker" } + ], + "rows": [ + { + + } + ], + "style":"dark", + "tags":[], + "templating":{ + "list":[ + ] + }, + "time":{ + }, + "timezone":"browser", + "title":"Home", + "version":5 + } + } ### Tags for Dashboard @@ -233,27 +233,27 @@ Get all tabs of dashboards **Example Request**: - GET /api/dashboards/home HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/dashboards/home HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json + + [ + { + "term":"tag1", + "count":1 + }, + { + "term":"tag2", + "count":4 + } + ] - [ - { - "term":"tag1", - "count":1 - }, - { - "term":"tag2", - "count":4 - } - ] - ### Dashboard from JSON file `GET /file/:file` @@ -271,27 +271,27 @@ Status Codes: **Example Request**: - GET /api/search?query=MyDashboard&starred=true&tag=prod HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/search?query=MyDashboard&starred=true&tag=prod HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - [ - { - "id":1, - "title":"Production Overview", - "uri":"db/production-overview", - "type":"dash-db", - "tags":[], - "isStarred":false - } - ] - + HTTP/1.1 200 + Content-Type: application/json + + [ + { + "id":1, + "title":"Production Overview", + "uri":"db/production-overview", + "type":"dash-db", + "tags":[], + "isStarred":false + } + ] + ## Data sources ### Get all datasources @@ -300,34 +300,34 @@ Status Codes: **Example Request**: - GET /api/datasources HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/datasources HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - [ - { - "id":1, - "orgId":1, - "name":"datasource_elastic", - "type":"elasticsearch", - "access":"proxy", - "url":"http://mydatasource.com", - "password":"", - "user":"", - "database":"grafana-dash", - "basicAuth":false, - "basicAuthUser":"", - "basicAuthPassword":"", - "isDefault":false, - "jsonData":null - } - ] + [ + { + "id":1, + "orgId":1, + "name":"datasource_elastic", + "type":"elasticsearch", + "access":"proxy", + "url":"http://mydatasource.com", + "password":"", + "user":"", + "database":"grafana-dash", + "basicAuth":false, + "basicAuthUser":"", + "basicAuthPassword":"", + "isDefault":false, + "jsonData":null + } + ] ### Get a single data sources by Id @@ -335,32 +335,32 @@ Status Codes: **Example Request**: - GET /api/datasources/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/datasources/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - { - "id":1, - "orgId":1, - "name":"test_datasource", - "type":"graphite", - "access":"proxy", - "url":"http://mydatasource.com", - "password":"", - "user":"", - "database":"", - "basicAuth":false, - "basicAuthUser":"", - "basicAuthPassword":"", - "isDefault":false, - "jsonData":null - } + { + "id":1, + "orgId":1, + "name":"test_datasource", + "type":"graphite", + "access":"proxy", + "url":"http://mydatasource.com", + "password":"", + "user":"", + "database":"", + "basicAuth":false, + "basicAuthUser":"", + "basicAuthPassword":"", + "isDefault":false, + "jsonData":null + } ### Create data source @@ -368,26 +368,26 @@ Status Codes: **Example Request**: - POST /api/datasources HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + POST /api/datasources HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - { - "name":"test_datasource", - "type":"graphite", - "url":"http://mydatasource.com", - "access":"proxy", - "basicAuth":false - } + { + "name":"test_datasource", + "type":"graphite", + "url":"http://mydatasource.com", + "access":"proxy", + "basicAuth":false + } **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - {"id":1,"message":"Datasource added"} + {"id":1,"message":"Datasource added"} ### Update an existing data source @@ -395,34 +395,34 @@ Status Codes: **Example Request**: - PUT /api/datasources/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - - { - "id":1, - "orgId":1, - "name":"test_datasource", - "type":"graphite", - "access":"proxy", - "url":"http://mydatasource.com", - "password":"", - "user":"", - "database":"", - "basicAuth":true, - "basicAuthUser":"basicuser", - "basicAuthPassword":"basicuser", - "isDefault":false, - "jsonData":null - } + PUT /api/datasources/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "id":1, + "orgId":1, + "name":"test_datasource", + "type":"graphite", + "access":"proxy", + "url":"http://mydatasource.com", + "password":"", + "user":"", + "database":"", + "basicAuth":true, + "basicAuthUser":"basicuser", + "basicAuthPassword":"basicuser", + "isDefault":false, + "jsonData":null + } **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - {"message":"Datasource updated"} + {"message":"Datasource updated"} ### Delete an existing data source @@ -430,17 +430,17 @@ Status Codes: **Example Request**: - DELETE /api/datasources/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + DELETE /api/datasources/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - {"message":"Data source deleted"} + {"message":"Data source deleted"} ### Available data source types @@ -448,29 +448,29 @@ Status Codes: **Example Request**: - GET /api/datasources/plugins HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + GET /api/datasources/plugins HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json + + { + "grafana":{ + "metrics":true,"module":"plugins/datasource/grafana/datasource", + "name":"Grafana (for testing)", + "partials":{ + "query":"app/plugins/datasource/grafana/partials/query.editor.html" + }, + "pluginType":"datasource", + "serviceName":"GrafanaDatasource", + "type":"grafana" + } + } - { - "grafana":{ - "metrics":true,"module":"plugins/datasource/grafana/datasource", - "name":"Grafana (for testing)", - "partials":{ - "query":"app/plugins/datasource/grafana/partials/query.editor.html" - }, - "pluginType":"datasource", - "serviceName":"GrafanaDatasource", - "type":"grafana" - } - } - ## Data source proxy calls `GET /api/datasources/proxy/:datasourceId/*` @@ -485,20 +485,20 @@ Proxies all calls to the actual datasource. **Example Request**: - GET /api/org HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/org HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - { - "id":1, - "name":"Main Org." - } + { + "id":1, + "name":"Main Org." + } ### Update current Organisation @@ -506,49 +506,49 @@ Proxies all calls to the actual datasource. **Example Request**: - PUT /api/org HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + PUT /api/org HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "name":"Main Org." + } + - { - "name":"Main Org." - } - - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Organization updated"} + - {"message":"Organization updated"} - - ### Get all users within the actual organisation `GET /api/org/users` **Example Request**: - GET /api/org/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/org/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - [ - { - "orgId":1, - "userId":1, - "email":"admin@mygraf.com", - "login":"admin", - "role":"Admin" - } - ] + [ + { + "orgId":1, + "userId":1, + "email":"admin@mygraf.com", + "login":"admin", + "role":"Admin" + } + ] ### Add a new user to the actual organisation @@ -558,65 +558,65 @@ Adds a global user to the actual organisation. **Example Request**: - POST /api/org/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + POST /api/org/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "role": "Admin", + "loginOrEmail": "admin" + } + - { - "role": "Admin", - "loginOrEmail": "admin" - } - - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User added to organization"} - + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User added to organization"} + ### Updates the given user `PATCH /api/org/users/:userId` **Example Request**: - PATCH /api/org/users/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + PATCH /api/org/users/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "role": "Viewer", + } + - { - "role": "Viewer", - } - - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Organization user updated"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Organization user updated"} + - ### Delete user in actual organisation `DELETE /api/org/users/:userId` **Example Request**: - DELETE /api/org/users/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + DELETE /api/org/users/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User removed from organization"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User removed from organization"} ## Organisations @@ -627,22 +627,22 @@ Adds a global user to the actual organisation. **Example Request**: - GET /api/orgs HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/orgs HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - [ - { - "id":1, - "name":"Main Org." - } - ] + HTTP/1.1 200 + Content-Type: application/json + + [ + { + "id":1, + "name":"Main Org." + } + ] ### Update Organisation @@ -652,22 +652,22 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - PUT /api/orgs/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + PUT /api/orgs/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "name":"Main Org 2." + } + - { - "name":"Main Org 2." - } - - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Organization updated"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Organization updated"} ### Get Users in Organisation @@ -675,24 +675,24 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - GET /api/orgs/1/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/orgs/1/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - [ - { - "orgId":1, - "userId":1, - "email":"admin@mygraf.com", - "login":"admin", - "role":"Admin" - } - ] + HTTP/1.1 200 + Content-Type: application/json + [ + { + "orgId":1, + "userId":1, + "email":"admin@mygraf.com", + "login":"admin", + "role":"Admin" + } + ] ### Add User in Organisation @@ -700,22 +700,22 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - POST /api/orgs/1/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + POST /api/orgs/1/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "loginOrEmail":"user", + "role":"Viewer" + } - { - "loginOrEmail":"user", - "role":"Viewer" - } - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User added to organization"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User added to organization"} ### Update Users in Organisation @@ -723,21 +723,21 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - PATCH /api/orgs/1/users/2 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + PATCH /api/orgs/1/users/2 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "role":"Admin" + } - { - "role":"Admin" - } - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Organization user updated"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Organization user updated"} ### Delete User in Organisation @@ -745,17 +745,17 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - DELETE /api/orgs/1/users/2 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + DELETE /api/orgs/1/users/2 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User removed from organization"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User removed from organization"} ## Users @@ -765,31 +765,32 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - GET /api/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - [ - { - "id": 1, - "name": "Admin", - "login": "admin", - "email": "admin@mygraf.com", - "isAdmin": true - }, - { - "id": 2, - "name": "User", - "login": "user", - "email": "user@mygraf.com" - "isAdmin": false - } - ] + HTTP/1.1 200 + Content-Type: application/json + + [ + { + "id": 1, + "name": "Admin", + "login": "admin", + "email": "admin@mygraf.com", + "isAdmin": true + }, + { + "id": 2, + "name": "User", + "login": "user", + "email": "user@mygraf.com", + "isAdmin": false + } + ] ### Get single user by Id @@ -797,24 +798,24 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - GET /api/users/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/users/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - { - "email": "user@mygraf.com" - "name": "admin", - "login": "admin", - "theme": "light", - "orgId": 1, - "isGrafanaAdmin": true - } + HTTP/1.1 200 + Content-Type: application/json + + { + "email": "user@mygraf.com" + "name": "admin", + "login": "admin", + "theme": "light", + "orgId": 1, + "isGrafanaAdmin": true + } ### User Update @@ -822,23 +823,24 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - PUT /api/users/2 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - - { - "email":"user@mygraf.com", - "name":"User2", - "login":"user", - "theme":"light" - } + PUT /api/users/2 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "email":"user@mygraf.com", + "name":"User2", + "login":"user", + "theme":"light" + } + **Example Response**: - - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User updated"} + + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User updated"} ### Get Organisations for user @@ -847,23 +849,23 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - GET /api/users/1/orgs HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/users/1/orgs HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json + HTTP/1.1 200 + Content-Type: application/json - [ - { - "orgId":1, - "name":"Main Org.", - "role":"Admin" - } - ] + [ + { + "orgId":1, + "name":"Main Org.", + "role":"Admin" + } + ] ## User @@ -873,24 +875,24 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y **Example Request**: - GET /api/user HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + GET /api/user HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - { - "email":"admin@mygraf.com", - "name":"Admin", - "login":"admin", - "theme":"light", - "orgId":1, - "isGrafanaAdmin":true - } + HTTP/1.1 200 + Content-Type: application/json + + { + "email":"admin@mygraf.com", + "name":"Admin", + "login":"admin", + "theme":"light", + "orgId":1, + "isGrafanaAdmin":true + } ### Change Password @@ -900,22 +902,23 @@ Changes the password for the user **Example Request**: - PUT /api/user/password HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + PUT /api/user/password HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "oldPassword": "old_password", + "newPassword": "new_password", + "confirmNew": "confirm_new_password" + } - { - "password": ""new_password" - } - - **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User password updated"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"User password changed"} ### Switch user context @@ -925,17 +928,17 @@ Switch user context to the given organisation. **Example Request**: - POST /api/user/using/2 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + POST /api/user/using/2 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Active organization changed"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Active organization changed"} ### Organisations of the actual User @@ -945,23 +948,23 @@ Return a list of all organisations of the current user. **Example Request**: - GET /api/user/orgs HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + GET /api/user/orgs HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - [ - { - "orgId":1, - "name":"Main Org.", - "role":"Admin" - } - ] + HTTP/1.1 200 + Content-Type: application/json + + [ + { + "orgId":1, + "name":"Main Org.", + "role":"Admin" + } + ] ### Star a dashboard @@ -971,17 +974,17 @@ Stars the given Dashboard for the actual user. **Example Request**: - POST /api/user/stars/dashboard/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + POST /api/user/stars/dashboard/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Dashboard starred!"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Dashboard starred!"} ### Unstar a dashboard @@ -991,17 +994,17 @@ Deletes the starring of the given Dashboard for the actual user. **Example Request**: - DELETE /api/user/stars/dashboard/1 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + DELETE /api/user/stars/dashboard/1 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Dashboard unstarred"} + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Dashboard unstarred"} ## Snapshots @@ -1012,112 +1015,111 @@ Deletes the starring of the given Dashboard for the actual user. **Example Request**: - POST /api/snapshots HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - - { - "dashboard": { - "editable":false, - "hideControls":true, - "nav":[ - { - "enable":false, - "type":"timepicker" - } - ], - "rows": [ - { - - } - ], - "style":"dark", - "tags":[], - "templating":{ - "list":[ - ] - }, - "time":{ - }, - "timezone":"browser", - "title":"Home", - "version":5 - } - "expires": 3600 - } - + POST /api/snapshots HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "dashboard": { + "editable":false, + "hideControls":true, + "nav":[ + { + "enable":false, + "type":"timepicker" + } + ], + "rows": [ + { + + } + ], + "style":"dark", + "tags":[], + "templating":{ + "list":[ + ] + }, + "time":{ + }, + "timezone":"browser", + "title":"Home", + "version":5 + }, + "expires": 3600 + } + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - { - "deleteKey":"XXXXXXX", - "deleteUrl":"myurl/dashboard/snapshot/XXXXXXX", - "key":"YYYYYYY", - "url":"myurl/dashboard/snapshot/YYYYYYY" - } + HTTP/1.1 200 + Content-Type: application/json + { + "deleteKey":"XXXXXXX", + "deleteUrl":"myurl/dashboard/snapshot/XXXXXXX", + "key":"YYYYYYY", + "url":"myurl/dashboard/snapshot/YYYYYYY" + } Keys: - **deleteKey** – Key generated to delete the snapshot - **key** – Key generated to share the dashboard - + ### Get Snapshot by Id - + `GET /api/snapshots/:key` **Example Request**: - GET /api/snapshots/YYYYYYY HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + GET /api/snapshots/YYYYYYY HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - { - "meta":{ - "isSnapshot":true, - "type":"snapshot", - "canSave":false, - "canEdit":false, - "canStar":false, - "slug":"", - "expires":"2200-13-32T25:23:23+02:00", - "created":"2200-13-32T28:24:23+02:00"}, - - { - "dashboard": { - "editable":false, - "hideControls":true, - "nav":[ - { - "enable":false, - "type":"timepicker" - } - ], - "rows": [ - { - - } - ], - "style":"dark", - "tags":[], - "templating":{ - "list":[ - ] - }, - "time":{ - }, - "timezone":"browser", - "title":"Home", - "version":5 - } - } + HTTP/1.1 200 + Content-Type: application/json + + { + "meta":{ + "isSnapshot":true, + "type":"snapshot", + "canSave":false, + "canEdit":false, + "canStar":false, + "slug":"", + "expires":"2200-13-32T25:23:23+02:00", + "created":"2200-13-32T28:24:23+02:00" + }, + "dashboard": { + "editable":false, + "hideControls":true, + "nav":[ + { + "enable":false, + "type":"timepicker" + } + ], + "rows": [ + { + + } + ], + "style":"dark", + "tags":[], + "templating":{ + "list":[ + ] + }, + "time":{ + }, + "timezone":"browser", + "title":"Home", + "version":5 + } + } ### Delete Snapshot by Id @@ -1125,18 +1127,18 @@ Keys: **Example Request**: - GET /api/snapshots/YYYYYYY HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/snapshots/YYYYYYY HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"Snapshot deleted. It might take an hour before it's cleared from a CDN cache."} - + HTTP/1.1 200 + Content-Type: application/json + + {"message":"Snapshot deleted. It might take an hour before it's cleared from a CDN cache."} + ## Frontend Settings @@ -1146,45 +1148,44 @@ Keys: **Example Request**: - GET /api/frontend/settings HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/frontend/settings HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - { - "allowOrgCreate":true, - "appSubUrl":"", - "buildInfo":{ - "buildstamp":xxxxxx, - "commit":"vyyyy", - "version":"zzzzz" - }, - "datasources":{ - "datasourcename":{ - "index":"grafana-dash", - "meta":{ - "annotations":true, - "module":"plugins/datasource/grafana/datasource", - "name":"Grafana", - "partials":{ - "annotations":"app/plugins/datasource/grafana/partials/annotations.editor.html", - "config":"app/plugins/datasource/grafana/partials/config.html" - }, - "pluginType":"datasource", - "serviceName":"Grafana", - "type":"grafanasearch" - } - } - } - - defaultDatasource: "Grafana" - } - + HTTP/1.1 200 + Content-Type: application/json + + { + "allowOrgCreate":true, + "appSubUrl":"", + "buildInfo":{ + "buildstamp":xxxxxx, + "commit":"vyyyy", + "version":"zzzzz" + }, + "datasources":{ + "datasourcename":{ + "index":"grafana-dash", + "meta":{ + "annotations":true, + "module":"plugins/datasource/grafana/datasource", + "name":"Grafana", + "partials":{ + "annotations":"app/plugins/datasource/grafana/partials/annotations.editor.html", + "config":"app/plugins/datasource/grafana/partials/config.html" + }, + "pluginType":"datasource", + "serviceName":"Grafana", + "type":"grafanasearch" + } + } + }, + "defaultDatasource": "Grafana" + } + ## Login ### Renew session based on remember cookie @@ -1193,18 +1194,18 @@ Keys: **Example Request**: - GET /api/login/ping HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/login/ping HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message": "Logged in"} - + HTTP/1.1 200 + Content-Type: application/json + + {"message": "Logged in"} + ## Admin ### Settings @@ -1213,155 +1214,155 @@ Keys: **Example Request**: - GET /api/admin/settings - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + GET /api/admin/settings + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - { - "DEFAULT": - { - "app_mode":"production"}, - "analytics": - { - "google_analytics_ua_id":"", - "reporting_enabled":"false" - }, - "auth.anonymous":{ - "enabled":"true", - "org_name":"Main Org.", - "org_role":"Viewer" - }, - "auth.basic":{ - "enabled":"false" - }, - "auth.github":{ - "allow_sign_up":"false", - "allowed_domains":"", - "allowed_organizations":"", - "api_url":"https://api.github.com/user", - "auth_url":"https://github.com/login/oauth/authorize", - "client_id":"some_id", - "client_secret":"************", - "enabled":"false", - "scopes":"user:email", - "team_ids":"", - "token_url":"https://github.com/login/oauth/access_token" - }, - "auth.google":{ - "allow_sign_up":"false","allowed_domains":"", - "api_url":"https://www.googleapis.com/oauth2/v1/userinfo", - "auth_url":"https://accounts.google.com/o/oauth2/auth", - "client_id":"some_client_id", - "client_secret":"************", - "enabled":"false", - "scopes":"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", - "token_url":"https://accounts.google.com/o/oauth2/token" - }, - "auth.ldap":{ - "config_file":"/etc/grafana/ldap.toml", - "enabled":"false" - }, - "auth.proxy":{ - "auto_sign_up":"true", - "enabled":"false", - "header_name":"X-WEBAUTH-USER", - "header_property":"username" - }, - "dashboards.json":{ - "enabled":"false", - "path":"/var/lib/grafana/dashboards" - }, - "database":{ - "host":"127.0.0.1:0000", - "name":"grafana", - "password":"************", - "path":"grafana.db", - "ssl_mode":"disable", - "type":"sqlite3", - "user":"root" - }, - "emails":{ - "templates_pattern":"emails/*.html", - "welcome_email_on_sign_up":"false" - }, - "event_publisher":{ - "enabled":"false", - "exchange":"grafana_events", - "rabbitmq_url":"amqp://localhost/" - }, - "log":{ - "buffer_len":"10000", - "level":"Info", - "mode":"file" - }, - "log.console":{ - "level":"" - }, - "log.file":{ - "daily_rotate":"true", - "file_name":"", - "level":"", - "log_rotate":"true", - "max_days":"7", - "max_lines":"1000000", - "max_lines_shift":"28", - "max_size_shift":"" - }, - "paths":{ - "data":"/tsdb/grafana", - "logs":"/logs/apps/grafana"}, - "security":{ - "admin_password":"************", - "admin_user":"admin", - "cookie_remember_name":"grafana_remember", - "cookie_username":"grafana_user", - "disable_gravatar":"false", - "login_remember_days":"7", - "secret_key":"************" - }, - "server":{ - "cert_file":"", - "cert_key":"", - "domain":"mygraf.com", - "enable_gzip":"false", - "enforce_domain":"false", - "http_addr":"127.0.0.1", - "http_port":"0000", - "protocol":"http", - "root_url":"%(protocol)s://%(domain)s:%(http_port)s/", - "router_logging":"true", - "static_root_path":"public" - }, - "session":{ - "cookie_name":"grafana_sess", - "cookie_secure":"false", - "gc_interval_time":"", - "provider":"file", - "provider_config":"sessions", - "session_life_time":"86400" - }, - "smtp":{ - "cert_file":"", - "enabled":"false", - "from_address":"admin@grafana.localhost", - "host":"localhost:25", - "key_file":"", - "password":"************", - "skip_verify":"false", - "user":""}, - "users":{ - "allow_org_create":"true", - "allow_sign_up":"false", - "auto_assign_org":"true", - "auto_assign_org_role":"Viewer" - } - } + HTTP/1.1 200 + Content-Type: application/json + + { + "DEFAULT": + { + "app_mode":"production"}, + "analytics": + { + "google_analytics_ua_id":"", + "reporting_enabled":"false" + }, + "auth.anonymous":{ + "enabled":"true", + "org_name":"Main Org.", + "org_role":"Viewer" + }, + "auth.basic":{ + "enabled":"false" + }, + "auth.github":{ + "allow_sign_up":"false", + "allowed_domains":"", + "allowed_organizations":"", + "api_url":"https://api.github.com/user", + "auth_url":"https://github.com/login/oauth/authorize", + "client_id":"some_id", + "client_secret":"************", + "enabled":"false", + "scopes":"user:email", + "team_ids":"", + "token_url":"https://github.com/login/oauth/access_token" + }, + "auth.google":{ + "allow_sign_up":"false","allowed_domains":"", + "api_url":"https://www.googleapis.com/oauth2/v1/userinfo", + "auth_url":"https://accounts.google.com/o/oauth2/auth", + "client_id":"some_client_id", + "client_secret":"************", + "enabled":"false", + "scopes":"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email", + "token_url":"https://accounts.google.com/o/oauth2/token" + }, + "auth.ldap":{ + "config_file":"/etc/grafana/ldap.toml", + "enabled":"false" + }, + "auth.proxy":{ + "auto_sign_up":"true", + "enabled":"false", + "header_name":"X-WEBAUTH-USER", + "header_property":"username" + }, + "dashboards.json":{ + "enabled":"false", + "path":"/var/lib/grafana/dashboards" + }, + "database":{ + "host":"127.0.0.1:0000", + "name":"grafana", + "password":"************", + "path":"grafana.db", + "ssl_mode":"disable", + "type":"sqlite3", + "user":"root" + }, + "emails":{ + "templates_pattern":"emails/*.html", + "welcome_email_on_sign_up":"false" + }, + "event_publisher":{ + "enabled":"false", + "exchange":"grafana_events", + "rabbitmq_url":"amqp://localhost/" + }, + "log":{ + "buffer_len":"10000", + "level":"Info", + "mode":"file" + }, + "log.console":{ + "level":"" + }, + "log.file":{ + "daily_rotate":"true", + "file_name":"", + "level":"", + "log_rotate":"true", + "max_days":"7", + "max_lines":"1000000", + "max_lines_shift":"28", + "max_size_shift":"" + }, + "paths":{ + "data":"/tsdb/grafana", + "logs":"/logs/apps/grafana"}, + "security":{ + "admin_password":"************", + "admin_user":"admin", + "cookie_remember_name":"grafana_remember", + "cookie_username":"grafana_user", + "disable_gravatar":"false", + "login_remember_days":"7", + "secret_key":"************" + }, + "server":{ + "cert_file":"", + "cert_key":"", + "domain":"mygraf.com", + "enable_gzip":"false", + "enforce_domain":"false", + "http_addr":"127.0.0.1", + "http_port":"0000", + "protocol":"http", + "root_url":"%(protocol)s://%(domain)s:%(http_port)s/", + "router_logging":"true", + "static_root_path":"public" + }, + "session":{ + "cookie_name":"grafana_sess", + "cookie_secure":"false", + "gc_interval_time":"", + "provider":"file", + "provider_config":"sessions", + "session_life_time":"86400" + }, + "smtp":{ + "cert_file":"", + "enabled":"false", + "from_address":"admin@grafana.localhost", + "host":"localhost:25", + "key_file":"", + "password":"************", + "skip_verify":"false", + "user":""}, + "users":{ + "allow_org_create":"true", + "allow_sign_up":"false", + "auto_assign_org":"true", + "auto_assign_org_role":"Viewer" + } + } ### Global Users @@ -1371,24 +1372,24 @@ Create new user **Example Request**: - POST /api/admin/users HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - - { - "name":"User", - "email":"user@graf.com", - "login":"user", - "password":"userpassword" - } + POST /api/admin/users HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + + { + "name":"User", + "email":"user@graf.com", + "login":"user", + "password":"userpassword" + } **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"message":"User created"} + HTTP/1.1 200 + Content-Type: application/json + + {"id":5,"message":"User created"} ### Password for User @@ -1398,17 +1399,17 @@ Change password for specific user **Example Request**: - PUT /api/admin/users/2/password HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + PUT /api/admin/users/2/password HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {"password":"userpassword"} + HTTP/1.1 200 + Content-Type: application/json + + {"password":"userpassword"} ### Permissions @@ -1416,17 +1417,17 @@ Change password for specific user **Example Request**: - PUT /api/admin/users/2/permissions HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk - + PUT /api/admin/users/2/permissions HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {message: "User permissions updated"} + HTTP/1.1 200 + Content-Type: application/json + + {message: "User permissions updated"} ### Delete global User @@ -1434,14 +1435,14 @@ Change password for specific user **Example Request**: - DELETE /api/admin/users/2 HTTP/1.1 - Accept: application/json - Content-Type: application/json - Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + DELETE /api/admin/users/2 HTTP/1.1 + Accept: application/json + Content-Type: application/json + Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: - HTTP/1.1 200 - Content-Type: application/json - - {message: "User deleted"} + HTTP/1.1 200 + Content-Type: application/json + + {message: "User deleted"} diff --git a/docs/sources/reference/keyboard_shortcuts.md b/docs/sources/reference/keyboard_shortcuts.md index b6e199e4e70..c9da3d5c6a1 100644 --- a/docs/sources/reference/keyboard_shortcuts.md +++ b/docs/sources/reference/keyboard_shortcuts.md @@ -1,5 +1,5 @@ -page_title: Kayboard Shortcuts -page_description: Kayboard Shortcuts for Grafana +page_title: Keyboard Shortcuts +page_description: Keyboard Shortcuts for Grafana page_keywords: grafana, export, import, documentation --- @@ -17,7 +17,7 @@ Press `Shift`+`?` to open the keyboard shortcut dialog from anywhere within the |Shortcut|Action| |---|---| |`Esc`|Exit fullscreen edit/view mode, close search or any editor view| -|`CTRL`+`F`|Open dashboard search view (also contains import/playlist controls)| +|`F`|Open dashboard search view (also contains import/playlist controls)| |`CTRL`+`S`|Save dashboard| |`CTRL`+`H`|Hide row controls| |`CTRL`+`Z`|Zoom out| @@ -25,8 +25,6 @@ Press `Shift`+`?` to open the keyboard shortcut dialog from anywhere within the |`CTRL`+`O`|Enable/Disable shared graph crosshair| +**Note**: Grafana keyboard shortcuts are the same across operating system. -**Note**: Grafana keyboard shortcuts are the same across operating system. For example, `CTRL`+`F` will open the dashboard picker on a Mac as well, **not** `⌘`+`F` - - -Have a suggestion for a new keyboard shortcut? Let us know. \ No newline at end of file +Have a suggestion for a new keyboard shortcut? Let us know. diff --git a/docs/sources/reference/search.md b/docs/sources/reference/search.md index 3c4555b843e..e2d6647229c 100644 --- a/docs/sources/reference/search.md +++ b/docs/sources/reference/search.md @@ -11,7 +11,7 @@ Dashboards can be searched by the dashboard name, filtered by one (or many) tags 1. `Dashboard Picker`: The Dashboard Picker is your primary navigation tool to move between dashboards. It is present on all dashboards, and open the Dashboard Search. The dashboard picker also doubles as the title of the current dashboard. -2. `Search Bar`: The search bar allows you to enter any string and search both database and file based dashbaords in real-time. +2. `Search Bar`: The search bar allows you to enter any string and search both database and file based dashboards in real-time. 3. `Starred`: The starred link allows you to filter the list to display only starred dashboards. 4. `Tags`: The tags filter allows you to filter the list by dashboard tags. @@ -25,14 +25,14 @@ To search and load dashboards click the open folder icon in the header or use th Dashboard search is: - Real-time -- *Not* case senstitive +- *Not* case sensitive - Functional across stored *and* file based dashboards. ## Filter by Tag(s) -Tags are a great way to organize your dashboards, especially as the number of dashbaords grow. Tags can be added and managed in the dashboard `Settings`. +Tags are a great way to organize your dashboards, especially as the number of dashboards grow. Tags can be added and managed in the dashboard `Settings`. -To filter the dashboard list by tag, click on any tag appearing in the right column. The list may be further filtered by cliking on additional tags: +To filter the dashboard list by tag, click on any tag appearing in the right column. The list may be further filtered by clicking on additional tags: @@ -40,7 +40,7 @@ Alternately, to see a list of all available tags, click the tags link in the sea -When using only a keybaord: `tab` to focus on the *tags* link, `▼` down arrow key to find a tag and select with the `Enter` key. +When using only a keyboard: `tab` to focus on the *tags* link, `▼` down arrow key to find a tag and select with the `Enter` key. **Note**: When multiple tags are selected, Grafana will show dashboards that include **all**. @@ -51,4 +51,4 @@ Starring is a great way to organize and find commonly used dashboards. To show o -When using only a keybaord: `tab` to focus on the *stars* link, `▼` down arrow key to find a tag and select with the `Enter` key. \ No newline at end of file +When using only a keyboard: `tab` to focus on the *stars* link, `▼` down arrow key to find a tag and select with the `Enter` key. \ No newline at end of file diff --git a/docs/sources/reference/sharing.md b/docs/sources/reference/sharing.md index e3a6ce3f2f5..c20f4e5f67c 100644 --- a/docs/sources/reference/sharing.md +++ b/docs/sources/reference/sharing.md @@ -5,7 +5,7 @@ page_keywords: grafana, sharing, guide, documentation --- # Sharing features -Grafana provides a number of ways to share a dashboard or a specfic panel to other users within your +Grafana provides a number of ways to share a dashboard or a specific panel to other users within your organization. It also provides ways to publish interactive snapshots that can be accessed by external partners. ## Share dashboard diff --git a/docs/sources/reference/singlestat.md b/docs/sources/reference/singlestat.md index 7a7c38da289..91724e89882 100644 --- a/docs/sources/reference/singlestat.md +++ b/docs/sources/reference/singlestat.md @@ -17,11 +17,11 @@ The singlestat panel has a normal query editor to allow you define your exact me 1. `Big Value`: Big Value refers to how we display the main stat for the Singlestat Panel. This is always a single value that is displayed in the Panel in between two strings, `Prefix` and `Suffix`. The single number is calculated by choosing a function (min,max,average,current,total) of your metric query. This functions reduces your query into a single numeric value. -2. `Font Size`: You can use this section -3. `Values`: The Value fields let you set the function (min, max, average, current, total) that your entire query is reduced into a single value with. You can also set the font size of theand font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed. +2. `Font Size`: You can use this section to select the font size of the different texts in the Singlestat Panel, i.e. prefix, value and postfix. +3. `Values`: The Value fields let you set the function (min, max, average, current, total) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed. 4. `Postfixes`: The Postfix fields let you define a custom label and font-size (as a %) to appear *after* the value 5. `Units`: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value. -6. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitely. +6. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitly. ### Coloring @@ -29,9 +29,9 @@ The coloring options of the Singlestat Panel config allow you to dynamically cha -1. `Background`: This checkbox applies the configured thresholds and colors to the entirity of the Singlestat Panel background. +1. `Background`: This checkbox applies the configured thresholds and colors to the entirety of the Singlestat Panel background. 2. `Value`: This checkbox applies the configured thresholds and colors to the summary stat. -3. `Thresholds`: Change the background and value colors dyanmically within the panel, depending on the Singlestat value. The threshold field accepts **3 comma-separated** values, corresponding to the three colors directly to the right. +3. `Thresholds`: Change the background and value colors dynamically within the panel, depending on the Singlestat value. The threshold field accepts **3 comma-separated** values, corresponding to the three colors directly to the right. 4. `Colors`: Select a color and opacity 5. `Invert order`: This link toggles the threshold color order.
For example: Green, Orange, Red () will become Red, Orange, Green (). @@ -54,4 +54,21 @@ Value to text mapping allows you to translate the value of the summary stat into +## Troubleshooting +### Multiple Series Error + + + + +Grafana 2.5 introduced stricter checking for multiple-series on singlestat panels. In previous versions, the panel logic did not verify that only a single series was used, and instead, displayed the first series encountered. Depending on your data source, this could have lead to inconsistent data being shown and/or a general confusion about which metric was being displayed. + +To fix your singlestat panel: + +- Edit your panel by clicking the Panel Title and selecting *Edit*. + +- Do you have multiple queries in the metrics tab? + - Solution: Select a single query to visualize. You can toggle whether a query is visualized by clicking the eye icon on each line. If the error persists, continue to the next solution. + +- Do you have one query? + - Solution: This likely means your query is returning multiple series. You will want to reduce this down to a single series. This can be accomplished in many ways, depending on your data source. Some common practices include summing the series, averaging or any number of other functions. Consult the documentation for your data source for additional information. diff --git a/docs/sources/reference/templating.md b/docs/sources/reference/templating.md index 239cb33c378..e605af845ea 100644 --- a/docs/sources/reference/templating.md +++ b/docs/sources/reference/templating.md @@ -63,7 +63,7 @@ Once configured, Multi-Select Tagging provides a convenient way to group and you ### Interval -Use the `Interval` type to create Template variables aroundr time ranges (eg. `1m`,`1h`, `1d`). There is also a special `auto` option that will change depending on the current time range, you can specify how many times the current time range should be divided to calculate the current `auto` range. +Use the `Interval` type to create Template variables around time ranges (eg. `1m`,`1h`, `1d`). There is also a special `auto` option that will change depending on the current time range, you can specify how many times the current time range should be divided to calculate the current `auto` range. ![](/img/v2/templated_variable_parameter.png) @@ -75,7 +75,7 @@ Use the `Custom` type to manually create Template variables around explicit valu Template Variables can be very useful to dynamically change what you're visualizing on a given panel. Sometimes, you might want to create entire new Panels (or Rows) based on what Template Variables have been selected. This is now possible in Grafana 2.1. -Once you've got your Template variables (of any type) configured the way you'd like, check out the Repeating Panels and Repeating Row documentatione +Once you've got your Template variables (of any type) configured the way you'd like, check out the Repeating Panels and Repeating Row documentation ## Screencast - Templated Graphite Queries diff --git a/docs/sources/reference/timerange.md b/docs/sources/reference/timerange.md index c253e0cd64c..2ab428622bc 100644 --- a/docs/sources/reference/timerange.md +++ b/docs/sources/reference/timerange.md @@ -8,40 +8,61 @@ page_keywords: grafana, time range, guide, documentation Grafana provides numerous ways to manage the time ranges of the data being visualized, both at the Dashboard-level and the Panel-level. - + In the top right, you have the master Dashboard time picker (it's in between the 'Zoom out' and the 'Refresh' links). -From this dropdown you can: +1. `Current time range & refresh interval`: This shows the current dashboard time and refresh interval. It also acts as the menu button to toggle the time range controls. +2. `Quick ranges`: Quick ranges are preset values to choose a relative time. At this time, quick ranges are not configurable, and will appear on every dashboard. +3. `Time range`: The time range section allows you to mix both explicit and relative ranges. The explicit time range format is `YYYY-MM-DD HH:MM:SS` +4. `Refreshing every:` When enabled, auto-refresh will reload the dashboard at the specified time range. Auto-refresh is most commonly used with relative time ranges ending in `now`, so new data will appear when the dashboard refreshes. -1. Specify an exact time range (eg. "October 13 12:01 to October 14 12:05) -2. Choose a relative time (eg. "Last 15 minutes","Last 1 week") -3. Configure auto-refresh options +These settings apply to all Panels in the Dashboard (except those with Panel Time Overrides enabled) -All of this applies to all Panels in the Dashboard (except those with Panel Time Overrides enabled) +## Time Units -## Customize relative time and auto auto-refresh options +The following time units are supported: `s (seconds)`, `m (minutes)`, `h (hours)`, `d (days)`, `w (weeks)`, `M (months)`, `y (years)`. The minus operator allows you to step back in time, relative to now. If you wish to display the full period of the unit (day, week, month, etc...), append `/$unit` to the end. -It's possible to customize the options displayed for relative time and the auto-refresh options. +Take a look at some examples to seen these concepts in practice: -From Dashboard settings, click the Timepicker tab. From here you can specify the relative and auto refresh intervals. The Timepicker tab settings are saved on a per Dashboard basis. Entries are comma separated and accept a number followed by one of the following units: `s (seconds)`, `m (minutes)`, `h (hours)`, `d (days)`, `w (weeks)`, `M (months)`, `y (years)`. +Example Relative Range | From: | To: +-------------- | ----- | --- +Last 5 minutes | `now-5m` | `now` +The day so far | `now/d` | `now` +This week | `now/w` | `now/w` +Week to date | `now/w` | `now` +Previous Month | `now-1M/M` | `now-1M/M` + + +## Dashboard-Level Time Picker Settings + +There are two settings available from the Dashboard Settings area, allowing customization of the auto-refresh intervals and the definition of `now`. +### Auto-Refresh Options + +It's possible to customize the options displayed for relative time and the auto-refresh options. + +From Dashboard settings, click the Timepicker tab. From here you can specify the relative and auto-refresh intervals. The Timepicker tab settings are saved on a per Dashboard basis. Entries are comma separated and accept any valid time unit. + +### Defining Now + +Users often ask, [when will then be now](https://www.youtube.com/watch?v=VeZ9HhHU86o)? Grafana offers the ability to override the `now` value on a per dashboard basis. Most commonly, this feature is used to accommodate known delays in data aggregation to avoid null values. ## Panel time overrides & timeshift -In Grafana v2.x you can now override the relative time range for individual panels, causing them to be different than what is selected in the Dashboard time picker in the upper right. You can also add a time shift to individual panels. This allows you to show metrics from different time periods or days at the same time. +You can override the relative time range for individual panels, causing them to be different than what is selected in the Dashboard time picker in the upper right. This allows you to show metrics from different time periods or days at the same time. -You control these overrides in panel editor mode and the new tab `Time Range`. +You control these overrides in panel editor mode and the tab `Time Range`. -When you zoom or change the Dashboard time to a custom absolute time range, all panel overrides will be disabled. The panel relative time override is only active when the dashboard time is also relative. The panel timeshift override however is always active, even when the dashboard time is absolute. +When you zoom or change the Dashboard time to a custom absolute time range, all panel overrides will be disabled. The panel relative time override is only active when the dashboard time is also relative. The panel timeshift override is always active, even when the dashboard time is absolute. -The `Hide time override info` option allows you to hide the the override info text that is by default shown in the +The `Hide time override info` option allows you to hide the override info text that is by default shown in the upper right of a panel when overridden time range options. -Currently you can only override the dashboard time with relative time ranges, not absolute time ranges. +Note: You can only override the dashboard time with relative time ranges. Absolute time ranges are not available. diff --git a/docs/sources/tutorials/hubot_howto.md b/docs/sources/tutorials/hubot_howto.md index b2f53d0bece..85ebb3e7c85 100644 --- a/docs/sources/tutorials/hubot_howto.md +++ b/docs/sources/tutorials/hubot_howto.md @@ -64,13 +64,13 @@ The `hubot-grafana` plugin requires a number of environment variables to be set The hubot plugin will take advantage of the Grafana server side rendering feature that can render any panel on the server using phantomjs. Grafana ships with a phantomjs binary (linux only). -To verify that this freature works try the `Direct link to rendered image` link in the panel share dialog. +To verify that this feature works try the `Direct link to rendered image` link in the panel share dialog. If you do not get an image when opening this link verify that the required font packages are installed for phantomjs to work. ### Grafana API Key You need to set the environment variable `HUBOT_GRAFANA_API_KEY` to a Grafana API Key. -You can add these from the API Keys page wich you find in the Organization dropdown. +You can add these from the API Keys page which you find in the Organization dropdown. ### Amazon S3 The `S3` options are optional but for the images to work properly in services like Slack and Hipchat they need @@ -118,7 +118,7 @@ Now you can add an alias like this: ## Summary -Grafana is going to ship with integrated Slack and Hiptchat features some day but you do +Grafana is going to ship with integrated Slack and Hipchat features some day but you do not have to wait for that. Grafana 2 shipped with a very clever server side rendering feature that can render any panel to a png using phantomjs. The hubot plugin for Grafana is something you can install and use today! diff --git a/docs/sources/tutorials/stack_guide_graphite.md b/docs/sources/tutorials/stack_guide_graphite.md index a9025cf9a71..1145cab2249 100644 --- a/docs/sources/tutorials/stack_guide_graphite.md +++ b/docs/sources/tutorials/stack_guide_graphite.md @@ -27,7 +27,7 @@ that is not really the case, or, at least, that it is a lot better than you expe To begin with we are going to install the 3 main components that define our metric stack. Later in the guide we will install StatsD, but that is optional. -- Carbon is the graphite ingestion deamon responsible for +- Carbon is the graphite ingestion daemon responsible for receiving metrics and storing them. - Graphite-api is light weight version of graphite-web with only the HTTP api and is responsible for executing metric queries. @@ -90,7 +90,7 @@ pattern = .* retentions = 10s:1d,1m:7d,10m:1y ``` -This config specifies the resolution of metrics and the retention periods. For example for all metrics begining with the word `carbon` receive metrics every minute and store for 30 days, then +This config specifies the resolution of metrics and the retention periods. For example for all metrics beginning with the word `carbon` receive metrics every minute and store for 30 days, then roll them up into 10 minute buckets and store those for 1 year, then roll those up into 1 hour buckets and store those for 5 years. For all other metrics the default rule will be applied with other retention periods. @@ -206,7 +206,7 @@ Reload supervisor supervisorctl reload -A carbon-cache deamon and graphite-api should now be running. Type `supervisorctl status` to verify that they are running. You can +A carbon-cache daemon and graphite-api should now be running. Type `supervisorctl status` to verify that they are running. You can also open `http://your_server_ip:8888/metrics/find?query?*` in your browser. You should see a json snippet. @@ -243,12 +243,12 @@ Open http://your_server_ip:3000 in your browser and login with the default user - Select `Add Panel` > `Graph` from the row menu - An empty graph panel should appear with title `no title (click here)`. Click on this title and then `Edit` - This will open the graph in edit mode and take you to the metrics tab. -- There is one query already added (asigned letter A) but it is empty. +- There is one query already added (assigned letter A) but it is empty. - Click on `select metric` to pick the first graphite metric node. A new `select metric` link will appear until you reached a leaf node. - Try picking the metric paths for `carbon.agents..cpuUsage`, you should now see a line appear in the graph! ## Writing metrics to Graphite -Graphite has the simples metric write protocol imaginable. Something that has surely contributed to its wide adoption by metric +Graphite has the simplest metric write protocol imaginable. Something that has surely contributed to its wide adoption by metric frameworks and numerous integrations. prod.server1.requests.count 10 1398969187 diff --git a/docs/sources/versions.html_fragment b/docs/sources/versions.html_fragment index 55190af8b37..3733641ac79 100644 --- a/docs/sources/versions.html_fragment +++ b/docs/sources/versions.html_fragment @@ -1,3 +1,4 @@ +
  • Version v2.5
  • Version v2.1
  • Version v2.0
  • Version v1.9
  • diff --git a/main.go b/main.go index 9639d432bea..4a052ea4934 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "io/ioutil" "os" "os/signal" @@ -27,6 +28,7 @@ import ( var version = "master" var commit = "NA" var buildstamp string +var build_date string var configFile = flag.String("config", "", "path to config file") var homePath = flag.String("homepath", "", "path to grafana install/home path, defaults to working directory") @@ -38,6 +40,14 @@ func init() { } func main() { + + v := flag.Bool("v", false, "prints current version and exits") + flag.Parse() + if *v { + fmt.Printf("Version %s (commit: %s)\n", version, commit) + os.Exit(0) + } + buildstampInt64, _ := strconv.ParseInt(buildstamp, 10, 64) setting.BuildVersion = version diff --git a/package.json b/package.json index 047f30f7ed0..75136e48f1a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "2.5.0-pre1", + "version": "2.6.0-pre1", "repository": { "type": "git", "url": "http://github.com/torkelo/grafana.git" @@ -21,7 +21,7 @@ "grunt-contrib-connect": "~0.5.0", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-cssmin": "~0.6.1", - "grunt-contrib-htmlmin": "~0.1.3", + "grunt-contrib-htmlmin": "~0.6.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-less": "~0.7.0", "grunt-contrib-requirejs": "~0.4.4", diff --git a/packaging/deb/systemd/grafana-server.service b/packaging/deb/systemd/grafana-server.service index 16b975f23ea..dd5d2097149 100644 --- a/packaging/deb/systemd/grafana-server.service +++ b/packaging/deb/systemd/grafana-server.service @@ -14,7 +14,7 @@ ExecStart=/usr/sbin/grafana-server \ --config=${CONF_FILE} \ --pidfile=${PID_FILE} \ cfg:default.paths.logs=${LOG_DIR} \ - cfg:default.paths.data=${DATA_DIR} \ + cfg:default.paths.data=${DATA_DIR} LimitNOFILE=10000 TimeoutStopSec=20 UMask=0027 diff --git a/packaging/publish/publish.sh b/packaging/publish/publish.sh new file mode 100755 index 00000000000..abccf74aa4b --- /dev/null +++ b/packaging/publish/publish.sh @@ -0,0 +1,17 @@ +#! /usr/bin/env bash + +version=2.5.0 + +wget https://grafanarel.s3.amazonaws.com/builds/grafana_${version}_amd64.deb + +package_cloud push grafana/stable/debian/jessie grafana_${version}_amd64.deb +package_cloud push grafana/stable/debian/wheezy grafana_${version}_amd64.deb +package_cloud push grafana/testing/debian/jessie grafana_${version}_amd64.deb +package_cloud push grafana/testing/debian/wheezy grafana_${version}_amd64.deb + +wget https://grafanarel.s3.amazonaws.com/builds/grafana-${version}-1.x86_64.rpm + +package_cloud push grafana/testing/el/6 grafana-${version}-1.x86_64.rpm +package_cloud push grafana/testing/el/7 grafana-${version}-1.x86_64.rpm +package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm +package_cloud push grafana/stable/el/6 grafana-${version}-1.x86_64.rpm diff --git a/packaging/rpm/systemd/grafana-server.service b/packaging/rpm/systemd/grafana-server.service index 855dce53d08..fb2ec24d123 100644 --- a/packaging/rpm/systemd/grafana-server.service +++ b/packaging/rpm/systemd/grafana-server.service @@ -14,7 +14,7 @@ ExecStart=/usr/sbin/grafana-server \ --config=${CONF_FILE} \ --pidfile=${PID_FILE} \ cfg:default.paths.logs=${LOG_DIR} \ - cfg:default.paths.data=${DATA_DIR} \ + cfg:default.paths.data=${DATA_DIR} LimitNOFILE=10000 TimeoutStopSec=20 diff --git a/pkg/api/admin_settings.go b/pkg/api/admin_settings.go index 06413d6a0b1..1f800cfe558 100644 --- a/pkg/api/admin_settings.go +++ b/pkg/api/admin_settings.go @@ -17,7 +17,7 @@ func AdminGetSettings(c *middleware.Context) { for _, key := range section.Keys() { keyName := key.Name() value := key.Value() - if strings.Contains(keyName, "secret") || strings.Contains(keyName, "password") || (strings.Contains(keyName, "provider_config") && strings.Contains(value, "@")) { + if strings.Contains(keyName, "secret") || strings.Contains(keyName, "password") || (strings.Contains(keyName, "provider_config")) { value = "************" } diff --git a/pkg/api/admin_users.go b/pkg/api/admin_users.go index a293032c200..7690630aaa2 100644 --- a/pkg/api/admin_users.go +++ b/pkg/api/admin_users.go @@ -37,7 +37,14 @@ func AdminCreateUser(c *middleware.Context, form dtos.AdminCreateUserForm) { metrics.M_Api_Admin_User_Create.Inc(1) - c.JsonOK("User created") + user := cmd.Result + + result := m.UserIdDTO{ + Message: "User created", + Id: user.Id, + } + + c.JSON(200, result) } func AdminUpdateUserPassword(c *middleware.Context, form dtos.AdminUpdateUserPasswordForm) { diff --git a/pkg/api/api.go b/pkg/api/api.go index 27eb3c749db..3d1b28d7aa3 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -40,7 +40,9 @@ func Register(r *macaron.Macaron) { r.Get("/admin/users/edit/:id", reqGrafanaAdmin, Index) r.Get("/admin/orgs", reqGrafanaAdmin, Index) r.Get("/admin/orgs/edit/:id", reqGrafanaAdmin, Index) + r.Get("/dashboard/*", reqSignedIn, Index) + r.Get("/dashboard-solo/*", reqSignedIn, Index) // sign up r.Get("/signup", Index) @@ -146,7 +148,7 @@ func Register(r *macaron.Macaron) { r.Post("/", quota("data_source"), bind(m.AddDataSourceCommand{}), AddDataSource) r.Put("/:id", bind(m.UpdateDataSourceCommand{}), UpdateDataSource) r.Delete("/:id", DeleteDataSource) - r.Get("/:id", GetDataSourceById) + r.Get("/:id", wrap(GetDataSourceById)) r.Get("/plugins", GetDataSourcePlugins) }, regOrgAdmin) diff --git a/pkg/api/cloudwatch/cloudwatch.go b/pkg/api/cloudwatch/cloudwatch.go index 536a81ee3fe..f4cde0ebd6a 100644 --- a/pkg/api/cloudwatch/cloudwatch.go +++ b/pkg/api/cloudwatch/cloudwatch.go @@ -7,9 +7,14 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/cloudwatch" "github.com/aws/aws-sdk-go/service/ec2" "github.com/grafana/grafana/pkg/middleware" + m "github.com/grafana/grafana/pkg/models" ) type actionHandler func(*cwRequest, *middleware.Context) @@ -17,9 +22,10 @@ type actionHandler func(*cwRequest, *middleware.Context) var actionHandlers map[string]actionHandler type cwRequest struct { - Region string `json:"region"` - Action string `json:"action"` - Body []byte `json:"-"` + Region string `json:"region"` + Action string `json:"action"` + Body []byte `json:"-"` + DataSource *m.DataSource } func init() { @@ -35,7 +41,20 @@ func init() { } func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) { - svc := cloudwatch.New(&aws.Config{Region: aws.String(req.Region)}) + sess := session.New() + creds := credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: req.DataSource.Database}, + &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(sess), ExpiryWindow: 5 * time.Minute}, + }) + + cfg := &aws.Config{ + Region: aws.String(req.Region), + Credentials: creds, + } + + svc := cloudwatch.New(session.New(cfg), cfg) reqParam := &struct { Parameters struct { @@ -70,7 +89,21 @@ func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) { } func handleListMetrics(req *cwRequest, c *middleware.Context) { - svc := cloudwatch.New(&aws.Config{Region: aws.String(req.Region)}) + sess := session.New() + creds := credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: req.DataSource.Database}, + &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(sess), ExpiryWindow: 5 * time.Minute}, + }) + + cfg := &aws.Config{ + Region: aws.String(req.Region), + Credentials: creds, + } + + svc := cloudwatch.New(session.New(cfg), cfg) + reqParam := &struct { Parameters struct { Namespace string `json:"namespace"` @@ -78,7 +111,6 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) { Dimensions []*cloudwatch.DimensionFilter `json:"dimensions"` } `json:"parameters"` }{} - json.Unmarshal(req.Body, reqParam) params := &cloudwatch.ListMetricsInput{ @@ -97,7 +129,20 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) { } func handleDescribeInstances(req *cwRequest, c *middleware.Context) { - svc := ec2.New(&aws.Config{Region: aws.String(req.Region)}) + sess := session.New() + creds := credentials.NewChainCredentials( + []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: req.DataSource.Database}, + &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(sess), ExpiryWindow: 5 * time.Minute}, + }) + + cfg := &aws.Config{ + Region: aws.String(req.Region), + Credentials: creds, + } + + svc := ec2.New(session.New(cfg), cfg) reqParam := &struct { Parameters struct { @@ -112,7 +157,7 @@ func handleDescribeInstances(req *cwRequest, c *middleware.Context) { params.Filters = reqParam.Parameters.Filters } if len(reqParam.Parameters.InstanceIds) > 0 { - params.InstanceIDs = reqParam.Parameters.InstanceIds + params.InstanceIds = reqParam.Parameters.InstanceIds } resp, err := svc.DescribeInstances(params) @@ -124,9 +169,10 @@ func handleDescribeInstances(req *cwRequest, c *middleware.Context) { c.JSON(200, resp) } -func HandleRequest(c *middleware.Context) { +func HandleRequest(c *middleware.Context, ds *m.DataSource) { var req cwRequest req.Body, _ = ioutil.ReadAll(c.Req.Request.Body) + req.DataSource = ds json.Unmarshal(req.Body, &req) if handler, found := actionHandlers[req.Action]; !found { diff --git a/pkg/api/cloudwatch/metrics.go b/pkg/api/cloudwatch/metrics.go index 6d6ff10dfb9..40cf974298d 100644 --- a/pkg/api/cloudwatch/metrics.go +++ b/pkg/api/cloudwatch/metrics.go @@ -2,6 +2,7 @@ package cloudwatch import ( "encoding/json" + "sort" "github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/util" @@ -15,6 +16,7 @@ func init() { "AWS/AutoScaling": {"GroupMinSize", "GroupMaxSize", "GroupDesiredCapacity", "GroupInServiceInstances", "GroupPendingInstances", "GroupStandbyInstances", "GroupTerminatingInstances", "GroupTotalInstances"}, "AWS/Billing": {"EstimatedCharges"}, "AWS/EC2": {"CPUCreditUsage", "CPUCreditBalance", "CPUUtilization", "DiskReadOps", "DiskWriteOps", "DiskReadBytes", "DiskWriteBytes", "NetworkIn", "NetworkOut", "StatusCheckFailed", "StatusCheckFailed_Instance", "StatusCheckFailed_System"}, + "AWS/ECS": {"CPUUtilization", "MemoryUtilization"}, "AWS/CloudFront": {"Requests", "BytesDownloaded", "BytesUploaded", "TotalErrorRate", "4xxErrorRate", "5xxErrorRate"}, "AWS/CloudSearch": {"SuccessfulRequests", "SearchableDocuments", "IndexUtilization", "Partitions"}, "AWS/DynamoDB": {"ConditionalCheckFailedRequests", "ConsumedReadCapacityUnits", "ConsumedWriteCapacityUnits", "OnlineIndexConsumedWriteCapacity", "OnlineIndexPercentageProgress", "OnlineIndexThrottleEvents", "ProvisionedReadCapacityUnits", "ProvisionedWriteCapacityUnits", "ReadThrottleEvents", "ReturnedItemCount", "SuccessfulRequestLatency", "SystemErrors", "ThrottledRequests", "UserErrors", "WriteThrottleEvents"}, @@ -48,6 +50,7 @@ func init() { "AWS/ElastiCache": {"CacheClusterId", "CacheNodeId"}, "AWS/EBS": {"VolumeId"}, "AWS/EC2": {"AutoScalingGroupName", "ImageId", "InstanceId", "InstanceType"}, + "AWS/ECS": {"ClusterName", "ServiceName"}, "AWS/ELB": {"LoadBalancerName", "AvailabilityZone"}, "AWS/ElasticMapReduce": {"ClusterId", "JobId"}, "AWS/Kinesis": {"StreamName"}, @@ -65,10 +68,12 @@ func init() { } } +// Whenever this list is updated, frontend list should also be updated. +// Please update the region list in public/app/plugins/datasource/cloudwatch/partials/config.html func handleGetRegions(req *cwRequest, c *middleware.Context) { regions := []string{ - "us-west-2", "us-west-1", "eu-west-1", "eu-central-1", "ap-southeast-1", - "ap-southeast-2", "ap-northeast-1", "sa-east-1", + "ap-northeast-1", "ap-southeast-1", "ap-southeast-2", "cn-north-1", + "eu-central-1", "eu-west-1", "sa-east-1", "us-east-1", "us-west-1", "us-west-2", } result := []interface{}{} @@ -80,8 +85,14 @@ func handleGetRegions(req *cwRequest, c *middleware.Context) { } func handleGetNamespaces(req *cwRequest, c *middleware.Context) { - result := []interface{}{} + keys := []string{} for key := range metricsMap { + keys = append(keys, key) + } + sort.Sort(sort.StringSlice(keys)) + + result := []interface{}{} + for _, key := range keys { result = append(result, util.DynMap{"text": key, "value": key}) } diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index d7f9f2cd740..6490a118861 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -56,7 +56,9 @@ func GetDashboard(c *middleware.Context) { Type: m.DashTypeDB, CanStar: c.IsSignedIn, CanSave: c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR, - CanEdit: c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR || c.OrgRole == m.ROLE_READ_ONLY_EDITOR, + CanEdit: canEditDashboard(c.OrgRole), + Created: dash.Created, + Updated: dash.Updated, }, } @@ -122,6 +124,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) { c.JSON(200, util.DynMap{"status": "success", "slug": cmd.Result.Slug, "version": cmd.Result.Version}) } +func canEditDashboard(role m.RoleType) bool { + return role == m.ROLE_ADMIN || role == m.ROLE_EDITOR || role == m.ROLE_READ_ONLY_EDITOR +} + func GetHomeDashboard(c *middleware.Context) { filePath := path.Join(setting.StaticRootPath, "dashboards/home.json") file, err := os.Open(filePath) @@ -132,6 +138,7 @@ func GetHomeDashboard(c *middleware.Context) { dash := dtos.DashboardFullWithMeta{} dash.Meta.IsHome = true + dash.Meta.CanEdit = canEditDashboard(c.OrgRole) jsonParser := json.NewDecoder(file) if err := jsonParser.Decode(&dash.Dashboard); err != nil { c.JsonApiErr(500, "Failed to load home dashboard", err) @@ -152,6 +159,7 @@ func GetDashboardFromJsonFile(c *middleware.Context) { dash := dtos.DashboardFullWithMeta{Dashboard: dashboard.Data} dash.Meta.Type = m.DashTypeJson + dash.Meta.CanEdit = canEditDashboard(c.OrgRole) c.JSON(200, &dash) } diff --git a/pkg/api/dataproxy.go b/pkg/api/dataproxy.go index 3aa215eac15..7193198155f 100644 --- a/pkg/api/dataproxy.go +++ b/pkg/api/dataproxy.go @@ -97,7 +97,7 @@ func ProxyDataSourceRequest(c *middleware.Context) { } if ds.Type == m.DS_CLOUDWATCH { - cloudwatch.HandleRequest(c) + cloudwatch.HandleRequest(c, ds) } else { proxyPath := c.Params("*") proxy := NewReverseProxy(ds, proxyPath, targetUrl) diff --git a/pkg/api/datasources.go b/pkg/api/datasources.go index 717211d438d..38a4004c241 100644 --- a/pkg/api/datasources.go +++ b/pkg/api/datasources.go @@ -37,20 +37,22 @@ func GetDataSources(c *middleware.Context) { c.JSON(200, result) } -func GetDataSourceById(c *middleware.Context) { +func GetDataSourceById(c *middleware.Context) Response { query := m.GetDataSourceByIdQuery{ Id: c.ParamsInt64(":id"), OrgId: c.OrgId, } if err := bus.Dispatch(&query); err != nil { - c.JsonApiErr(500, "Failed to query datasources", err) - return + if err == m.ErrDataSourceNotFound { + return ApiError(404, "Data source not found", nil) + } + return ApiError(500, "Failed to query datasources", err) } ds := query.Result - c.JSON(200, &dtos.DataSource{ + return Json(200, &dtos.DataSource{ Id: ds.Id, OrgId: ds.OrgId, Name: ds.Name, diff --git a/pkg/api/dtos/models.go b/pkg/api/dtos/models.go index 9a4400adbdf..7af4c84f56d 100644 --- a/pkg/api/dtos/models.go +++ b/pkg/api/dtos/models.go @@ -40,6 +40,7 @@ type DashboardMeta struct { Slug string `json:"slug"` Expires time.Time `json:"expires"` Created time.Time `json:"created"` + Updated time.Time `json:"updated"` } type DashboardFullWithMeta struct { diff --git a/pkg/login/ldap.go b/pkg/login/ldap.go index af9982e77df..355b4fd100a 100644 --- a/pkg/login/ldap.go +++ b/pkg/login/ldap.go @@ -2,8 +2,10 @@ package login import ( "crypto/tls" + "crypto/x509" "errors" "fmt" + "io/ioutil" "strings" "github.com/davecgh/go-spew/spew" @@ -24,18 +26,37 @@ func NewLdapAuthenticator(server *LdapServerConf) *ldapAuther { } func (a *ldapAuther) Dial() error { - address := fmt.Sprintf("%s:%d", a.server.Host, a.server.Port) var err error - if a.server.UseSSL { - tlsCfg := &tls.Config{ - InsecureSkipVerify: a.server.SkipVerifySSL, - ServerName: a.server.Host, + var certPool *x509.CertPool + if a.server.RootCACert != "" { + certPool := x509.NewCertPool() + for _, caCertFile := range strings.Split(a.server.RootCACert, " ") { + if pem, err := ioutil.ReadFile(caCertFile); err != nil { + return err + } else { + if !certPool.AppendCertsFromPEM(pem) { + return errors.New("Failed to append CA certficate " + caCertFile) + } + } } - a.conn, err = ldap.DialTLS("tcp", address, tlsCfg) - } else { - a.conn, err = ldap.Dial("tcp", address) } + for _, host := range strings.Split(a.server.Host, " ") { + address := fmt.Sprintf("%s:%d", host, a.server.Port) + if a.server.UseSSL { + tlsCfg := &tls.Config{ + InsecureSkipVerify: a.server.SkipVerifySSL, + ServerName: host, + RootCAs: certPool, + } + a.conn, err = ldap.DialTLS("tcp", address, tlsCfg) + } else { + a.conn, err = ldap.Dial("tcp", address) + } + if err == nil { + return nil + } + } return err } @@ -290,18 +311,56 @@ func (a *ldapAuther) searchForUser(username string) (*ldapUserInfo, error) { return nil, errors.New("Ldap search matched more than one entry, please review your filter setting") } + var memberOf []string + if a.server.GroupSearchFilter == "" { + memberOf = getLdapAttrArray(a.server.Attr.MemberOf, searchResult) + } else { + // If we are using a POSIX LDAP schema it won't support memberOf, so we manually search the groups + var groupSearchResult *ldap.SearchResult + for _, groupSearchBase := range a.server.GroupSearchBaseDNs { + filter := strings.Replace(a.server.GroupSearchFilter, "%s", username, -1) + + if ldapCfg.VerboseLogging { + log.Info("LDAP: Searching for user's groups: %s", filter) + } + + groupSearchReq := ldap.SearchRequest{ + BaseDN: groupSearchBase, + Scope: ldap.ScopeWholeSubtree, + DerefAliases: ldap.NeverDerefAliases, + Attributes: []string{ + // Here MemberOf would be the thing that identifies the group, which is normally 'cn' + a.server.Attr.MemberOf, + }, + Filter: filter, + } + + groupSearchResult, err = a.conn.Search(&groupSearchReq) + if err != nil { + return nil, err + } + + if len(groupSearchResult.Entries) > 0 { + for i := range groupSearchResult.Entries { + memberOf = append(memberOf, getLdapAttrN(a.server.Attr.MemberOf, groupSearchResult, i)) + } + break + } + } + } + return &ldapUserInfo{ DN: searchResult.Entries[0].DN, LastName: getLdapAttr(a.server.Attr.Surname, searchResult), FirstName: getLdapAttr(a.server.Attr.Name, searchResult), Username: getLdapAttr(a.server.Attr.Username, searchResult), Email: getLdapAttr(a.server.Attr.Email, searchResult), - MemberOf: getLdapAttrArray(a.server.Attr.MemberOf, searchResult), + MemberOf: memberOf, }, nil } -func getLdapAttr(name string, result *ldap.SearchResult) string { - for _, attr := range result.Entries[0].Attributes { +func getLdapAttrN(name string, result *ldap.SearchResult, n int) string { + for _, attr := range result.Entries[n].Attributes { if attr.Name == name { if len(attr.Values) > 0 { return attr.Values[0] @@ -311,6 +370,10 @@ func getLdapAttr(name string, result *ldap.SearchResult) string { return "" } +func getLdapAttr(name string, result *ldap.SearchResult) string { + return getLdapAttrN(name, result, 0) +} + func getLdapAttrArray(name string, result *ldap.SearchResult) []string { for _, attr := range result.Entries[0].Attributes { if attr.Name == name { diff --git a/pkg/login/settings.go b/pkg/login/settings.go index 93ff04054c1..b181dac3281 100644 --- a/pkg/login/settings.go +++ b/pkg/login/settings.go @@ -19,6 +19,7 @@ type LdapServerConf struct { Port int `toml:"port"` UseSSL bool `toml:"use_ssl"` SkipVerifySSL bool `toml:"ssl_skip_verify"` + RootCACert string `toml:"root_ca_cert"` BindDN string `toml:"bind_dn"` BindPassword string `toml:"bind_password"` Attr LdapAttributeMap `toml:"attributes"` @@ -26,6 +27,9 @@ type LdapServerConf struct { SearchFilter string `toml:"search_filter"` SearchBaseDNs []string `toml:"search_base_dns"` + GroupSearchFilter string `toml:"group_search_filter"` + GroupSearchBaseDNs []string `toml:"group_search_base_dns"` + LdapGroups []*LdapGroupToOrgRole `toml:"group_mappings"` } diff --git a/pkg/metrics/report_usage.go b/pkg/metrics/report_usage.go index 065c83d3b8f..abda18d12b7 100644 --- a/pkg/metrics/report_usage.go +++ b/pkg/metrics/report_usage.go @@ -67,7 +67,7 @@ func sendUsageStats() { // as sending that name could be sensitive information dsOtherCount := 0 for _, dsStat := range dsStats.Result { - if m.IsStandardDataSource(dsStat.Type) { + if m.IsKnownDataSourcePlugin(dsStat.Type) { metrics["stats.ds."+dsStat.Type+".count"] = dsStat.Count } else { dsOtherCount += dsStat.Count diff --git a/pkg/middleware/logger.go b/pkg/middleware/logger.go index 5b1132e111e..eb5c7b8dde4 100644 --- a/pkg/middleware/logger.go +++ b/pkg/middleware/logger.go @@ -22,6 +22,7 @@ import ( "github.com/Unknwon/macaron" "github.com/grafana/grafana/pkg/log" + "github.com/grafana/grafana/pkg/setting" ) func Logger() macaron.Handler { @@ -36,7 +37,9 @@ func Logger() macaron.Handler { switch rw.Status() { case 200, 304: content = fmt.Sprintf("%s", content) - return + if !setting.RouterLogging { + return + } case 404: content = fmt.Sprintf("%s", content) case 500: diff --git a/pkg/models/dashboards.go b/pkg/models/dashboards.go index 7d4a2690556..5b926c3e314 100644 --- a/pkg/models/dashboards.go +++ b/pkg/models/dashboards.go @@ -43,6 +43,8 @@ func NewDashboard(title string) *Dashboard { dash.Data = make(map[string]interface{}) dash.Data["title"] = title dash.Title = title + dash.Created = time.Now() + dash.Updated = time.Now() dash.UpdateSlug() return dash } @@ -73,9 +75,12 @@ func NewDashboardFromJson(data map[string]interface{}) *Dashboard { if dash.Data["version"] != nil { dash.Version = int(dash.Data["version"].(float64)) + dash.Updated = time.Now() } } else { dash.Data["version"] = 0 + dash.Created = time.Now() + dash.Updated = time.Now() } return dash diff --git a/pkg/models/datasource.go b/pkg/models/datasource.go index 35b623ce30a..38273598ab1 100644 --- a/pkg/models/datasource.go +++ b/pkg/models/datasource.go @@ -47,23 +47,25 @@ type DataSource struct { Updated time.Time } -func IsStandardDataSource(dsType string) bool { - switch dsType { - case DS_ES: - return true - case DS_INFLUXDB: - return true - case DS_OPENTSDB: - return true - case DS_CLOUDWATCH: - return true - case DS_PROMETHEUS: - return true - case DS_GRAPHITE: - return true - default: - return false - } +var knownDatasourcePlugins map[string]bool = map[string]bool{ + DS_ES: true, + DS_GRAPHITE: true, + DS_INFLUXDB: true, + DS_INFLUXDB_08: true, + DS_KAIROSDB: true, + DS_CLOUDWATCH: true, + DS_PROMETHEUS: true, + DS_OPENTSDB: true, + "opennms": true, + "druid": true, + "dalmatinerdb": true, + "gnocci": true, + "zabbix": true, +} + +func IsKnownDataSourcePlugin(dsType string) bool { + _, exists := knownDatasourcePlugins[dsType] + return exists } // ---------------------- diff --git a/pkg/models/user.go b/pkg/models/user.go index 64067d59654..2842bad490d 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -157,3 +157,8 @@ type UserSearchHitDTO struct { Email string `json:"email"` IsAdmin bool `json:"isAdmin"` } + +type UserIdDTO struct { + Id int64 `json:"id"` + Message string `json:"message"` +} diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index 2f7e5264e53..665cf6a36ca 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -91,7 +91,6 @@ func (scanner *PluginScanner) loadPluginJson(path string) error { if !exists { return errors.New("Did not find type property in plugin.json") } - DataSources[datasourceType.(string)] = pluginJson } diff --git a/pkg/services/sqlstore/user.go b/pkg/services/sqlstore/user.go index 6c6f581dcc4..96b8c24b8fc 100644 --- a/pkg/services/sqlstore/user.go +++ b/pkg/services/sqlstore/user.go @@ -321,7 +321,7 @@ func DeleteUser(cmd *m.DeleteUserCommand) error { return inTransaction(func(sess *xorm.Session) error { deletes := []string{ "DELETE FROM star WHERE user_id = ?", - "DELETE FROM user WHERE id = ?", + "DELETE FROM " + dialect.Quote("user") + " WHERE id = ?", } for _, sql := range deletes { diff --git a/pkg/social/social.go b/pkg/social/social.go index 1a00934b937..4a8cb8bac5d 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -193,7 +193,7 @@ func (s *SocialGithub) FetchPrivateEmail(client *http.Client) (string, error) { Verified bool `json:"verified"` } - emailsUrl := fmt.Sprintf("https://api.github.com/user/emails") + emailsUrl := fmt.Sprintf(s.apiUrl + "/emails") r, err := client.Get(emailsUrl) if err != nil { return "", err @@ -222,7 +222,7 @@ func (s *SocialGithub) FetchTeamMemberships(client *http.Client) ([]int, error) Id int `json:"id"` } - membershipUrl := fmt.Sprintf("https://api.github.com/user/teams") + membershipUrl := fmt.Sprintf(s.apiUrl + "/teams") r, err := client.Get(membershipUrl) if err != nil { return nil, err @@ -249,7 +249,7 @@ func (s *SocialGithub) FetchOrganizations(client *http.Client) ([]string, error) Login string `json:"login"` } - url := fmt.Sprintf("https://api.github.com/user/orgs") + url := fmt.Sprintf(s.apiUrl + "/orgs") r, err := client.Get(url) if err != nil { return nil, err diff --git a/public/app/app.js b/public/app/app.js index 4f30df34d89..0637b3aeea7 100644 --- a/public/app/app.js +++ b/public/app/app.js @@ -3,14 +3,12 @@ define([ 'jquery', 'lodash', 'require', - 'config', 'bootstrap', 'angular-route', 'angular-sanitize', 'angular-strap', 'angular-dragdrop', 'angular-ui', - 'extend-jquery', 'bindonce', 'app/core/core', ], @@ -71,10 +69,7 @@ function (angular, $, _, appLevelRequire) { }); var preBootRequires = [ - 'app/services/all', 'app/features/all', - 'app/controllers/all', - 'app/components/partials', ]; app.boot = function() { @@ -100,12 +95,7 @@ function (angular, $, _, appLevelRequire) { var $scope = this; $scope.requireContext(deps, function () { var deps = _.toArray(arguments); - // Check that this is a valid scope. - if($scope.$id) { - $scope.$apply(function () { - fn.apply($scope, deps); - }); - } + fn.apply($scope, deps); }); }; }]); diff --git a/public/app/components/kbn.js b/public/app/components/kbn.js deleted file mode 100644 index 5b9516bc82f..00000000000 --- a/public/app/components/kbn.js +++ /dev/null @@ -1,460 +0,0 @@ -define([ - 'jquery', - 'lodash', -], -function($, _) { - 'use strict'; - - var kbn = {}; - kbn.valueFormats = {}; - - kbn.round_interval = function(interval) { - switch (true) { - // 0.5s - case (interval <= 500): - return 100; // 0.1s - // 5s - case (interval <= 5000): - return 1000; // 1s - // 7.5s - case (interval <= 7500): - return 5000; // 5s - // 15s - case (interval <= 15000): - return 10000; // 10s - // 45s - case (interval <= 45000): - return 30000; // 30s - // 3m - case (interval <= 180000): - return 60000; // 1m - // 9m - case (interval <= 450000): - return 300000; // 5m - // 20m - case (interval <= 1200000): - return 600000; // 10m - // 45m - case (interval <= 2700000): - return 1800000; // 30m - // 2h - case (interval <= 7200000): - return 3600000; // 1h - // 6h - case (interval <= 21600000): - return 10800000; // 3h - // 24h - case (interval <= 86400000): - return 43200000; // 12h - // 48h - case (interval <= 172800000): - return 86400000; // 24h - // 1w - case (interval <= 604800000): - return 86400000; // 24h - // 3w - case (interval <= 1814400000): - return 604800000; // 1w - // 2y - case (interval < 3628800000): - return 2592000000; // 30d - default: - return 31536000000; // 1y - } - }; - - kbn.secondsToHms = function(seconds) { - var numyears = Math.floor(seconds / 31536000); - if(numyears){ - return numyears + 'y'; - } - var numdays = Math.floor((seconds % 31536000) / 86400); - if(numdays){ - return numdays + 'd'; - } - var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600); - if(numhours){ - return numhours + 'h'; - } - var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60); - if(numminutes){ - return numminutes + 'm'; - } - var numseconds = Math.floor((((seconds % 31536000) % 86400) % 3600) % 60); - if(numseconds){ - return numseconds + 's'; - } - var nummilliseconds = Math.floor(seconds * 1000.0); - if(nummilliseconds){ - return nummilliseconds + 'ms'; - } - - return 'less then a millisecond'; //'just now' //or other string you like; - }; - - kbn.to_percent = function(number,outof) { - return Math.floor((number/outof)*10000)/100 + "%"; - }; - - kbn.addslashes = function(str) { - str = str.replace(/\\/g, '\\\\'); - str = str.replace(/\'/g, '\\\''); - str = str.replace(/\"/g, '\\"'); - str = str.replace(/\0/g, '\\0'); - return str; - }; - - kbn.interval_regex = /(\d+(?:\.\d+)?)([Mwdhmsy])/; - - // histogram & trends - kbn.intervals_in_seconds = { - y: 31536000, - M: 2592000, - w: 604800, - d: 86400, - h: 3600, - m: 60, - s: 1 - }; - - kbn.calculateInterval = function(range, resolution, userInterval) { - var lowLimitMs = 1; // 1 millisecond default low limit - var intervalMs, lowLimitInterval; - - if (userInterval) { - if (userInterval[0] === '>') { - lowLimitInterval = userInterval.slice(1); - lowLimitMs = kbn.interval_to_ms(lowLimitInterval); - } - else { - return userInterval; - } - } - - intervalMs = kbn.round_interval((range.to.valueOf() - range.from.valueOf()) / resolution); - if (lowLimitMs > intervalMs) { - intervalMs = lowLimitMs; - } - - return kbn.secondsToHms(intervalMs / 1000); - }; - - kbn.describe_interval = function (string) { - var matches = string.match(kbn.interval_regex); - if (!matches || !_.has(kbn.intervals_in_seconds, matches[2])) { - throw new Error('Invalid interval string, expexcting a number followed by one of "Mwdhmsy"'); - } else { - return { - sec: kbn.intervals_in_seconds[matches[2]], - type: matches[2], - count: parseInt(matches[1], 10) - }; - } - }; - - kbn.interval_to_ms = function(string) { - var info = kbn.describe_interval(string); - return info.sec * 1000 * info.count; - }; - - kbn.interval_to_seconds = function (string) { - var info = kbn.describe_interval(string); - return info.sec * info.count; - }; - - kbn.query_color_dot = function (color, diameter) { - return '
    '; - }; - - kbn.valueFormats.percent = function(size, decimals) { - return kbn.toFixed(size, decimals) + '%'; - }; - - kbn.formatFuncCreator = function(factor, extArray) { - return function(size, decimals, scaledDecimals) { - if (size === null) { - return ""; - } - - var steps = 0; - var limit = extArray.length; - - while (Math.abs(size) >= factor) { - steps++; - size /= factor; - - if (steps >= limit) { return "NA"; } - } - - if (steps > 0 && scaledDecimals !== null) { - decimals = scaledDecimals + (3 * steps); - } - - return kbn.toFixed(size, decimals) + extArray[steps]; - }; - }; - - kbn.toFixed = function(value, decimals) { - if (value === null) { - return ""; - } - - var factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1; - var formatted = String(Math.round(value * factor) / factor); - - // if exponent return directly - if (formatted.indexOf('e') !== -1 || value === 0) { - return formatted; - } - - // If tickDecimals was specified, ensure that we have exactly that - // much precision; otherwise default to the value's own precision. - if (decimals != null) { - var decimalPos = formatted.indexOf("."); - var precision = decimalPos === -1 ? 0 : formatted.length - decimalPos - 1; - if (precision < decimals) { - return (precision ? formatted : formatted + ".") + (String(factor)).substr(1, decimals - precision); - } - } - - return formatted; - }; - - kbn.valueFormats.bits = kbn.formatFuncCreator(1024, [' b', ' Kib', ' Mib', ' Gib', ' Tib', ' Pib', ' Eib', ' Zib', ' Yib']); - kbn.valueFormats.bytes = kbn.formatFuncCreator(1024, [' B', ' KiB', ' MiB', ' GiB', ' TiB', ' PiB', ' EiB', ' ZiB', ' YiB']); - kbn.valueFormats.kbytes = kbn.formatFuncCreator(1024, [' KiB', ' MiB', ' GiB', ' TiB', ' PiB', ' EiB', ' ZiB', ' YiB']); - kbn.valueFormats.mbytes = kbn.formatFuncCreator(1024, [' MiB', ' GiB', ' TiB', ' PiB', ' EiB', ' ZiB', ' YiB']); - kbn.valueFormats.gbytes = kbn.formatFuncCreator(1024, [' GiB', ' TiB', ' PiB', ' EiB', ' ZiB', ' YiB']); - kbn.valueFormats.bps = kbn.formatFuncCreator(1000, [' bps', ' Kbps', ' Mbps', ' Gbps', ' Tbps', ' Pbps', ' Ebps', ' Zbps', ' Ybps']); - kbn.valueFormats.pps = kbn.formatFuncCreator(1000, [' pps', ' Kpps', ' Mpps', ' Gpps', ' Tpps', ' Ppps', ' Epps', ' Zpps', ' Ypps']); - kbn.valueFormats.Bps = kbn.formatFuncCreator(1000, [' Bps', ' KBps', ' MBps', ' GBps', ' TBps', ' PBps', ' EBps', ' ZBps', ' YBps']); - kbn.valueFormats.short = kbn.formatFuncCreator(1000, ['', ' K', ' Mil', ' Bil', ' Tri', ' Quadr', ' Quint', ' Sext', ' Sept']); - kbn.valueFormats.joule = kbn.formatFuncCreator(1000, [' J', ' kJ', ' MJ', ' GJ', ' TJ', ' PJ', ' EJ', ' ZJ', ' YJ']); - kbn.valueFormats.amp = kbn.formatFuncCreator(1000, [' A', ' kA', ' MA', ' GA', ' TA', ' PA', ' EA', ' ZA', ' YA']); - kbn.valueFormats.volt = kbn.formatFuncCreator(1000, [' V', ' kV', ' MV', ' GV', ' TV', ' PV', ' EV', ' ZV', ' YV']); - kbn.valueFormats.hertz = kbn.formatFuncCreator(1000, [' Hz', ' kHz', ' MHz', ' GHz', ' THz', ' PHz', ' EHz', ' ZHz', ' YHz']); - kbn.valueFormats.watt = kbn.formatFuncCreator(1000, [' W', ' kW', ' MW', ' GW', ' TW', ' PW', ' EW', ' ZW', ' YW']); - kbn.valueFormats.kwatt = kbn.formatFuncCreator(1000, [' kW', ' MW', ' GW', ' TW', ' PW', ' EW', ' ZW', ' YW']); - kbn.valueFormats.watth = kbn.formatFuncCreator(1000, [' Wh', ' kWh', ' MWh', ' GWh', ' TWh', ' PWh', ' EWh', ' ZWh', ' YWh']); - kbn.valueFormats.kwatth = kbn.formatFuncCreator(1000, [' kWh', ' MWh', ' GWh', ' TWh', ' PWh', ' EWh', ' ZWh', ' YWh']); - kbn.valueFormats.ev = kbn.formatFuncCreator(1000, [' eV', ' keV', ' MeV', 'GeV', 'TeV', 'PeV', 'EeV', 'ZeV', 'YeV']); - kbn.valueFormats.none = kbn.toFixed; - kbn.valueFormats.celsius = function(value, decimals) { return kbn.toFixed(value, decimals) + ' °C'; }; - kbn.valueFormats.farenheit = function(value, decimals) { return kbn.toFixed(value, decimals) + ' °F'; }; - kbn.valueFormats.humidity = function(value, decimals) { return kbn.toFixed(value, decimals) + ' %H'; }; - kbn.valueFormats.pressurembar = function(value, decimals) { return kbn.toFixed(value, decimals) + ' mbar'; }; - kbn.valueFormats.pressurehpa = function(value, decimals) { return kbn.toFixed(value, decimals) + ' hPa'; }; - kbn.valueFormats.ppm = function(value, decimals) { return kbn.toFixed(value, decimals) + ' ppm'; }; - kbn.valueFormats.velocityms = function(value, decimals) { return kbn.toFixed(value, decimals) + ' m/s'; }; - kbn.valueFormats.velocitykmh = function(value, decimals) { return kbn.toFixed(value, decimals) + ' km/h'; }; - kbn.valueFormats.velocitymph = function(value, decimals) { return kbn.toFixed(value, decimals) + ' mph'; }; - kbn.valueFormats.velocityknot = function(value, decimals) { return kbn.toFixed(value, decimals) + ' kn'; }; - - kbn.roundValue = function (num, decimals) { - if (num === null) { return null; } - var n = Math.pow(10, decimals); - return Math.round((n * num).toFixed(decimals)) / n; - }; - - kbn.toFixedScaled = function(value, decimals, scaledDecimals, additionalDecimals, ext) { - if (scaledDecimals === null) { - return kbn.toFixed(value, decimals) + ext; - } else { - return kbn.toFixed(value, scaledDecimals + additionalDecimals) + ext; - } - }; - - kbn.valueFormats.ms = function(size, decimals, scaledDecimals) { - if (size === null) { return ""; } - - if (Math.abs(size) < 1000) { - return kbn.toFixed(size, decimals) + " ms"; - } - // Less than 1 min - else if (Math.abs(size) < 60000) { - return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " s"); - } - // Less than 1 hour, devide in minutes - else if (Math.abs(size) < 3600000) { - return kbn.toFixedScaled(size / 60000, decimals, scaledDecimals, 5, " min"); - } - // Less than one day, devide in hours - else if (Math.abs(size) < 86400000) { - return kbn.toFixedScaled(size / 3600000, decimals, scaledDecimals, 7, " hour"); - } - // Less than one year, devide in days - else if (Math.abs(size) < 31536000000) { - return kbn.toFixedScaled(size / 86400000, decimals, scaledDecimals, 8, " day"); - } - - return kbn.toFixedScaled(size / 31536000000, decimals, scaledDecimals, 10, " year"); - }; - - kbn.valueFormats.s = function(size, decimals, scaledDecimals) { - if (size === null) { return ""; } - - if (Math.abs(size) < 600) { - return kbn.toFixed(size, decimals) + " s"; - } - // Less than 1 hour, devide in minutes - else if (Math.abs(size) < 3600) { - return kbn.toFixedScaled(size / 60, decimals, scaledDecimals, 1, " min"); - } - // Less than one day, devide in hours - else if (Math.abs(size) < 86400) { - return kbn.toFixedScaled(size / 3600, decimals, scaledDecimals, 4, " hour"); - } - // Less than one week, devide in days - else if (Math.abs(size) < 604800) { - return kbn.toFixedScaled(size / 86400, decimals, scaledDecimals, 5, " day"); - } - // Less than one year, devide in week - else if (Math.abs(size) < 31536000) { - return kbn.toFixedScaled(size / 604800, decimals, scaledDecimals, 6, " week"); - } - - return kbn.toFixedScaled(size / 3.15569e7, decimals, scaledDecimals, 7, " year"); - }; - - kbn.valueFormats['µs'] = function(size, decimals, scaledDecimals) { - if (size === null) { return ""; } - - if (Math.abs(size) < 1000) { - return kbn.toFixed(size, decimals) + " µs"; - } - else if (Math.abs(size) < 1000000) { - return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " ms"); - } - else { - return kbn.toFixedScaled(size / 1000000, decimals, scaledDecimals, 6, " s"); - } - }; - - kbn.valueFormats.ns = function(size, decimals, scaledDecimals) { - if (size === null) { return ""; } - - if (Math.abs(size) < 1000) { - return kbn.toFixed(size, decimals) + " ns"; - } - else if (Math.abs(size) < 1000000) { - return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " µs"); - } - else if (Math.abs(size) < 1000000000) { - return kbn.toFixedScaled(size / 1000000, decimals, scaledDecimals, 6, " ms"); - } - else if (Math.abs(size) < 60000000000){ - return kbn.toFixedScaled(size / 1000000000, decimals, scaledDecimals, 9, " s"); - } - else { - return kbn.toFixedScaled(size / 60000000000, decimals, scaledDecimals, 12, " min"); - } - }; - - kbn.slugifyForUrl = function(str) { - return str - .toLowerCase() - .replace(/[^\w ]+/g,'') - .replace(/ +/g,'-'); - }; - - kbn.exportSeriesListToCsv = function(seriesList) { - var text = 'Series;Time;Value\n'; - _.each(seriesList, function(series) { - _.each(series.datapoints, function(dp) { - text += series.alias + ';' + new Date(dp[1]).toISOString() + ';' + dp[0] + '\n'; - }); - }); - var blob = new Blob([text], { type: "text/csv;charset=utf-8" }); - window.saveAs(blob, 'grafana_data_export.csv'); - }; - - kbn.stringToJsRegex = function(str) { - if (str[0] !== '/') { - return new RegExp(str); - } - - var match = str.match(new RegExp('^/(.*?)/(g?i?m?y?)$')); - return new RegExp(match[1], match[2]); - }; - - kbn.getUnitFormats = function() { - return [ - { - text: 'none', - submenu: [ - {text: 'none' , value: 'none'}, - {text: 'short', value: 'short'}, - {text: 'percent', value: 'percent'}, - {text: 'ppm', value: 'ppm'}, - {text: 'dB', value: 'dB'}, - ] - }, - { - text: 'duration', - submenu: [ - {text: 'nanoseconds (ns)' , value: 'ns'}, - {text: 'microseconds (µs)', value: 'µs'}, - {text: 'milliseconds (ms)', value: 'ms'}, - {text: 'seconds (s)', value: 's'}, - {text: 'Hertz (1/s)', value: 'hertz'}, - ] - }, - { - text: 'data', - submenu: [ - {text: 'bits', value: 'bits'}, - {text: 'bytes', value: 'bytes'}, - {text: 'kilobytes', value: 'kbytes'}, - {text: 'megabytes', value: 'mbytes'}, - {text: 'gigabytes', value: 'gbytes'}, - ] - }, - { - text: 'data rate', - submenu: [ - {text: 'packets/sec', value: 'pps'}, - {text: 'bits/sec', value: 'bps'}, - {text: 'bytes/sec', value: 'Bps'}, - ] - }, - { - text: 'energy', - submenu: [ - {text: 'watt (W)', value: 'watt'}, - {text: 'kilowatt (kW)', value: 'kwatt'}, - {text: 'watt-hour (Wh)', value: 'watth'}, - {text: 'kilowatt-hour (kWh)', value: 'kwatth'}, - {text: 'joule (J)', value: 'joule'}, - {text: 'electron volt (eV)', value: 'ev'}, - {text: 'Ampere (A)', value: 'amp'}, - {text: 'Volt (V)', value: 'volt'}, - ] - }, - { - text: 'weather', - submenu: [ - {text: 'Celcius (°C)', value: 'celsius' }, - {text: 'Farenheit (°F)', value: 'farenheit'}, - {text: 'Humidity (%H)', value: 'humidity' }, - {text: 'Pressure (mbar)', value: 'pressurembar' }, - {text: 'Pressure (hPa)', value: 'pressurehpa' }, - ] - }, - { - text: 'velocity', - submenu: [ - {text: 'm/s', value: 'velocityms' }, - {text: 'km/h', value: 'velocitykmh' }, - {text: 'mph', value: 'velocitymph' }, - {text: 'knot (kn)', value: 'velocityknot' }, - ] - }, - ]; - }; - - return kbn; -}); diff --git a/public/app/components/settings.js b/public/app/components/settings.js deleted file mode 100644 index a9e1d382dd5..00000000000 --- a/public/app/components/settings.js +++ /dev/null @@ -1,57 +0,0 @@ -define([ - 'lodash', -], -function (_) { - "use strict"; - - return function Settings (options) { - /** - * To add a setting, you MUST define a default. Also, - * THESE ARE ONLY DEFAULTS. - * They are overridden by config.js in the root directory - * @type {Object} - */ - var defaults = { - datasources : {}, - window_title_prefix : 'Grafana - ', - panels : { - 'graph': { path: 'app/panels/graph', name: 'Graph' }, - 'singlestat': { path: 'app/panels/singlestat', name: 'Single stat' }, - 'text': { path: 'app/panels/text', name: 'Text' }, - 'dashlist': { path: 'app/panels/dashlist', name: 'Dashboard list' }, - }, - new_panel_title: 'no title (click here)', - plugins: {}, - default_route: '/dashboard/file/default.json', - playlist_timespan: "1m", - unsaved_changes_warning: true, - search: { max_results: 100 }, - appSubUrl: "" - }; - - var settings = _.extend({}, defaults, options); - - // var parseBasicAuth = function(datasource) { - // var passwordEnd = datasource.url.indexOf('@'); - // if (passwordEnd > 0) { - // var userStart = datasource.url.indexOf('//') + 2; - // var userAndPassword = datasource.url.substring(userStart, passwordEnd); - // var bytes = crypto.charenc.Binary.stringToBytes(userAndPassword); - // datasource.basicAuth = crypto.util.bytesToBase64(bytes); - // - // var urlHead = datasource.url.substring(0, userStart); - // datasource.url = urlHead + datasource.url.substring(passwordEnd + 1); - // } - // - // return datasource; - // }; - // - // _.each(settings.datasources, function(datasource, key) { - // datasource.name = key; - // if (datasource.url) { parseBasicAuth(datasource); } - // if (datasource.type === 'influxdb') { parseMultipleHosts(datasource); } - // }); - - return settings; - }; -}); diff --git a/public/app/controllers/all.js b/public/app/controllers/all.js deleted file mode 100644 index 1a313e6b019..00000000000 --- a/public/app/controllers/all.js +++ /dev/null @@ -1,12 +0,0 @@ -define([ - './grafanaCtrl', - './search', - './inspectCtrl', - './jsonEditorCtrl', - './loginCtrl', - './invitedCtrl', - './signupCtrl', - './resetPasswordCtrl', - './sidemenuCtrl', - './errorCtrl', -], function () {}); diff --git a/public/app/controllers/console-ctrl.js b/public/app/controllers/console-ctrl.js deleted file mode 100644 index 8a673d99476..00000000000 --- a/public/app/controllers/console-ctrl.js +++ /dev/null @@ -1,108 +0,0 @@ -define([ - 'angular', - 'lodash', - 'moment', - 'store' -], -function (angular, _, moment, store) { - 'use strict'; - - var module = angular.module('grafana.controllers'); - var consoleEnabled = store.getBool('grafanaConsole'); - - if (!consoleEnabled) { - return; - } - - var events = []; - - function ConsoleEvent(type, title, data) { - this.type = type; - this.title = title; - this.data = data; - this.time = moment().format('hh:mm:ss'); - - if (data.config) { - this.method = data.config.method; - this.elapsed = (new Date().getTime() - data.config.$grafana_timestamp) + ' ms'; - if (data.config.params && data.config.params.q) { - this.field2 = data.config.params.q; - } - if (_.isString(data.config.data)) { - this.field2 = data.config.data; - } - if (data.status !== 200) { - this.error = true; - this.field3 = data.data; - } - - if (_.isArray(data.data)) { - this.extractTimeseriesInfo(data.data); - } - } - } - - ConsoleEvent.prototype.extractTimeseriesInfo = function(series) { - if (series.length === 0) { - return; - } - - var points = 0; - var ok = false; - - if (series[0].datapoints) { - points = _.reduce(series, function(memo, val) { - return memo + val.datapoints.length; - }, 0); - ok = true; - } - if (series[0].columns) { - points = _.reduce(series, function(memo, val) { - return memo + val.points.length; - }, 0); - ok = true; - } - - if (ok) { - this.field1 = '(' + series.length + ' series'; - this.field1 += ', ' + points + ' points)'; - } - }; - - module.config(function($provide, $httpProvider) { - $provide.factory('mupp', function($q) { - return { - 'request': function(config) { - if (config.inspect) { - config.$grafana_timestamp = new Date().getTime(); - } - return config; - }, - 'response': function(response) { - if (response.config.inspect) { - events.push(new ConsoleEvent(response.config.inspect.type, response.config.url, response)); - } - return response; - }, - 'requestError': function(rejection) { - console.log('requestError', rejection); - return $q.reject(rejection); - }, - 'responseError': function (rejection) { - var inspect = rejection.config.inspect || { type: 'error' }; - events.push(new ConsoleEvent(inspect.type, rejection.config.url, rejection)); - return $q.reject(rejection); - } - }; - }); - - $httpProvider.interceptors.push('mupp'); - }); - - module.controller('ConsoleCtrl', function($scope) { - - $scope.events = events; - - }); - -}); diff --git a/public/app/controllers/metricKeys.js b/public/app/controllers/metricKeys.js deleted file mode 100644 index be743112cf8..00000000000 --- a/public/app/controllers/metricKeys.js +++ /dev/null @@ -1,186 +0,0 @@ -define([ - 'angular', - 'lodash', - 'config' -], -function (angular, _, config) { - 'use strict'; - - var module = angular.module('grafana.controllers'); - - module.controller('MetricKeysCtrl', function($scope, $http, $q) { - var elasticSearchUrlForMetricIndex = config.elasticsearch + '/' + config.grafana_metrics_index + '/'; - var httpOptions = {}; - if (config.elasticsearchBasicAuth) { - httpOptions.withCredentials = true; - httpOptions.headers = { - "Authorization": "Basic " + config.elasticsearchBasicAuth - }; - } - $scope.init = function () { - $scope.metricPath = "prod.apps.api.boobarella.*"; - $scope.metricCounter = 0; - }; - - $scope.createIndex = function () { - $scope.errorText = null; - $scope.infoText = null; - - deleteIndex() - .then(createIndex) - .then(function () { - $scope.infoText = "Index created!"; - }) - .then(null, function (err) { - $scope.errorText = angular.toJson(err); - }); - }; - - $scope.loadMetricsFromPath = function() { - $scope.errorText = null; - $scope.infoText = null; - $scope.metricCounter = 0; - - return loadMetricsRecursive($scope.metricPath) - .then(function() { - $scope.infoText = "Indexing completed!"; - }, function(err) { - $scope.errorText = "Error: " + err; - }); - }; - - $scope.loadAll = function() { - $scope.infoText = "Fetching all metrics from graphite..."; - - getFromEachGraphite('/metrics/index.json', saveMetricsArray) - .then(function() { - $scope.infoText = "Indexing complete!"; - }).then(null, function(err) { - $scope.errorText = err; - }); - }; - - function getFromEachGraphite(request, data_callback, error_callback) { - return $q.all(_.map(config.datasources, function(datasource) { - if (datasource.type = 'graphite') { - return $http.get(datasource.url + request) - .then(data_callback, error_callback); - } - })); - } - - function saveMetricsArray(data, currentIndex) { - if (!data && !data.data && data.data.length === 0) { - return $q.reject('No metrics from graphite'); - } - - if (data.data.length === currentIndex) { - return $q.when('done'); - } - - currentIndex = currentIndex || 0; - - return saveMetricKey(data.data[currentIndex]) - .then(function() { - return saveMetricsArray(data, currentIndex + 1); - }); - } - - function deleteIndex() - { - var deferred = $q.defer(); - $http.delete(elasticSearchUrlForMetricIndex, httpOptions) - .success(function() { - deferred.resolve('ok'); - }) - .error(function(data, status) { - if (status === 404) { - deferred.resolve('ok'); - } - else { - deferred.reject('elastic search returned unexpected error'); - } - }); - - return deferred.promise; - } - - function createIndex() - { - return $http.put(elasticSearchUrlForMetricIndex, { - settings: { - analysis: { - analyzer: { - metric_path_ngram : { tokenizer : "my_ngram_tokenizer" } - }, - tokenizer: { - my_ngram_tokenizer : { - type : "nGram", - min_gram : "3", - max_gram : "8", - token_chars: ["letter", "digit", "punctuation", "symbol"] - } - } - } - }, - mappings: { - metricKey: { - properties: { - metricPath: { - type: "multi_field", - fields: { - "metricPath": { type: "string", index: "analyzed", index_analyzer: "standard" }, - "metricPath_ng": { type: "string", index: "analyzed", index_analyzer: "metric_path_ngram" } - } - } - } - } - } - }, httpOptions); - } - - function receiveMetric(result) { - var data = result.data; - if (!data || data.length === 0) { - console.log('no data'); - return; - } - - var funcs = _.map(data, function(metric) { - if (metric.expandable) { - return loadMetricsRecursive(metric.id + ".*"); - } - if (metric.leaf) { - return saveMetricKey(metric.id); - } - }); - - return $q.all(funcs); - } - - function saveMetricKey(metricId) { - - // Create request with id as title. Rethink this. - var request = $scope.ejs.Document(config.grafana_metrics_index, 'metricKey', metricId).source({ - metricPath: metricId - }); - - return request.doIndex( - function() { - $scope.infoText = "Indexing " + metricId; - $scope.metricCounter = $scope.metricCounter + 1; - }, - function() { - $scope.errorText = "failed to save metric " + metricId; - } - ); - } - - function loadMetricsRecursive(metricPath) - { - return getFromEachGraphite('/metrics/find/?query=' + metricPath, receiveMetric); - } - - }); - -}); diff --git a/public/app/components/config.js b/public/app/core/config.js similarity index 88% rename from public/app/components/config.js rename to public/app/core/config.js index e26a55e097b..f8e7bb228a2 100644 --- a/public/app/components/config.js +++ b/public/app/core/config.js @@ -1,5 +1,5 @@ define([ - 'settings', + 'app/core/settings', ], function (Settings) { "use strict"; diff --git a/public/app/core/controllers/all.js b/public/app/core/controllers/all.js new file mode 100644 index 00000000000..d22010cffdc --- /dev/null +++ b/public/app/core/controllers/all.js @@ -0,0 +1,12 @@ +define([ + './grafana_ctrl', + './search_ctrl', + './inspect_ctrl', + './json_editor_ctrl', + './login_ctrl', + './invited_ctrl', + './signup_ctrl', + './reset_password_ctrl', + './sidemenu_ctrl', + './error_ctrl', +], function () {}); diff --git a/public/app/controllers/errorCtrl.js b/public/app/core/controllers/error_ctrl.js similarity index 60% rename from public/app/controllers/errorCtrl.js rename to public/app/core/controllers/error_ctrl.js index 13b64584226..9816928fa6c 100644 --- a/public/app/controllers/errorCtrl.js +++ b/public/app/core/controllers/error_ctrl.js @@ -1,13 +1,11 @@ define([ 'angular', - 'lodash' + '../core_module', ], -function (angular) { +function (angular, coreModule) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('ErrorCtrl', function($scope, contextSrv) { + coreModule.controller('ErrorCtrl', function($scope, contextSrv) { var showSideMenu = contextSrv.sidemenu; contextSrv.sidemenu = false; diff --git a/public/app/controllers/grafanaCtrl.js b/public/app/core/controllers/grafana_ctrl.js similarity index 94% rename from public/app/controllers/grafanaCtrl.js rename to public/app/core/controllers/grafana_ctrl.js index 77c4d5f70c5..baafd15938e 100644 --- a/public/app/controllers/grafanaCtrl.js +++ b/public/app/core/controllers/grafana_ctrl.js @@ -1,16 +1,15 @@ define([ 'angular', - 'config', 'lodash', 'jquery', - 'store', + '../core_module', + 'app/core/config', + 'app/core/store', ], -function (angular, config, _, $, store) { +function (angular, _, $, coreModule, config, store) { "use strict"; - var module = angular.module('grafana.controllers'); - - module.controller('GrafanaCtrl', function($scope, alertSrv, utilSrv, $rootScope, $controller, contextSrv) { + coreModule.controller('GrafanaCtrl', function($scope, alertSrv, utilSrv, $rootScope, $controller, contextSrv) { $scope.init = function() { $scope.contextSrv = contextSrv; diff --git a/public/app/controllers/inspectCtrl.js b/public/app/core/controllers/inspect_ctrl.js similarity index 92% rename from public/app/controllers/inspectCtrl.js rename to public/app/core/controllers/inspect_ctrl.js index e70a88323e9..81cfaf64a85 100644 --- a/public/app/controllers/inspectCtrl.js +++ b/public/app/core/controllers/inspect_ctrl.js @@ -2,13 +2,12 @@ define([ 'angular', 'lodash', 'jquery', + '../core_module', ], -function (angular, _, $) { +function (angular, _, $, coreModule) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('InspectCtrl', function($scope) { + coreModule.controller('InspectCtrl', function($scope) { var model = $scope.inspector; function getParametersFromQueryString(queryString) { diff --git a/public/app/controllers/invitedCtrl.js b/public/app/core/controllers/invited_ctrl.js similarity index 81% rename from public/app/controllers/invitedCtrl.js rename to public/app/core/controllers/invited_ctrl.js index 0b4a096fb1b..540cb01ca1c 100644 --- a/public/app/controllers/invitedCtrl.js +++ b/public/app/core/controllers/invited_ctrl.js @@ -1,16 +1,13 @@ define([ 'angular', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, config) { +function (angular, coreModule, config) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('InvitedCtrl', function($scope, $routeParams, contextSrv, backendSrv) { - + coreModule.controller('InvitedCtrl', function($scope, $routeParams, contextSrv, backendSrv) { contextSrv.sidemenu = false; - $scope.formModel = {}; $scope.init = function() { diff --git a/public/app/controllers/jsonEditorCtrl.js b/public/app/core/controllers/json_editor_ctrl.js similarity index 68% rename from public/app/controllers/jsonEditorCtrl.js rename to public/app/core/controllers/json_editor_ctrl.js index 60bda8514b7..0bfd5fcfb05 100644 --- a/public/app/controllers/jsonEditorCtrl.js +++ b/public/app/core/controllers/json_editor_ctrl.js @@ -1,13 +1,11 @@ define([ 'angular', - 'lodash' + '../core_module', ], -function (angular) { +function (angular, coreModule) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('JsonEditorCtrl', function($scope) { + coreModule.controller('JsonEditorCtrl', function($scope) { $scope.json = angular.toJson($scope.object, true); $scope.canUpdate = $scope.updateHandler !== void 0; diff --git a/public/app/controllers/loginCtrl.js b/public/app/core/controllers/login_ctrl.js similarity index 91% rename from public/app/controllers/loginCtrl.js rename to public/app/core/controllers/login_ctrl.js index 0ee370fb979..22cb2c6f04b 100644 --- a/public/app/controllers/loginCtrl.js +++ b/public/app/core/controllers/login_ctrl.js @@ -1,13 +1,12 @@ define([ 'angular', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, config) { +function (angular, coreModule, config) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('LoginCtrl', function($scope, backendSrv, contextSrv, $location) { + coreModule.controller('LoginCtrl', function($scope, backendSrv, contextSrv, $location) { $scope.formModel = { user: '', email: '', diff --git a/public/app/controllers/resetPasswordCtrl.js b/public/app/core/controllers/reset_password_ctrl.js similarity index 84% rename from public/app/controllers/resetPasswordCtrl.js rename to public/app/core/controllers/reset_password_ctrl.js index ed693f0d45a..d414b059458 100644 --- a/public/app/controllers/resetPasswordCtrl.js +++ b/public/app/core/controllers/reset_password_ctrl.js @@ -1,13 +1,11 @@ define([ 'angular', + '../core_module', ], -function (angular) { +function (angular, coreModule) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) { - + coreModule.controller('ResetPasswordCtrl', function($scope, contextSrv, backendSrv, $location) { contextSrv.sidemenu = false; $scope.formModel = {}; $scope.mode = 'send'; diff --git a/public/app/controllers/search.js b/public/app/core/controllers/search_ctrl.js similarity index 94% rename from public/app/controllers/search.js rename to public/app/core/controllers/search_ctrl.js index 279b3a1d793..bbf869b9f38 100644 --- a/public/app/controllers/search.js +++ b/public/app/core/controllers/search_ctrl.js @@ -1,14 +1,13 @@ define([ 'angular', 'lodash', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, _, config) { +function (angular, _, coreModule, config) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('SearchCtrl', function($scope, $location, $timeout, backendSrv) { + coreModule.controller('SearchCtrl', function($scope, $location, $timeout, backendSrv) { $scope.init = function() { $scope.giveSearchFocus = 0; diff --git a/public/app/controllers/sidemenuCtrl.js b/public/app/core/controllers/sidemenu_ctrl.js similarity index 93% rename from public/app/controllers/sidemenuCtrl.js rename to public/app/core/controllers/sidemenu_ctrl.js index b7ba32f0d35..c2ee868323f 100644 --- a/public/app/controllers/sidemenuCtrl.js +++ b/public/app/core/controllers/sidemenu_ctrl.js @@ -2,14 +2,13 @@ define([ 'angular', 'lodash', 'jquery', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, _, $, config) { +function (angular, _, $, coreModule, config) { 'use strict'; - var module = angular.module('grafana.controllers'); - - module.controller('SideMenuCtrl', function($scope, $location, contextSrv, backendSrv) { + coreModule.controller('SideMenuCtrl', function($scope, $location, contextSrv, backendSrv) { $scope.getUrl = function(url) { return config.appSubUrl + url; diff --git a/public/app/controllers/signupCtrl.ts b/public/app/core/controllers/signup_ctrl.ts similarity index 85% rename from public/app/controllers/signupCtrl.ts rename to public/app/core/controllers/signup_ctrl.ts index d59f1f0eb68..9c18b121612 100644 --- a/public/app/controllers/signupCtrl.ts +++ b/public/app/core/controllers/signup_ctrl.ts @@ -1,9 +1,8 @@ -/// +/// import angular = require('angular'); -import config = require('config'); - -var module = angular.module('grafana.controllers'); +import config = require('app/core/config'); +import coreModule = require('../core_module'); export class SignUpCtrl { @@ -48,5 +47,5 @@ export class SignUpCtrl { }; } -module.controller('SignUpCtrl', SignUpCtrl); +coreModule.controller('SignUpCtrl', SignUpCtrl); diff --git a/public/app/core/core.ts b/public/app/core/core.ts index 98f487b236f..9b726de271a 100644 --- a/public/app/core/core.ts +++ b/public/app/core/core.ts @@ -16,6 +16,11 @@ /// /// +/// +/// +/// +/// + export * from './directives/array_join' export * from './directives/give_focus' export * from './filters/filters' diff --git a/public/app/core/directives/dash_upload.js b/public/app/core/directives/dash_upload.js index 4a42d38eea7..ed4253c71ca 100644 --- a/public/app/core/directives/dash_upload.js +++ b/public/app/core/directives/dash_upload.js @@ -1,8 +1,8 @@ define([ - 'kbn', '../core_module', + 'app/core/utils/kbn', ], -function (kbn, coreModule) { +function (coreModule, kbn) { 'use strict'; coreModule.directive('dashUpload', function(timer, alertSrv, $location) { diff --git a/public/app/core/directives/dropdown_typeahead.js b/public/app/core/directives/dropdown_typeahead.js index c306b9ff8e5..ad484bb18d7 100644 --- a/public/app/core/directives/dropdown_typeahead.js +++ b/public/app/core/directives/dropdown_typeahead.js @@ -45,16 +45,25 @@ function (_, $, coreModule) { } var typeaheadValues = _.reduce($scope.menuItems, function(memo, value, index) { - _.each(value.submenu, function(item, subIndex) { - item.click = 'menuItemSelected(' + index + ',' + subIndex + ')'; - memo.push(value.text + ' ' + item.text); - }); + if (!value.submenu) { + value.click = 'menuItemSelected(' + index + ')'; + memo.push(value.text); + } else { + _.each(value.submenu, function(item, subIndex) { + item.click = 'menuItemSelected(' + index + ',' + subIndex + ')'; + memo.push(value.text + ' ' + item.text); + }); + } return memo; }, []); $scope.menuItemSelected = function(index, subIndex) { - var item = $scope.menuItems[index]; - $scope.dropdownTypeaheadOnSelect({$item: item, $subItem: item.submenu[subIndex]}); + var menuItem = $scope.menuItems[index]; + var payload = {$item: menuItem}; + if (menuItem.submenu && subIndex !== void 0) { + payload.$subItem = menuItem.submenu[subIndex]; + } + $scope.dropdownTypeaheadOnSelect(payload); }; $input.attr('data-provide', 'typeahead'); @@ -65,9 +74,10 @@ function (_, $, coreModule) { updater: function (value) { var result = {}; _.each($scope.menuItems, function(menuItem) { + result.$item = menuItem; + _.each(menuItem.submenu, function(submenuItem) { if (value === (menuItem.text + ' ' + submenuItem.text)) { - result.$item = menuItem; result.$subItem = submenuItem; } }); diff --git a/public/app/core/directives/metric_segment.js b/public/app/core/directives/metric_segment.js index 6fdc171c1f8..1d07544bb2d 100644 --- a/public/app/core/directives/metric_segment.js +++ b/public/app/core/directives/metric_segment.js @@ -20,13 +20,13 @@ function (_, $, coreModule) { getOptions: "&", onChange: "&", }, - link: function($scope, elem) { var $input = $(inputTemplate); var $button = $(buttonTemplate); var segment = $scope.segment; var options = null; var cancelBlur = null; + var linkMode = true; $input.appendTo(elem); $button.appendTo(elem); @@ -55,19 +55,21 @@ function (_, $, coreModule) { }); }; - $scope.switchToLink = function(now) { - if (now === true || cancelBlur) { - clearTimeout(cancelBlur); - cancelBlur = null; - $input.hide(); - $button.show(); - $scope.updateVariableValue($input.val()); - } - else { - // need to have long delay because the blur - // happens long before the click event on the typeahead options - cancelBlur = setTimeout($scope.switchToLink, 100); - } + $scope.switchToLink = function() { + if (linkMode) { return; } + + clearTimeout(cancelBlur); + cancelBlur = null; + linkMode = true; + $input.hide(); + $button.show(); + $scope.updateVariableValue($input.val()); + }; + + $scope.inputBlur = function() { + // happens long before the click event on the typeahead options + // need to have long delay because the blur + cancelBlur = setTimeout($scope.switchToLink, 100); }; $scope.source = function(query, callback) { @@ -98,7 +100,7 @@ function (_, $, coreModule) { } $input.val(value); - $scope.switchToLink(true); + $scope.switchToLink(); return value; }; @@ -139,6 +141,8 @@ function (_, $, coreModule) { $input.show(); $input.focus(); + linkMode = false; + var typeahead = $input.data('typeahead'); if (typeahead) { $input.val(''); @@ -146,7 +150,7 @@ function (_, $, coreModule) { } }); - $input.blur($scope.switchToLink); + $input.blur($scope.inputBlur); $compile(elem.contents())($scope); } @@ -192,6 +196,8 @@ function (_, $, coreModule) { var option = _.findWhere($scope.options, {text: $scope.segment.value}); if (option && option.value !== $scope.property) { $scope.property = option.value; + } else if (attrs.custom !== 'false') { + $scope.property = $scope.segment.value; } } else { $scope.property = $scope.segment.value; diff --git a/public/app/core/directives/misc.js b/public/app/core/directives/misc.js index 5733774c3bd..0fe18f922f7 100644 --- a/public/app/core/directives/misc.js +++ b/public/app/core/directives/misc.js @@ -1,9 +1,9 @@ define([ 'angular', - 'kbn', '../core_module', + 'app/core/utils/kbn', ], -function (angular, kbn, coreModule) { +function (angular, coreModule, kbn) { 'use strict'; coreModule.directive('tip', function($compile) { diff --git a/public/app/core/directives/ng_model_on_blur.js b/public/app/core/directives/ng_model_on_blur.js index 5e32a28eb94..c4a645732c5 100644 --- a/public/app/core/directives/ng_model_on_blur.js +++ b/public/app/core/directives/ng_model_on_blur.js @@ -1,9 +1,9 @@ define([ - 'kbn', - 'app/core/core_module', + '../core_module', + 'app/core/utils/kbn', 'app/core/utils/rangeutil', ], -function (kbn, coreModule, rangeUtil) { +function (coreModule, kbn, rangeUtil) { 'use strict'; coreModule.directive('ngModelOnblur', function() { diff --git a/public/app/components/extend-jquery.js b/public/app/core/jquery_extended.js similarity index 100% rename from public/app/components/extend-jquery.js rename to public/app/core/jquery_extended.js diff --git a/public/app/components/lodash.extended.js b/public/app/core/lodash_extended.js similarity index 100% rename from public/app/components/lodash.extended.js rename to public/app/core/lodash_extended.js diff --git a/public/app/components/partials.js b/public/app/core/partials.js similarity index 100% rename from public/app/components/partials.js rename to public/app/core/partials.js diff --git a/public/app/core/routes/dashboard_loaders.js b/public/app/core/routes/dashboard_loaders.js index e8a9b80237f..bcc284e882c 100644 --- a/public/app/core/routes/dashboard_loaders.js +++ b/public/app/core/routes/dashboard_loaders.js @@ -9,7 +9,7 @@ function (coreModule) { if (!$routeParams.slug) { backendSrv.get('/api/dashboards/home').then(function(result) { var meta = result.meta; - meta.canSave = meta.canShare = meta.canEdit = meta.canStar = false; + meta.canSave = meta.canShare = meta.canStar = false; $scope.initDashboard(result, $scope); }); return; diff --git a/public/app/services/alertSrv.js b/public/app/core/services/alert_srv.js similarity index 92% rename from public/app/services/alertSrv.js rename to public/app/core/services/alert_srv.js index 3d0f9e66ff2..f3b5329cd60 100644 --- a/public/app/services/alertSrv.js +++ b/public/app/core/services/alert_srv.js @@ -1,13 +1,12 @@ define([ 'angular', - 'lodash' + 'lodash', + '../core_module', ], -function (angular, _) { +function (angular, _, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('alertSrv', function($timeout, $sce, $rootScope, $modal, $q) { + coreModule.service('alertSrv', function($timeout, $sce, $rootScope, $modal, $q) { var self = this; this.init = function() { diff --git a/public/app/core/services/all.js b/public/app/core/services/all.js new file mode 100644 index 00000000000..2d4415a8fa2 --- /dev/null +++ b/public/app/core/services/all.js @@ -0,0 +1,13 @@ +define([ + './alert_srv', + './util_srv', + './datasource_srv', + './context_srv', + './timer', + './keyboard_manager', + './analytics', + './popover_srv', + './segment_srv', + './backend_srv', +], +function () {}); diff --git a/public/app/services/analytics.js b/public/app/core/services/analytics.js similarity index 75% rename from public/app/services/analytics.js rename to public/app/core/services/analytics.js index 4bb7f0c79db..e09ee6c9b77 100644 --- a/public/app/services/analytics.js +++ b/public/app/core/services/analytics.js @@ -1,12 +1,11 @@ define([ 'angular', + '../core_module', ], -function(angular) { +function(angular, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - module.service('googleAnalyticsSrv', function($rootScope, $location) { - + coreModule.service('googleAnalyticsSrv', function($rootScope, $location) { var first = true; this.init = function() { diff --git a/public/app/services/backendSrv.js b/public/app/core/services/backend_srv.js similarity index 91% rename from public/app/services/backendSrv.js rename to public/app/core/services/backend_srv.js index 819ce9d938e..5d6ce8e0fe4 100644 --- a/public/app/services/backendSrv.js +++ b/public/app/core/services/backend_srv.js @@ -1,14 +1,13 @@ define([ 'angular', 'lodash', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, _, config) { +function (angular, _, coreModule, config) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('backendSrv', function($http, alertSrv, $timeout) { + coreModule.service('backendSrv', function($http, alertSrv, $timeout) { var self = this; this.get = function(url, params) { @@ -106,6 +105,11 @@ function (angular, _, config) { }); } + // for Prometheus + if (!err.data.message && _.isString(err.data.error)) { + err.data.message = err.data.error; + } + throw err; }); }; diff --git a/public/app/services/contextSrv.js b/public/app/core/services/context_srv.js similarity index 89% rename from public/app/services/contextSrv.js rename to public/app/core/services/context_srv.js index b3f8a1ed164..77f10fdf16a 100644 --- a/public/app/services/contextSrv.js +++ b/public/app/core/services/context_srv.js @@ -1,15 +1,14 @@ define([ 'angular', 'lodash', - 'store', - 'config', + '../core_module', + 'app/core/store', + 'app/core/config', ], -function (angular, _, store, config) { +function (angular, _, coreModule, store, config) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('contextSrv', function($rootScope, $timeout) { + coreModule.service('contextSrv', function($rootScope, $timeout) { var self = this; function User() { diff --git a/public/app/services/datasourceSrv.js b/public/app/core/services/datasource_srv.js similarity index 92% rename from public/app/services/datasourceSrv.js rename to public/app/core/services/datasource_srv.js index 644e84e8801..9709bb88cdf 100644 --- a/public/app/services/datasourceSrv.js +++ b/public/app/core/services/datasource_srv.js @@ -1,14 +1,13 @@ define([ 'angular', 'lodash', - 'config', + '../core_module', + 'app/core/config', ], -function (angular, _, config) { +function (angular, _, coreModule, config) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('datasourceSrv', function($q, $injector, $rootScope) { + coreModule.service('datasourceSrv', function($q, $injector, $rootScope) { var self = this; this.init = function() { diff --git a/public/app/services/keyboardManager.js b/public/app/core/services/keyboard_manager.js similarity index 97% rename from public/app/services/keyboardManager.js rename to public/app/core/services/keyboard_manager.js index f45ddad305b..14b65465281 100644 --- a/public/app/services/keyboardManager.js +++ b/public/app/core/services/keyboard_manager.js @@ -1,15 +1,14 @@ define([ 'angular', - 'lodash' + 'lodash', + '../core_module', ], -function (angular, _) { +function (angular, _, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - // This service was based on OpenJS library available in BSD License // http://www.openjs.com/scripts/events/keyboard_shortcuts/index.php - module.factory('keyboardManager', ['$window', '$timeout', function ($window, $timeout) { + coreModule.factory('keyboardManager', ['$window', '$timeout', function ($window, $timeout) { var keyboardManagerService = {}; var defaultOpt = { diff --git a/public/app/services/popoverSrv.js b/public/app/core/services/popover_srv.js similarity index 88% rename from public/app/services/popoverSrv.js rename to public/app/core/services/popover_srv.js index cec294178c0..26a935bf283 100644 --- a/public/app/services/popoverSrv.js +++ b/public/app/core/services/popover_srv.js @@ -2,13 +2,12 @@ define([ 'angular', 'lodash', 'jquery', + '../core_module', ], -function (angular, _, $) { +function (angular, _, $, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('popoverSrv', function($templateCache, $timeout, $q, $http, $compile) { + coreModule.service('popoverSrv', function($templateCache, $timeout, $q, $http, $compile) { this.getTemplate = function(url) { return $q.when($templateCache.get(url) || $http.get(url, {cache: true})); diff --git a/public/app/services/uiSegmentSrv.js b/public/app/core/services/segment_srv.js similarity index 76% rename from public/app/services/uiSegmentSrv.js rename to public/app/core/services/segment_srv.js index 2973089b6ba..836437a6dc5 100644 --- a/public/app/services/uiSegmentSrv.js +++ b/public/app/core/services/segment_srv.js @@ -1,13 +1,13 @@ define([ 'angular', 'lodash', + '../core_module', ], -function (angular, _) { +function (angular, _, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('uiSegmentSrv', function($sce, templateSrv) { + coreModule.service('uiSegmentSrv', function($sce, templateSrv) { + var self = this; function MetricSegment(options) { if (options === '*' || options.value === '*') { @@ -75,6 +75,24 @@ function (angular, _) { }); }; + this.transformToSegments = function(addTemplateVars, variableTypeFilter) { + return function(results) { + var segments = _.map(results, function(segment) { + return self.newSegment({ value: segment.text, expandable: segment.expandable }); + }); + + if (addTemplateVars) { + _.each(templateSrv.variables, function(variable) { + if (variableTypeFilter === void 0 || variableTypeFilter === variable.type) { + segments.unshift(self.newSegment({ type: 'template', value: '$' + variable.name, expandable: true })); + } + }); + } + + return segments; + }; + }; + this.newSelectMetric = function() { return new MetricSegment({value: 'select metric', fake: true}); }; diff --git a/public/app/services/timer.js b/public/app/core/services/timer.js similarity index 80% rename from public/app/services/timer.js rename to public/app/core/services/timer.js index 3939fe6b78f..668388a786e 100644 --- a/public/app/services/timer.js +++ b/public/app/core/services/timer.js @@ -1,13 +1,12 @@ define([ 'angular', - 'lodash' + 'lodash', + '../core_module', ], -function (angular, _) { +function (angular, _, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('timer', function($timeout) { + coreModule.service('timer', function($timeout) { // This service really just tracks a list of $timeout promises to give us a // method for cancelling them all when we need to @@ -31,4 +30,4 @@ function (angular, _) { }; }); -}); \ No newline at end of file +}); diff --git a/public/app/services/utilSrv.js b/public/app/core/services/util_srv.js similarity index 78% rename from public/app/services/utilSrv.js rename to public/app/core/services/util_srv.js index b9e703443e4..2418546e5da 100644 --- a/public/app/services/utilSrv.js +++ b/public/app/core/services/util_srv.js @@ -1,12 +1,11 @@ define([ 'angular', + '../core_module', ], -function (angular) { +function (angular, coreModule) { 'use strict'; - var module = angular.module('grafana.services'); - - module.service('utilSrv', function($rootScope, $modal, $q) { + coreModule.service('utilSrv', function($rootScope, $modal, $q) { this.init = function() { $rootScope.onAppEvent('show-modal', this.showModal, $rootScope); diff --git a/public/app/core/settings.js b/public/app/core/settings.js new file mode 100644 index 00000000000..59eaf8ea8b9 --- /dev/null +++ b/public/app/core/settings.js @@ -0,0 +1,27 @@ +define([ + 'lodash', +], +function (_) { + "use strict"; + + return function Settings (options) { + var defaults = { + datasources : {}, + window_title_prefix : 'Grafana - ', + panels : { + 'graph': { path: 'app/panels/graph', name: 'Graph' }, + 'table': { path: 'app/panels/table', name: 'Table' }, + 'singlestat': { path: 'app/panels/singlestat', name: 'Single stat' }, + 'text': { path: 'app/panels/text', name: 'Text' }, + 'dashlist': { path: 'app/panels/dashlist', name: 'Dashboard list' }, + }, + new_panel_title: 'Panel Title', + plugins: {}, + playlist_timespan: "1m", + unsaved_changes_warning: true, + appSubUrl: "" + }; + + return _.extend({}, defaults, options); + }; +}); diff --git a/public/app/components/store.js b/public/app/core/store.js similarity index 88% rename from public/app/components/store.js rename to public/app/core/store.js index 84e72b96314..504b0e5aff5 100644 --- a/public/app/components/store.js +++ b/public/app/core/store.js @@ -12,7 +12,7 @@ define([], function() { if (def !== void 0 && !this.exists(key)) { return def; } - return window.localStorage[key] === 'true' ? true : false; + return window.localStorage[key] === 'true'; }, exists: function(key) { return window.localStorage[key] !== void 0; diff --git a/public/app/components/timeSeries.js b/public/app/core/time_series.ts similarity index 70% rename from public/app/components/timeSeries.js rename to public/app/core/time_series.ts index 74194e68ff9..429e3882e8b 100644 --- a/public/app/components/timeSeries.js +++ b/public/app/core/time_series.ts @@ -1,11 +1,48 @@ -define([ - 'lodash', - 'kbn' -], -function (_, kbn) { - 'use strict'; +/// - function TimeSeries(opts) { +import _ = require('lodash'); +import kbn = require('app/core/utils/kbn'); + +function matchSeriesOverride(aliasOrRegex, seriesAlias) { + if (!aliasOrRegex) { return false; } + + if (aliasOrRegex[0] === '/') { + var regex = kbn.stringToJsRegex(aliasOrRegex); + return seriesAlias.match(regex) != null; + } + + return aliasOrRegex === seriesAlias; +} + +function translateFillOption(fill) { + return fill === 0 ? 0.001 : fill/10; +} + +class TimeSeries { + datapoints: any; + id: string; + label: string; + alias: string; + color: string; + valueFormater: any; + stats: any; + legend: boolean; + allIsNull: boolean; + allIsZero: boolean; + decimals: number; + scaledDecimals: number; + + lines: any; + bars: any; + points: any; + yaxis: any; + zindex: any; + stack: any; + nullPointMode: any; + fillBelowTo: any; + transform: any; + + constructor(opts) { this.datapoints = opts.datapoints; this.label = opts.alias; this.id = opts.alias; @@ -16,27 +53,13 @@ function (_, kbn) { this.legend = true; } - function matchSeriesOverride(aliasOrRegex, seriesAlias) { - if (!aliasOrRegex) { return false; } - - if (aliasOrRegex[0] === '/') { - var regex = kbn.stringToJsRegex(aliasOrRegex); - return seriesAlias.match(regex) != null; - } - - return aliasOrRegex === seriesAlias; - } - - function translateFillOption(fill) { - return fill === 0 ? 0.001 : fill/10; - } - - TimeSeries.prototype.applySeriesOverrides = function(overrides) { + applySeriesOverrides(overrides) { this.lines = {}; this.points = {}; this.bars = {}; this.yaxis = 1; this.zindex = 0; + this.nullPointMode = null; delete this.stack; for (var i = 0; i < overrides.length; i++) { @@ -50,6 +73,7 @@ function (_, kbn) { if (override.fill !== void 0) { this.lines.fill = translateFillOption(override.fill); } if (override.stack !== void 0) { this.stack = override.stack; } if (override.linewidth !== void 0) { this.lines.lineWidth = override.linewidth; } + if (override.nullPointMode !== void 0) { this.nullPointMode = override.nullPointMode; } if (override.pointradius !== void 0) { this.points.radius = override.pointradius; } if (override.steppedLine !== void 0) { this.lines.steps = override.steppedLine; } if (override.zindex !== void 0) { this.zindex = override.zindex; } @@ -64,7 +88,7 @@ function (_, kbn) { } }; - TimeSeries.prototype.getFlotPairs = function (fillStyle) { + getFlotPairs(fillStyle) { var result = []; this.stats.total = 0; @@ -73,11 +97,13 @@ function (_, kbn) { this.stats.avg = null; this.stats.current = null; this.allIsNull = true; + this.allIsZero = true; var ignoreNulls = fillStyle === 'connected'; var nullAsZero = fillStyle === 'null as zero'; var currentTime; var currentValue; + var nonNulls = 0; for (var i = 0; i < this.datapoints.length; i++) { currentValue = this.datapoints[i][0]; @@ -94,6 +120,7 @@ function (_, kbn) { if (_.isNumber(currentValue)) { this.stats.total += currentValue; this.allIsNull = false; + nonNulls++; } if (currentValue > this.stats.max) { @@ -105,6 +132,10 @@ function (_, kbn) { } } + if (currentValue != 0) { + this.allIsZero = false; + } + result.push([currentTime, currentValue]); } @@ -116,26 +147,26 @@ function (_, kbn) { if (this.stats.min === Number.MAX_VALUE) { this.stats.min = null; } if (result.length) { - this.stats.avg = (this.stats.total / result.length); + this.stats.avg = (this.stats.total / nonNulls); this.stats.current = result[result.length-1][1]; if (this.stats.current === null && result.length > 1) { this.stats.current = result[result.length-2][1]; } } + this.stats.count = result.length; return result; - }; + } - TimeSeries.prototype.updateLegendValues = function(formater, decimals, scaledDecimals) { + updateLegendValues(formater, decimals, scaledDecimals) { this.valueFormater = formater; this.decimals = decimals; this.scaledDecimals = scaledDecimals; - }; + } - TimeSeries.prototype.formatValue = function(value) { + formatValue(value) { return this.valueFormater(value, this.decimals, this.scaledDecimals); - }; + } +} - return TimeSeries; - -}); +export = TimeSeries; diff --git a/public/app/core/utils/flatten.ts b/public/app/core/utils/flatten.ts new file mode 100644 index 00000000000..fb4c47d1e3d --- /dev/null +++ b/public/app/core/utils/flatten.ts @@ -0,0 +1,39 @@ +// Copyright (c) 2014, Hugh Kennedy +// Based on code from https://github.com/hughsk/flat/blob/master/index.js +// +function flatten(target, opts): any { + opts = opts || {}; + + var delimiter = opts.delimiter || '.'; + var maxDepth = opts.maxDepth || 3; + var currentDepth = 1; + var output = {}; + + function step(object, prev) { + Object.keys(object).forEach(function(key) { + var value = object[key]; + var isarray = opts.safe && Array.isArray(value); + var type = Object.prototype.toString.call(value); + var isobject = type === "[object Object]"; + + var newKey = prev ? prev + delimiter + key : key; + + if (!opts.maxDepth) { + maxDepth = currentDepth + 1; + } + + if (!isarray && isobject && Object.keys(value).length && currentDepth < maxDepth) { + ++currentDepth; + return step(value, newKey); + } + + output[newKey] = value; + }); + } + + step(target, null); + + return output; +} + +export = flatten; diff --git a/public/app/core/utils/kbn.js b/public/app/core/utils/kbn.js new file mode 100644 index 00000000000..123e8e16be1 --- /dev/null +++ b/public/app/core/utils/kbn.js @@ -0,0 +1,667 @@ +define([ + 'jquery', + 'lodash', +], +function($, _) { + 'use strict'; + + var kbn = {}; + kbn.valueFormats = {}; + + ///// HELPER FUNCTIONS ///// + + kbn.round_interval = function(interval) { + switch (true) { + // 0.5s + case (interval <= 500): + return 100; // 0.1s + // 5s + case (interval <= 5000): + return 1000; // 1s + // 7.5s + case (interval <= 7500): + return 5000; // 5s + // 15s + case (interval <= 15000): + return 10000; // 10s + // 45s + case (interval <= 45000): + return 30000; // 30s + // 3m + case (interval <= 180000): + return 60000; // 1m + // 9m + case (interval <= 450000): + return 300000; // 5m + // 20m + case (interval <= 1200000): + return 600000; // 10m + // 45m + case (interval <= 2700000): + return 1800000; // 30m + // 2h + case (interval <= 7200000): + return 3600000; // 1h + // 6h + case (interval <= 21600000): + return 10800000; // 3h + // 24h + case (interval <= 86400000): + return 43200000; // 12h + // 48h + case (interval <= 172800000): + return 86400000; // 24h + // 1w + case (interval <= 604800000): + return 86400000; // 24h + // 3w + case (interval <= 1814400000): + return 604800000; // 1w + // 2y + case (interval < 3628800000): + return 2592000000; // 30d + default: + return 31536000000; // 1y + } + }; + + kbn.secondsToHms = function(seconds) { + var numyears = Math.floor(seconds / 31536000); + if(numyears){ + return numyears + 'y'; + } + var numdays = Math.floor((seconds % 31536000) / 86400); + if(numdays){ + return numdays + 'd'; + } + var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600); + if(numhours){ + return numhours + 'h'; + } + var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60); + if(numminutes){ + return numminutes + 'm'; + } + var numseconds = Math.floor((((seconds % 31536000) % 86400) % 3600) % 60); + if(numseconds){ + return numseconds + 's'; + } + var nummilliseconds = Math.floor(seconds * 1000.0); + if(nummilliseconds){ + return nummilliseconds + 'ms'; + } + + return 'less then a millisecond'; //'just now' //or other string you like; + }; + + kbn.to_percent = function(number,outof) { + return Math.floor((number/outof)*10000)/100 + "%"; + }; + + kbn.addslashes = function(str) { + str = str.replace(/\\/g, '\\\\'); + str = str.replace(/\'/g, '\\\''); + str = str.replace(/\"/g, '\\"'); + str = str.replace(/\0/g, '\\0'); + return str; + }; + + kbn.interval_regex = /(\d+(?:\.\d+)?)([Mwdhmsy])/; + + // histogram & trends + kbn.intervals_in_seconds = { + y: 31536000, + M: 2592000, + w: 604800, + d: 86400, + h: 3600, + m: 60, + s: 1 + }; + + kbn.calculateInterval = function(range, resolution, userInterval) { + var lowLimitMs = 1; // 1 millisecond default low limit + var intervalMs, lowLimitInterval; + + if (userInterval) { + if (userInterval[0] === '>') { + lowLimitInterval = userInterval.slice(1); + lowLimitMs = kbn.interval_to_ms(lowLimitInterval); + } + else { + return userInterval; + } + } + + intervalMs = kbn.round_interval((range.to.valueOf() - range.from.valueOf()) / resolution); + if (lowLimitMs > intervalMs) { + intervalMs = lowLimitMs; + } + + return kbn.secondsToHms(intervalMs / 1000); + }; + + kbn.describe_interval = function (string) { + var matches = string.match(kbn.interval_regex); + if (!matches || !_.has(kbn.intervals_in_seconds, matches[2])) { + throw new Error('Invalid interval string, expexcting a number followed by one of "Mwdhmsy"'); + } else { + return { + sec: kbn.intervals_in_seconds[matches[2]], + type: matches[2], + count: parseInt(matches[1], 10) + }; + } + }; + + kbn.interval_to_ms = function(string) { + var info = kbn.describe_interval(string); + return info.sec * 1000 * info.count; + }; + + kbn.interval_to_seconds = function (string) { + var info = kbn.describe_interval(string); + return info.sec * info.count; + }; + + kbn.query_color_dot = function (color, diameter) { + return '
    '; + }; + + kbn.slugifyForUrl = function(str) { + return str + .toLowerCase() + .replace(/[^\w ]+/g,'') + .replace(/ +/g,'-'); + }; + + kbn.exportSeriesListToCsv = function(seriesList) { + var text = 'Series;Time;Value\n'; + _.each(seriesList, function(series) { + _.each(series.datapoints, function(dp) { + text += series.alias + ';' + new Date(dp[1]).toISOString() + ';' + dp[0] + '\n'; + }); + }); + var blob = new Blob([text], { type: "text/csv;charset=utf-8" }); + window.saveAs(blob, 'grafana_data_export.csv'); + }; + + kbn.stringToJsRegex = function(str) { + if (str[0] !== '/') { + return new RegExp('^' + str + '$'); + } + + var match = str.match(new RegExp('^/(.*?)/(g?i?m?y?)$')); + return new RegExp(match[1], match[2]); + }; + + kbn.toFixed = function(value, decimals) { + if (value === null) { + return ""; + } + + var factor = decimals ? Math.pow(10, Math.max(0, decimals)) : 1; + var formatted = String(Math.round(value * factor) / factor); + + // if exponent return directly + if (formatted.indexOf('e') !== -1 || value === 0) { + return formatted; + } + + // If tickDecimals was specified, ensure that we have exactly that + // much precision; otherwise default to the value's own precision. + if (decimals != null) { + var decimalPos = formatted.indexOf("."); + var precision = decimalPos === -1 ? 0 : formatted.length - decimalPos - 1; + if (precision < decimals) { + return (precision ? formatted : formatted + ".") + (String(factor)).substr(1, decimals - precision); + } + } + + return formatted; + }; + + kbn.toFixedScaled = function(value, decimals, scaledDecimals, additionalDecimals, ext) { + if (scaledDecimals === null) { + return kbn.toFixed(value, decimals) + ext; + } else { + return kbn.toFixed(value, scaledDecimals + additionalDecimals) + ext; + } + }; + + kbn.roundValue = function (num, decimals) { + if (num === null) { return null; } + var n = Math.pow(10, decimals); + return Math.round((n * num).toFixed(decimals)) / n; + }; + + ///// FORMAT FUNCTION CONSTRUCTORS ///// + + kbn.formatBuilders = {}; + + // Formatter which always appends a fixed unit string to the value. No + // scaling of the value is performed. + kbn.formatBuilders.fixedUnit = function(unit) { + return function(size, decimals) { + if (size === null) { return ""; } + return kbn.toFixed(size, decimals) + ' ' + unit; + }; + }; + + // Formatter which scales the unit string geometrically according to the given + // numeric factor. Repeatedly scales the value down by the factor until it is + // less than the factor in magnitude, or the end of the array is reached. + kbn.formatBuilders.scaledUnits = function(factor, extArray) { + return function(size, decimals, scaledDecimals) { + if (size === null) { + return ""; + } + + var steps = 0; + var limit = extArray.length; + + while (Math.abs(size) >= factor) { + steps++; + size /= factor; + + if (steps >= limit) { return "NA"; } + } + + if (steps > 0 && scaledDecimals !== null) { + decimals = scaledDecimals + (3 * steps); + } + + return kbn.toFixed(size, decimals) + extArray[steps]; + }; + }; + + // Extension of the scaledUnits builder which uses SI decimal prefixes. If an + // offset is given, it adjusts the starting units at the given prefix; a value + // of 0 starts at no scale; -3 drops to nano, +2 starts at mega, etc. + kbn.formatBuilders.decimalSIPrefix = function(unit, offset) { + var prefixes = ['n', 'µ', 'm', '', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; + prefixes = prefixes.slice(3 + (offset || 0)); + var units = prefixes.map(function(p) { return ' ' + p + unit; }); + return kbn.formatBuilders.scaledUnits(1000, units); + }; + + // Extension of the scaledUnits builder which uses SI binary prefixes. If + // offset is given, it starts the units at the given prefix; otherwise, the + // offset defaults to zero and the initial unit is not prefixed. + kbn.formatBuilders.binarySIPrefix = function(unit, offset) { + var prefixes = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'].slice(offset); + var units = prefixes.map(function(p) { return ' ' + p + unit; }); + return kbn.formatBuilders.scaledUnits(1024, units); + }; + + // Currency formatter for prefixing a symbol onto a number. Supports scaling + // up to the trillions. + kbn.formatBuilders.currency = function(symbol) { + var units = ['', 'K', 'M', 'B', 'T']; + var scaler = kbn.formatBuilders.scaledUnits(1000, units); + return function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + var scaled = scaler(size, decimals, scaledDecimals); + return symbol + scaled; + }; + }; + + kbn.formatBuilders.simpleCountUnit = function(symbol) { + var units = ['', 'K', 'M', 'B', 'T']; + var scaler = kbn.formatBuilders.scaledUnits(1000, units); + return function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + var scaled = scaler(size, decimals, scaledDecimals); + return scaled + " " + symbol; + }; + }; + + ///// VALUE FORMATS ///// + + // Dimensionless Units + kbn.valueFormats.none = kbn.toFixed; + kbn.valueFormats.short = kbn.formatBuilders.scaledUnits(1000, ['', ' K', ' Mil', ' Bil', ' Tri', ' Quadr', ' Quint', ' Sext', ' Sept']); + kbn.valueFormats.dB = kbn.formatBuilders.fixedUnit('dB'); + kbn.valueFormats.ppm = kbn.formatBuilders.fixedUnit('ppm'); + + kbn.valueFormats.percent = function(size, decimals) { + if (size === null) { return ""; } + return kbn.toFixed(size, decimals) + '%'; + }; + + kbn.valueFormats.percentunit = function(size, decimals) { + if (size === null) { return ""; } + return kbn.toFixed(100*size, decimals) + '%'; + }; + + // Currencies + kbn.valueFormats.currencyUSD = kbn.formatBuilders.currency('$'); + kbn.valueFormats.currencyGBP = kbn.formatBuilders.currency('£'); + kbn.valueFormats.currencyEUR = kbn.formatBuilders.currency('€'); + kbn.valueFormats.currencyJPY = kbn.formatBuilders.currency('¥'); + + // Data + kbn.valueFormats.bits = kbn.formatBuilders.binarySIPrefix('b'); + kbn.valueFormats.bytes = kbn.formatBuilders.binarySIPrefix('B'); + kbn.valueFormats.kbytes = kbn.formatBuilders.binarySIPrefix('B', 1); + kbn.valueFormats.mbytes = kbn.formatBuilders.binarySIPrefix('B', 2); + kbn.valueFormats.gbytes = kbn.formatBuilders.binarySIPrefix('B', 3); + + // Data Rate + kbn.valueFormats.pps = kbn.formatBuilders.decimalSIPrefix('pps'); + kbn.valueFormats.bps = kbn.formatBuilders.decimalSIPrefix('bps'); + kbn.valueFormats.Bps = kbn.formatBuilders.decimalSIPrefix('Bps'); + + // Throughput + kbn.valueFormats.ops = kbn.formatBuilders.simpleCountUnit('ops'); + kbn.valueFormats.rps = kbn.formatBuilders.simpleCountUnit('rps'); + kbn.valueFormats.wps = kbn.formatBuilders.simpleCountUnit('wps'); + kbn.valueFormats.iops = kbn.formatBuilders.simpleCountUnit('iops'); + + // Energy + kbn.valueFormats.watt = kbn.formatBuilders.decimalSIPrefix('W'); + kbn.valueFormats.kwatt = kbn.formatBuilders.decimalSIPrefix('W', 1); + kbn.valueFormats.watth = kbn.formatBuilders.decimalSIPrefix('Wh'); + kbn.valueFormats.kwatth = kbn.formatBuilders.decimalSIPrefix('Wh', 1); + kbn.valueFormats.joule = kbn.formatBuilders.decimalSIPrefix('J'); + kbn.valueFormats.ev = kbn.formatBuilders.decimalSIPrefix('eV'); + kbn.valueFormats.amp = kbn.formatBuilders.decimalSIPrefix('A'); + kbn.valueFormats.volt = kbn.formatBuilders.decimalSIPrefix('V'); + + // Temperature + kbn.valueFormats.celsius = kbn.formatBuilders.fixedUnit('°C'); + kbn.valueFormats.farenheit = kbn.formatBuilders.fixedUnit('°F'); + kbn.valueFormats.kelvin = kbn.formatBuilders.fixedUnit('K'); + kbn.valueFormats.humidity = kbn.formatBuilders.fixedUnit('%H'); + + // Pressure + kbn.valueFormats.pressurembar = kbn.formatBuilders.fixedUnit('mbar'); + kbn.valueFormats.pressurehpa = kbn.formatBuilders.fixedUnit('hPa'); + kbn.valueFormats.pressurehg = kbn.formatBuilders.fixedUnit('"Hg'); + kbn.valueFormats.pressurepsi = kbn.formatBuilders.scaledUnits(1000, [' psi', ' ksi', ' Mpsi']); + + // Length + kbn.valueFormats.lengthm = kbn.formatBuilders.decimalSIPrefix('m'); + kbn.valueFormats.lengthmm = kbn.formatBuilders.decimalSIPrefix('m', -1); + kbn.valueFormats.lengthkm = kbn.formatBuilders.decimalSIPrefix('m', 1); + kbn.valueFormats.lengthmi = kbn.formatBuilders.fixedUnit('mi'); + + // Velocity + kbn.valueFormats.velocityms = kbn.formatBuilders.fixedUnit('m/s'); + kbn.valueFormats.velocitykmh = kbn.formatBuilders.fixedUnit('km/h'); + kbn.valueFormats.velocitymph = kbn.formatBuilders.fixedUnit('mph'); + kbn.valueFormats.velocityknot = kbn.formatBuilders.fixedUnit('kn'); + + // Volume + kbn.valueFormats.litre = kbn.formatBuilders.decimalSIPrefix('L'); + kbn.valueFormats.mlitre = kbn.formatBuilders.decimalSIPrefix('L', -1); + + // Time + kbn.valueFormats.hertz = kbn.formatBuilders.decimalSIPrefix('Hz'); + + kbn.valueFormats.ms = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 1000) { + return kbn.toFixed(size, decimals) + " ms"; + } + // Less than 1 min + else if (Math.abs(size) < 60000) { + return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " s"); + } + // Less than 1 hour, devide in minutes + else if (Math.abs(size) < 3600000) { + return kbn.toFixedScaled(size / 60000, decimals, scaledDecimals, 5, " min"); + } + // Less than one day, devide in hours + else if (Math.abs(size) < 86400000) { + return kbn.toFixedScaled(size / 3600000, decimals, scaledDecimals, 7, " hour"); + } + // Less than one year, devide in days + else if (Math.abs(size) < 31536000000) { + return kbn.toFixedScaled(size / 86400000, decimals, scaledDecimals, 8, " day"); + } + + return kbn.toFixedScaled(size / 31536000000, decimals, scaledDecimals, 10, " year"); + }; + + kbn.valueFormats.s = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 60) { + return kbn.toFixed(size, decimals) + " s"; + } + // Less than 1 hour, devide in minutes + else if (Math.abs(size) < 3600) { + return kbn.toFixedScaled(size / 60, decimals, scaledDecimals, 1, " min"); + } + // Less than one day, devide in hours + else if (Math.abs(size) < 86400) { + return kbn.toFixedScaled(size / 3600, decimals, scaledDecimals, 4, " hour"); + } + // Less than one week, devide in days + else if (Math.abs(size) < 604800) { + return kbn.toFixedScaled(size / 86400, decimals, scaledDecimals, 5, " day"); + } + // Less than one year, devide in week + else if (Math.abs(size) < 31536000) { + return kbn.toFixedScaled(size / 604800, decimals, scaledDecimals, 6, " week"); + } + + return kbn.toFixedScaled(size / 3.15569e7, decimals, scaledDecimals, 7, " year"); + }; + + kbn.valueFormats['µs'] = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 1000) { + return kbn.toFixed(size, decimals) + " µs"; + } + else if (Math.abs(size) < 1000000) { + return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " ms"); + } + else { + return kbn.toFixedScaled(size / 1000000, decimals, scaledDecimals, 6, " s"); + } + }; + + kbn.valueFormats.ns = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 1000) { + return kbn.toFixed(size, decimals) + " ns"; + } + else if (Math.abs(size) < 1000000) { + return kbn.toFixedScaled(size / 1000, decimals, scaledDecimals, 3, " µs"); + } + else if (Math.abs(size) < 1000000000) { + return kbn.toFixedScaled(size / 1000000, decimals, scaledDecimals, 6, " ms"); + } + else if (Math.abs(size) < 60000000000){ + return kbn.toFixedScaled(size / 1000000000, decimals, scaledDecimals, 9, " s"); + } + else { + return kbn.toFixedScaled(size / 60000000000, decimals, scaledDecimals, 12, " min"); + } + }; + + kbn.valueFormats.m = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 60) { + return kbn.toFixed(size, decimals) + " min"; + } + else if (Math.abs(size) < 1440) { + return kbn.toFixedScaled(size / 60, decimals, scaledDecimals, 2, " hour"); + } + else if (Math.abs(size) < 10080) { + return kbn.toFixedScaled(size / 1440, decimals, scaledDecimals, 3, " day"); + } + else if (Math.abs(size) < 604800) { + return kbn.toFixedScaled(size / 10080, decimals, scaledDecimals, 4, " week"); + } + else { + return kbn.toFixedScaled(size / 5.25948e5, decimals, scaledDecimals, 5, " year"); + } + }; + + kbn.valueFormats.h = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 24) { + return kbn.toFixed(size, decimals) + " hour"; + } + else if (Math.abs(size) < 168) { + return kbn.toFixedScaled(size / 24, decimals, scaledDecimals, 2, " day"); + } + else if (Math.abs(size) < 8760) { + return kbn.toFixedScaled(size / 168, decimals, scaledDecimals, 3, " week"); + } + else { + return kbn.toFixedScaled(size / 8760, decimals, scaledDecimals, 4, " year"); + } + }; + + kbn.valueFormats.d = function(size, decimals, scaledDecimals) { + if (size === null) { return ""; } + + if (Math.abs(size) < 7) { + return kbn.toFixed(size, decimals) + " day"; + } + else if (Math.abs(size) < 365) { + return kbn.toFixedScaled(size / 7, decimals, scaledDecimals, 2, " week"); + } + else { + return kbn.toFixedScaled(size / 365, decimals, scaledDecimals, 3, " year"); + } + }; + + ///// FORMAT MENU ///// + + kbn.getUnitFormats = function() { + return [ + { + text: 'none', + submenu: [ + {text: 'none' , value: 'none' }, + {text: 'short', value: 'short' }, + {text: 'percent (0-100)', value: 'percent' }, + {text: 'percent (0.0-1.0)', value: 'percentunit'}, + {text: 'Humidity (%H)', value: 'humidity' }, + {text: 'ppm', value: 'ppm' }, + {text: 'decibel', value: 'dB' }, + ] + }, + { + text: 'currency', + submenu: [ + {text: 'Dollars ($)', value: 'currencyUSD'}, + {text: 'Pounds (£)', value: 'currencyGBP'}, + {text: 'Euro (€)', value: 'currencyEUR'}, + {text: 'Yen (¥)', value: 'currencyJPY'}, + ] + }, + { + text: 'time', + submenu: [ + {text: 'Hertz (1/s)', value: 'hertz'}, + {text: 'nanoseconds (ns)' , value: 'ns' }, + {text: 'microseconds (µs)', value: 'µs' }, + {text: 'milliseconds (ms)', value: 'ms' }, + {text: 'seconds (s)', value: 's' }, + {text: 'minutes (m)', value: 'm' }, + {text: 'hours (h)', value: 'h' }, + {text: 'days (d)', value: 'd' }, + ] + }, + { + text: 'data', + submenu: [ + {text: 'bits', value: 'bits' }, + {text: 'bytes', value: 'bytes' }, + {text: 'kilobytes', value: 'kbytes'}, + {text: 'megabytes', value: 'mbytes'}, + {text: 'gigabytes', value: 'gbytes'}, + ] + }, + { + text: 'data rate', + submenu: [ + {text: 'packets/sec', value: 'pps'}, + {text: 'bits/sec', value: 'bps'}, + {text: 'bytes/sec', value: 'Bps'}, + ] + }, + { + text: 'throughput', + submenu: [ + {text: 'ops/sec (ops)', value: 'ops' }, + {text: 'reads/sec (rps)', value: 'rps' }, + {text: 'writes/sec (wps)', value: 'wps' }, + {text: 'I/O ops/sec (iops)', value: 'iops'}, + ] + }, + { + text: 'length', + submenu: [ + {text: 'millimetre (mm)', value: 'lengthmm'}, + {text: 'meter (m)', value: 'lengthm' }, + {text: 'kilometer (km)', value: 'lengthkm'}, + {text: 'mile (mi)', value: 'lengthmi'}, + ] + }, + { + text: 'velocity', + submenu: [ + {text: 'm/s', value: 'velocityms' }, + {text: 'km/h', value: 'velocitykmh' }, + {text: 'mph', value: 'velocitymph' }, + {text: 'knot (kn)', value: 'velocityknot'}, + ] + }, + { + text: 'volume', + submenu: [ + {text: 'millilitre', value: 'mlitre'}, + {text: 'litre', value: 'litre' }, + ] + }, + { + text: 'energy', + submenu: [ + {text: 'watt (W)', value: 'watt' }, + {text: 'kilowatt (kW)', value: 'kwatt' }, + {text: 'watt-hour (Wh)', value: 'watth' }, + {text: 'kilowatt-hour (kWh)', value: 'kwatth'}, + {text: 'joule (J)', value: 'joule' }, + {text: 'electron volt (eV)', value: 'ev' }, + {text: 'Ampere (A)', value: 'amp' }, + {text: 'Volt (V)', value: 'volt' }, + ] + }, + { + text: 'temperature', + submenu: [ + {text: 'Celcius (°C)', value: 'celsius' }, + {text: 'Farenheit (°F)', value: 'farenheit' }, + {text: 'Kelvin (K)', value: 'kelvin' }, + ] + }, + { + text: 'pressure', + submenu: [ + {text: 'Millibars', value: 'pressurembar'}, + {text: 'Hectopascals', value: 'pressurehpa' }, + {text: 'Inches of mercury', value: 'pressurehg' }, + {text: 'PSI', value: 'pressurepsi' }, + ] + } + ]; + }; + + return kbn; +}); diff --git a/public/app/core/utils/rangeutil.ts b/public/app/core/utils/rangeutil.ts index 1e64fcc0061..9e44a50c81f 100644 --- a/public/app/core/utils/rangeutil.ts +++ b/public/app/core/utils/rangeutil.ts @@ -34,11 +34,12 @@ var rangeOptions = [ { from: 'now-15m', to: 'now', display: 'Last 15 minutes', section: 3 }, { from: 'now-30m', to: 'now', display: 'Last 30 minutes', section: 3 }, { from: 'now-1h', to: 'now', display: 'Last 1 hour', section: 3 }, + { from: 'now-3h', to: 'now', display: 'Last 3 hours', section: 3 }, { from: 'now-6h', to: 'now', display: 'Last 6 hours', section: 3 }, { from: 'now-12h', to: 'now', display: 'Last 12 hours', section: 3 }, { from: 'now-24h', to: 'now', display: 'Last 24 hours', section: 3 }, - { from: 'now-7d', to: 'now', display: 'Last 7 days', section: 3 }, + { from: 'now-7d', to: 'now', display: 'Last 7 days', section: 0 }, { from: 'now-30d', to: 'now', display: 'Last 30 days', section: 0 }, { from: 'now-60d', to: 'now', display: 'Last 60 days', section: 0 }, { from: 'now-90d', to: 'now', display: 'Last 90 days', section: 0 }, @@ -133,8 +134,12 @@ _.each(rangeOptions, function (frame) { return from.fromNow() + ' to ' + formatDate(range.to); } - var res = describeTextRange(range.from); - return res.display; + if (range.to.toString() === 'now') { + var res = describeTextRange(range.from); + return res.display; + } + + return range.from.toString() + ' to ' + range.to.toString(); } export = { diff --git a/public/app/features/admin/partials/orgs.html b/public/app/features/admin/partials/orgs.html index fe87073eb6c..573c0799c68 100644 --- a/public/app/features/admin/partials/orgs.html +++ b/public/app/features/admin/partials/orgs.html @@ -17,6 +17,7 @@ + {{org.id}} {{org.name}} diff --git a/public/app/features/annotations/annotationsSrv.js b/public/app/features/annotations/annotationsSrv.js index 89c9b72ec1f..f131ad28393 100644 --- a/public/app/features/annotations/annotationsSrv.js +++ b/public/app/features/annotations/annotationsSrv.js @@ -7,14 +7,14 @@ define([ var module = angular.module('grafana.services'); - module.service('annotationsSrv', function(datasourceSrv, $q, alertSrv, $rootScope) { + module.service('annotationsSrv', function($rootScope, $q, datasourceSrv, alertSrv, timeSrv) { var promiseCached; var list = []; var self = this; this.init = function() { $rootScope.onAppEvent('refresh', this.clearCache, $rootScope); - $rootScope.onAppEvent('setup-dashboard', this.clearCache, $rootScope); + $rootScope.onAppEvent('dashboard-loaded', this.clearCache, $rootScope); }; this.clearCache = function() { @@ -22,7 +22,7 @@ define([ list = []; }; - this.getAnnotations = function(rangeUnparsed, dashboard) { + this.getAnnotations = function(dashboard) { if (dashboard.annotations.list.length === 0) { return $q.when(null); } @@ -34,9 +34,13 @@ define([ self.dashboard = dashboard; var annotations = _.where(dashboard.annotations.list, {enable: true}); + var range = timeSrv.timeRange(); + var rangeRaw = timeSrv.timeRange(false); + var promises = _.map(annotations, function(annotation) { return datasourceSrv.get(annotation.datasource).then(function(datasource) { - return datasource.annotationQuery(annotation, rangeUnparsed) + var query = {range: range, rangeRaw: rangeRaw, annotation: annotation}; + return datasource.annotationQuery(query) .then(self.receiveAnnotationResults) .then(null, errorHandler); }, this); diff --git a/public/app/features/dashboard/dashboardCtrl.js b/public/app/features/dashboard/dashboardCtrl.js index 30dda154e94..cf071565515 100644 --- a/public/app/features/dashboard/dashboardCtrl.js +++ b/public/app/features/dashboard/dashboardCtrl.js @@ -1,8 +1,7 @@ define([ 'angular', 'jquery', - 'config', - 'lodash', + 'app/core/config', ], function (angular, $, config) { "use strict"; @@ -29,7 +28,7 @@ function (angular, $, config) { var resizeEventTimeout; this.init = function(dashboard) { - $scope.reset_row(); + $scope.resetRow(); $scope.registerWindowResizeEvent(); $scope.onAppEvent('show-json-editor', $scope.showJsonEditor); $scope.setupDashboard(dashboard); @@ -88,17 +87,17 @@ function (angular, $, config) { $rootScope.$broadcast('refresh'); }; - $scope.add_row = function(dash, row) { + $scope.addRow = function(dash, row) { dash.rows.push(row); }; - $scope.add_row_default = function() { - $scope.reset_row(); + $scope.addRowDefault = function() { + $scope.resetRow(); $scope.row.title = 'New row'; - $scope.add_row($scope.dashboard, $scope.row); + $scope.addRow($scope.dashboard, $scope.row); }; - $scope.reset_row = function() { + $scope.resetRow = function() { $scope.row = { title: '', height: '250px', diff --git a/public/app/features/dashboard/dashboardLoaderSrv.js b/public/app/features/dashboard/dashboardLoaderSrv.js index f2fc3c9c03f..f578a9d1075 100644 --- a/public/app/features/dashboard/dashboardLoaderSrv.js +++ b/public/app/features/dashboard/dashboardLoaderSrv.js @@ -3,9 +3,10 @@ define([ 'moment', 'lodash', 'jquery', - 'kbn', + 'app/core/utils/kbn', + 'app/core/utils/datemath', ], -function (angular, moment, _, $, kbn) { +function (angular, moment, _, $, kbn, dateMath) { 'use strict'; var module = angular.module('grafana.services'); @@ -59,8 +60,8 @@ function (angular, moment, _, $, kbn) { }; /*jshint -W054 */ - var script_func = new Function('ARGS','kbn','_','moment','window','document','$','jQuery', 'services', result.data); - var script_result = script_func($routeParams, kbn, _ , moment, window, document, $, $, services); + var script_func = new Function('ARGS','kbn','dateMath','_','moment','window','document','$','jQuery', 'services', result.data); + var script_result = script_func($routeParams, kbn, dateMath, _ , moment, window, document, $, $, services); // Handle async dashboard scripts if (_.isFunction(script_result)) { diff --git a/public/app/features/dashboard/dashboardNavCtrl.js b/public/app/features/dashboard/dashboardNavCtrl.js index eef2a8595a7..56a64c4933f 100644 --- a/public/app/features/dashboard/dashboardNavCtrl.js +++ b/public/app/features/dashboard/dashboardNavCtrl.js @@ -1,9 +1,7 @@ define([ 'angular', 'lodash', - 'config', - 'store', - 'filesaver' + 'vendor/filesaver' ], function (angular, _) { 'use strict'; diff --git a/public/app/features/dashboard/dashboardSrv.js b/public/app/features/dashboard/dashboardSrv.js index 170cce52fbf..73919ce0e01 100644 --- a/public/app/features/dashboard/dashboardSrv.js +++ b/public/app/features/dashboard/dashboardSrv.js @@ -1,11 +1,10 @@ define([ 'angular', 'jquery', - 'kbn', 'lodash', 'moment', ], -function (angular, $, kbn, _, moment) { +function (angular, $, _, moment) { 'use strict'; var module = angular.module('grafana.services'); @@ -27,7 +26,7 @@ function (angular, $, kbn, _, moment) { this.tags = data.tags || []; this.style = data.style || "dark"; this.timezone = data.timezone || 'browser'; - this.editable = data.editable === false ? false : true; + this.editable = data.editable !== false; this.hideControls = data.hideControls || false; this.sharedCrosshair = data.sharedCrosshair || false; this.rows = data.rows || []; @@ -49,10 +48,10 @@ function (angular, $, kbn, _, moment) { p._initMeta = function(meta) { meta = meta || {}; - meta.canShare = meta.canShare === false ? false : true; - meta.canSave = meta.canSave === false ? false : true; - meta.canStar = meta.canStar === false ? false : true; - meta.canEdit = meta.canEdit === false ? false : true; + meta.canShare = meta.canShare !== false; + meta.canSave = meta.canSave !== false; + meta.canStar = meta.canStar !== false; + meta.canEdit = meta.canEdit !== false; if (!this.editable) { meta.canEdit = false; @@ -118,7 +117,7 @@ function (angular, $, kbn, _, moment) { },0); }; - p.add_panel = function(panel, row) { + p.addPanel = function(panel, row) { var rowSpan = this.rowSpan(row); var panelCount = row.panels.length; var space = (12 - rowSpan) - panel.span; @@ -152,7 +151,6 @@ function (angular, $, kbn, _, moment) { result.panel = panel; result.row = row; result.index = index; - return; } }); }); @@ -231,9 +229,9 @@ function (angular, $, kbn, _, moment) { var i, j, k; var oldVersion = this.schemaVersion; var panelUpgrades = []; - this.schemaVersion = 7; + this.schemaVersion = 8; - if (oldVersion === 7) { + if (oldVersion === 8) { return; } @@ -328,9 +326,63 @@ function (angular, $, kbn, _, moment) { } } - if (oldVersion < 7 && old.nav && old.nav.length) { - this.timepicker = old.nav[0]; - delete this.nav; + if (oldVersion < 7) { + if (old.nav && old.nav.length) { + this.timepicker = old.nav[0]; + delete this.nav; + } + + // ensure query refIds + panelUpgrades.push(function(panel) { + _.each(panel.targets, function(target) { + if (!target.refId) { + target.refId = this.getNextQueryLetter(panel); + } + }, this); + }); + } + + if (oldVersion < 8) { + panelUpgrades.push(function(panel) { + _.each(panel.targets, function(target) { + // update old influxdb query schema + if (target.fields && target.tags && target.groupBy) { + if (target.rawQuery) { + delete target.fields; + delete target.fill; + } else { + target.select = _.map(target.fields, function(field) { + var parts = []; + parts.push({type: 'field', params: [field.name]}); + parts.push({type: field.func, params: []}); + if (field.mathExpr) { + parts.push({type: 'math', params: [field.mathExpr]}); + } + if (field.asExpr) { + parts.push({type: 'alias', params: [field.asExpr]}); + } + return parts; + }); + delete target.fields; + _.each(target.groupBy, function(part) { + if (part.type === 'time' && part.interval) { + part.params = [part.interval]; + delete part.interval; + } + if (part.type === 'tag' && part.key) { + part.params = [part.key]; + delete part.key; + } + }); + + if (target.fill) { + target.groupBy.push({type: 'fill', params: [target.fill]}); + delete target.fill; + } + } + } + }); + }); } if (panelUpgrades.length === 0) { @@ -341,7 +393,7 @@ function (angular, $, kbn, _, moment) { var row = this.rows[i]; for (j = 0; j < row.panels.length; j++) { for (k = 0; k < panelUpgrades.length; k++) { - panelUpgrades[k](row.panels[j]); + panelUpgrades[k].call(this, row.panels[j]); } } } diff --git a/public/app/features/dashboard/graphiteImportCtrl.js b/public/app/features/dashboard/graphiteImportCtrl.js index 2b6660c2a22..53338883274 100644 --- a/public/app/features/dashboard/graphiteImportCtrl.js +++ b/public/app/features/dashboard/graphiteImportCtrl.js @@ -1,7 +1,7 @@ define([ 'angular', 'lodash', - 'kbn' + 'app/core/utils/kbn' ], function (angular, _, kbn) { 'use strict'; diff --git a/public/app/features/dashboard/keybindings.js b/public/app/features/dashboard/keybindings.js index b417382bc45..2219cab2d4c 100644 --- a/public/app/features/dashboard/keybindings.js +++ b/public/app/features/dashboard/keybindings.js @@ -33,7 +33,7 @@ function(angular, $) { }, { inputDisabled: true }); - keyboardManager.bind('ctrl+f', function() { + keyboardManager.bind('f', function() { scope.appEvent('show-dash-search'); }, { inputDisabled: true }); diff --git a/public/app/features/dashboard/partials/graphiteImport.html b/public/app/features/dashboard/partials/graphiteImport.html index 343b5d52e41..9c351346fe6 100644 --- a/public/app/features/dashboard/partials/graphiteImport.html +++ b/public/app/features/dashboard/partials/graphiteImport.html @@ -25,7 +25,7 @@ diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index 543fad9de22..541ef45e9ab 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -77,28 +77,30 @@
    Rows settings
    -
    -
      -
    • - Title -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    +
    +
    +
      +
    • + Title +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    diff --git a/public/app/features/dashboard/playlistCtrl.js b/public/app/features/dashboard/playlistCtrl.js index b5d04374e9a..9242905405a 100644 --- a/public/app/features/dashboard/playlistCtrl.js +++ b/public/app/features/dashboard/playlistCtrl.js @@ -1,7 +1,7 @@ define([ 'angular', 'lodash', - 'config' + 'app/core/config' ], function (angular, _, config) { 'use strict'; diff --git a/public/app/features/dashboard/playlistSrv.js b/public/app/features/dashboard/playlistSrv.js index 9997581fbc3..bf4587f6c48 100644 --- a/public/app/features/dashboard/playlistSrv.js +++ b/public/app/features/dashboard/playlistSrv.js @@ -1,8 +1,7 @@ define([ 'angular', 'lodash', - 'kbn', - 'store' + 'app/core/utils/kbn', ], function (angular, _, kbn) { 'use strict'; diff --git a/public/app/features/dashboard/rowCtrl.js b/public/app/features/dashboard/rowCtrl.js index 27365f7bd1c..723481d2d65 100644 --- a/public/app/features/dashboard/rowCtrl.js +++ b/public/app/features/dashboard/rowCtrl.js @@ -1,7 +1,7 @@ define([ 'angular', 'lodash', - 'config' + 'app/core/config' ], function (angular, _, config) { 'use strict'; @@ -28,7 +28,7 @@ function (angular, _, config) { $scope.panelMenuPos = posX; }; - $scope.toggle_row = function(row) { + $scope.toggleRow = function(row) { row.collapse = row.collapse ? false : true; if (!row.collapse) { $timeout(function() { @@ -37,11 +37,11 @@ function (angular, _, config) { } }; - $scope.add_panel = function(panel) { - $scope.dashboard.add_panel(panel, $scope.row); + $scope.addPanel = function(panel) { + $scope.dashboard.addPanel(panel, $scope.row); }; - $scope.delete_row = function() { + $scope.deleteRow = function() { $scope.appEvent('confirm-modal', { title: 'Are you sure you want to delete this row?', icon: 'fa-trash', @@ -52,16 +52,37 @@ function (angular, _, config) { }); }; - $scope.move_row = function(direction) { + $scope.moveRow = function(direction) { var rowsList = $scope.dashboard.rows; var rowIndex = _.indexOf(rowsList, $scope.row); - var newIndex = rowIndex + direction; + var newIndex = rowIndex; + switch(direction) { + case 'up': { + newIndex = rowIndex - 1; + break; + } + case 'down': { + newIndex = rowIndex + 1; + break; + } + case 'top': { + newIndex = 0; + break; + } + case 'bottom': { + newIndex = rowsList.length - 1; + break; + } + default: { + newIndex = rowIndex; + } + } if (newIndex >= 0 && newIndex <= (rowsList.length - 1)) { - _.move(rowsList, rowIndex, rowIndex + direction); + _.move(rowsList, rowIndex, newIndex); } }; - $scope.add_panel_default = function(type) { + $scope.addPanelDefault = function(type) { var defaultSpan = 12; var _as = 12 - $scope.dashboard.rowSpan($scope.row); @@ -70,17 +91,18 @@ function (angular, _, config) { error: false, span: _as < defaultSpan && _as > 0 ? _as : defaultSpan, editable: true, - type: type + type: type, + isNew: true, }; - $scope.add_panel(panel); + $scope.addPanel(panel); $timeout(function() { - $scope.$broadcast('render'); + $scope.dashboardViewState.update({fullscreen: true, edit: true, panelId: panel.id }); }); }; - $scope.set_height = function(height) { + $scope.setHeight = function(height) { $scope.row.height = height; $scope.$broadcast('render'); }; diff --git a/public/app/features/dashboard/shareModalCtrl.js b/public/app/features/dashboard/shareModalCtrl.js index 5afee9d39cd..b723660abe7 100644 --- a/public/app/features/dashboard/shareModalCtrl.js +++ b/public/app/features/dashboard/shareModalCtrl.js @@ -2,7 +2,7 @@ define([ 'angular', 'lodash', 'require', - 'config', + 'app/core/config', ], function (angular, _, require, config) { 'use strict'; @@ -75,7 +75,7 @@ function (angular, _, require, config) { $scope.iframeHtml = ''; - $scope.imageUrl = soloUrl.replace('/dashboard', '/render/dashboard'); + $scope.imageUrl = soloUrl.replace('/dashboard-solo/', '/render/dashboard-solo/'); $scope.imageUrl += '&width=1000'; $scope.imageUrl += '&height=500'; }; @@ -84,9 +84,9 @@ function (angular, _, require, config) { module.directive('clipboardButton',function() { return function(scope, elem) { - require(['ZeroClipboard'], function(ZeroClipboard) { + require(['vendor/zero_clipboard'], function(ZeroClipboard) { ZeroClipboard.config({ - swfPath: config.appSubUrl + '/public/vendor/ZeroClipboard.swf' + swfPath: config.appSubUrl + '/public/vendor/zero_clipboard.swf' }); new ZeroClipboard(elem[0]); }); diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js index be05a1f8a70..691bfd07904 100644 --- a/public/app/features/dashboard/timeSrv.js +++ b/public/app/features/dashboard/timeSrv.js @@ -1,11 +1,11 @@ define([ 'angular', 'lodash', - 'config', - 'kbn', 'moment', + 'app/core/config', + 'app/core/utils/kbn', 'app/core/utils/datemath' -], function (angular, _, config, kbn, moment, dateMath) { +], function (angular, _, moment, config, kbn, dateMath) { 'use strict'; var module = angular.module('grafana.services'); @@ -90,11 +90,11 @@ define([ timer.cancel(this.refresh_timer); }; - this.setTime = function(time) { + this.setTime = function(time, enableRefresh) { _.extend(this.time, time); - // disable refresh if we have an absolute time - if (moment.isMoment(time.to)) { + // disable refresh if zoom in or zoom out + if (!enableRefresh && moment.isMoment(time.to)) { this.old_refresh = this.dashboard.refresh || this.old_refresh; this.setAutoRefresh(false); } diff --git a/public/app/features/dashboard/timepicker/timepicker.ts b/public/app/features/dashboard/timepicker/timepicker.ts index bda002d59cd..0f99210f3fa 100644 --- a/public/app/features/dashboard/timepicker/timepicker.ts +++ b/public/app/features/dashboard/timepicker/timepicker.ts @@ -4,7 +4,7 @@ import angular = require('angular'); import _ = require('lodash'); import moment = require('moment'); -import kbn = require('kbn'); +import kbn = require('app/core/utils/kbn'); import dateMath = require('app/core/utils/datemath'); import rangeUtil = require('app/core/utils/rangeutil'); @@ -115,7 +115,7 @@ export class TimePickerCtrl { this.timeSrv.setAutoRefresh(this.refresh.value); } - this.timeSrv.setTime(this.timeRaw); + this.timeSrv.setTime(this.timeRaw, true); this.$rootScope.appEvent('hide-dash-editor'); } diff --git a/public/app/features/dashboard/unsavedChangesSrv.js b/public/app/features/dashboard/unsavedChangesSrv.js index 758c06b1975..bbb38d745c7 100644 --- a/public/app/features/dashboard/unsavedChangesSrv.js +++ b/public/app/features/dashboard/unsavedChangesSrv.js @@ -122,11 +122,7 @@ function(angular, _) { var currentJson = angular.toJson(current); var originalJson = angular.toJson(original); - if (currentJson !== originalJson) { - return true; - } - - return false; + return currentJson !== originalJson; }; p.open_modal = function() { diff --git a/public/app/features/dashboard/viewStateSrv.js b/public/app/features/dashboard/viewStateSrv.js index 749aced2bf2..58403766a31 100644 --- a/public/app/features/dashboard/viewStateSrv.js +++ b/public/app/features/dashboard/viewStateSrv.js @@ -89,6 +89,11 @@ function (angular, _, $) { this.leaveFullscreen(false); } var panelScope = this.getPanelScope(this.state.panelId); + // panel could be about to be created/added and scope does + // not exist yet + if (!panelScope) { + return; + } this.enterFullscreen(panelScope); return; } diff --git a/public/app/features/dashlinks/module.js b/public/app/features/dashlinks/module.js index 6b5677e5d2d..b7029e6cf2d 100644 --- a/public/app/features/dashlinks/module.js +++ b/public/app/features/dashlinks/module.js @@ -52,7 +52,7 @@ function (angular, _) { if (link.asDropdown) { template += '