ListRepositories
Gets information about one or more repositories.
Request Syntax
{
"nextToken": "string
",
"order": "string
",
"sortBy": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- nextToken
-
An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to Amazon CodeCommit, another page of 1,000 records is retrieved.
Type: String
Required: No
- order
-
The order in which to sort the results of a list repositories operation.
Type: String
Valid Values:
ascending | descending
Required: No
- sortBy
-
The criteria used to sort the results of a list repositories operation.
Type: String
Valid Values:
repositoryName | lastModifiedDate
Required: No
Response Syntax
{
"nextToken": "string",
"repositories": [
{
"repositoryId": "string",
"repositoryName": "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.
- nextToken
-
An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to Amazon CodeCommit, another page of 1,000 records is retrieved.
Type: String
- repositories
-
Lists the repositories called by the list repositories operation.
Type: Array of RepositoryNameIdPair objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- InvalidContinuationTokenException
-
The specified continuation token is not valid.
HTTP Status Code: 400
- InvalidOrderException
-
The specified sort order is not valid.
HTTP Status Code: 400
- InvalidSortByException
-
The specified sort by value is not valid.
HTTP Status Code: 400
Examples
Example
This example illustrates one usage of ListRepositories.
Sample Request
POST / HTTP/1.1
Host: codecommit.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 2
X-Amz-Target: CodeCommit_20150413.ListRepositories
X-Amz-Date: 20151028T212036Z
User-Agent: aws-cli/1.7.38 Python/2.7.9 Windows/7
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
{}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 721
Date: Wed, 28 Oct 2015 21:20:37 GMT
{
"repositories":[
{
"repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE",
"repositoryName": "MyDemoRepo"
},
{
"repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE"
"repositoryName": "MyOtherDemoRepo"
}
]
}
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: