Class: Fog::DNS::HuaweiCloud::V1::Real
- Inherits:
-
Object
- Object
- Fog::DNS::HuaweiCloud::V1::Real
- Includes:
- HuaweiCloud::Core
- Defined in:
- lib/fog/dns/huaweicloud/v1.rb,
lib/fog/dns/huaweicloud/v1/requests/get_quota.rb,
lib/fog/dns/huaweicloud/v1/requests/list_domains.rb,
lib/fog/dns/huaweicloud/v1/requests/update_quota.rb
Class Method Summary collapse
Instance Method Summary collapse
- #get_quota(project_id) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #list_domains(options = {}) ⇒ Object
- #set_api_path ⇒ Object
- #update_quota(project_id, options = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fog/dns/huaweicloud/v1.rb', line 105 def initialize( = {}) initialize_identity @huaweicloud_service_type = [:huaweicloud_service_type] || ['dns'] @huaweicloud_service_name = [:huaweicloud_service_name] = [:connection_options] || {} authenticate set_api_path @persistent = [:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, ) end |
Class Method Details
.not_found_class ⇒ Object
101 102 103 |
# File 'lib/fog/dns/huaweicloud/v1.rb', line 101 def self.not_found_class Fog::DNS::HuaweiCloud::NotFound end |
Instance Method Details
#get_quota(project_id) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/fog/dns/huaweicloud/v1/requests/get_quota.rb', line 6 def get_quota(project_id) request( :expects => 200, :method => 'GET', :path => "quotas/#{project_id}" ) end |
#list_domains(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/fog/dns/huaweicloud/v1/requests/list_domains.rb', line 6 def list_domains( = {}) request( :expects => 200, :method => 'GET', :path => 'domains', :query => ) end |
#set_api_path ⇒ Object
119 120 121 122 123 |
# File 'lib/fog/dns/huaweicloud/v1.rb', line 119 def set_api_path # version explicitly set to allow usage also in 'DEPRECATED' mitaka version, # where f.i. quota modification was not possible at the time of creation @path = '/v1' unless @path =~ /v1/ end |
#update_quota(project_id, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/fog/dns/huaweicloud/v1/requests/update_quota.rb', line 6 def update_quota(project_id, = {}) request( :body => Fog::JSON.encode(), :expects => 200, :method => 'PUT', :path => "quotas/#{project_id}" ) end |