-
-
Notifications
You must be signed in to change notification settings - Fork 0
Cloudways Ruby Server Endpoints
This gem provides a Ruby client for interacting with Cloudways server endpoints, enabling management of servers using Cloudways' API. Below are the available server endpoints and their usage.
Add this line to your application's Gemfile:
gem 'ruby_api_pack_cloudways'And then execute:
bundle installSet up configuration for Cloudways API access in your application:
RubyApiPackCloudways.configure do |config|
config.api_url = 'https://api.cloudways.com/api/v1'
config.api_email = 'your_email'
config.api_key = 'your_api_key'
endBelow is a list of all available server endpoints provided by the CwServer class in the ruby_api_pack_cloudways gem.
Fetches a list of all servers.
RubyApiPackCloudways::Api::CwServer.server_listRetrieves details for a specific server by server_id.
RubyApiPackCloudways::Api::CwServer.server_details(server_id)Attaches block storage to a server.
RubyApiPackCloudways::Api::CwServer.attach_block_storage(server_id, { storage_size: 100 })Creates a clone of an existing server.
RubyApiPackCloudways::Api::CwServer.clone_server(server_id, { name: 'new_server' })Creates a new server with specified parameters.
RubyApiPackCloudways::Api::CwServer.create_server({ server_name: 'my_server', ... })Deletes a server identified by server_id.
RubyApiPackCloudways::Api::CwServer.delete_server(server_id)Retrieves the disk usage information for a server.
RubyApiPackCloudways::Api::CwServer.disk_usage(server_id)Restarts a specific server by server_id.
RubyApiPackCloudways::Api::CwServer.restart_server(server_id)Scales the block storage of a server.
RubyApiPackCloudways::Api::CwServer.scale_block_storage(server_id, { new_size: 200 })Scales the volume size of a server.
RubyApiPackCloudways::Api::CwServer.scale_volume_size(server_id, { new_size: 500 })Starts a specific server.
RubyApiPackCloudways::Api::CwServer.start_server(server_id)Stops a specific server.
RubyApiPackCloudways::Api::CwServer.stop_server(server_id)Updates the label of a server.
RubyApiPackCloudways::Api::CwServer.update_server_label(server_id, { label: 'New Server Label' })Upgrades the server to a new plan or configuration.
RubyApiPackCloudways::Api::CwServer.upgrade_server(server_id, { plan: 'premium' })