Class: CWlogsIO::Client
- Inherits:
-
Object
- Object
- CWlogsIO::Client
- Defined in:
- lib/cwlogs_io/client.rb
Instance Method Summary collapse
- #create_log_group ⇒ Object
- #create_log_stream ⇒ Object
-
#initialize(auth, log_group, log_stream) ⇒ Client
constructor
A new instance of Client.
- #put_log_events(log_events) ⇒ Object
Constructor Details
#initialize(auth, log_group, log_stream) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 |
# File 'lib/cwlogs_io/client.rb', line 7 def initialize(auth, log_group, log_stream) @auth = auth @log_group = log_group @log_stream = log_stream end |
Instance Method Details
#create_log_group ⇒ Object
13 14 15 |
# File 'lib/cwlogs_io/client.rb', line 13 def create_log_group client.create_log_group({ log_group_name: @log_group }) end |
#create_log_stream ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/cwlogs_io/client.rb', line 17 def create_log_stream client.create_log_stream( { log_group_name: @log_group, log_stream_name: @log_stream, } ) end |
#put_log_events(log_events) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/cwlogs_io/client.rb', line 26 def put_log_events(log_events) client.put_log_events( { log_events: to_params(log_events), log_group_name: @log_group, log_stream_name: @log_stream, } ) end |