Documentation Powered by ReDoc

# Luna-Streams API (v.0.2.1)

Download OpenAPI specification:Download

'VisionLabs Luna-Streams'

Service is intended for creation and management streams. A Streams is an user logical entity.

# version

## get version

get service version

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/version

### Response samples

- 200
- 500

Content type
application/json
application/json
application/msgpack
`
{

- "Version":
  {
  - "api": 1,
  - "major": 0,
  - "minor": 0,
  - "patch": 0
  }

}`

# streams

## create stream

Create a new stream.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

One of

account_id required | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... new stream account ID for authentication in Luna Platform
name | string <= 128 characters Default: "" new stream name
description | string <= 128 characters Default: "" new stream description
required | any (stream_data) stream data
required | object (stream_event_handler) stream event handler data
| object (stream_policies) stream processing policies
| object (location_to_be_created) stream location info
| object (stream_autorestart) stream autorestart policies
status | string Default: "pending" Enum: "pending" "pause" processing initial status
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ group name

### Responses

/1/streams

### Request samples

- Payload

Content type
application/json
Example
stream_with_group_name
stream_with_group_name
stream_with_group_id
`
{

- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "name": "",
- "description": "",
- "data":
  {
  - "type": "udp",
  - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
  - "roi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "droi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "rotation": 0,
  - "preferred_program_stream_frame_width": 800,
  - "endless": true
  },
- "event_handler":
  {
  - "origin": "http://127.0.0.1:5000",
  - "api_version": 6,
  - "bestshot_handler":
    {
    - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
    },
  - "detection_handler":
    {
    - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
    },
  - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
  },
- "policies":
  {
  - "sending":
    {
    - "time_period_of_searching": -1,
    - "silent_period": 0,
    - "type": "sec",
    - "number_of_bestshots_to_send": 1,
    - "send_only_full_set": true,
    - "delete_track_after_sending": false
    },
  - "primary_track_policy":
    {
    - "use_primary_track_policy": false,
    - "best_shot_min_size": 70,
    - "best_shot_proper_size": 140
    },
  - "liveness":
    {
    - "use_shoulders_liveness_filtration": false,
    - "use_mask_liveness_filtration": false,
    - "use_flying_faces_liveness_filtration": false,
    - "liveness_mode": 0,
    - "number_of_liveness_checks": 10,
    - "liveness_threshold": 0.6,
    - "livenesses_weights":
      [
      - 0.05,
      - 0.45,
      - 0.5
      ],
    - "mask_backgrounds_count": 300
    },
  - "filtering":
    {
    - "min_score": 0.5187,
    - "detection_yaw_threshold": 40,
    - "detection_pitch_threshold": 40,
    - "detection_roll_threshold": 30,
    - "yaw_number": 1,
    - "yaw_collection_mode": false,
    - "mouth_occlusion_threshold": 0.1,
    - "min_body_size_threshold": 0.1
    },
  - "frame_processing_mode": "auto",
  - "real_time_mode_fps": 0,
  - "ffmpeg_threads_number": 0,
  - "healthcheck":
    {
    - "max_error_count": 10,
    - "period": 3600,
    - "retry_delay": 5
    }
  },
- "location":
  {
  - "city": "Moscow",
  - "area": "Central",
  - "district": "Basmanny",
  - "street": "Podsosensky lane",
  - "house_number": "23 bldg.3",
  - "geo_position":
    {
    - "longitude": 36.616,
    - "latitude": 55.752
    }
  },
- "autorestart":
  {
  - "restart": 0,
  - "attempt_count": 10,
  - "delay": 60
  },
- "status": "pending",
- "group_name": "hd_stream_2"

}`

### Response samples

- 201
- 400
- 403
- 500

Content type
application/json
`
{

- "stream_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "version": 1

}`

## get streams

