{"id":21630473,"url":"https://github.com/hawkular/hawkular-client-ruby","last_synced_at":"2025-04-11T14:05:26.104Z","repository":{"id":56876090,"uuid":"39637373","full_name":"hawkular/hawkular-client-ruby","owner":"hawkular","description":"Ruby client for Hawkular","archived":false,"fork":false,"pushed_at":"2020-09-03T19:03:05.000Z","size":52283,"stargazers_count":8,"open_issues_count":9,"forks_count":28,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-30T02:20:13.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hawkular.org/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hawkular.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGES.rdoc","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-24T14:05:43.000Z","updated_at":"2021-09-13T01:55:15.000Z","dependencies_parsed_at":"2022-08-20T23:10:21.934Z","dependency_job_id":null,"html_url":"https://github.com/hawkular/hawkular-client-ruby","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawkular%2Fhawkular-client-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawkular%2Fhawkular-client-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawkular%2Fhawkular-client-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawkular%2Fhawkular-client-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hawkular","download_url":"https://codeload.github.com/hawkular/hawkular-client-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248412952,"owners_count":21099226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T02:11:06.498Z","updated_at":"2025-04-11T14:05:26.063Z","avatar_url":"https://github.com/hawkular.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"{\u003cimg src=\"https://travis-ci.org/hawkular/hawkular-client-ruby.svg?branch=master\" alt=\"Build Status\" /\u003e}[https://travis-ci.org/hawkular/hawkular-client-ruby]\n{\u003cimg src=\"https://coveralls.io/repos/github/hawkular/hawkular-client-ruby/badge.svg?branch=master\" alt=\"Coverage Status\" /\u003e}[https://coveralls.io/github/hawkular/hawkular-client-ruby?branch=master]\n{\u003cimg src=\"https://codeclimate.com/github/hawkular/hawkular-client-ruby/badges/gpa.svg\" /\u003e}[https://codeclimate.com/github/hawkular/hawkular-client-ruby]\n\n= hawkular-client-ruby\n\nA Ruby Hawkular Client.\n\nDocumentation[http://www.hawkular.org/hawkular-client-ruby/]\n\n== Changelog\n\nSee {CHANGELOG}[http://www.hawkular.org/hawkular-client-ruby/docs/latest/file.CHANGES.html] for a list of changes and\n{API-Breaking-Changes}[http://www.hawkular.org/hawkular-client-ruby/docs/latest/file.api_breaking_changes.html] for a list of api-breaking changes.\n\n== Overview\n\nRuby Hawkular Client provides a Ruby API to communicate with the following Hawkular subprojects:\n* {Hawkular Alerts}[https://github.com/hawkular/hawkular-alerts]\n* {Hawkular Inventory}[https://github.com/hawkular/hawkular-inventory]\n* {Hawkular Metrics}[https://github.com/hawkular/hawkular-metrics]\n* Invoking operations on {Hawkular Wildfly Agent}[https://github.com/hawkular/hawkular-agent].\n\n\n== Usage\n\nYou must initialize the Hawkular Client with the server url, your username, password and tenant.\n\n  require 'hawkular/hawkular_client'\n  client = Hawkular::Client.new(\n    entrypoint: 'http://localhost:8080',\n    credentials: { username: 'jdoe', password: 'password' },\n    options: { tenant: 'hawkular' }\n  )\n\nEach subproject API is packed in its own class, which you can access through the client object.\n\n  client.alerts # Alerts API\n  client.inventory # Inventory API\n  client.metrics # Metrics API\n  client.operations # Operations API\n\nMetrics API is also subdivided to: Mixed, Availability, Counters, Gauges and Tenants.\n\n  client.metrics # Mixed API\n  client.metrics.avail # Availability\n  client.metrics.counters # Counters\n  client.metrics.gauges # Gauges\n  client.metrics.tenants # Tenants\n\nThe Mixed API is capable of handling multiple types of metrics, like the\npush_data[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client.html#push_data-instance_method] method, which pushes data\nfor multiple metrics of all supported data.\n\nYou can also access each subproject's API individually, if you would like to use only the metrics API you could do\n\n  require 'hawkular/metrics/metrics_client'\n  metrics_client = Hawkular::Metrics::Client.new(\n    entrypoint: 'http://localhost:8080/hawkular/metrics',\n    credentials: { username: 'jdoe', password: 'password' },\n    options: { tenant: 'hawkular' }\n  )\n\n=== HTTP and HTTPS options\n\nWill all client classes, the +:options+ hash can contain extra parameters passed through to +RestClient+ gem.  It can include a +:headers+ sub-hash to add custom headers:\n\n  require 'hawkular/hawkular_client'\n  client = Hawkular::Client.new(\n    entrypoint: 'http://localhost:8080',\n    credentials: { username: 'jdoe', password: 'password' },\n    options: { tenant: 'hawkular', proxy: 'proxy.example.com', ssl_ca_file: 'ca.pem',\n               headers: {'Max-Forwards': 5} }\n  )\n\n=== Examples\n\nSuppose you will monitor the availability of two networks to later determine which one is the best.\nEvery certain time, you would get the availability of each network and push them to Hawkular Metrics.\n\n  # ... Initialize client ...\n  is_network01_available = true\n  is_network02_available = false\n  client.metrics.push_data(availabilities: [\n    { id: 'network-01', data: [{ value: is_network01_available ?  'up' : 'down' }] },\n    { id: 'network-02', data: [{ value: is_network02_available ?  'up' : 'down' }] }\n  ])\n\nAt some other point you might want to access that data to analyze it\n\n  # ... Initialize client ...\n  # Fetches the 5 last availabilities reported in the last 8 hours.\n  network01_avail = client.metrics.avail.get_data('network-01', limit: 5, order: 'DESC')\n  network02_avail = client.metrics.avail.get_data('network-02', limit: 5, order: 'DESC')\n  # ... Do something with the availabilities ...\n\nEach network01_avail will be an array like:\n\n  [\n    { \"timestamp\" =\u003e 1467312571473, \"value\" =\u003e \"up\" },\n    { \"timestamp\" =\u003e 1467312492650, \"value\" =\u003e \"up\" },\n    # ...\n  ]\n\nYou can get more info on the other parameters by checking the metrics API get_data[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client/Metrics#get_data-instance_method]\n\n=== More info\n\nCheck each resource API for a detailed description of what methods are available.\n* Alerts[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Alerts/Client.html]\n* Inventory[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Inventory/Client.html]\n* Metrics:\n  * Mixed[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client.html]\n  * Availability[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client/Availability.html]\n  * Counters[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client/Counters.html]\n  * Gauges[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client/Gauges.html]\n  * Tenants[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Metrics/Client/Tenants.html]\n* Operations[http://www.hawkular.org/hawkular-client-ruby/docs/latest/Hawkular/Operations/Client.html]\n\n== Contributing to hawkular-client-ruby\n\n* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet\n* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it\n* Fork the project\n* Start a feature/bugfix branch\n* Commit and push until you are happy with your contribution\n* Make sure to add tests for it. This is important so it won't break in a future version unintentionally.\n* Run your code through RuboCop (which is default when running +rake+) and fix complaints.\n* When you open a pull request, watch out for failures on Travis.\n* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is\n  otherwise necessary, that is fine, but please isolate to its own commit so we can cherry-pick around it.\n\n== Running the tests\n\nIntegration tests are recorded and played against cassettes recorded with VCR\n(http://www.relishapp.com/vcr/vcr/docs)\n\n* From command line run\n    rake spec\n* To run the tests against a live server, set +VCR_OFF+ to +1+ as in\n    VCR_OFF=1 rake spec\n* To update the VCR tapes that supports it (metrics and inventory), set +VCR_UPDATE+ to +1+ as in\n    VCR_UPDATE=1 rake spec\n* Currently, we support two posible metrics contexts: \u003ccode\u003ehawkular-metrics 0.8.0.Final\u003c/code\u003e and \u003ccode\u003ehawkular-services\u003c/code\u003e that contain metrics. If you want to run/re-record the tests only for services, you can skip the other context by \u003ccode\u003eSKIP_V8_METRICS=1\u003c/code\u003e, or similarly \u003ccode\u003eSKIP_SERVICES_METRICS=1\u003c/code\u003e. So for instance updating the VCR templates only for hawkular-services would require command:\n    VCR_UPDATE=1 SKIP_V8_METRICS=1 rspec ./spec/integration/metric_spec.rb\n\nFor more details consult the {spec readme}[http://www.hawkular.org/hawkular-client-ruby/docs/latest/file.README.html].\n\n== Logging\n\nIf you want to see API requests and responses, use the following environment\nvariables:\n\n    RESTCLIENT_LOG=stdout HAWKULARCLIENT_LOG_RESPONSE=1 rake spec\n\n== Generate documentation\n\nClient documentation can be generated using http://yardoc.org\n\n    yardoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawkular%2Fhawkular-client-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhawkular%2Fhawkular-client-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawkular%2Fhawkular-client-ruby/lists"}