# SCPFetcher

## SCPFetcher - Create

Create SCP fetcher with device ID

**POST**

```
https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/SCPFetcher
```

#### Parameters

| Field          |              Label in UI |   Type | Description                                                                                                                                                                    |
| -------------- | -----------------------: | -----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| auth\_type     |           Authentication | String | password or certificate (exact). Mandatory Field                                                                                                                               |
| username       |                 Username | String | SCP username. Mandatory Field                                                                                                                                                  |
| parser         |                   Parser | String | Value can be one of the following: SyslogParser LineParser StackTraceParser DB2Parser RACFParser or any custom parser. Mandatory Field                                         |
| interval       | Fetch Interval (minutes) |    int | Fetch interval in minutes. Mandatory Field                                                                                                                                     |
| processpolicy  |        Processing Policy | String | Select a Processing Policy for the collector. Execute ProcessingPolicy - List API to list the available processpolicies and use the value of the id parameter. Mandatory Field |
| namepattern    |         Filename Pattern | String | Regex pattern for filename match or empty for all. Optional Field                                                                                                              |
| port           |                     Port |    int | Access port. Mandatory Field                                                                                                                                                   |
| oldlogs        |         Forward Old Logs | String | Check point to extract old logs or not - If check should be "on" or "off" (exact). Mandatory Field                                                                             |
| device\_id     |                        - | String | Existing Device id . Obtain the value of the required device\_id using Devices - List API. Optional Field                                                                      |
| auth\_password |                 Password | String | Password for authentication. Only mandatory if auth\_type is equal to 'password'. Mandatory Field                                                                              |
| charset        |                  Charset | String | Existing LogPoint charset. Obtain the value of the required charset using Charsets - List API. Mandatory Field                                                                 |
| remotepath     |        Relative FilePath | String | Remote path to the file directory. Optional Field.                                                                                                                             |
| policy\_id     |                        - | String | Respective LCP policy ID. Obtain the value of the required policy\_id using LogCollectionPolicies - List API. Optional Field                                                   |

#### Request Example

{% code title="Request JSON" %}

```json
{
    "data": {
        "auth_type": "password",
        "username": "SCPTest",
        "parser": "SyslogParser",
        "interval": 6,
        "processpolicy": "57724aacd8aaa40b569bcb1fasd",
        "namepattern": "*.pyc",
        "port": 22,
        "oldlogs": "on",
        "device_id": "57724aacd8aaa40b569bcb1f",
        "auth_password": "hercules",
        "charset": "utf_8",
        "remotepath": "/base/collection/"
    }
}
```

{% endcode %}

#### Success Response

{% code title="Success JSON" %}

