Class: Aliyun::Log::Logstore

Inherits:
Common::AttrStruct show all
Defined in:
lib/aliyun/log/logstore.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Common::AttrStruct

#to_s

Methods included from Common::AttrStruct::AttrHelper

#attrs

Constructor Details

#initialize(opts, protocol) ⇒ Logstore

Returns a new instance of Logstore.



9
10
11
12
# File 'lib/aliyun/log/logstore.rb', line 9

def initialize(opts, protocol)
  super(opts)
  @protocol = protocol
end

Class Method Details

.from_json(attrs, protocol) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/aliyun/log/logstore.rb', line 14

def self.from_json(attrs, protocol)
  new({
        name: attrs['logstoreName'],
        project_name: attrs['projectName'],
        ttl: attrs['ttl'],
        shared_count: attrs['shardCount'],
        enable_tracking: attrs['enable_tracking'],
        auto_split: attrs['autoSplit'],
        max_split_shard: attrs['maxSplitShard'],
        create_time: attrs['createTime'],
        last_modify_time: attrs['lastModifyTime']
      }, protocol)
end

Instance Method Details

#create_index(fields) ⇒ Object



56
57
58
# File 'lib/aliyun/log/logstore.rb', line 56

def create_index(fields)
  @protocol.create_index(project_name, name, fields)
end

#create_index_line(token = nil) ⇒ Object



52
53
54
# File 'lib/aliyun/log/logstore.rb', line 52

def create_index_line(token = nil)
  @protocol.create_index_line(project_name, name, token)
end

#delete_indexObject



64
65
66
# File 'lib/aliyun/log/logstore.rb', line 64

def delete_index
  @protocol.delete_index(project_name, name)
end

#get_histograms(opts = {}) ⇒ Object



40
41
42
# File 'lib/aliyun/log/logstore.rb', line 40

def get_histograms(opts = {})
  @protocol.get_histograms(project_name, name, opts)
end

#get_indexObject



48
49
50
# File 'lib/aliyun/log/logstore.rb', line 48

def get_index
  @protocol.get_index(project_name, name)
end

#get_logs(opts = {}) ⇒ Object



36
37
38
# File 'lib/aliyun/log/logstore.rb', line 36

def get_logs(opts = {})
  @protocol.get_logs(project_name, name, opts)
end

#list_topics(opts = {}) ⇒ Object



44
45
46
# File 'lib/aliyun/log/logstore.rb', line 44

def list_topics(opts = {})
  @protocol.list_topics(project_name, name, opts)
end

#put_log(attributes) ⇒ Object



32
33
34
# File 'lib/aliyun/log/logstore.rb', line 32

def put_log(attributes)
  @protocol.put_log(project_name, name, attributes)
end

#put_logs(content) ⇒ Object



28
29
30
# File 'lib/aliyun/log/logstore.rb', line 28

def put_logs(content)
  @protocol.put_logs(project_name, name, content)
end

#update_index(fields) ⇒ Object



60
61
62
# File 'lib/aliyun/log/logstore.rb', line 60

def update_index(fields)
  @protocol.update_index(project_name, name, fields)
end