Page tree
Skip to end of metadata
Go to start of metadata

Примеры

Узнать статусы всех сервисов

curl -X GET \
  -H "Accept: application/json" \
  http://ВАШ_СЕРВЕР:ПОРТ/suggestions/api/4_1/rs/status
 Пример ответа
{
    "version": "20.9",
    "revision": "8c291e5f",
    "date": "28.08.2020",
    "services": [
        {
            "search": true,
            "enrich": false,
            "state": "ENABLED",
            "version": "26.08.2020 00:00:00",
            "count": 1689,
            "resources": [
                {
                    "version": "26.08.2020 00:00:00",
                    "name": "bank"
                }
            ],
            "name": "bank"
        },
        {
            "search": true,
            "enrich": false,
            "state": "ENABLED",
            "version": "01.09.2020 00:00:00",
            "count": 9718,
            "resources": [
                {
                    "version": "01.09.2020 00:00:00",
                    "name": "egr"
                },
                {
                    "version": "31.08.2020 00:00:00",
                    "name": "party_ext"
                }
            ],
            "name": "party"
        },
        {
            "search": true,
            "enrich": true,
            "state": "ENABLED",
            "version": "29.08.2020 00:00:00",
            "count": 31892709,
            "resources": [
                {
                    "version": "27.08.2020 15:43:06",
                    "name": "fias"
                },
                {
                    "version": "07.04.2020 12:43:07",
                    "name": "iso3166"
                },
                {
                    "version": "26.06.2020 10:50:28",
                    "name": "house"
                },
                {
                    "version": "26.06.2020 10:46:24",
                    "name": "geo"
                },
                {
                    "version": "29.08.2020 00:00:00",
                    "name": "geonames"
                },
                {
                    "version": "03.07.2020 15:05:15",
                    "name": "osm"
                }
            ],
            "name": "address"
        },
        {
            "search": true,
            "enrich": false,
            "state": "ENABLED",
            "version": "23.08.2020 00:00:00",
            "count": 466,
            "resources": [
                {
                    "version": "23.08.2020 00:00:00",
                    "name": "outward"
                }
            ],
            "name": "metro"
        },
        ...
    ]
}

 Пример ответа до версии 20.9 (раскрыть)
{
    "version": "20.7",
    "revision": "af58219d",
    "date": "06.07.2020",
    "services": [
        {
            "search": true,
            "enrich": false,
            "state": "ENABLED",
            "version": "06.07.2020 00:00:00",
            "count": 1722,
            "resources": [
                {
                    "version": "06.07.2020 00:00:00",
                    "name": "bank"
                }
            ],
            "name": "bank"
        },
        {
            "search": true,
            "enrich": true,
            "state": "ENABLED",
            "version": "03.07.2020 15:05:15",
            "count": 31804976,
            "resources": [
                {
                    "version": "01.06.2020 12:43:24",
                    "name": "fias"
                },
                {
                    "version": "27.06.2019 18:23:18",
                    "name": "fias_iso_code"
                },
                {
                    "version": "30.06.2020 00:00:00",
                    "name": "extra_house"
                },
                {
                    "version": "30.06.2020 00:00:00",
                    "name": "geo_house"
                },
                {
                    "version": "30.06.2020 00:00:00",
                    "name": "geo_subject"
                },
                {
                    "version": "02.07.2020 00:00:00",
                    "name": "geonames"
                },
                {
                    "version": "03.07.2020 15:05:15",
                    "name": "osm"
                }
            ],
            "name": "address"
        },
        {
            "search": true,
            "enrich": false,
            "state": "ENABLED",
            "version": "18.06.2020 00:00:00",
            "count": 466,
            "resources": [
                {
                    "version": "18.06.2020 00:00:00",
                    "name": "outward"
                }
            ],
            "name": "metro"
        },
        ...
    ]
}
 Пример ответа до версии 20.7 (раскрыть)
{
  "version": "16.8",
  "revision": "e63cc6755be2",
  "date": "07.12.2016",
  "services": [
    {
      "search": true,
      "enrich": false,
      "state": "ENABLED",
      "resources": [
        {
          "version": "12.10.2016 06:48:02",
          "count": 236780,
          "name": "ip_blocks"
        }
      ],
      "name": "ip"
    },
    {
      "search": true,
      "enrich": true,
      "state": "ENABLED",
      "resources": [
        {
          "version": "10.10.2016 00:00:00",
          "count": 24945657,
          "name": "fias"
        }
      ],
      "name": "address"
    },
    {
      "search": true,
      "enrich": false,
      "state": "ENABLED",
      "resources": [
        {
          "version": "11.10.2016 22:34:24",
          "count": 923143,
          "name": "email"
        }
      ],
      "name": "email"
    },
    {
      "search": true,
      "enrich": false,
      "state": "ENABLED",
      "resources": [
        {
          "version": "11.10.2016 22:34:24",
          "count": 773006,
          "name": "fio"
        }
      ],
      "name": "fio"
    },
    {
      "search": true,
      "enrich": false,
      "state": "ENABLED",
      "resources": [
        {
          "version": "22.08.2016 00:00:00",
          "count": 22201567,
          "name": "egr"
        }
      ],
      "name": "party"
    },
    {
      "search": true,
      "enrich": false,
      "state": "ENABLED",
      "resources": [
        {
          "version": "12.10.2016 00:00:00",
          "count": 21204,
          "name": "bank"
        }
      ],
      "name": "bank"
    }
  ]
}

