commands.add_domains_and_devices

Adds Issuing CAs, Domains and Devices with different onboarding protocols.

Module Contents

commands.add_domains_and_devices.get_random_no_onboarding_pki_protocols()[source]

Gets random allowed PkiProtocols.

Parameters:

include_protocol – This protocol will be included in the allowed list.

Returns:

A list of PkiProtocols.

Return type:

list[onboarding.models.NoOnboardingPkiProtocol]

commands.add_domains_and_devices.get_random_onboarding_pki_protocols(include_protocol=None)[source]

Gets random allowed PkiProtocols.

Parameters:

include_protocol (onboarding.models.OnboardingPkiProtocol | None) – This protocol will be included in the allowed list.

Returns:

A list of PkiProtocols.

Return type:

list[onboarding.models.OnboardingPkiProtocol]

commands.add_domains_and_devices.create_signer_for_domain(domain_name, issuing_ca)[source]

Creates a signer certificate for a domain using the domain’s issuing CA.

Parameters:
  • domain_name (str)

  • issuing_ca (pki.models.CaModel)

Return type:

signer.models.SignerModel

class commands.add_domains_and_devices.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: django.core.management.base.BaseCommand, trustpoint.logger.LoggerMixin

Add domains and associated device names with random onboarding protocol and serial number.

help = 'Add domains and associated device names with random onboarding protocol and serial number'[source]
log_and_stdout(message, level='info')[source]

Log a message and write it to stdout.

Parameters:
  • message (str) – The message to log and print.

  • level (str) – The logging level (‘info’, ‘warning’, ‘error’, etc.).

Return type:

None

handle(*_args, **_kwargs)[source]

Execute the command.

Parameters:
  • _args (tuple[str])

  • _kwargs (dict[str, str])

Return type:

None