Class: Kamal::Providers::Base
- Inherits:
-
Object
- Object
- Kamal::Providers::Base
- Defined in:
- lib/kamal/providers/base.rb
Overview
Abstract base class defining the provider adapter interface All cloud provider implementations must inherit from this class and implement the required methods.
Example implementation:
class MyProvider < Kamal::Providers::Base
def provision_vm(config)
# Implementation here
end
end
Direct Known Subclasses
Instance Method Summary collapse
-
#destroy_vm(vm_id) ⇒ Boolean
Destroy VM and cleanup all associated resources.
-
#estimate_cost(config) ⇒ Hash
Estimate monthly cost for VM configuration.
-
#provision_vm(config) ⇒ Hash
Provision a new VM.
-
#query_status(vm_id) ⇒ Symbol
Query VM status.
Instance Method Details
#destroy_vm(vm_id) ⇒ Boolean
Destroy VM and cleanup all associated resources
98 99 100 |
# File 'lib/kamal/providers/base.rb', line 98 def destroy_vm(vm_id) raise NotImplementedError, "#{self.class}#destroy_vm must be implemented" end |
#estimate_cost(config) ⇒ Hash
Estimate monthly cost for VM configuration
This provides generic cost guidance and pricing page link. Real-time pricing queries are not implemented in Phase 1.
116 117 118 |
# File 'lib/kamal/providers/base.rb', line 116 def estimate_cost(config) raise NotImplementedError, "#{self.class}#estimate_cost must be implemented" end |
#provision_vm(config) ⇒ Hash
Provision a new VM
72 73 74 |
# File 'lib/kamal/providers/base.rb', line 72 def provision_vm(config) raise NotImplementedError, "#{self.class}#provision_vm must be implemented" end |
#query_status(vm_id) ⇒ Symbol
Query VM status
87 88 89 |
# File 'lib/kamal/providers/base.rb', line 87 def query_status(vm_id) raise NotImplementedError, "#{self.class}#query_status must be implemented" end |