Class: OpenObserve::Api::Api::Dashboards
- Inherits:
-
Object
- Object
- OpenObserve::Api::Api::Dashboards
- Defined in:
- lib/openobserve-api/api/api/dashboards.rb
Instance Method Summary collapse
- #annotations(start_time:, end_time:, org_id:, dashboard_id:, panels: nil) ⇒ Object
- #annotations_delete(org_id:, dashboard_id:, delete_annotations_request:) ⇒ Object
- #annotations_panels(org_id:, dashboard_id:, timed_annotation_id:, request_body:) ⇒ Object
- #annotations_post(org_id:, dashboard_id:, create_annotations_request:) ⇒ Object
- #annotations_put(org_id:, dashboard_id:, timed_annotation_id:, update_annotations_request:) ⇒ Object
- #create(org_id:, dashboard:, folder: nil) ⇒ Object
- #delete(org_id:, dashboard_id:, folder: nil) ⇒ Object
- #get(org_id:, dashboard_id:, folder: nil) ⇒ Object
-
#initialize(connection) ⇒ Dashboards
constructor
A new instance of Dashboards.
- #list(org_id:, folder: nil, title: nil, page_size: nil) ⇒ Object
- #move(org_id:, move_dashboards_request:) ⇒ Object
- #panels(org_id:, dashboard_id:, hash:, add_panel_request:, folder: nil) ⇒ Object
- #panels_delete(org_id:, dashboard_id:, panel_id:, hash:, folder: nil, tab_id: nil) ⇒ Object
- #panels_put(org_id:, dashboard_id:, panel_id:, hash:, add_panel_request:, folder: nil) ⇒ Object
- #update(org_id:, dashboard_id:, folder:, dashboard:, hash: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Dashboards
Returns a new instance of Dashboards.
5 6 7 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#annotations(start_time:, end_time:, org_id:, dashboard_id:, panels: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 9 def annotations(start_time:, end_time:, org_id:, dashboard_id:, panels: nil) raise ArgumentError, 'start_time is required' if start_time.nil? raise ArgumentError, 'end_time is required' if end_time.nil? raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? @connection.call( :GET, '/api/{org_id}/dashboards/{dashboard_id}/annotations' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: [OpenObserve::Api::Models::TimedAnnotation], auth: ['Authorization'], query: { 'panels' => panels, 'start_time' => start_time, 'end_time' => end_time } ) end |
#annotations_delete(org_id:, dashboard_id:, delete_annotations_request:) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 26 def annotations_delete(org_id:, dashboard_id:, delete_annotations_request:) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'delete_annotations_request is required' if delete_annotations_request.nil? @connection.call( :DELETE, '/api/{org_id}/dashboards/{dashboard_id}/annotations' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: nil, auth: ['Authorization'], body: delete_annotations_request ) end |
#annotations_panels(org_id:, dashboard_id:, timed_annotation_id:, request_body:) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 42 def annotations_panels(org_id:, dashboard_id:, timed_annotation_id:, request_body:) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'timed_annotation_id is required' if timed_annotation_id.nil? raise ArgumentError, 'request_body is required' if request_body.nil? @connection.call( :DELETE, '/api/{org_id}/dashboards/{dashboard_id}/annotations/panels/{timed_annotation_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)) .gsub('{timed_annotation_id}', ERB::Util.url_encode(timed_annotation_id.to_s)), type: nil, auth: ['Authorization'], body: request_body ) end |
#annotations_post(org_id:, dashboard_id:, create_annotations_request:) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 60 def annotations_post(org_id:, dashboard_id:, create_annotations_request:) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'create_annotations_request is required' if create_annotations_request.nil? @connection.call( :POST, '/api/{org_id}/dashboards/{dashboard_id}/annotations' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: [OpenObserve::Api::Models::TimedAnnotation], auth: ['Authorization'], body: create_annotations_request ) end |
#annotations_put(org_id:, dashboard_id:, timed_annotation_id:, update_annotations_request:) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 76 def annotations_put(org_id:, dashboard_id:, timed_annotation_id:, update_annotations_request:) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'timed_annotation_id is required' if timed_annotation_id.nil? raise ArgumentError, 'update_annotations_request is required' if update_annotations_request.nil? @connection.call( :PUT, '/api/{org_id}/dashboards/{dashboard_id}/annotations/{timed_annotation_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)) .gsub('{timed_annotation_id}', ERB::Util.url_encode(timed_annotation_id.to_s)), type: nil, auth: ['Authorization'], body: update_annotations_request ) end |
#create(org_id:, dashboard:, folder: nil) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 94 def create(org_id:, dashboard:, folder: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard is required' if dashboard.nil? @connection.call( :POST, '/api/{org_id}/dashboards' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)), type: OpenObserve::Api::Models::Dashboard, auth: ['Authorization'], query: { 'folder' => folder }, body: dashboard ) end |
#delete(org_id:, dashboard_id:, folder: nil) ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 109 def delete(org_id:, dashboard_id:, folder: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? @connection.call( :DELETE, '/api/{org_id}/dashboards/{dashboard_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: nil, auth: ['Authorization'], query: { 'folder' => folder } ) end |
#get(org_id:, dashboard_id:, folder: nil) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 124 def get(org_id:, dashboard_id:, folder: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? @connection.call( :GET, '/api/{org_id}/dashboards/{dashboard_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: OpenObserve::Api::Models::Dashboard, auth: ['Authorization'], query: { 'folder' => folder } ) end |
#list(org_id:, folder: nil, title: nil, page_size: nil) ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 139 def list(org_id:, folder: nil, title: nil, page_size: nil) raise ArgumentError, 'org_id is required' if org_id.nil? @connection.call( :GET, '/api/{org_id}/dashboards' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)), type: OpenObserve::Api::Models::ListDashboards200Response, auth: ['Authorization'], query: { 'folder' => folder, 'title' => title, 'pageSize' => page_size } ) end |
#move(org_id:, move_dashboards_request:) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 152 def move(org_id:, move_dashboards_request:) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'move_dashboards_request is required' if move_dashboards_request.nil? @connection.call( :PATCH, '/api/{org_id}/dashboards/move' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)), type: nil, auth: ['Authorization'], body: move_dashboards_request ) end |
#panels(org_id:, dashboard_id:, hash:, add_panel_request:, folder: nil) ⇒ Object
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 166 def panels(org_id:, dashboard_id:, hash:, add_panel_request:, folder: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'hash is required' if hash.nil? raise ArgumentError, 'add_panel_request is required' if add_panel_request.nil? @connection.call( :POST, '/api/{org_id}/dashboards/{dashboard_id}/panels' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: OpenObserve::Api::Models::AddPanel200Response, auth: ['Authorization'], query: { 'folder' => folder, 'hash' => hash }, body: add_panel_request ) end |
#panels_delete(org_id:, dashboard_id:, panel_id:, hash:, folder: nil, tab_id: nil) ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 184 def panels_delete(org_id:, dashboard_id:, panel_id:, hash:, folder: nil, tab_id: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'panel_id is required' if panel_id.nil? raise ArgumentError, 'hash is required' if hash.nil? @connection.call( :DELETE, '/api/{org_id}/dashboards/{dashboard_id}/panels/{panel_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)) .gsub('{panel_id}', ERB::Util.url_encode(panel_id.to_s)), type: OpenObserve::Api::Models::DeletePanel200Response, auth: ['Authorization'], query: { 'folder' => folder, 'hash' => hash, 'tabId' => tab_id } ) end |
#panels_put(org_id:, dashboard_id:, panel_id:, hash:, add_panel_request:, folder: nil) ⇒ Object
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 202 def panels_put(org_id:, dashboard_id:, panel_id:, hash:, add_panel_request:, folder: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'panel_id is required' if panel_id.nil? raise ArgumentError, 'hash is required' if hash.nil? raise ArgumentError, 'add_panel_request is required' if add_panel_request.nil? @connection.call( :PUT, '/api/{org_id}/dashboards/{dashboard_id}/panels/{panel_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)) .gsub('{panel_id}', ERB::Util.url_encode(panel_id.to_s)), type: OpenObserve::Api::Models::AddPanel200Response, auth: ['Authorization'], query: { 'folder' => folder, 'hash' => hash }, body: add_panel_request ) end |
#update(org_id:, dashboard_id:, folder:, dashboard:, hash: nil) ⇒ Object
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/openobserve-api/api/api/dashboards.rb', line 222 def update(org_id:, dashboard_id:, folder:, dashboard:, hash: nil) raise ArgumentError, 'org_id is required' if org_id.nil? raise ArgumentError, 'dashboard_id is required' if dashboard_id.nil? raise ArgumentError, 'folder is required' if folder.nil? raise ArgumentError, 'dashboard is required' if dashboard.nil? @connection.call( :PUT, '/api/{org_id}/dashboards/{dashboard_id}' .gsub('{org_id}', ERB::Util.url_encode(org_id.to_s)) .gsub('{dashboard_id}', ERB::Util.url_encode(dashboard_id.to_s)), type: OpenObserve::Api::Models::Dashboard, auth: ['Authorization'], query: { 'folder' => folder, 'hash' => hash }, body: dashboard ) end |