Event Streams

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

class ngrok.services.EventStreamsClient(client)[source]
create(metadata='', description='', fields=[], event_type='', destination_ids=[], sampling_rate=0)[source]

Create a new Event Stream. It will not apply to anything until you associate it with one or more Endpoint Configs.

Parameters
  • metadata (str) – Arbitrary user-defined machine-readable data of this Event Stream. Optional, max 4096 bytes.

  • description (str) – Human-readable description of the Event Stream. Optional, max 255 bytes.

  • fields (Sequence[str]) – A list of protocol-specific fields you want to collect on each event.

  • event_type (str) – The protocol that determines which events will be collected. Supported values are tcp_connection_closed and http_request_complete.

  • destination_ids (Sequence[str]) – A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.

  • sampling_rate (float) – The percentage of all events you would like to capture. Valid values range from 0.01, representing 1% of all events to 1.00, representing 100% of all events.

https://ngrok.com/docs/api#api-event-streams-create

Return type

EventStream

delete(id)[source]

Delete an Event Stream. Associated Event Destinations will be preserved.

Parameters

id (str) – a resource identifier

https://ngrok.com/docs/api#api-event-streams-delete

get(id)[source]

Get detailed information about an Event Stream by ID.

Parameters

id (str) – a resource identifier

https://ngrok.com/docs/api#api-event-streams-get

Return type

EventStream

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

List all Event Streams available on this account.

Parameters
  • before_id (Optional[str]) –

  • limit (Optional[str]) –

https://ngrok.com/docs/api#api-event-streams-list

Return type

EventStreamList

update(id, metadata=None, description=None, fields=None, destination_ids=None, sampling_rate=None)[source]

Update attributes of an Event Stream by ID.

Parameters
  • id (str) – Unique identifier for this Event Stream.

  • metadata (Optional[str]) – Arbitrary user-defined machine-readable data of this Event Stream. Optional, max 4096 bytes.

  • description (Optional[str]) – Human-readable description of the Event Stream. Optional, max 255 bytes.

  • fields (Optional[Sequence[str]]) – A list of protocol-specific fields you want to collect on each event.

  • destination_ids (Optional[Sequence[str]]) – A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.

  • sampling_rate (Optional[float]) – The percentage of all events you would like to capture. Valid values range from 0.01, representing 1% of all events to 1.00, representing 100% of all events.

https://ngrok.com/docs/api#api-event-streams-update

Return type

EventStream