SematextCloud 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +13 -0
  4. data/README.md +149 -0
  5. data/Rakefile +8 -0
  6. data/SematextCloud.gemspec +45 -0
  7. data/docs/AlertNotificationRequest.md +9 -0
  8. data/docs/AlertNotificationsApi.md +118 -0
  9. data/docs/AlertRule.md +53 -0
  10. data/docs/AlertRuleScheduleTimeRangeDto.md +7 -0
  11. data/docs/AlertRuleScheduleWeekdayDto.md +10 -0
  12. data/docs/AlertsApi.md +270 -0
  13. data/docs/App.md +32 -0
  14. data/docs/AppDescription.md +6 -0
  15. data/docs/AppMetadata.md +10 -0
  16. data/docs/AppsApi.md +369 -0
  17. data/docs/AwsSettingsControllerApi.md +63 -0
  18. data/docs/BasicAuthMethodDto.md +7 -0
  19. data/docs/BasicOrganizationDto.md +9 -0
  20. data/docs/BillingApi.md +176 -0
  21. data/docs/BillingInfo.md +8 -0
  22. data/docs/CloudWatchSettings.md +9 -0
  23. data/docs/CreateAppInfo.md +10 -0
  24. data/docs/DataSeriesFilter.md +8 -0
  25. data/docs/DataSeriesRequest.md +12 -0
  26. data/docs/Error.md +7 -0
  27. data/docs/FilterValue.md +11 -0
  28. data/docs/GenericApiResponse.md +9 -0
  29. data/docs/Invitation.md +15 -0
  30. data/docs/LogsAppApi.md +58 -0
  31. data/docs/MetricsApi.md +227 -0
  32. data/docs/MonitoringAppApi.md +58 -0
  33. data/docs/NotificationIntegration.md +15 -0
  34. data/docs/Plan.md +18 -0
  35. data/docs/ReportInfo.md +13 -0
  36. data/docs/ResetPasswordApi.md +58 -0
  37. data/docs/SavedQueriesApi.md +220 -0
  38. data/docs/SavedQuery.md +18 -0
  39. data/docs/ServiceIntegration.md +17 -0
  40. data/docs/SubscriptionsApi.md +114 -0
  41. data/docs/TagApiControllerApi.md +212 -0
  42. data/docs/UpdateAppInfo.md +14 -0
  43. data/docs/UserInfo.md +6 -0
  44. data/docs/UserPermissions.md +8 -0
  45. data/docs/UserRole.md +8 -0
  46. data/lib/SematextCloud.rb +78 -0
  47. data/lib/SematextCloud/api/alert_notifications_api.rb +137 -0
  48. data/lib/SematextCloud/api/alerts_api.rb +283 -0
  49. data/lib/SematextCloud/api/apps_api.rb +381 -0
  50. data/lib/SematextCloud/api/aws_settings_controller_api.rb +83 -0
  51. data/lib/SematextCloud/api/billing_api.rb +197 -0
  52. data/lib/SematextCloud/api/logs_app_api.rb +75 -0
  53. data/lib/SematextCloud/api/metrics_api.rb +247 -0
  54. data/lib/SematextCloud/api/monitoring_app_api.rb +75 -0
  55. data/lib/SematextCloud/api/reset_password_api.rb +75 -0
  56. data/lib/SematextCloud/api/saved_queries_api.rb +237 -0
  57. data/lib/SematextCloud/api/subscriptions_api.rb +133 -0
  58. data/lib/SematextCloud/api/tag_api_controller_api.rb +247 -0
  59. data/lib/SematextCloud/api_client.rb +389 -0
  60. data/lib/SematextCloud/api_error.rb +38 -0
  61. data/lib/SematextCloud/configuration.rb +209 -0
  62. data/lib/SematextCloud/models/alert_notification_request.rb +212 -0
  63. data/lib/SematextCloud/models/alert_rule.rb +652 -0
  64. data/lib/SematextCloud/models/alert_rule_schedule_time_range_dto.rb +192 -0
  65. data/lib/SematextCloud/models/alert_rule_schedule_weekday_dto.rb +221 -0
  66. data/lib/SematextCloud/models/app.rb +419 -0
  67. data/lib/SematextCloud/models/app_description.rb +183 -0
  68. data/lib/SematextCloud/models/app_metadata.rb +268 -0
  69. data/lib/SematextCloud/models/basic_auth_method_dto.rb +226 -0
  70. data/lib/SematextCloud/models/basic_organization_dto.rb +246 -0
  71. data/lib/SematextCloud/models/billing_info.rb +201 -0
  72. data/lib/SematextCloud/models/cloud_watch_settings.rb +256 -0
  73. data/lib/SematextCloud/models/create_app_info.rb +220 -0
  74. data/lib/SematextCloud/models/data_series_filter.rb +237 -0
  75. data/lib/SematextCloud/models/data_series_request.rb +283 -0
  76. data/lib/SematextCloud/models/error.rb +192 -0
  77. data/lib/SematextCloud/models/filter_value.rb +230 -0
  78. data/lib/SematextCloud/models/generic_api_response.rb +214 -0
  79. data/lib/SematextCloud/models/invitation.rb +326 -0
  80. data/lib/SematextCloud/models/notification_integration.rb +324 -0
  81. data/lib/SematextCloud/models/plan.rb +337 -0
  82. data/lib/SematextCloud/models/report_info.rb +247 -0
  83. data/lib/SematextCloud/models/saved_query.rb +291 -0
  84. data/lib/SematextCloud/models/service_integration.rb +282 -0
  85. data/lib/SematextCloud/models/update_app_info.rb +289 -0
  86. data/lib/SematextCloud/models/user_info.rb +183 -0
  87. data/lib/SematextCloud/models/user_permissions.rb +201 -0
  88. data/lib/SematextCloud/models/user_role.rb +247 -0
  89. data/lib/SematextCloud/version.rb +15 -0
  90. data/spec/api/alert_notifications_api_spec.rb +60 -0
  91. data/spec/api/alerts_api_spec.rb +90 -0
  92. data/spec/api/apps_api_spec.rb +113 -0
  93. data/spec/api/aws_settings_controller_api_spec.rb +48 -0
  94. data/spec/api/billing_api_spec.rb +72 -0
  95. data/spec/api/logs_app_api_spec.rb +46 -0
  96. data/spec/api/metrics_api_spec.rb +83 -0
  97. data/spec/api/monitoring_app_api_spec.rb +46 -0
  98. data/spec/api/reset_password_api_spec.rb +46 -0
  99. data/spec/api/saved_queries_api_spec.rb +80 -0
  100. data/spec/api/subscriptions_api_spec.rb +58 -0
  101. data/spec/api/tag_api_controller_api_spec.rb +88 -0
  102. data/spec/api_client_spec.rb +226 -0
  103. data/spec/configuration_spec.rb +42 -0
  104. data/spec/models/alert_notification_request_spec.rb +59 -0
  105. data/spec/models/alert_rule_schedule_time_range_dto_spec.rb +47 -0
  106. data/spec/models/alert_rule_schedule_weekday_dto_spec.rb +65 -0
  107. data/spec/models/alert_rule_spec.rb +327 -0
  108. data/spec/models/app_description_spec.rb +41 -0
  109. data/spec/models/app_metadata_spec.rb +77 -0
  110. data/spec/models/app_spec.rb +197 -0
  111. data/spec/models/basic_auth_method_dto_spec.rb +51 -0
  112. data/spec/models/basic_organization_dto_spec.rb +63 -0
  113. data/spec/models/billing_info_spec.rb +53 -0
  114. data/spec/models/cloud_watch_settings_spec.rb +67 -0
  115. data/spec/models/create_app_info_spec.rb +65 -0
  116. data/spec/models/data_series_filter_spec.rb +57 -0
  117. data/spec/models/data_series_request_spec.rb +81 -0
  118. data/spec/models/error_spec.rb +47 -0
  119. data/spec/models/filter_value_spec.rb +71 -0
  120. data/spec/models/generic_api_response_spec.rb +59 -0
  121. data/spec/models/invitation_spec.rb +107 -0
  122. data/spec/models/notification_integration_spec.rb +107 -0
  123. data/spec/models/plan_spec.rb +121 -0
  124. data/spec/models/report_info_spec.rb +83 -0
  125. data/spec/models/saved_query_spec.rb +113 -0
  126. data/spec/models/service_integration_spec.rb +107 -0
  127. data/spec/models/update_app_info_spec.rb +93 -0
  128. data/spec/models/user_info_spec.rb +41 -0
  129. data/spec/models/user_permissions_spec.rb +53 -0
  130. data/spec/models/user_role_spec.rb +61 -0
  131. data/spec/spec_helper.rb +111 -0
  132. metadata +395 -0
