class Fog::Compute::OneAndOne::MonitoringPolicy

Public Instance Methods

add_ports(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 55
def add_ports(options = {})

  requires :id

  response = service.add_ports(monitoring_policy_id: id,
    ports: options[:ports])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
add_processes(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 100
def add_processes(options = {})

  requires :id

  response = service.add_processes(monitoring_policy_id: id,
    processes: options[:processes])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
add_servers(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 146
def add_servers(options = {})

  requires :id

  response = service.add_mp_servers(monitoring_policy_id: id,
    servers: options[:servers])

  # Decode and Merge Attributes
  merge_attributes(response.body)

  true

end
delete_port(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 70
def delete_port(options = {})

  requires :id

  response = service.delete_port(monitoring_policy_id: id,
    port_id: options[:port_id])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
delete_process(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 115
def delete_process(options = {})

  requires :id

  response = service.delete_process(monitoring_policy_id: id,
    process_id: options[:process_id])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
destroy() click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 176
def destroy

  requires :id

  service.delete_monitoring_policy(id)
  
  true

end
ready?() click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 187
def ready?

  state == 'ACTIVE'

end
remove_server(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 161
def remove_server(options = {})

  requires :id

  response = service.remove_mp_server(monitoring_policy_id: id,
    server_id: options[:server_id])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
save() click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 22
def save

  requires :name, :agent, :email, :thresholds, :ports, :processes

  # Perform Request
  response = service.create_monitoring_policy(name: name,
    description: description, email: email, agent: agent,
    thresholds: thresholds, ports: ports, processes: processes)

  # Merge Attributes
  merge_attributes(response.body)

  true

end
update(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 39
def update(options = {})

  requires :id

  response = service.update_monitoring_policy(monitoring_policy_id: id,
    name: options[:name], description: options[:description],
    email: options[:email], thresholds: options[:thresholds])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
update_port(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 85
def update_port(options = {})

  requires :id

  response = service.update_port(monitoring_policy_id: id,
    port_id: options[:port_id], new_port: options[:new_port])

  # Merge Attributes
  merge_attributes(response.body)

  true

end
update_process(options = {}) click to toggle source
# File lib/oneandone/models/compute/monitoring_policy.rb, line 130
def update_process(options = {})

  requires :id

  response = service.update_process(monitoring_policy_id: id,
    process_id: options[:process_id],
    new_process: options[:new_process])

  # Merge Attributes
  merge_attributes(response.body)

  true

end