Class: CloudsmithApi::MetricsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudsmith-api/api/metrics_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MetricsApi

Returns a new instance of MetricsApi.



19
20
21
# File 'lib/cloudsmith-api/api/metrics_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/cloudsmith-api/api/metrics_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#metrics_entitlements_account_list(owner, opts = {}) ⇒ EntitlementUsageMetrics

View for listing entitlement token metrics, across an account. View for listing entitlement token metrics, across an account.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example '2020-12-31' or '2021-12-13T00:00:00Z'.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example '2020-12-31' or '2021-12-13T00:00:00Z'.

  • :tokens (String)

    A comma seperated list of tokens (slug perm) to include in the results.

Returns:



32
33
34
35
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 32

def (owner, opts = {})
  data, _status_code, _headers = (owner, opts)
  data
end

#metrics_entitlements_account_list_with_http_info(owner, opts = {}) ⇒ Array<(EntitlementUsageMetrics, Fixnum, Hash)>

View for listing entitlement token metrics, across an account. View for listing entitlement token metrics, across an account.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :tokens (String)

    A comma seperated list of tokens (slug perm) to include in the results.

Returns:

  • (Array<(EntitlementUsageMetrics, Fixnum, Hash)>)

    EntitlementUsageMetrics data, response status code and response headers



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
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 47

def (owner, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.metrics_entitlements_account_list ...'
  end
  # verify the required parameter 'owner' is set
  if @api_client.config.client_side_validation && owner.nil?
    fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_entitlements_account_list"
  end
  # resource path
  local_var_path = '/metrics/entitlements/{owner}/'.sub('{' + 'owner' + '}', owner.to_s)

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apikey', 'basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EntitlementUsageMetrics')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_account_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#metrics_entitlements_repo_list(owner, repo, opts = {}) ⇒ EntitlementUsageMetrics

View for listing entitlement token metrics, for a repository. View for listing entitlement token metrics, for a repository.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :tokens (String)

    A comma seperated list of tokens (slug perm) to include in the results.

Returns:



102
103
104
105
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 102

def metrics_entitlements_repo_list(owner, repo, opts = {})
  data, _status_code, _headers = metrics_entitlements_repo_list_with_http_info(owner, repo, opts)
  data
end

#metrics_entitlements_repo_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(EntitlementUsageMetrics, Fixnum, Hash)>

View for listing entitlement token metrics, for a repository. View for listing entitlement token metrics, for a repository.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :tokens (String)

    A comma seperated list of tokens (slug perm) to include in the results.

Returns:

  • (Array<(EntitlementUsageMetrics, Fixnum, Hash)>)

    EntitlementUsageMetrics data, response status code and response headers



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
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 118

def metrics_entitlements_repo_list_with_http_info(owner, repo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.metrics_entitlements_repo_list ...'
  end
  # verify the required parameter 'owner' is set
  if @api_client.config.client_side_validation && owner.nil?
    fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_entitlements_repo_list"
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_entitlements_repo_list"
  end
  # resource path
  local_var_path = '/metrics/entitlements/{owner}/{repo}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apikey', 'basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'EntitlementUsageMetrics')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_repo_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#metrics_packages_list(owner, repo, opts = {}) ⇒ PackageUsageMetrics

View for listing package usage metrics, for a repository. View for listing package usage metrics, for a repository.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :packages (String)

    A comma seperated list of packages (slug perm) to include in the results.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

Returns:



177
178
179
180
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 177

def metrics_packages_list(owner, repo, opts = {})
  data, _status_code, _headers = metrics_packages_list_with_http_info(owner, repo, opts)
  data
end

#metrics_packages_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(PackageUsageMetrics, Fixnum, Hash)>

View for listing package usage metrics, for a repository. View for listing package usage metrics, for a repository.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    A page number within the paginated result set.

  • :page_size (Integer)

    Number of results to return per page.

  • :finish (String)

    Include metrics upto and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

  • :packages (String)

    A comma seperated list of packages (slug perm) to include in the results.

  • :start (String)

    Include metrics from and including this UTC date or UTC datetime. For example &#39;2020-12-31&#39; or &#39;2021-12-13T00:00:00Z&#39;.

Returns:

  • (Array<(PackageUsageMetrics, Fixnum, Hash)>)

    PackageUsageMetrics data, response status code and response headers



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
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 193

def metrics_packages_list_with_http_info(owner, repo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MetricsApi.metrics_packages_list ...'
  end
  # verify the required parameter 'owner' is set
  if @api_client.config.client_side_validation && owner.nil?
    fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_packages_list"
  end
  # verify the required parameter 'repo' is set
  if @api_client.config.client_side_validation && repo.nil?
    fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_packages_list"
  end
  # resource path
  local_var_path = '/metrics/packages/{owner}/{repo}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)

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

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apikey', 'basic']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PackageUsageMetrics')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MetricsApi#metrics_packages_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end