123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package configservice_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/configservice"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleConfigService_DeleteDeliveryChannel() {
- svc := configservice.New(nil)
- params := &configservice.DeleteDeliveryChannelInput{
- DeliveryChannelName: aws.String("ChannelName"), // Required
- }
- resp, err := svc.DeleteDeliveryChannel(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 ExampleConfigService_DeliverConfigSnapshot() {
- svc := configservice.New(nil)
- params := &configservice.DeliverConfigSnapshotInput{
- DeliveryChannelName: aws.String("ChannelName"), // Required
- }
- resp, err := svc.DeliverConfigSnapshot(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 ExampleConfigService_DescribeConfigurationRecorderStatus() {
- svc := configservice.New(nil)
- params := &configservice.DescribeConfigurationRecorderStatusInput{
- ConfigurationRecorderNames: []*string{
- aws.String("RecorderName"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeConfigurationRecorderStatus(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 ExampleConfigService_DescribeConfigurationRecorders() {
- svc := configservice.New(nil)
- params := &configservice.DescribeConfigurationRecordersInput{
- ConfigurationRecorderNames: []*string{
- aws.String("RecorderName"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeConfigurationRecorders(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 ExampleConfigService_DescribeDeliveryChannelStatus() {
- svc := configservice.New(nil)
- params := &configservice.DescribeDeliveryChannelStatusInput{
- DeliveryChannelNames: []*string{
- aws.String("ChannelName"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeDeliveryChannelStatus(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 ExampleConfigService_DescribeDeliveryChannels() {
- svc := configservice.New(nil)
- params := &configservice.DescribeDeliveryChannelsInput{
- DeliveryChannelNames: []*string{
- aws.String("ChannelName"), // Required
- // More values...
- },
- }
- resp, err := svc.DescribeDeliveryChannels(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 ExampleConfigService_GetResourceConfigHistory() {
- svc := configservice.New(nil)
- params := &configservice.GetResourceConfigHistoryInput{
- ResourceId: aws.String("ResourceId"), // Required
- ResourceType: aws.String("ResourceType"), // Required
- ChronologicalOrder: aws.String("ChronologicalOrder"),
- EarlierTime: aws.Time(time.Now()),
- LaterTime: aws.Time(time.Now()),
- Limit: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.GetResourceConfigHistory(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 ExampleConfigService_ListDiscoveredResources() {
- svc := configservice.New(nil)
- params := &configservice.ListDiscoveredResourcesInput{
- ResourceType: aws.String("ResourceType"), // Required
- IncludeDeletedResources: aws.Bool(true),
- Limit: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- ResourceIds: []*string{
- aws.String("ResourceId"), // Required
- // More values...
- },
- ResourceName: aws.String("ResourceName"),
- }
- resp, err := svc.ListDiscoveredResources(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 ExampleConfigService_PutConfigurationRecorder() {
- svc := configservice.New(nil)
- params := &configservice.PutConfigurationRecorderInput{
- ConfigurationRecorder: &configservice.ConfigurationRecorder{ // Required
- Name: aws.String("RecorderName"),
- RecordingGroup: &configservice.RecordingGroup{
- AllSupported: aws.Bool(true),
- ResourceTypes: []*string{
- aws.String("ResourceType"), // Required
- // More values...
- },
- },
- RoleARN: aws.String("String"),
- },
- }
- resp, err := svc.PutConfigurationRecorder(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 ExampleConfigService_PutDeliveryChannel() {
- svc := configservice.New(nil)
- params := &configservice.PutDeliveryChannelInput{
- DeliveryChannel: &configservice.DeliveryChannel{ // Required
- Name: aws.String("ChannelName"),
- S3BucketName: aws.String("String"),
- S3KeyPrefix: aws.String("String"),
- SnsTopicARN: aws.String("String"),
- },
- }
- resp, err := svc.PutDeliveryChannel(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 ExampleConfigService_StartConfigurationRecorder() {
- svc := configservice.New(nil)
- params := &configservice.StartConfigurationRecorderInput{
- ConfigurationRecorderName: aws.String("RecorderName"), // Required
- }
- resp, err := svc.StartConfigurationRecorder(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 ExampleConfigService_StopConfigurationRecorder() {
- svc := configservice.New(nil)
- params := &configservice.StopConfigurationRecorderInput{
- ConfigurationRecorderName: aws.String("RecorderName"), // Required
- }
- resp, err := svc.StopConfigurationRecorder(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)
- }
|