summaryrefslogtreecommitdiff
path: root/api-ref/source/baremetal-api-v1-shards.inc
blob: c051e506efb4e6556723fb505c70d914bb28883c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.. -*- rst -*-

======
Shards
======

This section describes an API endpoint returning the population of shards
among nodes in the Bare Metal Service. Shards are a way to group nodes in the
Bare Metal service. They are used by API clients to separate nodes into groups,
allowing horizontal scaling.

Shards are not directly added and removed from the Bare Metal service. Instead,
operators can configure a node into a given shard by setting the ``shard`` key
to any unique string value representing the shard.

.. note::
    The Bare Metal Service does not use shards directly. It instead relies on
    API clients and external services to use shards to group nodes into smaller
    areas of responsibility.


Shards
======

.. rest_method:: GET /v1/shards

.. versionadded:: 1.82

The ``/v1/shards`` endpoint exists to allow querying the distribution of nodes
between all defined shards.

Normal response codes: 200

Error response codes: 400 403 404

Request
-------

No request parameters are accepted by this endpoint.

Response
--------

Returns a list of shards and the count of nodes assigned to each. The
list is sorted by descending count.

.. rest_parameters:: parameters.yaml

    - name: shard_name
    - count: shard_count

Response Example
----------------

.. literalinclude:: samples/shards-list-response.json
   :language: javascript