hawkular/hawkular-client-ruby

View on GitHub
api_breaking_changes.rdoc

Summary

Maintainability
Test Coverage
== Breaking changes in the major releases

=== 5.0.0.pre1
* The Hawkular inventory implementation was rewritten. Thus, the support for
  inventory on metrics has been removed from the client. The new API is now
  being used. Some of the most important changes are these:
  * CanonicalPath is removed. Now, entities in inventory have opaque IDs,
    and no assumptions about the format of the ID can be done.
  * Inventory has now four basic classes for entities: Resource, Resource Type,
    Metric and Operation. The _BaseEntity_ class has been removed.
  * The inventory client <code>Hawkular::Inventory::Client</code> class was
    fully rewritten. None of the previous methods exist. Now, it is using the new
    API exposed by Hawkular and provides basic methods to traverse the inventory
    tree and do some simple queries.
* Almost all _Operations_ client methods receive a hash with the parameters
  to perform the operation. A common hash key was <code>resourcePath</code>.
  Because of the new inventory API, this key is no longer requried. Instead,
  <code>resourceId</code> and <code>feedId</code> keys are required. This means
  that all methods of the _Operations_ client class are non-backwards compatible.
  * In particular, <code>export_jdr</code> method does not receive a hash, but
    plain parameters. The <code>resourcePath</code> parameter was replaced by
    <code>resourceId</code> and <code>feedId</code> parameters. Also, support
    for <code>sender_request_id</code> is added as a parameter.

=== 4.0.0
* Standardized Exceptions under the Hawkular namespace, and the old names were deprecated, here is the list:
  1. <code>Hawkular::BaseClient::HawkularException</code> -> <code>Hawkular::Exception</code>
  2. <code>Hawkular::BaseClient::HawkularConnectionException</code> -> <code>Hawkular::ConnectionException</code>

=== 3.0.0

* A lot of methods in the inventory client have been changed or removed, here is the list:
1. <code>get_tenant</code> - removed
2. <code>list_relationships</code> - removed
3. <code>list_relationships_for_feed</code> - removed
4. <code>get_entity</code> - removed
5. <code>delete_feed</code> - removed
6. <code>create_feed</code> - removed
7. <code>create_resource_type</code> - removed
8. <code>create_resource</code> - removed
9. <code>create_resource_under_resource</code> - removed
10. <code>create_metric_type</code> - removed
11. <code>create_metric_for_resource</code> - removed
12. <code>events</code> - removed
13. <code>no_more_events!</code> - removed
14. <code>list_metrics_for_resource_type</code> - removed
15. <code>list_resource_types(feed_id)</code> - now the feed_id parameter is mandatory

* instead of <code>Hawkular::Inventory::CanonicalPath.to_resource</code> use <code>Hawkular::Inventory::CanonicalPath.down</code>

removed deprecated API:

* instead of <code>HawkularUtilsMixin</code> use <code>Hawkular::ClientUtils</code>
* instead of <code>Hawkular::Operations::OperationsClient</code> use <code>Hawkular::Operations::Client</code>
* instead of <code>Hawkular::Alerts::AlertsClient</code> use <code>Hawkular::Alerts::Client</code>
* instead of <code>Hawkular::Token::TokenClient</code> use <code>Hawkular::Token::Client</code>
* instead of <code>Hawkular::Inventory::InventoryClient</code> use <code>Hawkular::Inventory::Client</code>


=== 2.0.0

By default no Hawkular-Tenant HTTP header is being set. If you need it (for instance for hawkular-services), provide the tenant option when creating a client.
e.g. <code>::Hawkular::Client.new(..., options: { tenant: 'hawkular' })</code>

=== 1.0.0

To use the client use the <code>require 'hawkular/hawkular_client'</code> instead of <code>require 'hawkular_all'</code>

---

While it's still possible to use individual component clients (inventory, alert, metrics, operation, token), the preferred way is to use
the unified client that has reference on those 'sub-clients':

<code>::Hawkular::Client.new(:entrypoint => 'http://localhost:8080', :credentials => {username: 'jdoe', password: 'password'})</code>

See the link:spec/integraion/hawkular_client_spec.rb to see more details.


---

In the <code>lib/hawkular/inventory/inventory_api.rb</code> all following methods have different signatures (+old+ -> +new+):

<code>list_resources_for_type(feed_id, type, fetch_properties = false)</code>
->
<code>list_resources_for_type(type_path, fetch_properties = false, filter = {})</code>


<code>get_config_data_for_resource(feed_id, res_ids)</code>
->
<code>get_config_data_for_resource(resource_path)</code>


<code>def list_child_resources(Resource parent_resource, recursive = false)</code>
->
<code>def list_child_resources(parent_resource_path, recursive = false)</code>


<code>list_relationships(Resource resource, named = nil)</code>
->
<code>list_relationships(path, named = nil)</code>


<code>list_relationships_for_feed(feed_id, named = nil)</code>
->
<code>list_relationships_for_feed(path, named = nil)</code>


<code>list_metrics_for_metric_type(feed_id, type)</code>
->
<code>list_metrics_for_metric_type(met_type_path)</code>


<code>list_metrics_for_resource_type(feed, type)</code>
->
<code>list_metrics_for_resource_type(res_type_path)</code>


<code>list_metrics_for_resource(Resource resource, filter = {})</code>
->
<code>list_metrics_for_resource(resource_path, filter = {})</code>


<code>create_resource(feed_id, type_path, resource_id, resource_name = nil, properties = {})</code>
->
<code>create_resource(type_path, resource_id, resource_name = nil, properties = {})</code>


<code>create_resource_under_resource(feed_id, type_path, parent_resource_ids, resource_id, resource_name = nil, properties = {})</code>
->
<code>create_resource_under_resource(type_path, parent_resource_path, resource_id, resource_name = nil, properties = {})</code>


<code>get_resource(feed_id, res_ids, fetch_resource_config = true)</code>
->
<code>get_resource(res_path, fetch_resource_config = true)</code>


<code>create_metric_for_resource(feed_id, metric_id, type_path, res_ids, metric_name = nil)</code>
->
<code>create_metric_for_resource(metric_type_path, resource_path, metric_id, metric_name = nil)</code>