4.3.3. ProjectSettingsChange

Description

The method allows you to change the settings of an existing project.

Request

{
  "user_id":(number),
  "methods":[
    {
      "method":"ProjectSettingsChange",
      "params":{
        "project_id":(number),
        "name":(string),
        "default_view":(string),
        "report_settings":{
          "generate_report":(boolean),
          "format":(string),
          "store_template":(boolean)
        },
        "restart_settings":{
          "restart":(boolean),
          "attempts_number":(number)
        }
      }
    }
  ]
}

where:

  • user_id — an integer value, a user identifier;

  • project_id — an integer value, a user project identifier;

  • name — a string, a project name;

  • default_view — a string, the view that should be displayed when opening a project. List of views: dashboard (by default), templates, probes_view;

  • generate_report — a logical type, manages the automatic generation of a report for completed tasks in the selected format;

  • format — a string, report format for completed tasks. List of formats: PDF (by default), CSV, JSON;

  • store_template — a logical type, it is responsible for storing the template in ZIP-archive with the report;

  • restart — a logical type, it is responsible for restarting a task with the Stalled state the specified number of times. For more information about Stalled state, see TaskStatus;

  • attempts_number — an integer value, specifies the number of times a task with Stalled status will be restarted. The value can be in the range from 1 to 10, default value is 3.

Reply

{
  "reply":[
    {
      "method":"ProjectSettingsChange",
      "result":[
        {
          "name":(string),
          "settings":{
            "default_view":(string),
            "report_settings":{
              "generate_report":(boolean),
              "format":(string),
              "store_template":(boolean)
            },
            "restart_settings":{
              "restart":(boolean),
              "attempts_number":(number)
            }
          }
        }
      ]
    }
  ]
}

where:

  • name — a string, a project name;

  • default_view — a string, the view that will be displayed when opening a project;

  • generate_report — a logical type, manages the automatic generation of a report for completed tasks in the selected format;

  • format — a string, report format for completed tasks;

  • store_template — a logical type, it is responsible for storing the template in ZIP-archive with the report;

  • restart — a logical type, it is responsible for restarting a task with the Stalled state the specified number of times;

  • attempts_number — an integer value, specifies the number of times a task with Stalled status will be restarted.

Example

Request by the cURL utility
Request Changes to project settings
curl http://172.16.1.41/ctrl_api/v1/json \
 -H "Content-Type: application/json" \
 --data '{"user_id":1,"methods":[{"method":"ProjectSettingsChange","params":{"project_id":2,"name":"NewNameAPI","default_view":"templates","report_settings":{"generate_report":true,"format":"JSON","store_template":true},"restart_settings":{"restart":true,"attempts_number":1}}}]}'
Reply
 {
   "reply":[
     {
       "method":"ProjectSettingsChange",
       "result":{
         "name":"NewNameAPI",
         "settings":{
           "default_view":"templates",
           "report_settings":{
             "generate_report":true,
             "format":"JSON",
             "store_template":true
           },
           "restart_settings":{
             "restart":true,
             "attempts_number":1
           }
         }
       }
     }
   ]
 }