[id='rest_v2_cache_manager_info']
= Getting Basic Cache Manager Information
Retrieving information about Cache Managers with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}
----

{brandname} responds with information in JSON format, as in the following
example:

[source,json,options="nowrap",subs=attributes+]
----
include::json_examples/rest_cache_manager_response.json[]
----

* `version` contains the {brandname} version
* `name` contains the name of the cache manager as defined in the configuration
* `coordinator` is true if the cache manager is the coordinator of the cluster
* `cache_configuration_names` contains an array of all caches configurations defined in the cache manager
* `cluster_name` contains the name of the cluster as defined in the configuration
* `physical_addresses` contains the physical network addresses associated with the cache manager
* `coordinator_address` contains the physical network addresses of the coordinator of the cluster
* `cache_manager_status` the lifecycle status of the cache manager.
For possible values, check the https://docs.jboss.org/infinispan/9.4/apidocs/org/infinispan/lifecycle/ComponentStatus.html[`org.infinispan.lifecycle.ComponentStatus`] documentation
* `created_cache_count` number of created caches, excludes all internal and private caches
* `running_cache_count` number of created caches that are running
* `node_address` contains the logical address of the cache manager
* `cluster_members` and `cluster_members_physical_addresses` an array of logical and physical addresses of the members of the cluster
* `cluster_size` number of members in the cluster
* `defined_caches` A list of all caches defined in the cache manager, excluding private caches but including internal caches that are accessible


[id='rest_v2_cache_manager_health']
= Getting Cluster Health
Retrieve health information for {brandname} clusters with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/health
----

{brandname} responds with cluster health information in JSON format, as in the
following example:

[source,json,options="nowrap",subs=attributes+]
----
include::json_examples/rest_cache_health_response.json[]
----

* `cluster_health` contains the health of the cluster
** `cluster_name` specifies the name of the cluster as defined in the configuration.
** `health_status` provides one of the following:
*** `DEGRADED` indicates at least one of the caches is in degraded mode.
*** `HEALTHY_REBALANCING` indicates at least one cache is in the rebalancing state.
*** `HEALTHY` indicates all cache instances in the cluster are operating as expected.
*** `FAILED` indicates the cache failed to start with the provided configuration.
** `number_of_nodes` displays the total number of cluster members.
Returns a value of `0` for non-clustered (standalone) servers.
** `node_names` is an array of all cluster members.
Empty for standalone servers.
* `cache_health` contains health information per-cache
** `status`  HEALTHY, DEGRADED, HEALTHY_REBALANCING or FAILED
** `cache_name` the name of the cache as defined in the configuration.


[id='rest_v2_cache_manager_health_status']
= Getting Cache Manager Health Status
Retrieve the health status of Cache Managers with `GET` requests that do not require authentication.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/health/status
----

{brandname} responds with one of the following in `text/plain` format:

* `HEALTHY`
* `HEALTHY_REBALANCING`
* `DEGRADED`
* `FAILED`


[id='rest_v2_cache_manager_availability']
= Checking REST Endpoint Availability
Verify {brandname} server REST endpoint availability with `HEAD` requests.

[source,options="nowrap",subs=attributes+]
----
HEAD /rest/v2/cache-managers/{cacheManagerName}/health
----

If you receive a successful response code then the {brandname} REST server is
running and serving requests.


[id='rest_v2_cache_manager_config']
= Obtaining Global Configuration for Cache Managers
Retrieve global configuration for Cache Managers with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/config
----

.Headers

|===
|Header |Required or Optional |Parameter

|`link:#rest_accept[Accept]`
|OPTIONAL
|The required format to return the content. Supported formats are _application/json_ and _application/xml_. JSON is assumed if no header is provided.
|===

.Reference

link:{javadocroot}/org/infinispan/configuration/global/GlobalConfiguration.html[GlobalConfiguration]


[id='rest_v2_cache_manager_caches_config']
= Obtaining Configuration for All Caches
Retrieve the configuration for all caches with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/cache-configs
----

{brandname} responds with `JSON` arrays that contain each cache and cache
configuration, as in the following example:

[source,json,options="nowrap",subs=attributes+]
----
include::json_examples/rest_cache_config_response.json[]
----

[id='rest_v2_cache_manager_cache_templates']
= Listing Available Cache Templates
Retrieve all available {brandname} cache templates with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/cache-configs/templates
----

[TIP]
====
See link:#rest_v2_create_cache_template[Creating Caches with Templates].
====

[id='rest_v2_cache_manager_cache_list']
= (Experimental) Obtaining Cache Status and Information
Retrieve a list of all available caches for a Cache Manager, along with cache statuses and details, with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/caches
----

{brandname} responds with JSON arrays that lists and describes each available
cache, as in the following example:

[source,json,options="nowrap",subs=attributes+]
----
include::json_examples/rest_caches_info_response.json[]
----


[id='rest_v2_cache_manager_stats']
= Getting Cache Manager Statistics
Retrieve the statistics for Cache Managers with `GET` requests.

[source,options="nowrap",subs=attributes+]
----
GET /rest/v2/cache-managers/{cacheManagerName}/stats
----

{brandname} responds with Cache Manager statistics in JSON format, as in the following example:

[source,json,options="nowrap",subs=attributes+]
----
include::json_examples/rest_cache_stats_response.json[]
----

* `statistics_enabled` is `true` if statistics collection is enabled for the Cache Manager.
* `read_write_ratio` displays the read/write ratio across all caches.
* `time_since_start` shows the time, in seconds, since the Cache Manager started.
* `time_since_reset` shows the number of seconds since the Cache Manager statistics were last reset.
* `number_of_entries` shows the total number of entries currently in all caches from the Cache Manager. This statistic returns entries in the local cache instances only.
* `total_number_of_entries` shows the number of store operations performed across all caches for the Cache Manager.
* `off_heap_memory_used` shows the amount, in `bytes[]`, of off-heap memory used by this cache container.
* `data_memory_used` shows the amount, in `bytes[]`, that the current eviction algorithm estimates is in use for data across all caches. Returns `0` if eviction is not enabled.
* `misses` shows the number of `get()` misses across all caches.
* `remove_hits` shows the number of removal hits across all caches.
* `remove_misses` shows the number of removal misses across all caches.
* `evictions` shows the number of evictions across all caches.
* `average_read_time` shows the average number of milliseconds taken for `get()` operations across all caches.
* `average_read_time_nanos` same as `average_read_time` but in nanoseconds.
* `average_remove_time` shows the average number of milliseconds for `remove()` operations across all caches.
* `average_remove_time_nanos` same as `average_remove_time` but in nanoseconds.
* `required_minimum_number_of_nodes` shows the required minimum number of nodes to guarantee data consistency.
* `hits` provides the number of `get()` hits across all caches.
* `stores` provides the number of `put()` operations across all caches.
* `current_number_of_entries_in_memory` shows the total number of entries currently in all caches, excluding passivated entries.
* `hit_ratio` provides the total percentage hit/(hit+miss) ratio for all caches.
* `retrievals` shows the total number of `get()` operations.
