Reserved Domains#

Do not construct this object directly, instead access the reserved_domains property of an ngrok.Client object.

class ngrok.services.ReservedDomainsClient(client)[source]#

Reserved Domains are hostnames that you can listen for traffic on. Domains can be used to listen for http, https or tls traffic. You may use a domain that you own by creating a CNAME record specified in the returned resource. This CNAME record points traffic for that domain to ngrok’s edge servers.

create(domain='', region='', description='', metadata='', certificate_id=None, certificate_management_policy=None)[source]#

Create a new reserved domain.

Parameters:
  • domain (str) – hostname of the reserved domain

  • region (str) – reserve the domain in this geographic ngrok datacenter. Optional, default is us. (au, eu, ap, us, jp, in, sa)

  • description (str) – human-readable description of what this reserved domain will be used for

  • metadata (str) – arbitrary user-defined machine-readable data of this reserved domain. Optional, max 4096 bytes.

  • certificate_id (Optional[str, None]) – ID of a user-uploaded TLS certificate to use for connections to targeting this domain. Optional, mutually exclusive with certificate_management_policy.

  • certificate_management_policy (Optional[ReservedDomainCertPolicy, None]) – configuration for automatic management of TLS certificates for this domain, or null if automatic management is disabled. Optional, mutually exclusive with certificate_id.

https://ngrok.com/docs/api#api-reserved-domains-create

Return type:

ReservedDomain

delete(id)[source]#

Delete a reserved domain.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-reserved-domains-delete

delete_certificate(id)[source]#

Detach the certificate attached to a reserved domain.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-reserved-domains-delete-certificate

delete_certificate_management_policy(id)[source]#

Detach the certificate management policy attached to a reserved domain.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-reserved-domains-delete-certificate-management-policy

get(id)[source]#

Get the details of a reserved domain.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-reserved-domains-get

Return type:

ReservedDomain

list(before_id=None, limit=None)[source]#

List all reserved domains on this account.

Parameters:
  • before_id (Optional[str, None]) –

  • limit (Optional[str, None]) –

https://ngrok.com/docs/api#api-reserved-domains-list

Return type:

ReservedDomainList

update(id, description=None, metadata=None, certificate_id=None, certificate_management_policy=None)[source]#

Update the attributes of a reserved domain.

Parameters:
  • id (str) –

  • description (Optional[str, None]) – human-readable description of what this reserved domain will be used for

  • metadata (Optional[str, None]) – arbitrary user-defined machine-readable data of this reserved domain. Optional, max 4096 bytes.

  • certificate_id (Optional[str, None]) – ID of a user-uploaded TLS certificate to use for connections to targeting this domain. Optional, mutually exclusive with certificate_management_policy.

  • certificate_management_policy (Optional[ReservedDomainCertPolicy, None]) – configuration for automatic management of TLS certificates for this domain, or null if automatic management is disabled. Optional, mutually exclusive with certificate_id.

https://ngrok.com/docs/api#api-reserved-domains-update

Return type:

ReservedDomain