cloudsmith-api 0.52.5 → 0.53.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +16 -4
- data/build.json +1 -1
- data/docs/EntitlementTokenMetric.md +9 -0
- data/docs/MetricsApi.md +158 -0
- data/docs/MetricsownerrepopackagesusageActivePackages.md +10 -0
- data/docs/PackageUsageMetric.md +11 -0
- data/docs/Quota.md +8 -0
- data/docs/QuotaApi.md +248 -0
- data/docs/QuotaHistory.md +8 -0
- data/docs/QuotaHistoryHistory.md +13 -0
- data/docs/RepositoryToken.md +3 -0
- data/docs/RepositoryTokenRefresh.md +3 -0
- data/docs/RepositoryTokenSyncTokens.md +3 -0
- data/lib/cloudsmith-api.rb +8 -0
- data/lib/cloudsmith-api/api/metrics_api.rb +167 -0
- data/lib/cloudsmith-api/api/quota_api.rb +227 -0
- data/lib/cloudsmith-api/models/entitlement_token_metric.rb +209 -0
- data/lib/cloudsmith-api/models/metricsownerrepopackagesusage_active_packages.rb +209 -0
- data/lib/cloudsmith-api/models/package_usage_metric.rb +243 -0
- data/lib/cloudsmith-api/models/quota.rb +194 -0
- data/lib/cloudsmith-api/models/quota_history.rb +196 -0
- data/lib/cloudsmith-api/models/quota_history_history.rb +239 -0
- data/lib/cloudsmith-api/models/repository_token.rb +31 -1
- data/lib/cloudsmith-api/models/repository_token_refresh.rb +31 -1
- data/lib/cloudsmith-api/models/repository_token_sync_tokens.rb +31 -1
- data/lib/cloudsmith-api/version.rb +1 -1
- data/spec/api/metrics_api_spec.rb +71 -0
- data/spec/api/quota_api_spec.rb +83 -0
- data/spec/models/entitlement_token_metric_spec.rb +48 -0
- data/spec/models/metricsownerrepopackagesusage_active_packages_spec.rb +54 -0
- data/spec/models/package_usage_metric_spec.rb +60 -0
- data/spec/models/quota_history_history_spec.rb +72 -0
- data/spec/models/quota_history_spec.rb +42 -0
- data/spec/models/quota_spec.rb +42 -0
- data/spec/models/repository_token_refresh_spec.rb +18 -0
- data/spec/models/repository_token_spec.rb +18 -0
- data/spec/models/repository_token_sync_tokens_spec.rb +18 -0
- data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.6.gem +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.17/gem_make.out +1 -1
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out +2 -2
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.1/gem_make.out +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/Makefile +3 -3
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/FUNDING.yml +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/workflows/tests.yml +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.gitignore +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop.yml +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop_opinionated.yml +1 -18
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.travis.yml +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.yardopts +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/2.0-Upgrade.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/CHANGELOG.md +7 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Gemfile +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/LICENSE.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/README.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Rakefile +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/SECURITY.md +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/bin/console +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/codecov.yml +0 -2
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/data/list.txt +312 -78
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/domain.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/errors.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/list.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/rule.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/version.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/public_suffix.gemspec +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/.empty +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/acceptance_test.rb +2 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_find.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_find_all.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_names.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_select.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_select_incremental.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_valid.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/domain_profiler.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/find_profiler.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/find_profiler_jp.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/initialization_profiler.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/list_profsize.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/object_binsize.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/psl_test.rb +1 -1
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/test_helper.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/tests.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/domain_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/errors_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/list_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/public_suffix_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/rule_test.rb +0 -0
- data/vendor/bundle/ruby/2.6.0/specifications/{public_suffix-4.0.5.gemspec → public_suffix-4.0.6.gemspec} +4 -4
- data/vendor/bundle/ruby/2.6.0/specifications/sys-uname-1.2.1.gemspec +1 -1
- metadata +167 -135
- data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.5.gem +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# CloudsmithApi::QuotaHistoryHistory
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**days** | **Integer** | | [optional]
|
|
7
|
+
**display** | **Object** | | [optional]
|
|
8
|
+
**_end** | **String** | | [optional]
|
|
9
|
+
**plan** | **String** | | [optional]
|
|
10
|
+
**raw** | **Object** | | [optional]
|
|
11
|
+
**start** | **String** | | [optional]
|
|
12
|
+
|
|
13
|
+
|
data/docs/RepositoryToken.md
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
## Properties
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clients** | **Integer** | | [optional]
|
|
6
7
|
**created_at** | **String** | The datetime the token was updated at. | [optional]
|
|
7
8
|
**created_by** | **String** | | [optional]
|
|
8
9
|
**created_by_url** | **String** | | [optional]
|
|
9
10
|
**default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
|
|
11
|
+
**downloads** | **Integer** | | [optional]
|
|
10
12
|
**has_limits** | **BOOLEAN** | | [optional]
|
|
11
13
|
**identifier** | **Integer** | | [optional]
|
|
12
14
|
**is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
|
|
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
|
|
|
26
28
|
**updated_at** | **String** | The datetime the token was updated at. | [optional]
|
|
27
29
|
**updated_by** | **String** | | [optional]
|
|
28
30
|
**updated_by_url** | **String** | | [optional]
|
|
31
|
+
**usage** | **String** | | [optional]
|
|
29
32
|
**user** | **String** | | [optional]
|
|
30
33
|
**user_url** | **String** | | [optional]
|
|
31
34
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
## Properties
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clients** | **Integer** | | [optional]
|
|
6
7
|
**created_at** | **String** | The datetime the token was updated at. | [optional]
|
|
7
8
|
**created_by** | **String** | | [optional]
|
|
8
9
|
**created_by_url** | **String** | | [optional]
|
|
9
10
|
**default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
|
|
11
|
+
**downloads** | **Integer** | | [optional]
|
|
10
12
|
**has_limits** | **BOOLEAN** | | [optional]
|
|
11
13
|
**identifier** | **Integer** | | [optional]
|
|
12
14
|
**is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
|
|
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
|
|
|
26
28
|
**updated_at** | **String** | The datetime the token was updated at. | [optional]
|
|
27
29
|
**updated_by** | **String** | | [optional]
|
|
28
30
|
**updated_by_url** | **String** | | [optional]
|
|
31
|
+
**usage** | **String** | | [optional]
|
|
29
32
|
**user** | **String** | | [optional]
|
|
30
33
|
**user_url** | **String** | | [optional]
|
|
31
34
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
## Properties
|
|
4
4
|
Name | Type | Description | Notes
|
|
5
5
|
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**clients** | **Integer** | | [optional]
|
|
6
7
|
**created_at** | **String** | The datetime the token was updated at. | [optional]
|
|
7
8
|
**created_by** | **String** | | [optional]
|
|
8
9
|
**created_by_url** | **String** | | [optional]
|
|
9
10
|
**default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
|
|
11
|
+
**downloads** | **Integer** | | [optional]
|
|
10
12
|
**has_limits** | **BOOLEAN** | | [optional]
|
|
11
13
|
**identifier** | **Integer** | | [optional]
|
|
12
14
|
**is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
|
|
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
|
|
|
26
28
|
**updated_at** | **String** | The datetime the token was updated at. | [optional]
|
|
27
29
|
**updated_by** | **String** | | [optional]
|
|
28
30
|
**updated_by_url** | **String** | | [optional]
|
|
31
|
+
**usage** | **String** | | [optional]
|
|
29
32
|
**user** | **String** | | [optional]
|
|
30
33
|
**user_url** | **String** | | [optional]
|
|
31
34
|
|
data/lib/cloudsmith-api.rb
CHANGED
|
@@ -21,6 +21,7 @@ require 'cloudsmith-api/models/alpine_package_upload'
|
|
|
21
21
|
require 'cloudsmith-api/models/conan_package_upload'
|
|
22
22
|
require 'cloudsmith-api/models/distribution'
|
|
23
23
|
require 'cloudsmith-api/models/distros_versions'
|
|
24
|
+
require 'cloudsmith-api/models/entitlement_token_metric'
|
|
24
25
|
require 'cloudsmith-api/models/entitlements_create'
|
|
25
26
|
require 'cloudsmith-api/models/entitlements_partial_update'
|
|
26
27
|
require 'cloudsmith-api/models/entitlements_refresh'
|
|
@@ -32,6 +33,7 @@ require 'cloudsmith-api/models/files_validate'
|
|
|
32
33
|
require 'cloudsmith-api/models/format'
|
|
33
34
|
require 'cloudsmith-api/models/formats_distributions'
|
|
34
35
|
require 'cloudsmith-api/models/maven_package_upload'
|
|
36
|
+
require 'cloudsmith-api/models/metricsownerrepopackagesusage_active_packages'
|
|
35
37
|
require 'cloudsmith-api/models/namespace'
|
|
36
38
|
require 'cloudsmith-api/models/organization'
|
|
37
39
|
require 'cloudsmith-api/models/package'
|
|
@@ -40,6 +42,7 @@ require 'cloudsmith-api/models/package_file_parts_upload'
|
|
|
40
42
|
require 'cloudsmith-api/models/package_file_upload'
|
|
41
43
|
require 'cloudsmith-api/models/package_move'
|
|
42
44
|
require 'cloudsmith-api/models/package_status'
|
|
45
|
+
require 'cloudsmith-api/models/package_usage_metric'
|
|
43
46
|
require 'cloudsmith-api/models/packages_copy'
|
|
44
47
|
require 'cloudsmith-api/models/packages_move'
|
|
45
48
|
require 'cloudsmith-api/models/packages_tag'
|
|
@@ -87,6 +90,9 @@ require 'cloudsmith-api/models/packages_validateupload_terraform'
|
|
|
87
90
|
require 'cloudsmith-api/models/packages_validateupload_vagrant'
|
|
88
91
|
require 'cloudsmith-api/models/packagesownerrepo_architectures'
|
|
89
92
|
require 'cloudsmith-api/models/packagesownerrepo_files'
|
|
93
|
+
require 'cloudsmith-api/models/quota'
|
|
94
|
+
require 'cloudsmith-api/models/quota_history'
|
|
95
|
+
require 'cloudsmith-api/models/quota_history_history'
|
|
90
96
|
require 'cloudsmith-api/models/raw_package_upload'
|
|
91
97
|
require 'cloudsmith-api/models/repos_create'
|
|
92
98
|
require 'cloudsmith-api/models/repos_gpg_keys'
|
|
@@ -116,9 +122,11 @@ require 'cloudsmith-api/api/distros_api'
|
|
|
116
122
|
require 'cloudsmith-api/api/entitlements_api'
|
|
117
123
|
require 'cloudsmith-api/api/files_api'
|
|
118
124
|
require 'cloudsmith-api/api/formats_api'
|
|
125
|
+
require 'cloudsmith-api/api/metrics_api'
|
|
119
126
|
require 'cloudsmith-api/api/namespaces_api'
|
|
120
127
|
require 'cloudsmith-api/api/orgs_api'
|
|
121
128
|
require 'cloudsmith-api/api/packages_api'
|
|
129
|
+
require 'cloudsmith-api/api/quota_api'
|
|
122
130
|
require 'cloudsmith-api/api/rates_api'
|
|
123
131
|
require 'cloudsmith-api/api/repos_api'
|
|
124
132
|
require 'cloudsmith-api/api/status_api'
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Cloudsmith API
|
|
3
|
+
|
|
4
|
+
#The API to the Cloudsmith Service
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
Contact: support@cloudsmith.io
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.2.3
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module CloudsmithApi
|
|
16
|
+
class MetricsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# View for listing entitlement token usage as a metric.
|
|
24
|
+
# View for listing entitlement token usage as a metric.
|
|
25
|
+
# @param owner
|
|
26
|
+
# @param repo
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
29
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
30
|
+
# @option opts [Integer] :finish Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied.
|
|
31
|
+
# @option opts [Integer] :start Filter token usage starting from this datetime (UTC by default unless otherwise specified)).
|
|
32
|
+
# @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
|
|
33
|
+
# @return [Array<EntitlementTokenMetric>]
|
|
34
|
+
def metrics_entitlements_usage_list(owner, repo, opts = {})
|
|
35
|
+
data, _status_code, _headers = metrics_entitlements_usage_list_with_http_info(owner, repo, opts)
|
|
36
|
+
return data
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# View for listing entitlement token usage as a metric.
|
|
40
|
+
# View for listing entitlement token usage as a metric.
|
|
41
|
+
# @param owner
|
|
42
|
+
# @param repo
|
|
43
|
+
# @param [Hash] opts the optional parameters
|
|
44
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
45
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
46
|
+
# @option opts [Integer] :finish Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied.
|
|
47
|
+
# @option opts [Integer] :start Filter token usage starting from this datetime (UTC by default unless otherwise specified)).
|
|
48
|
+
# @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
|
|
49
|
+
# @return [Array<(Array<EntitlementTokenMetric>, Fixnum, Hash)>] Array<EntitlementTokenMetric> data, response status code and response headers
|
|
50
|
+
def metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {})
|
|
51
|
+
if @api_client.config.debugging
|
|
52
|
+
@api_client.config.logger.debug "Calling API: MetricsApi.metrics_entitlements_usage_list ..."
|
|
53
|
+
end
|
|
54
|
+
# verify the required parameter 'owner' is set
|
|
55
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
56
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_entitlements_usage_list"
|
|
57
|
+
end
|
|
58
|
+
# verify the required parameter 'repo' is set
|
|
59
|
+
if @api_client.config.client_side_validation && repo.nil?
|
|
60
|
+
fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_entitlements_usage_list"
|
|
61
|
+
end
|
|
62
|
+
# resource path
|
|
63
|
+
local_var_path = "/metrics/{owner}/{repo}/entitlements/usage/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)
|
|
64
|
+
|
|
65
|
+
# query parameters
|
|
66
|
+
query_params = {}
|
|
67
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
68
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
69
|
+
query_params[:'finish'] = opts[:'finish'] if !opts[:'finish'].nil?
|
|
70
|
+
query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
|
|
71
|
+
query_params[:'tokens'] = opts[:'tokens'] if !opts[:'tokens'].nil?
|
|
72
|
+
|
|
73
|
+
# header parameters
|
|
74
|
+
header_params = {}
|
|
75
|
+
|
|
76
|
+
# form parameters
|
|
77
|
+
form_params = {}
|
|
78
|
+
|
|
79
|
+
# http body (model)
|
|
80
|
+
post_body = nil
|
|
81
|
+
auth_names = ['apikey', 'csrf_token']
|
|
82
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
83
|
+
:header_params => header_params,
|
|
84
|
+
:query_params => query_params,
|
|
85
|
+
:form_params => form_params,
|
|
86
|
+
:body => post_body,
|
|
87
|
+
:auth_names => auth_names,
|
|
88
|
+
:return_type => 'Array<EntitlementTokenMetric>')
|
|
89
|
+
if @api_client.config.debugging
|
|
90
|
+
@api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
91
|
+
end
|
|
92
|
+
return data, status_code, headers
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# View for listing package usage metrics by user.
|
|
96
|
+
# View for listing package usage metrics by user.
|
|
97
|
+
# @param owner
|
|
98
|
+
# @param repo
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
101
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
102
|
+
# @option opts [Integer] :finish Filter token usage ending before this datetime (UTC). Defaults to now if not supplied.
|
|
103
|
+
# @option opts [String] :packages A comma seperated list of packages (slug perm) to include in the results.
|
|
104
|
+
# @option opts [Integer] :start Filter token usage starting from this datetime (UTC)).
|
|
105
|
+
# @return [Array<PackageUsageMetric>]
|
|
106
|
+
def metrics_packages_usage_list(owner, repo, opts = {})
|
|
107
|
+
data, _status_code, _headers = metrics_packages_usage_list_with_http_info(owner, repo, opts)
|
|
108
|
+
return data
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# View for listing package usage metrics by user.
|
|
112
|
+
# View for listing package usage metrics by user.
|
|
113
|
+
# @param owner
|
|
114
|
+
# @param repo
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
117
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
118
|
+
# @option opts [Integer] :finish Filter token usage ending before this datetime (UTC). Defaults to now if not supplied.
|
|
119
|
+
# @option opts [String] :packages A comma seperated list of packages (slug perm) to include in the results.
|
|
120
|
+
# @option opts [Integer] :start Filter token usage starting from this datetime (UTC)).
|
|
121
|
+
# @return [Array<(Array<PackageUsageMetric>, Fixnum, Hash)>] Array<PackageUsageMetric> data, response status code and response headers
|
|
122
|
+
def metrics_packages_usage_list_with_http_info(owner, repo, opts = {})
|
|
123
|
+
if @api_client.config.debugging
|
|
124
|
+
@api_client.config.logger.debug "Calling API: MetricsApi.metrics_packages_usage_list ..."
|
|
125
|
+
end
|
|
126
|
+
# verify the required parameter 'owner' is set
|
|
127
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
128
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_packages_usage_list"
|
|
129
|
+
end
|
|
130
|
+
# verify the required parameter 'repo' is set
|
|
131
|
+
if @api_client.config.client_side_validation && repo.nil?
|
|
132
|
+
fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_packages_usage_list"
|
|
133
|
+
end
|
|
134
|
+
# resource path
|
|
135
|
+
local_var_path = "/metrics/{owner}/{repo}/packages/usage/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)
|
|
136
|
+
|
|
137
|
+
# query parameters
|
|
138
|
+
query_params = {}
|
|
139
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
140
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
141
|
+
query_params[:'finish'] = opts[:'finish'] if !opts[:'finish'].nil?
|
|
142
|
+
query_params[:'packages'] = opts[:'packages'] if !opts[:'packages'].nil?
|
|
143
|
+
query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
|
|
144
|
+
|
|
145
|
+
# header parameters
|
|
146
|
+
header_params = {}
|
|
147
|
+
|
|
148
|
+
# form parameters
|
|
149
|
+
form_params = {}
|
|
150
|
+
|
|
151
|
+
# http body (model)
|
|
152
|
+
post_body = nil
|
|
153
|
+
auth_names = ['apikey', 'csrf_token']
|
|
154
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => 'Array<PackageUsageMetric>')
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug "API called: MetricsApi#metrics_packages_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
163
|
+
end
|
|
164
|
+
return data, status_code, headers
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Cloudsmith API
|
|
3
|
+
|
|
4
|
+
#The API to the Cloudsmith Service
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: v1
|
|
7
|
+
Contact: support@cloudsmith.io
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.2.3
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module CloudsmithApi
|
|
16
|
+
class QuotaApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Quota history for a given namespace.
|
|
24
|
+
# Quota history for a given namespace.
|
|
25
|
+
# @param owner
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [QuotaHistory]
|
|
28
|
+
def quota_history_read(owner, opts = {})
|
|
29
|
+
data, _status_code, _headers = quota_history_read_with_http_info(owner, opts)
|
|
30
|
+
return data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Quota history for a given namespace.
|
|
34
|
+
# Quota history for a given namespace.
|
|
35
|
+
# @param owner
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @return [Array<(QuotaHistory, Fixnum, Hash)>] QuotaHistory data, response status code and response headers
|
|
38
|
+
def quota_history_read_with_http_info(owner, opts = {})
|
|
39
|
+
if @api_client.config.debugging
|
|
40
|
+
@api_client.config.logger.debug "Calling API: QuotaApi.quota_history_read ..."
|
|
41
|
+
end
|
|
42
|
+
# verify the required parameter 'owner' is set
|
|
43
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
44
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_history_read"
|
|
45
|
+
end
|
|
46
|
+
# resource path
|
|
47
|
+
local_var_path = "/quota/history/{owner}/".sub('{' + 'owner' + '}', owner.to_s)
|
|
48
|
+
|
|
49
|
+
# query parameters
|
|
50
|
+
query_params = {}
|
|
51
|
+
|
|
52
|
+
# header parameters
|
|
53
|
+
header_params = {}
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = {}
|
|
57
|
+
|
|
58
|
+
# http body (model)
|
|
59
|
+
post_body = nil
|
|
60
|
+
auth_names = ['apikey', 'csrf_token']
|
|
61
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
62
|
+
:header_params => header_params,
|
|
63
|
+
:query_params => query_params,
|
|
64
|
+
:form_params => form_params,
|
|
65
|
+
:body => post_body,
|
|
66
|
+
:auth_names => auth_names,
|
|
67
|
+
:return_type => 'QuotaHistory')
|
|
68
|
+
if @api_client.config.debugging
|
|
69
|
+
@api_client.config.logger.debug "API called: QuotaApi#quota_history_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
70
|
+
end
|
|
71
|
+
return data, status_code, headers
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Open-source Quota history for a given namespace.
|
|
75
|
+
# Open-source Quota history for a given namespace.
|
|
76
|
+
# @param owner
|
|
77
|
+
# @param [Hash] opts the optional parameters
|
|
78
|
+
# @return [QuotaHistory]
|
|
79
|
+
def quota_oss_history_read(owner, opts = {})
|
|
80
|
+
data, _status_code, _headers = quota_oss_history_read_with_http_info(owner, opts)
|
|
81
|
+
return data
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Open-source Quota history for a given namespace.
|
|
85
|
+
# Open-source Quota history for a given namespace.
|
|
86
|
+
# @param owner
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [Array<(QuotaHistory, Fixnum, Hash)>] QuotaHistory data, response status code and response headers
|
|
89
|
+
def quota_oss_history_read_with_http_info(owner, opts = {})
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "Calling API: QuotaApi.quota_oss_history_read ..."
|
|
92
|
+
end
|
|
93
|
+
# verify the required parameter 'owner' is set
|
|
94
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
95
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_history_read"
|
|
96
|
+
end
|
|
97
|
+
# resource path
|
|
98
|
+
local_var_path = "/quota/oss/history/{owner}/".sub('{' + 'owner' + '}', owner.to_s)
|
|
99
|
+
|
|
100
|
+
# query parameters
|
|
101
|
+
query_params = {}
|
|
102
|
+
|
|
103
|
+
# header parameters
|
|
104
|
+
header_params = {}
|
|
105
|
+
|
|
106
|
+
# form parameters
|
|
107
|
+
form_params = {}
|
|
108
|
+
|
|
109
|
+
# http body (model)
|
|
110
|
+
post_body = nil
|
|
111
|
+
auth_names = ['apikey', 'csrf_token']
|
|
112
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
113
|
+
:header_params => header_params,
|
|
114
|
+
:query_params => query_params,
|
|
115
|
+
:form_params => form_params,
|
|
116
|
+
:body => post_body,
|
|
117
|
+
:auth_names => auth_names,
|
|
118
|
+
:return_type => 'QuotaHistory')
|
|
119
|
+
if @api_client.config.debugging
|
|
120
|
+
@api_client.config.logger.debug "API called: QuotaApi#quota_oss_history_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
121
|
+
end
|
|
122
|
+
return data, status_code, headers
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Open-source Quota usage for a given namespace.
|
|
126
|
+
# Open-source Quota usage for a given namespace.
|
|
127
|
+
# @param owner
|
|
128
|
+
# @param [Hash] opts the optional parameters
|
|
129
|
+
# @return [Quota]
|
|
130
|
+
def quota_oss_read(owner, opts = {})
|
|
131
|
+
data, _status_code, _headers = quota_oss_read_with_http_info(owner, opts)
|
|
132
|
+
return data
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Open-source Quota usage for a given namespace.
|
|
136
|
+
# Open-source Quota usage for a given namespace.
|
|
137
|
+
# @param owner
|
|
138
|
+
# @param [Hash] opts the optional parameters
|
|
139
|
+
# @return [Array<(Quota, Fixnum, Hash)>] Quota data, response status code and response headers
|
|
140
|
+
def quota_oss_read_with_http_info(owner, opts = {})
|
|
141
|
+
if @api_client.config.debugging
|
|
142
|
+
@api_client.config.logger.debug "Calling API: QuotaApi.quota_oss_read ..."
|
|
143
|
+
end
|
|
144
|
+
# verify the required parameter 'owner' is set
|
|
145
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
146
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_read"
|
|
147
|
+
end
|
|
148
|
+
# resource path
|
|
149
|
+
local_var_path = "/quota/oss/{owner}/".sub('{' + 'owner' + '}', owner.to_s)
|
|
150
|
+
|
|
151
|
+
# query parameters
|
|
152
|
+
query_params = {}
|
|
153
|
+
|
|
154
|
+
# header parameters
|
|
155
|
+
header_params = {}
|
|
156
|
+
|
|
157
|
+
# form parameters
|
|
158
|
+
form_params = {}
|
|
159
|
+
|
|
160
|
+
# http body (model)
|
|
161
|
+
post_body = nil
|
|
162
|
+
auth_names = ['apikey', 'csrf_token']
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
164
|
+
:header_params => header_params,
|
|
165
|
+
:query_params => query_params,
|
|
166
|
+
:form_params => form_params,
|
|
167
|
+
:body => post_body,
|
|
168
|
+
:auth_names => auth_names,
|
|
169
|
+
:return_type => 'Quota')
|
|
170
|
+
if @api_client.config.debugging
|
|
171
|
+
@api_client.config.logger.debug "API called: QuotaApi#quota_oss_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
172
|
+
end
|
|
173
|
+
return data, status_code, headers
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Quota usage for a given namespace.
|
|
177
|
+
# Quota usage for a given namespace.
|
|
178
|
+
# @param owner
|
|
179
|
+
# @param [Hash] opts the optional parameters
|
|
180
|
+
# @return [Quota]
|
|
181
|
+
def quota_read(owner, opts = {})
|
|
182
|
+
data, _status_code, _headers = quota_read_with_http_info(owner, opts)
|
|
183
|
+
return data
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Quota usage for a given namespace.
|
|
187
|
+
# Quota usage for a given namespace.
|
|
188
|
+
# @param owner
|
|
189
|
+
# @param [Hash] opts the optional parameters
|
|
190
|
+
# @return [Array<(Quota, Fixnum, Hash)>] Quota data, response status code and response headers
|
|
191
|
+
def quota_read_with_http_info(owner, opts = {})
|
|
192
|
+
if @api_client.config.debugging
|
|
193
|
+
@api_client.config.logger.debug "Calling API: QuotaApi.quota_read ..."
|
|
194
|
+
end
|
|
195
|
+
# verify the required parameter 'owner' is set
|
|
196
|
+
if @api_client.config.client_side_validation && owner.nil?
|
|
197
|
+
fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_read"
|
|
198
|
+
end
|
|
199
|
+
# resource path
|
|
200
|
+
local_var_path = "/quota/{owner}/".sub('{' + 'owner' + '}', owner.to_s)
|
|
201
|
+
|
|
202
|
+
# query parameters
|
|
203
|
+
query_params = {}
|
|
204
|
+
|
|
205
|
+
# header parameters
|
|
206
|
+
header_params = {}
|
|
207
|
+
|
|
208
|
+
# form parameters
|
|
209
|
+
form_params = {}
|
|
210
|
+
|
|
211
|
+
# http body (model)
|
|
212
|
+
post_body = nil
|
|
213
|
+
auth_names = ['apikey', 'csrf_token']
|
|
214
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
215
|
+
:header_params => header_params,
|
|
216
|
+
:query_params => query_params,
|
|
217
|
+
:form_params => form_params,
|
|
218
|
+
:body => post_body,
|
|
219
|
+
:auth_names => auth_names,
|
|
220
|
+
:return_type => 'Quota')
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: QuotaApi#quota_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
return data, status_code, headers
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|