123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- // 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/service/directconnect"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleDirectConnect_AllocateConnectionOnInterconnect() {
- svc := directconnect.New(nil)
- 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_AllocatePrivateVirtualInterface() {
- svc := directconnect.New(nil)
- 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
- 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() {
- svc := directconnect.New(nil)
- params := &directconnect.AllocatePublicVirtualInterfaceInput{
- ConnectionId: aws.String("ConnectionId"), // Required
- NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ // Required
- AmazonAddress: aws.String("AmazonAddress"), // Required
- Asn: aws.Int64(1), // Required
- CustomerAddress: aws.String("CustomerAddress"), // Required
- RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{ // Required
- { // Required
- Cidr: aws.String("CIDR"),
- },
- // More values...
- },
- VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
- Vlan: aws.Int64(1), // Required
- AuthKey: aws.String("BGPAuthKey"),
- },
- 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_ConfirmConnection() {
- svc := directconnect.New(nil)
- 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() {
- svc := directconnect.New(nil)
- 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() {
- svc := directconnect.New(nil)
- 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_CreateConnection() {
- svc := directconnect.New(nil)
- params := &directconnect.CreateConnectionInput{
- Bandwidth: aws.String("Bandwidth"), // Required
- ConnectionName: aws.String("ConnectionName"), // Required
- Location: aws.String("LocationCode"), // Required
- }
- 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() {
- svc := directconnect.New(nil)
- params := &directconnect.CreateInterconnectInput{
- Bandwidth: aws.String("Bandwidth"), // Required
- InterconnectName: aws.String("InterconnectName"), // Required
- Location: aws.String("LocationCode"), // Required
- }
- 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_CreatePrivateVirtualInterface() {
- svc := directconnect.New(nil)
- 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
- 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() {
- svc := directconnect.New(nil)
- params := &directconnect.CreatePublicVirtualInterfaceInput{
- ConnectionId: aws.String("ConnectionId"), // Required
- NewPublicVirtualInterface: &directconnect.NewPublicVirtualInterface{ // Required
- AmazonAddress: aws.String("AmazonAddress"), // Required
- Asn: aws.Int64(1), // Required
- CustomerAddress: aws.String("CustomerAddress"), // Required
- RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{ // Required
- { // Required
- Cidr: aws.String("CIDR"),
- },
- // More values...
- },
- VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
- Vlan: aws.Int64(1), // Required
- AuthKey: aws.String("BGPAuthKey"),
- },
- }
- 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_DeleteConnection() {
- svc := directconnect.New(nil)
- 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() {
- svc := directconnect.New(nil)
- 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_DeleteVirtualInterface() {
- svc := directconnect.New(nil)
- 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_DescribeConnections() {
- svc := directconnect.New(nil)
- 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() {
- svc := directconnect.New(nil)
- 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_DescribeInterconnects() {
- svc := directconnect.New(nil)
- 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_DescribeLocations() {
- svc := directconnect.New(nil)
- 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_DescribeVirtualGateways() {
- svc := directconnect.New(nil)
- 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() {
- svc := directconnect.New(nil)
- 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)
- }
|