Update Go AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2019-07-13 00:03:55 +03:00
committed by Andrey Smirnov
parent d08be990ef
commit 94a72b23ff
2183 changed files with 885887 additions and 228114 deletions
+3767 -259
View File
File diff suppressed because it is too large Load Diff
+15 -2
View File
@@ -3,8 +3,21 @@
// Package sms provides the client and types for making API
// requests to AWS Server Migration Service.
//
// Amazon Server Migration Service automates the process of migrating servers
// to EC2.
// This is the AWS Sever Migration Service API Reference. It provides descriptions,
// syntax, and usage examples for each of the actions and data types for the
// AWS Sever Migration Service (AWS SMS). The topic for each action shows the
// Query API request parameters and the XML response. You can also view the
// XML request elements in the WSDL.
//
// Alternatively, you can use one of the AWS SDKs to access an API that's tailored
// to the programming language or platform that you're using. For more information,
// see AWS SDKs (http://aws.amazon.com/tools/#SDKs).
//
// To learn more about the Server Migration Service, see the following resources:
//
// * AWS Sever Migration Service product page (https://aws.amazon.com/server-migration-service/)
//
// * AWS Sever Migration Service User Guide (https://docs.aws.amazon.com/server-migration-service/latest/userguide/server-migration.html)
//
// See https://docs.aws.amazon.com/goto/WebAPI/sms-2016-10-24 for more information on this service.
//
+18 -15
View File
@@ -7,65 +7,68 @@ const (
// ErrCodeInternalError for service response error code
// "InternalError".
//
// An internal error has occured.
// An internal error occurred.
ErrCodeInternalError = "InternalError"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
//
// A parameter specified in the request is not valid, is unsupported, or cannot
// be used.
// A specified parameter is not valid.
ErrCodeInvalidParameterException = "InvalidParameterException"
// ErrCodeMissingRequiredParameterException for service response error code
// "MissingRequiredParameterException".
//
// The request is missing a required parameter. Ensure that you have supplied
// all the required parameters for the request.
// A required parameter is missing.
ErrCodeMissingRequiredParameterException = "MissingRequiredParameterException"
// ErrCodeNoConnectorsAvailableException for service response error code
// "NoConnectorsAvailableException".
//
// No connectors are available to handle this request. Please associate connector(s)
// and verify any existing connectors are healthy and can respond to requests.
// There are no connectors available.
ErrCodeNoConnectorsAvailableException = "NoConnectorsAvailableException"
// ErrCodeOperationNotPermittedException for service response error code
// "OperationNotPermittedException".
//
// The specified operation is not allowed. This error can occur for a number
// of reasons; for example, you might be trying to start a Replication Run before
// seed Replication Run.
// This operation is not allowed.
ErrCodeOperationNotPermittedException = "OperationNotPermittedException"
// ErrCodeReplicationJobAlreadyExistsException for service response error code
// "ReplicationJobAlreadyExistsException".
//
// An active Replication Job already exists for the specified server.
// The specified replication job already exists.
ErrCodeReplicationJobAlreadyExistsException = "ReplicationJobAlreadyExistsException"
// ErrCodeReplicationJobNotFoundException for service response error code
// "ReplicationJobNotFoundException".
//
// The specified Replication Job cannot be found.
// The specified replication job does not exist.
ErrCodeReplicationJobNotFoundException = "ReplicationJobNotFoundException"
// ErrCodeReplicationRunLimitExceededException for service response error code
// "ReplicationRunLimitExceededException".
//
// This user has exceeded the maximum allowed Replication Run limit.
// You have exceeded the number of on-demand replication runs you can request
// in a 24-hour period.
ErrCodeReplicationRunLimitExceededException = "ReplicationRunLimitExceededException"
// ErrCodeServerCannotBeReplicatedException for service response error code
// "ServerCannotBeReplicatedException".
//
// The provided server cannot be replicated.
// The specified server cannot be replicated.
ErrCodeServerCannotBeReplicatedException = "ServerCannotBeReplicatedException"
// ErrCodeTemporarilyUnavailableException for service response error code
// "TemporarilyUnavailableException".
//
// The service is temporarily unavailable.
ErrCodeTemporarilyUnavailableException = "TemporarilyUnavailableException"
// ErrCodeUnauthorizedOperationException for service response error code
// "UnauthorizedOperationException".
//
// This user does not have permissions to perform this operation.
// You lack permissions needed to perform this operation. Check your IAM policies,
// and ensure that you are using the correct access keys.
ErrCodeUnauthorizedOperationException = "UnauthorizedOperationException"
)
+58
View File
@@ -0,0 +1,58 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// +build go1.10,integration
package sms_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/awstesting/integration"
"github.com/aws/aws-sdk-go/service/sms"
)
var _ aws.Config
var _ awserr.Error
var _ request.Request
func TestInteg_00_GetConnectors(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := sms.New(sess)
params := &sms.GetConnectorsInput{}
_, err := svc.GetConnectorsWithContext(ctx, params)
if err != nil {
t.Errorf("expect no error, got %v", err)
}
}
func TestInteg_01_DeleteReplicationJob(t *testing.T) {
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
sess := integration.SessionWithDefaultRegion("us-west-2")
svc := sms.New(sess)
params := &sms.DeleteReplicationJobInput{
ReplicationJobId: aws.String("invalidId"),
}
_, err := svc.DeleteReplicationJobWithContext(ctx, params)
if err == nil {
t.Fatalf("expect request to fail")
}
aerr, ok := err.(awserr.RequestFailure)
if !ok {
t.Fatalf("expect awserr, was %T", err)
}
if len(aerr.Code()) == 0 {
t.Errorf("expect non-empty error code")
}
if v := aerr.Code(); v == request.ErrCodeSerialization {
t.Errorf("expect API error code got serialization failure")
}
}
+4 -2
View File
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "sms" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
ServiceName = "sms" // Name of service.
EndpointsID = ServiceName // ID to lookup a service endpoint with.
ServiceID = "SMS" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the SMS client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
+70 -2
View File
@@ -26,7 +26,7 @@ import (
// // myFunc uses an SDK service client to make a request to
// // AWS Server Migration Service.
// func myFunc(svc smsiface.SMSAPI) bool {
// // Make svc.CreateReplicationJob request
// // Make svc.CreateApp request
// }
//
// func main() {
@@ -42,7 +42,7 @@ import (
// type mockSMSClient struct {
// smsiface.SMSAPI
// }
// func (m *mockSMSClient) CreateReplicationJob(input *sms.CreateReplicationJobInput) (*sms.CreateReplicationJobOutput, error) {
// func (m *mockSMSClient) CreateApp(input *sms.CreateAppInput) (*sms.CreateAppOutput, error) {
// // mock response/functionality
// }
//
@@ -60,10 +60,26 @@ import (
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type SMSAPI interface {
CreateApp(*sms.CreateAppInput) (*sms.CreateAppOutput, error)
CreateAppWithContext(aws.Context, *sms.CreateAppInput, ...request.Option) (*sms.CreateAppOutput, error)
CreateAppRequest(*sms.CreateAppInput) (*request.Request, *sms.CreateAppOutput)
CreateReplicationJob(*sms.CreateReplicationJobInput) (*sms.CreateReplicationJobOutput, error)
CreateReplicationJobWithContext(aws.Context, *sms.CreateReplicationJobInput, ...request.Option) (*sms.CreateReplicationJobOutput, error)
CreateReplicationJobRequest(*sms.CreateReplicationJobInput) (*request.Request, *sms.CreateReplicationJobOutput)
DeleteApp(*sms.DeleteAppInput) (*sms.DeleteAppOutput, error)
DeleteAppWithContext(aws.Context, *sms.DeleteAppInput, ...request.Option) (*sms.DeleteAppOutput, error)
DeleteAppRequest(*sms.DeleteAppInput) (*request.Request, *sms.DeleteAppOutput)
DeleteAppLaunchConfiguration(*sms.DeleteAppLaunchConfigurationInput) (*sms.DeleteAppLaunchConfigurationOutput, error)
DeleteAppLaunchConfigurationWithContext(aws.Context, *sms.DeleteAppLaunchConfigurationInput, ...request.Option) (*sms.DeleteAppLaunchConfigurationOutput, error)
DeleteAppLaunchConfigurationRequest(*sms.DeleteAppLaunchConfigurationInput) (*request.Request, *sms.DeleteAppLaunchConfigurationOutput)
DeleteAppReplicationConfiguration(*sms.DeleteAppReplicationConfigurationInput) (*sms.DeleteAppReplicationConfigurationOutput, error)
DeleteAppReplicationConfigurationWithContext(aws.Context, *sms.DeleteAppReplicationConfigurationInput, ...request.Option) (*sms.DeleteAppReplicationConfigurationOutput, error)
DeleteAppReplicationConfigurationRequest(*sms.DeleteAppReplicationConfigurationInput) (*request.Request, *sms.DeleteAppReplicationConfigurationOutput)
DeleteReplicationJob(*sms.DeleteReplicationJobInput) (*sms.DeleteReplicationJobOutput, error)
DeleteReplicationJobWithContext(aws.Context, *sms.DeleteReplicationJobInput, ...request.Option) (*sms.DeleteReplicationJobOutput, error)
DeleteReplicationJobRequest(*sms.DeleteReplicationJobInput) (*request.Request, *sms.DeleteReplicationJobOutput)
@@ -76,6 +92,26 @@ type SMSAPI interface {
DisassociateConnectorWithContext(aws.Context, *sms.DisassociateConnectorInput, ...request.Option) (*sms.DisassociateConnectorOutput, error)
DisassociateConnectorRequest(*sms.DisassociateConnectorInput) (*request.Request, *sms.DisassociateConnectorOutput)
GenerateChangeSet(*sms.GenerateChangeSetInput) (*sms.GenerateChangeSetOutput, error)
GenerateChangeSetWithContext(aws.Context, *sms.GenerateChangeSetInput, ...request.Option) (*sms.GenerateChangeSetOutput, error)
GenerateChangeSetRequest(*sms.GenerateChangeSetInput) (*request.Request, *sms.GenerateChangeSetOutput)
GenerateTemplate(*sms.GenerateTemplateInput) (*sms.GenerateTemplateOutput, error)
GenerateTemplateWithContext(aws.Context, *sms.GenerateTemplateInput, ...request.Option) (*sms.GenerateTemplateOutput, error)
GenerateTemplateRequest(*sms.GenerateTemplateInput) (*request.Request, *sms.GenerateTemplateOutput)
GetApp(*sms.GetAppInput) (*sms.GetAppOutput, error)
GetAppWithContext(aws.Context, *sms.GetAppInput, ...request.Option) (*sms.GetAppOutput, error)
GetAppRequest(*sms.GetAppInput) (*request.Request, *sms.GetAppOutput)
GetAppLaunchConfiguration(*sms.GetAppLaunchConfigurationInput) (*sms.GetAppLaunchConfigurationOutput, error)
GetAppLaunchConfigurationWithContext(aws.Context, *sms.GetAppLaunchConfigurationInput, ...request.Option) (*sms.GetAppLaunchConfigurationOutput, error)
GetAppLaunchConfigurationRequest(*sms.GetAppLaunchConfigurationInput) (*request.Request, *sms.GetAppLaunchConfigurationOutput)
GetAppReplicationConfiguration(*sms.GetAppReplicationConfigurationInput) (*sms.GetAppReplicationConfigurationOutput, error)
GetAppReplicationConfigurationWithContext(aws.Context, *sms.GetAppReplicationConfigurationInput, ...request.Option) (*sms.GetAppReplicationConfigurationOutput, error)
GetAppReplicationConfigurationRequest(*sms.GetAppReplicationConfigurationInput) (*request.Request, *sms.GetAppReplicationConfigurationOutput)
GetConnectors(*sms.GetConnectorsInput) (*sms.GetConnectorsOutput, error)
GetConnectorsWithContext(aws.Context, *sms.GetConnectorsInput, ...request.Option) (*sms.GetConnectorsOutput, error)
GetConnectorsRequest(*sms.GetConnectorsInput) (*request.Request, *sms.GetConnectorsOutput)
@@ -108,10 +144,42 @@ type SMSAPI interface {
ImportServerCatalogWithContext(aws.Context, *sms.ImportServerCatalogInput, ...request.Option) (*sms.ImportServerCatalogOutput, error)
ImportServerCatalogRequest(*sms.ImportServerCatalogInput) (*request.Request, *sms.ImportServerCatalogOutput)
LaunchApp(*sms.LaunchAppInput) (*sms.LaunchAppOutput, error)
LaunchAppWithContext(aws.Context, *sms.LaunchAppInput, ...request.Option) (*sms.LaunchAppOutput, error)
LaunchAppRequest(*sms.LaunchAppInput) (*request.Request, *sms.LaunchAppOutput)
ListApps(*sms.ListAppsInput) (*sms.ListAppsOutput, error)
ListAppsWithContext(aws.Context, *sms.ListAppsInput, ...request.Option) (*sms.ListAppsOutput, error)
ListAppsRequest(*sms.ListAppsInput) (*request.Request, *sms.ListAppsOutput)
PutAppLaunchConfiguration(*sms.PutAppLaunchConfigurationInput) (*sms.PutAppLaunchConfigurationOutput, error)
PutAppLaunchConfigurationWithContext(aws.Context, *sms.PutAppLaunchConfigurationInput, ...request.Option) (*sms.PutAppLaunchConfigurationOutput, error)
PutAppLaunchConfigurationRequest(*sms.PutAppLaunchConfigurationInput) (*request.Request, *sms.PutAppLaunchConfigurationOutput)
PutAppReplicationConfiguration(*sms.PutAppReplicationConfigurationInput) (*sms.PutAppReplicationConfigurationOutput, error)
PutAppReplicationConfigurationWithContext(aws.Context, *sms.PutAppReplicationConfigurationInput, ...request.Option) (*sms.PutAppReplicationConfigurationOutput, error)
PutAppReplicationConfigurationRequest(*sms.PutAppReplicationConfigurationInput) (*request.Request, *sms.PutAppReplicationConfigurationOutput)
StartAppReplication(*sms.StartAppReplicationInput) (*sms.StartAppReplicationOutput, error)
StartAppReplicationWithContext(aws.Context, *sms.StartAppReplicationInput, ...request.Option) (*sms.StartAppReplicationOutput, error)
StartAppReplicationRequest(*sms.StartAppReplicationInput) (*request.Request, *sms.StartAppReplicationOutput)
StartOnDemandReplicationRun(*sms.StartOnDemandReplicationRunInput) (*sms.StartOnDemandReplicationRunOutput, error)
StartOnDemandReplicationRunWithContext(aws.Context, *sms.StartOnDemandReplicationRunInput, ...request.Option) (*sms.StartOnDemandReplicationRunOutput, error)
StartOnDemandReplicationRunRequest(*sms.StartOnDemandReplicationRunInput) (*request.Request, *sms.StartOnDemandReplicationRunOutput)
StopAppReplication(*sms.StopAppReplicationInput) (*sms.StopAppReplicationOutput, error)
StopAppReplicationWithContext(aws.Context, *sms.StopAppReplicationInput, ...request.Option) (*sms.StopAppReplicationOutput, error)
StopAppReplicationRequest(*sms.StopAppReplicationInput) (*request.Request, *sms.StopAppReplicationOutput)
TerminateApp(*sms.TerminateAppInput) (*sms.TerminateAppOutput, error)
TerminateAppWithContext(aws.Context, *sms.TerminateAppInput, ...request.Option) (*sms.TerminateAppOutput, error)
TerminateAppRequest(*sms.TerminateAppInput) (*request.Request, *sms.TerminateAppOutput)
UpdateApp(*sms.UpdateAppInput) (*sms.UpdateAppOutput, error)
UpdateAppWithContext(aws.Context, *sms.UpdateAppInput, ...request.Option) (*sms.UpdateAppOutput, error)
UpdateAppRequest(*sms.UpdateAppInput) (*request.Request, *sms.UpdateAppOutput)
UpdateReplicationJob(*sms.UpdateReplicationJobInput) (*sms.UpdateReplicationJobOutput, error)
UpdateReplicationJobWithContext(aws.Context, *sms.UpdateReplicationJobInput, ...request.Option) (*sms.UpdateReplicationJobOutput, error)
UpdateReplicationJobRequest(*sms.UpdateReplicationJobInput) (*request.Request, *sms.UpdateReplicationJobOutput)