Service
Services is a collection of services that you have in your organization. It can be a collection of services that you are monitoring or services that you are providing to your customers. It can be anything that you want to keep track of.
Модель Service
Свойства
- Имя
_id- Тип
- Object ID
- Описание
ID of this object
- Имя
createdAt- Тип
- Date
- Описание
Date and Time when the object was created.
- Имя
updatedAt- Тип
- Date
- Описание
Date and Time when the object was updated.
- Имя
project- Тип
- Project
- Описание
Relation to Project Resource in which this object belongs
- Имя
projectId- Тип
- Object IDОбязательно
- Описание
ID of your Project in which this object belongs
- Имя
name- Тип
- TextОбязательно
- Описание
Any friendly name of this object
- Имя
slug- Тип
- SlugОбязательно
- Описание
Friendly globally unique name for your object
- Имя
description- Тип
- Long Text
- Описание
Friendly description that will help you remember
- Имя
createdByUser- Тип
- User
- Описание
Relation to User who created this object (if this object was created by a User)
- Имя
createdByUserId- Тип
- Object ID
- Описание
User ID who created this object (if this object was created by a User)
- Имя
labels- Тип
- Label
- Описание
Relation to Labels Array where this object is categorized in.
- Имя
serviceColor- Тип
- Color
- Описание
Color for this service
- Имя
techStack- Тип
- JSON
- Описание
Tech stack used in the service. This will help other developers understand the service better.
- Имя
retainTelemetryDataForDays- Тип
- Number
- Описание
Number of days to retain telemetry data for this service.
/api/service/get-listСписок
Этот метод возвращает постраничный список ваших объектов «Service». По умолчанию на странице до десяти записей.
Необязательные query-параметры
limit- число
- Сколько объектов вернуть. По умолчанию 10, максимум 100
skip- число
- Сколько объектов пропустить (для пагинации)
Необязательное тело запроса
query- Чтобы фильтровать Service, укажите запрос здесь. Подробнее: написание запросов.
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
sort- По умолчанию сортировка по дате создания. Порядок можно изменить — см. раздел «Сортировка» в типах данных.
Запрос списка
POST/api/service/get-list?skip=0&limit=10Content-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"name": true,
"projectId": true,
"createdByUserId": true,
"description": true,
"slug": true
},
"query": {
"name": "User Authentication API"
},
"sort": {
"createdAt": -1
}
}Ответ
{
"count": 10,
"limit": 10,
"skip": 0,
"data": [
{
"_id": "377a9260-28fe-11f1-b591-3fdcef396aba",
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"slug": "Example slug"
},
{
"_id": "377a9261-28fe-11f1-b591-3fdcef396aba",
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"slug": "Example slug"
},
{
"_id": "377a9262-28fe-11f1-b591-3fdcef396aba",
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"slug": "Example slug"
}
]
}/api/service/:id/get-itemПолучить по ID
Возвращает объект «Service» по идентификатору.
id- строка
- ID объекта
Необязательное тело запроса
select- По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.
Запрос одного объекта
POST/api/service/:id/get-itemContent-Type: application/json ApiKey: YOUR_API_KEY
{
"select": {
"name": true,
"projectId": true,
"createdByUserId": true,
"description": true,
"slug": true
}
}Ответ
{
"_id": "377a9260-28fe-11f1-b591-3fdcef396aba",
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"slug": "Example slug"
}/api/service/countКоличество
Возвращает количество ваших объектов «Service».
Необязательное тело запроса
query- Чтобы фильтровать Service, укажите запрос здесь. Подробнее: написание запросов.
Запрос количества
POST/api/service/countContent-Type: application/json ApiKey: YOUR_API_KEY
{
"query": {
"name": "User Authentication API"
}
}Ответ
{
"count": 107
}/api/serviceСоздать Service
Создаёт новый объект.
Запрос создания
POST/api/serviceContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"createdByUser": "Example created by user"
}
}Ответ
{
"_id": "377a9260-28fe-11f1-b591-3fdcef396aba",
"name": "User Authentication API",
"projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
"createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"slug": "Example slug"
}/api/service/:idОбновить по ID
Обновляет объект по ID.
Альтернативные методы
Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:
Запрос обновления
PUT/api/service/:idContent-Type: application/json ApiKey: YOUR_API_KEY
{
"data": {
"name": "User Authentication API",
"description": "RESTful API service that handles user authentication, authorization, and session management for the platform",
"labels": []
}
}Ответ
{}/api/service/:idУдалить по ID
Удаляет объект по ID.
Альтернативные методы
Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:
Запрос удаления
DELETE/api/service/:idContent-Type: application/json ApiKey: YOUR_API_KEY
Ответ
{}Права доступа
Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.
Права на чтение
Нужны для чтения Service
Project OwnerProject AdminProject MemberProject MemberRead ServiceRead All Project Resources
Права на создание
Нужны для создания Service
Project OwnerProject AdminProject MemberCreate Service
Права на обновление
Нужны для обновления Service
Project OwnerProject AdminProject MemberEdit Service
Права на удаление
Нужны для удаления Service
Project OwnerProject AdminProject MemberDelete Service