Class: Ovh::Api::Api::Vps::Tasks
- Inherits:
-
Object
- Object
- Ovh::Api::Api::Vps::Tasks
- Defined in:
- lib/ovh-api/api/vps/tasks.rb
Instance Method Summary collapse
- #get(id:, service_name:) ⇒ Object
-
#initialize(connection) ⇒ Tasks
constructor
A new instance of Tasks.
- #list(service_name:, state: nil, type: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Tasks
Returns a new instance of Tasks.
6 7 8 |
# File 'lib/ovh-api/api/vps/tasks.rb', line 6 def initialize(connection) @connection = connection end |
Instance Method Details
#get(id:, service_name:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ovh-api/api/vps/tasks.rb', line 10 def get(id:, service_name:) raise ArgumentError, 'id is required' if id.nil? raise ArgumentError, 'service_name is required' if service_name.nil? @connection.call( :GET, '/vps/{serviceName}/tasks/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)) .gsub('{serviceName}', ERB::Util.url_encode(service_name.to_s)), type: nil, auth: [] ) end |
#list(service_name:, state: nil, type: nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ovh-api/api/vps/tasks.rb', line 24 def list(service_name:, state: nil, type: nil) raise ArgumentError, 'service_name is required' if service_name.nil? @connection.call( :GET, '/vps/{serviceName}/tasks' .gsub('{serviceName}', ERB::Util.url_encode(service_name.to_s)), type: nil, auth: [], query: { 'state' => state, 'type' => type } ) end |