-
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
Hawkular::Inventory::Client
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
resourcePath
. Because of the new inventory API, this key is no longer requried. Instead,resourceId
andfeedId
keys are required. This means that all methods of the Operations client class are non-backwards compatible.-
In particular,
export_jdr
method does not receive a hash, but plain parameters. TheresourcePath
parameter was replaced byresourceId
andfeedId
parameters. Also, support forsender_request_id
is added as a parameter.
-
-
Standardized Exceptions under the Hawkular namespace, and the old names were deprecated, here is the list:
-
Hawkular::BaseClient::HawkularException
->Hawkular::Exception
-
Hawkular::BaseClient::HawkularConnectionException
->Hawkular::ConnectionException
-
-
A lot of methods in the inventory client have been changed or removed, here is the list:
-
get_tenant
- removed -
list_relationships
- removed -
list_relationships_for_feed
- removed -
get_entity
- removed -
delete_feed
- removed -
create_feed
- removed -
create_resource_type
- removed -
create_resource
- removed -
create_resource_under_resource
- removed -
create_metric_type
- removed -
create_metric_for_resource
- removed -
events
- removed -
no_more_events!
- removed -
list_metrics_for_resource_type
- removed -
list_resource_types(feed_id)
- now the feed_id parameter is mandatory
-
instead of
Hawkular::Inventory::CanonicalPath.to_resource
useHawkular::Inventory::CanonicalPath.down
removed deprecated API:
-
instead of
HawkularUtilsMixin
useHawkular::ClientUtils
-
instead of
Hawkular::Operations::OperationsClient
useHawkular::Operations::Client
-
instead of
Hawkular::Alerts::AlertsClient
useHawkular::Alerts::Client
-
instead of
Hawkular::Token::TokenClient
useHawkular::Token::Client
-
instead of
Hawkular::Inventory::InventoryClient
useHawkular::Inventory::Client
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. ::Hawkular::Client.new(..., options: { tenant: 'hawkular' })
To use the client use the require 'hawkular/hawkular_client'
instead of require 'hawkular_all'
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’:
::Hawkular::Client.new(:entrypoint => 'http://localhost:8080', :credentials => {username: 'jdoe', password: 'password'})
See the spec/integraion/hawkular_client_spec.rb to see more details.
In the lib/hawkular/inventory/inventory_api.rb
all following methods have different signatures (old
-> new
):
list_resources_for_type(feed_id, type, fetch_properties = false)
-> list_resources_for_type(type_path, fetch_properties = false, filter = {})
get_config_data_for_resource(feed_id, res_ids)
-> get_config_data_for_resource(resource_path)
def list_child_resources(Resource parent_resource, recursive = false)
-> def list_child_resources(parent_resource_path, recursive = false)
list_relationships(Resource resource, named = nil)
-> list_relationships(path, named = nil)
list_relationships_for_feed(feed_id, named = nil)
-> list_relationships_for_feed(path, named = nil)
list_metrics_for_metric_type(feed_id, type)
-> list_metrics_for_metric_type(met_type_path)
list_metrics_for_resource_type(feed, type)
-> list_metrics_for_resource_type(res_type_path)
list_metrics_for_resource(Resource resource, filter = {})
-> list_metrics_for_resource(resource_path, filter = {})
create_resource(feed_id, type_path, resource_id, resource_name = nil, properties = {})
-> create_resource(type_path, resource_id, resource_name = nil, properties = {})
create_resource_under_resource(feed_id, type_path, parent_resource_ids, resource_id, resource_name = nil, properties = {})
-> create_resource_under_resource(type_path, parent_resource_path, resource_id, resource_name = nil, properties = {})
get_resource(feed_id, res_ids, fetch_resource_config = true)
-> get_resource(res_path, fetch_resource_config = true)
create_metric_for_resource(feed_id, metric_id, type_path, res_ids, metric_name = nil)
-> create_metric_for_resource(metric_type_path, resource_path, metric_id, metric_name = nil)