# State vector

Služba zodpovedná za udržiavanie aktuálneho stavu gateway-u.

Udržuje tieto stavy:

  • state_election - stav volieb
  • state_write - stav zapisovačky
  • state_register_terminals - stav registrácie terminálov
  • office_id - ID volebnej miestnosti
  • pin - PIN kód k GUI aplikácii na gataway-i
  • server_key - verejný kľúč servera
  • server_address - adresa servera

# Konfiguračný súbor

Konfiguračný súbor obsahuje celú konfiguráciu volieb pre konkrétnu volebnú miestnosť. Je dostupný ako statický súbor na adrese /statevector/config/config.json pomocou Nginx.

# Popis API

# hello__get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/', headers = headers)

print(r.json())

GET /

Hello

Sample testing endpoint

Example responses

200 Response

{
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# get_state_election_state_election_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/state_election', headers = headers)

print(r.json())

GET /state_election

Get State Election

Get election state string 0 or 1

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# set_state_election_state_election_post

Code samples

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/gateway/statevector/state_election', headers = headers)

print(r.json())

POST /state_election

Set State Election

Set election state string 0 or 1

Body parameter

"string"

Parameters

Name In Type Required Description
body body string true none

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
422 Unprocessable Entity Validation Error HTTPValidationError

Response Schema

# get_state_write_state_write_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/state_write', headers = headers)

print(r.json())

GET /state_write

Get State Write

Get write state string 0 or 1

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# set_state_write_state_write_post

Code samples

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/gateway/statevector/state_write', headers = headers)

print(r.json())

POST /state_write

Set State Write

Set write state string 0 or 1

Body parameter

"string"

Parameters

Name In Type Required Description
body body string true none

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
422 Unprocessable Entity Validation Error HTTPValidationError

Response Schema

# state_register_terminals_state_register_terminals_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/state_register_terminals', headers = headers)

print(r.json())

GET /state_register_terminals

State Register Terminals

Get terminals registration state string 0 or 1

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# set_state_register_terminals_state_register_terminals_post

Code samples

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('/gateway/statevector/state_register_terminals', headers = headers)

print(r.json())

POST /state_register_terminals

Set State Register Terminals

Set register terminals state string 0 or 1

Body parameter

"string"

Parameters

Name In Type Required Description
body body string true none

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline
422 Unprocessable Entity Validation Error HTTPValidationError

Response Schema

# get_office_id_office_id_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/office_id', headers = headers)

print(r.json())

GET /office_id

Get Office Id

Get office id

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# get_pin_pin_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/pin', headers = headers)

print(r.json())

GET /pin

Get Pin

Get pin

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# get_server_key_server_key_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/server_key', headers = headers)

print(r.json())

GET /server_key

Get Server Key

Get server key

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# get_server_address_server_address_get

Code samples

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/gateway/statevector/server_address', headers = headers)

print(r.json())

GET /server_address

Get Server Address

Get server address

Example responses

200 Response

null

Responses

Status Meaning Description Schema
200 OK Successful Response Inline

Response Schema

# Schemas

# HTTPValidationError

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

HTTPValidationError

# Properties
Name Type Required Restrictions Description
detail [ValidationError] false none none

# ValidationError

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

ValidationError

# Properties
Name Type Required Restrictions Description
loc [string] true none none
msg string true none none
type string true none none