mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-31 04:30:44 +00:00
Upgrade AWS SDK to the latest version
This commit is contained in:
+160
-112
@@ -1,6 +1,5 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package efs provides a client for Amazon Elastic File System.
|
||||
package efs
|
||||
|
||||
import (
|
||||
@@ -18,19 +17,18 @@ const opCreateFileSystem = "CreateFileSystem"
|
||||
|
||||
// CreateFileSystemRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the CreateFileSystem operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See CreateFileSystem for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the CreateFileSystem method directly
|
||||
// instead.
|
||||
// See CreateFileSystem for more information on using the CreateFileSystem
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the CreateFileSystemRequest method.
|
||||
// req, resp := client.CreateFileSystemRequest(params)
|
||||
@@ -155,19 +153,18 @@ const opCreateMountTarget = "CreateMountTarget"
|
||||
|
||||
// CreateMountTargetRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the CreateMountTarget operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See CreateMountTarget for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the CreateMountTarget method directly
|
||||
// instead.
|
||||
// See CreateMountTarget for more information on using the CreateMountTarget
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the CreateMountTargetRequest method.
|
||||
// req, resp := client.CreateMountTargetRequest(params)
|
||||
@@ -372,19 +369,18 @@ const opCreateTags = "CreateTags"
|
||||
|
||||
// CreateTagsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the CreateTags operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See CreateTags for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the CreateTags method directly
|
||||
// instead.
|
||||
// See CreateTags for more information on using the CreateTags
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the CreateTagsRequest method.
|
||||
// req, resp := client.CreateTagsRequest(params)
|
||||
@@ -468,19 +464,18 @@ const opDeleteFileSystem = "DeleteFileSystem"
|
||||
|
||||
// DeleteFileSystemRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteFileSystem operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DeleteFileSystem for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DeleteFileSystem method directly
|
||||
// instead.
|
||||
// See DeleteFileSystem for more information on using the DeleteFileSystem
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DeleteFileSystemRequest method.
|
||||
// req, resp := client.DeleteFileSystemRequest(params)
|
||||
@@ -576,19 +571,18 @@ const opDeleteMountTarget = "DeleteMountTarget"
|
||||
|
||||
// DeleteMountTargetRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteMountTarget operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DeleteMountTarget for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DeleteMountTarget method directly
|
||||
// instead.
|
||||
// See DeleteMountTarget for more information on using the DeleteMountTarget
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DeleteMountTargetRequest method.
|
||||
// req, resp := client.DeleteMountTargetRequest(params)
|
||||
@@ -694,19 +688,18 @@ const opDeleteTags = "DeleteTags"
|
||||
|
||||
// DeleteTagsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DeleteTags operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DeleteTags for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DeleteTags method directly
|
||||
// instead.
|
||||
// See DeleteTags for more information on using the DeleteTags
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DeleteTagsRequest method.
|
||||
// req, resp := client.DeleteTagsRequest(params)
|
||||
@@ -791,19 +784,18 @@ const opDescribeFileSystems = "DescribeFileSystems"
|
||||
|
||||
// DescribeFileSystemsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeFileSystems operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeFileSystems for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeFileSystems method directly
|
||||
// instead.
|
||||
// See DescribeFileSystems for more information on using the DescribeFileSystems
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeFileSystemsRequest method.
|
||||
// req, resp := client.DescribeFileSystemsRequest(params)
|
||||
@@ -904,19 +896,18 @@ const opDescribeMountTargetSecurityGroups = "DescribeMountTargetSecurityGroups"
|
||||
|
||||
// DescribeMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeMountTargetSecurityGroups operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeMountTargetSecurityGroups for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeMountTargetSecurityGroups method directly
|
||||
// instead.
|
||||
// See DescribeMountTargetSecurityGroups for more information on using the DescribeMountTargetSecurityGroups
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeMountTargetSecurityGroupsRequest method.
|
||||
// req, resp := client.DescribeMountTargetSecurityGroupsRequest(params)
|
||||
@@ -1005,19 +996,18 @@ const opDescribeMountTargets = "DescribeMountTargets"
|
||||
|
||||
// DescribeMountTargetsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeMountTargets operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeMountTargets for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeMountTargets method directly
|
||||
// instead.
|
||||
// See DescribeMountTargets for more information on using the DescribeMountTargets
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeMountTargetsRequest method.
|
||||
// req, resp := client.DescribeMountTargetsRequest(params)
|
||||
@@ -1103,19 +1093,18 @@ const opDescribeTags = "DescribeTags"
|
||||
|
||||
// DescribeTagsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DescribeTags operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See DescribeTags for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the DescribeTags method directly
|
||||
// instead.
|
||||
// See DescribeTags for more information on using the DescribeTags
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the DescribeTagsRequest method.
|
||||
// req, resp := client.DescribeTagsRequest(params)
|
||||
@@ -1196,19 +1185,18 @@ const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups"
|
||||
|
||||
// ModifyMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the ModifyMountTargetSecurityGroups operation. The "output" return
|
||||
// value can be used to capture response data after the request's "Send" method
|
||||
// is called.
|
||||
// value will be populated with the request's response once the request complets
|
||||
// successfuly.
|
||||
//
|
||||
// See ModifyMountTargetSecurityGroups for usage and error information.
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// Creating a request object using this method should be used when you want to inject
|
||||
// custom logic into the request's lifecycle using a custom handler, or if you want to
|
||||
// access properties on the request object before or after sending the request. If
|
||||
// you just want the service response, call the ModifyMountTargetSecurityGroups method directly
|
||||
// instead.
|
||||
// See ModifyMountTargetSecurityGroups for more information on using the ModifyMountTargetSecurityGroups
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
// Note: You must call the "Send" method on the returned request object in order
|
||||
// to execute the request.
|
||||
//
|
||||
// // Example sending a request using the ModifyMountTargetSecurityGroupsRequest method.
|
||||
// req, resp := client.ModifyMountTargetSecurityGroupsRequest(params)
|
||||
@@ -1318,6 +1306,32 @@ type CreateFileSystemInput struct {
|
||||
// CreationToken is a required field
|
||||
CreationToken *string `min:"1" type:"string" required:"true"`
|
||||
|
||||
// A boolean value that, if true, creates an encrypted file system. When creating
|
||||
// an encrypted file system, you have the option of specifying a CreateFileSystemRequest$KmsKeyId
|
||||
// for an existing AWS Key Management Service (AWS KMS) customer master key
|
||||
// (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, /aws/elasticfilesystem,
|
||||
// is used to protect the encrypted file system.
|
||||
Encrypted *bool `type:"boolean"`
|
||||
|
||||
// The id of the AWS KMS CMK that will be used to protect the encrypted file
|
||||
// system. This parameter is only required if you want to use a non-default
|
||||
// CMK. If this parameter is not specified, the default CMK for Amazon EFS is
|
||||
// used. This id can be in one of the following formats:
|
||||
//
|
||||
// * Key ID - A unique identifier of the key. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
|
||||
//
|
||||
// * ARN - An Amazon Resource Name for the key. For example, arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.
|
||||
//
|
||||
// * Key alias - A previously created display name for a key. For example,
|
||||
// alias/projectKey1.
|
||||
//
|
||||
// * Key alias ARN - An Amazon Resource Name for a key alias. For example,
|
||||
// arn:aws:kms:us-west-2:444455556666:alias/projectKey1.
|
||||
//
|
||||
// Note that if the KmsKeyId is specified, the CreateFileSystemRequest$Encrypted
|
||||
// parameter must be set to true.
|
||||
KmsKeyId *string `min:"1" type:"string"`
|
||||
|
||||
// The PerformanceMode of the file system. We recommend generalPurpose performance
|
||||
// mode for most file systems. File systems using the maxIO performance mode
|
||||
// can scale to higher levels of aggregate throughput and operations per second
|
||||
@@ -1345,6 +1359,9 @@ func (s *CreateFileSystemInput) Validate() error {
|
||||
if s.CreationToken != nil && len(*s.CreationToken) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1))
|
||||
}
|
||||
if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
@@ -1358,6 +1375,18 @@ func (s *CreateFileSystemInput) SetCreationToken(v string) *CreateFileSystemInpu
|
||||
return s
|
||||
}
|
||||
|
||||
// SetEncrypted sets the Encrypted field's value.
|
||||
func (s *CreateFileSystemInput) SetEncrypted(v bool) *CreateFileSystemInput {
|
||||
s.Encrypted = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetKmsKeyId sets the KmsKeyId field's value.
|
||||
func (s *CreateFileSystemInput) SetKmsKeyId(v string) *CreateFileSystemInput {
|
||||
s.KmsKeyId = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetPerformanceMode sets the PerformanceMode field's value.
|
||||
func (s *CreateFileSystemInput) SetPerformanceMode(v string) *CreateFileSystemInput {
|
||||
s.PerformanceMode = &v
|
||||
@@ -2114,11 +2143,18 @@ type FileSystemDescription struct {
|
||||
// CreationToken is a required field
|
||||
CreationToken *string `min:"1" type:"string" required:"true"`
|
||||
|
||||
// A boolean value that, if true, indicates that the file system is encrypted.
|
||||
Encrypted *bool `type:"boolean"`
|
||||
|
||||
// ID of the file system, assigned by Amazon EFS.
|
||||
//
|
||||
// FileSystemId is a required field
|
||||
FileSystemId *string `type:"string" required:"true"`
|
||||
|
||||
// The id of an AWS Key Management Service (AWS KMS) customer master key (CMK)
|
||||
// that was used to protect the encrypted file system.
|
||||
KmsKeyId *string `min:"1" type:"string"`
|
||||
|
||||
// Lifecycle phase of the file system.
|
||||
//
|
||||
// LifeCycleState is a required field
|
||||
@@ -2182,12 +2218,24 @@ func (s *FileSystemDescription) SetCreationToken(v string) *FileSystemDescriptio
|
||||
return s
|
||||
}
|
||||
|
||||
// SetEncrypted sets the Encrypted field's value.
|
||||
func (s *FileSystemDescription) SetEncrypted(v bool) *FileSystemDescription {
|
||||
s.Encrypted = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetFileSystemId sets the FileSystemId field's value.
|
||||
func (s *FileSystemDescription) SetFileSystemId(v string) *FileSystemDescription {
|
||||
s.FileSystemId = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetKmsKeyId sets the KmsKeyId field's value.
|
||||
func (s *FileSystemDescription) SetKmsKeyId(v string) *FileSystemDescription {
|
||||
s.KmsKeyId = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetLifeCycleState sets the LifeCycleState field's value.
|
||||
func (s *FileSystemDescription) SetLifeCycleState(v string) *FileSystemDescription {
|
||||
s.LifeCycleState = &v
|
||||
|
||||
+32
@@ -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 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
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// 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.
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
//
|
||||
// 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 the SDK's request pipeline.
|
||||
// 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.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package efs
|
||||
|
||||
|
||||
+334
-174
@@ -1,277 +1,437 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
+7
-9
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package efs
|
||||
|
||||
@@ -11,14 +11,12 @@ import (
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// 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).
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01
|
||||
// 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user