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(name, region='', description='', metadata='', http_endpoint_configuration_id=None, https_endpoint_configuration_id=None, certificate_id=None, certificate_management_policy=None)[source]

Create a new reserved domain.

Parameters
  • name (str) – the domain name to reserve. It may be a full domain name like app.example.com. If the name does not contain a ‘.’ it will reserve that subdomain on ngrok.io.

  • 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.

  • http_endpoint_configuration_id (Optional[str]) – ID of an endpoint configuration of type http that will be used to handle inbound http traffic to this domain

  • https_endpoint_configuration_id (Optional[str]) – ID of an endpoint configuration of type https that will be used to handle inbound https traffic to this domain

  • certificate_id (Optional[str]) – 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]) – 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

delete_http_endpoint_config(id)[source]

Detach the http endpoint configuration attached to a reserved domain.

Parameters

id (str) – a resource identifier

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

delete_https_endpoint_config(id)[source]

Detach the https endpoint configuration attached to a reserved domain.

Parameters

id (str) – a resource identifier

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

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]) –

  • limit (Optional[str]) –

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

Return type

ReservedDomainList

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

Update the attributes of a reserved domain.

Parameters
  • id (str) –

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

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

  • http_endpoint_configuration_id (Optional[str]) – ID of an endpoint configuration of type http that will be used to handle inbound http traffic to this domain

  • https_endpoint_configuration_id (Optional[str]) – ID of an endpoint configuration of type https that will be used to handle inbound https traffic to this domain

  • certificate_id (Optional[str]) – 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]) – 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