hfc.fabric_ca.affiliationService

Module Contents

Classes

AffiliationService(client)

hfc.fabric_ca.affiliationService._logger
class hfc.fabric_ca.affiliationService.AffiliationService(client)

Bases: object

create(self, registrar, name, caname='', force=False)

Create a new affiliation. The caller must have hf.AffiliationMgr authority.

If any of the parent affiliations do not exist and ‘force’ is true, create all parent affiliations also.

Parameters
  • registrar – Required. The identity of the registrar (i.e. who is performing the registration)

  • name – The affiliation path to create

  • caname – Optional. Name of the CA to send the request to within the Fabric CA server (Default value = ‘’)

  • force – Optional. (Default value = False)

Raises
  • RequestException – errors in requests.exceptions

  • ValueError – Failed response, json parse error, args missing

Returns

result

getOne(self, affiliation, registrar)

List a specific affiliation at or below the caller’s affinity. The caller must have hf.AffiliationMgr authority.

Parameters
  • affiliation – The affiliation path to be queried.

  • registrar – Required. The identity of the registrar (i.e. who is performing the registration)

Raises
  • RequestException – errors in requests.exceptions

  • ValueError – Failed response, json parse error, args missing

Returns

result

getAll(self, registrar)

List all affiliations equal to and below the caller’s affiliation. The caller must have hf.AffiliationMgr authority.

Parameters

registrar – Required. The identity of the registrar (i.e. who is performing the registration)

Returns

result

Raises
  • RequestException – errors in requests.exceptions

  • ValueError – Failed response, json parse error, args missing

delete(self, affiliation, registrar, force=False)

Delete an affiliation. The caller must have hf.AffiliationMgr authority. Ca server must have cfg.affiliations.allowremove: true

If force is true and there are any child affiliations or any identities are associated with this affiliation or child affiliations, these

identities and child affiliations

will be deleted; otherwise, an error is returned.

Parameters
  • affiliation – affiliation

  • registrar – Required. The identity of the registrar (i.e. who is performing the registration)

  • force – (Default value = False)

Returns

result

Raises
  • RequestException – errors in requests.exceptions

  • ValueError – Failed response, json parse error, args missing

update(self, affiliation, registrar, name, caname='', force=False)

Rename an affiliation. The caller must have hf.AffiliationMgr authority.

If any identities are associated with this affiliation, ‘force’ is true causes these identities’ affiliations to be renamed; otherwise, an error is returned.

Parameters
  • affiliation – The affiliation path to be updated.

  • registrar – Required. The identity of the registrar (i.e. who is performing the registration)

  • name – The affiliation path to create

  • caname – Optional. Name of the CA to send the request to within the Fabric CA server (Default value = ‘’)

  • force – Optional. (Default value = False)

Returns

result

Raises
  • RequestException – errors in requests.exceptions

  • ValueError – Failed response, json parse error, args missing