Узнать статус конкретного сервиса:

curl -X GET \
  -H "Accept: application/json" \
  http://ВАШ_СЕРВЕР:ПОРТ/suggestions/api/4_1/rs/status/address
 Пример ответа
{
    "search": true,
    "enrich": true,
    "state": "REINDEXING",
    "version": "29.08.2020 00:00:00",
    "count": 31892709,
    "resources": [
        {
            "version": "27.08.2020 15:43:06",
            "name": "fias"
        },
        {
            "version": "07.04.2020 12:43:07",
            "name": "iso3166"
        },
        {
            "version": "26.06.2020 10:50:28",
            "name": "house"
        },
        {
            "version": "26.06.2020 10:46:24",
            "name": "geo"
        },
        {
            "version": "29.08.2020 00:00:00",
            "name": "geonames"
        },
        {
            "version": "03.07.2020 15:05:15",
            "name": "osm"
        }
    ],
    "name": "address"
}
 Пример ответа до версии 20.9 (раскрыть)
{
    "search": true,
    "enrich": true,
    "state": "REINDEXING",
    "version": "03.07.2020 15:05:15",
    "count": 31804976,
    "resources": [
        {
            "version": "01.06.2020 12:43:24",
            "name": "fias"
        },
        {
            "version": "27.06.2019 18:23:18",
            "name": "fias_iso_code"
        },
        {
            "version": "30.06.2020 00:00:00",
            "name": "extra_house"
        },
        {
            "version": "30.06.2020 00:00:00",
            "name": "geo_house"
        },
        {
            "version": "30.06.2020 00:00:00",
            "name": "geo_subject"
        },
        {
            "version": "02.07.2020 00:00:00",
            "name": "geonames"
        },
        {
            "version": "03.07.2020 15:05:15",
            "name": "osm"
        }
    ],
    "name": "address"
}
 Пример ответа до версии 20.7 (раскрыть)
{
  "search": true,
  "enrich": true,
  "state": "ENABLED",
  "resources": [
    {
      "version": "10.10.2016 00:00:00",
      "count": 24945657,
      "name": "fias"
    }
  ],
  "name": "address"
}

Возвращаемая информация:

"search" – true, если работает поиск, иначе false;

"enrich" – включено ли обогащение (работает только при интеграции Подсказок с Фактором);

"state" – состояние сервиса:

  • ENABLED – сервис доступен для поиска и добавления новых записей;
  • DISABLED – сервис недоступен, справочника для индексации не найдено;
  • INDEXING – сервис недоступен, идет индексация справочника;
  • REINDEXING – сервис доступен для поиска, но недоступен для добавления новых записей (идет переиндексация справочника);

"name" – название сервиса;

"version" – версия ресурса (версия самого свежего справочника);

"count" – количество объектов в индексе;

"resources" – информация о справочниках:

  • "version" – версия справочника;

  • "name" – название справочника:
    • outward – для внешних справочников;
    • address_jdbc – для справочника из БД.
  • No labels