- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetBlobCommand
Returns the base-64 encoded content of an individual blob in a repository.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeCommitClient, GetBlobCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, GetBlobCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // GetBlobInput
repositoryName: "STRING_VALUE", // required
blobId: "STRING_VALUE", // required
};
const command = new GetBlobCommand(input);
const response = await client.send(command);
// { // GetBlobOutput
// content: new Uint8Array(), // required
// };
GetBlobCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
blobId Required | string | undefined | The ID of the blob, which is its SHA-1 pointer. |
repositoryName Required | string | undefined | The name of the repository that contains the blob. |
GetBlobCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
content Required | Uint8Array | undefined | The content of the blob, usually a file. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
BlobIdDoesNotExistException | client | The specified blob does not exist. |
BlobIdRequiredException | client | A blob ID is required, but was not specified. |
EncryptionIntegrityChecksFailedException | server | An encryption integrity check failed. |
EncryptionKeyAccessDeniedException | client | An encryption key could not be accessed. |
EncryptionKeyDisabledException | client | The encryption key is disabled. |
EncryptionKeyNotFoundException | client | No encryption key was found. |
EncryptionKeyUnavailableException | client | The encryption key is not available. |
FileTooLargeException | client | The specified file exceeds the file size limit for CodeCommit. For more information about limits in CodeCommit, see Quotas in the CodeCommit User Guide. |
InvalidBlobIdException | client | The specified blob is not valid. |
InvalidRepositoryNameException | client | A specified repository name is not valid. This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist. |
RepositoryDoesNotExistException | client | The specified repository does not exist. |
RepositoryNameRequiredException | client | A repository name is required, but was not specified. |
CodeCommitServiceException | Base exception class for all service exceptions from CodeCommit service. |