Class: QingStor::SDK::Service
- Inherits:
-
Object
- Object
- QingStor::SDK::Service
- Defined in:
- lib/qingstor/sdk/service/qingstor.rb
Overview
QingStor provides QingStor Service API (API Version 2016-01-06)
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
- #bucket(bucket_name, zone) ⇒ Object
-
#initialize(config) ⇒ Service
constructor
A new instance of Service.
-
#list_buckets(location: '') ⇒ Object
list_buckets: Retrieve the bucket list.
- #list_buckets_request(location: '') ⇒ Object
Constructor Details
#initialize(config) ⇒ Service
Returns a new instance of Service.
27 28 29 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 27 def initialize(config) self.config = config end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
25 26 27 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 25 def config @config end |
#properties ⇒ Object
Returns the value of attribute properties.
25 26 27 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 25 def properties @properties end |
Instance Method Details
#bucket(bucket_name, zone) ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 69 def bucket(bucket_name, zone) properties = { 'bucket-name' => bucket_name, 'zone' => zone, } Bucket.new(config, properties) end |
#list_buckets(location: '') ⇒ Object
list_buckets: Retrieve the bucket list. Documentation URL: docs.qingcloud.com/qingstor/api/service/get.html
33 34 35 36 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 33 def list_buckets(location: '') request = list_buckets_request location: location request.send end |
#list_buckets_request(location: '') ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/qingstor/sdk/service/qingstor.rb', line 38 def list_buckets_request(location: '') input = { config: config, api_name: 'Get Service', request_method: 'GET', request_uri: '/', request_params: { }, request_headers: { 'Location' => location, }, request_elements: { }, request_body: nil, status_code: [ 200, # OK ], } list_buckets_input_validate input Request.new input end |