Switch to using the dep tool and update all the dependencies
This commit is contained in:
+4575
File diff suppressed because it is too large
Load Diff
+87
@@ -0,0 +1,87 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package snowball provides the client and types for making API
|
||||
// requests to Amazon Import/Export Snowball.
|
||||
//
|
||||
// AWS Snowball is a petabyte-scale data transport solution that uses secure
|
||||
// appliances to transfer large amounts of data between your on-premises data
|
||||
// centers and Amazon Simple Storage Service (Amazon S3). The Snowball commands
|
||||
// described here provide access to the same functionality that is available
|
||||
// in the AWS Snowball Management Console, which enables you to create and manage
|
||||
// jobs for Snowball. To transfer data locally with a Snowball appliance, you'll
|
||||
// need to use the Snowball client or the Amazon S3 API adapter for Snowball.
|
||||
// For more information, see the User Guide (http://docs.aws.amazon.com/AWSImportExport/latest/ug/api-reference.html).
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/snowball-2016-06-30 for more information on this service.
|
||||
//
|
||||
// See snowball package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/snowball/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for Amazon Import/Export Snowball you will first need
|
||||
// to create a new instance of it.
|
||||
//
|
||||
// When creating a client for an AWS service you'll first need to have a Session
|
||||
// already created. The Session provides configuration that can be shared
|
||||
// between multiple service clients. Additional configuration can be applied to
|
||||
// the Session and service's client when they are constructed. The aws package's
|
||||
// Config type contains several fields such as Region for the AWS Region the
|
||||
// client should make API requests too. The optional Config value can be provided
|
||||
// as the variadic argument for Sessions and client creation.
|
||||
//
|
||||
// Once the service's client is created you can use it to make API requests the
|
||||
// AWS service. These clients are safe to use concurrently.
|
||||
//
|
||||
// // Create a session to share configuration, and load external configuration.
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create the service's client with the session.
|
||||
// svc := snowball.New(sess)
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use service clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws package's Config type for more information on configuration options.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon Import/Export Snowball client Snowball for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/snowball/#New
|
||||
//
|
||||
// Once the client is created you can make an API request to the service.
|
||||
// Each API method takes a input parameter, and returns the service response
|
||||
// and an error.
|
||||
//
|
||||
// The API method will document which error codes the service can be returned
|
||||
// by the operation if the service models the API operation's errors. These
|
||||
// errors will also be available as const strings prefixed with "ErrCode".
|
||||
//
|
||||
// result, err := svc.CancelCluster(params)
|
||||
// if err != nil {
|
||||
// // Cast err to awserr.Error to handle specific error codes.
|
||||
// aerr, ok := err.(awserr.Error)
|
||||
// if ok && aerr.Code() == <error code to check for> {
|
||||
// // Specific error code handling
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// fmt.Println("CancelCluster result:")
|
||||
// fmt.Println(result)
|
||||
//
|
||||
// Using the Client with Context
|
||||
//
|
||||
// The service's client also provides methods to make API requests with a Context
|
||||
// value. This allows you to control the timeout, and cancellation of pending
|
||||
// requests. These methods also take request Option as variadic parameter to apply
|
||||
// additional configuration to the API request.
|
||||
//
|
||||
// ctx := context.Background()
|
||||
//
|
||||
// result, err := svc.CancelClusterWithContext(ctx, params)
|
||||
//
|
||||
// See the request package documentation for more information on using Context pattern
|
||||
// with the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
|
||||
package snowball
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package snowball
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeClusterLimitExceededException for service response error code
|
||||
// "ClusterLimitExceededException".
|
||||
//
|
||||
// Job creation failed. Currently, clusters support five nodes. If you have
|
||||
// less than five nodes for your cluster and you have more nodes to create for
|
||||
// this cluster, try again and create jobs until your cluster has exactly five
|
||||
// notes.
|
||||
ErrCodeClusterLimitExceededException = "ClusterLimitExceededException"
|
||||
|
||||
// ErrCodeInvalidAddressException for service response error code
|
||||
// "InvalidAddressException".
|
||||
//
|
||||
// The address provided was invalid. Check the address with your region's carrier,
|
||||
// and try again.
|
||||
ErrCodeInvalidAddressException = "InvalidAddressException"
|
||||
|
||||
// ErrCodeInvalidInputCombinationException for service response error code
|
||||
// "InvalidInputCombinationException".
|
||||
//
|
||||
// Job or cluster creation failed. One ore more inputs were invalid. Confirm
|
||||
// that the CreateClusterRequest$SnowballType value supports your CreateJobRequest$JobType,
|
||||
// and try again.
|
||||
ErrCodeInvalidInputCombinationException = "InvalidInputCombinationException"
|
||||
|
||||
// ErrCodeInvalidJobStateException for service response error code
|
||||
// "InvalidJobStateException".
|
||||
//
|
||||
// The action can't be performed because the job's current state doesn't allow
|
||||
// that action to be performed.
|
||||
ErrCodeInvalidJobStateException = "InvalidJobStateException"
|
||||
|
||||
// ErrCodeInvalidNextTokenException for service response error code
|
||||
// "InvalidNextTokenException".
|
||||
//
|
||||
// The NextToken string was altered unexpectedly, and the operation has stopped.
|
||||
// Run the operation without changing the NextToken string, and try again.
|
||||
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
|
||||
|
||||
// ErrCodeInvalidResourceException for service response error code
|
||||
// "InvalidResourceException".
|
||||
//
|
||||
// The specified resource can't be found. Check the information you provided
|
||||
// in your last request, and try again.
|
||||
ErrCodeInvalidResourceException = "InvalidResourceException"
|
||||
|
||||
// ErrCodeKMSRequestFailedException for service response error code
|
||||
// "KMSRequestFailedException".
|
||||
//
|
||||
// The provided AWS Key Management Service key lacks the permissions to perform
|
||||
// the specified CreateJob or UpdateJob action.
|
||||
ErrCodeKMSRequestFailedException = "KMSRequestFailedException"
|
||||
|
||||
// ErrCodeUnsupportedAddressException for service response error code
|
||||
// "UnsupportedAddressException".
|
||||
//
|
||||
// The address is either outside the serviceable area for your region, or an
|
||||
// error occurred. Check the address with your region's carrier and try again.
|
||||
// If the issue persists, contact AWS Support.
|
||||
ErrCodeUnsupportedAddressException = "UnsupportedAddressException"
|
||||
)
|
||||
+546
@@ -0,0 +1,546 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package snowball_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/snowball"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleSnowball_CancelCluster() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.CancelClusterInput{
|
||||
ClusterId: aws.String("ClusterId"), // Required
|
||||
}
|
||||
resp, err := svc.CancelCluster(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_CancelJob() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.CancelJobInput{
|
||||
JobId: aws.String("JobId"), // Required
|
||||
}
|
||||
resp, err := svc.CancelJob(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_CreateAddress() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.CreateAddressInput{
|
||||
Address: &snowball.Address{ // Required
|
||||
AddressId: aws.String("AddressId"),
|
||||
City: aws.String("String"),
|
||||
Company: aws.String("String"),
|
||||
Country: aws.String("String"),
|
||||
IsRestricted: aws.Bool(true),
|
||||
Landmark: aws.String("String"),
|
||||
Name: aws.String("String"),
|
||||
PhoneNumber: aws.String("String"),
|
||||
PostalCode: aws.String("String"),
|
||||
PrefectureOrDistrict: aws.String("String"),
|
||||
StateOrProvince: aws.String("String"),
|
||||
Street1: aws.String("String"),
|
||||
Street2: aws.String("String"),
|
||||
Street3: aws.String("String"),
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateAddress(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_CreateCluster() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.CreateClusterInput{
|
||||
AddressId: aws.String("AddressId"), // Required
|
||||
JobType: aws.String("JobType"), // Required
|
||||
Resources: &snowball.JobResource{ // Required
|
||||
LambdaResources: []*snowball.LambdaResource{
|
||||
{ // Required
|
||||
EventTriggers: []*snowball.EventTriggerDefinition{
|
||||
{ // Required
|
||||
EventResourceARN: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LambdaArn: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
S3Resources: []*snowball.S3Resource{
|
||||
{ // Required
|
||||
BucketArn: aws.String("ResourceARN"),
|
||||
KeyRange: &snowball.KeyRange{
|
||||
BeginMarker: aws.String("String"),
|
||||
EndMarker: aws.String("String"),
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
ShippingOption: aws.String("ShippingOption"), // Required
|
||||
Description: aws.String("String"),
|
||||
ForwardingAddressId: aws.String("AddressId"),
|
||||
KmsKeyARN: aws.String("KmsKeyARN"),
|
||||
Notification: &snowball.Notification{
|
||||
JobStatesToNotify: []*string{
|
||||
aws.String("JobState"), // Required
|
||||
// More values...
|
||||
},
|
||||
NotifyAll: aws.Bool(true),
|
||||
SnsTopicARN: aws.String("SnsTopicARN"),
|
||||
},
|
||||
SnowballType: aws.String("Type"),
|
||||
}
|
||||
resp, err := svc.CreateCluster(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_CreateJob() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.CreateJobInput{
|
||||
AddressId: aws.String("AddressId"),
|
||||
ClusterId: aws.String("ClusterId"),
|
||||
Description: aws.String("String"),
|
||||
ForwardingAddressId: aws.String("AddressId"),
|
||||
JobType: aws.String("JobType"),
|
||||
KmsKeyARN: aws.String("KmsKeyARN"),
|
||||
Notification: &snowball.Notification{
|
||||
JobStatesToNotify: []*string{
|
||||
aws.String("JobState"), // Required
|
||||
// More values...
|
||||
},
|
||||
NotifyAll: aws.Bool(true),
|
||||
SnsTopicARN: aws.String("SnsTopicARN"),
|
||||
},
|
||||
Resources: &snowball.JobResource{
|
||||
LambdaResources: []*snowball.LambdaResource{
|
||||
{ // Required
|
||||
EventTriggers: []*snowball.EventTriggerDefinition{
|
||||
{ // Required
|
||||
EventResourceARN: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LambdaArn: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
S3Resources: []*snowball.S3Resource{
|
||||
{ // Required
|
||||
BucketArn: aws.String("ResourceARN"),
|
||||
KeyRange: &snowball.KeyRange{
|
||||
BeginMarker: aws.String("String"),
|
||||
EndMarker: aws.String("String"),
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
ShippingOption: aws.String("ShippingOption"),
|
||||
SnowballCapacityPreference: aws.String("Capacity"),
|
||||
SnowballType: aws.String("Type"),
|
||||
}
|
||||
resp, err := svc.CreateJob(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_DescribeAddress() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.DescribeAddressInput{
|
||||
AddressId: aws.String("AddressId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeAddress(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_DescribeAddresses() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.DescribeAddressesInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.DescribeAddresses(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_DescribeCluster() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.DescribeClusterInput{
|
||||
ClusterId: aws.String("ClusterId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeCluster(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_DescribeJob() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.DescribeJobInput{
|
||||
JobId: aws.String("JobId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeJob(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_GetJobManifest() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.GetJobManifestInput{
|
||||
JobId: aws.String("JobId"), // Required
|
||||
}
|
||||
resp, err := svc.GetJobManifest(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_GetJobUnlockCode() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.GetJobUnlockCodeInput{
|
||||
JobId: aws.String("JobId"), // Required
|
||||
}
|
||||
resp, err := svc.GetJobUnlockCode(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_GetSnowballUsage() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
var params *snowball.GetSnowballUsageInput
|
||||
resp, err := svc.GetSnowballUsage(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_ListClusterJobs() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.ListClusterJobsInput{
|
||||
ClusterId: aws.String("ClusterId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.ListClusterJobs(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_ListClusters() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.ListClustersInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.ListClusters(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_ListJobs() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.ListJobsInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.ListJobs(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_UpdateCluster() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.UpdateClusterInput{
|
||||
ClusterId: aws.String("ClusterId"), // Required
|
||||
AddressId: aws.String("AddressId"),
|
||||
Description: aws.String("String"),
|
||||
ForwardingAddressId: aws.String("AddressId"),
|
||||
Notification: &snowball.Notification{
|
||||
JobStatesToNotify: []*string{
|
||||
aws.String("JobState"), // Required
|
||||
// More values...
|
||||
},
|
||||
NotifyAll: aws.Bool(true),
|
||||
SnsTopicARN: aws.String("SnsTopicARN"),
|
||||
},
|
||||
Resources: &snowball.JobResource{
|
||||
LambdaResources: []*snowball.LambdaResource{
|
||||
{ // Required
|
||||
EventTriggers: []*snowball.EventTriggerDefinition{
|
||||
{ // Required
|
||||
EventResourceARN: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LambdaArn: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
S3Resources: []*snowball.S3Resource{
|
||||
{ // Required
|
||||
BucketArn: aws.String("ResourceARN"),
|
||||
KeyRange: &snowball.KeyRange{
|
||||
BeginMarker: aws.String("String"),
|
||||
EndMarker: aws.String("String"),
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
ShippingOption: aws.String("ShippingOption"),
|
||||
}
|
||||
resp, err := svc.UpdateCluster(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
|
||||
func ExampleSnowball_UpdateJob() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := snowball.New(sess)
|
||||
|
||||
params := &snowball.UpdateJobInput{
|
||||
JobId: aws.String("JobId"), // Required
|
||||
AddressId: aws.String("AddressId"),
|
||||
Description: aws.String("String"),
|
||||
ForwardingAddressId: aws.String("AddressId"),
|
||||
Notification: &snowball.Notification{
|
||||
JobStatesToNotify: []*string{
|
||||
aws.String("JobState"), // Required
|
||||
// More values...
|
||||
},
|
||||
NotifyAll: aws.Bool(true),
|
||||
SnsTopicARN: aws.String("SnsTopicARN"),
|
||||
},
|
||||
Resources: &snowball.JobResource{
|
||||
LambdaResources: []*snowball.LambdaResource{
|
||||
{ // Required
|
||||
EventTriggers: []*snowball.EventTriggerDefinition{
|
||||
{ // Required
|
||||
EventResourceARN: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
LambdaArn: aws.String("ResourceARN"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
S3Resources: []*snowball.S3Resource{
|
||||
{ // Required
|
||||
BucketArn: aws.String("ResourceARN"),
|
||||
KeyRange: &snowball.KeyRange{
|
||||
BeginMarker: aws.String("String"),
|
||||
EndMarker: aws.String("String"),
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
ShippingOption: aws.String("ShippingOption"),
|
||||
SnowballCapacityPreference: aws.String("Capacity"),
|
||||
}
|
||||
resp, err := svc.UpdateJob(params)
|
||||
|
||||
if err != nil {
|
||||
// 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)
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package snowball
|
||||
|
||||
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/jsonrpc"
|
||||
)
|
||||
|
||||
// Snowball provides the API operation methods for making requests to
|
||||
// Amazon Import/Export Snowball. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// Snowball methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type Snowball 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 = "snowball" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Snowball 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 Snowball client from just a session.
|
||||
// svc := snowball.New(mySession)
|
||||
//
|
||||
// // Create a Snowball client with additional configuration
|
||||
// svc := snowball.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Snowball {
|
||||
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) *Snowball {
|
||||
svc := &Snowball{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-06-30",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AWSIESnowballJobManagementService",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a Snowball operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Snowball) 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
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package snowballiface provides an interface to enable mocking the Amazon Import/Export Snowball 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 snowballiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/snowball"
|
||||
)
|
||||
|
||||
// SnowballAPI provides an interface to enable mocking the
|
||||
// snowball.Snowball 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 the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon Import/Export Snowball.
|
||||
// func myFunc(svc snowballiface.SnowballAPI) bool {
|
||||
// // Make svc.CancelCluster request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := snowball.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockSnowballClient struct {
|
||||
// snowballiface.SnowballAPI
|
||||
// }
|
||||
// func (m *mockSnowballClient) CancelCluster(input *snowball.CancelClusterInput) (*snowball.CancelClusterOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockSnowballClient{}
|
||||
//
|
||||
// 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 SnowballAPI interface {
|
||||
CancelCluster(*snowball.CancelClusterInput) (*snowball.CancelClusterOutput, error)
|
||||
CancelClusterWithContext(aws.Context, *snowball.CancelClusterInput, ...request.Option) (*snowball.CancelClusterOutput, error)
|
||||
CancelClusterRequest(*snowball.CancelClusterInput) (*request.Request, *snowball.CancelClusterOutput)
|
||||
|
||||
CancelJob(*snowball.CancelJobInput) (*snowball.CancelJobOutput, error)
|
||||
CancelJobWithContext(aws.Context, *snowball.CancelJobInput, ...request.Option) (*snowball.CancelJobOutput, error)
|
||||
CancelJobRequest(*snowball.CancelJobInput) (*request.Request, *snowball.CancelJobOutput)
|
||||
|
||||
CreateAddress(*snowball.CreateAddressInput) (*snowball.CreateAddressOutput, error)
|
||||
CreateAddressWithContext(aws.Context, *snowball.CreateAddressInput, ...request.Option) (*snowball.CreateAddressOutput, error)
|
||||
CreateAddressRequest(*snowball.CreateAddressInput) (*request.Request, *snowball.CreateAddressOutput)
|
||||
|
||||
CreateCluster(*snowball.CreateClusterInput) (*snowball.CreateClusterOutput, error)
|
||||
CreateClusterWithContext(aws.Context, *snowball.CreateClusterInput, ...request.Option) (*snowball.CreateClusterOutput, error)
|
||||
CreateClusterRequest(*snowball.CreateClusterInput) (*request.Request, *snowball.CreateClusterOutput)
|
||||
|
||||
CreateJob(*snowball.CreateJobInput) (*snowball.CreateJobOutput, error)
|
||||
CreateJobWithContext(aws.Context, *snowball.CreateJobInput, ...request.Option) (*snowball.CreateJobOutput, error)
|
||||
CreateJobRequest(*snowball.CreateJobInput) (*request.Request, *snowball.CreateJobOutput)
|
||||
|
||||
DescribeAddress(*snowball.DescribeAddressInput) (*snowball.DescribeAddressOutput, error)
|
||||
DescribeAddressWithContext(aws.Context, *snowball.DescribeAddressInput, ...request.Option) (*snowball.DescribeAddressOutput, error)
|
||||
DescribeAddressRequest(*snowball.DescribeAddressInput) (*request.Request, *snowball.DescribeAddressOutput)
|
||||
|
||||
DescribeAddresses(*snowball.DescribeAddressesInput) (*snowball.DescribeAddressesOutput, error)
|
||||
DescribeAddressesWithContext(aws.Context, *snowball.DescribeAddressesInput, ...request.Option) (*snowball.DescribeAddressesOutput, error)
|
||||
DescribeAddressesRequest(*snowball.DescribeAddressesInput) (*request.Request, *snowball.DescribeAddressesOutput)
|
||||
|
||||
DescribeAddressesPages(*snowball.DescribeAddressesInput, func(*snowball.DescribeAddressesOutput, bool) bool) error
|
||||
DescribeAddressesPagesWithContext(aws.Context, *snowball.DescribeAddressesInput, func(*snowball.DescribeAddressesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeCluster(*snowball.DescribeClusterInput) (*snowball.DescribeClusterOutput, error)
|
||||
DescribeClusterWithContext(aws.Context, *snowball.DescribeClusterInput, ...request.Option) (*snowball.DescribeClusterOutput, error)
|
||||
DescribeClusterRequest(*snowball.DescribeClusterInput) (*request.Request, *snowball.DescribeClusterOutput)
|
||||
|
||||
DescribeJob(*snowball.DescribeJobInput) (*snowball.DescribeJobOutput, error)
|
||||
DescribeJobWithContext(aws.Context, *snowball.DescribeJobInput, ...request.Option) (*snowball.DescribeJobOutput, error)
|
||||
DescribeJobRequest(*snowball.DescribeJobInput) (*request.Request, *snowball.DescribeJobOutput)
|
||||
|
||||
GetJobManifest(*snowball.GetJobManifestInput) (*snowball.GetJobManifestOutput, error)
|
||||
GetJobManifestWithContext(aws.Context, *snowball.GetJobManifestInput, ...request.Option) (*snowball.GetJobManifestOutput, error)
|
||||
GetJobManifestRequest(*snowball.GetJobManifestInput) (*request.Request, *snowball.GetJobManifestOutput)
|
||||
|
||||
GetJobUnlockCode(*snowball.GetJobUnlockCodeInput) (*snowball.GetJobUnlockCodeOutput, error)
|
||||
GetJobUnlockCodeWithContext(aws.Context, *snowball.GetJobUnlockCodeInput, ...request.Option) (*snowball.GetJobUnlockCodeOutput, error)
|
||||
GetJobUnlockCodeRequest(*snowball.GetJobUnlockCodeInput) (*request.Request, *snowball.GetJobUnlockCodeOutput)
|
||||
|
||||
GetSnowballUsage(*snowball.GetSnowballUsageInput) (*snowball.GetSnowballUsageOutput, error)
|
||||
GetSnowballUsageWithContext(aws.Context, *snowball.GetSnowballUsageInput, ...request.Option) (*snowball.GetSnowballUsageOutput, error)
|
||||
GetSnowballUsageRequest(*snowball.GetSnowballUsageInput) (*request.Request, *snowball.GetSnowballUsageOutput)
|
||||
|
||||
ListClusterJobs(*snowball.ListClusterJobsInput) (*snowball.ListClusterJobsOutput, error)
|
||||
ListClusterJobsWithContext(aws.Context, *snowball.ListClusterJobsInput, ...request.Option) (*snowball.ListClusterJobsOutput, error)
|
||||
ListClusterJobsRequest(*snowball.ListClusterJobsInput) (*request.Request, *snowball.ListClusterJobsOutput)
|
||||
|
||||
ListClusters(*snowball.ListClustersInput) (*snowball.ListClustersOutput, error)
|
||||
ListClustersWithContext(aws.Context, *snowball.ListClustersInput, ...request.Option) (*snowball.ListClustersOutput, error)
|
||||
ListClustersRequest(*snowball.ListClustersInput) (*request.Request, *snowball.ListClustersOutput)
|
||||
|
||||
ListJobs(*snowball.ListJobsInput) (*snowball.ListJobsOutput, error)
|
||||
ListJobsWithContext(aws.Context, *snowball.ListJobsInput, ...request.Option) (*snowball.ListJobsOutput, error)
|
||||
ListJobsRequest(*snowball.ListJobsInput) (*request.Request, *snowball.ListJobsOutput)
|
||||
|
||||
ListJobsPages(*snowball.ListJobsInput, func(*snowball.ListJobsOutput, bool) bool) error
|
||||
ListJobsPagesWithContext(aws.Context, *snowball.ListJobsInput, func(*snowball.ListJobsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
UpdateCluster(*snowball.UpdateClusterInput) (*snowball.UpdateClusterOutput, error)
|
||||
UpdateClusterWithContext(aws.Context, *snowball.UpdateClusterInput, ...request.Option) (*snowball.UpdateClusterOutput, error)
|
||||
UpdateClusterRequest(*snowball.UpdateClusterInput) (*request.Request, *snowball.UpdateClusterOutput)
|
||||
|
||||
UpdateJob(*snowball.UpdateJobInput) (*snowball.UpdateJobOutput, error)
|
||||
UpdateJobWithContext(aws.Context, *snowball.UpdateJobInput, ...request.Option) (*snowball.UpdateJobOutput, error)
|
||||
UpdateJobRequest(*snowball.UpdateJobInput) (*request.Request, *snowball.UpdateJobOutput)
|
||||
}
|
||||
|
||||
var _ SnowballAPI = (*snowball.Snowball)(nil)
|
||||
Reference in New Issue
Block a user