ebs – github.com/aws/aws-sdk-go-v2/service/ebs Index | Files | Directories

package ebs

import "github.com/aws/aws-sdk-go-v2/service/ebs"

Index

Constants

const ServiceAPIVersion = "2019-11-02"
const ServiceID = "EBS"

Functions

func AddResolveEndpointMiddleware

func AddResolveEndpointMiddleware(stack *middleware.Stack, options ResolveEndpointMiddlewareOptions)

func NewDefaultEndpointResolver

func NewDefaultEndpointResolver() *internalendpoints.Resolver

NewDefaultEndpointResolver constructs a new service endpoint resolver

func RemoveResolveEndpointMiddleware

func RemoveResolveEndpointMiddleware(stack *middleware.Stack) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

You can use the Amazon Elastic Block Store (EBS) direct APIs to directly read the data on your EBS snapshots, and identify the difference between two snapshots. You can view the details of blocks in an EBS snapshot, compare the block difference between two snapshots, and directly access the data in a snapshot. If you're an independent software vendor (ISV) who offers backup services for EBS, the EBS direct APIs make it easier and more cost-effective to track incremental changes on your EBS volumes via EBS snapshots. This can be done without having to create new volumes from EBS snapshots. <p>This API reference provides detailed information about the actions, data types, parameters, and errors of the EBS direct APIs. For more information about the elements that make up the EBS direct APIs, and examples of how to use them effectively, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html">Accessing the Contents of an EBS Snapshot</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>. For more information about the supported AWS Regions, endpoints, and service quotas for the EBS direct APIs, see <a href="https://docs.aws.amazon.com/general/latest/gr/ebs-service.html">Amazon Elastic Block Store Endpoints and Quotas</a> in the <i>AWS General Reference</i>.</p>

func New

func New(options Options, optFns ...func(*Options)) *Client

New returns an initialized Client based on the functional options. Provide additional functional options to further configure the behavior of the client, such as changing the client's endpoint or adding custom middleware behavior.

func NewFromConfig

func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client

NewFromConfig returns a new client from the provided config.

func (*Client) CompleteSnapshot

func (c *Client) CompleteSnapshot(ctx context.Context, params *CompleteSnapshotInput, optFns ...func(*Options)) (*CompleteSnapshotOutput, error)

Seals and completes the snapshot after all of the required blocks of data have been written to it. Completing the snapshot changes the status to completed. You cannot write new blocks to a snapshot after it has been completed.

func (*Client) GetSnapshotBlock

func (c *Client) GetSnapshotBlock(ctx context.Context, params *GetSnapshotBlockInput, optFns ...func(*Options)) (*GetSnapshotBlockOutput, error)

Returns the data in a block in an Amazon Elastic Block Store snapshot.

func (*Client) ListChangedBlocks

func (c *Client) ListChangedBlocks(ctx context.Context, params *ListChangedBlocksInput, optFns ...func(*Options)) (*ListChangedBlocksOutput, error)

Returns the block indexes and block tokens for blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

func (*Client) ListSnapshotBlocks

func (c *Client) ListSnapshotBlocks(ctx context.Context, params *ListSnapshotBlocksInput, optFns ...func(*Options)) (*ListSnapshotBlocksOutput, error)

Returns the block indexes and block tokens for blocks in an Amazon Elastic Block Store snapshot.

func (*Client) PutSnapshotBlock

func (c *Client) PutSnapshotBlock(ctx context.Context, params *PutSnapshotBlockInput, optFns ...func(*Options)) (*PutSnapshotBlockOutput, error)

Writes a block of data to a block in the snapshot. If the specified block contains data, the existing data is overwritten. The target snapshot must be in the pending state. Data written to a snapshot must be aligned with 512-byte sectors.

func (*Client) StartSnapshot

func (c *Client) StartSnapshot(ctx context.Context, params *StartSnapshotInput, optFns ...func(*Options)) (*StartSnapshotOutput, error)

Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes. After creating the snapshot, use PutSnapshotBlock (https://docs.aws.amazon.com/ebs/latest/APIReference/API_PutSnapshotBlock.html) to write blocks of data to the snapshot.

type CompleteSnapshotInput

type CompleteSnapshotInput struct {

	// An aggregated Base-64 SHA256 checksum based on the checksums of each written
	// block. To generate the aggregated checksum using the linear aggregation method,
	// arrange the checksums for each written block in ascending order of their block
	// index, concatenate them to form a single string, and then generate the checksum
	// on the entire string using the SHA256 algorithm.
	Checksum *string

	// The ID of the snapshot.
	//
	// This member is required.
	SnapshotId *string

	// The aggregation method used to generate the checksum. Currently, the only
	// supported aggregation method is LINEAR.
	ChecksumAggregationMethod types.ChecksumAggregationMethod

	// The number of blocks that were written to the snapshot.
	//
	// This member is required.
	ChangedBlocksCount *int32

	// The algorithm used to generate the checksum. Currently, the only supported
	// algorithm is SHA256.
	ChecksumAlgorithm types.ChecksumAlgorithm
}

type CompleteSnapshotOutput

type CompleteSnapshotOutput struct {

	// The status of the snapshot.
	Status types.Status

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type EndpointResolver

type EndpointResolver interface {
	ResolveEndpoint(region string, options ResolverOptions) (aws.Endpoint, error)
}

EndpointResolver interface for resolving service endpoints.

func WithEndpointResolver

func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver

WithEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided fallbackResolver for resolution. awsResolver and fallbackResolver must not be nil

type EndpointResolverFunc

type EndpointResolverFunc func(region string, options ResolverOptions) (aws.Endpoint, error)

EndpointResolverFunc is a helper utility that wraps a function so it satisfies the EndpointResolver interface. This is useful when you want to add additional endpoint resolving logic, or stub out specific endpoints with custom values.

func (EndpointResolverFunc) ResolveEndpoint

func (fn EndpointResolverFunc) ResolveEndpoint(region string, options ResolverOptions) (endpoint aws.Endpoint, err error)

type GetSnapshotBlockInput

type GetSnapshotBlockInput struct {

	// The block token of the block from which to get data.  <p>Obtain the
	// <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or
	// <code>ListSnapshotBlocks</code> operations.</p>
	//
	// This member is required.
	BlockToken *string

	// The block index of the block from which to get data.  <p>Obtain the
	// <code>BlockIndex</code> by running the <code>ListChangedBlocks</code> or
	// <code>ListSnapshotBlocks</code> operations.</p>
	//
	// This member is required.
	BlockIndex *int32

	// The ID of the snapshot containing the block from which to get data.
	//
	// This member is required.
	SnapshotId *string
}

type GetSnapshotBlockOutput

type GetSnapshotBlockOutput struct {

	// The data content of the block.
	BlockData io.ReadCloser

	// The checksum generated for the block, which is Base64 encoded.
	Checksum *string

	// The size of the data in the block.
	DataLength *int32

	// The algorithm used to generate the checksum for the block, such as SHA256.
	ChecksumAlgorithm types.ChecksumAlgorithm

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type HTTPSignerV4

type HTTPSignerV4 interface {
	SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time) error
}

type IdempotencyTokenProvider

type IdempotencyTokenProvider interface {
	GetIdempotencyToken() (string, error)
}

IdempotencyTokenProvider interface for providing idempotency token

type ListChangedBlocksInput

type ListChangedBlocksInput struct {

	// The ID of the first snapshot to use for the comparison. The FirstSnapshotID
	// parameter must be specified with a SecondSnapshotId parameter; otherwise, an
	// error occurs.
	FirstSnapshotId *string

	// The token to request the next page of results.
	NextToken *string

	// The number of results to return.
	MaxResults *int32

	// The ID of the second snapshot to use for the comparison. The SecondSnapshotId
	// parameter must be specified with a FirstSnapshotID parameter; otherwise, an
	// error occurs.
	//
	// This member is required.
	SecondSnapshotId *string

	// The block index from which the comparison should start.  <p>The list in the
	// response will start from this block index or the next valid block index in the
	// snapshots.</p>
	StartingBlockIndex *int32
}

type ListChangedBlocksOutput

type ListChangedBlocksOutput struct {

	// The token to use to retrieve the next page of results. This value is null when
	// there are no more results to return.
	NextToken *string

	// The size of the volume in GB.
	VolumeSize *int64

	// The size of the block.
	BlockSize *int32

	// The time when the BlockToken expires.
	ExpiryTime *time.Time

	// An array of objects containing information about the changed blocks.
	ChangedBlocks []*types.ChangedBlock

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type ListSnapshotBlocksInput

type ListSnapshotBlocksInput struct {

	// The ID of the snapshot from which to get block indexes and block tokens.
	//
	// This member is required.
	SnapshotId *string

	// The block index from which the list should start. The list in the response will
	// start from this block index or the next valid block index in the snapshot.
	StartingBlockIndex *int32

	// The token to request the next page of results.
	NextToken *string

	// The number of results to return.
	MaxResults *int32
}

type ListSnapshotBlocksOutput

type ListSnapshotBlocksOutput struct {

	// The size of the volume in GB.
	VolumeSize *int64

	// The token to use to retrieve the next page of results. This value is null when
	// there are no more results to return.
	NextToken *string

	// An array of objects containing information about the blocks.
	Blocks []*types.Block

	// The size of the block.
	BlockSize *int32

	// The time when the BlockToken expires.
	ExpiryTime *time.Time

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type Options

type Options struct {
	// Set of options to modify how an operation is invoked. These apply to all
	// operations invoked for this client. Use functional options on operation call to
	// modify this list for per operation behavior.
	APIOptions []func(*middleware.Stack) error

	// The credentials object to use when signing requests.
	Credentials aws.CredentialsProvider

	// The endpoint options to be used when attempting to resolve an endpoint.
	EndpointOptions ResolverOptions

	// The service endpoint resolver.
	EndpointResolver EndpointResolver

	// Signature Version 4 (SigV4) Signer
	HTTPSignerV4 HTTPSignerV4

	// Provides idempotency tokens values that will be automatically populated into
	// idempotent API operations.
	IdempotencyTokenProvider IdempotencyTokenProvider

	// The region to send requests to. (Required)
	Region string

	// Retryer guides how HTTP requests should be retried in case of recoverable
	// failures. When nil the API client will use a default retryer.
	Retryer retry.Retryer

	// The HTTP client to invoke API calls with. Defaults to client's default HTTP
	// implementation if nil.
	HTTPClient HTTPClient
}

func (Options) Copy

func (o Options) Copy() Options

Copy creates a clone where the APIOptions list is deep copied.

func (Options) GetCredentials

func (o Options) GetCredentials() aws.CredentialsProvider

func (Options) GetEndpointOptions

func (o Options) GetEndpointOptions() ResolverOptions

func (Options) GetEndpointResolver

func (o Options) GetEndpointResolver() EndpointResolver

func (Options) GetHTTPSignerV4

func (o Options) GetHTTPSignerV4() HTTPSignerV4

func (Options) GetIdempotencyTokenProvider

func (o Options) GetIdempotencyTokenProvider() IdempotencyTokenProvider

func (Options) GetRegion

func (o Options) GetRegion() string

func (Options) GetRetryer

func (o Options) GetRetryer() retry.Retryer

type PutSnapshotBlockInput

type PutSnapshotBlockInput struct {

	// The size of the data to write to the block, in bytes. Currently, the only
	// supported size is 524288. Valid values: 524288
	//
	// This member is required.
	DataLength *int32

	// The progress of the write process, as a percentage.
	Progress *int32

	// The block index of the block in which to write the data. A block index is the
	// offset position of a block within a snapshot, and it is used to identify the
	// block. To identify the logical offset of the data in the logical volume,
	// multiply the block index with the block size (Block index * 512 bytes).
	//
	// This member is required.
	BlockIndex *int32

	// A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are
	// supported.
	//
	// This member is required.
	Checksum *string

	// The ID of the snapshot.
	//
	// This member is required.
	SnapshotId *string

	// The algorithm used to generate the checksum. Currently, the only supported
	// algorithm is SHA256.
	//
	// This member is required.
	ChecksumAlgorithm types.ChecksumAlgorithm

	// The data to write to the block. The block data is not signed as part of the
	// Signature Version 4 signing process. As a result, you must generate and provide
	// a Base64-encoded SHA256 checksum for the block data using the x-amz-Checksum
	// header. Also, you must specify the checksum algorithm using the
	// x-amz-Checksum-Algorithm header. The checksum that you provide is part of the
	// Signature Version 4 signing process. It is validated against a checksum
	// generated by Amazon EBS to ensure the validity and authenticity of the data. If
	// the checksums do not correspond, the request fails. For more information, see
	// Using checksums with the EBS direct APIs
	// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums)
	// in the Amazon Elastic Compute Cloud User Guide.
	//
	// This member is required.
	BlockData io.Reader
}

type PutSnapshotBlockOutput

type PutSnapshotBlockOutput struct {

	// The SHA256 checksum generated for the block data by Amazon EBS.
	Checksum *string

	// The algorithm used by Amazon EBS to generate the checksum.
	ChecksumAlgorithm types.ChecksumAlgorithm

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

type ResolveEndpoint

type ResolveEndpoint struct {
	Resolver EndpointResolver
	Options  ResolverOptions
}

func (*ResolveEndpoint) HandleSerialize

func (*ResolveEndpoint) ID

func (*ResolveEndpoint) ID() string

type ResolveEndpointMiddlewareOptions

type ResolveEndpointMiddlewareOptions interface {
	GetEndpointResolver() EndpointResolver
	GetEndpointOptions() ResolverOptions
}

type ResolverOptions

type ResolverOptions = internalendpoints.Options

ResolverOptions is the service endpoint resolver options

type StartSnapshotInput

type StartSnapshotInput struct {

	// A unique, case-sensitive identifier that you provide to ensure the idempotency
	// of the request. Idempotency ensures that an API request completes only once.
	// With an idempotent request, if the original request completes successfully. The
	// subsequent retries with the same client token return the result from the
	// original successful request and they have no additional effect. If you do not
	// specify a client token, one is automatically generated by the AWS SDK. For more
	// information, see  Idempotency for StartSnapshot API
	// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-direct-api-idempotency.html)
	// in the Amazon Elastic Compute Cloud User Guide.
	ClientToken *string

	// A description for the snapshot.
	Description *string

	// The tags to apply to the snapshot.
	Tags []*types.Tag

	// The size of the volume, in GiB. The maximum size is 16384 GiB (16 TiB).
	//
	// This member is required.
	VolumeSize *int64

	// The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
	// customer master key (CMK) to be used to encrypt the snapshot. If you do not
	// specify a CMK, the default AWS managed CMK is used. If you specify a
	// ParentSnapshotId, omit this parameter; the snapshot will be encrypted using the
	// same CMK that was used to encrypt the parent snapshot. If Encrypted is set to
	// true, you must specify a CMK ARN.
	KmsKeyArn *string

	// Indicates whether to encrypt the snapshot. To create an encrypted snapshot,
	// specify true. To create an unencrypted snapshot, omit this parameter. If you
	// specify a value for ParentSnapshotId, omit this parameter. If you specify true,
	// the snapshot is encrypted using the CMK specified using the KmsKeyArn parameter.
	// If no value is specified for KmsKeyArn, the default CMK for your account is
	// used. If no default CMK has been specified for your account, the AWS managed CMK
	// is used. To set a default CMK for your account, use  ModifyEbsDefaultKmsKeyId
	// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyEbsDefaultKmsKeyId.html).
	// If your account is enabled for encryption by default, you cannot set this
	// parameter to false. In this case, you can omit this parameter.  <p>For more
	// information, see <a
	// href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption">
	// Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
	Encrypted *bool

	// The ID of the parent snapshot. If there is no parent snapshot, or if you are
	// creating the first snapshot for an on-premises volume, omit this parameter. If
	// your account is enabled for encryption by default, you cannot use an unencrypted
	// snapshot as a parent snapshot. You must first create an encrypted copy of the
	// parent snapshot using CopySnapshot
	// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CopySnapshot.html).
	ParentSnapshotId *string

	// The amount of time (in minutes) after which the snapshot is automatically
	// cancelled if:
	//
	//     * No blocks are written to the snapshot.
	//
	//     * The snapshot
	// is not completed after writing the last block of data.
	//
	// If no value is
	// specified, the timeout defaults to 60 minutes.
	Timeout *int32
}

type StartSnapshotOutput

type StartSnapshotOutput struct {

	// The timestamp when the snapshot was created.
	StartTime *time.Time

	// The AWS account ID of the snapshot owner.
	OwnerId *string

	// The ID of the snapshot.
	SnapshotId *string

	// The description of the snapshot.
	Description *string

	// The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
	// customer master key (CMK) used to encrypt the snapshot.
	KmsKeyArn *string

	// The ID of the parent snapshot.
	ParentSnapshotId *string

	// The status of the snapshot.
	Status types.Status

	// The size of the blocks in the snapshot, in bytes.
	BlockSize *int32

	// The tags applied to the snapshot. You can specify up to 50 tags per snapshot.
	// For more information, see  Tagging your Amazon EC2 resources
	// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) in the
	// Amazon Elastic Compute Cloud User Guide.
	Tags []*types.Tag

	// The size of the volume, in GiB.
	VolumeSize *int64

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata
}

Source Files

api_client.go api_op_CompleteSnapshot.go api_op_GetSnapshotBlock.go api_op_ListChangedBlocks.go api_op_ListSnapshotBlocks.go api_op_PutSnapshotBlock.go api_op_StartSnapshot.go deserializers.go endpoints.go serializers.go validators.go

Directories

PathSynopsis
internal
types
Version
v0.26.0
Published
Oct 1, 2020
Platform
js/wasm
Imports
29 packages
Last checked
now

Tools for package owners.