コード例 #1
0
func ExampleCloudTrail_UpdateTrail() {
	svc := cloudtrail.New(nil)

	params := &cloudtrail.UpdateTrailInput{
		Name: aws.String("String"), // Required
		CloudWatchLogsLogGroupARN:  aws.String("String"),
		CloudWatchLogsRoleARN:      aws.String("String"),
		IncludeGlobalServiceEvents: aws.Boolean(true),
		S3BucketName:               aws.String("String"),
		S3KeyPrefix:                aws.String("String"),
		SNSTopicName:               aws.String("String"),
	}
	resp, err := svc.UpdateTrail(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
コード例 #2
0
func ExampleCloudTrail_LookupEvents() {
	svc := cloudtrail.New(nil)

	params := &cloudtrail.LookupEventsInput{
		EndTime: aws.Time(time.Now()),
		LookupAttributes: []*cloudtrail.LookupAttribute{
			&cloudtrail.LookupAttribute{ // Required
				AttributeKey:   aws.String("LookupAttributeKey"), // Required
				AttributeValue: aws.String("String"),             // Required
			},
			// More values...
		},
		MaxResults: aws.Long(1),
		NextToken:  aws.String("NextToken"),
		StartTime:  aws.Time(time.Now()),
	}
	resp, err := svc.LookupEvents(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
コード例 #3
0
func ExampleCloudTrail_GetTrailStatus() {
	svc := cloudtrail.New(nil)

	params := &cloudtrail.GetTrailStatusInput{
		Name: aws.String("String"), // Required
	}
	resp, err := svc.GetTrailStatus(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}
コード例 #4
0
func ExampleCloudTrail_DescribeTrails() {
	svc := cloudtrail.New(nil)

	params := &cloudtrail.DescribeTrailsInput{
		TrailNameList: []*string{
			aws.String("String"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeTrails(params)

	if awserr := aws.Error(err); awserr != nil {
		// A service error occurred.
		fmt.Println("Error:", awserr.Code, awserr.Message)
	} else if err != nil {
		// A non-service error occurred.
		panic(err)
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}