Class: LinodeOpenapiClient::LongviewApi

Inherits:
Object
  • Object
show all
Defined in:
lib/linode_openapi_client/api/longview_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LongviewApi

Returns a new instance of LongviewApi.



19
20
21
# File 'lib/linode_openapi_client/api/longview_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/linode_openapi_client/api/longview_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_longview_client(api_version, client_id, opts = {}) ⇒ Object

Delete a Longview client Deletes a Longview Client from your Account. __All information stored for this client will be lost.__ This _does not_ uninstall the Longview Client application for your Linode - you must do that manually. <<LB>> — - __CLI__. “‘ linode-cli longview delete 789 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


28
29
30
31
# File 'lib/linode_openapi_client/api/longview_api.rb', line 28

def delete_longview_client(api_version, client_id, opts = {})
  data, _status_code, _headers = delete_longview_client_with_http_info(api_version, client_id, opts)
  data
end

#delete_longview_client_with_http_info(api_version, client_id, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Delete a Longview client Deletes a Longview Client from your Account. __All information stored for this client will be lost.__ This _does not_ uninstall the Longview Client application for your Linode - you must do that manually. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview delete 789 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/linode_openapi_client/api/longview_api.rb', line 39

def delete_longview_client_with_http_info(api_version, client_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.delete_longview_client ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.delete_longview_client"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'client_id' is set
  if @api_client.config.client_side_validation && client_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_id' when calling LongviewApi.delete_longview_client"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/clients/{clientId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.delete_longview_client",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#delete_longview_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longview_client(api_version, client_id, opts = {}) ⇒ GetLongviewClient200Response

Get a Longview client Returns a single Longview Client you can access. <<LB>> — - __CLI__. “‘ linode-cli longview view 789 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



102
103
104
105
# File 'lib/linode_openapi_client/api/longview_api.rb', line 102

def get_longview_client(api_version, client_id, opts = {})
  data, _status_code, _headers = get_longview_client_with_http_info(api_version, client_id, opts)
  data
end

#get_longview_client_with_http_info(api_version, client_id, opts = {}) ⇒ Array<(GetLongviewClient200Response, Integer, Hash)>

Get a Longview client Returns a single Longview Client you can access. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview view 789 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/linode_openapi_client/api/longview_api.rb', line 113

def get_longview_client_with_http_info(api_version, client_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.get_longview_client ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.get_longview_client"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'client_id' is set
  if @api_client.config.client_side_validation && client_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_id' when calling LongviewApi.get_longview_client"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/clients/{clientId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLongviewClient200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.get_longview_client",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#get_longview_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longview_clients(api_version, opts = {}) ⇒ GetLongviewClients200Response

List Longview clients Returns a paginated list of Longview Clients you have access to. Longview Client is used to monitor stats on your Linode with the help of the Longview Client application. <<LB>> — - __CLI__. “‘ linode-cli longview list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



177
178
179
180
# File 'lib/linode_openapi_client/api/longview_api.rb', line 177

def get_longview_clients(api_version, opts = {})
  data, _status_code, _headers = get_longview_clients_with_http_info(api_version, opts)
  data
end

#get_longview_clients_with_http_info(api_version, opts = {}) ⇒ Array<(GetLongviewClients200Response, Integer, Hash)>

List Longview clients Returns a paginated list of Longview Clients you have access to. Longview Client is used to monitor stats on your Linode with the help of the Longview Client application. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/linode_openapi_client/api/longview_api.rb', line 189

def get_longview_clients_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.get_longview_clients ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.get_longview_clients"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling LongviewApi.get_longview_clients, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LongviewApi.get_longview_clients, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LongviewApi.get_longview_clients, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/longview/clients'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLongviewClients200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.get_longview_clients",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#get_longview_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longview_plan(api_version, opts = {}) ⇒ GetLongviewPlan200Response

Get a Longview plan Get the details of your current Longview plan. This returns a ‘LongviewSubscription` object for your current Longview Pro plan, or an empty set `{}` if your current plan is Longview Free. You must have at least one of the following `global` [List a user’s grants](techdocs.akamai.com/linode-api/reference/get-user-grants) in order to run this operation: - ‘"account_access": read_write` - `"account_access": read_only` - `"longview_subscription": true` - `"add_longview": true` To update your subscription plan, send a request to [Update a Longview plan](techdocs.akamai.com/linode-api/reference/put-longview-plan). <<LB>> — - __CLI__. “` linode-cli longview plan-view “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_only “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



261
262
263
264
# File 'lib/linode_openapi_client/api/longview_api.rb', line 261

def get_longview_plan(api_version, opts = {})
  data, _status_code, _headers = get_longview_plan_with_http_info(api_version, opts)
  data
end

#get_longview_plan_with_http_info(api_version, opts = {}) ⇒ Array<(GetLongviewPlan200Response, Integer, Hash)>

Get a Longview plan Get the details of your current Longview plan. This returns a &#x60;LongviewSubscription&#x60; object for your current Longview Pro plan, or an empty set &#x60;{}&#x60; if your current plan is Longview Free. You must have at least one of the following &#x60;global&#x60; [List a user&#39;s grants](techdocs.akamai.com/linode-api/reference/get-user-grants) in order to run this operation: - &#x60;&quot;account_access&quot;: read_write&#x60; - &#x60;&quot;account_access&quot;: read_only&#x60; - &#x60;&quot;longview_subscription&quot;: true&#x60; - &#x60;&quot;add_longview&quot;: true&#x60; To update your subscription plan, send a request to [Update a Longview plan](techdocs.akamai.com/linode-api/reference/put-longview-plan). &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview plan-view &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_only &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetLongviewPlan200Response, Integer, Hash)>)

    GetLongviewPlan200Response data, response status code and response headers



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/linode_openapi_client/api/longview_api.rb', line 271

def get_longview_plan_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.get_longview_plan ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.get_longview_plan"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/plan'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLongviewPlan200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.get_longview_plan",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#get_longview_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longview_subscription(api_version, subscription_id, opts = {}) ⇒ GetLongviewSubscription200Response

Get a Longview subscription Get the Longview plan details as a single ‘LongviewSubscription` object for the provided subscription ID. This is a public endpoint and requires no authentication. <<LB>> — - __CLI__. “` linode-cli longview subscription-view “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • subscription_id (String)

    The Longview Subscription to look up.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



330
331
332
333
# File 'lib/linode_openapi_client/api/longview_api.rb', line 330

def get_longview_subscription(api_version, subscription_id, opts = {})
  data, _status_code, _headers = get_longview_subscription_with_http_info(api_version, subscription_id, opts)
  data
end

#get_longview_subscription_with_http_info(api_version, subscription_id, opts = {}) ⇒ Array<(GetLongviewSubscription200Response, Integer, Hash)>

Get a Longview subscription Get the Longview plan details as a single &#x60;LongviewSubscription&#x60; object for the provided subscription ID. This is a public endpoint and requires no authentication. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview subscription-view &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • subscription_id (String)

    The Longview Subscription to look up.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/linode_openapi_client/api/longview_api.rb', line 341

def get_longview_subscription_with_http_info(api_version, subscription_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.get_longview_subscription ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.get_longview_subscription"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'subscription_id' is set
  if @api_client.config.client_side_validation && subscription_id.nil?
    fail ArgumentError, "Missing the required parameter 'subscription_id' when calling LongviewApi.get_longview_subscription"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/subscriptions/{subscriptionId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'subscriptionId' + '}', CGI.escape(subscription_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLongviewSubscription200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"LongviewApi.get_longview_subscription",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#get_longview_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_longview_subscriptions(api_version, opts = {}) ⇒ GetLongviewSubscriptions200Response

List Longview subscriptions Returns a paginated list of available Longview Subscriptions. This is a public endpoint and requires no authentication. <<LB>> — - __CLI__. “‘ linode-cli longview subscriptions-list “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



405
406
407
408
# File 'lib/linode_openapi_client/api/longview_api.rb', line 405

def get_longview_subscriptions(api_version, opts = {})
  data, _status_code, _headers = get_longview_subscriptions_with_http_info(api_version, opts)
  data
end

#get_longview_subscriptions_with_http_info(api_version, opts = {}) ⇒ Array<(GetLongviewSubscriptions200Response, Integer, Hash)>

List Longview subscriptions Returns a paginated list of available Longview Subscriptions. This is a public endpoint and requires no authentication. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview subscriptions-list &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    The page of a collection to return. (default to 1)

  • :page_size (Integer)

    The number of items to return per page. (default to 100)

Returns:



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/linode_openapi_client/api/longview_api.rb', line 417

def get_longview_subscriptions_with_http_info(api_version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.get_longview_subscriptions ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.get_longview_subscriptions"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling LongviewApi.get_longview_subscriptions, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LongviewApi.get_longview_subscriptions, must be smaller than or equal to 500.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 25
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LongviewApi.get_longview_subscriptions, must be greater than or equal to 25.'
  end

  # resource path
  local_var_path = '/{apiVersion}/longview/subscriptions'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLongviewSubscriptions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"LongviewApi.get_longview_subscriptions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#get_longview_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_longview_client(api_version, post_longview_client_request, opts = {}) ⇒ PostLongviewClient200Response

Create a Longview client Creates a Longview Client. This Client will not begin monitoring the status of your server until you configure the Longview Client application on your Linode using the returning ‘install_code` and `api_key`. <<LB>> — - __CLI__. “` linode-cli longview create \ –label client789 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_longview_client_request (PostLongviewClientRequest)

    Information about the LongviewClient to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



490
491
492
493
# File 'lib/linode_openapi_client/api/longview_api.rb', line 490

def post_longview_client(api_version, post_longview_client_request, opts = {})
  data, _status_code, _headers = post_longview_client_with_http_info(api_version, post_longview_client_request, opts)
  data
end

#post_longview_client_with_http_info(api_version, post_longview_client_request, opts = {}) ⇒ Array<(PostLongviewClient200Response, Integer, Hash)>

Create a Longview client Creates a Longview Client. This Client will not begin monitoring the status of your server until you configure the Longview Client application on your Linode using the returning &#x60;install_code&#x60; and &#x60;api_key&#x60;. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview create \ –label client789 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • post_longview_client_request (PostLongviewClientRequest)

    Information about the LongviewClient to create.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/linode_openapi_client/api/longview_api.rb', line 501

def post_longview_client_with_http_info(api_version, post_longview_client_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.post_longview_client ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.post_longview_client"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'post_longview_client_request' is set
  if @api_client.config.client_side_validation && post_longview_client_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_longview_client_request' when calling LongviewApi.post_longview_client"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/clients'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_longview_client_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PostLongviewClient200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.post_longview_client",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#post_longview_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_longview_client(api_version, client_id, put_longview_client_request, opts = {}) ⇒ PutLongviewClient200Response

Update a Longview client Updates a Longview Client. This cannot update how it monitors your server; use the Longview Client application on your Linode for monitoring configuration. <<LB>> — - __CLI__. “‘ linode-cli longview update 789 \ –label client789 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • put_longview_client_request (PutLongviewClientRequest)

    The fields to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



570
571
572
573
# File 'lib/linode_openapi_client/api/longview_api.rb', line 570

def put_longview_client(api_version, client_id, put_longview_client_request, opts = {})
  data, _status_code, _headers = put_longview_client_with_http_info(api_version, client_id, put_longview_client_request, opts)
  data
end

#put_longview_client_with_http_info(api_version, client_id, put_longview_client_request, opts = {}) ⇒ Array<(PutLongviewClient200Response, Integer, Hash)>

Update a Longview client Updates a Longview Client. This cannot update how it monitors your server; use the Longview Client application on your Linode for monitoring configuration. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview update 789 \ –label client789 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • client_id (Integer)

    The Longview Client ID to access.

  • put_longview_client_request (PutLongviewClientRequest)

    The fields to update.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/linode_openapi_client/api/longview_api.rb', line 582

def put_longview_client_with_http_info(api_version, client_id, put_longview_client_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.put_longview_client ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.put_longview_client"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'client_id' is set
  if @api_client.config.client_side_validation && client_id.nil?
    fail ArgumentError, "Missing the required parameter 'client_id' when calling LongviewApi.put_longview_client"
  end
  # verify the required parameter 'put_longview_client_request' is set
  if @api_client.config.client_side_validation && put_longview_client_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_longview_client_request' when calling LongviewApi.put_longview_client"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/clients/{clientId}'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s)).sub('{' + 'clientId' + '}', CGI.escape(client_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(put_longview_client_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PutLongviewClient200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.put_longview_client",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#put_longview_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_longview_plan(api_version, put_longview_plan_request, opts = {}) ⇒ PutLongviewPlan200Response

Update a Longview plan Update your Longview plan to that of the given subscription ID. This returns a ‘LongviewSubscription` object for the updated Longview Pro plan, or an empty set `{}` if the updated plan is Longview Free. You must have `"longview_subscription": true` configured as a `global` [user grant](techdocs.akamai.com/linode-api/reference/get-user-grants) in order to run this operation. You can send a request to the [List Longview subscriptions](techdocs.akamai.com/linode-api/reference/get-longview-subscriptions) operation to receive the details, including `id`’s, of each plan. <<LB>> — - __CLI__. “‘ linode-cli longview plan-update –longview_subscription longview-10 “` [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. “` longview:read_write “` [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • put_longview_plan_request (PutLongviewPlanRequest)

    Update your Longview subscription plan.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



654
655
656
657
# File 'lib/linode_openapi_client/api/longview_api.rb', line 654

def put_longview_plan(api_version, put_longview_plan_request, opts = {})
  data, _status_code, _headers = put_longview_plan_with_http_info(api_version, put_longview_plan_request, opts)
  data
end

#put_longview_plan_with_http_info(api_version, put_longview_plan_request, opts = {}) ⇒ Array<(PutLongviewPlan200Response, Integer, Hash)>

Update a Longview plan Update your Longview plan to that of the given subscription ID. This returns a &#x60;LongviewSubscription&#x60; object for the updated Longview Pro plan, or an empty set &#x60;{}&#x60; if the updated plan is Longview Free. You must have &#x60;&quot;longview_subscription&quot;: true&#x60; configured as a &#x60;global&#x60; [user grant](techdocs.akamai.com/linode-api/reference/get-user-grants) in order to run this operation. You can send a request to the [List Longview subscriptions](techdocs.akamai.com/linode-api/reference/get-longview-subscriptions) operation to receive the details, including &#x60;id&#x60;&#39;s, of each plan. &lt;&lt;LB&gt;&gt; — - __CLI__. &#x60;&#x60;&#x60; linode-cli longview plan-update –longview_subscription longview-10 &#x60;&#x60;&#x60; [Learn more…](www.linode.com/docs/products/tools/cli/get-started/) - __OAuth scopes__. &#x60;&#x60;&#x60; longview:read_write &#x60;&#x60;&#x60; [Learn more…](techdocs.akamai.com/linode-api/reference/get-started#oauth)

Parameters:

  • api_version (String)

    __Enum__ Call either the &#x60;v4&#x60; URL, or &#x60;v4beta&#x60; for operations still in Beta.

  • put_longview_plan_request (PutLongviewPlanRequest)

    Update your Longview subscription plan.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PutLongviewPlan200Response, Integer, Hash)>)

    PutLongviewPlan200Response data, response status code and response headers



665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# File 'lib/linode_openapi_client/api/longview_api.rb', line 665

def put_longview_plan_with_http_info(api_version, put_longview_plan_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LongviewApi.put_longview_plan ...'
  end
  # verify the required parameter 'api_version' is set
  if @api_client.config.client_side_validation && api_version.nil?
    fail ArgumentError, "Missing the required parameter 'api_version' when calling LongviewApi.put_longview_plan"
  end
  # verify enum value
  allowable_values = ["v4", "v4beta"]
  if @api_client.config.client_side_validation && !allowable_values.include?(api_version)
    fail ArgumentError, "invalid value for \"api_version\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'put_longview_plan_request' is set
  if @api_client.config.client_side_validation && put_longview_plan_request.nil?
    fail ArgumentError, "Missing the required parameter 'put_longview_plan_request' when calling LongviewApi.put_longview_plan"
  end
  # resource path
  local_var_path = '/{apiVersion}/longview/plan'.sub('{' + 'apiVersion' + '}', CGI.escape(api_version.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(put_longview_plan_request)

  # return_type
  return_type = opts[:debug_return_type] || 'PutLongviewPlan200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['personalAccessToken', 'oauth']

  new_options = opts.merge(
    :operation => :"LongviewApi.put_longview_plan",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LongviewApi#put_longview_plan\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end