Upgrade AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2017-09-28 17:57:05 +03:00
parent 9a767b7631
commit 182c21e38c
1096 changed files with 309697 additions and 132612 deletions
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package directconnectiface provides an interface to enable mocking the AWS Direct Connect service client
// for testing your code.
@@ -21,7 +21,7 @@ import (
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the the SDK's request pipeline.
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // AWS Direct Connect.
+39
View File
@@ -0,0 +1,39 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package directconnect provides the client and types for making API
// requests to AWS Direct Connect.
//
// AWS Direct Connect links your internal network to an AWS Direct Connect location
// over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end
// of the cable is connected to your router, the other to an AWS Direct Connect
// router. With this connection in place, you can create virtual interfaces
// directly to the AWS cloud (for example, to Amazon Elastic Compute Cloud (Amazon
// EC2) and Amazon Simple Storage Service (Amazon S3)) and to Amazon Virtual
// Private Cloud (Amazon VPC), bypassing Internet service providers in your
// network path. An AWS Direct Connect location provides access to AWS in the
// region it is associated with, as well as access to other US regions. For
// example, you can provision a single connection to any AWS Direct Connect
// location in the US and use it to access public AWS services in all US Regions
// and AWS GovCloud (US).
//
// See https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25 for more information on this service.
//
// See directconnect package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/directconnect/
//
// Using the Client
//
// To AWS Direct Connect with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS Direct Connect client DirectConnect for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/directconnect/#New
package directconnect
+1 -1
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package directconnect
-895
View File
@@ -1,895 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package directconnect_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/directconnect"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleDirectConnect_AllocateConnectionOnInterconnect() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AllocateConnectionOnInterconnectInput{
Bandwidth: aws.String("Bandwidth"), // Required
ConnectionName: aws.String("ConnectionName"), // Required
InterconnectId: aws.String("InterconnectId"), // Required
OwnerAccount: aws.String("OwnerAccount"), // Required
Vlan: aws.Int64(1), // Required
}
resp, err := svc.AllocateConnectionOnInterconnect(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 ExampleDirectConnect_AllocateHostedConnection() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AllocateHostedConnectionInput{
Bandwidth: aws.String("Bandwidth"), // Required
ConnectionId: aws.String("ConnectionId"), // Required
ConnectionName: aws.String("ConnectionName"), // Required
OwnerAccount: aws.String("OwnerAccount"), // Required
Vlan: aws.Int64(1), // Required
}
resp, err := svc.AllocateHostedConnection(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 ExampleDirectConnect_AllocatePrivateVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AllocatePrivateVirtualInterfaceInput{
ConnectionId: aws.String("ConnectionId"), // Required
NewPrivateVirtualInterfaceAllocation: &directconnect.NewPrivateVirtualInterfaceAllocation{ // Required
Asn: aws.Int64(1), // Required
VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
Vlan: aws.Int64(1), // Required
AddressFamily: aws.String("AddressFamily"),
AmazonAddress: aws.String("AmazonAddress"),
AuthKey: aws.String("BGPAuthKey"),
CustomerAddress: aws.String("CustomerAddress"),
},
OwnerAccount: aws.String("OwnerAccount"), // Required
}
resp, err := svc.AllocatePrivateVirtualInterface(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 ExampleDirectConnect_AllocatePublicVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AllocatePublicVirtualInterfaceInput{
ConnectionId: aws.String("ConnectionId"), // Required
NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ // Required
Asn: aws.Int64(1), // Required
VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
Vlan: aws.Int64(1), // Required
AddressFamily: aws.String("AddressFamily"),
AmazonAddress: aws.String("AmazonAddress"),
AuthKey: aws.String("BGPAuthKey"),
CustomerAddress: aws.String("CustomerAddress"),
RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{
{ // Required
Cidr: aws.String("CIDR"),
},
// More values...
},
},
OwnerAccount: aws.String("OwnerAccount"), // Required
}
resp, err := svc.AllocatePublicVirtualInterface(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 ExampleDirectConnect_AssociateConnectionWithLag() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AssociateConnectionWithLagInput{
ConnectionId: aws.String("ConnectionId"), // Required
LagId: aws.String("LagId"), // Required
}
resp, err := svc.AssociateConnectionWithLag(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 ExampleDirectConnect_AssociateHostedConnection() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AssociateHostedConnectionInput{
ConnectionId: aws.String("ConnectionId"), // Required
ParentConnectionId: aws.String("ConnectionId"), // Required
}
resp, err := svc.AssociateHostedConnection(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 ExampleDirectConnect_AssociateVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.AssociateVirtualInterfaceInput{
ConnectionId: aws.String("ConnectionId"), // Required
VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
}
resp, err := svc.AssociateVirtualInterface(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 ExampleDirectConnect_ConfirmConnection() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.ConfirmConnectionInput{
ConnectionId: aws.String("ConnectionId"), // Required
}
resp, err := svc.ConfirmConnection(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 ExampleDirectConnect_ConfirmPrivateVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.ConfirmPrivateVirtualInterfaceInput{
VirtualGatewayId: aws.String("VirtualGatewayId"), // Required
VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
}
resp, err := svc.ConfirmPrivateVirtualInterface(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 ExampleDirectConnect_ConfirmPublicVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.ConfirmPublicVirtualInterfaceInput{
VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
}
resp, err := svc.ConfirmPublicVirtualInterface(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 ExampleDirectConnect_CreateBGPPeer() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreateBGPPeerInput{
NewBGPPeer: &directconnect.NewBGPPeer{
AddressFamily: aws.String("AddressFamily"),
AmazonAddress: aws.String("AmazonAddress"),
Asn: aws.Int64(1),
AuthKey: aws.String("BGPAuthKey"),
CustomerAddress: aws.String("CustomerAddress"),
},
VirtualInterfaceId: aws.String("VirtualInterfaceId"),
}
resp, err := svc.CreateBGPPeer(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 ExampleDirectConnect_CreateConnection() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreateConnectionInput{
Bandwidth: aws.String("Bandwidth"), // Required
ConnectionName: aws.String("ConnectionName"), // Required
Location: aws.String("LocationCode"), // Required
LagId: aws.String("LagId"),
}
resp, err := svc.CreateConnection(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 ExampleDirectConnect_CreateInterconnect() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreateInterconnectInput{
Bandwidth: aws.String("Bandwidth"), // Required
InterconnectName: aws.String("InterconnectName"), // Required
Location: aws.String("LocationCode"), // Required
LagId: aws.String("LagId"),
}
resp, err := svc.CreateInterconnect(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 ExampleDirectConnect_CreateLag() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreateLagInput{
ConnectionsBandwidth: aws.String("Bandwidth"), // Required
LagName: aws.String("LagName"), // Required
Location: aws.String("LocationCode"), // Required
NumberOfConnections: aws.Int64(1), // Required
ConnectionId: aws.String("ConnectionId"),
}
resp, err := svc.CreateLag(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 ExampleDirectConnect_CreatePrivateVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreatePrivateVirtualInterfaceInput{
ConnectionId: aws.String("ConnectionId"), // Required
NewPrivateVirtualInterface: &directconnect.NewPrivateVirtualInterface{ // Required
Asn: aws.Int64(1), // Required
VirtualGatewayId: aws.String("VirtualGatewayId"), // Required
VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
Vlan: aws.Int64(1), // Required
AddressFamily: aws.String("AddressFamily"),
AmazonAddress: aws.String("AmazonAddress"),
AuthKey: aws.String("BGPAuthKey"),
CustomerAddress: aws.String("CustomerAddress"),
},
}
resp, err := svc.CreatePrivateVirtualInterface(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 ExampleDirectConnect_CreatePublicVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.CreatePublicVirtualInterfaceInput{
ConnectionId: aws.String("ConnectionId"), // Required
NewPublicVirtualInterface: &directconnect.NewPublicVirtualInterface{ // Required
Asn: aws.Int64(1), // Required
VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
Vlan: aws.Int64(1), // Required
AddressFamily: aws.String("AddressFamily"),
AmazonAddress: aws.String("AmazonAddress"),
AuthKey: aws.String("BGPAuthKey"),
CustomerAddress: aws.String("CustomerAddress"),
RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{
{ // Required
Cidr: aws.String("CIDR"),
},
// More values...
},
},
}
resp, err := svc.CreatePublicVirtualInterface(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 ExampleDirectConnect_DeleteBGPPeer() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DeleteBGPPeerInput{
Asn: aws.Int64(1),
CustomerAddress: aws.String("CustomerAddress"),
VirtualInterfaceId: aws.String("VirtualInterfaceId"),
}
resp, err := svc.DeleteBGPPeer(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 ExampleDirectConnect_DeleteConnection() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DeleteConnectionInput{
ConnectionId: aws.String("ConnectionId"), // Required
}
resp, err := svc.DeleteConnection(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 ExampleDirectConnect_DeleteInterconnect() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DeleteInterconnectInput{
InterconnectId: aws.String("InterconnectId"), // Required
}
resp, err := svc.DeleteInterconnect(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 ExampleDirectConnect_DeleteLag() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DeleteLagInput{
LagId: aws.String("LagId"), // Required
}
resp, err := svc.DeleteLag(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 ExampleDirectConnect_DeleteVirtualInterface() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DeleteVirtualInterfaceInput{
VirtualInterfaceId: aws.String("VirtualInterfaceId"), // Required
}
resp, err := svc.DeleteVirtualInterface(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 ExampleDirectConnect_DescribeConnectionLoa() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeConnectionLoaInput{
ConnectionId: aws.String("ConnectionId"), // Required
LoaContentType: aws.String("LoaContentType"),
ProviderName: aws.String("ProviderName"),
}
resp, err := svc.DescribeConnectionLoa(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 ExampleDirectConnect_DescribeConnections() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeConnectionsInput{
ConnectionId: aws.String("ConnectionId"),
}
resp, err := svc.DescribeConnections(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 ExampleDirectConnect_DescribeConnectionsOnInterconnect() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeConnectionsOnInterconnectInput{
InterconnectId: aws.String("InterconnectId"), // Required
}
resp, err := svc.DescribeConnectionsOnInterconnect(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 ExampleDirectConnect_DescribeHostedConnections() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeHostedConnectionsInput{
ConnectionId: aws.String("ConnectionId"), // Required
}
resp, err := svc.DescribeHostedConnections(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 ExampleDirectConnect_DescribeInterconnectLoa() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeInterconnectLoaInput{
InterconnectId: aws.String("InterconnectId"), // Required
LoaContentType: aws.String("LoaContentType"),
ProviderName: aws.String("ProviderName"),
}
resp, err := svc.DescribeInterconnectLoa(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 ExampleDirectConnect_DescribeInterconnects() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeInterconnectsInput{
InterconnectId: aws.String("InterconnectId"),
}
resp, err := svc.DescribeInterconnects(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 ExampleDirectConnect_DescribeLags() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeLagsInput{
LagId: aws.String("LagId"),
}
resp, err := svc.DescribeLags(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 ExampleDirectConnect_DescribeLoa() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeLoaInput{
ConnectionId: aws.String("ConnectionId"), // Required
LoaContentType: aws.String("LoaContentType"),
ProviderName: aws.String("ProviderName"),
}
resp, err := svc.DescribeLoa(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 ExampleDirectConnect_DescribeLocations() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
var params *directconnect.DescribeLocationsInput
resp, err := svc.DescribeLocations(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 ExampleDirectConnect_DescribeTags() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeTagsInput{
ResourceArns: []*string{ // Required
aws.String("ResourceArn"), // Required
// More values...
},
}
resp, err := svc.DescribeTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleDirectConnect_DescribeVirtualGateways() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
var params *directconnect.DescribeVirtualGatewaysInput
resp, err := svc.DescribeVirtualGateways(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 ExampleDirectConnect_DescribeVirtualInterfaces() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DescribeVirtualInterfacesInput{
ConnectionId: aws.String("ConnectionId"),
VirtualInterfaceId: aws.String("VirtualInterfaceId"),
}
resp, err := svc.DescribeVirtualInterfaces(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 ExampleDirectConnect_DisassociateConnectionFromLag() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.DisassociateConnectionFromLagInput{
ConnectionId: aws.String("ConnectionId"), // Required
LagId: aws.String("LagId"), // Required
}
resp, err := svc.DisassociateConnectionFromLag(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 ExampleDirectConnect_TagResource() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.TagResourceInput{
ResourceArn: aws.String("ResourceArn"), // Required
Tags: []*directconnect.Tag{ // Required
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"),
},
// More values...
},
}
resp, err := svc.TagResource(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 ExampleDirectConnect_UntagResource() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.UntagResourceInput{
ResourceArn: aws.String("ResourceArn"), // Required
TagKeys: []*string{ // Required
aws.String("TagKey"), // Required
// More values...
},
}
resp, err := svc.UntagResource(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 ExampleDirectConnect_UpdateLag() {
sess := session.Must(session.NewSession())
svc := directconnect.New(sess)
params := &directconnect.UpdateLagInput{
LagId: aws.String("LagId"), // Required
LagName: aws.String("LagName"),
MinimumLinks: aws.Int64(1),
}
resp, err := svc.UpdateLag(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)
}
+7 -16
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package directconnect
@@ -11,21 +11,12 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
// AWS Direct Connect links your internal network to an AWS Direct Connect location
// over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end
// of the cable is connected to your router, the other to an AWS Direct Connect
// router. With this connection in place, you can create virtual interfaces
// directly to the AWS cloud (for example, to Amazon Elastic Compute Cloud (Amazon
// EC2) and Amazon Simple Storage Service (Amazon S3)) and to Amazon Virtual
// Private Cloud (Amazon VPC), bypassing Internet service providers in your
// network path. An AWS Direct Connect location provides access to AWS in the
// region it is associated with, as well as access to other US regions. For
// example, you can provision a single connection to any AWS Direct Connect
// location in the US and use it to access public AWS services in all US Regions
// and AWS GovCloud (US).
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25
// DirectConnect provides the API operation methods for making requests to
// AWS Direct Connect. See this package's package overview docs
// for details on the service.
//
// DirectConnect methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type DirectConnect struct {
*client.Client
}