Skip to main content

source_repository_branches

Creates, updates, deletes, gets or lists a source_repository_branches resource.

Overview​

Namesource_repository_branches
TypeResource
Idaws.codecatalyst.source_repository_branches

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the branch.
head_commit_idstringThe commit ID of the tip of the branch at the time of the request, also known as the head commit.
last_updated_timestring (date-time)The time the branch was last updated, in coordinated universal time (UTC) timestamp format as specified in RFC 3339.
refstringThe Git reference name of the branch.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_source_repository_branchesselectspace_name, project_name, source_repository_name, regionRetrieves a list of branches in a specified source repository.
create_source_repository_branchinsertspace_name, project_name, source_repository_name, name, regionCreates a branch in a specified source repository in Amazon CodeCatalyst. This API only creates a branch in a source repository hosted in Amazon CodeCatalyst. You cannot use this API to create a branch in a linked repository.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name for the branch you're creating.
project_namestringThe name of the project in the space.
regionstringAWS region (default: us-east-1)
source_repository_namestringThe name of the repository where you want to create a branch.
space_namestringThe name of the space.

SELECT examples​

Retrieves a list of branches in a specified source repository.

SELECT
name,
head_commit_id,
last_updated_time,
ref
FROM aws.codecatalyst.source_repository_branches
WHERE space_name = '{{ space_name }}' -- required
AND project_name = '{{ project_name }}' -- required
AND source_repository_name = '{{ source_repository_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a branch in a specified source repository in Amazon CodeCatalyst. This API only creates a branch in a source repository hosted in Amazon CodeCatalyst. You cannot use this API to create a branch in a linked repository.

INSERT INTO aws.codecatalyst.source_repository_branches (
headCommitId,
space_name,
project_name,
source_repository_name,
name,
region
)
SELECT
'{{ headCommitId }}',
'{{ space_name }}',
'{{ project_name }}',
'{{ source_repository_name }}',
'{{ name }}',
'{{ region }}'
RETURNING
name,
head_commit_id,
last_updated_time,
ref
;