PyScripts Module REST API

GET /v1/rating/module_config/pyscripts/scripts

Get the script list

Parameters:
  • no_data (bool) – Set to True to remove script data from output.

  • deleted (bool) – Show deleted mappings.

  • start (datetime) – Mappings with start after date.

  • end (datetime) – Mappings with end before date.

  • updated_by (str) – user uuid to filter on.

  • created_by (str) – user uuid to filter on.

  • deleted_by (str) – user uuid to filter on.

  • description (str) – mapping that contains the text in description.

  • is_active (bool) – only active mappings.

Return:

List of every scripts.

Return type:

ScriptCollection

GET /v1/rating/module_config/pyscripts/scripts/(script_id)

Return a script.

Parameters:
  • script_id (uuid) – UUID of the script to filter on.

Return type:

Script

POST /v1/rating/module_config/pyscripts/scripts

Create pyscripts script.

Parameters:
  • force (bool) – Allows start and end in the past.

  • script_data (Script) – Informations about the script to create.

Return type:

Script

PUT /v1/rating/module_config/pyscripts/scripts

Update pyscripts script.

Parameters:
  • script_id (uuid) – UUID of the script to update.

  • script_data (Script) – Script data to update.

Return type:

Script

DELETE /v1/rating/module_config/pyscripts/scripts

Delete the script.

Parameters:
  • script_id (uuid) – UUID of the script to delete.

type Script

Type describing a script.

Data samples:

Json
{
    "created_at": "2023-01-01T10:10:10",
    "created_by": "7977999e2e2511e6a8b2df30b233ffcb",
    "deleted": "2023-01-15T00:00:00",
    "deleted_by": "7977999e2e2511e6a8b2df30b233ffcb",
    "description": "description",
    "end": "2023-03-01T00:00:00",
    "name": "rule 1",
    "start": "2023-02-01T00:00:00",
    "updated_by": "7977999e2e2511e6a8b2df30b233ffcb"
}
XML
b'<value>\n  <name>rule 1</name>\n  <created_at>2023-01-01T10:10:10</created_at>\n  <start>2023-02-01T00:00:00</start>\n  <end>2023-03-01 00:00:00</end>\n  <description>description</description>\n  <deleted>2023-01-15T00:00:00</deleted>\n  <created_by>7977999e2e2511e6a8b2df30b233ffcb</created_by>\n  <updated_by>7977999e2e2511e6a8b2df30b233ffcb</updated_by>\n  <deleted_by>7977999e2e2511e6a8b2df30b233ffcb</deleted_by>\n</value>'
checksum

Checksum of the script data.

created_at

The date the rule was created.

created_by

The id of the user who created the rule.

data

Data of the script.

deleted

The date the rule was deleted.

deleted_by

The id of the user who deleted the rule.

description

The description of the rule.

end

Must be None or a date in the future. To set a date in the past, use the force parameter in the POST query.

name

Name of the script.

script_id

UUID of the script.

start

Must be None or a date in the future. To set a date in the past, use the force parameter in the POST query.

updated_by

The id of the user who last updated the rule.

type ScriptCollection

Type describing a list of scripts.

Data samples:

Json
{
    "scripts": [
        {
            "created_at": "2023-01-01T10:10:10",
            "created_by": "7977999e2e2511e6a8b2df30b233ffcb",
            "deleted": "2023-01-15T00:00:00",
            "deleted_by": "7977999e2e2511e6a8b2df30b233ffcb",
            "description": "description",
            "end": "2023-03-01T00:00:00",
            "name": "rule 1",
            "start": "2023-02-01T00:00:00",
            "updated_by": "7977999e2e2511e6a8b2df30b233ffcb"
        }
    ]
}
XML
b'<value>\n  <scripts>\n    <item>\n      <name>rule 1</name>\n      <created_at>2023-01-01T10:10:10</created_at>\n      <start>2023-02-01T00:00:00</start>\n      <end>2023-03-01 00:00:00</end>\n      <description>description</description>\n      <deleted>2023-01-15T00:00:00</deleted>\n      <created_by>7977999e2e2511e6a8b2df30b233ffcb</created_by>\n      <updated_by>7977999e2e2511e6a8b2df30b233ffcb</updated_by>\n      <deleted_by>7977999e2e2511e6a8b2df30b233ffcb</deleted_by>\n    </item>\n  </scripts>\n</value>'
scripts

List of scripts.