Vendor aws-sdk-go (dep ensure) (#178)
This commit is contained in:
2524
vendor/github.com/aws/aws-sdk-go/service/efs/api.go
generated
vendored
Normal file
2524
vendor/github.com/aws/aws-sdk-go/service/efs/api.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
32
vendor/github.com/aws/aws-sdk-go/service/efs/doc.go
generated
vendored
Normal file
32
vendor/github.com/aws/aws-sdk-go/service/efs/doc.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package efs provides the client and types for making API
|
||||
// requests to Amazon Elastic File System.
|
||||
//
|
||||
// Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage
|
||||
// for use with Amazon EC2 instances in the AWS Cloud. With Amazon EFS, storage
|
||||
// capacity is elastic, growing and shrinking automatically as you add and remove
|
||||
// files, so your applications have the storage they need, when they need it.
|
||||
// For more information, see the User Guide (http://docs.aws.amazon.com/efs/latest/ug/api-reference.html).
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01 for more information on this service.
|
||||
//
|
||||
// See efs package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/efs/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact Amazon Elastic File System 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 Amazon Elastic File System client EFS for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/efs/#New
|
||||
package efs
|
||||
108
vendor/github.com/aws/aws-sdk-go/service/efs/efsiface/interface.go
generated
vendored
Normal file
108
vendor/github.com/aws/aws-sdk-go/service/efs/efsiface/interface.go
generated
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package efsiface provides an interface to enable mocking the Amazon Elastic File System service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package efsiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/efs"
|
||||
)
|
||||
|
||||
// EFSAPI provides an interface to enable mocking the
|
||||
// efs.EFS service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// 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 SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon Elastic File System.
|
||||
// func myFunc(svc efsiface.EFSAPI) bool {
|
||||
// // Make svc.CreateFileSystem request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := efs.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockEFSClient struct {
|
||||
// efsiface.EFSAPI
|
||||
// }
|
||||
// func (m *mockEFSClient) CreateFileSystem(input *efs.CreateFileSystemInput) (*efs.FileSystemDescription, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockEFSClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type EFSAPI interface {
|
||||
CreateFileSystem(*efs.CreateFileSystemInput) (*efs.FileSystemDescription, error)
|
||||
CreateFileSystemWithContext(aws.Context, *efs.CreateFileSystemInput, ...request.Option) (*efs.FileSystemDescription, error)
|
||||
CreateFileSystemRequest(*efs.CreateFileSystemInput) (*request.Request, *efs.FileSystemDescription)
|
||||
|
||||
CreateMountTarget(*efs.CreateMountTargetInput) (*efs.MountTargetDescription, error)
|
||||
CreateMountTargetWithContext(aws.Context, *efs.CreateMountTargetInput, ...request.Option) (*efs.MountTargetDescription, error)
|
||||
CreateMountTargetRequest(*efs.CreateMountTargetInput) (*request.Request, *efs.MountTargetDescription)
|
||||
|
||||
CreateTags(*efs.CreateTagsInput) (*efs.CreateTagsOutput, error)
|
||||
CreateTagsWithContext(aws.Context, *efs.CreateTagsInput, ...request.Option) (*efs.CreateTagsOutput, error)
|
||||
CreateTagsRequest(*efs.CreateTagsInput) (*request.Request, *efs.CreateTagsOutput)
|
||||
|
||||
DeleteFileSystem(*efs.DeleteFileSystemInput) (*efs.DeleteFileSystemOutput, error)
|
||||
DeleteFileSystemWithContext(aws.Context, *efs.DeleteFileSystemInput, ...request.Option) (*efs.DeleteFileSystemOutput, error)
|
||||
DeleteFileSystemRequest(*efs.DeleteFileSystemInput) (*request.Request, *efs.DeleteFileSystemOutput)
|
||||
|
||||
DeleteMountTarget(*efs.DeleteMountTargetInput) (*efs.DeleteMountTargetOutput, error)
|
||||
DeleteMountTargetWithContext(aws.Context, *efs.DeleteMountTargetInput, ...request.Option) (*efs.DeleteMountTargetOutput, error)
|
||||
DeleteMountTargetRequest(*efs.DeleteMountTargetInput) (*request.Request, *efs.DeleteMountTargetOutput)
|
||||
|
||||
DeleteTags(*efs.DeleteTagsInput) (*efs.DeleteTagsOutput, error)
|
||||
DeleteTagsWithContext(aws.Context, *efs.DeleteTagsInput, ...request.Option) (*efs.DeleteTagsOutput, error)
|
||||
DeleteTagsRequest(*efs.DeleteTagsInput) (*request.Request, *efs.DeleteTagsOutput)
|
||||
|
||||
DescribeFileSystems(*efs.DescribeFileSystemsInput) (*efs.DescribeFileSystemsOutput, error)
|
||||
DescribeFileSystemsWithContext(aws.Context, *efs.DescribeFileSystemsInput, ...request.Option) (*efs.DescribeFileSystemsOutput, error)
|
||||
DescribeFileSystemsRequest(*efs.DescribeFileSystemsInput) (*request.Request, *efs.DescribeFileSystemsOutput)
|
||||
|
||||
DescribeMountTargetSecurityGroups(*efs.DescribeMountTargetSecurityGroupsInput) (*efs.DescribeMountTargetSecurityGroupsOutput, error)
|
||||
DescribeMountTargetSecurityGroupsWithContext(aws.Context, *efs.DescribeMountTargetSecurityGroupsInput, ...request.Option) (*efs.DescribeMountTargetSecurityGroupsOutput, error)
|
||||
DescribeMountTargetSecurityGroupsRequest(*efs.DescribeMountTargetSecurityGroupsInput) (*request.Request, *efs.DescribeMountTargetSecurityGroupsOutput)
|
||||
|
||||
DescribeMountTargets(*efs.DescribeMountTargetsInput) (*efs.DescribeMountTargetsOutput, error)
|
||||
DescribeMountTargetsWithContext(aws.Context, *efs.DescribeMountTargetsInput, ...request.Option) (*efs.DescribeMountTargetsOutput, error)
|
||||
DescribeMountTargetsRequest(*efs.DescribeMountTargetsInput) (*request.Request, *efs.DescribeMountTargetsOutput)
|
||||
|
||||
DescribeTags(*efs.DescribeTagsInput) (*efs.DescribeTagsOutput, error)
|
||||
DescribeTagsWithContext(aws.Context, *efs.DescribeTagsInput, ...request.Option) (*efs.DescribeTagsOutput, error)
|
||||
DescribeTagsRequest(*efs.DescribeTagsInput) (*request.Request, *efs.DescribeTagsOutput)
|
||||
|
||||
ModifyMountTargetSecurityGroups(*efs.ModifyMountTargetSecurityGroupsInput) (*efs.ModifyMountTargetSecurityGroupsOutput, error)
|
||||
ModifyMountTargetSecurityGroupsWithContext(aws.Context, *efs.ModifyMountTargetSecurityGroupsInput, ...request.Option) (*efs.ModifyMountTargetSecurityGroupsOutput, error)
|
||||
ModifyMountTargetSecurityGroupsRequest(*efs.ModifyMountTargetSecurityGroupsInput) (*request.Request, *efs.ModifyMountTargetSecurityGroupsOutput)
|
||||
}
|
||||
|
||||
var _ EFSAPI = (*efs.EFS)(nil)
|
||||
127
vendor/github.com/aws/aws-sdk-go/service/efs/errors.go
generated
vendored
Normal file
127
vendor/github.com/aws/aws-sdk-go/service/efs/errors.go
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package efs
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeBadRequest for service response error code
|
||||
// "BadRequest".
|
||||
//
|
||||
// Returned if the request is malformed or contains an error such as an invalid
|
||||
// parameter value or a missing required parameter.
|
||||
ErrCodeBadRequest = "BadRequest"
|
||||
|
||||
// ErrCodeDependencyTimeout for service response error code
|
||||
// "DependencyTimeout".
|
||||
//
|
||||
// The service timed out trying to fulfill the request, and the client should
|
||||
// try the call again.
|
||||
ErrCodeDependencyTimeout = "DependencyTimeout"
|
||||
|
||||
// ErrCodeFileSystemAlreadyExists for service response error code
|
||||
// "FileSystemAlreadyExists".
|
||||
//
|
||||
// Returned if the file system you are trying to create already exists, with
|
||||
// the creation token you provided.
|
||||
ErrCodeFileSystemAlreadyExists = "FileSystemAlreadyExists"
|
||||
|
||||
// ErrCodeFileSystemInUse for service response error code
|
||||
// "FileSystemInUse".
|
||||
//
|
||||
// Returned if a file system has mount targets.
|
||||
ErrCodeFileSystemInUse = "FileSystemInUse"
|
||||
|
||||
// ErrCodeFileSystemLimitExceeded for service response error code
|
||||
// "FileSystemLimitExceeded".
|
||||
//
|
||||
// Returned if the AWS account has already created maximum number of file systems
|
||||
// allowed per account.
|
||||
ErrCodeFileSystemLimitExceeded = "FileSystemLimitExceeded"
|
||||
|
||||
// ErrCodeFileSystemNotFound for service response error code
|
||||
// "FileSystemNotFound".
|
||||
//
|
||||
// Returned if the specified FileSystemId does not exist in the requester's
|
||||
// AWS account.
|
||||
ErrCodeFileSystemNotFound = "FileSystemNotFound"
|
||||
|
||||
// ErrCodeIncorrectFileSystemLifeCycleState for service response error code
|
||||
// "IncorrectFileSystemLifeCycleState".
|
||||
//
|
||||
// Returned if the file system's life cycle state is not "created".
|
||||
ErrCodeIncorrectFileSystemLifeCycleState = "IncorrectFileSystemLifeCycleState"
|
||||
|
||||
// ErrCodeIncorrectMountTargetState for service response error code
|
||||
// "IncorrectMountTargetState".
|
||||
//
|
||||
// Returned if the mount target is not in the correct state for the operation.
|
||||
ErrCodeIncorrectMountTargetState = "IncorrectMountTargetState"
|
||||
|
||||
// ErrCodeInternalServerError for service response error code
|
||||
// "InternalServerError".
|
||||
//
|
||||
// Returned if an error occurred on the server side.
|
||||
ErrCodeInternalServerError = "InternalServerError"
|
||||
|
||||
// ErrCodeIpAddressInUse for service response error code
|
||||
// "IpAddressInUse".
|
||||
//
|
||||
// Returned if the request specified an IpAddress that is already in use in
|
||||
// the subnet.
|
||||
ErrCodeIpAddressInUse = "IpAddressInUse"
|
||||
|
||||
// ErrCodeMountTargetConflict for service response error code
|
||||
// "MountTargetConflict".
|
||||
//
|
||||
// Returned if the mount target would violate one of the specified restrictions
|
||||
// based on the file system's existing mount targets.
|
||||
ErrCodeMountTargetConflict = "MountTargetConflict"
|
||||
|
||||
// ErrCodeMountTargetNotFound for service response error code
|
||||
// "MountTargetNotFound".
|
||||
//
|
||||
// Returned if there is no mount target with the specified ID found in the caller's
|
||||
// account.
|
||||
ErrCodeMountTargetNotFound = "MountTargetNotFound"
|
||||
|
||||
// ErrCodeNetworkInterfaceLimitExceeded for service response error code
|
||||
// "NetworkInterfaceLimitExceeded".
|
||||
//
|
||||
// The calling account has reached the ENI limit for the specific AWS region.
|
||||
// Client should try to delete some ENIs or get its account limit raised. For
|
||||
// more information, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html)
|
||||
// in the Amazon Virtual Private Cloud User Guide (see the Network interfaces
|
||||
// per VPC entry in the table).
|
||||
ErrCodeNetworkInterfaceLimitExceeded = "NetworkInterfaceLimitExceeded"
|
||||
|
||||
// ErrCodeNoFreeAddressesInSubnet for service response error code
|
||||
// "NoFreeAddressesInSubnet".
|
||||
//
|
||||
// Returned if IpAddress was not specified in the request and there are no free
|
||||
// IP addresses in the subnet.
|
||||
ErrCodeNoFreeAddressesInSubnet = "NoFreeAddressesInSubnet"
|
||||
|
||||
// ErrCodeSecurityGroupLimitExceeded for service response error code
|
||||
// "SecurityGroupLimitExceeded".
|
||||
//
|
||||
// Returned if the size of SecurityGroups specified in the request is greater
|
||||
// than five.
|
||||
ErrCodeSecurityGroupLimitExceeded = "SecurityGroupLimitExceeded"
|
||||
|
||||
// ErrCodeSecurityGroupNotFound for service response error code
|
||||
// "SecurityGroupNotFound".
|
||||
//
|
||||
// Returned if one of the specified security groups does not exist in the subnet's
|
||||
// VPC.
|
||||
ErrCodeSecurityGroupNotFound = "SecurityGroupNotFound"
|
||||
|
||||
// ErrCodeSubnetNotFound for service response error code
|
||||
// "SubnetNotFound".
|
||||
//
|
||||
// Returned if there is no subnet with ID SubnetId provided in the request.
|
||||
ErrCodeSubnetNotFound = "SubnetNotFound"
|
||||
|
||||
// ErrCodeUnsupportedAvailabilityZone for service response error code
|
||||
// "UnsupportedAvailabilityZone".
|
||||
ErrCodeUnsupportedAvailabilityZone = "UnsupportedAvailabilityZone"
|
||||
)
|
||||
437
vendor/github.com/aws/aws-sdk-go/service/efs/examples_test.go
generated
vendored
Normal file
437
vendor/github.com/aws/aws-sdk-go/service/efs/examples_test.go
generated
vendored
Normal file
@@ -0,0 +1,437 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package efs_test
|
||||
|
||||
import (
|
||||
"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 _ strings.Reader
|
||||
var _ aws.Config
|
||||
|
||||
func parseTime(layout, value string) *time.Time {
|
||||
t, err := time.Parse(layout, value)
|
||||
if err != nil {
|
||||
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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.CreateMountTarget(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
result, err := svc.CreateTags(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteFileSystem(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteMountTarget(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
},
|
||||
}
|
||||
|
||||
result, err := svc.DeleteTags(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeMountTargetSecurityGroups(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeMountTargets(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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"),
|
||||
}
|
||||
|
||||
result, err := svc.DescribeTags(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// 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("sg-abcd1234"),
|
||||
},
|
||||
}
|
||||
|
||||
result, err := svc.ModifyMountTargetSecurityGroups(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.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
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
93
vendor/github.com/aws/aws-sdk-go/service/efs/service.go
generated
vendored
Normal file
93
vendor/github.com/aws/aws-sdk-go/service/efs/service.go
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package efs
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// EFS provides the API operation methods for making requests to
|
||||
// Amazon Elastic File System. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// EFS methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type EFS struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "elasticfilesystem" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the EFS client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a EFS client from just a session.
|
||||
// svc := efs.New(mySession)
|
||||
//
|
||||
// // Create a EFS client with additional configuration
|
||||
// svc := efs.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *EFS {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EFS {
|
||||
svc := &EFS{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-02-01",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a EFS operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *EFS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
Reference in New Issue
Block a user