Table of Contents
CodeBuild.Client¶A low-level client representing AWS CodeBuild:
client = session.create_client('codebuild')
These are the available methods:
batch_get_builds()batch_get_projects()can_paginate()create_project()delete_project()generate_presigned_url()get_paginator()get_waiter()list_builds()list_builds_for_project()list_curated_environment_images()list_projects()start_build()stop_build()update_project()batch_get_builds(**kwargs)¶Gets information about builds.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_builds(
ids=[
'string',
]
)
| Parameters: | ids (list) – [REQUIRED] The IDs of the builds.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'builds': [
{
'id': 'string',
'arn': 'string',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'currentPhase': 'string',
'buildStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'sourceVersion': 'string',
'projectName': 'string',
'phases': [
{
'phaseType': 'SUBMITTED'|'PROVISIONING'|'DOWNLOAD_SOURCE'|'INSTALL'|'PRE_BUILD'|'BUILD'|'POST_BUILD'|'UPLOAD_ARTIFACTS'|'FINALIZING'|'COMPLETED',
'phaseStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'durationInSeconds': 123,
'contexts': [
{
'statusCode': 'string',
'message': 'string'
},
]
},
],
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'location': 'string',
'sha256sum': 'string',
'md5sum': 'string'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'logs': {
'groupName': 'string',
'streamName': 'string',
'deepLink': 'string'
},
'timeoutInMinutes': 123,
'buildComplete': True|False,
'initiator': 'string'
},
],
'buildsNotFound': [
'string',
]
}
Response Structure
|
batch_get_projects(**kwargs)¶Gets information about build projects.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_projects(
names=[
'string',
]
)
| Parameters: | names (list) – [REQUIRED] The names of the build projects.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'projects': [
{
'name': 'string',
'arn': 'string',
'description': 'string',
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'serviceRole': 'string',
'timeoutInMinutes': 123,
'encryptionKey': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'created': datetime(2015, 1, 1),
'lastModified': datetime(2015, 1, 1)
},
],
'projectsNotFound': [
'string',
]
}
Response Structure
|
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_project(**kwargs)¶Creates a build project.
See also: AWS API Documentation
Request Syntax
response = client.create_project(
name='string',
description='string',
source={
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
artifacts={
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
environment={
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
serviceRole='string',
timeoutInMinutes=123,
encryptionKey='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'project': {
'name': 'string',
'arn': 'string',
'description': 'string',
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'serviceRole': 'string',
'timeoutInMinutes': 123,
'encryptionKey': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'created': datetime(2015, 1, 1),
'lastModified': datetime(2015, 1, 1)
}
}
Response Structure
|
delete_project(**kwargs)¶Deletes a build project.
See also: AWS API Documentation
Request Syntax
response = client.delete_project(
name='string'
)
| Parameters: | name (string) – [REQUIRED] The name of the build project. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_waiter(waiter_name)¶list_builds(**kwargs)¶Gets a list of build IDs, with each build ID representing a single build.
See also: AWS API Documentation
Request Syntax
response = client.list_builds(
sortOrder='ASCENDING'|'DESCENDING',
nextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ids': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
list_builds_for_project(**kwargs)¶Gets a list of build IDs for the specified build project, with each build ID representing a single build.
See also: AWS API Documentation
Request Syntax
response = client.list_builds_for_project(
projectName='string',
sortOrder='ASCENDING'|'DESCENDING',
nextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ids': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
list_curated_environment_images()¶Gets information about Docker images that are managed by AWS CodeBuild.
See also: AWS API Documentation
Request Syntax
response = client.list_curated_environment_images()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'platforms': [
{
'platform': 'DEBIAN'|'AMAZON_LINUX'|'UBUNTU',
'languages': [
{
'language': 'JAVA'|'PYTHON'|'NODE_JS'|'RUBY'|'GOLANG'|'DOCKER'|'ANDROID'|'DOTNET'|'BASE',
'images': [
{
'name': 'string',
'description': 'string'
},
]
},
]
},
]
}
Response Structure
|
list_projects(**kwargs)¶Gets a list of build project names, with each build project name representing a single build project.
See also: AWS API Documentation
Request Syntax
response = client.list_projects(
sortBy='NAME'|'CREATED_TIME'|'LAST_MODIFIED_TIME',
sortOrder='ASCENDING'|'DESCENDING',
nextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'nextToken': 'string',
'projects': [
'string',
]
}
Response Structure
|
start_build(**kwargs)¶Starts running a build.
See also: AWS API Documentation
Request Syntax
response = client.start_build(
projectName='string',
sourceVersion='string',
artifactsOverride={
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
environmentVariablesOverride=[
{
'name': 'string',
'value': 'string'
},
],
buildspecOverride='string',
timeoutInMinutesOverride=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'build': {
'id': 'string',
'arn': 'string',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'currentPhase': 'string',
'buildStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'sourceVersion': 'string',
'projectName': 'string',
'phases': [
{
'phaseType': 'SUBMITTED'|'PROVISIONING'|'DOWNLOAD_SOURCE'|'INSTALL'|'PRE_BUILD'|'BUILD'|'POST_BUILD'|'UPLOAD_ARTIFACTS'|'FINALIZING'|'COMPLETED',
'phaseStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'durationInSeconds': 123,
'contexts': [
{
'statusCode': 'string',
'message': 'string'
},
]
},
],
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'location': 'string',
'sha256sum': 'string',
'md5sum': 'string'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'logs': {
'groupName': 'string',
'streamName': 'string',
'deepLink': 'string'
},
'timeoutInMinutes': 123,
'buildComplete': True|False,
'initiator': 'string'
}
}
Response Structure
|
stop_build(**kwargs)¶Attempts to stop running a build.
See also: AWS API Documentation
Request Syntax
response = client.stop_build(
id='string'
)
| Parameters: | id (string) – [REQUIRED] The ID of the build. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'build': {
'id': 'string',
'arn': 'string',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'currentPhase': 'string',
'buildStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'sourceVersion': 'string',
'projectName': 'string',
'phases': [
{
'phaseType': 'SUBMITTED'|'PROVISIONING'|'DOWNLOAD_SOURCE'|'INSTALL'|'PRE_BUILD'|'BUILD'|'POST_BUILD'|'UPLOAD_ARTIFACTS'|'FINALIZING'|'COMPLETED',
'phaseStatus': 'SUCCEEDED'|'FAILED'|'FAULT'|'TIMED_OUT'|'IN_PROGRESS'|'STOPPED',
'startTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'durationInSeconds': 123,
'contexts': [
{
'statusCode': 'string',
'message': 'string'
},
]
},
],
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'location': 'string',
'sha256sum': 'string',
'md5sum': 'string'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'logs': {
'groupName': 'string',
'streamName': 'string',
'deepLink': 'string'
},
'timeoutInMinutes': 123,
'buildComplete': True|False,
'initiator': 'string'
}
}
Response Structure
|
update_project(**kwargs)¶Changes the settings of a build project.
See also: AWS API Documentation
Request Syntax
response = client.update_project(
name='string',
description='string',
source={
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
artifacts={
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
environment={
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
serviceRole='string',
timeoutInMinutes=123,
encryptionKey='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'project': {
'name': 'string',
'arn': 'string',
'description': 'string',
'source': {
'type': 'CODECOMMIT'|'CODEPIPELINE'|'GITHUB'|'S3'|'BITBUCKET',
'location': 'string',
'buildspec': 'string',
'auth': {
'type': 'OAUTH',
'resource': 'string'
}
},
'artifacts': {
'type': 'CODEPIPELINE'|'S3'|'NO_ARTIFACTS',
'location': 'string',
'path': 'string',
'namespaceType': 'NONE'|'BUILD_ID',
'name': 'string',
'packaging': 'NONE'|'ZIP'
},
'environment': {
'type': 'LINUX_CONTAINER',
'image': 'string',
'computeType': 'BUILD_GENERAL1_SMALL'|'BUILD_GENERAL1_MEDIUM'|'BUILD_GENERAL1_LARGE',
'environmentVariables': [
{
'name': 'string',
'value': 'string'
},
],
'privilegedMode': True|False
},
'serviceRole': 'string',
'timeoutInMinutes': 123,
'encryptionKey': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'created': datetime(2015, 1, 1),
'lastModified': datetime(2015, 1, 1)
}
}
Response Structure
|
The available paginators are: