get_file
async
¶
get_file(
repository_name: RepositoryName,
file_path: Path,
*,
config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
commit_specifier: Optional[CommitName] = None,
) -> GetFileOutput
Returns the base-64 encoded contents of a specified file and its metadata.
Parameters:
-
repository_name(RepositoryName) –The name of the repository that contains the file.
-
commit_specifier(Optional[CommitName], default:None) –The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the head commit is used.
-
file_path(Path) –The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.
Raises:
-
CommitDoesNotExistException–The specified commit does not exist or no commit was specified, and the specified repository has no default branch.
-
EncryptionIntegrityChecksFailedException–An encryption integrity check failed.
-
EncryptionKeyAccessDeniedException–An encryption key could not be accessed.
-
EncryptionKeyDisabledException–The encryption key is disabled.
-
EncryptionKeyNotFoundException–No encryption key was found.
-
EncryptionKeyUnavailableException–The encryption key is not available.
-
FileDoesNotExistException–The specified file does not exist. Verify that you have used the correct file name, full path, and extension.
-
FileTooLargeException–The specified file exceeds the file size limit for CodeCommit. For more information about limits in CodeCommit, see Quotas in the CodeCommit User Guide.
-
InvalidCommitException–The specified commit is not valid.
-
InvalidPathException–The specified path is not valid.
-
InvalidRepositoryNameException–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.
-
PathRequiredException–The folderPath for a location cannot be null.
-
RepositoryDoesNotExistException–The specified repository does not exist.
-
RepositoryNameRequiredException–A repository name is required, but was not specified.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_codecommit/_services/async_code_commit.py
2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 | |