vendor: update all dependencies
This commit is contained in:
parent
0b6fba34a3
commit
eb87cf6f12
2008 changed files with 352633 additions and 1004750 deletions
506
vendor/github.com/aws/aws-sdk-go/service/efs/examples_test.go
generated
vendored
506
vendor/github.com/aws/aws-sdk-go/service/efs/examples_test.go
generated
vendored
|
@ -3,275 +3,435 @@
|
|||
package efs_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/efs"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleEFS_CreateFileSystem() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.CreateFileSystemInput{
|
||||
CreationToken: aws.String("CreationToken"), // Required
|
||||
PerformanceMode: aws.String("PerformanceMode"),
|
||||
}
|
||||
resp, err := svc.CreateFileSystem(params)
|
||||
var _ strings.Reader
|
||||
var _ aws.Config
|
||||
|
||||
func parseTime(layout, value string) *time.Time {
|
||||
t, err := time.Parse(layout, value)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
panic(err)
|
||||
}
|
||||
return &t
|
||||
}
|
||||
|
||||
// To create a new file system
|
||||
//
|
||||
// This operation creates a new file system with the default generalpurpose performance
|
||||
// mode.
|
||||
func ExampleEFS_CreateFileSystem_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.CreateFileSystemInput{
|
||||
CreationToken: aws.String("tokenstring"),
|
||||
PerformanceMode: aws.String("generalPurpose"),
|
||||
}
|
||||
|
||||
result, err := svc.CreateFileSystem(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemAlreadyExists:
|
||||
fmt.Println(efs.ErrCodeFileSystemAlreadyExists, aerr.Error())
|
||||
case efs.ErrCodeFileSystemLimitExceeded:
|
||||
fmt.Println(efs.ErrCodeFileSystemLimitExceeded, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_CreateMountTarget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.CreateMountTargetInput{
|
||||
FileSystemId: aws.String("FileSystemId"), // Required
|
||||
SubnetId: aws.String("SubnetId"), // Required
|
||||
IpAddress: aws.String("IpAddress"),
|
||||
SecurityGroups: []*string{
|
||||
aws.String("SecurityGroup"), // Required
|
||||
// More values...
|
||||
},
|
||||
// To create a new mount target
|
||||
//
|
||||
// This operation creates a new mount target for an EFS file system.
|
||||
func ExampleEFS_CreateMountTarget_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.CreateMountTargetInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
SubnetId: aws.String("subnet-1234abcd"),
|
||||
}
|
||||
resp, err := svc.CreateMountTarget(params)
|
||||
|
||||
result, err := svc.CreateMountTarget(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
case efs.ErrCodeIncorrectFileSystemLifeCycleState:
|
||||
fmt.Println(efs.ErrCodeIncorrectFileSystemLifeCycleState, aerr.Error())
|
||||
case efs.ErrCodeMountTargetConflict:
|
||||
fmt.Println(efs.ErrCodeMountTargetConflict, aerr.Error())
|
||||
case efs.ErrCodeSubnetNotFound:
|
||||
fmt.Println(efs.ErrCodeSubnetNotFound, aerr.Error())
|
||||
case efs.ErrCodeNoFreeAddressesInSubnet:
|
||||
fmt.Println(efs.ErrCodeNoFreeAddressesInSubnet, aerr.Error())
|
||||
case efs.ErrCodeIpAddressInUse:
|
||||
fmt.Println(efs.ErrCodeIpAddressInUse, aerr.Error())
|
||||
case efs.ErrCodeNetworkInterfaceLimitExceeded:
|
||||
fmt.Println(efs.ErrCodeNetworkInterfaceLimitExceeded, aerr.Error())
|
||||
case efs.ErrCodeSecurityGroupLimitExceeded:
|
||||
fmt.Println(efs.ErrCodeSecurityGroupLimitExceeded, aerr.Error())
|
||||
case efs.ErrCodeSecurityGroupNotFound:
|
||||
fmt.Println(efs.ErrCodeSecurityGroupNotFound, aerr.Error())
|
||||
case efs.ErrCodeUnsupportedAvailabilityZone:
|
||||
fmt.Println(efs.ErrCodeUnsupportedAvailabilityZone, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_CreateTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.CreateTagsInput{
|
||||
FileSystemId: aws.String("FileSystemId"), // Required
|
||||
Tags: []*efs.Tag{ // Required
|
||||
{ // Required
|
||||
Key: aws.String("TagKey"), // Required
|
||||
Value: aws.String("TagValue"), // Required
|
||||
// To create a new tag
|
||||
//
|
||||
// This operation creates a new tag for an EFS file system.
|
||||
func ExampleEFS_CreateTags_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.CreateTagsInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
Tags: []*efs.Tag{
|
||||
{
|
||||
Key: aws.String("Name"),
|
||||
Value: aws.String("MyFileSystem"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateTags(params)
|
||||
|
||||
result, err := svc.CreateTags(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DeleteFileSystem() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DeleteFileSystemInput{
|
||||
FileSystemId: aws.String("FileSystemId"), // Required
|
||||
// To delete a file system
|
||||
//
|
||||
// This operation deletes an EFS file system.
|
||||
func ExampleEFS_DeleteFileSystem_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DeleteFileSystemInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
}
|
||||
resp, err := svc.DeleteFileSystem(params)
|
||||
|
||||
result, err := svc.DeleteFileSystem(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
case efs.ErrCodeFileSystemInUse:
|
||||
fmt.Println(efs.ErrCodeFileSystemInUse, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DeleteMountTarget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DeleteMountTargetInput{
|
||||
MountTargetId: aws.String("MountTargetId"), // Required
|
||||
// To delete a mount target
|
||||
//
|
||||
// This operation deletes a mount target.
|
||||
func ExampleEFS_DeleteMountTarget_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DeleteMountTargetInput{
|
||||
MountTargetId: aws.String("fsmt-12340abc"),
|
||||
}
|
||||
resp, err := svc.DeleteMountTarget(params)
|
||||
|
||||
result, err := svc.DeleteMountTarget(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeDependencyTimeout:
|
||||
fmt.Println(efs.ErrCodeDependencyTimeout, aerr.Error())
|
||||
case efs.ErrCodeMountTargetNotFound:
|
||||
fmt.Println(efs.ErrCodeMountTargetNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DeleteTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DeleteTagsInput{
|
||||
FileSystemId: aws.String("FileSystemId"), // Required
|
||||
TagKeys: []*string{ // Required
|
||||
aws.String("TagKey"), // Required
|
||||
// More values...
|
||||
// To delete tags for an EFS file system
|
||||
//
|
||||
// This operation deletes tags for an EFS file system.
|
||||
func ExampleEFS_DeleteTags_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DeleteTagsInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
TagKeys: []*string{
|
||||
aws.String("Name"),
|
||||
},
|
||||
}
|
||||
resp, err := svc.DeleteTags(params)
|
||||
|
||||
result, err := svc.DeleteTags(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DescribeFileSystems() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DescribeFileSystemsInput{
|
||||
CreationToken: aws.String("CreationToken"),
|
||||
FileSystemId: aws.String("FileSystemId"),
|
||||
Marker: aws.String("Marker"),
|
||||
MaxItems: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.DescribeFileSystems(params)
|
||||
// To describe an EFS file system
|
||||
//
|
||||
// This operation describes all of the EFS file systems in an account.
|
||||
func ExampleEFS_DescribeFileSystems_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DescribeFileSystemsInput{}
|
||||
|
||||
result, err := svc.DescribeFileSystems(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DescribeMountTargetSecurityGroups() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DescribeMountTargetSecurityGroupsInput{
|
||||
MountTargetId: aws.String("MountTargetId"), // Required
|
||||
// To describe the security groups for a mount target
|
||||
//
|
||||
// This operation describes all of the security groups for a file system's mount target.
|
||||
func ExampleEFS_DescribeMountTargetSecurityGroups_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DescribeMountTargetSecurityGroupsInput{
|
||||
MountTargetId: aws.String("fsmt-12340abc"),
|
||||
}
|
||||
resp, err := svc.DescribeMountTargetSecurityGroups(params)
|
||||
|
||||
result, err := svc.DescribeMountTargetSecurityGroups(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeMountTargetNotFound:
|
||||
fmt.Println(efs.ErrCodeMountTargetNotFound, aerr.Error())
|
||||
case efs.ErrCodeIncorrectMountTargetState:
|
||||
fmt.Println(efs.ErrCodeIncorrectMountTargetState, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DescribeMountTargets() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DescribeMountTargetsInput{
|
||||
FileSystemId: aws.String("FileSystemId"),
|
||||
Marker: aws.String("Marker"),
|
||||
MaxItems: aws.Int64(1),
|
||||
MountTargetId: aws.String("MountTargetId"),
|
||||
// To describe the mount targets for a file system
|
||||
//
|
||||
// This operation describes all of a file system's mount targets.
|
||||
func ExampleEFS_DescribeMountTargets_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DescribeMountTargetsInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
}
|
||||
resp, err := svc.DescribeMountTargets(params)
|
||||
|
||||
result, err := svc.DescribeMountTargets(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
case efs.ErrCodeMountTargetNotFound:
|
||||
fmt.Println(efs.ErrCodeMountTargetNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_DescribeTags() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.DescribeTagsInput{
|
||||
FileSystemId: aws.String("FileSystemId"), // Required
|
||||
Marker: aws.String("Marker"),
|
||||
MaxItems: aws.Int64(1),
|
||||
// To describe the tags for a file system
|
||||
//
|
||||
// This operation describes all of a file system's tags.
|
||||
func ExampleEFS_DescribeTags_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.DescribeTagsInput{
|
||||
FileSystemId: aws.String("fs-01234567"),
|
||||
}
|
||||
resp, err := svc.DescribeTags(params)
|
||||
|
||||
result, err := svc.DescribeTags(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeFileSystemNotFound:
|
||||
fmt.Println(efs.ErrCodeFileSystemNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
func ExampleEFS_ModifyMountTargetSecurityGroups() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := efs.New(sess)
|
||||
|
||||
params := &efs.ModifyMountTargetSecurityGroupsInput{
|
||||
MountTargetId: aws.String("MountTargetId"), // Required
|
||||
// To modify the security groups associated with a mount target for a file system
|
||||
//
|
||||
// This operation modifies the security groups associated with a mount target for a
|
||||
// file system.
|
||||
func ExampleEFS_ModifyMountTargetSecurityGroups_shared00() {
|
||||
svc := efs.New(session.New())
|
||||
input := &efs.ModifyMountTargetSecurityGroupsInput{
|
||||
MountTargetId: aws.String("fsmt-12340abc"),
|
||||
SecurityGroups: []*string{
|
||||
aws.String("SecurityGroup"), // Required
|
||||
// More values...
|
||||
aws.String("sg-abcd1234"),
|
||||
},
|
||||
}
|
||||
resp, err := svc.ModifyMountTargetSecurityGroups(params)
|
||||
|
||||
result, err := svc.ModifyMountTargetSecurityGroups(input)
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case efs.ErrCodeBadRequest:
|
||||
fmt.Println(efs.ErrCodeBadRequest, aerr.Error())
|
||||
case efs.ErrCodeInternalServerError:
|
||||
fmt.Println(efs.ErrCodeInternalServerError, aerr.Error())
|
||||
case efs.ErrCodeMountTargetNotFound:
|
||||
fmt.Println(efs.ErrCodeMountTargetNotFound, aerr.Error())
|
||||
case efs.ErrCodeIncorrectMountTargetState:
|
||||
fmt.Println(efs.ErrCodeIncorrectMountTargetState, aerr.Error())
|
||||
case efs.ErrCodeSecurityGroupLimitExceeded:
|
||||
fmt.Println(efs.ErrCodeSecurityGroupLimitExceeded, aerr.Error())
|
||||
case efs.ErrCodeSecurityGroupNotFound:
|
||||
fmt.Println(efs.ErrCodeSecurityGroupNotFound, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err 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)
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue