package ebs

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

Package ebs provides the client and types for making API requests to Amazon EBS.

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.

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 Accessing the Contents of an EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html) in the Amazon Elastic Compute Cloud User Guide. For more information about the supported AWS Regions, endpoints, and service quotas for the EBS direct APIs, see Amazon Elastic Block Store Endpoints and Quotas (https://docs.aws.amazon.com/general/latest/gr/ebs-service.html) in the AWS General Reference.

See https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02 for more information on this service.

See ebs package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/ebs/

Using the Client

To use Amazon EBS 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 EBS client for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/ebs/#New

Index

Constants

const (
	ServiceName = "Amazon EBS" // Service's name
	ServiceID   = "EBS"        // Service's identifier
	EndpointsID = "ebs"        // Service's Endpoint identifier
)
const (

	// ErrCodeAccessDeniedException for service response error code
	// "AccessDeniedException".
	//
	// You do not have sufficient access to perform this action.
	ErrCodeAccessDeniedException = "AccessDeniedException"

	// ErrCodeConcurrentLimitExceededException for service response error code
	// "ConcurrentLimitExceededException".
	//
	// You have reached the limit for concurrent API requests. For more information,
	// see Optimizing performance of the EBS direct APIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapi-performance)
	// in the Amazon Elastic Compute Cloud User Guide.
	ErrCodeConcurrentLimitExceededException = "ConcurrentLimitExceededException"

	// ErrCodeConflictException for service response error code
	// "ConflictException".
	//
	// The request uses the same client token as a previous, but non-identical request.
	ErrCodeConflictException = "ConflictException"

	// ErrCodeInternalServerException for service response error code
	// "InternalServerException".
	//
	// An internal error has occurred.
	ErrCodeInternalServerException = "InternalServerException"

	// ErrCodeRequestThrottledException for service response error code
	// "RequestThrottledException".
	//
	// The number of API requests has exceed the maximum allowed API request throttling
	// limit.
	ErrCodeRequestThrottledException = "RequestThrottledException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// The specified resource does not exist.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeServiceQuotaExceededException for service response error code
	// "ServiceQuotaExceededException".
	//
	// Your current service quotas do not allow you to perform this action.
	ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException"

	// ErrCodeValidationException for service response error code
	// "ValidationException".
	//
	// The input fails to satisfy the constraints of the EBS direct APIs.
	ErrCodeValidationException = "ValidationException"
)

Types

type AccessDeniedExceptionReason

type AccessDeniedExceptionReason string
const (
	AccessDeniedExceptionReasonUnauthorizedAccount    AccessDeniedExceptionReason = "UNAUTHORIZED_ACCOUNT"
	AccessDeniedExceptionReasonDependencyAccessDenied AccessDeniedExceptionReason = "DEPENDENCY_ACCESS_DENIED"
)

Enum values for AccessDeniedExceptionReason

func (AccessDeniedExceptionReason) MarshalValue

func (enum AccessDeniedExceptionReason) MarshalValue() (string, error)

func (AccessDeniedExceptionReason) MarshalValueBuf

func (enum AccessDeniedExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)

type Block

type Block struct {

	// The block index.
	BlockIndex *int64 `type:"integer"`

	// The block token for the block index.
	BlockToken *string `type:"string"`
	// contains filtered or unexported fields
}

A block of data in an Amazon Elastic Block Store snapshot.

func (Block) MarshalFields

func (s Block) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (Block) String

func (s Block) String() string

String returns the string representation

type ChangedBlock

type ChangedBlock struct {

	// The block index.
	BlockIndex *int64 `type:"integer"`

	// The block token for the block index of the FirstSnapshotId specified in the
	// ListChangedBlocks operation. This value is absent if the first snapshot does
	// not have the changed block that is on the second snapshot.
	FirstBlockToken *string `type:"string"`

	// The block token for the block index of the SecondSnapshotId specified in
	// the ListChangedBlocks operation.
	SecondBlockToken *string `type:"string"`
	// contains filtered or unexported fields
}

A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.

func (ChangedBlock) MarshalFields

func (s ChangedBlock) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (ChangedBlock) String

func (s ChangedBlock) String() string

String returns the string representation

type ChecksumAggregationMethod

type ChecksumAggregationMethod string
const (
	ChecksumAggregationMethodLinear ChecksumAggregationMethod = "LINEAR"
)

Enum values for ChecksumAggregationMethod

func (ChecksumAggregationMethod) MarshalValue

func (enum ChecksumAggregationMethod) MarshalValue() (string, error)

func (ChecksumAggregationMethod) MarshalValueBuf

func (enum ChecksumAggregationMethod) MarshalValueBuf(b []byte) ([]byte, error)

type ChecksumAlgorithm

type ChecksumAlgorithm string
const (
	ChecksumAlgorithmSha256 ChecksumAlgorithm = "SHA256"
)

Enum values for ChecksumAlgorithm

func (ChecksumAlgorithm) MarshalValue

func (enum ChecksumAlgorithm) MarshalValue() (string, error)

func (ChecksumAlgorithm) MarshalValueBuf

func (enum ChecksumAlgorithm) MarshalValueBuf(b []byte) ([]byte, error)

type Client

type Client struct {
	*aws.Client
}

Client provides the API operation methods for making requests to Amazon EBS. See this package's package overview docs for details on the service.

The client's methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(config aws.Config) *Client

New creates a new instance of the client from the provided Config.

Example:

// Create a client from just a config.
svc := ebs.New(myConfig)

func (*Client) CompleteSnapshotRequest

func (c *Client) CompleteSnapshotRequest(input *CompleteSnapshotInput) CompleteSnapshotRequest

CompleteSnapshotRequest returns a request value for making API operation for Amazon Elastic Block Store.

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.

// Example sending a request using CompleteSnapshotRequest.
req := client.CompleteSnapshotRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/CompleteSnapshot

func (*Client) GetSnapshotBlockRequest

func (c *Client) GetSnapshotBlockRequest(input *GetSnapshotBlockInput) GetSnapshotBlockRequest

GetSnapshotBlockRequest returns a request value for making API operation for Amazon Elastic Block Store.

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

// Example sending a request using GetSnapshotBlockRequest.
req := client.GetSnapshotBlockRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/GetSnapshotBlock

func (*Client) ListChangedBlocksRequest

func (c *Client) ListChangedBlocksRequest(input *ListChangedBlocksInput) ListChangedBlocksRequest

ListChangedBlocksRequest returns a request value for making API operation for Amazon Elastic Block Store.

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.

// Example sending a request using ListChangedBlocksRequest.
req := client.ListChangedBlocksRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListChangedBlocks

func (*Client) ListSnapshotBlocksRequest

func (c *Client) ListSnapshotBlocksRequest(input *ListSnapshotBlocksInput) ListSnapshotBlocksRequest

ListSnapshotBlocksRequest returns a request value for making API operation for Amazon Elastic Block Store.

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

// Example sending a request using ListSnapshotBlocksRequest.
req := client.ListSnapshotBlocksRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/ListSnapshotBlocks

func (*Client) PutSnapshotBlockRequest

func (c *Client) PutSnapshotBlockRequest(input *PutSnapshotBlockInput) PutSnapshotBlockRequest

PutSnapshotBlockRequest returns a request value for making API operation for Amazon Elastic Block Store.

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.

// Example sending a request using PutSnapshotBlockRequest.
req := client.PutSnapshotBlockRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/PutSnapshotBlock

func (*Client) StartSnapshotRequest

func (c *Client) StartSnapshotRequest(input *StartSnapshotInput) StartSnapshotRequest

StartSnapshotRequest returns a request value for making API operation for Amazon Elastic Block Store.

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.

// Example sending a request using StartSnapshotRequest.
req := client.StartSnapshotRequest(params)
resp, err := req.Send(context.TODO())
if err == nil {
    fmt.Println(resp)
}

Please also see https://docs.aws.amazon.com/goto/WebAPI/ebs-2019-11-02/StartSnapshot

type CompleteSnapshotInput

type CompleteSnapshotInput struct {

	// The number of blocks that were written to the snapshot.
	//
	// ChangedBlocksCount is a required field
	ChangedBlocksCount *int64 `location:"header" locationName:"x-amz-ChangedBlocksCount" type:"integer" required:"true"`

	// 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 `location:"header" locationName:"x-amz-Checksum" type:"string"`

	// The aggregation method used to generate the checksum. Currently, the only
	// supported aggregation method is LINEAR.
	ChecksumAggregationMethod ChecksumAggregationMethod `location:"header" locationName:"x-amz-Checksum-Aggregation-Method" type:"string" enum:"true"`

	// The algorithm used to generate the checksum. Currently, the only supported
	// algorithm is SHA256.
	ChecksumAlgorithm ChecksumAlgorithm `location:"header" locationName:"x-amz-Checksum-Algorithm" type:"string" enum:"true"`

	// The ID of the snapshot.
	//
	// SnapshotId is a required field
	SnapshotId *string `location:"uri" locationName:"snapshotId" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CompleteSnapshotInput) MarshalFields

func (s CompleteSnapshotInput) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (CompleteSnapshotInput) String

func (s CompleteSnapshotInput) String() string

String returns the string representation

func (*CompleteSnapshotInput) Validate

func (s *CompleteSnapshotInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CompleteSnapshotOutput

type CompleteSnapshotOutput struct {

	// The status of the snapshot.
	Status Status `type:"string" enum:"true"`
	// contains filtered or unexported fields
}

func (CompleteSnapshotOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (CompleteSnapshotOutput) String

func (s CompleteSnapshotOutput) String() string

String returns the string representation

type CompleteSnapshotRequest

type CompleteSnapshotRequest struct {
	*aws.Request
	Input *CompleteSnapshotInput
	Copy  func(*CompleteSnapshotInput) CompleteSnapshotRequest
}

CompleteSnapshotRequest is the request type for the CompleteSnapshot API operation.

func (CompleteSnapshotRequest) Send

Send marshals and sends the CompleteSnapshot API request.

type CompleteSnapshotResponse

type CompleteSnapshotResponse struct {
	*CompleteSnapshotOutput
	// contains filtered or unexported fields
}

CompleteSnapshotResponse is the response type for the CompleteSnapshot API operation.

func (*CompleteSnapshotResponse) SDKResponseMetdata

func (r *CompleteSnapshotResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the CompleteSnapshot request.

type GetSnapshotBlockInput

type GetSnapshotBlockInput struct {

	// The block index of the block from which to get data.
	//
	// Obtain the BlockIndex by running the ListChangedBlocks or ListSnapshotBlocks
	// operations.
	//
	// BlockIndex is a required field
	BlockIndex *int64 `location:"uri" locationName:"blockIndex" type:"integer" required:"true"`

	// The block token of the block from which to get data.
	//
	// Obtain the BlockToken by running the ListChangedBlocks or ListSnapshotBlocks
	// operations.
	//
	// BlockToken is a required field
	BlockToken *string `location:"querystring" locationName:"blockToken" type:"string" required:"true"`

	// The ID of the snapshot containing the block from which to get data.
	//
	// SnapshotId is a required field
	SnapshotId *string `location:"uri" locationName:"snapshotId" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (GetSnapshotBlockInput) MarshalFields

func (s GetSnapshotBlockInput) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (GetSnapshotBlockInput) String

func (s GetSnapshotBlockInput) String() string

String returns the string representation

func (*GetSnapshotBlockInput) Validate

func (s *GetSnapshotBlockInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetSnapshotBlockOutput

type GetSnapshotBlockOutput struct {

	// The data content of the block.
	BlockData io.ReadCloser `type:"blob" sensitive:"true"`

	// The checksum generated for the block, which is Base64 encoded.
	Checksum *string `location:"header" locationName:"x-amz-Checksum" type:"string"`

	// The algorithm used to generate the checksum for the block, such as SHA256.
	ChecksumAlgorithm ChecksumAlgorithm `location:"header" locationName:"x-amz-Checksum-Algorithm" type:"string" enum:"true"`

	// The size of the data in the block.
	DataLength *int64 `location:"header" locationName:"x-amz-Data-Length" type:"integer"`
	// contains filtered or unexported fields
}

func (GetSnapshotBlockOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (GetSnapshotBlockOutput) String

func (s GetSnapshotBlockOutput) String() string

String returns the string representation

type GetSnapshotBlockRequest

type GetSnapshotBlockRequest struct {
	*aws.Request
	Input *GetSnapshotBlockInput
	Copy  func(*GetSnapshotBlockInput) GetSnapshotBlockRequest
}

GetSnapshotBlockRequest is the request type for the GetSnapshotBlock API operation.

func (GetSnapshotBlockRequest) Send

Send marshals and sends the GetSnapshotBlock API request.

type GetSnapshotBlockResponse

type GetSnapshotBlockResponse struct {
	*GetSnapshotBlockOutput
	// contains filtered or unexported fields
}

GetSnapshotBlockResponse is the response type for the GetSnapshotBlock API operation.

func (*GetSnapshotBlockResponse) SDKResponseMetdata

func (r *GetSnapshotBlockResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the GetSnapshotBlock request.

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 `location:"querystring" locationName:"firstSnapshotId" min:"1" type:"string"`

	// The number of results to return.
	MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"100" type:"integer"`

	// The token to request the next page of results.
	NextToken *string `location:"querystring" locationName:"pageToken" type:"string"`

	// 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.
	//
	// SecondSnapshotId is a required field
	SecondSnapshotId *string `location:"uri" locationName:"secondSnapshotId" min:"1" type:"string" required:"true"`

	// The block index from which the comparison should start.
	//
	// The list in the response will start from this block index or the next valid
	// block index in the snapshots.
	StartingBlockIndex *int64 `location:"querystring" locationName:"startingBlockIndex" type:"integer"`
	// contains filtered or unexported fields
}

func (ListChangedBlocksInput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (ListChangedBlocksInput) String

func (s ListChangedBlocksInput) String() string

String returns the string representation

func (*ListChangedBlocksInput) Validate

func (s *ListChangedBlocksInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListChangedBlocksOutput

type ListChangedBlocksOutput struct {

	// The size of the block.
	BlockSize *int64 `type:"integer"`

	// An array of objects containing information about the changed blocks.
	ChangedBlocks []ChangedBlock `type:"list"`

	// The time when the BlockToken expires.
	ExpiryTime *time.Time `type:"timestamp"`

	// 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 `type:"string"`

	// The size of the volume in GB.
	VolumeSize *int64 `min:"1" type:"long"`
	// contains filtered or unexported fields
}

func (ListChangedBlocksOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (ListChangedBlocksOutput) String

func (s ListChangedBlocksOutput) String() string

String returns the string representation

type ListChangedBlocksPaginator

type ListChangedBlocksPaginator struct {
	aws.Pager
}

ListChangedBlocksPaginator is used to paginate the request. This can be done by calling Next and CurrentPage.

func NewListChangedBlocksPaginator

func NewListChangedBlocksPaginator(req ListChangedBlocksRequest) ListChangedBlocksPaginator

NewListChangedBlocksRequestPaginator returns a paginator for ListChangedBlocks. Use Next method to get the next page, and CurrentPage to get the current response page from the paginator. Next will return false, if there are no more pages, or an error was encountered.

Note: This operation can generate multiple requests to a service.

// Example iterating over pages.
req := client.ListChangedBlocksRequest(input)
p := ebs.NewListChangedBlocksRequestPaginator(req)

for p.Next(context.TODO()) {
    page := p.CurrentPage()
}

if err := p.Err(); err != nil {
    return err
}

func (*ListChangedBlocksPaginator) CurrentPage

type ListChangedBlocksRequest

type ListChangedBlocksRequest struct {
	*aws.Request
	Input *ListChangedBlocksInput
	Copy  func(*ListChangedBlocksInput) ListChangedBlocksRequest
}

ListChangedBlocksRequest is the request type for the ListChangedBlocks API operation.

func (ListChangedBlocksRequest) Send

Send marshals and sends the ListChangedBlocks API request.

type ListChangedBlocksResponse

type ListChangedBlocksResponse struct {
	*ListChangedBlocksOutput
	// contains filtered or unexported fields
}

ListChangedBlocksResponse is the response type for the ListChangedBlocks API operation.

func (*ListChangedBlocksResponse) SDKResponseMetdata

func (r *ListChangedBlocksResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the ListChangedBlocks request.

type ListSnapshotBlocksInput

type ListSnapshotBlocksInput struct {

	// The number of results to return.
	MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"100" type:"integer"`

	// The token to request the next page of results.
	NextToken *string `location:"querystring" locationName:"pageToken" type:"string"`

	// The ID of the snapshot from which to get block indexes and block tokens.
	//
	// SnapshotId is a required field
	SnapshotId *string `location:"uri" locationName:"snapshotId" min:"1" type:"string" required:"true"`

	// 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 *int64 `location:"querystring" locationName:"startingBlockIndex" type:"integer"`
	// contains filtered or unexported fields
}

func (ListSnapshotBlocksInput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (ListSnapshotBlocksInput) String

func (s ListSnapshotBlocksInput) String() string

String returns the string representation

func (*ListSnapshotBlocksInput) Validate

func (s *ListSnapshotBlocksInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListSnapshotBlocksOutput

type ListSnapshotBlocksOutput struct {

	// The size of the block.
	BlockSize *int64 `type:"integer"`

	// An array of objects containing information about the blocks.
	Blocks []Block `type:"list" sensitive:"true"`

	// The time when the BlockToken expires.
	ExpiryTime *time.Time `type:"timestamp"`

	// 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 `type:"string"`

	// The size of the volume in GB.
	VolumeSize *int64 `min:"1" type:"long"`
	// contains filtered or unexported fields
}

func (ListSnapshotBlocksOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (ListSnapshotBlocksOutput) String

func (s ListSnapshotBlocksOutput) String() string

String returns the string representation

type ListSnapshotBlocksPaginator

type ListSnapshotBlocksPaginator struct {
	aws.Pager
}

ListSnapshotBlocksPaginator is used to paginate the request. This can be done by calling Next and CurrentPage.

func NewListSnapshotBlocksPaginator

func NewListSnapshotBlocksPaginator(req ListSnapshotBlocksRequest) ListSnapshotBlocksPaginator

NewListSnapshotBlocksRequestPaginator returns a paginator for ListSnapshotBlocks. Use Next method to get the next page, and CurrentPage to get the current response page from the paginator. Next will return false, if there are no more pages, or an error was encountered.

Note: This operation can generate multiple requests to a service.

// Example iterating over pages.
req := client.ListSnapshotBlocksRequest(input)
p := ebs.NewListSnapshotBlocksRequestPaginator(req)

for p.Next(context.TODO()) {
    page := p.CurrentPage()
}

if err := p.Err(); err != nil {
    return err
}

func (*ListSnapshotBlocksPaginator) CurrentPage

type ListSnapshotBlocksRequest

type ListSnapshotBlocksRequest struct {
	*aws.Request
	Input *ListSnapshotBlocksInput
	Copy  func(*ListSnapshotBlocksInput) ListSnapshotBlocksRequest
}

ListSnapshotBlocksRequest is the request type for the ListSnapshotBlocks API operation.

func (ListSnapshotBlocksRequest) Send

Send marshals and sends the ListSnapshotBlocks API request.

type ListSnapshotBlocksResponse

type ListSnapshotBlocksResponse struct {
	*ListSnapshotBlocksOutput
	// contains filtered or unexported fields
}

ListSnapshotBlocksResponse is the response type for the ListSnapshotBlocks API operation.

func (*ListSnapshotBlocksResponse) SDKResponseMetdata

func (r *ListSnapshotBlocksResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the ListSnapshotBlocks request.

type PutSnapshotBlockInput

type PutSnapshotBlockInput struct {

	// 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.
	//
	// To use an non-seekable io.Reader for this request wrap the io.Reader with
	// "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable
	// readers. This will allow the SDK to send the reader's payload as chunked
	// transfer encoding.
	//
	// BlockData is a required field
	BlockData io.ReadSeeker `type:"blob" required:"true" sensitive:"true"`

	// 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).
	//
	// BlockIndex is a required field
	BlockIndex *int64 `location:"uri" locationName:"blockIndex" type:"integer" required:"true"`

	// A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
	//
	// Checksum is a required field
	Checksum *string `location:"header" locationName:"x-amz-Checksum" type:"string" required:"true"`

	// The algorithm used to generate the checksum. Currently, the only supported
	// algorithm is SHA256.
	//
	// ChecksumAlgorithm is a required field
	ChecksumAlgorithm ChecksumAlgorithm `location:"header" locationName:"x-amz-Checksum-Algorithm" type:"string" required:"true" enum:"true"`

	// The size of the data to write to the block, in bytes. Currently, the only
	// supported size is 524288.
	//
	// Valid values: 524288
	//
	// DataLength is a required field
	DataLength *int64 `location:"header" locationName:"x-amz-Data-Length" type:"integer" required:"true"`

	// The progress of the write process, as a percentage.
	Progress *int64 `location:"header" locationName:"x-amz-Progress" type:"integer"`

	// The ID of the snapshot.
	//
	// SnapshotId is a required field
	SnapshotId *string `location:"uri" locationName:"snapshotId" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (PutSnapshotBlockInput) MarshalFields

func (s PutSnapshotBlockInput) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (PutSnapshotBlockInput) String

func (s PutSnapshotBlockInput) String() string

String returns the string representation

func (*PutSnapshotBlockInput) Validate

func (s *PutSnapshotBlockInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type PutSnapshotBlockOutput

type PutSnapshotBlockOutput struct {

	// The SHA256 checksum generated for the block data by Amazon EBS.
	Checksum *string `location:"header" locationName:"x-amz-Checksum" type:"string"`

	// The algorithm used by Amazon EBS to generate the checksum.
	ChecksumAlgorithm ChecksumAlgorithm `location:"header" locationName:"x-amz-Checksum-Algorithm" type:"string" enum:"true"`
	// contains filtered or unexported fields
}

func (PutSnapshotBlockOutput) MarshalFields

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (PutSnapshotBlockOutput) String

func (s PutSnapshotBlockOutput) String() string

String returns the string representation

type PutSnapshotBlockRequest

type PutSnapshotBlockRequest struct {
	*aws.Request
	Input *PutSnapshotBlockInput
	Copy  func(*PutSnapshotBlockInput) PutSnapshotBlockRequest
}

PutSnapshotBlockRequest is the request type for the PutSnapshotBlock API operation.

func (PutSnapshotBlockRequest) Send

Send marshals and sends the PutSnapshotBlock API request.

type PutSnapshotBlockResponse

type PutSnapshotBlockResponse struct {
	*PutSnapshotBlockOutput
	// contains filtered or unexported fields
}

PutSnapshotBlockResponse is the response type for the PutSnapshotBlock API operation.

func (*PutSnapshotBlockResponse) SDKResponseMetdata

func (r *PutSnapshotBlockResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the PutSnapshotBlock request.

type RequestThrottledExceptionReason

type RequestThrottledExceptionReason string
const (
	RequestThrottledExceptionReasonAccountThrottled           RequestThrottledExceptionReason = "ACCOUNT_THROTTLED"
	RequestThrottledExceptionReasonDependencyRequestThrottled RequestThrottledExceptionReason = "DEPENDENCY_REQUEST_THROTTLED"
)

Enum values for RequestThrottledExceptionReason

func (RequestThrottledExceptionReason) MarshalValue

func (enum RequestThrottledExceptionReason) MarshalValue() (string, error)

func (RequestThrottledExceptionReason) MarshalValueBuf

func (enum RequestThrottledExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)

type ResourceNotFoundExceptionReason

type ResourceNotFoundExceptionReason string
const (
	ResourceNotFoundExceptionReasonSnapshotNotFound           ResourceNotFoundExceptionReason = "SNAPSHOT_NOT_FOUND"
	ResourceNotFoundExceptionReasonDependencyResourceNotFound ResourceNotFoundExceptionReason = "DEPENDENCY_RESOURCE_NOT_FOUND"
)

Enum values for ResourceNotFoundExceptionReason

func (ResourceNotFoundExceptionReason) MarshalValue

func (enum ResourceNotFoundExceptionReason) MarshalValue() (string, error)

func (ResourceNotFoundExceptionReason) MarshalValueBuf

func (enum ResourceNotFoundExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)

type ServiceQuotaExceededExceptionReason

type ServiceQuotaExceededExceptionReason string
const (
	ServiceQuotaExceededExceptionReasonDependencyServiceQuotaExceeded ServiceQuotaExceededExceptionReason = "DEPENDENCY_SERVICE_QUOTA_EXCEEDED"
)

Enum values for ServiceQuotaExceededExceptionReason

func (ServiceQuotaExceededExceptionReason) MarshalValue

func (enum ServiceQuotaExceededExceptionReason) MarshalValue() (string, error)

func (ServiceQuotaExceededExceptionReason) MarshalValueBuf

func (enum ServiceQuotaExceededExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)

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 `type:"string" idempotencyToken:"true"`

	// A description for the snapshot.
	Description *string `type:"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.
	//
	// For more information, see Using encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-encryption)
	// in the Amazon Elastic Compute Cloud User Guide.
	Encrypted *bool `type:"boolean"`

	// 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 `min:"1" type:"string" sensitive:"true"`

	// 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 `min:"1" type:"string"`

	// The tags to apply to the snapshot.
	Tags []Tag `type:"list"`

	// 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 *int64 `min:"10" type:"integer"`

	// The size of the volume, in GiB. The maximum size is 16384 GiB (16 TiB).
	//
	// VolumeSize is a required field
	VolumeSize *int64 `min:"1" type:"long" required:"true"`
	// contains filtered or unexported fields
}

func (StartSnapshotInput) MarshalFields

func (s StartSnapshotInput) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (StartSnapshotInput) String

func (s StartSnapshotInput) String() string

String returns the string representation

func (*StartSnapshotInput) Validate

func (s *StartSnapshotInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type StartSnapshotOutput

type StartSnapshotOutput struct {

	// The size of the blocks in the snapshot, in bytes.
	BlockSize *int64 `type:"integer"`

	// The description of the snapshot.
	Description *string `type:"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 `min:"1" type:"string" sensitive:"true"`

	// The AWS account ID of the snapshot owner.
	OwnerId *string `min:"1" type:"string"`

	// The ID of the parent snapshot.
	ParentSnapshotId *string `min:"1" type:"string"`

	// The ID of the snapshot.
	SnapshotId *string `min:"1" type:"string"`

	// The timestamp when the snapshot was created.
	StartTime *time.Time `type:"timestamp"`

	// The status of the snapshot.
	Status Status `type:"string" enum:"true"`

	// 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 []Tag `type:"list"`

	// The size of the volume, in GiB.
	VolumeSize *int64 `min:"1" type:"long"`
	// contains filtered or unexported fields
}

func (StartSnapshotOutput) MarshalFields

func (s StartSnapshotOutput) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (StartSnapshotOutput) String

func (s StartSnapshotOutput) String() string

String returns the string representation

type StartSnapshotRequest

type StartSnapshotRequest struct {
	*aws.Request
	Input *StartSnapshotInput
	Copy  func(*StartSnapshotInput) StartSnapshotRequest
}

StartSnapshotRequest is the request type for the StartSnapshot API operation.

func (StartSnapshotRequest) Send

Send marshals and sends the StartSnapshot API request.

type StartSnapshotResponse

type StartSnapshotResponse struct {
	*StartSnapshotOutput
	// contains filtered or unexported fields
}

StartSnapshotResponse is the response type for the StartSnapshot API operation.

func (*StartSnapshotResponse) SDKResponseMetdata

func (r *StartSnapshotResponse) SDKResponseMetdata() *aws.Response

SDKResponseMetdata returns the response metadata for the StartSnapshot request.

type Status

type Status string
const (
	StatusCompleted Status = "completed"
	StatusPending   Status = "pending"
	StatusError     Status = "error"
)

Enum values for Status

func (Status) MarshalValue

func (enum Status) MarshalValue() (string, error)

func (Status) MarshalValueBuf

func (enum Status) MarshalValueBuf(b []byte) ([]byte, error)

type Tag

type Tag struct {

	// The key of the tag.
	Key *string `type:"string"`

	// The value of the tag.
	Value *string `type:"string"`
	// contains filtered or unexported fields
}

Describes a tag.

func (Tag) MarshalFields

func (s Tag) MarshalFields(e protocol.FieldEncoder) error

MarshalFields encodes the AWS API shape using the passed in protocol encoder.

func (Tag) String

func (s Tag) String() string

String returns the string representation

type ValidationExceptionReason

type ValidationExceptionReason string
const (
	ValidationExceptionReasonInvalidCustomerKey       ValidationExceptionReason = "INVALID_CUSTOMER_KEY"
	ValidationExceptionReasonInvalidPageToken         ValidationExceptionReason = "INVALID_PAGE_TOKEN"
	ValidationExceptionReasonInvalidBlockToken        ValidationExceptionReason = "INVALID_BLOCK_TOKEN"
	ValidationExceptionReasonInvalidSnapshotId        ValidationExceptionReason = "INVALID_SNAPSHOT_ID"
	ValidationExceptionReasonUnrelatedSnapshots       ValidationExceptionReason = "UNRELATED_SNAPSHOTS"
	ValidationExceptionReasonInvalidBlock             ValidationExceptionReason = "INVALID_BLOCK"
	ValidationExceptionReasonInvalidContentEncoding   ValidationExceptionReason = "INVALID_CONTENT_ENCODING"
	ValidationExceptionReasonInvalidTag               ValidationExceptionReason = "INVALID_TAG"
	ValidationExceptionReasonInvalidDependencyRequest ValidationExceptionReason = "INVALID_DEPENDENCY_REQUEST"
	ValidationExceptionReasonInvalidParameterValue    ValidationExceptionReason = "INVALID_PARAMETER_VALUE"
	ValidationExceptionReasonInvalidVolumeSize        ValidationExceptionReason = "INVALID_VOLUME_SIZE"
)

Enum values for ValidationExceptionReason

func (ValidationExceptionReason) MarshalValue

func (enum ValidationExceptionReason) MarshalValue() (string, error)

func (ValidationExceptionReason) MarshalValueBuf

func (enum ValidationExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)

Source Files

api_client.go api_doc.go api_enums.go api_errors.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 api_types.go

Directories

PathSynopsis
service/ebs/ebsifacePackage ebsiface provides an interface to enable mocking the Amazon Elastic Block Store service client for testing your code.
Version
v0.24.0
Published
Jul 22, 2020
Platform
windows/amd64
Imports
9 packages
Last checked
2 minutes ago

Tools for package owners.