Class: Harbor2Client::QuotaApi
- Inherits:
-
Object
- Object
- Harbor2Client::QuotaApi
- Defined in:
- lib/harbor2_client/api/quota_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_quota(id, opts = {}) ⇒ Quota
Get the specified quota Get the specified quota.
-
#get_quota_with_http_info(id, opts = {}) ⇒ Array<(Quota, Fixnum, Hash)>
Get the specified quota Get the specified quota.
-
#initialize(api_client = ApiClient.default) ⇒ QuotaApi
constructor
A new instance of QuotaApi.
-
#list_quotas(opts = {}) ⇒ Array<Quota>
List quotas List quotas.
-
#list_quotas_with_http_info(opts = {}) ⇒ Array<(Array<Quota>, Fixnum, Hash)>
List quotas List quotas.
-
#update_quota(id, hard, opts = {}) ⇒ nil
Update the specified quota Update hard limits of the specified quota.
-
#update_quota_with_http_info(id, hard, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update the specified quota Update hard limits of the specified quota.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ QuotaApi
Returns a new instance of QuotaApi.
19 20 21 |
# File 'lib/harbor2_client/api/quota_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/harbor2_client/api/quota_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_quota(id, opts = {}) ⇒ Quota
Get the specified quota Get the specified quota
28 29 30 31 |
# File 'lib/harbor2_client/api/quota_api.rb', line 28 def get_quota(id, opts = {}) data, _status_code, _headers = get_quota_with_http_info(id, opts) data end |
#get_quota_with_http_info(id, opts = {}) ⇒ Array<(Quota, Fixnum, Hash)>
Get the specified quota Get the specified quota
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 |
# File 'lib/harbor2_client/api/quota_api.rb', line 39 def get_quota_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.get_quota ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling QuotaApi.get_quota" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling QuotaApi.get_quota, the character length must be great than or equal to 1.' end # resource path local_var_path = '/quotas/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # 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']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['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 => 'Quota') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#get_quota\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_quotas(opts = {}) ⇒ Array<Quota>
List quotas List quotas
93 94 95 96 |
# File 'lib/harbor2_client/api/quota_api.rb', line 93 def list_quotas(opts = {}) data, _status_code, _headers = list_quotas_with_http_info(opts) data end |
#list_quotas_with_http_info(opts = {}) ⇒ Array<(Array<Quota>, Fixnum, Hash)>
List quotas List quotas
108 109 110 111 112 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 |
# File 'lib/harbor2_client/api/quota_api.rb', line 108 def list_quotas_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.list_quotas ...' end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling QuotaApi.list_quotas, the character length must be great than or equal to 1.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling QuotaApi.list_quotas, must be smaller than or equal to 100.' end # resource path local_var_path = '/quotas' # 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[:'reference'] = opts[:'reference'] if !opts[:'reference'].nil? query_params[:'reference_id'] = opts[:'reference_id'] if !opts[:'reference_id'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['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 => 'Array<Quota>') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#list_quotas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_quota(id, hard, opts = {}) ⇒ nil
Update the specified quota Update hard limits of the specified quota
164 165 166 167 |
# File 'lib/harbor2_client/api/quota_api.rb', line 164 def update_quota(id, hard, opts = {}) update_quota_with_http_info(id, hard, opts) nil end |
#update_quota_with_http_info(id, hard, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Update the specified quota Update hard limits of the specified quota
176 177 178 179 180 181 182 183 184 185 186 187 188 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 |
# File 'lib/harbor2_client/api/quota_api.rb', line 176 def update_quota_with_http_info(id, hard, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.update_quota ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling QuotaApi.update_quota" end # verify the required parameter 'hard' is set if @api_client.config.client_side_validation && hard.nil? fail ArgumentError, "Missing the required parameter 'hard' when calling QuotaApi.update_quota" end if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1 fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling QuotaApi.update_quota, the character length must be great than or equal to 1.' end # resource path local_var_path = '/quotas/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # 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']) header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil? # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(hard) auth_names = ['basic'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#update_quota\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |