mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+503
-304
File diff suppressed because it is too large
Load Diff
+17
-18
@@ -3,34 +3,33 @@
|
||||
// Package glacier provides the client and types for making API
|
||||
// requests to Amazon Glacier.
|
||||
//
|
||||
// Amazon Glacier is a storage solution for "cold data."
|
||||
// Amazon S3 Glacier (Glacier) is a storage solution for "cold data."
|
||||
//
|
||||
// Amazon Glacier is an extremely low-cost storage service that provides secure,
|
||||
// durable, and easy-to-use storage for data backup and archival. With Amazon
|
||||
// Glacier, customers can store their data cost effectively for months, years,
|
||||
// or decades. Amazon Glacier also enables customers to offload the administrative
|
||||
// burdens of operating and scaling storage to AWS, so they don't have to worry
|
||||
// about capacity planning, hardware provisioning, data replication, hardware
|
||||
// failure and recovery, or time-consuming hardware migrations.
|
||||
// Glacier is an extremely low-cost storage service that provides secure, durable,
|
||||
// and easy-to-use storage for data backup and archival. With Glacier, customers
|
||||
// can store their data cost effectively for months, years, or decades. Glacier
|
||||
// also enables customers to offload the administrative burdens of operating
|
||||
// and scaling storage to AWS, so they don't have to worry about capacity planning,
|
||||
// hardware provisioning, data replication, hardware failure and recovery, or
|
||||
// time-consuming hardware migrations.
|
||||
//
|
||||
// Amazon Glacier is a great storage choice when low storage cost is paramount,
|
||||
// your data is rarely retrieved, and retrieval latency of several hours is
|
||||
// acceptable. If your application requires fast or frequent access to your
|
||||
// data, consider using Amazon S3. For more information, see Amazon Simple Storage
|
||||
// Service (Amazon S3) (http://aws.amazon.com/s3/).
|
||||
// Glacier is a great storage choice when low storage cost is paramount and
|
||||
// your data is rarely retrieved. If your application requires fast or frequent
|
||||
// access to your data, consider using Amazon S3. For more information, see
|
||||
// Amazon Simple Storage Service (Amazon S3) (http://aws.amazon.com/s3/).
|
||||
//
|
||||
// You can store any kind of data in any format. There is no maximum limit on
|
||||
// the total amount of data you can store in Amazon Glacier.
|
||||
// the total amount of data you can store in Glacier.
|
||||
//
|
||||
// If you are a first-time user of Amazon Glacier, we recommend that you begin
|
||||
// by reading the following sections in the Amazon Glacier Developer Guide:
|
||||
// If you are a first-time user of Glacier, we recommend that you begin by reading
|
||||
// the following sections in the Amazon S3 Glacier Developer Guide:
|
||||
//
|
||||
// * What is Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html)
|
||||
// * What is Amazon S3 Glacier (https://docs.aws.amazon.com/amazonglacier/latest/dev/introduction.html)
|
||||
// - This section of the Developer Guide describes the underlying data model,
|
||||
// the operations it supports, and the AWS SDKs that you can use to interact
|
||||
// with the service.
|
||||
//
|
||||
// * Getting Started with Amazon Glacier (http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-getting-started.html)
|
||||
// * Getting Started with Amazon S3 Glacier (https://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-getting-started.html)
|
||||
// - The Getting Started section walks you through the process of creating
|
||||
// a vault, uploading archives, creating jobs to download archives, retrieving
|
||||
// the job output, and deleting archives.
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ const (
|
||||
// ErrCodeRequestTimeoutException for service response error code
|
||||
// "RequestTimeoutException".
|
||||
//
|
||||
// Returned if, when uploading an archive, Amazon Glacier times out while receiving
|
||||
// the upload.
|
||||
// Returned if, when uploading an archive, Amazon S3 Glacier times out while
|
||||
// receiving the upload.
|
||||
ErrCodeRequestTimeoutException = "RequestTimeoutException"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
|
||||
+1
-1
@@ -545,7 +545,7 @@ func ExampleGlacier_GetJobOutput_shared00() {
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To get the access-policy set on the vault
|
||||
// To get the access-policy set on the vault
|
||||
//
|
||||
// The example retrieves the access-policy set on the vault named example-vault.
|
||||
func ExampleGlacier_GetVaultAccessPolicy_shared00() {
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// +build go1.10,integration
|
||||
|
||||
package glacier_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/glacier"
|
||||
)
|
||||
|
||||
var _ aws.Config
|
||||
var _ awserr.Error
|
||||
var _ request.Request
|
||||
|
||||
func TestInteg_00_ListVaults(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := glacier.New(sess)
|
||||
params := &glacier.ListVaultsInput{}
|
||||
_, err := svc.ListVaultsWithContext(ctx, params)
|
||||
if err != nil {
|
||||
t.Errorf("expect no error, got %v", err)
|
||||
}
|
||||
}
|
||||
func TestInteg_01_ListVaults(t *testing.T) {
|
||||
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancelFn()
|
||||
|
||||
sess := integration.SessionWithDefaultRegion("us-west-2")
|
||||
svc := glacier.New(sess)
|
||||
params := &glacier.ListVaultsInput{
|
||||
AccountId: aws.String("abcmnoxyz"),
|
||||
}
|
||||
_, err := svc.ListVaultsWithContext(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
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "glacier" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
ServiceName = "glacier" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "Glacier" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Glacier 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,
|
||||
|
||||
Reference in New Issue
Block a user