ebs.d.ts
  1  import {Request} from '../lib/request';
  2  import {Response} from '../lib/response';
  3  import {AWSError} from '../lib/error';
  4  import {Service} from '../lib/service';
  5  import {ServiceConfigurationOptions} from '../lib/service';
  6  import {ConfigBase as Config} from '../lib/config-base';
  7  import {Readable} from 'stream';
  8  interface Blob {}
  9  declare class EBS extends Service {
 10    /**
 11     * Constructs a service object. This object has one method for each API operation.
 12     */
 13    constructor(options?: EBS.Types.ClientConfiguration)
 14    config: Config & EBS.Types.ClientConfiguration;
 15    /**
 16     * 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.
 17     */
 18    completeSnapshot(params: EBS.Types.CompleteSnapshotRequest, callback?: (err: AWSError, data: EBS.Types.CompleteSnapshotResponse) => void): Request<EBS.Types.CompleteSnapshotResponse, AWSError>;
 19    /**
 20     * 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.
 21     */
 22    completeSnapshot(callback?: (err: AWSError, data: EBS.Types.CompleteSnapshotResponse) => void): Request<EBS.Types.CompleteSnapshotResponse, AWSError>;
 23    /**
 24     * Returns the data in a block in an Amazon Elastic Block Store snapshot.
 25     */
 26    getSnapshotBlock(params: EBS.Types.GetSnapshotBlockRequest, callback?: (err: AWSError, data: EBS.Types.GetSnapshotBlockResponse) => void): Request<EBS.Types.GetSnapshotBlockResponse, AWSError>;
 27    /**
 28     * Returns the data in a block in an Amazon Elastic Block Store snapshot.
 29     */
 30    getSnapshotBlock(callback?: (err: AWSError, data: EBS.Types.GetSnapshotBlockResponse) => void): Request<EBS.Types.GetSnapshotBlockResponse, AWSError>;
 31    /**
 32     * Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.
 33     */
 34    listChangedBlocks(params: EBS.Types.ListChangedBlocksRequest, callback?: (err: AWSError, data: EBS.Types.ListChangedBlocksResponse) => void): Request<EBS.Types.ListChangedBlocksResponse, AWSError>;
 35    /**
 36     * Returns information about the blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.
 37     */
 38    listChangedBlocks(callback?: (err: AWSError, data: EBS.Types.ListChangedBlocksResponse) => void): Request<EBS.Types.ListChangedBlocksResponse, AWSError>;
 39    /**
 40     * Returns information about the blocks in an Amazon Elastic Block Store snapshot.
 41     */
 42    listSnapshotBlocks(params: EBS.Types.ListSnapshotBlocksRequest, callback?: (err: AWSError, data: EBS.Types.ListSnapshotBlocksResponse) => void): Request<EBS.Types.ListSnapshotBlocksResponse, AWSError>;
 43    /**
 44     * Returns information about the blocks in an Amazon Elastic Block Store snapshot.
 45     */
 46    listSnapshotBlocks(callback?: (err: AWSError, data: EBS.Types.ListSnapshotBlocksResponse) => void): Request<EBS.Types.ListSnapshotBlocksResponse, AWSError>;
 47    /**
 48     * Writes a block of data to a 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-KiB sectors.
 49     */
 50    putSnapshotBlock(params: EBS.Types.PutSnapshotBlockRequest, callback?: (err: AWSError, data: EBS.Types.PutSnapshotBlockResponse) => void): Request<EBS.Types.PutSnapshotBlockResponse, AWSError>;
 51    /**
 52     * Writes a block of data to a 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-KiB sectors.
 53     */
 54    putSnapshotBlock(callback?: (err: AWSError, data: EBS.Types.PutSnapshotBlockResponse) => void): Request<EBS.Types.PutSnapshotBlockResponse, AWSError>;
 55    /**
 56     * Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.  After creating the snapshot, use  PutSnapshotBlock to write blocks of data to the snapshot.
 57     */
 58    startSnapshot(params: EBS.Types.StartSnapshotRequest, callback?: (err: AWSError, data: EBS.Types.StartSnapshotResponse) => void): Request<EBS.Types.StartSnapshotResponse, AWSError>;
 59    /**
 60     * Creates a new Amazon EBS snapshot. The new snapshot enters the pending state after the request completes.  After creating the snapshot, use  PutSnapshotBlock to write blocks of data to the snapshot.
 61     */
 62    startSnapshot(callback?: (err: AWSError, data: EBS.Types.StartSnapshotResponse) => void): Request<EBS.Types.StartSnapshotResponse, AWSError>;
 63  }
 64  declare namespace EBS {
 65    export interface Block {
 66      /**
 67       * The block index.
 68       */
 69      BlockIndex?: BlockIndex;
 70      /**
 71       * The block token for the block index.
 72       */
 73      BlockToken?: BlockToken;
 74    }
 75    export type BlockData = Buffer|Uint8Array|Blob|string|Readable;
 76    export type BlockIndex = number;
 77    export type BlockSize = number;
 78    export type BlockToken = string;
 79    export type Blocks = Block[];
 80    export type Boolean = boolean;
 81    export interface ChangedBlock {
 82      /**
 83       * The block index.
 84       */
 85      BlockIndex?: BlockIndex;
 86      /**
 87       * 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.
 88       */
 89      FirstBlockToken?: BlockToken;
 90      /**
 91       * The block token for the block index of the SecondSnapshotId specified in the ListChangedBlocks operation.
 92       */
 93      SecondBlockToken?: BlockToken;
 94    }
 95    export type ChangedBlocks = ChangedBlock[];
 96    export type ChangedBlocksCount = number;
 97    export type Checksum = string;
 98    export type ChecksumAggregationMethod = "LINEAR"|string;
 99    export type ChecksumAlgorithm = "SHA256"|string;
100    export interface CompleteSnapshotRequest {
101      /**
102       * The ID of the snapshot.
103       */
104      SnapshotId: SnapshotId;
105      /**
106       * The number of blocks that were written to the snapshot.
107       */
108      ChangedBlocksCount: ChangedBlocksCount;
109      /**
110       * 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.
111       */
112      Checksum?: Checksum;
113      /**
114       * The algorithm used to generate the checksum. Currently, the only supported algorithm is SHA256.
115       */
116      ChecksumAlgorithm?: ChecksumAlgorithm;
117      /**
118       * The aggregation method used to generate the checksum. Currently, the only supported aggregation method is LINEAR.
119       */
120      ChecksumAggregationMethod?: ChecksumAggregationMethod;
121    }
122    export interface CompleteSnapshotResponse {
123      /**
124       * The status of the snapshot.
125       */
126      Status?: Status;
127    }
128    export type DataLength = number;
129    export type Description = string;
130    export interface GetSnapshotBlockRequest {
131      /**
132       * The ID of the snapshot containing the block from which to get data.
133       */
134      SnapshotId: SnapshotId;
135      /**
136       * The block index of the block from which to get data. Obtain the BlockIndex by running the ListChangedBlocks or ListSnapshotBlocks operations.
137       */
138      BlockIndex: BlockIndex;
139      /**
140       * The block token of the block from which to get data. Obtain the BlockToken by running the ListChangedBlocks or ListSnapshotBlocks operations.
141       */
142      BlockToken: BlockToken;
143    }
144    export interface GetSnapshotBlockResponse {
145      /**
146       * The size of the data in the block.
147       */
148      DataLength?: DataLength;
149      /**
150       * The data content of the block.
151       */
152      BlockData?: BlockData;
153      /**
154       * The checksum generated for the block, which is Base64 encoded.
155       */
156      Checksum?: Checksum;
157      /**
158       * The algorithm used to generate the checksum for the block, such as SHA256.
159       */
160      ChecksumAlgorithm?: ChecksumAlgorithm;
161    }
162    export type IdempotencyToken = string;
163    export type KmsKeyArn = string;
164    export interface ListChangedBlocksRequest {
165      /**
166       * 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. 
167       */
168      FirstSnapshotId?: SnapshotId;
169      /**
170       * 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. 
171       */
172      SecondSnapshotId: SnapshotId;
173      /**
174       * The token to request the next page of results.
175       */
176      NextToken?: PageToken;
177      /**
178       * The number of results to return.
179       */
180      MaxResults?: MaxResults;
181      /**
182       * 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.
183       */
184      StartingBlockIndex?: BlockIndex;
185    }
186    export interface ListChangedBlocksResponse {
187      /**
188       * An array of objects containing information about the changed blocks.
189       */
190      ChangedBlocks?: ChangedBlocks;
191      /**
192       * The time when the BlockToken expires.
193       */
194      ExpiryTime?: TimeStamp;
195      /**
196       * The size of the volume in GB.
197       */
198      VolumeSize?: VolumeSize;
199      /**
200       * The size of the blocks in the snapshot, in bytes.
201       */
202      BlockSize?: BlockSize;
203      /**
204       * The token to use to retrieve the next page of results. This value is null when there are no more results to return.
205       */
206      NextToken?: PageToken;
207    }
208    export interface ListSnapshotBlocksRequest {
209      /**
210       * The ID of the snapshot from which to get block indexes and block tokens.
211       */
212      SnapshotId: SnapshotId;
213      /**
214       * The token to request the next page of results.
215       */
216      NextToken?: PageToken;
217      /**
218       * The number of results to return.
219       */
220      MaxResults?: MaxResults;
221      /**
222       * 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.
223       */
224      StartingBlockIndex?: BlockIndex;
225    }
226    export interface ListSnapshotBlocksResponse {
227      /**
228       * An array of objects containing information about the blocks.
229       */
230      Blocks?: Blocks;
231      /**
232       * The time when the BlockToken expires.
233       */
234      ExpiryTime?: TimeStamp;
235      /**
236       * The size of the volume in GB.
237       */
238      VolumeSize?: VolumeSize;
239      /**
240       * The size of the blocks in the snapshot, in bytes.
241       */
242      BlockSize?: BlockSize;
243      /**
244       * The token to use to retrieve the next page of results. This value is null when there are no more results to return.
245       */
246      NextToken?: PageToken;
247    }
248    export type MaxResults = number;
249    export type OwnerId = string;
250    export type PageToken = string;
251    export type Progress = number;
252    export interface PutSnapshotBlockRequest {
253      /**
254       * The ID of the snapshot.
255       */
256      SnapshotId: SnapshotId;
257      /**
258       * The block index of the block in which to write the data. A block index is a logical index in units of 512 KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/524288). The logical offset of the data must be 512 KiB aligned.
259       */
260      BlockIndex: BlockIndex;
261      /**
262       * 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 in the Amazon Elastic Compute Cloud User Guide.
263       */
264      BlockData: BlockData;
265      /**
266       * The size of the data to write to the block, in bytes. Currently, the only supported size is 524288 bytes. Valid values: 524288 
267       */
268      DataLength: DataLength;
269      /**
270       * The progress of the write process, as a percentage.
271       */
272      Progress?: Progress;
273      /**
274       * A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.
275       */
276      Checksum: Checksum;
277      /**
278       * The algorithm used to generate the checksum. Currently, the only supported algorithm is SHA256.
279       */
280      ChecksumAlgorithm: ChecksumAlgorithm;
281    }
282    export interface PutSnapshotBlockResponse {
283      /**
284       * The SHA256 checksum generated for the block data by Amazon EBS.
285       */
286      Checksum?: Checksum;
287      /**
288       * The algorithm used by Amazon EBS to generate the checksum.
289       */
290      ChecksumAlgorithm?: ChecksumAlgorithm;
291    }
292    export type SnapshotId = string;
293    export interface StartSnapshotRequest {
294      /**
295       * The size of the volume, in GiB. The maximum size is 16384 GiB (16 TiB).
296       */
297      VolumeSize: VolumeSize;
298      /**
299       * 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.
300       */
301      ParentSnapshotId?: SnapshotId;
302      /**
303       * The tags to apply to the snapshot.
304       */
305      Tags?: Tags;
306      /**
307       * A description for the snapshot.
308       */
309      Description?: Description;
310      /**
311       * 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 Amazon Web Services SDK. For more information, see  Idempotency for StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.
312       */
313      ClientToken?: IdempotencyToken;
314      /**
315       * 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 KMS key specified using the KmsKeyArn parameter. If no value is specified for KmsKeyArn, the default KMS key for your account is used. If no default KMS key has been specified for your account, the Amazon Web Services managed KMS key is used. To set a default KMS key for your account, use  ModifyEbsDefaultKmsKeyId. 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 in the Amazon Elastic Compute Cloud User Guide.
316       */
317      Encrypted?: Boolean;
318      /**
319       * The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to be used to encrypt the snapshot. If you do not specify a KMS key, the default Amazon Web Services managed KMS key is used. If you specify a ParentSnapshotId, omit this parameter; the snapshot will be encrypted using the same KMS key that was used to encrypt the parent snapshot. If Encrypted is set to true, you must specify a KMS key ARN. 
320       */
321      KmsKeyArn?: KmsKeyArn;
322      /**
323       * 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.
324       */
325      Timeout?: Timeout;
326    }
327    export interface StartSnapshotResponse {
328      /**
329       * The description of the snapshot.
330       */
331      Description?: Description;
332      /**
333       * The ID of the snapshot.
334       */
335      SnapshotId?: SnapshotId;
336      /**
337       * The Amazon Web Services account ID of the snapshot owner.
338       */
339      OwnerId?: OwnerId;
340      /**
341       * The status of the snapshot.
342       */
343      Status?: Status;
344      /**
345       * The timestamp when the snapshot was created.
346       */
347      StartTime?: TimeStamp;
348      /**
349       * The size of the volume, in GiB.
350       */
351      VolumeSize?: VolumeSize;
352      /**
353       * The size of the blocks in the snapshot, in bytes.
354       */
355      BlockSize?: BlockSize;
356      /**
357       * The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see  Tagging your Amazon EC2 resources in the Amazon Elastic Compute Cloud User Guide.
358       */
359      Tags?: Tags;
360      /**
361       * The ID of the parent snapshot.
362       */
363      ParentSnapshotId?: SnapshotId;
364      /**
365       * The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.
366       */
367      KmsKeyArn?: KmsKeyArn;
368    }
369    export type Status = "completed"|"pending"|"error"|string;
370    export interface Tag {
371      /**
372       * The key of the tag.
373       */
374      Key?: TagKey;
375      /**
376       * The value of the tag.
377       */
378      Value?: TagValue;
379    }
380    export type TagKey = string;
381    export type TagValue = string;
382    export type Tags = Tag[];
383    export type TimeStamp = Date;
384    export type Timeout = number;
385    export type VolumeSize = number;
386    /**
387     * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
388     */
389    export type apiVersion = "2019-11-02"|"latest"|string;
390    export interface ClientApiVersions {
391      /**
392       * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
393       */
394      apiVersion?: apiVersion;
395    }
396    export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
397    /**
398     * Contains interfaces for use with the EBS client.
399     */
400    export import Types = EBS;
401  }
402  export = EBS;