Documentation ¶
Overview ¶
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
- type Block
- type ChangedBlock
- type ChecksumAlgorithm
- type Client
- type GetSnapshotBlockInput
- type GetSnapshotBlockOutput
- type GetSnapshotBlockRequest
- type GetSnapshotBlockResponse
- type ListChangedBlocksInput
- type ListChangedBlocksOutput
- type ListChangedBlocksPaginator
- type ListChangedBlocksRequest
- type ListChangedBlocksResponse
- type ListSnapshotBlocksInput
- type ListSnapshotBlocksOutput
- type ListSnapshotBlocksPaginator
- type ListSnapshotBlocksRequest
- type ListSnapshotBlocksResponse
- type ValidationExceptionReason
Constants ¶
const ( ServiceName = "Amazon EBS" // Service's name ServiceID = "EBS" // Service's identifier EndpointsID = "ebs" // Service's Endpoint identifier )
const ( // ErrCodeResourceNotFoundException for service response error code // "ResourceNotFoundException". // // The specified resource does not exist. ErrCodeResourceNotFoundException = "ResourceNotFoundException" // ErrCodeValidationException for service response error code // "ValidationException". // // The input fails to satisfy the constraints of the EBS direct APIs. ErrCodeValidationException = "ValidationException" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
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 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 ¶
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 ¶
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) 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
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 ¶
func (s GetSnapshotBlockOutput) MarshalFields(e protocol.FieldEncoder) error
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 ¶
func (r GetSnapshotBlockRequest) Send(ctx context.Context) (*GetSnapshotBlockResponse, error)
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 ¶
func (s ListChangedBlocksInput) MarshalFields(e protocol.FieldEncoder) error
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 `type:"long"` // contains filtered or unexported fields }
func (ListChangedBlocksOutput) MarshalFields ¶
func (s ListChangedBlocksOutput) MarshalFields(e protocol.FieldEncoder) error
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 ¶
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 ¶
func (p *ListChangedBlocksPaginator) CurrentPage() *ListChangedBlocksOutput
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 ¶
func (r ListChangedBlocksRequest) Send(ctx context.Context) (*ListChangedBlocksResponse, error)
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 ¶
func (s ListSnapshotBlocksInput) MarshalFields(e protocol.FieldEncoder) error
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 `type:"long"` // contains filtered or unexported fields }
func (ListSnapshotBlocksOutput) MarshalFields ¶
func (s ListSnapshotBlocksOutput) MarshalFields(e protocol.FieldEncoder) error
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 ¶
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 ¶
func (p *ListSnapshotBlocksPaginator) CurrentPage() *ListSnapshotBlocksOutput
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 ¶
func (r ListSnapshotBlocksRequest) Send(ctx context.Context) (*ListSnapshotBlocksResponse, error)
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 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" )
Enum values for ValidationExceptionReason
func (ValidationExceptionReason) MarshalValue ¶
func (enum ValidationExceptionReason) MarshalValue() (string, error)
func (ValidationExceptionReason) MarshalValueBuf ¶
func (enum ValidationExceptionReason) MarshalValueBuf(b []byte) ([]byte, error)