Skip to content

list_deployment_groups

list_deployment_groups(
    application_name: ApplicationName,
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    next_token: Optional[NextToken] = None,
) -> ListDeploymentGroupsOutput

Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.

Parameters:

  • application_name (ApplicationName) –

    The name of an CodeDeploy application associated with the user or Amazon Web Services account.

  • next_token (Optional[NextToken], default: None ) –

    An identifier returned from the previous list deployment groups call. It can be used to return the next set of deployment groups in the list.

Raises:

Source code in docs_src/capo_codedeploy/_services/code_deploy.py
def list_deployment_groups(
    self,
    application_name: "capo_codedeploy.types.application_name.ApplicationName",
    *,
    config_overrides: Optional[CodeDeployClientConfig] = None,
    next_token: Optional["capo_codedeploy.types.next_token.NextToken"] = None,
) -> (
    "capo_codedeploy.types.list_deployment_groups_output.ListDeploymentGroupsOutput"
):
    """<p>Lists the deployment groups for an application registered with the Amazon Web Services user or Amazon Web Services account.</p>

    Args:
        application_name: <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
        next_token: <p>An identifier returned from the previous list deployment groups call. It can be used to return the next set of deployment groups in the list.</p>

    Raises:
        capo_codedeploy.errors.application_does_not_exist_exception.ApplicationDoesNotExistException: <p>The application does not exist with the user or Amazon Web Services account.</p>
        capo_codedeploy.errors.application_name_required_exception.ApplicationNameRequiredException: <p>The minimum number of required application names was not specified.</p>
        capo_codedeploy.errors.invalid_application_name_exception.InvalidApplicationNameException: <p>The application name was specified in an invalid format.</p>
        capo_codedeploy.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The next token was specified in an invalid format.</p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codedeploy.types.list_deployment_groups_input.ListDeploymentGroupsInput]",
    ) -> OperationResponse[
        "capo_codedeploy.types.list_deployment_groups_output.ListDeploymentGroupsOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.list_deployment_groups

        output, http_response = (
            capo_codedeploy._operations.code_deploy_20141006.list_deployment_groups.list_deployment_groups(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDeploymentGroups")
    )
    input_: capo_codedeploy.types.list_deployment_groups_input.ListDeploymentGroupsInput = {
        "application_name": application_name
    }
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output