@@ -0,0 +1,83 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module SematextCloud
16
+ class AwsSettingsControllerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Update App's AWS CloudWatch settings
23
+ # Applicable only for AWS Apps
24
+ # @param app_id appId
25
+ # @param dto dto
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [GenericApiResponse]
28
+ def update_using_put(app_id, dto, opts = {})
29
+ data, _status_code, _headers = update_using_put_with_http_info(app_id, dto, opts)
30
+ data
31
+ end
32
+
33
+ # Update App's AWS CloudWatch settings
34
+ # Applicable only for AWS Apps
35
+ # @param app_id appId
36
+ # @param dto dto
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
39
+ def update_using_put_with_http_info(app_id, dto, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: AwsSettingsControllerApi.update_using_put ...'
42
+ end
43
+ # verify the required parameter 'app_id' is set
44
+ if @api_client.config.client_side_validation && app_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling AwsSettingsControllerApi.update_using_put"
46
+ end
47
+ # verify the required parameter 'dto' is set
48
+ if @api_client.config.client_side_validation && dto.nil?
49
+ fail ArgumentError, "Missing the required parameter 'dto' when calling AwsSettingsControllerApi.update_using_put"
50
+ end
51
+ # resource path
52
+ local_var_path = '/users-web/api/v3/apps/{appId}/aws'.sub('{' + 'appId' + '}', app_id.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+
57
+ # header parameters
58
+ header_params = {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = {}
66
+
67
+ # http body (model)
68
+ post_body = @api_client.object_to_http_body(dto)
69
+ auth_names = ['api_key']
70
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => 'GenericApiResponse')
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: AwsSettingsControllerApi#update_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,197 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module SematextCloud
16
+ class BillingApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get invoice details
23
+ # @param service service
24
+ # @param year year
25
+ # @param month month
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [GenericApiResponse]
28
+ def get_detailed_invoice_using_get(service, year, month, opts = {})
29
+ data, _status_code, _headers = get_detailed_invoice_using_get_with_http_info(service, year, month, opts)
30
+ data
31
+ end
32
+
33
+ # Get invoice details
34
+ # @param service service
35
+ # @param year year
36
+ # @param month month
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
39
+ def get_detailed_invoice_using_get_with_http_info(service, year, month, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: BillingApi.get_detailed_invoice_using_get ...'
42
+ end
43
+ # verify the required parameter 'service' is set
44
+ if @api_client.config.client_side_validation && service.nil?
45
+ fail ArgumentError, "Missing the required parameter 'service' when calling BillingApi.get_detailed_invoice_using_get"
46
+ end
47
+ # verify the required parameter 'year' is set
48
+ if @api_client.config.client_side_validation && year.nil?
49
+ fail ArgumentError, "Missing the required parameter 'year' when calling BillingApi.get_detailed_invoice_using_get"
50
+ end
51
+ # verify the required parameter 'month' is set
52
+ if @api_client.config.client_side_validation && month.nil?
53
+ fail ArgumentError, "Missing the required parameter 'month' when calling BillingApi.get_detailed_invoice_using_get"
54
+ end
55
+ # resource path
56
+ local_var_path = '/users-web/api/v3/billing/invoice/{service}/{year}/{month}'.sub('{' + 'service' + '}', service.to_s).sub('{' + 'year' + '}', year.to_s).sub('{' + 'month' + '}', month.to_s)
57
+
58
+ # query parameters
59
+ query_params = {}
60
+
61
+ # header parameters
62
+ header_params = {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+ # HTTP header 'Content-Type'
66
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = {}
70
+
71
+ # http body (model)
72
+ post_body = nil
73
+ auth_names = ['api_key']
74
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => 'GenericApiResponse')
81
+ if @api_client.config.debugging
82
+ @api_client.config.logger.debug "API called: BillingApi#get_detailed_invoice_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
83
+ end
84
+ return data, status_code, headers
85
+ end
86
+ # Get available plans
87
+ # @param [Hash] opts the optional parameters
88
+ # @option opts [Integer] :integration_id integrationId
89
+ # @option opts [String] :app_type appType
90
+ # @return [GenericApiResponse]
91
+ def list_available_plans_using_get(opts = {})
92
+ data, _status_code, _headers = list_available_plans_using_get_with_http_info(opts)
93
+ data
94
+ end
95
+
96
+ # Get available plans
97
+ # @param [Hash] opts the optional parameters
98
+ # @option opts [Integer] :integration_id integrationId
99
+ # @option opts [String] :app_type appType
100
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
101
+ def list_available_plans_using_get_with_http_info(opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: BillingApi.list_available_plans_using_get ...'
104
+ end
105
+ # resource path
106
+ local_var_path = '/users-web/api/v3/billing/availablePlans'
107
+
108
+ # query parameters
109
+ query_params = {}
110
+ query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil?
111
+ query_params[:'appType'] = opts[:'app_type'] if !opts[:'app_type'].nil?
112
+
113
+ # header parameters
114
+ header_params = {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
117
+ # HTTP header 'Content-Type'
118
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = {}
122
+
123
+ # http body (model)
124
+ post_body = nil
125
+ auth_names = ['api_key']
126
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => 'GenericApiResponse')
133
+ if @api_client.config.debugging
134
+ @api_client.config.logger.debug "API called: BillingApi#list_available_plans_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
135
+ end
136
+ return data, status_code, headers
137
+ end
138
+ # Update plan for an app
139
+ # @param app_id appId
140
+ # @param dto dto
141
+ # @param [Hash] opts the optional parameters
142
+ # @return [GenericApiResponse]
143
+ def update_plan_using_put(app_id, dto, opts = {})
144
+ data, _status_code, _headers = update_plan_using_put_with_http_info(app_id, dto, opts)
145
+ data
146
+ end
147
+
148
+ # Update plan for an app
149
+ # @param app_id appId
150
+ # @param dto dto
151
+ # @param [Hash] opts the optional parameters
152
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
153
+ def update_plan_using_put_with_http_info(app_id, dto, opts = {})
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug 'Calling API: BillingApi.update_plan_using_put ...'
156
+ end
157
+ # verify the required parameter 'app_id' is set
158
+ if @api_client.config.client_side_validation && app_id.nil?
159
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling BillingApi.update_plan_using_put"
160
+ end
161
+ # verify the required parameter 'dto' is set
162
+ if @api_client.config.client_side_validation && dto.nil?
163
+ fail ArgumentError, "Missing the required parameter 'dto' when calling BillingApi.update_plan_using_put"
164
+ end
165
+ # resource path
166
+ local_var_path = '/users-web/api/v3/billing/info/{appId}'.sub('{' + 'appId' + '}', app_id.to_s)
167
+
168
+ # query parameters
169
+ query_params = {}
170
+
171
+ # header parameters
172
+ header_params = {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+ # HTTP header 'Content-Type'
176
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
177
+
178
+ # form parameters
179
+ form_params = {}
180
+
181
+ # http body (model)
182
+ post_body = @api_client.object_to_http_body(dto)
183
+ auth_names = ['api_key']
184
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
185
+ :header_params => header_params,
186
+ :query_params => query_params,
187
+ :form_params => form_params,
188
+ :body => post_body,
189
+ :auth_names => auth_names,
190
+ :return_type => 'GenericApiResponse')
191
+ if @api_client.config.debugging
192
+ @api_client.config.logger.debug "API called: BillingApi#update_plan_using_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
193
+ end
194
+ return data, status_code, headers
195
+ end
196
+ end
197
+ end
@@ -0,0 +1,75 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module SematextCloud
16
+ class LogsAppApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Logs App
23
+ # @param application_details Details of the application to be created
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [GenericApiResponse]
26
+ def create_logsene_application(application_details, opts = {})
27
+ data, _status_code, _headers = create_logsene_application_with_http_info(application_details, opts)
28
+ data
29
+ end
30
+
31
+ # Create Logs App
32
+ # @param application_details Details of the application to be created
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
35
+ def create_logsene_application_with_http_info(application_details, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: LogsAppApi.create_logsene_application ...'
38
+ end
39
+ # verify the required parameter 'application_details' is set
40
+ if @api_client.config.client_side_validation && application_details.nil?
41
+ fail ArgumentError, "Missing the required parameter 'application_details' when calling LogsAppApi.create_logsene_application"
42
+ end
43
+ # resource path
44
+ local_var_path = '/logsene-reports/api/v3/apps'
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = @api_client.object_to_http_body(application_details)
61
+ auth_names = ['api_key']
62
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => 'GenericApiResponse')
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: LogsAppApi#create_logsene_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,247 @@
1
+ =begin
2
+ #Sematext Cloud API
3
+
4
+ #API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5
+
6
+ OpenAPI spec version: v3
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.12
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module SematextCloud
16
+ class MetricsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get metrics data points for an app
23
+ # Default value of interval is 5m
24
+ # @param app_id appId
25
+ # @param request_body Metric data points request
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [GenericApiResponse]
28
+ def list_data_series_using_post(app_id, request_body, opts = {})
29
+ data, _status_code, _headers = list_data_series_using_post_with_http_info(app_id, request_body, opts)
30
+ data
31
+ end
32
+
33
+ # Get metrics data points for an app
34
+ # Default value of interval is 5m
35
+ # @param app_id appId
36
+ # @param request_body Metric data points request
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
39
+ def list_data_series_using_post_with_http_info(app_id, request_body, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: MetricsApi.list_data_series_using_post ...'
42
+ end
43
+ # verify the required parameter 'app_id' is set
44
+ if @api_client.config.client_side_validation && app_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_data_series_using_post"
46
+ end
47
+ # verify the required parameter 'request_body' is set
48
+ if @api_client.config.client_side_validation && request_body.nil?
49
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling MetricsApi.list_data_series_using_post"
50
+ end
51
+ # resource path
52
+ local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/data'.sub('{' + 'appId' + '}', app_id.to_s)
53
+
54
+ # query parameters
55
+ query_params = {}
56
+
57
+ # header parameters
58
+ header_params = {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = {}
66
+
67
+ # http body (model)
68
+ post_body = @api_client.object_to_http_body(request_body)
69
+ auth_names = ['api_key']
70
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => 'GenericApiResponse')
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: MetricsApi#list_data_series_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+ # Get metrics filters and their values for an app
83
+ # Default value of interval is 5m
84
+ # @param app_id appId
85
+ # @param request_body Metric filters request
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [GenericApiResponse]
88
+ def list_filters_using_post(app_id, request_body, opts = {})
89
+ data, _status_code, _headers = list_filters_using_post_with_http_info(app_id, request_body, opts)
90
+ data
91
+ end
92
+
93
+ # Get metrics filters and their values for an app
94
+ # Default value of interval is 5m
95
+ # @param app_id appId
96
+ # @param request_body Metric filters request
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
99
+ def list_filters_using_post_with_http_info(app_id, request_body, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: MetricsApi.list_filters_using_post ...'
102
+ end
103
+ # verify the required parameter 'app_id' is set
104
+ if @api_client.config.client_side_validation && app_id.nil?
105
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_filters_using_post"
106
+ end
107
+ # verify the required parameter 'request_body' is set
108
+ if @api_client.config.client_side_validation && request_body.nil?
109
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling MetricsApi.list_filters_using_post"
110
+ end
111
+ # resource path
112
+ local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/filters'.sub('{' + 'appId' + '}', app_id.to_s)
113
+
114
+ # query parameters
115
+ query_params = {}
116
+
117
+ # header parameters
118
+ header_params = {}
119
+ # HTTP header 'Accept' (if needed)
120
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
+ # HTTP header 'Content-Type'
122
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
123
+
124
+ # form parameters
125
+ form_params = {}
126
+
127
+ # http body (model)
128
+ post_body = @api_client.object_to_http_body(request_body)
129
+ auth_names = ['api_key']
130
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
131
+ :header_params => header_params,
132
+ :query_params => query_params,
133
+ :form_params => form_params,
134
+ :body => post_body,
135
+ :auth_names => auth_names,
136
+ :return_type => 'GenericApiResponse')
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug "API called: MetricsApi#list_filters_using_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
139
+ end
140
+ return data, status_code, headers
141
+ end
142
+ # Get metrics keys for an app
143
+ # @param app_id appId
144
+ # @param [Hash] opts the optional parameters
145
+ # @return [GenericApiResponse]
146
+ def list_metrics_keys_using_get(app_id, opts = {})
147
+ data, _status_code, _headers = list_metrics_keys_using_get_with_http_info(app_id, opts)
148
+ data
149
+ end
150
+
151
+ # Get metrics keys for an app
152
+ # @param app_id appId
153
+ # @param [Hash] opts the optional parameters
154
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
155
+ def list_metrics_keys_using_get_with_http_info(app_id, opts = {})
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug 'Calling API: MetricsApi.list_metrics_keys_using_get ...'
158
+ end
159
+ # verify the required parameter 'app_id' is set
160
+ if @api_client.config.client_side_validation && app_id.nil?
161
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_metrics_keys_using_get"
162
+ end
163
+ # resource path
164
+ local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics/keys'.sub('{' + 'appId' + '}', app_id.to_s)
165
+
166
+ # query parameters
167
+ query_params = {}
168
+
169
+ # header parameters
170
+ header_params = {}
171
+ # HTTP header 'Accept' (if needed)
172
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
173
+ # HTTP header 'Content-Type'
174
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
175
+
176
+ # form parameters
177
+ form_params = {}
178
+
179
+ # http body (model)
180
+ post_body = nil
181
+ auth_names = ['api_key']
182
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
183
+ :header_params => header_params,
184
+ :query_params => query_params,
185
+ :form_params => form_params,
186
+ :body => post_body,
187
+ :auth_names => auth_names,
188
+ :return_type => 'GenericApiResponse')
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug "API called: MetricsApi#list_metrics_keys_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
191
+ end
192
+ return data, status_code, headers
193
+ end
194
+ # Get metrics info for an app
195
+ # @param app_id appId
196
+ # @param [Hash] opts the optional parameters
197
+ # @return [GenericApiResponse]
198
+ def list_metrics_using_get(app_id, opts = {})
199
+ data, _status_code, _headers = list_metrics_using_get_with_http_info(app_id, opts)
200
+ data
201
+ end
202
+
203
+ # Get metrics info for an app
204
+ # @param app_id appId
205
+ # @param [Hash] opts the optional parameters
206
+ # @return [Array<(GenericApiResponse, Fixnum, Hash)>] GenericApiResponse data, response status code and response headers
207
+ def list_metrics_using_get_with_http_info(app_id, opts = {})
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug 'Calling API: MetricsApi.list_metrics_using_get ...'
210
+ end
211
+ # verify the required parameter 'app_id' is set
212
+ if @api_client.config.client_side_validation && app_id.nil?
213
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling MetricsApi.list_metrics_using_get"
214
+ end
215
+ # resource path
216
+ local_var_path = '/spm-reports/api/v3/apps/{appId}/metrics'.sub('{' + 'appId' + '}', app_id.to_s)
217
+
218
+ # query parameters
219
+ query_params = {}
220
+
221
+ # header parameters
222
+ header_params = {}
223
+ # HTTP header 'Accept' (if needed)
224
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
225
+ # HTTP header 'Content-Type'
226
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
227
+
228
+ # form parameters
229
+ form_params = {}
230
+
231
+ # http body (model)
232
+ post_body = nil
233
+ auth_names = ['api_key']
234
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
235
+ :header_params => header_params,
236
+ :query_params => query_params,
237
+ :form_params => form_params,
238
+ :body => post_body,
239
+ :auth_names => auth_names,
240
+ :return_type => 'GenericApiResponse')
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "API called: MetricsApi#list_metrics_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
243
+ end
244
+ return data, status_code, headers
245
+ end
246
+ end
247
+ end