Get streams according to filters. The results are sorted by stream creation order, the oldest streams shown first.

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id
stream_ids | Array of strings <uuid> (stream_id) Example: stream_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Stream Id filter. Only streams with the specified ids will be returned in the response.
names | Array of strings (stream_name) Example: names=name1,name2 Stream Name filter. Only streams with the specified names will be returned in the response.
reference | string (stream_reference) <= 512 characters Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA== Stream Reference filter. Only streams with the specified reference will be returned in the response.
statuses | Array of strings (stream_status) Items Enum: "pending" "in_progress" "done" "pause" "restart" "cancel" "failure" "handler_lost" "not_found" Example: statuses=pending,pause Stream Status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.
create_time__gte | string <date-time> (time) Example: create_time__gte=2021-09-21T11:11:41.674Z Stream create time lower including bound filter in RFC 3339 format. Only streams with the creation time greater than or equal to the specified boundary will be returned in the response.
create_time__lt | string <date-time> (time) Example: create_time__lt=2021-09-21T19:11:41.674Z Stream create time upper excliding bound filter in RFC 3339 format. Only streams with the creation time lower than the specified boundary will be returned in the response.
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ Example: group_name=group1 Group name filter. Only groups with the specified names will be returned in the response.
page | integer >= 1 Default: 1 a page number.
page_size | integer [ 1 .. 100 ] Default: 10 the number of items on page.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "streams":
  [
  - {
    - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
    - "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
    - "name": "some name",
    - "description": "some description",
    - "data":
      {
      - "type": "udp",
      - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
      - "roi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "droi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "rotation": 0,
      - "preferred_program_stream_frame_width": 800,
      - "endless": true
      },
    - "event_handler":
      {
      - "origin": "http://127.0.0.1:5000",
      - "api_version": 6,
      - "bestshot_handler":
        {
        - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
        },
      - "detection_handler":
        {
        - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
        },
      - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
      },
    - "policies":
      {
      - "sending":
        {
        - "time_period_of_searching": -1,
        - "silent_period": 0,
        - "type": "sec",
        - "number_of_bestshots_to_send": 1,
        - "send_only_full_set": true,
        - "delete_track_after_sending": false
        },
      - "primary_track_policy":
        {
        - "use_primary_track_policy": false,
        - "best_shot_min_size": 70,
        - "best_shot_proper_size": 140
        },
      - "liveness":
        {
        - "use_shoulders_liveness_filtration": false,
        - "use_mask_liveness_filtration": false,
        - "use_flying_faces_liveness_filtration": false,
        - "liveness_mode": 0,
        - "number_of_liveness_checks": 10,
        - "liveness_threshold": 0.6,
        - "livenesses_weights":
          [
          - 0.05,
          - 0.45,
          - 0.5
          ],
        - "mask_backgrounds_count": 300
        },
      - "filtering":
        {
        - "min_score": 0.5187,
        - "detection_yaw_threshold": 40,
        - "detection_pitch_threshold": 40,
        - "detection_roll_threshold": 30,
        - "yaw_number": 1,
        - "yaw_collection_mode": false,
        - "mouth_occlusion_threshold": 0.1,
        - "min_body_size_threshold": 0.1
        },
      - "frame_processing_mode": "auto",
      - "real_time_mode_fps": 0,
      - "ffmpeg_threads_number": 0,
      - "healthcheck":
        {
        - "max_error_count": 10,
        - "period": 3600,
        - "retry_delay": 5
        }
      },
    - "location":
      {
      - "city": "Moscow",
      - "area": "Central",
      - "district": "Basmanny",
      - "street": "Podsosensky lane",
      - "house_number": "23 bldg.3",
      - "geo_position":
        {
        - "longitude": 36.616,
        - "latitude": 55.752
        }
      },
    - "autorestart":
      {
      - "restart": 0,
      - "attempt_count": 10,
      - "delay": 60,
      - "current_attempt": 0,
      - "last_attempt_time": "2018-08-11T09:11:41.674Z"
      },
    - "version": 1,
    - "create_time": "2018-08-11T09:11:41.674Z",
    - "status": "pending",
    - "last_error": null,
    - "video_info":
      {
      - "width": 1920,
      - "height": 1080,
      - "frame_rate": 25,
      - "bit_rate": 25,
      - "gop_size": 25,
      - "start_time": "2018-08-11T09:11:41.674Z",
      - "duration": 0,
      - "progress": 0
      },
    - "groups":
      [
      - "hd_stream_2"
      ]
    }
  ]

}`

## delete streams

Delete streams matching specified filters (OR).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

stream_ids | Array of strings <uuid> (stream_id) <= 1000 items Stream Id filter.
names | Array of strings (stream_name) <= 1000 items Stream Name filter.

### Responses

/1/streams

### Request samples

- Payload

Content type
application/json
`
{

- "stream_ids":
  [
  - "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
  ],
- "names":
  [
  - "some name"
  ]

}`

### Response samples

- 400
- 500

Content type
application/json
`
{

- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'Additional properties are not allowed ('faces' was unexpected)'",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"

}`

## count streams

Count streams according to the filters.

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id
stream_ids | Array of strings <uuid> (stream_id) Example: stream_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Stream Id filter. Only streams with the specified ids will be returned in the response.
names | Array of strings (stream_name) Example: names=name1,name2 Stream Name filter. Only streams with the specified names will be returned in the response.
reference | string (stream_reference) <= 512 characters Example: reference=https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA== Stream Reference filter. Only streams with the specified reference will be returned in the response.
statuses | Array of strings (stream_status) Items Enum: "pending" "in_progress" "done" "pause" "restart" "cancel" "failure" "handler_lost" "not_found" Example: statuses=pending,pause Stream Status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.
create_time__gte | string <date-time> (time) Example: create_time__gte=2021-09-21T11:11:41.674Z Stream create time lower including bound filter in RFC 3339 format. Only streams with the creation time greater than or equal to the specified boundary will be returned in the response.
create_time__lt | string <date-time> (time) Example: create_time__lt=2021-09-21T19:11:41.674Z Stream create time upper excliding bound filter in RFC 3339 format. Only streams with the creation time lower than the specified boundary will be returned in the response.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams/count

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "streams_count": 146

}`

