Ada lebih banyak AWS SDK contoh yang tersedia di GitHub repo SDKContoh AWS Dokumen
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan BatchGetRepositories
dengan AWS SDK atau CLI
Contoh kode berikut menunjukkan cara menggunakanBatchGetRepositories
.
- CLI
-
- AWS CLI
-
Untuk melihat detail tentang beberapa repositori
Contoh ini menunjukkan rincian tentang beberapa AWS CodeCommit repositori.
aws codecommit batch-get-repositories \ --repository-names
MyDemoRepo
MyOtherDemoRepo
Output:
{ "repositoriesNotFound": [], "repositories": [ { "creationDate": 1429203623.625, "defaultBranch": "main", "repositoryName": "MyDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo", "lastModifiedDate": 1430783812.0869999, "repositoryDescription": "My demonstration repository", "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo", "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyDemoRepo" "accountId": "111111111111" }, { "creationDate": 1429203623.627, "defaultBranch": "main", "repositoryName": "MyOtherDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo", "lastModifiedDate": 1430783812.0889999, "repositoryDescription": "My other demonstration repository", "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo", "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE", "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyOtherDemoRepo" "accountId": "111111111111" } ], "repositoriesNotFound": [] }
-
Untuk API detailnya, lihat BatchGetRepositories
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell
-
Contoh 1: Contoh ini mengonfirmasi repositori mana yang ditemukan dan tidak ditemukan.
Get-CCRepositoryBatch -RepositoryName MyDemoRepo, MyNewRepo, AMissingRepo
Output:
Repositories RepositoriesNotFound ------------ -------------------- {MyDemoRepo, MyNewRepo} {AMissingRepo}
-
Untuk API detailnya, lihat BatchGetRepositoriesdi AWS Tools for PowerShell Referensi Cmdlet.
-
Tindakan
CreateBranch