connection_profile – Manage a connection profile for a Hyperledger Fabric network
Synopsis
Create, update, or delete a connection profile for a Hyperledger Fabric network 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: intDefault 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: strDefault value:https://iam.cloud.ibm.com/identity/token
- state
absent
- If a connection profile exists at the specified path, it will be removed.
present
- Asserts that a connection profile exists at the specified path. If no connection profile exists, a connection profile will be created. If a connection profile exists, but does not match the specfied configuration, then the connection profile will be updated, if it can be. If it cannot be updated, it will be removed and re-created with the specified configuration.Type: strDefault value:present
- name
The name of this connection profile.
Only required when state is
present
.Type: str- path (required)
The path to the JSON file where the connection profile will be stored.
- organization
The organization for this connection profile.
Only required when state is
present
.- certificate_authority
The certificate authority to reference in this connection profile.
You can pass a string, which is the display name of a certificate authority registered with the IBM Blockchain Platform console.
You can also pass a dictionary, which must match the result format of one of the ERROR while parsing: While parsing “M(certificate_authority_info)” at index 82: Module name “certificate_authority_info” is not a FQCN or ERROR while parsing: While parsing “M(certificate_authority)” at index 115: Module name “certificate_authority” is not a FQCN modules.
Type: raw- peers
The peers to reference in this connection profile.
You can pass strings, which are the display names of peers registered with the IBM Blockchain Platform console.
You can also pass dictionaries, which must match the result format of one of the ERROR while parsing: While parsing “M(peer_info)” at index 82: Module name “peer_info” is not a FQCN or ERROR while parsing: While parsing “M(peer)” at index 98: Module name “peer” is not a FQCN modules.
Only required when state is
present
.Type: listElements: raw
Examples
- name: Create a connection profile
ibm.blockchain_platform.connection_profile:
state: present
api_endpoint: https://ibp-console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Org1 Gateway
path: Org1 Gateway.json
organization: Org1
certificate_authority: Org1 CA
peers:
- Org1 Peer
- name: Delete a connection profile
ibm.blockchain_platform.connection_profile:
state: absent
api_endpoint: https://ibp-console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
path: Org1 Gateway.json