## get stream

Get the stream by ID.

##### path Parameters

stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream (`stream_id` received in the "create stream" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams/{stream_id}

### Response samples

- 200
- 404
- 500

Content type
application/json
`
{

- "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "name": "some name",
- "description": "some description",
- "data":
  {
  - "type": "udp",
  - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
  - "roi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "droi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "rotation": 0,
  - "preferred_program_stream_frame_width": 800,
  - "endless": true
  },
- "event_handler":
  {
  - "origin": "http://127.0.0.1:5000",
  - "api_version": 6,
  - "bestshot_handler":
    {
    - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
    },
  - "detection_handler":
    {
    - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
    },
  - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
  },
- "policies":
  {
  - "sending":
    {
    - "time_period_of_searching": -1,
    - "silent_period": 0,
    - "type": "sec",
    - "number_of_bestshots_to_send": 1,
    - "send_only_full_set": true,
    - "delete_track_after_sending": false
    },
  - "primary_track_policy":
    {
    - "use_primary_track_policy": false,
    - "best_shot_min_size": 70,
    - "best_shot_proper_size": 140
    },
  - "liveness":
    {
    - "use_shoulders_liveness_filtration": false,
    - "use_mask_liveness_filtration": false,
    - "use_flying_faces_liveness_filtration": false,
    - "liveness_mode": 0,
    - "number_of_liveness_checks": 10,
    - "liveness_threshold": 0.6,
    - "livenesses_weights":
      [
      - 0.05,
      - 0.45,
      - 0.5
      ],
    - "mask_backgrounds_count": 300
    },
  - "filtering":
    {
    - "min_score": 0.5187,
    - "detection_yaw_threshold": 40,
    - "detection_pitch_threshold": 40,
    - "detection_roll_threshold": 30,
    - "yaw_number": 1,
    - "yaw_collection_mode": false,
    - "mouth_occlusion_threshold": 0.1,
    - "min_body_size_threshold": 0.1
    },
  - "frame_processing_mode": "auto",
  - "real_time_mode_fps": 0,
  - "ffmpeg_threads_number": 0,
  - "healthcheck":
    {
    - "max_error_count": 10,
    - "period": 3600,
    - "retry_delay": 5
    }
  },
- "location":
  {
  - "city": "Moscow",
  - "area": "Central",
  - "district": "Basmanny",
  - "street": "Podsosensky lane",
  - "house_number": "23 bldg.3",
  - "geo_position":
    {
    - "longitude": 36.616,
    - "latitude": 55.752
    }
  },
- "autorestart":
  {
  - "restart": 0,
  - "attempt_count": 10,
  - "delay": 60,
  - "current_attempt": 0,
  - "last_attempt_time": "2018-08-11T09:11:41.674Z"
  },
- "version": 1,
- "create_time": "2018-08-11T09:11:41.674Z",
- "status": "pending",
- "last_error": null,
- "video_info":
  {
  - "width": 1920,
  - "height": 1080,
  - "frame_rate": 25,
  - "bit_rate": 25,
  - "gop_size": 25,
  - "start_time": "2018-08-11T09:11:41.674Z",
  - "duration": 0,
  - "progress": 0
  },
- "groups":
  [
  - "hd_stream_2"
  ]

}`

## update stream

Update stream fields: description, status.

##### path Parameters

stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream (`stream_id` received in the "create stream" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

description | string <= 128 characters new stream description
status | string Enum: "pending" "pause" "cancel" new stream processing status

### Responses

/1/streams/{stream_id}

### Request samples

- Payload

Content type
application/json
`
{

- "description": "cancelled stream description",
- "status": "cancel"

}`

### Response samples

- 400
- 403
- 404
- 500

Content type
application/json
Example
nothing_to_update
nothing_to_update
invalid_status
extra_fields
unable_to_pause
unable_to_cancel
`
{

- "error_code": 12022,
- "desc": "Bad/incomplete input data",
- "detail": "Failed to validate input json. Path: '', message: 'at least one field must have a value'",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"

}`

## put stream

Update existing stream. You should specify all the fields required for the stream in the request.

##### path Parameters

stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream (`stream_id` received in the "create stream" request).

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

One of

account_id required | string <uuid> ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... new stream account ID for authentication in Luna Platform
name | string <= 128 characters Default: "" new stream name
description | string <= 128 characters Default: "" new stream description
required | any (stream_data) stream data
required | object (stream_event_handler) stream event handler data
| object (stream_policies) stream processing policies
| object (location_to_be_created) stream location info
| object (stream_autorestart) stream autorestart policies
status | string Default: "pending" Enum: "pending" "pause" processing initial status
group_name | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ group name

### Responses

/1/streams/{stream_id}

### Request samples

- Payload

Content type
application/json
Example
stream_with_group_name
stream_with_group_name
stream_with_group_id
`
{

- "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
- "name": "",
- "description": "",
- "data":
  {
  - "type": "udp",
  - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
  - "roi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "droi":
    [
    - 0,
    - 0,
    - 0,
    - 0
    ],
  - "rotation": 0,
  - "preferred_program_stream_frame_width": 800,
  - "endless": true
  },
- "event_handler":
  {
  - "origin": "http://127.0.0.1:5000",
  - "api_version": 6,
  - "bestshot_handler":
    {
    - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
    },
  - "detection_handler":
    {
    - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
    },
  - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
  },
- "policies":
  {
  - "sending":
    {
    - "time_period_of_searching": -1,
    - "silent_period": 0,
    - "type": "sec",
    - "number_of_bestshots_to_send": 1,
    - "send_only_full_set": true,
    - "delete_track_after_sending": false
    },
  - "primary_track_policy":
    {
    - "use_primary_track_policy": false,
    - "best_shot_min_size": 70,
    - "best_shot_proper_size": 140
    },
  - "liveness":
    {
    - "use_shoulders_liveness_filtration": false,
    - "use_mask_liveness_filtration": false,
    - "use_flying_faces_liveness_filtration": false,
    - "liveness_mode": 0,
    - "number_of_liveness_checks": 10,
    - "liveness_threshold": 0.6,
    - "livenesses_weights":
      [
      - 0.05,
      - 0.45,
      - 0.5
      ],
    - "mask_backgrounds_count": 300
    },
  - "filtering":
    {
    - "min_score": 0.5187,
    - "detection_yaw_threshold": 40,
    - "detection_pitch_threshold": 40,
    - "detection_roll_threshold": 30,
    - "yaw_number": 1,
    - "yaw_collection_mode": false,
    - "mouth_occlusion_threshold": 0.1,
    - "min_body_size_threshold": 0.1
    },
  - "frame_processing_mode": "auto",
  - "real_time_mode_fps": 0,
  - "ffmpeg_threads_number": 0,
  - "healthcheck":
    {
    - "max_error_count": 10,
    - "period": 3600,
    - "retry_delay": 5
    }
  },
- "location":
  {
  - "city": "Moscow",
  - "area": "Central",
  - "district": "Basmanny",
  - "street": "Podsosensky lane",
  - "house_number": "23 bldg.3",
  - "geo_position":
    {
    - "longitude": 36.616,
    - "latitude": 55.752
    }
  },
- "autorestart":
  {
  - "restart": 0,
  - "attempt_count": 10,
  - "delay": 60
  },
- "status": "pending",
- "group_name": "hd_stream_2"

}`

### Response samples

- 200
- 400
- 403
- 404
- 500

Content type
application/json
`
{

- "stream_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "version": 10

}`

## remove stream

Remove the stream by ID.

##### path Parameters

stream_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the stream (`stream_id` received in the "create stream" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams/{stream_id}

### Response samples

- 404
- 500

Content type
application/json
`
{

- "error_code": 39001,
- "desc": "Object not found",
- "detail": "Stream with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-39001"

}`

# queue

## Check the streams processing queue

See the streams in the queue.

##### query Parameters

limit required | integer >= 1 Maximum number of the objects in the response.
stream_ids | Array of strings <uuid> (stream_id) Example: stream_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Stream Id filter. Only streams with the specified ids will be returned in the response.
names | Array of strings (stream_name) Example: names=name1,name2 Stream Name filter. Only streams with the specified names will be returned in the response.
group_ids | Array of strings <uuid> (group_id) Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce group ids
group_names | Array of strings (group_name) Example: group_names=group1,group2 group names

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams/processing/queue

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "streams":
  [
  - {
    - "status": "pending",
    - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
    - "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
    - "name": "some name",
    - "description": "some description",
    - "data":
      {
      - "type": "udp",
      - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
      - "roi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "droi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "rotation": 0,
      - "preferred_program_stream_frame_width": 800,
      - "endless": true
      },
    - "event_handler":
      {
      - "origin": "http://127.0.0.1:5000",
      - "api_version": 6,
      - "bestshot_handler":
        {
        - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
        },
      - "detection_handler":
        {
        - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
        },
      - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
      },
    - "policies":
      {
      - "sending":
        {
        - "time_period_of_searching": -1,
        - "silent_period": 0,
        - "type": "sec",
        - "number_of_bestshots_to_send": 1,
        - "send_only_full_set": true,
        - "delete_track_after_sending": false
        },
      - "primary_track_policy":
        {
        - "use_primary_track_policy": false,
        - "best_shot_min_size": 70,
        - "best_shot_proper_size": 140
        },
      - "liveness":
        {
        - "use_shoulders_liveness_filtration": false,
        - "use_mask_liveness_filtration": false,
        - "use_flying_faces_liveness_filtration": false,
        - "liveness_mode": 0,
        - "number_of_liveness_checks": 10,
        - "liveness_threshold": 0.6,
        - "livenesses_weights":
          [
          - 0.05,
          - 0.45,
          - 0.5
          ],
        - "mask_backgrounds_count": 300
        },
      - "filtering":
        {
        - "min_score": 0.5187,
        - "detection_yaw_threshold": 40,
        - "detection_pitch_threshold": 40,
        - "detection_roll_threshold": 30,
        - "yaw_number": 1,
        - "yaw_collection_mode": false,
        - "mouth_occlusion_threshold": 0.1,
        - "min_body_size_threshold": 0.1
        },
      - "frame_processing_mode": "auto",
      - "real_time_mode_fps": 0,
      - "ffmpeg_threads_number": 0,
      - "healthcheck":
        {
        - "max_error_count": 10,
        - "period": 3600,
        - "retry_delay": 5
        }
      },
    - "location":
      {
      - "city": "Moscow",
      - "area": "Central",
      - "district": "Basmanny",
      - "street": "Podsosensky lane",
      - "house_number": "23 bldg.3",
      - "geo_position":
        {
        - "longitude": 36.616,
        - "latitude": 55.752
        }
      },
    - "autorestart":
      {
      - "restart": 0,
      - "attempt_count": 10,
      - "delay": 60,
      - "current_attempt": 0,
      - "last_attempt_time": "2018-08-11T09:11:41.674Z"
      },
    - "version": 1,
    - "create_time": "2018-08-11T09:11:41.674Z",
    - "last_error": null,
    - "video_info":
      {
      - "width": 1920,
      - "height": 1080,
      - "frame_rate": 25,
      - "bit_rate": 25,
      - "gop_size": 25,
      - "start_time": "2018-08-11T09:11:41.674Z",
      - "duration": 0,
      - "progress": 0
      },
    - "groups":
      [
      - "hd_stream_2"
      ]
    }
  ]

}`

## Get some streams from the queue

Receive streams from the queue. The streams are received according to the specified filters.

The following actions are performed upon the request:

- The streams are marked as "in progress".
- The streams are deleted from the Streams Processing Queue.

The information about the streams is returned in the response.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

required | object (post_streams_processing_queue_request_filters)
limit required | integer >= 1 maximum number of the streams to return

### Responses

/1/streams/processing/queue

### Request samples

- Payload

Content type
application/json
`
{

- "filters":
  {
  - "stream_ids":
    [
    - "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
    ],
  - "names":
    [
    - "some name"
    ],
  - "group_ids":
    [
    - "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
    ],
  - "group_names":
    [
    - "hd_stream_2"
    ]
  },
- "limit": 1

}`

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "streams":
  [
  - {
    - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
    - "account_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
    - "name": "some name",
    - "description": "some description",
    - "data":
      {
      - "type": "udp",
      - "reference": "https://upload.wikimedia.org/wikipedia/commons/2xQ2gprbMUePw1s9gw9fvA==",
      - "roi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "droi":
        [
        - 0,
        - 0,
        - 0,
        - 0
        ],
      - "rotation": 0,
      - "preferred_program_stream_frame_width": 800,
      - "endless": true
      },
    - "event_handler":
      {
      - "origin": "http://127.0.0.1:5000",
      - "api_version": 6,
      - "bestshot_handler":
        {
        - "handler_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
        },
      - "detection_handler":
        {
        - "handler_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
        },
      - "frame_store": "http://127.0.0.1:5020/1/buckets/frames/images"
      },
    - "policies":
      {
      - "sending":
        {
        - "time_period_of_searching": -1,
        - "silent_period": 0,
        - "type": "sec",
        - "number_of_bestshots_to_send": 1,
        - "send_only_full_set": true,
        - "delete_track_after_sending": false
        },
      - "primary_track_policy":
        {
        - "use_primary_track_policy": false,
        - "best_shot_min_size": 70,
        - "best_shot_proper_size": 140
        },
      - "liveness":
        {
        - "use_shoulders_liveness_filtration": false,
        - "use_mask_liveness_filtration": false,
        - "use_flying_faces_liveness_filtration": false,
        - "liveness_mode": 0,
        - "number_of_liveness_checks": 10,
        - "liveness_threshold": 0.6,
        - "livenesses_weights":
          [
          - 0.05,
          - 0.45,
          - 0.5
          ],
        - "mask_backgrounds_count": 300
        },
      - "filtering":
        {
        - "min_score": 0.5187,
        - "detection_yaw_threshold": 40,
        - "detection_pitch_threshold": 40,
        - "detection_roll_threshold": 30,
        - "yaw_number": 1,
        - "yaw_collection_mode": false,
        - "mouth_occlusion_threshold": 0.1,
        - "min_body_size_threshold": 0.1
        },
      - "frame_processing_mode": "auto",
      - "real_time_mode_fps": 0,
      - "ffmpeg_threads_number": 0,
      - "healthcheck":
        {
        - "max_error_count": 10,
        - "period": 3600,
        - "retry_delay": 5
        }
      },
    - "location":
      {
      - "city": "Moscow",
      - "area": "Central",
      - "district": "Basmanny",
      - "street": "Podsosensky lane",
      - "house_number": "23 bldg.3",
      - "geo_position":
        {
        - "longitude": 36.616,
        - "latitude": 55.752
        }
      },
    - "autorestart":
      {
      - "restart": 0,
      - "attempt_count": 10,
      - "delay": 60,
      - "current_attempt": 0,
      - "last_attempt_time": "2018-08-11T09:11:41.674Z"
      },
    - "version": 1,
    - "create_time": "2018-08-11T09:11:41.674Z",
    - "status": "in_progress",
    - "last_error": null,
    - "video_info":
      {
      - "width": 1920,
      - "height": 1080,
      - "frame_rate": 25,
      - "bit_rate": 25,
      - "gop_size": 25,
      - "start_time": "2018-08-11T09:11:41.674Z",
      - "duration": 0,
      - "progress": 0
      },
    - "groups":
      [
      - "hd_stream_2"
      ]
    }
  ]

}`

## Post feedback on streams

Post information about streams processing.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

required | Array of objects array of stream info

### Responses

/1/streams/processing/feedback

### Request samples

- Payload

Content type
application/json
`
{

- "streams":
  [
  - {
    - "error": null,
    - "video_info":
      {
      - "width": 1920,
      - "height": 1080,
      - "frame_rate": 25,
      - "bit_rate": 25,
      - "gop_size": 25,
      - "start_time": "2018-08-11T09:11:41.674Z",
      - "duration": 0,
      - "progress": 0
      },
    - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
    - "status": "in_progress",
    - "version": 1
    }
  ]

}`

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "streams":
  {
  - "modified":
    [
    - {
      - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
      - "status": "in_progress",
      - "version": 1
      }
    ],
  - "unmodified":
    [
    - {
      - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
      - "status": "in_progress",
      - "version": 1
      }
    ]
  }

}`

# streams logs

## get streams logs

Get streams logs according to filters. The results are sorted by log creation order, the new streams logs shown first.

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id
stream_ids | Array of strings <uuid> (stream_id) Example: stream_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce Stream Id filter. Only streams with the specified ids will be returned in the response.
statuses | Array of strings (stream_status) Items Enum: "pending" "in_progress" "done" "pause" "restart" "cancel" "failure" "handler_lost" "not_found" Example: statuses=pending,pause Stream Status filter - comma-separated list of status values. Only streams with the specified statuses will be returned in the response.
targets | Array of strings Default: ["stream_id","status","error","video_info","log_time","version"] Items Enum: "stream_id" "status" "error" "video_info" "log_time" "version" Example: targets=status List of comma-separated stream logs targets.
log_time__lt | string <date-time> (time) Example: log_time__lt=2021-09-21T19:11:41.674Z Stream log record time upper excliding bound filter in RFC 3339 format. Only stream logs with the record time lower than the specified boundary will be returned in the response.
log_time__gte | string <date-time> (time) Example: log_time__gte=2021-09-21T11:11:41.674Z Stream log record time lower including bound filter in RFC 3339 format. Only stream log with the record time greater than or equal to the specified boundary will be returned in the response.
page | integer >= 1 Default: 1 a page number.
page_size | integer [ 1 .. 100 ] Default: 10 the number of items on page.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/streams/logs

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "logs":
  [
  - {
    - "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6",
    - "log_time": "string",
    - "error": null,
    - "status": "in_progress",
    - "video_info":
      {
      - "width": 1920,
      - "height": 1080,
      - "frame_rate": 25,
      - "bit_rate": 25,
      - "gop_size": 25,
      - "start_time": "2018-08-11T09:11:41.674Z",
      - "duration": 0,
      - "progress": 0
      },
    - "version": 1
    }
  ]

}`

# groups

## create group

Create a new group.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

account_id required | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... account ID for authentication in Luna Platform
group_name required | string (group_name) ^[a-zA-Z0-9_\-]{1,128}$ group name
description | string <= 256 characters Default: "" group description

### Responses

/1/groups

### Request samples

- Payload

Content type
application/json
`
{

- "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "group_name": "stream_group-1",
- "description": "default stream group"

}`

### Response samples

- 201
- 400
- 409
- 500

Content type
application/json
`
{

- "group_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "group_name": "stream_group-1"

}`

## get groups

Get groups according to filters. The results are sorted by group creation order, the oldest group shown first.

##### query Parameters

group_ids | Array of strings <uuid> (group_id) Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce group ids
group_names | Array of strings (group_name) Example: group_names=group1,group2 group names
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id
page | integer >= 1 Default: 1 a page number.
page_size | integer [ 1 .. 100 ] Default: 10 the number of items on page.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/groups

### Response samples

- 200
- 400
- 500

Content type
application/json
`
[

- {
  - "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
  - "group_name": "stream_group-1",
  - "group_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
  - "description": "default stream group",
  - "create_time": "2018-08-11T09:11:41.674Z"
  },
- {
  - "account_id": "2d6cbe1f-cbbe-485a-ab37-b968cc5e8764",
  - "group_name": "stream_group-2",
  - "group_id": "a7d8fd45-fgga-453d-ac05-3e594054b813",
  - "description": "stream group 2",
  - "create_time": "2019-10-11T10:11:41.674Z"
  }

]`

## get group count

Count of groups according to the filters.

##### query Parameters

group_ids | Array of strings <uuid> (group_id) Example: group_ids=ae09126e-70a6-49c7-923f-df2320f08639,68b363eb-600a-4e72-afb3-8c4196e385ce group ids
group_names | Array of strings (group_name) Example: group_names=group1,group2 group names
account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/groups/count

### Response samples

- 200
- 400
- 500

Content type
application/json
`
{

- "groups_count": 7

}`

## get group

Get the group by name.

##### path Parameters

group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group (`group_id` received in the "create group" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/groups/{group_id}

### Response samples

- 200
- 400
- 404
- 500

Content type
application/json
`
{

- "account_id": "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b",
- "group_name": "stream_group-1",
- "group_id": "b5d6fd45-fcca-453d-ac05-3e594054b813",
- "description": "default stream group",
- "create_time": "2018-08-11T09:11:41.674Z"

}`

## update group

Update group fields: description

##### path Parameters

group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group (`group_id` received in the "create group" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

description required | string <= 256 characters group description

### Responses

/1/groups/{group_id}

### Request samples

- Payload

Content type
application/json
`
{

- "description": "old stream group"

}`

### Response samples

- 400
- 404
- 500

Content type
application/json
`
{

- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"

}`

## remove group

Remove the group by name.

##### path Parameters

group_id required | string <uuid> (uuid) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: 557d54ec-29ad-4f3c-93b4-c9092ef12515 ID of the group (`group_id` received in the "create group" request).

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/groups/{group_id}

### Response samples

- 400
- 404
- 500

Content type
application/json
`
{

- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"

}`

# linker

## attach (or detach) streams to a group

attach (or detach) streams to a group

##### query Parameters

account_id | string <uuid> (account_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... Example: account_id=8950722f-3fd4-4223-b48f-03f95f0e8dfb account id

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

##### Request Body schema: application/json

action required | string Enum: "attach" "detach" action to perform: attach streams to group or detach
stream_ids required | Array of strings <uuid> (uuid) <= 1000 items stream ids
group_id required | string <uuid> (group_id) ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]... group ID

### Responses

/1/linker

### Request samples

- Payload

Content type
application/json
`
{

- "action": "attach",
- "stream_ids":
  [
  - "557d54ec-29ad-4f3c-93b4-c9092ef12515"
  ],
- "group_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"

}`

### Response samples

- 400
- 500

Content type
application/json
`
{

- "error_code": 12012,
- "desc": "Bad/incomplete input data",
- "detail": "Bad query parameters 'account_id'",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"

}`

# documents

## get openapi documentation

Get service OpenApi documentation. If Accept request header is of type `application/x-yaml`, returns documentation in `yaml` format or returns `html` documentation, if Accept-Type is `text/html`

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.
Accept required | string (accept_docs_handler) Enum: "application/x-yaml" "text/html" acceptable type of receiving data

### Responses

/1/docs/spec

### Response samples

- 415
- 500

Content type
application/json
`
{

- "error_code": 12024,
- "detail": "Bad/incomplete input data",
- "desc": "Unsupported media type",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12024"

}`

## get development manual

Get sphinx documentation - Development Manual. After the request you will be redirected to the page `/docs/dev/index.html`

##### header Parameters

Accept | string Enum: "application/json" "application/msgpack" Preferred response content type
Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/1/docs/dev

### Response samples

- 500

Content type
application/json
`
{

- "error_code": 1,
- "detail": "internal server error",
- "desc": "internal server error",
- "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-1"

}`

# config

## get service configuration

Get service configuration. Passwords and tokens will be hidden in the response.

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.
Accept | string Enum: "application/json" "text/plain" acceptable type of receiving data

### Responses

/1/config

### Response samples

- 200
- 415
- 500

Content type
application/json
application/json
text/plain
`
{

- "INFLUX_MONITORING":
  {
  - "SEND_DATA_FOR_MONITORING": 0,
  - "VERSION": 2,
  - "ORGANIZATION": "ORGANIZATION_NAME",
  - "TOKEN": "********",
  - "BUCKET": "luna_monitoring",
  - "HOST": "127.0.0.1",
  - "PORT": 8086,
  - "USE_SSL": 0,
  - "FLUSHING_PERIOD": 1
  }

}`

# health

## get health

get health of service

##### header Parameters

Luna-Request-Id | string <timestamp,uuid> ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4... Example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs. If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.

### Responses

/healthcheck

### Response samples

- 200
- 500
- 502

Content type
application/json
`
{

- "execution_time": 0.123

}`