carlogtt_python_library.amazon_internal.pipelines module
This module …
- class carlogtt_python_library.amazon_internal.pipelines.Pipelines(aws_region_name: str, *, aws_profile_name: str | None = None, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, caching: bool = False, client_parameters: dict[str, Any] | None = None)[source]
Bases:
objectA handler class for the PipelinesAPI.
It includes an option to cache the client session to minimize the number of AWS API call.
Internal Amazon API https://us-west-2.prod.pipelines-api.builder-tools.aws.dev/model/index.html
- Parameters:
aws_region_name – The name of the AWS region where the service is to be used. This parameter is required to configure the AWS client.
aws_profile_name – The name of the AWS profile to use for credentials. This is useful if you have multiple profiles configured in your AWS credentials file. Default is None, which means the default profile or environment variables will be used if not provided.
aws_access_key_id – The AWS access key ID for programmatically accessing AWS services. This parameter is optional and only needed if not using a profile from the AWS credentials file.
aws_secret_access_key – The AWS secret access key corresponding to the provided access key ID. Like the access key ID, this parameter is optional and only needed if not using a profile.
aws_session_token – The AWS temporary session token corresponding to the provided access key ID. Like the access key ID, this parameter is optional and only needed if not using a profile.
caching – Determines whether to enable caching for the client session. If set to True, the client session will be cached to improve performance and reduce the number of API calls. Default is False.
client_parameters – A key-value pair object of parameters that will be passed to the low-level service client.
- get_pipeline_structure(*, pipeline_name: str | None = None, pipeline_id: str | None = None) dict[str, Any][source]
Returns the structure of a pipeline based on it’s name or ID.
- Parameters:
pipeline_name – The name of the pipeline.
pipeline_id – The id of the pipeline.
- Returns:
The pipeline structure.
- Raise:
PipelinesError if function call fails.
- get_pipelines_containing_target(target_name: str, target_type: TargetType, in_primary_pipeline: bool) dict[str, Any][source]
Returns a list of pipeline names which contain the provided target.
- Parameters:
target_name – The name of the target.
target_type – The type of the target.
in_primary_pipeline – Whether the target is in the primary pipeline.
- Returns:
The list of pipelines containing the target.
- Raise:
PipelinesError if function call fails.
- invalidate_client_cache() None[source]
Clears the cached client, if caching is enabled.
This method allows manually invalidating the cached client, forcing a new client instance to be created on the next access. Useful if AWS credentials have changed or if there’s a need to connect to a different region within the same instance lifecycle.
- Returns:
None.
- Raises:
PipelinesError – Raises an error if caching is not enabled for this instance.
- class carlogtt_python_library.amazon_internal.pipelines.TargetType(*values)[source]
Bases:
EnumEnum class for the different types of targets that can be used in the PipelinesAPI.
Targets represent instances in underlying systems, like packages, code deploy apps, etc.
- BATS = 'BATS'
- CD = 'CD'
- CF = 'CF'
- DG = 'DG'
- ENV = 'ENV'
- GEN = 'GEN'
- OS = 'OS'
- PKG = 'PKG'
- VS = 'VS'