..
.. SPDX-License-Identifier: Apache-2.0
..

:github_url: https://github.com/IBM-Blockchain/ansible-collection/edit/main/plugins/modules/channel_consenters.py


channel_consenters -- Manage the consenters for a Hyperledger Fabric channel
============================================================================

.. contents::
   :local:
   :depth: 1


Synopsis
--------

Specify the consenters for a Hyperledger Fabric channel by using the IBM Blockchain Platform.

This module works with the IBM Blockchain Platform managed service running in IBM Cloud, or the IBM Blockchain Platform software running in a Red Hat OpenShift or Kubernetes cluster.






Parameters
----------

  api_endpoint (required)
    The URL for the IBM Blockchain Platform console.

    | **Type**: str

  api_authtype (required)
    ``ibmcloud`` - Authenticate to the IBM Blockchain Platform console using IBM Cloud authentication. You must provide a valid API key using *api_key*.

    ``basic`` - Authenticate to the IBM Blockchain Platform console using basic authentication. You must provide both a valid API key using *api_key* and API secret using *api_secret*.

    | **Type**: str

  api_key (required)
    The API key for the IBM Blockchain Platform console.

    | **Type**: str

  api_secret
    The API secret for the IBM Blockchain Platform console.

    Only required when *api_authtype* is ``basic``.

    | **Type**: str

  api_timeout
    The timeout, in seconds, to use when interacting with the IBM Blockchain Platform console.

    | **Type**: int
    | **Default value**: ``60``

  api_token_endpoint
    The IBM Cloud IAM token endpoint to use when using IBM Cloud authentication.

    Only required when *api_authtype* is ``ibmcloud``, and you are using IBM internal staging servers for testing.

    | **Type**: str
    | **Default value**: ``https://iam.cloud.ibm.com/identity/token``

  path (required)
    Path to current the channel configuration file.

    This file can be fetched by using the :ref:`channel_config <channel_config_module>` module.

    This file will be updated in place. You will need to keep a copy of the original file for computing the configuration update.

    | **Type**: str

  ordering_service
    The ordering service to use as the consenters for this channel. All ordering service nodes in this ordering service will be used as the consenters for this channel.

    You can pass a string, which is the cluster name of a ordering service registered with the IBM Blockchain Platform console.

    You can also pass a list, which must match the result format of one of the :ref:`ordering_service_info <ordering_service_info_module>` or :ref:`ordering_service <ordering_service_module>` modules.

    Cannot be specified with *ordering_service_nodes*.

    | **Type**: raw

  ordering_service_nodes
    The ordering service nodes to use as the consenters for this channel.

    You can pass strings, which are the names of ordering service nodes that are registered with the IBM Blockchain Platform console.

    You can also pass a dict, which must match the result format of one of the :ref:`ordering_service_node_info <ordering_service_node_info_module>` or :ref:`ordering_service_node <ordering_service_node_module>` modules.

    Cannot be specified with *ordering_service*.

    | **Type**: list
    | **Elements**: raw








Examples
--------

.. code-block:: yaml+jinja

    
    - name: Set channel consenters from ordering service
      ibm.blockchain_platform.channel_consenters:
        api_endpoint: https://ibp-console.example.org:32000
        api_authtype: basic
        api_key: xxxxxxxx
        api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        path: channel_config.bin
        ordering_service: Ordering Service

    - name: Set channel consenters from ordering service nodes
      ibm.blockchain_platform.channel_consenters:
        api_endpoint: https://ibp-console.example.org:32000
        api_authtype: basic
        api_key: xxxxxxxx
        api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        path: channel_config.bin
        ordering_service_nodes:
          - Ordering Service_1
          - Ordering Service_2
          - Ordering Service_5



