class QingStor::SDK::Service

QingStor provides QingStor Service API (API Version 2016-01-06)

Attributes

config[RW]
properties[RW]

Public Class Methods

new(config) click to toggle source
# File lib/qingstor/sdk/service/qingstor.rb, line 27
def initialize(config)
  config.check
  self.config = config
end

Public Instance Methods

bucket(bucket_name, zone) click to toggle source
# File lib/qingstor/sdk/service/qingstor.rb, line 76
def bucket(bucket_name, zone)
  properties = {
    'bucket-name' => bucket_name,
    'zone'        => zone
  }
  Bucket.new(config, properties)
end
list_buckets(limit: nil, offset: nil, location: '') click to toggle source

list_buckets: Retrieve the bucket list. Documentation URL: docs.qingcloud.com/qingstor/api/service/get.html

# File lib/qingstor/sdk/service/qingstor.rb, line 34
def list_buckets(limit: nil,
                 offset: nil, location: '')
  request = list_buckets_request limit: limit,
    offset: offset, location: location
  request.send
end
list_buckets_request(limit: nil, offset: nil, location: '') click to toggle source
# File lib/qingstor/sdk/service/qingstor.rb, line 41
def list_buckets_request(limit: nil,
                         offset: nil, location: '')
  input = {
    config:           config,
    api_name:         'Get Service',
    request_method:   'GET',
    request_uri:      '/',
    request_params:   {
      'limit'  => limit,
      'offset' => offset
    },
    request_headers:  {
      'Location' => location
    },
    request_elements: {
    },
    request_body:     nil,

    status_code:      [
      200
    ]
  }

  list_buckets_input_validate input
  Request.new input
end

Private Instance Methods

list_buckets_input_validate(input) click to toggle source
# File lib/qingstor/sdk/service/qingstor.rb, line 70
def list_buckets_input_validate(input)
  input.deep_stringify_keys!
end