Class: Fastly::BackendApi
- Inherits:
-
Object
- Object
- Fastly::BackendApi
- Defined in:
- lib/fastly/api/backend_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_backend(opts = {}) ⇒ BackendResponse
Create a backend Create a backend for a particular service and version.
-
#create_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Create a backend Create a backend for a particular service and version.
-
#delete_backend(opts = {}) ⇒ InlineResponse200
Delete a backend Delete the backend for a particular service and version.
-
#delete_backend_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>
Delete a backend Delete the backend for a particular service and version.
-
#get_backend(opts = {}) ⇒ BackendResponse
Describe a backend Get the backend for a particular service and version.
-
#get_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Describe a backend Get the backend for a particular service and version.
-
#initialize(api_client = ApiClient.default) ⇒ BackendApi
constructor
A new instance of BackendApi.
-
#list_backends(opts = {}) ⇒ Array<BackendResponse>
List backends List all backends for a particular service and version.
-
#list_backends_with_http_info(opts = {}) ⇒ Array<(Array<BackendResponse>, Integer, Hash)>
List backends List all backends for a particular service and version.
-
#update_backend(opts = {}) ⇒ BackendResponse
Update a backend Update the backend for a particular service and version.
-
#update_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Update a backend Update the backend for a particular service and version.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ BackendApi
Returns a new instance of BackendApi.
17 18 19 |
# File 'lib/fastly/api/backend_api.rb', line 17 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
15 16 17 |
# File 'lib/fastly/api/backend_api.rb', line 15 def api_client @api_client end |
Instance Method Details
#create_backend(opts = {}) ⇒ BackendResponse
Create a backend Create a backend for a particular service and version.
56 57 58 59 |
# File 'lib/fastly/api/backend_api.rb', line 56 def create_backend(opts = {}) data, _status_code, _headers = create_backend_with_http_info(opts) data end |
#create_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Create a backend Create a backend for a particular service and version.
97 98 99 100 101 102 103 104 105 106 107 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/fastly/api/backend_api.rb', line 97 def create_backend_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BackendApi.create_backend ...' end # unbox the parameters from the hash service_id = opts[:'service_id'] version_id = opts[:'version_id'] # verify the required parameter 'service_id' is set if @api_client.config.client_side_validation && service_id.nil? fail ArgumentError, "Missing the required parameter 'service_id' when calling BackendApi.create_backend" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling BackendApi.create_backend" end pattern = Regexp.new(/^[A-Za-z0-9]+$/) if @api_client.config.client_side_validation && !opts[:'share_key'].nil? && opts[:'share_key'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"share_key\"]' when calling BackendApi.create_backend, must conform to the pattern #{pattern}." end # resource path local_var_path = '/service/{service_id}/version/{version_id}/backend'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['address'] = opts[:'address'] if !opts[:'address'].nil? form_params['auto_loadbalance'] = opts[:'auto_loadbalance'] if !opts[:'auto_loadbalance'].nil? form_params['between_bytes_timeout'] = opts[:'between_bytes_timeout'] if !opts[:'between_bytes_timeout'].nil? form_params['client_cert'] = opts[:'client_cert'] if !opts[:'client_cert'].nil? form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil? form_params['connect_timeout'] = opts[:'connect_timeout'] if !opts[:'connect_timeout'].nil? form_params['first_byte_timeout'] = opts[:'first_byte_timeout'] if !opts[:'first_byte_timeout'].nil? form_params['healthcheck'] = opts[:'healthcheck'] if !opts[:'healthcheck'].nil? form_params['hostname'] = opts[:'hostname'] if !opts[:'hostname'].nil? form_params['ipv4'] = opts[:'ipv4'] if !opts[:'ipv4'].nil? form_params['ipv6'] = opts[:'ipv6'] if !opts[:'ipv6'].nil? form_params['keepalive_time'] = opts[:'keepalive_time'] if !opts[:'keepalive_time'].nil? form_params['max_conn'] = opts[:'max_conn'] if !opts[:'max_conn'].nil? form_params['max_tls_version'] = opts[:'max_tls_version'] if !opts[:'max_tls_version'].nil? form_params['min_tls_version'] = opts[:'min_tls_version'] if !opts[:'min_tls_version'].nil? form_params['name'] = opts[:'name'] if !opts[:'name'].nil? form_params['override_host'] = opts[:'override_host'] if !opts[:'override_host'].nil? form_params['port'] = opts[:'port'] if !opts[:'port'].nil? form_params['request_condition'] = opts[:'request_condition'] if !opts[:'request_condition'].nil? form_params['share_key'] = opts[:'share_key'] if !opts[:'share_key'].nil? form_params['shield'] = opts[:'shield'] if !opts[:'shield'].nil? form_params['ssl_ca_cert'] = opts[:'ssl_ca_cert'] if !opts[:'ssl_ca_cert'].nil? form_params['ssl_cert_hostname'] = opts[:'ssl_cert_hostname'] if !opts[:'ssl_cert_hostname'].nil? form_params['ssl_check_cert'] = opts[:'ssl_check_cert'] if !opts[:'ssl_check_cert'].nil? form_params['ssl_ciphers'] = opts[:'ssl_ciphers'] if !opts[:'ssl_ciphers'].nil? form_params['ssl_client_cert'] = opts[:'ssl_client_cert'] if !opts[:'ssl_client_cert'].nil? form_params['ssl_client_key'] = opts[:'ssl_client_key'] if !opts[:'ssl_client_key'].nil? form_params['ssl_hostname'] = opts[:'ssl_hostname'] if !opts[:'ssl_hostname'].nil? form_params['ssl_sni_hostname'] = opts[:'ssl_sni_hostname'] if !opts[:'ssl_sni_hostname'].nil? form_params['use_ssl'] = opts[:'use_ssl'] if !opts[:'use_ssl'].nil? form_params['weight'] = opts[:'weight'] if !opts[:'weight'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BackendResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"BackendApi.create_backend", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BackendApi#create_backend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_backend(opts = {}) ⇒ InlineResponse200
Delete a backend Delete the backend for a particular service and version.
199 200 201 202 |
# File 'lib/fastly/api/backend_api.rb', line 199 def delete_backend(opts = {}) data, _status_code, _headers = delete_backend_with_http_info(opts) data end |
#delete_backend_with_http_info(opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>
Delete a backend Delete the backend for a particular service and version.
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/fastly/api/backend_api.rb', line 210 def delete_backend_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BackendApi.delete_backend ...' end # unbox the parameters from the hash service_id = opts[:'service_id'] version_id = opts[:'version_id'] backend_name = opts[:'backend_name'] # verify the required parameter 'service_id' is set if @api_client.config.client_side_validation && service_id.nil? fail ArgumentError, "Missing the required parameter 'service_id' when calling BackendApi.delete_backend" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling BackendApi.delete_backend" end # verify the required parameter 'backend_name' is set if @api_client.config.client_side_validation && backend_name.nil? fail ArgumentError, "Missing the required parameter 'backend_name' when calling BackendApi.delete_backend" end # resource path local_var_path = '/service/{service_id}/version/{version_id}/backend/{backend_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'backend_name' + '}', CGI.escape(backend_name.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineResponse200' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"BackendApi.delete_backend", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BackendApi#delete_backend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_backend(opts = {}) ⇒ BackendResponse
Describe a backend Get the backend for a particular service and version.
276 277 278 279 |
# File 'lib/fastly/api/backend_api.rb', line 276 def get_backend(opts = {}) data, _status_code, _headers = get_backend_with_http_info(opts) data end |
#get_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Describe a backend Get the backend for a particular service and version.
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 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/fastly/api/backend_api.rb', line 287 def get_backend_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BackendApi.get_backend ...' end # unbox the parameters from the hash service_id = opts[:'service_id'] version_id = opts[:'version_id'] backend_name = opts[:'backend_name'] # verify the required parameter 'service_id' is set if @api_client.config.client_side_validation && service_id.nil? fail ArgumentError, "Missing the required parameter 'service_id' when calling BackendApi.get_backend" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling BackendApi.get_backend" end # verify the required parameter 'backend_name' is set if @api_client.config.client_side_validation && backend_name.nil? fail ArgumentError, "Missing the required parameter 'backend_name' when calling BackendApi.get_backend" end # resource path local_var_path = '/service/{service_id}/version/{version_id}/backend/{backend_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'backend_name' + '}', CGI.escape(backend_name.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BackendResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"BackendApi.get_backend", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BackendApi#get_backend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_backends(opts = {}) ⇒ Array<BackendResponse>
List backends List all backends for a particular service and version.
352 353 354 355 |
# File 'lib/fastly/api/backend_api.rb', line 352 def list_backends(opts = {}) data, _status_code, _headers = list_backends_with_http_info(opts) data end |
#list_backends_with_http_info(opts = {}) ⇒ Array<(Array<BackendResponse>, Integer, Hash)>
List backends List all backends for a particular service and version.
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 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/fastly/api/backend_api.rb', line 362 def list_backends_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BackendApi.list_backends ...' end # unbox the parameters from the hash service_id = opts[:'service_id'] version_id = opts[:'version_id'] # verify the required parameter 'service_id' is set if @api_client.config.client_side_validation && service_id.nil? fail ArgumentError, "Missing the required parameter 'service_id' when calling BackendApi.list_backends" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling BackendApi.list_backends" end # resource path local_var_path = '/service/{service_id}/version/{version_id}/backend'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<BackendResponse>' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"BackendApi.list_backends", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BackendApi#list_backends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_backend(opts = {}) ⇒ BackendResponse
Update a backend Update the backend for a particular service and version.
454 455 456 457 |
# File 'lib/fastly/api/backend_api.rb', line 454 def update_backend(opts = {}) data, _status_code, _headers = update_backend_with_http_info(opts) data end |
#update_backend_with_http_info(opts = {}) ⇒ Array<(BackendResponse, Integer, Hash)>
Update a backend Update the backend for a particular service and version.
496 497 498 499 500 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 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 |
# File 'lib/fastly/api/backend_api.rb', line 496 def update_backend_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BackendApi.update_backend ...' end # unbox the parameters from the hash service_id = opts[:'service_id'] version_id = opts[:'version_id'] backend_name = opts[:'backend_name'] # verify the required parameter 'service_id' is set if @api_client.config.client_side_validation && service_id.nil? fail ArgumentError, "Missing the required parameter 'service_id' when calling BackendApi.update_backend" end # verify the required parameter 'version_id' is set if @api_client.config.client_side_validation && version_id.nil? fail ArgumentError, "Missing the required parameter 'version_id' when calling BackendApi.update_backend" end # verify the required parameter 'backend_name' is set if @api_client.config.client_side_validation && backend_name.nil? fail ArgumentError, "Missing the required parameter 'backend_name' when calling BackendApi.update_backend" end pattern = Regexp.new(/^[A-Za-z0-9]+$/) if @api_client.config.client_side_validation && !opts[:'share_key'].nil? && opts[:'share_key'] !~ pattern fail ArgumentError, "invalid value for 'opts[:\"share_key\"]' when calling BackendApi.update_backend, must conform to the pattern #{pattern}." end # resource path local_var_path = '/service/{service_id}/version/{version_id}/backend/{backend_name}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'backend_name' + '}', CGI.escape(backend_name.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']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['address'] = opts[:'address'] if !opts[:'address'].nil? form_params['auto_loadbalance'] = opts[:'auto_loadbalance'] if !opts[:'auto_loadbalance'].nil? form_params['between_bytes_timeout'] = opts[:'between_bytes_timeout'] if !opts[:'between_bytes_timeout'].nil? form_params['client_cert'] = opts[:'client_cert'] if !opts[:'client_cert'].nil? form_params['comment'] = opts[:'comment'] if !opts[:'comment'].nil? form_params['connect_timeout'] = opts[:'connect_timeout'] if !opts[:'connect_timeout'].nil? form_params['first_byte_timeout'] = opts[:'first_byte_timeout'] if !opts[:'first_byte_timeout'].nil? form_params['healthcheck'] = opts[:'healthcheck'] if !opts[:'healthcheck'].nil? form_params['hostname'] = opts[:'hostname'] if !opts[:'hostname'].nil? form_params['ipv4'] = opts[:'ipv4'] if !opts[:'ipv4'].nil? form_params['ipv6'] = opts[:'ipv6'] if !opts[:'ipv6'].nil? form_params['keepalive_time'] = opts[:'keepalive_time'] if !opts[:'keepalive_time'].nil? form_params['max_conn'] = opts[:'max_conn'] if !opts[:'max_conn'].nil? form_params['max_tls_version'] = opts[:'max_tls_version'] if !opts[:'max_tls_version'].nil? form_params['min_tls_version'] = opts[:'min_tls_version'] if !opts[:'min_tls_version'].nil? form_params['name'] = opts[:'name'] if !opts[:'name'].nil? form_params['override_host'] = opts[:'override_host'] if !opts[:'override_host'].nil? form_params['port'] = opts[:'port'] if !opts[:'port'].nil? form_params['request_condition'] = opts[:'request_condition'] if !opts[:'request_condition'].nil? form_params['share_key'] = opts[:'share_key'] if !opts[:'share_key'].nil? form_params['shield'] = opts[:'shield'] if !opts[:'shield'].nil? form_params['ssl_ca_cert'] = opts[:'ssl_ca_cert'] if !opts[:'ssl_ca_cert'].nil? form_params['ssl_cert_hostname'] = opts[:'ssl_cert_hostname'] if !opts[:'ssl_cert_hostname'].nil? form_params['ssl_check_cert'] = opts[:'ssl_check_cert'] if !opts[:'ssl_check_cert'].nil? form_params['ssl_ciphers'] = opts[:'ssl_ciphers'] if !opts[:'ssl_ciphers'].nil? form_params['ssl_client_cert'] = opts[:'ssl_client_cert'] if !opts[:'ssl_client_cert'].nil? form_params['ssl_client_key'] = opts[:'ssl_client_key'] if !opts[:'ssl_client_key'].nil? form_params['ssl_hostname'] = opts[:'ssl_hostname'] if !opts[:'ssl_hostname'].nil? form_params['ssl_sni_hostname'] = opts[:'ssl_sni_hostname'] if !opts[:'ssl_sni_hostname'].nil? form_params['use_ssl'] = opts[:'use_ssl'] if !opts[:'use_ssl'].nil? form_params['weight'] = opts[:'weight'] if !opts[:'weight'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BackendResponse' # auth_names auth_names = opts[:debug_auth_names] || ['token'] = opts.merge( :operation => :"BackendApi.update_backend", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: BackendApi#update_backend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |