2121from linode_api4 .objects .monitor import (
2222 AkamaiObjectStorageLogsDestinationDetails ,
2323 CustomHTTPSLogsDestinationDetails ,
24+ LogsStreamDetails ,
2425)
2526
2627__all__ = [
@@ -475,34 +476,49 @@ def stream_create(
475476 label : str ,
476477 type : Union [LogsStreamType , str ],
477478 status : Optional [Union [LogsStreamStatus , str ]] = None ,
479+ details : Optional [LogsStreamDetails ] = None ,
478480 ) -> LogsStream :
479481 """
480- Creates a new :any:`LogsStream` for logs on this account with
481- the given label, type, and object storage details. For example::
482+ Creates a new :any:`LogsStream` for logs on this account. For example::
482483
483484 client = LinodeClient(TOKEN)
484485
486+ # audit_logs stream (no details required)
485487 new_stream = client.monitor.stream_create(
486- destinations= [1234],
488+ destinations=[1234],
487489 label="Linode_services",
488490 status="active",
489491 type="audit_logs"
490- )
492+ )
493+
494+ # lke_audit_logs stream with specific clusters
495+ lke_stream = client.monitor.stream_create(
496+ destinations=[1234],
497+ label="LKE_audit_stream",
498+ type="lke_audit_logs",
499+ details=LogsStreamDetails(
500+ cluster_ids=[1111, 2222],
501+ is_auto_add_all_clusters_enabled=False,
502+ )
503+ )
491504
492505 API Documentation: https://techdocs.akamai.com/linode-api/reference/post-stream
493506
494- :param destinations: List of unique identifiers for the sync points that will receive logs data.
507+ :param destinations: The unique identifier for the sync point that will receive logs data.
495508 Run the List destinations operation and store the id values for each applicable destination.
496509 At the moment only single destination is supported.
497510 :type destinations: list[int]
498511 :param label: The name of the stream. This is used for display purposes in Akamai Cloud Manager.
499512 :type label: str
500- :param type: The type of stream. Set this to ``audit_logs`` for logs consisting of all the control plane
501- operations for the services in your Linodes .
502- :type type: str
513+ :param type: The type of stream — ``audit_logs`` for Linode control plane logs,
514+ or ``lke_audit_logs`` for LKE enterprise cluster audit logs .
515+ :type type: str or LogsStreamType
503516 :param status: (Optional) The availability status of the stream. Possible values are: ``active``, ``inactive``.
504517 Defaults to ``active``.
505518 :type status: str
519+ :param details: (Optional) Additional stream details. Only applicable for
520+ ``lke_audit_logs`` streams. Omit for ``audit_logs`` streams.
521+ :type details: LogsStreamDetails
506522
507523 :returns: The newly created logs stream.
508524 :rtype: LogsStream
@@ -517,6 +533,9 @@ def stream_create(
517533 if status is not None :
518534 params ["status" ] = status
519535
536+ if details is not None :
537+ params ["details" ] = details .dict
538+
520539 result = self .client .post ("/monitor/streams" , data = params )
521540
522541 if "id" not in result :
0 commit comments