Table of Contents
A low-level client representing AWS CodeStar connections:
client = session.create_client('codestar-connections')
These are the available methods:
Check if an operation can be paginated.
Creates a connection that can then be given to other AWS services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.
See also: AWS API Documentation
Request Syntax
response = client.create_connection(
ProviderType='Bitbucket',
ConnectionName='string'
)
[REQUIRED]
The name of the external provider where your third-party code repository is configured. Currently, the valid provider type is Bitbucket.
[REQUIRED]
The name of the connection to be created. The name must be unique in the calling AWS account.
dict
Response Syntax
{
'ConnectionArn': 'string'
}
Response Structure
(dict) --
ConnectionArn (string) --
The Amazon Resource Name (ARN) of the connection to be created. The ARN is used as the connection reference when the connection is shared between AWS services.
Note
The ARN is never reused if the connection is deleted.
Exceptions
The connection to be deleted.
See also: AWS API Documentation
Request Syntax
response = client.delete_connection(
ConnectionArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the connection to be deleted.
Note
The ARN is never reused if the connection is deleted.
{}
Response Structure
Exceptions
Generate a presigned url given a client, its method, and arguments
The presigned url
Returns the connection ARN and details such as status, owner, and provider type.
See also: AWS API Documentation
Request Syntax
response = client.get_connection(
ConnectionArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of a connection.
{
'Connection': {
'ConnectionName': 'string',
'ConnectionArn': 'string',
'ProviderType': 'Bitbucket',
'OwnerAccountId': 'string',
'ConnectionStatus': 'PENDING'|'AVAILABLE'|'ERROR'
}
}
Response Structure
The connection details, such as status, owner, and provider type.
The name of the connection. Connection names must be unique in an AWS user account.
The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between AWS services.
Note
The ARN is never reused if the connection is deleted.
The name of the external provider where your third-party code repository is configured. Currently, the valid provider type is Bitbucket.
The name of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.
The current status of the connection.
Exceptions
Create a paginator for an operation.
Returns an object that can wait for some condition.
Lists the connections associated with your account.
See also: AWS API Documentation
Request Syntax
response = client.list_connections(
ProviderTypeFilter='Bitbucket',
MaxResults=123,
NextToken='string'
)
dict
Response Syntax
{
'Connections': [
{
'ConnectionName': 'string',
'ConnectionArn': 'string',
'ProviderType': 'Bitbucket',
'OwnerAccountId': 'string',
'ConnectionStatus': 'PENDING'|'AVAILABLE'|'ERROR'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Connections (list) --
A list of connections and the details for each connection, such as status, owner, and provider type.
(dict) --
The configuration that allows a service such as CodePipeline to connect to a third-party code repository.
ConnectionName (string) --
The name of the connection. Connection names must be unique in an AWS user account.
ConnectionArn (string) --
The Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between AWS services.
Note
The ARN is never reused if the connection is deleted.
ProviderType (string) --
The name of the external provider where your third-party code repository is configured. Currently, the valid provider type is Bitbucket.
OwnerAccountId (string) --
The name of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository.
ConnectionStatus (string) --
The current status of the connection.
NextToken (string) --
A token that can be used in the next ListConnections call. To view all items in the list, continue to call this operation with each subsequent token until no more nextToken values are returned.
Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
Exceeded the maximum limit for connections.
Example
try:
...
except client.exceptions.LimitExceededException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
Exceeded the maximum limit for connections.
Resource not found. Verify the connection resource ARN and try again.
Example
try:
...
except client.exceptions.ResourceNotFoundException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
Resource not found. Verify the connection resource ARN and try again.
The available paginators are: