Porovnat verze

Klíč

  • Tento řádek byl přidán.
  • Tento řádek byl odstraněn.
  • Formátování bylo změněno.

...

To read the parameter property.

Request

  • Urn:             /api/

...

  • prop
  • Method:      POST
  • Request header:  Cookie: session  - actual session value.
  • Request content: json
Blok kódu
titlePožadavekJson schema:
POST {
        "param$schema": ["http://json-schema.org/draft-07/schema#",
      "title": "prop -  request"sntp_enable",
         "type": "sntp_serverobject",
          "sntp_timeout",
  properties": {
        "sntp_period",param": {
          "dev_sntype": "array",
          "test_wr_param"
items": {
         ]
   "type": "string",
  }
 
nebo
POST {
        "parampattern": "^[a-z_][a-z0-9_] //returns all existing parameters
*$"
          }

Odpověď je ve formátu json.

Blok kódu
titleOdpověď
{
      "status": {
        "sntp_timeout": "undefined", }
      },
      "proprequired":{ [
        "sntp_enableparam":{
          "type": "short"],
          "accessadditionalProperties": "rw",
      false
}

Meaning of json items:

  • $.param
    Array with names of configuration parameters to retrieve parameter definitions. An empty array causes read all parameter definitions.


Blok kódu
titleExample
- request for reading values of specific parameters:
{
    "enumparam": [
       				// request for reading values of specific parameters
     { "ident": "no",  "value": 0 },
     sntp_enable",
       { "ident": "yes", "value": 1 }
          ]
 sntp_server",
         "restartRequired": true
        }sntp_timeout",
        "sntp_serverperiod":{,
          "type": "string"def_fw_version",
          "size": 254test_wr_only_param",
          "access": "rw",device_restart"
    ]
}
OR
{							 // request for reading values "restartRequired": true,
       for all existing parameters (empty array):
   "regexparam": "^((?!-)[0-9A-Za-z-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$"]					
}

Response

  • Response code:
    • 200 – OK
    • 400 – Error (bad request)
    • 401 – Unauthorized
    • 500 – Server error
    • 512 - Internal application error
  • Response header: Set-Cookie: session  - Actual session value.
  • Response type: json
Blok kódu
titleJson schema:
{
        },
  "$schema": "http://json-schema.org/draft-07/schema#",
      "sntp_periodtitle":{
 "set -  response",
      "type": "integerobject",
          "accessproperties": "rw",{
          "minValuestatus": 1,{
          "maxValuetype": 24
        },
"object",
          "dev_fw_versionadditionalProperties": {
            "type": "string",
            "accessminLength": "r"1,
        },
       "pattern": "test_wr_only_param":{^[a-z_][a-z0-9_]*$"
          "type": "integer",}
          "access": "w"
  }
      },
        "do_adm_restart":{
          "type": "action",
          "access": ""
        },
  "additionalProperties": false
}

Meaning of json items:

  • $.status:
    List of unsaved parameter values.
    Is present only for response with response code 400 – Bad request.
    Type: object
    Optional.
    • Format of list items: "<parameter_name>": "<error_status>"
      <parameter_name> – name of reported parameter
      <error_status> – type of error.
    • Possible values:
      "undefined" – parameter not exists
      "bad value" – parameter value is out of range
      "bad type" – wrong type of parameter value
      "access denied" – parameter is not accessible for write
      "no memory" – not enough memory
      "error" – general internal error
      "busy" – device is in busy state (e.g. during the factory init process or upgrade process)
Blok kódu
titleExample
{
      "firmwarestatus": {
          "typesntp_timeout": "fileundefined",
          "accesssntp_period": "w"
        }bad value",
        "configurationsntp_enable":{
          "type": "file "bad type",
          "accessdev_sn": "rw"
        }access denied"
      }
    }