AWS CodeCommit
API Reference
API Version 2015-04-13
AWS CodeCommit: API Reference
Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved.
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon.
Table of Contents
Welcome ... 1
Actions ... 5
AssociateApprovalRuleTemplateWithRepository ... 7
Request Syntax ... 7
Request Parameters ... 7
Response Elements ... 7
Errors ... 7
Examples ... 9
See Also ... 9
BatchAssociateApprovalRuleTemplateWithRepositories ... 10
Request Syntax ... 10
Request Parameters ... 10
Response Syntax ... 10
Response Elements ... 11
Errors ... 11
Examples ... 12
See Also ... 13
BatchDescribeMergeConflicts ... 14
Request Syntax ... 14
Request Parameters ... 14
Response Syntax ... 15
Response Elements ... 17
Errors ... 17
Examples ... 19
See Also ... 21
BatchDisassociateApprovalRuleTemplateFromRepositories ... 22
Request Syntax ... 22
Request Parameters ... 22
Response Syntax ... 22
Response Elements ... 23
Errors ... 23
Examples ... 24
See Also ... 25
BatchGetCommits ... 26
Request Syntax ... 26
Request Parameters ... 26
Response Syntax ... 26
Response Elements ... 27
Errors ... 27
Examples ... 28
See Also ... 29
BatchGetRepositories ... 31
Request Syntax ... 31
Request Parameters ... 31
Response Syntax ... 31
Response Elements ... 32
Errors ... 32
Examples ... 33
See Also ... 34
CreateApprovalRuleTemplate ... 35
Request Syntax ... 35
Request Parameters ... 35
Response Syntax ... 36
Response Elements ... 36
Errors ... 36
Examples ... 37
See Also ... 38
CreateBranch ... 39
Request Syntax ... 39
Request Parameters ... 39
Response Elements ... 39
Errors ... 40
Examples ... 41
See Also ... 42
CreateCommit ... 43
Request Syntax ... 43
Request Parameters ... 43
Response Syntax ... 45
Response Elements ... 45
Errors ... 46
Examples ... 50
See Also ... 51
CreatePullRequest ... 52
Request Syntax ... 52
Request Parameters ... 52
Response Syntax ... 53
Response Elements ... 53
Errors ... 54
Examples ... 56
See Also ... 58
CreatePullRequestApprovalRule ... 59
Request Syntax ... 59
Request Parameters ... 59
Response Syntax ... 60
Response Elements ... 60
Errors ... 60
Examples ... 62
See Also ... 63
CreateRepository ... 64
Request Syntax ... 64
Request Parameters ... 64
Response Syntax ... 65
Response Elements ... 65
Errors ... 65
Examples ... 67
See Also ... 67
CreateUnreferencedMergeCommit ... 69
Request Syntax ... 69
Request Parameters ... 69
Response Syntax ... 71
Response Elements ... 71
Errors ... 72
Examples ... 75
See Also ... 76
DeleteApprovalRuleTemplate ... 77
Request Syntax ... 77
Request Parameters ... 77
Response Syntax ... 77
Response Elements ... 77
Errors ... 77
Examples ... 78
See Also ... 78
DeleteBranch ... 80
Request Syntax ... 80
Request Parameters ... 80
Response Syntax ... 80
Response Elements ... 80
Errors ... 81
Examples ... 82
See Also ... 83
DeleteCommentContent ... 84
Request Syntax ... 84
Request Parameters ... 84
Response Syntax ... 84
Response Elements ... 84
Errors ... 85
Examples ... 85
See Also ... 86
DeleteFile ... 87
Request Syntax ... 87
Request Parameters ... 87
Response Syntax ... 88
Response Elements ... 88
Errors ... 89
Examples ... 91
See Also ... 92
DeletePullRequestApprovalRule ... 93
Request Syntax ... 93
Request Parameters ... 93
Response Syntax ... 93
Response Elements ... 93
Errors ... 94
Examples ... 95
See Also ... 95
DeleteRepository ... 97
Request Syntax ... 97
Request Parameters ... 97
Response Syntax ... 97
Response Elements ... 97
Errors ... 97
Examples ... 98
See Also ... 99
DescribeMergeConflicts ... 100
Request Syntax ... 100
Request Parameters ... 100
Response Syntax ... 101
Response Elements ... 102
Errors ... 103
Examples ... 105
See Also ... 107
DescribePullRequestEvents ... 108
Request Syntax ... 108
Request Parameters ... 108
Response Syntax ... 109
Response Elements ... 110
Errors ... 110
Examples ... 111
See Also ... 112
DisassociateApprovalRuleTemplateFromRepository ... 113
Request Syntax ... 113
Request Parameters ... 113
Response Elements ... 113
Errors ... 113
Examples ... 115
See Also ... 115
EvaluatePullRequestApprovalRules ... 116
Request Syntax ... 116
Request Parameters ... 116
Response Syntax ... 116
Response Elements ... 116
Errors ... 117
Examples ... 118
See Also ... 118
GetApprovalRuleTemplate ... 120
Request Syntax ... 120
Request Parameters ... 120
Response Syntax ... 120
Response Elements ... 120
Errors ... 121
Examples ... 121
See Also ... 122
GetBlob ... 123
Request Syntax ... 123
Request Parameters ... 123
Response Syntax ... 123
Response Elements ... 123
Errors ... 124
See Also ... 125
GetBranch ... 126
Request Syntax ... 126
Request Parameters ... 126
Response Syntax ... 126
Response Elements ... 126
Errors ... 127
Examples ... 128
See Also ... 128
GetComment ... 130
Request Syntax ... 130
Request Parameters ... 130
Response Syntax ... 130
Response Elements ... 130
Errors ... 131
Examples ... 132
See Also ... 132
GetCommentReactions ... 134
Request Syntax ... 134
Request Parameters ... 134
Response Syntax ... 134
Response Elements ... 135
Errors ... 135
Examples ... 136
See Also ... 137
GetCommentsForComparedCommit ... 138
Request Syntax ... 138
Request Parameters ... 138
Response Syntax ... 139
Response Elements ... 139
Errors ... 140
Examples ... 141
See Also ... 142
GetCommentsForPullRequest ... 144
Request Syntax ... 144
Request Parameters ... 144
Response Syntax ... 145
Response Elements ... 145
Errors ... 146
Examples ... 147
See Also ... 149
GetCommit ... 150
Request Syntax ... 150
Request Parameters ... 150
Response Syntax ... 150
Response Elements ... 151
Errors ... 151
Examples ... 152
See Also ... 153
GetDifferences ... 154
Request Syntax ... 154
Request Parameters ... 154
Response Syntax ... 155
Response Elements ... 155
Errors ... 156
Examples ... 157
See Also ... 158
GetFile ... 159
Request Syntax ... 159
Request Parameters ... 159
Response Syntax ... 159
Response Elements ... 160
Errors ... 160
Examples ... 162
See Also ... 163
GetFolder ... 164
Request Syntax ... 164
Request Parameters ... 164
Response Syntax ... 164
Response Elements ... 165
Errors ... 166
Examples ... 167
See Also ... 168
GetMergeCommit ... 170
Request Syntax ... 170
Request Parameters ... 170
Response Syntax ... 171
Response Elements ... 171
Errors ... 171
Examples ... 173
See Also ... 173
GetMergeConflicts ... 175
Request Syntax ... 175
Request Parameters ... 175
Response Syntax ... 176
Response Elements ... 177
Errors ... 178
Examples ... 180
See Also ... 181
GetMergeOptions ... 182
Request Syntax ... 182
Request Parameters ... 182
Response Syntax ... 183
Response Elements ... 183
Errors ... 183
Examples ... 185
See Also ... 186
GetPullRequest ... 187
Request Syntax ... 187
Request Parameters ... 187
Response Syntax ... 187
Response Elements ... 188
Errors ... 188
Examples ... 189
See Also ... 190
GetPullRequestApprovalStates ... 191
Request Syntax ... 191
Request Parameters ... 191
Response Syntax ... 191
Response Elements ... 191
Errors ... 192
Examples ... 193
See Also ... 193
GetPullRequestOverrideState ... 195
Request Syntax ... 195
Request Parameters ... 195
Response Syntax ... 195
Response Elements ... 195
Errors ... 196
Examples ... 197
See Also ... 197
GetRepository ... 199
Request Syntax ... 199
Request Parameters ... 199
Response Syntax ... 199
Response Elements ... 199
Errors ... 200
Examples ... 201
See Also ... 201
GetRepositoryTriggers ... 203
Request Syntax ... 203
Request Parameters ... 203
Response Syntax ... 203
Response Elements ... 203
Errors ... 204
Examples ... 205
See Also ... 205
ListApprovalRuleTemplates ... 207
Request Syntax ... 207
Request Parameters ... 207
Response Syntax ... 207
Response Elements ... 207
Errors ... 208
Examples ... 208
See Also ... 209
ListAssociatedApprovalRuleTemplatesForRepository ... 210
Request Syntax ... 210
Request Parameters ... 210
Response Syntax ... 210
Response Elements ... 210
Errors ... 211
Examples ... 212
See Also ... 213
ListBranches ... 214
Request Syntax ... 214
Request Parameters ... 214
Response Syntax ... 214
Response Elements ... 214
Errors ... 215
Examples ... 216
See Also ... 216
ListPullRequests ... 218
Request Syntax ... 218
Request Parameters ... 218
Response Syntax ... 219
Response Elements ... 219
Errors ... 219
Examples ... 220
See Also ... 221
ListRepositories ... 222
Request Syntax ... 222
Request Parameters ... 222
Response Syntax ... 222
Response Elements ... 223
Errors ... 223
Examples ... 223
See Also ... 224
ListRepositoriesForApprovalRuleTemplate ... 225
Request Syntax ... 225
Request Parameters ... 225
Response Syntax ... 225
Response Elements ... 225
Errors ... 226
Examples ... 227
See Also ... 228
ListTagsForResource ... 229
Request Syntax ... 229
Request Parameters ... 229
Response Syntax ... 229
Response Elements ... 229
Errors ... 230
Examples ... 230
See Also ... 231
MergeBranchesByFastForward ... 232
Request Syntax ... 232
Request Parameters ... 232
Response Syntax ... 233
Response Elements ... 233
Errors ... 233
Examples ... 235
See Also ... 236
MergeBranchesBySquash ... 237
Request Syntax ... 237
Request Parameters ... 237
Response Syntax ... 239
Response Elements ... 239
Errors ... 239
Examples ... 243
See Also ... 244
MergeBranchesByThreeWay ... 245
Request Syntax ... 245
Request Parameters ... 245
Response Syntax ... 247
Response Elements ... 247
Errors ... 247
Examples ... 251
See Also ... 252
MergePullRequestByFastForward ... 253
Request Syntax ... 253
Request Parameters ... 253
Response Syntax ... 253
Response Elements ... 254
Errors ... 254
Examples ... 256
See Also ... 257
MergePullRequestBySquash ... 259
Request Syntax ... 259
Request Parameters ... 259
Response Syntax ... 261
Response Elements ... 262
Errors ... 262
Examples ... 266
See Also ... 267
MergePullRequestByThreeWay ... 268
Request Syntax ... 268
Request Parameters ... 268
Response Syntax ... 270
Response Elements ... 271
Errors ... 271
Examples ... 275
See Also ... 276
OverridePullRequestApprovalRules ... 277
Request Syntax ... 277
Request Parameters ... 277
Response Elements ... 277
Errors ... 277
Examples ... 279
See Also ... 280
PostCommentForComparedCommit ... 281
Request Syntax ... 281
Request Parameters ... 281
Response Syntax ... 282
Response Elements ... 282
Errors ... 283
Examples ... 286
See Also ... 287
PostCommentForPullRequest ... 288
Request Syntax ... 288
Request Parameters ... 288
Response Syntax ... 289
Response Elements ... 290
Errors ... 290
Examples ... 293
See Also ... 294
PostCommentReply ... 296
Request Syntax ... 296
Request Parameters ... 296
Response Syntax ... 296
Response Elements ... 297
Errors ... 297
Examples ... 298
See Also ... 299
PutCommentReaction ... 300
Request Syntax ... 300
Request Parameters ... 300
Response Elements ... 300
Errors ... 300
Examples ... 301
See Also ... 302
PutFile ... 303
Request Syntax ... 303
Request Parameters ... 303
Response Syntax ... 304
Response Elements ... 305
Errors ... 305
Examples ... 308
See Also ... 309
PutRepositoryTriggers ... 310
Request Syntax ... 310
Request Parameters ... 310
Response Syntax ... 310
Response Elements ... 310
Errors ... 311
Examples ... 313
See Also ... 314
TagResource ... 315
Request Syntax ... 315
Request Parameters ... 315
Response Elements ... 315
Errors ... 315
Examples ... 316
See Also ... 317
TestRepositoryTriggers ... 318
Request Syntax ... 318
Request Parameters ... 318
Response Syntax ... 318
Response Elements ... 319
Errors ... 319
Examples ... 321
See Also ... 322
UntagResource ... 323
Request Syntax ... 323
Request Parameters ... 323
Response Elements ... 323
Errors ... 323
Examples ... 324
See Also ... 325
UpdateApprovalRuleTemplateContent ... 326
Request Syntax ... 326
Request Parameters ... 326
Response Syntax ... 326
Response Elements ... 327
Errors ... 327
Examples ... 328
See Also ... 328
UpdateApprovalRuleTemplateDescription ... 330
Request Syntax ... 330
Request Parameters ... 330
Response Syntax ... 330
Response Elements ... 330
Errors ... 331
Examples ... 331
See Also ... 332
UpdateApprovalRuleTemplateName ... 333
Request Syntax ... 333
Request Parameters ... 333
Response Syntax ... 333
Response Elements ... 333
Errors ... 334
Examples ... 334
See Also ... 335
UpdateComment ... 336
Request Syntax ... 336
Request Parameters ... 336
Response Syntax ... 336
Response Elements ... 336
Errors ... 337
Examples ... 337
See Also ... 338
UpdateDefaultBranch ... 340
Request Syntax ... 340
Request Parameters ... 340
Response Elements ... 340
Errors ... 340
Examples ... 342
See Also ... 342
UpdatePullRequestApprovalRuleContent ... 343
Request Syntax ... 343
Request Parameters ... 343
Response Syntax ... 344
Response Elements ... 344
Errors ... 344
Examples ... 346
See Also ... 347
UpdatePullRequestApprovalState ... 348
Request Syntax ... 348
Request Parameters ... 348
Response Elements ... 348
Errors ... 348
Examples ... 350
See Also ... 351
UpdatePullRequestDescription ... 352
Request Syntax ... 352
Request Parameters ... 352
Response Syntax ... 352
Response Elements ... 353
Errors ... 353
Examples ... 354
See Also ... 355
UpdatePullRequestStatus ... 356
Request Syntax ... 356
Request Parameters ... 356
Response Syntax ... 356
Response Elements ... 357
Errors ... 357
Examples ... 358
See Also ... 359
UpdatePullRequestTitle ... 361
Request Syntax ... 361
Request Parameters ... 361
Response Syntax ... 361
Response Elements ... 362
Errors ... 362
Examples ... 363
See Also ... 364
UpdateRepositoryDescription ... 365
Request Syntax ... 365
Request Parameters ... 365
Response Elements ... 365
Errors ... 365
Examples ... 366
See Also ... 367
UpdateRepositoryName ... 368
Request Syntax ... 368
Request Parameters ... 368
Response Elements ... 368
Errors ... 368
Examples ... 369
See Also ... 369
Data Types ... 371
Approval ... 373
Contents ... 373
See Also ... 373
ApprovalRule ... 374
Contents ... 374
See Also ... 375
ApprovalRuleEventMetadata ... 376
Contents ... 376
See Also ... 376
ApprovalRuleOverriddenEventMetadata ... 377
Contents ... 377
See Also ... 377
ApprovalRuleTemplate ... 378
Contents ... 378
See Also ... 379
ApprovalStateChangedEventMetadata ... 380
Contents ... 380
See Also ... 380
BatchAssociateApprovalRuleTemplateWithRepositoriesError ... 381
Contents ... 381
See Also ... 381
BatchDescribeMergeConflictsError ... 382
Contents ... 382
See Also ... 382
BatchDisassociateApprovalRuleTemplateFromRepositoriesError ... 383
Contents ... 383
See Also ... 383
BatchGetCommitsError ... 384
Contents ... 384
See Also ... 384
BlobMetadata ... 385
Contents ... 385
See Also ... 385
BranchInfo ... 386
Contents ... 386
See Also ... 386
Comment ... 387
Contents ... 387
See Also ... 388
CommentsForComparedCommit ... 389
Contents ... 389
See Also ... 390
CommentsForPullRequest ... 391
Contents ... 391
See Also ... 392
Commit ... 393
Contents ... 393
See Also ... 394
Conflict ... 395
Contents ... 395
See Also ... 395
ConflictMetadata ... 396
Contents ... 396
See Also ... 397
ConflictResolution ... 398
Contents ... 398
See Also ... 398
DeleteFileEntry ... 399
Contents ... 399
See Also ... 399
Difference ... 400
Contents ... 400
See Also ... 400
Evaluation ... 401
Contents ... 401
See Also ... 401
File ... 402
Contents ... 402
See Also ... 402
FileMetadata ... 403
Contents ... 403
See Also ... 403
FileModes ... 404
Contents ... 404
See Also ... 404
FileSizes ... 405
Contents ... 405
See Also ... 405
Folder ... 406
Contents ... 406
See Also ... 406
IsBinaryFile ... 407
Contents ... 407
See Also ... 407
Location ... 408
Contents ... 408
See Also ... 408
MergeHunk ... 409
Contents ... 409
See Also ... 409
MergeHunkDetail ... 410
Contents ... 410
See Also ... 410
MergeMetadata ... 411
Contents ... 411
See Also ... 411
MergeOperations ... 412
Contents ... 412
See Also ... 412
ObjectTypes ... 413
Contents ... 413
See Also ... 413
OriginApprovalRuleTemplate ... 414
Contents ... 414
See Also ... 414
PullRequest ... 415
Contents ... 415
See Also ... 416
PullRequestCreatedEventMetadata ... 417
Contents ... 417
See Also ... 417
PullRequestEvent ... 418
Contents ... 418
See Also ... 419
PullRequestMergedStateChangedEventMetadata ... 420
Contents ... 420
See Also ... 420
PullRequestSourceReferenceUpdatedEventMetadata ... 421
Contents ... 421
See Also ... 421
PullRequestStatusChangedEventMetadata ... 422
Contents ... 422
See Also ... 422
PullRequestTarget ... 423
Contents ... 423
See Also ... 424
PutFileEntry ... 425
Contents ... 425
See Also ... 425
ReactionForComment ... 426
Contents ... 426
See Also ... 426
ReactionValueFormats ... 427
Contents ... 427
See Also ... 427
ReplaceContentEntry ... 428
Contents ... 428
See Also ... 428
RepositoryMetadata ... 429
Contents ... 429
See Also ... 430
RepositoryNameIdPair ... 431
Contents ... 431
See Also ... 431
RepositoryTrigger ... 432
Contents ... 432
See Also ... 433
RepositoryTriggerExecutionFailure ... 434
Contents ... 434
See Also ... 434
SetFileModeEntry ... 435
Contents ... 435
See Also ... 435
SourceFileSpecifier ... 436
Contents ... 436
See Also ... 436
SubModule ... 437
Contents ... 437
See Also ... 437
SymbolicLink ... 438
Contents ... 438
See Also ... 438
Target ... 439
Contents ... 439
See Also ... 439
UserInfo ... 440
Contents ... 440
See Also ... 440
Common Parameters ... 441
Common Errors ... 443
Welcome
This is the AWS CodeCommit API Reference. This reference provides descriptions of the operations and data types for AWS CodeCommit API along with usage examples.
You can use the AWS CodeCommit API to work with the following objects:
Repositories, by calling the following:
• BatchGetRepositories (p. 31), which returns information about one or more repositories associated with your AWS account.
• CreateRepository (p. 64), which creates an AWS CodeCommit repository.
• DeleteRepository (p. 97), which deletes an AWS CodeCommit repository.
• GetRepository (p. 199), which returns information about a specified repository.
• ListRepositories (p. 222), which lists all AWS CodeCommit repositories associated with your AWS account.
• UpdateRepositoryDescription (p. 365), which sets or updates the description of the repository.
• UpdateRepositoryName (p. 368), which changes the name of the repository. If you change the name of a repository, no other users of that repository can access it until you send them the new HTTPS or SSH URL to use.
Branches, by calling the following:
• CreateBranch (p. 39), which creates a branch in a specified repository.
• DeleteBranch (p. 80), which deletes the specified branch in a repository unless it is the default branch.
• GetBranch (p. 126), which returns information about a specified branch.
• ListBranches (p. 214), which lists all branches for a specified repository.
• UpdateDefaultBranch (p. 340), which changes the default branch for a repository.
Files, by calling the following:
• DeleteFile (p. 87), which deletes the content of a specified file from a specified branch.
• GetBlob (p. 123), which returns the base-64 encoded content of an individual Git blob object in a repository.
• GetFile (p. 159), which returns the base-64 encoded content of a specified file.
• GetFolder (p. 164), which returns the contents of a specified folder or directory.
• PutFile (p. 303), which adds or modifies a single file in a specified repository and branch.
Commits, by calling the following:
• BatchGetCommits (p. 26), which returns information about one or more commits in a repository.
• CreateCommit (p. 43), which creates a commit for changes to a repository.
• GetCommit (p. 150), which returns information about a commit, including commit messages and author and committer information.
• GetDifferences (p. 154), which returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference).
Merges, by calling the following:
• BatchDescribeMergeConflicts (p. 14), which returns information about conflicts in a merge between commits in a repository.
• CreateUnreferencedMergeCommit (p. 69), which creates an unreferenced commit between two branches or commits for the purpose of comparing them and identifying any potential conflicts.
• DescribeMergeConflicts (p. 100), which returns information about merge conflicts between the base, source, and destination versions of a file in a potential merge.
• GetMergeCommit (p. 170), which returns information about the merge between a source and destination commit.
• GetMergeConflicts (p. 175), which returns information about merge conflicts between the source and destination branch in a pull request.
• GetMergeOptions (p. 182), which returns information about the available merge options between two branches or commit specifiers.
• MergeBranchesByFastForward (p. 232), which merges two branches using the fast-forward merge option.
• MergeBranchesBySquash (p. 237), which merges two branches using the squash merge option.
• MergeBranchesByThreeWay (p. 245), which merges two branches using the three-way merge option.
Pull requests, by calling the following:
• CreatePullRequest (p. 52), which creates a pull request in a specified repository.
• CreatePullRequestApprovalRule (p. 59), which creates an approval rule for a specified pull request.
• DeletePullRequestApprovalRule (p. 93), which deletes an approval rule for a specified pull request.
• DescribePullRequestEvents (p. 108), which returns information about one or more pull request events.
• EvaluatePullRequestApprovalRules (p. 116), which evaluates whether a pull request has met all the conditions specified in its associated approval rules.
• GetCommentsForPullRequest (p. 144), which returns information about comments on a specified pull request.
• GetPullRequest (p. 187), which returns information about a specified pull request.
• GetPullRequestApprovalStates (p. 191), which returns information about the approval states for a specified pull request.
• GetPullRequestOverrideState (p. 195), which returns information about whether approval rules have been set aside (overriden) for a pull request, and if so, the Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.
• ListPullRequests (p. 218), which lists all pull requests for a repository.
• MergePullRequestByFastForward (p. 253), which merges the source destination branch of a pull request into the specified destination branch for that pull request using the fast-forward merge option.
• MergePullRequestBySquash (p. 259), which merges the source destination branch of a pull request into the specified destination branch for that pull request using the squash merge option.
• MergePullRequestByThreeWay (p. 268), which merges the source destination branch of a pull request into the specified destination branch for that pull request using the three-way merge option.
• OverridePullRequestApprovalRules (p. 277), which sets aside all approval rule requirements for a pull request.
• PostCommentForPullRequest (p. 288), which posts a comment to a pull request at the specified line, file, or request.
• UpdatePullRequestApprovalRuleContent (p. 343), which updates the structure of an approval rule for a pull request.
• UpdatePullRequestApprovalState (p. 348), which updates the state of an approval on a pull request.
• UpdatePullRequestDescription (p. 352), which updates the description of a pull request.
• UpdatePullRequestStatus (p. 356), which updates the status of a pull request.
• UpdatePullRequestTitle (p. 361), which updates the title of a pull request.
Approval rule templates, by calling the following:
• AssociateApprovalRuleTemplateWithRepository (p. 7), which associates a template with a specified repository. After the template is associated with a repository, AWS CodeCommit creates approval rules that match the template conditions on every pull request created in the specified repository.
• BatchAssociateApprovalRuleTemplateWithRepositories (p. 10), which associates a template with one or more specified repositories. After the template is associated with a repository, AWS CodeCommit creates approval rules that match the template conditions on every pull request created in the specified repositories.
• BatchDisassociateApprovalRuleTemplateFromRepositories (p. 22), which removes the association between a template and specified repositories so that approval rules based on the template are not automatically created when pull requests are created in those repositories.
• CreateApprovalRuleTemplate (p. 35), which creates a template for approval rules that can then be associated with one or more repositories in your AWS account.
• DeleteApprovalRuleTemplate (p. 77), which deletes the specified template. It does not remove approval rules on pull requests already created with the template.
• DisassociateApprovalRuleTemplateFromRepository (p. 113), which removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository.
• GetApprovalRuleTemplate (p. 120), which returns information about an approval rule template.
• ListApprovalRuleTemplates (p. 207), which lists all approval rule templates in the AWS Region in your AWS account.
• ListAssociatedApprovalRuleTemplatesForRepository (p. 210), which lists all approval rule templates that are associated with a specified repository.
• ListRepositoriesForApprovalRuleTemplate (p. 225), which lists all repositories associated with the specified approval rule template.
• UpdateApprovalRuleTemplateDescription (p. 330), which updates the description of an approval rule template.
• UpdateApprovalRuleTemplateName (p. 333), which updates the name of an approval rule template.
• UpdateApprovalRuleTemplateContent (p. 326), which updates the content of an approval rule template.
Comments in a repository, by calling the following:
• DeleteCommentContent (p. 84), which deletes the content of a comment on a commit in a repository.
• GetComment (p. 130), which returns information about a comment on a commit.
• GetCommentReactions (p. 134), which returns information about emoji reactions to comments.
• GetCommentsForComparedCommit (p. 138), which returns information about comments on the comparison between two commit specifiers in a repository.
• PostCommentForComparedCommit (p. 281), which creates a comment on the comparison between two commit specifiers in a repository.
• PostCommentReply (p. 296), which creates a reply to a comment.
• PutCommentReaction (p. 300), which creates or updates an emoji reaction to a comment.
• UpdateComment (p. 336), which updates the content of a comment on a commit in a repository.
Tags used to tag resources in AWS CodeCommit (not Git tags), by calling the following:
• ListTagsForResource (p. 229), which gets information about AWStags for a specified Amazon Resource Name (ARN) in AWS CodeCommit.
• TagResource (p. 315), which adds or updates tags for a resource in AWS CodeCommit.
• UntagResource (p. 323), which removes tags for a resource in AWS CodeCommit.
Triggers, by calling the following:
• GetRepositoryTriggers (p. 203), which returns information about triggers configured for a repository.
• PutRepositoryTriggers (p. 310), which replaces all triggers for a repository and can be used to create or delete triggers.
• TestRepositoryTriggers (p. 318), which tests the functionality of a repository trigger by sending data to the trigger target.
For information about how to use AWS CodeCommit, see the AWS CodeCommit User Guide.
This document was last published on March 6, 2022.
Actions
The following actions are supported:
• AssociateApprovalRuleTemplateWithRepository (p. 7)
• BatchAssociateApprovalRuleTemplateWithRepositories (p. 10)
• BatchDescribeMergeConflicts (p. 14)
• BatchDisassociateApprovalRuleTemplateFromRepositories (p. 22)
• BatchGetCommits (p. 26)
• BatchGetRepositories (p. 31)
• CreateApprovalRuleTemplate (p. 35)
• CreateBranch (p. 39)
• CreateCommit (p. 43)
• CreatePullRequest (p. 52)
• CreatePullRequestApprovalRule (p. 59)
• CreateRepository (p. 64)
• CreateUnreferencedMergeCommit (p. 69)
• DeleteApprovalRuleTemplate (p. 77)
• DeleteBranch (p. 80)
• DeleteCommentContent (p. 84)
• DeleteFile (p. 87)
• DeletePullRequestApprovalRule (p. 93)
• DeleteRepository (p. 97)
• DescribeMergeConflicts (p. 100)
• DescribePullRequestEvents (p. 108)
• DisassociateApprovalRuleTemplateFromRepository (p. 113)
• EvaluatePullRequestApprovalRules (p. 116)
• GetApprovalRuleTemplate (p. 120)
• GetBlob (p. 123)
• GetBranch (p. 126)
• GetComment (p. 130)
• GetCommentReactions (p. 134)
• GetCommentsForComparedCommit (p. 138)
• GetCommentsForPullRequest (p. 144)
• GetCommit (p. 150)
• GetDifferences (p. 154)
• GetFile (p. 159)
• GetFolder (p. 164)
• GetMergeCommit (p. 170)
• GetMergeConflicts (p. 175)
• GetMergeOptions (p. 182)
• GetPullRequest (p. 187)
• GetPullRequestApprovalStates (p. 191)
• GetPullRequestOverrideState (p. 195)
• GetRepository (p. 199)
• GetRepositoryTriggers (p. 203)
• ListApprovalRuleTemplates (p. 207)
• ListAssociatedApprovalRuleTemplatesForRepository (p. 210)
• ListBranches (p. 214)
• ListPullRequests (p. 218)
• ListRepositories (p. 222)
• ListRepositoriesForApprovalRuleTemplate (p. 225)
• ListTagsForResource (p. 229)
• MergeBranchesByFastForward (p. 232)
• MergeBranchesBySquash (p. 237)
• MergeBranchesByThreeWay (p. 245)
• MergePullRequestByFastForward (p. 253)
• MergePullRequestBySquash (p. 259)
• MergePullRequestByThreeWay (p. 268)
• OverridePullRequestApprovalRules (p. 277)
• PostCommentForComparedCommit (p. 281)
• PostCommentForPullRequest (p. 288)
• PostCommentReply (p. 296)
• PutCommentReaction (p. 300)
• PutFile (p. 303)
• PutRepositoryTriggers (p. 310)
• TagResource (p. 315)
• TestRepositoryTriggers (p. 318)
• UntagResource (p. 323)
• UpdateApprovalRuleTemplateContent (p. 326)
• UpdateApprovalRuleTemplateDescription (p. 330)
• UpdateApprovalRuleTemplateName (p. 333)
• UpdateComment (p. 336)
• UpdateDefaultBranch (p. 340)
• UpdatePullRequestApprovalRuleContent (p. 343)
• UpdatePullRequestApprovalState (p. 348)
• UpdatePullRequestDescription (p. 352)
• UpdatePullRequestStatus (p. 356)
• UpdatePullRequestTitle (p. 361)
• UpdateRepositoryDescription (p. 365)
• UpdateRepositoryName (p. 368)
AssociateApprovalRuleTemplateWithRepository
AssociateApprovalRuleTemplateWithRepository
Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.
Request Syntax
{ "approvalRuleTemplateName": "string", "repositoryName": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 441).
The request accepts the following data in JSON format.
approvalRuleTemplateName (p. 7)
The name for the approval rule template.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes repositoryName (p. 7)
The name of the repository that you want to associate with the template.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
Required: Yes
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors (p. 443).
ApprovalRuleTemplateDoesNotExistException
The specified approval rule template does not exist. Verify that the name is correct and that you are signed in to the AWS Region where the template was created, and then try again.
Errors
HTTP Status Code: 400
ApprovalRuleTemplateNameRequiredException
An approval rule template name is required, but was not specified.
HTTP Status Code: 400
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
HTTP Status Code: 500
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
HTTP Status Code: 400 EncryptionKeyDisabledException
The encryption key is disabled.
HTTP Status Code: 400
EncryptionKeyNotFoundException No encryption key was found.
HTTP Status Code: 400
EncryptionKeyUnavailableException The encryption key is not available.
HTTP Status Code: 400
InvalidApprovalRuleTemplateNameException
The name of the approval rule template is not valid. Template names must be between 1 and 100 valid characters in length. For more information about limits in AWS CodeCommit, see Quotas in the AWS CodeCommit User Guide.
HTTP Status Code: 400 InvalidRepositoryNameException
A specified repository name is not valid.
NoteThis 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.
HTTP Status Code: 400
MaximumRuleTemplatesAssociatedWithRepositoryException
The maximum number of approval rule templates for a repository has been exceeded. You cannot associate more than 25 approval rule templates with a repository.
HTTP Status Code: 400 RepositoryDoesNotExistException
The specified repository does not exist.
HTTP Status Code: 400
Examples
RepositoryNameRequiredException
A repository name is required, but was not specified.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of AssociateApprovalRuleTemplateWithRepository.
Sample Request
>POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity
Content-Length: 226
X-Amz-Target: CodeCommit_20150413.AssociateApprovalRuleTemplateWithRepository X-Amz-Date: 20191021T213222Z
User-Agent: aws-cli/1.16.137 Python/3.6.0 Windows/10 Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151028/us-east-1/
codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz- target, Signature=8d9b5998EXAMPLE
{ "repositoryName": "MyDemoRepo",
"approvalRuleTemplateName": "2-approver-rule-for-main"
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 1681
Date: Mon, 21 Oxr 2019 22:43:13 GMT
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
BatchAssociateApprovalRuleTemplateWithRepositories
BatchAssociateApprovalRuleTemplateWithRepositories
Creates an association between an approval rule template and one or more specified repositories.
Request Syntax
{ "approvalRuleTemplateName": "string", "repositoryNames": [ "string" ] }
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 441).
The request accepts the following data in JSON format.
approvalRuleTemplateName (p. 10)
The name of the template you want to associate with one or more repositories.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes repositoryNames (p. 10)
The names of the repositories you want to associate with the template.
NoteThe length constraint limit is for each string in the array. The array itself can be empty.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
Required: Yes
Response Syntax
{ "associatedRepositoryNames": [ "string" ], "errors": [
{
"errorCode": "string", "errorMessage": "string", "repositoryName": "string"
} ]}
Response Elements
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
associatedRepositoryNames (p. 10)
A list of names of the repositories that have been associated with the template.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
errors (p. 10)
A list of any errors that might have occurred while attempting to create the association between the template and the repositories.
Type: Array of BatchAssociateApprovalRuleTemplateWithRepositoriesError (p. 381) objects
Errors
For information about the errors that are common to all actions, see Common Errors (p. 443).
ApprovalRuleTemplateDoesNotExistException
The specified approval rule template does not exist. Verify that the name is correct and that you are signed in to the AWS Region where the template was created, and then try again.
HTTP Status Code: 400
ApprovalRuleTemplateNameRequiredException
An approval rule template name is required, but was not specified.
HTTP Status Code: 400
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
HTTP Status Code: 500
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
HTTP Status Code: 400 EncryptionKeyDisabledException
The encryption key is disabled.
HTTP Status Code: 400
EncryptionKeyNotFoundException No encryption key was found.
HTTP Status Code: 400
Examples
EncryptionKeyUnavailableException The encryption key is not available.
HTTP Status Code: 400
InvalidApprovalRuleTemplateNameException
The name of the approval rule template is not valid. Template names must be between 1 and 100 valid characters in length. For more information about limits in AWS CodeCommit, see Quotas in the AWS CodeCommit User Guide.
HTTP Status Code: 400
MaximumRepositoryNamesExceededException
The maximum number of allowed repository names was exceeded. Currently, this number is 100.
HTTP Status Code: 400
RepositoryNamesRequiredException
At least one repository name object is required, but was not specified.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of BatchAssociateApprovalRuleTemplateWithRepositories.
Sample Request
>POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity
Content-Length: 226
X-Amz-Target: CodeCommit_20150413.BatchAssociateApprovalRuleTemplateWithRepositories X-Amz-Date: 20191021T213222Z
User-Agent: aws-cli/1.16.137 Python/3.6.0 Windows/10 Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151028/us-east-1/
codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz- target, Signature=8d9b5998EXAMPLE
{ "approvalRuleTemplateName": "2-approver-rule-for-main", "repositoryNames": [
"MyDemoRepo", "MyOtherDemoRepo"
] }
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 1681
Date: Mon, 21 Oct 2019 22:43:13 GMT
See Also
{ "associatedRepositoryNames": [ "MyDemoRepo",
"MyOtherDemoRepo"
],
"errors": []
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
BatchDescribeMergeConflicts
BatchDescribeMergeConflicts
Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy.
Request Syntax
{ "conflictDetailLevel": "string",
"conflictResolutionStrategy": "string", "destinationCommitSpecifier": "string", "filePaths": [ "string" ],
"maxConflictFiles": number, "maxMergeHunks": number, "mergeOption": "string", "nextToken": "string", "repositoryName": "string", "sourceCommitSpecifier": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 441).
The request accepts the following data in JSON format.
conflictDetailLevel (p. 14)
The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.
Type: String
Valid Values: FILE_LEVEL | LINE_LEVEL Required: No
conflictResolutionStrategy (p. 14)
Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.
Type: String
Valid Values: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE Required: No
destinationCommitSpecifier (p. 14)
The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).
Type: String Required: Yes
Response Syntax
filePaths (p. 14)
The path of the target files used to describe the conflicts. If not specified, the default is all conflict files.
Type: Array of strings Required: No
maxConflictFiles (p. 14)
The maximum number of files to include in the output.
Type: Integer Required: No maxMergeHunks (p. 14)
The maximum number of merge hunks to include in the output.
Type: Integer Required: No mergeOption (p. 14)
The merge option or strategy you want to use to merge the code.
Type: String
Valid Values: FAST_FORWARD_MERGE | SQUASH_MERGE | THREE_WAY_MERGE Required: Yes
nextToken (p. 14)
An enumeration token that, when provided in a request, returns the next batch of the results.
Type: String Required: No repositoryName (p. 14)
The name of the repository that contains the merge conflicts you want to review.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
Required: Yes
sourceCommitSpecifier (p. 14)
The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).
Type: String Required: Yes
Response Syntax
{
Response Syntax
"baseCommitId": "string", "conflicts": [
{
"conflictMetadata": {
"contentConflict": boolean, "fileModeConflict": boolean, "fileModes": {
"base": "string", "destination": "string", "source": "string"
},
"filePath": "string", "fileSizes": { "base": number, "destination": number, "source": number },
"isBinaryFile": { "base": boolean, "destination": boolean, "source": boolean },
"mergeOperations": { "destination": "string", "source": "string"
},
"numberOfConflicts": number, "objectTypeConflict": boolean, "objectTypes": {
"base": "string", "destination": "string", "source": "string"
} },
"mergeHunks": [ {
"base": {
"endLine": number, "hunkContent": "string", "startLine": number },
"destination": { "endLine": number, "hunkContent": "string", "startLine": number },
"isConflict": boolean, "source": {
"endLine": number, "hunkContent": "string", "startLine": number }
} ] } ],
"destinationCommitId": "string", "errors": [
{
"exceptionName": "string", "filePath": "string", "message": "string"
} ],
"nextToken": "string", "sourceCommitId": "string"
Response Elements
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
baseCommitId (p. 15)
The commit ID of the merge base.
Type: String conflicts (p. 15)
A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the files.
Type: Array of Conflict (p. 395) objects destinationCommitId (p. 15)
The commit ID of the destination commit specifier that was used in the merge evaluation.
Type: String errors (p. 15)
A list of any errors returned while describing the merge conflicts for each file.
Type: Array of BatchDescribeMergeConflictsError (p. 382) objects nextToken (p. 15)
An enumeration token that can be used in a request to return the next batch of the results.
Type: String sourceCommitId (p. 15)
The commit ID of the source commit specifier that was used in the merge evaluation.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors (p. 443).
CommitDoesNotExistException
The specified commit does not exist or no commit was specified, and the specified repository has no default branch.
HTTP Status Code: 400 CommitRequiredException
A commit was not specified.
HTTP Status Code: 400
Errors
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
HTTP Status Code: 500
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
HTTP Status Code: 400 EncryptionKeyDisabledException
The encryption key is disabled.
HTTP Status Code: 400
EncryptionKeyNotFoundException
No encryption key was found.
HTTP Status Code: 400
EncryptionKeyUnavailableException
The encryption key is not available.
HTTP Status Code: 400 InvalidCommitException
The specified commit is not valid.
HTTP Status Code: 400
InvalidConflictDetailLevelException
The specified conflict detail level is not valid.
HTTP Status Code: 400
InvalidConflictResolutionStrategyException
The specified conflict resolution strategy is not valid.
HTTP Status Code: 400
InvalidContinuationTokenException
The specified continuation token is not valid.
HTTP Status Code: 400 InvalidMaxConflictFilesException
The specified value for the number of conflict files to return is not valid.
HTTP Status Code: 400 InvalidMaxMergeHunksException
The specified value for the number of merge hunks to return is not valid.
HTTP Status Code: 400
Examples
InvalidMergeOptionException
The specified merge option is not valid for this operation. Not all merge strategies are supported for all operations.
HTTP Status Code: 400 InvalidRepositoryNameException
A specified repository name is not valid.
NoteThis 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.
HTTP Status Code: 400
MaximumFileContentToLoadExceededException
The number of files to load exceeds the allowed limit.
HTTP Status Code: 400
MaximumItemsToCompareExceededException
The number of items to compare between the source or destination branches and the merge base has exceeded the maximum allowed.
HTTP Status Code: 400 MergeOptionRequiredException
A merge option or stategy is required, and none was provided.
HTTP Status Code: 400 RepositoryDoesNotExistException
The specified repository does not exist.
HTTP Status Code: 400
RepositoryNameRequiredException
A repository name is required, but was not specified.
HTTP Status Code: 400
TipsDivergenceExceededException
The divergence between the tips of the provided commit specifiers is too great to determine
whether there might be any merge conflicts. Locally compare the specifiers using git diff or a diff tool.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of BatchDescribeMergeConflicts.
Examples
Sample Request
>POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity
Content-Length: 226
X-Amz-Target: CodeCommit_20150413.BatchDescribeMergeConflicts X-Amz-Date: 20190428T213222Z
User-Agent: aws-cli/1.16.137 Python/3.6.0 Windows/10 Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151028/us-east-1/
codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz- target, Signature=8d9b5998EXAMPLE
{ "repositoryName": "MyDemoRepo",
"destinationCommitSpecifier": "bugfix-bug1234", "sourceCommitSpecifier": "main",
"mergeOption": "THREE_WAY_MERGE", "conflictDetailLevel" "LINE_LEVEL", "conflictResolutionStrategy": "NONE", "nextToken": "exampleToken",
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 1681
Date: Sun, 28 Apr 2019 22:43:13 GMT {
"conflicts":[
{
"conflictMetadata": { "filePath": "file1.py", "fileSizes": {
"source": 123, "destination": 125, "base": 124
},
"fileModes": {
"source": "EXECUTABLE", "destination": "EXECUTABLE", "base": "EXECUTABLE"
},
"numberOfConflicts", 4, "isBinaryFile": {
"source": false, "destination": false, "base": false
},
"contentConflict": true, "fileModeConflict": false, "mergeOperations": { "source": "M", "destination": "M"
} }
"mergeHunks":[
{
"mergeHunk": {
See Also
"isConflict": true "source": {
"startLine": 123, "endLine": 123,
"hunkContent" "JzCQbIVyEXAMPLE="
}
"destination": { "startLine": 125, "endLine": 125,
"hunkContent" "BytPbuMiEXAMPLE="
}
"base": {
"startLine": 124, "endLine": 124,
"hunkContent" "MnKCdITaEXAMPLE="
} } } ]
"errors":
"sourceCommitId": "c5709475EXAMPLE", "destinationCommitId": "317f8570EXAMPLE", "baseCommitId": "fb12a539EXAMPLE",
"nextToken": "exampleToken"
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
BatchDisassociateApprovalRuleTemplateFromRepositories
BatchDisassociateApprovalRuleTemplateFromRepositories
Removes the association between an approval rule template and one or more specified repositories.
Request Syntax
{ "approvalRuleTemplateName": "string", "repositoryNames": [ "string" ] }
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 441).
The request accepts the following data in JSON format.
approvalRuleTemplateName (p. 22)
The name of the template that you want to disassociate from one or more repositories.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes repositoryNames (p. 22)
The repository names that you want to disassociate from the approval rule template.
NoteThe length constraint limit is for each string in the array. The array itself can be empty.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
Required: Yes
Response Syntax
{ "disassociatedRepositoryNames": [ "string" ], "errors": [
{
"errorCode": "string", "errorMessage": "string", "repositoryName": "string"
} ]}
Response Elements
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
disassociatedRepositoryNames (p. 22)
A list of repository names that have had their association with the template removed.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
errors (p. 22)
A list of any errors that might have occurred while attempting to remove the association between the template and the repositories.
Type: Array of BatchDisassociateApprovalRuleTemplateFromRepositoriesError (p. 383) objects
Errors
For information about the errors that are common to all actions, see Common Errors (p. 443).
ApprovalRuleTemplateDoesNotExistException
The specified approval rule template does not exist. Verify that the name is correct and that you are signed in to the AWS Region where the template was created, and then try again.
HTTP Status Code: 400
ApprovalRuleTemplateNameRequiredException
An approval rule template name is required, but was not specified.
HTTP Status Code: 400
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
HTTP Status Code: 500
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
HTTP Status Code: 400 EncryptionKeyDisabledException
The encryption key is disabled.
HTTP Status Code: 400
EncryptionKeyNotFoundException No encryption key was found.
HTTP Status Code: 400
Examples
EncryptionKeyUnavailableException The encryption key is not available.
HTTP Status Code: 400
InvalidApprovalRuleTemplateNameException
The name of the approval rule template is not valid. Template names must be between 1 and 100 valid characters in length. For more information about limits in AWS CodeCommit, see Quotas in the AWS CodeCommit User Guide.
HTTP Status Code: 400
MaximumRepositoryNamesExceededException
The maximum number of allowed repository names was exceeded. Currently, this number is 100.
HTTP Status Code: 400
RepositoryNamesRequiredException
At least one repository name object is required, but was not specified.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of BatchDisassociateApprovalRuleTemplateFromRepositories.
Sample Request
>POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity
Content-Length: 226
X-Amz-Target: CodeCommit_20150413.BatchDisassociateApprovalRuleTemplateFromRepositories X-Amz-Date: 20191021T213222Z
User-Agent: aws-cli/1.16.137 Python/3.6.0 Windows/10 Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151028/us-east-1/
codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz- target, Signature=8d9b5998EXAMPLE
{ "approvalRuleTemplateName": "2-approver-rule-for-main", "repositoryNames": [
"MyDemoRepo", "MyOtherDemoRepo"
] }
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 1681
Date: Mon, 21 Oxr 2019 22:43:13 GMT
See Also
"disassociatedRepositoryNames": [ "MyDemoRepo",
"MyOtherDemoRepo"
],
"errors": []
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
BatchGetCommits
BatchGetCommits
Returns information about the contents of one or more commits in a repository.
Request Syntax
{ "commitIds": [ "string" ], "repositoryName": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 441).
The request accepts the following data in JSON format.
commitIds (p. 26)
The full commit IDs of the commits to get information about.
NoteYou must supply the full SHA IDs of each commit. You cannot use shortened SHA IDs.
Type: Array of strings Required: Yes repositoryName (p. 26)
The name of the repository that contains the commits.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 100.
Pattern: [\w\.-]+
Required: Yes
Response Syntax
{ "commits": [ {
"additionalData": "string", "author": {
"date": "string", "email": "string", "name": "string"
},
"commitId": "string", "committer": { "date": "string", "email": "string", "name": "string"
},
Response Elements
"message": "string", "parents": [ "string" ], "treeId": "string"
} ],
"errors": [ {
"commitId": "string", "errorCode": "string", "errorMessage": "string"
} ]}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
commits (p. 26)
An array of commit data type objects, each of which contains information about a specified commit.
Type: Array of Commit (p. 393) objects errors (p. 26)
Returns any commit IDs for which information could not be found. For example, if one of the commit IDs was a shortened SHA ID or that commit was not found in the specified repository, the ID returns an error object with more information.
Type: Array of BatchGetCommitsError (p. 384) objects
Errors
For information about the errors that are common to all actions, see Common Errors (p. 443).
CommitIdsLimitExceededException
The maximum number of allowed commit IDs in a batch request is 100. Verify that your batch requests contains no more than 100 commit IDs, and then try again.
HTTP Status Code: 400 CommitIdsListRequiredException
A list of commit IDs is required, but was either not specified or the list was empty.
HTTP Status Code: 400
EncryptionIntegrityChecksFailedException An encryption integrity check failed.
HTTP Status Code: 500
EncryptionKeyAccessDeniedException An encryption key could not be accessed.
HTTP Status Code: 400
Examples
EncryptionKeyDisabledException The encryption key is disabled.
HTTP Status Code: 400
EncryptionKeyNotFoundException No encryption key was found.
HTTP Status Code: 400
EncryptionKeyUnavailableException The encryption key is not available.
HTTP Status Code: 400 InvalidRepositoryNameException
A specified repository name is not valid.
NoteThis 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.
HTTP Status Code: 400 RepositoryDoesNotExistException
The specified repository does not exist.
HTTP Status Code: 400
RepositoryNameRequiredException
A repository name is required, but was not specified.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of BatchGetCommits.
Sample Request
>POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com Accept-Encoding: identity
Content-Length: 105
X-Amz-Target: CodeCommit_20150413.BatchGetCommits X-Amz-Date: 20190724T201222Z
User-Agent: aws-cli/1.11.187 Python/3.4.9 Windows/10 Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151028/us-east-1/
codecommit/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz- target, Signature=8d9b5998EXAMPLE
{ "repositoryName": "MyDemoRepo",