View a markdown version of this page

Use BatchGetRepositories with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use BatchGetRepositories with a CLI

The following code examples show how to use BatchGetRepositories.

CLI
AWS CLI

To view details about multiple repositories

The following batch-get-repositories example shows details about multiple AWS CodeCommit repositories.

aws codecommit batch-get-repositories \ --repository-names MyDemoRepo MyOtherDemoRepo

Output:

{ "repositories": [ { "creationDate": 1429203623.625, "defaultBranch": "main", "repositoryName": "MyDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/MyDemoRepo", "lastModifiedDate": 1430783812.0869999, "repositoryDescription": "My demonstration repository", "cloneUrlHttp": "https://codecommit.us-west-2.amazonaws.com/v1/repos/MyDemoRepo", "repositoryId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Arn": "arn:aws:codecommit:us-west-2:123456789012:MyDemoRepo", "accountId": "123456789012" }, { "creationDate": 1429203623.627, "defaultBranch": "main", "repositoryName": "MyOtherDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/MyOtherDemoRepo", "lastModifiedDate": 1430783812.0889999, "repositoryDescription": "My other demonstration repository", "cloneUrlHttp": "https://codecommit.us-west-2.amazonaws.com/v1/repos/MyOtherDemoRepo", "repositoryId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222", "Arn": "arn:aws:codecommit:us-west-2:123456789012:MyOtherDemoRepo", "accountId": "123456789012" } ], "repositoriesNotFound": [] }

For more information, see View CodeCommit repository details in the AWS CodeCommit User Guide.

PowerShell
Tools for PowerShell V4

Example 1: This example confirms which of the specified repositories are found and not found.

Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo

Output:

Repositories RepositoriesNotFound ------------ -------------------- {MyDemoRepo, MyNewRepo} {AMissingRepo}
Tools for PowerShell V5

Example 1: This example confirms which of the specified repositories are found and not found.

Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo

Output:

Repositories RepositoriesNotFound ------------ -------------------- {MyDemoRepo, MyNewRepo} {AMissingRepo}