Class: Fog::ContainerInfra::HuaweiCloud::Real
- Inherits:
-
Object
- Object
- Fog::ContainerInfra::HuaweiCloud::Real
- Includes:
- HuaweiCloud::Core
- Defined in:
- lib/fog/container_infra/huaweicloud.rb,
lib/fog/container_infra/huaweicloud/requests/get_bay.rb,
lib/fog/container_infra/huaweicloud/requests/list_bays.rb,
lib/fog/container_infra/huaweicloud/requests/create_bay.rb,
lib/fog/container_infra/huaweicloud/requests/delete_bay.rb,
lib/fog/container_infra/huaweicloud/requests/update_bay.rb,
lib/fog/container_infra/huaweicloud/requests/get_cluster.rb,
lib/fog/container_infra/huaweicloud/requests/get_bay_model.rb,
lib/fog/container_infra/huaweicloud/requests/list_clusters.rb,
lib/fog/container_infra/huaweicloud/requests/create_cluster.rb,
lib/fog/container_infra/huaweicloud/requests/delete_cluster.rb,
lib/fog/container_infra/huaweicloud/requests/update_cluster.rb,
lib/fog/container_infra/huaweicloud/requests/get_certificate.rb,
lib/fog/container_infra/huaweicloud/requests/list_bay_models.rb,
lib/fog/container_infra/huaweicloud/requests/create_bay_model.rb,
lib/fog/container_infra/huaweicloud/requests/delete_bay_model.rb,
lib/fog/container_infra/huaweicloud/requests/update_bay_model.rb,
lib/fog/container_infra/huaweicloud/requests/create_certificate.rb,
lib/fog/container_infra/huaweicloud/requests/get_cluster_template.rb,
lib/fog/container_infra/huaweicloud/requests/list_cluster_templates.rb,
lib/fog/container_infra/huaweicloud/requests/create_cluster_template.rb,
lib/fog/container_infra/huaweicloud/requests/delete_cluster_template.rb,
lib/fog/container_infra/huaweicloud/requests/update_cluster_template.rb
Class Method Summary collapse
Instance Method Summary collapse
- #create_bay(params) ⇒ Object
- #create_bay_model(params) ⇒ Object
- #create_certificate(params) ⇒ Object
- #create_cluster(params) ⇒ Object
- #create_cluster_template(params) ⇒ Object
- #delete_bay(uuid_or_name) ⇒ Object
- #delete_bay_model(uuid_or_name) ⇒ Object
- #delete_cluster(uuid_or_name) ⇒ Object
- #delete_cluster_template(uuid_or_name) ⇒ Object
- #get_bay(uuid_or_name) ⇒ Object
- #get_bay_model(uuid_or_name) ⇒ Object
- #get_certificate(bay_uuid) ⇒ Object
- #get_cluster(uuid_or_name) ⇒ Object
- #get_cluster_template(uuid_or_name) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #list_bay_models ⇒ Object
- #list_bays ⇒ Object
- #list_cluster_templates ⇒ Object
- #list_clusters ⇒ Object
- #request(options = {}) ⇒ Object
- #set_api_path ⇒ Object
- #update_bay(uuid_or_name, params) ⇒ Object
- #update_bay_model(uuid_or_name, params) ⇒ Object
- #update_cluster(uuid_or_name, params) ⇒ Object
- #update_cluster_template(uuid_or_name, params) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/fog/container_infra/huaweicloud.rb', line 129 def initialize( = {}) initialize_identity @huaweicloud_service_type = [:huaweicloud_service_type] || ['container-infra'] @huaweicloud_service_name = [:huaweicloud_service_name] @huaweicloud_endpoint_type = [:huaweicloud_endpoint_type] || 'publicURL' @connection_options = [:connection_options] || {} authenticate set_api_path @persistent = [:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end |
Class Method Details
.not_found_class ⇒ Object
125 126 127 |
# File 'lib/fog/container_infra/huaweicloud.rb', line 125 def self.not_found_class Fog::ContainerInfra::HuaweiCloud::NotFound end |
Instance Method Details
#create_bay(params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/create_bay.rb', line 5 def create_bay(params) request( :expects => [202, 201, 200], :method => 'POST', :path => "bays", :body => Fog::JSON.encode(params) ) end |
#create_bay_model(params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/create_bay_model.rb', line 5 def create_bay_model(params) request( :expects => [201, 200], :method => 'POST', :path => "baymodels", :body => Fog::JSON.encode(params) ) end |
#create_certificate(params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/create_certificate.rb', line 5 def create_certificate(params) request( :expects => [201, 200], :method => 'POST', :path => "certificates", :body => Fog::JSON.encode(params) ) end |
#create_cluster(params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/create_cluster.rb', line 5 def create_cluster(params) request( :expects => [202, 201, 200], :method => 'POST', :path => "clusters", :body => Fog::JSON.encode(params) ) end |
#create_cluster_template(params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/create_cluster_template.rb', line 5 def create_cluster_template(params) request( :expects => [201, 200], :method => 'POST', :path => "clustertemplates", :body => Fog::JSON.encode(params) ) end |
#delete_bay(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/delete_bay.rb', line 5 def delete_bay(uuid_or_name) request( :expects => [204], :method => 'DELETE', :path => "bays/#{uuid_or_name}" ) end |
#delete_bay_model(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/delete_bay_model.rb', line 5 def delete_bay_model(uuid_or_name) request( :expects => [204], :method => 'DELETE', :path => "baymodels/#{uuid_or_name}" ) end |
#delete_cluster(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/delete_cluster.rb', line 5 def delete_cluster(uuid_or_name) request( :expects => [204], :method => 'DELETE', :path => "clusters/#{uuid_or_name}" ) end |
#delete_cluster_template(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/delete_cluster_template.rb', line 5 def delete_cluster_template(uuid_or_name) request( :expects => [204], :method => 'DELETE', :path => "clustertemplates/#{uuid_or_name}" ) end |
#get_bay(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/get_bay.rb', line 5 def get_bay(uuid_or_name) request( :expects => [200], :method => 'GET', :path => "bays/#{uuid_or_name}" ) end |
#get_bay_model(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/get_bay_model.rb', line 5 def get_bay_model(uuid_or_name) request( :expects => [200], :method => 'GET', :path => "baymodels/#{uuid_or_name}" ) end |
#get_certificate(bay_uuid) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/get_certificate.rb', line 5 def get_certificate(bay_uuid) request( :expects => [200], :method => 'GET', :path => "certificates/#{cluster_uuid}" ) end |
#get_cluster(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/get_cluster.rb', line 5 def get_cluster(uuid_or_name) request( :expects => [200], :method => 'GET', :path => "clusters/#{uuid_or_name}" ) end |
#get_cluster_template(uuid_or_name) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/get_cluster_template.rb', line 5 def get_cluster_template(uuid_or_name) request( :expects => [200], :method => 'GET', :path => "clustertemplates/#{uuid_or_name}" ) end |
#list_bay_models ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/list_bay_models.rb', line 5 def list_bay_models request( :expects => [200], :method => 'GET', :path => "baymodels/detail" ) end |
#list_bays ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/list_bays.rb', line 5 def list_bays request( :expects => [200], :method => 'GET', :path => "bays/detail" ) end |
#list_cluster_templates ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/list_cluster_templates.rb', line 5 def list_cluster_templates request( :expects => [200], :method => 'GET', :path => "clustertemplates/detail" ) end |
#list_clusters ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fog/container_infra/huaweicloud/requests/list_clusters.rb', line 5 def list_clusters request( :expects => [200], :method => 'GET', :path => "clusters/detail" ) end |
#request(options = {}) ⇒ Object
145 146 147 148 |
# File 'lib/fog/container_infra/huaweicloud.rb', line 145 def request( = {}) [:headers] = {'HuaweiCloud-API-Version' => "container-infra #{SUPPORTED_MICROVERSION}"} super() end |
#set_api_path ⇒ Object
150 151 152 153 154 155 156 157 158 159 |
# File 'lib/fog/container_infra/huaweicloud.rb', line 150 def set_api_path unless @path.match(SUPPORTED_VERSIONS) @path = Fog::HuaweiCloud.get_supported_version_path( SUPPORTED_VERSIONS, @huaweicloud_management_uri, @auth_token, @connection_options ) end end |
#update_bay(uuid_or_name, params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/update_bay.rb', line 5 def update_bay(uuid_or_name, params) request( :expects => [202, 200], :method => 'PATCH', :path => "bays/#{uuid_or_name}", :body => Fog::JSON.encode(params) ) end |
#update_bay_model(uuid_or_name, params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/update_bay_model.rb', line 5 def update_bay_model(uuid_or_name, params) request( :expects => [200], :method => 'PATCH', :path => "baymodels/#{uuid_or_name}", :body => Fog::JSON.encode(params) ) end |
#update_cluster(uuid_or_name, params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/update_cluster.rb', line 5 def update_cluster(uuid_or_name, params) request( :expects => [202, 200], :method => 'PATCH', :path => "clusters/#{uuid_or_name}", :body => Fog::JSON.encode(params) ) end |
#update_cluster_template(uuid_or_name, params) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/fog/container_infra/huaweicloud/requests/update_cluster_template.rb', line 5 def update_cluster_template(uuid_or_name, params) request( :expects => [200], :method => 'PATCH', :path => "clustertemplates/#{uuid_or_name}", :body => Fog::JSON.encode(params) ) end |