Source types

You can use various HTTP methods to load, create, update, and delete source types.

Load (GET method)

To load a source type, use a GET method and the following URL:
https://<server>:<port>/Unity/SourceTypes
To load a single source type, use a GET method and the following URL:
https://<server>:<port>/Unity/SourceTypes?id=<sourcetype_id>
where <sourcetype_id> is the identifier of the source type that you want to load.
The possible input values are described in the table:
Table 1. GET method parameters
Parameter Description
indexingConfig Enter the valid index configuration for the JSON file.
inputType Specify the type of file that is loaded. 0, denoting log file, is the only possible value.
splitter:fileSet Specify the file set that the splitter uses to split log files.
splitter:ruleSet Specify the rule set that the splitter uses to split log files.
splitter:type Specify the type of splitter that is used. 0 means that the file is used for splitting log files. 1 means that the file is used for annotating log files.
name Specify the name of the source type that you want to create.
id Specify the identifier of the source type that you want to load.
annotator:fileSet Specify the file set that the annotator uses to annotate log files.
annotator:ruleSet Specify the rule set that the annotator uses to annotate log files.
annotator:type Specify the type of annotator that is used. 0 means that the file is used for splitting log files. 1 means that the file is used for annotating log files.
annotator:postOnFailure Specify whether you want to annotator to post results if the annotation process fails. The default value is false.
You define the parameter values in the JSON format in the HTTP message body. For example:
{
    "indexingConfig": {},				- Valid index configuration JSON
    "inputType": 0,						- 0 for log file
    "splitter": {
        "fileSet": <fileset_id>,
        "ruleSet": <ruleset_id>,
        "type": 1						- 0 for Split 1 for Annotate
    },
    "name": "Javacore",
    "id": <id>,
    "annotator": {
        "fileSet": <fileset_id>,
        "ruleSet": <ruleset_id>,
        "type": 1,						- 0 for Split 1 for Annotate
        "postOnFailure": false
    }}

Create (POST method)

To create a source type, use a POST method and the following URL:
https://<server>:<port>/Unity/SourceTypes
You define the parameter values in the JSON format in the HTTP message body. The values are the same as the ones that are listed in table 1. For example:
{
    "name": "Test",
    "indexingConfig": {},				- Valid index configuration JSON
    "inputType": 0,						- 0 for log file
    "splitter": {
        "ruleSet": <ruleset_id>,
		  "fileSet": <fileset_id>
    },
    "annotator": {
		  "ruleSet": <ruleset_id>,
        "fileSet": <fileset_id>,
        "postOnFailure": true
    }}

Update (PUT method)

To update a source type, use a PUT method and the following URL:
https://<server>:<port>/Unity/SourceTypes?id=<sourcetype_id>
where <sourcetype_id> is the identifier of the source type that you want to update.

You define the parameter values in the JSON format in the HTTP message body. The values are the same as the ones that are listed in table 1. The input JSON is the same as that described for POST method.

Delete (DELETE method)

To delete a source type, uses a DELETE method and the following URL:
https://<server>:<port>/Unity/SourceTypes?id=<sourcetype_id>
where <sourcetype_id> is the identifier of the source type that you want to delete.