get_file
¶
get_file(
provider: GitProvider,
owner: GitOwnerName,
repository_path: GitRepositoryPath,
file_path: GitFilePath,
branch: GitBranchName,
*,
config_overrides: Optional[AmplifyGen3ClientConfig] = None,
repository_name: Optional[GitRepositoryName] = None,
) -> GetFileResponse
Gets the contents of a file from a repository branch. Files can be up to 1 MiB. The AWS Management Console uses this operation when you create an app from a repository. To view files in detail, use your Git provider.
Parameters:
-
provider(GitProvider) –The Git provider.
-
owner(GitOwnerName) –The account that the Git connection is for. The value depends on the provider:
-
For GitHub, specify the user or organization name.
-
For GitLab, specify the user name.
To get this value, call ListGitConnections.
-
-
repository_name(Optional[GitRepositoryName], default:None) –The name of the repository, which is the last segment of RepositoryPath.
-
repository_path(GitRepositoryPath) –The full path of the repository in the Git provider, for example my-org/my-app. GitLab paths can include subgroups, for example my-group/subgroup/my-app. To get this value, call ListRepositories.
-
file_path(GitFilePath) –The path of the file, relative to the root of the repository, for example package.json.
-
branch(GitBranchName) –The name of the branch to read from.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
GitConnectionDisconnectedException–The Git connection doesn't exist, or the Git provider no longer accepts its access. For example, the app was uninstalled or access was revoked. Reconnect the Git provider account, and then try again.
-
InternalServerException–An internal error occurred. Retry the request.
-
ThrottlingException–The request was denied because the request rate exceeds the allowed limit.
-
ValidationException–The request contains invalid parameters or is otherwise malformed.
-
UnknownServiceError–The service returned an error code this client does not model.