Build Status

Xcal::Parktronic

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'xcal-parktronic'

And then execute:

$ bundle

Or install it yourself as:

$ gem install xcal-parktronic

RDocs

You can view documentation in RDoc format here:

http://rubydoc.info/gems/xcal-parktronic/frames

Usage

Initialization:

api = ParkClient.new(access_token: 'your_access_token', endpoint: 'http://api_host')
api = Xcal::Parktronic::ApiClient.new(access_token: 'your_access_token', endpoint: 'http://api_host')
api = Xcal::Parktronic::ApiClient.new(access_token: 'your_access_token', endpoint: 'http://api_host', memcached_host: 'localhost:11211')

Alarms:

api.alarms
api.alarm( alarm_id )
api.update_alarm( alarm_id, alarm_param_1: 'value', alarm_param_2: 'value', ... )
api.alarm_tags( alarm_id )

api.post_alarm( alarm: alarm_params )
api.post_alarm( alarm: alarm_params, events: [event_1_params, event_2_params, ...] )

api.search_alarm(name: 'test alarm')
api.search_alarm(tagged_with: 'test alarm', time_range: 120)
api.search_alarm(where: {impact_level: 'Unknown', originating_system: 'test'}, time_range: 120)
api.search_alarm(extends: ['latest_event', 'with_most_recent_events'], time_range: 120)

api.brouha_products_services

Alarm Actions

api.alarm( alarm_id ).get_alarm_actions
api.alarm( alarm_id ).get_alarm_action( alarm_action_id )
api.alarm( alarm_id ).post_alarm_action( alarm_action_params )
api.alarm( alarm_id ).update_alarm_action( alarm_action_id, alarm_action_param_1: 'value', alarm_action_param_2: 'value', ... )
api.alarm( alarm_id ).set_position( alarm_action_id, position )

Events

api.event( event_id )
api.update_event( event_id, event_param_1: 'value', event_param_2: 'value', ... )
api.event_tags( event_id )

api.alarm( alarm_id ).get_events( page: 2, per_page: 4 )
api.alarm( alarm_id ).get_all_events
api.alarm( alarm_id ).post_event( event_params )

api.search_events(search: {subject: 'test event', incident_ticket_id: '23'})
api.search_events(scopes: {tagged_with: 'test event tag', general_filter: 'ticketed'})
api.search_events(where: {event_status: 'Critical', incident_ticket_id: 'IFS-23'})
api.search_events(extends: ['alarm_impact_level'])

Events history

api.events_history
api.events_history( page: 2, per_page: 5 )
api.events_history( host_impacted: 'xre-host-1', service_impacted: 'xre' )

Metrics

api.metrics
api.metrics(page: 2, per_page: 5)
api.metric( metric_id )
api.metric_by_name( metric_name )
api.post_metric( metric: metric_params, metric_values: [metric_value_1, metric_value_2] )
api.update_metric( metric_id, metric_param_1: 'value', metric_param_2: 'value', ... )

api.metric( metric_id ).get_metric_values
api.metric( metric_id ).get_metric_values( page: 2, per_page: 4 )
api.metric( metric_id ).get_value_groups
api.metric( metric_id ).get_value_groups( page: 2, per_page: 4 )

api.metrics_calculate_summary( start_time: start_time, end_time: end_time, ids: [metric_id_1, metric_id_2] )

Data Center Service States

api.data_center_service_states

Custom Queries

api.custom_queries
api.post_custom_query( custom_query_params )
api.update_custom_query( custom_query_id , alarm_param_1: 'value', alarm_param_2: 'value', ... )
api.find_custom_query( widget_id, widget_type )

Outages:

api.outages
api.outages( page: 2, per_page: 5 )

Stack changes

api.stack_changes
api.stack_changes( page: 2, per_page: 5 )
api.stack_changes( page: 2, per_page: 5, element: 'XBO' )
api.stack_changes( time_range: { time_offset: -1, start_date: 0, start_time: 1440, end_time: 0 }, element: 'XBO' )

Command notifications (remote commands)

api.command_notifications
api.command_notifications( page: 1, per_page: 2 )
api.update_command_notification( command_notification_id )