get_file
¶
get_file(
repository_name: RepositoryName,
file_path: Path,
*,
config_overrides: Optional[CodeCommitClientConfig] = 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/code_commit.py
2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 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 | |