```json
{
    "status": "Success",
    "message": "/monitorapi/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

{% endcode %}

## SCPFetcher - Edit

Edit SCP with given ID

**PUT**

```
https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/SCPFetcher/{id}
```

#### Parameters

| Field          |              Label in UI |   Type | Description                                                                                                                                                                                                                                                                 |
| -------------- | -----------------------: | -----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id             |                        - | String | UUID of the respective SCPFetcher. To obtain the SCP fetcher uuid , execute Devices - List API if the collector was configured using device id or execute LogCollectionPolicies - List API if the collector was configured using log collection policy id . Mandatory Field |
| processpolicy  |        Processing Policy | String | Pick one from the available process policy id from the database. Mandatory Field                                                                                                                                                                                            |
| charset        |                  Charset | String | Existing LogPoint charset. Obtain the value of the required charset using Charsets - List API. Mandatory Field                                                                                                                                                              |
| auth\_type     |           Authentication | String | password or certificate (exact). Mandatory Field                                                                                                                                                                                                                            |
| username       |                 Username | String | SCP username. Mandatory Field                                                                                                                                                                                                                                               |
| remotepath     |        Relative FilePath | String | Remote path to the file directory. Optional Field                                                                                                                                                                                                                           |
| namepattern    |         Filename Pattern | String | Regex pattern for filename match or empty for all. Optional Field                                                                                                                                                                                                           |
| port           |                     Port |    int | Access port. Mandatory Field                                                                                                                                                                                                                                                |
| parser         |                   Parser | String | Value can be one of the following: SyslogParser LineParser StackTraceParser DB2Parser RACFParser . Mandatory Field                                                                                                                                                          |
| interval       | Fetch Interval (minutes) |    int | Fetch interval in minutes. Mandatory Field                                                                                                                                                                                                                                  |
| oldlogs        |         Forward Old Logs | String | Check point to extract old logs or not - If check should be "on" or "off" (exact). Mandatory Field                                                                                                                                                                          |
| auth\_password |                 Password | String | Password for authentication. Only mandatory if auth\_type is equal to 'password'. Mandatory Field                                                                                                                                                                           |

#### Request Example

{% code title="Request JSON" %}

```json
{
    "data": {
        "processpolicy": "57724aacd8aaa40b569bcb1fasd",
        "charset": "utf_8",
        "auth_type": "password",
        "username": "SCPTest",
        "remotepath": "/base/collection/",
        "namepattern": "*.pyc",
        "port": 22,
        "parser": "SyslogParser",
        "interval": 6,
        "oldlogs": "on",
        "auth_password": "hercules"
    }
}
```

{% endcode %}

#### Success Response

{% code title="Success JSON" %}

```json
{
    "status": "Success",
    "message": "/monitorapi/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

{% endcode %}

## SCPFetcher - TestExisting

Test existing SCP connection

**POST**

```
https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/SCPFetcher/{id}/testexistingscp
```

#### Parameters

| Field | Label in UI |   Type | Description                                                                                                                   |
| ----- | ----------: | -----: | ----------------------------------------------------------------------------------------------------------------------------- |
| id    |           - | String | UUID of the respective SCPFetcher. Obtain the value of the required SCPFetcher uuid using Devices - List API. Mandatory Field |

#### Request Example

{% code title="" %}

```json
{
    "data": {}
}
```

{% endcode %}

#### Success Response

{% code title="Success JSON" %}

```json
{
    "status": "Success",
    "message": "/monitorapi/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

{% endcode %}

## SCPFetcher - TestNew

Test new SCP fetcher with device ID

**POST**

```
https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/SCPFetcher/testnewscp
```

#### Parameters

| Field          |              Label in UI |   Type | Description                                                                                                                                                                      |
| -------------- | -----------------------: | -----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| auth\_type     |           Authentication | String | password or certificate (exact). Mandatory Field                                                                                                                                 |
| username       |                 Username | String | SCP username. Mandatory Field                                                                                                                                                    |
| parser         |                   Parser | String | Value can be one of the following: SyslogParser LineParser StackTraceParser DB2Parser RACFParser or any custom parser. Mandatory Field                                           |
| device\_id     |                        - | String | Existing Device id . Obtain the value of the required device\_id using Devices - List API. Optional Field                                                                        |
| interval       | Fetch Interval (minutes) |    int | Fetch interval in minutes. Mandatory Field                                                                                                                                       |
| processpolicy  |        Processing Policy | String | Select a Processing Policy for the collector. Execute ProcessingPolicy - List API to list the available processpolicies and use the value of the id parameter. . Mandatory Field |
| namepattern    |         Filename Pattern | String | Regex pattern for filename match or empty for all. Optional Field                                                                                                                |
| port           |                     Port |    int | Access port. Mandatory Field                                                                                                                                                     |
| oldlogs        |         Forward Old Logs | String | Check point to extract old logs or not - If check should be "on" or "off" (exact). Mandatory Field                                                                               |
| auth\_password |                 Password | String | Password for authentication. Only mandatory if auth\_type is equal to 'password'. Mandatory Field                                                                                |
| charset        |                  Charset | String | Existing LogPoint charset. Obtain the value of the required charset using Charsets - List API. Mandatory Field                                                                   |
| remotepath     |        Relative FilePath | String | Remote path to the file directory. Optional Field                                                                                                                                |

#### Request Example

{% code title="Request JSON" %}

```json
{
    "data": {
        "auth_type": "password",
        "username": "SCPTest",
        "parser": "SyslogParser",
        "device_id": "57724aacd8aaa40b569bcb1f",
        "interval": 6,
        "processpolicy": "57724aacd8aaa40b569bcb1fasd",
        "namepattern": "*.pyc",
        "port": 22,
        "oldlogs": "on",
        "auth_password": "hercules",
        "charset": "utf_8",
        "remotepath": "/base/collection/"
    }
}
```

{% endcode %}

#### Success Response

{% code title="Success JSON" %}

```json
{
    "status": "Success",
    "message": "/monitorapi/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

{% endcode %}

## SCPFetcher - Trash

Delete the SCP fetcher with given ID

**DELETE**

```
https://api-server-host-name/configapi/{pool_UUID}/{logpoint_identifier}/SCPFetcher/{id}
```

#### Parameters

| Field | Label in UI |   Type | Description                                                                                                                                                                                                                                                                 |
| ----- | ----------: | -----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id    |           - | String | UUID of the respective SCPFetcher. To obtain the SCP fetcher uuid , execute Devices - List API if the collector was configured using device id or execute LogCollectionPolicies - List API if the collector was configured using log collection policy id . Mandatory Field |

#### Success Response

{% code title="Success JSON" %}

```json
{
    "status": "Success",
    "message": "/monitorapi/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

{% endcode %}
