# Lists

## Lists - CreateDynamic

Creates a collection of list that collects specific values from the events during runtime and stores them for a limited or an unlimited period.

**POST**

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

### Parameters

| Field            | Label in UI |   Type | Description                                                                                                                                                                                                                                                                                                                            |
| ---------------- | ----------: | -----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agelimit\_day    |         Day |    int | Age Limit is the expiration time for the values in the list. Specify the value for the day. Mandatory Field.                                                                                                                                                                                                                           |
| agelimit\_hour   |        Hour |    int | Specify the value for the hour. Mandatory Field.                                                                                                                                                                                                                                                                                       |
| agelimit\_minute |      Minute |    int | Specify the value for the minute. Mandatory Field.                                                                                                                                                                                                                                                                                     |
| d\_name          |        Name | String | Specify the name for the list which is automatically represented in uppercase. The value can be alpha numeric characters with underscore(*) and the value should not begin or end with white space character, hyphen(-) and underscore(*). The value should contain at least 2 characters and at most 100 characters. Mandatory Field. |

### Request Example

```json
{
    "data": {
        "agelimit_day": 0,
        "agelimit_hour": 0,
        "agelimit_minute": 30,
        "d_name": "DEVICE_IP_LIST"
    }
}
```

### Success Response

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

## Lists - CreateStatic

Creates a collection of pre-defined values which can be used to search those values efficiently.

**POST**

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

### Parameters

| Field   |    Label in UI |      Type | Description                                                                                                                                                                                                                                                                                                                            |
| ------- | -------------: | --------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| lists   | List of Values | \[String] | List of values for s\_name. Mandatory Field.                                                                                                                                                                                                                                                                                           |
| s\_name |           Name |    String | Specify the name for the list which is automatically represented in uppercase. The value can be alpha numeric characters with underscore(*) and the value should not begin or end with white space character, hyphen(-) and underscore(*). The value should contain at least 2 characters and at most 100 characters. Mandatory Field. |

### Request Example

```json
{
    "data": {
        "lists": [
            "10.1.1.1",
            "10.2.2.2"
        ],
        "s_name": "IP_BLACKLIST"
    }
}
```

### Success Response

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

***

## Lists - EditDynamic

Edits a collection of list that collects specific values from the events during the runtime and stores them for a limited or an unlimited period.

**PUT**

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

### Parameters

| Field            | Label in UI |   Type | Description                                                                                                  |
| ---------------- | ----------: | -----: | ------------------------------------------------------------------------------------------------------------ |
| agelimit\_day    |         Day |    int | Age Limit is the expiration time for the values in the list. Specify the value for the day. Mandatory Field. |
| agelimit\_hour   |        Hour |    int | Specify the value for the hour. Mandatory Field.                                                             |
| agelimit\_minute |      Minute |    int | Specify the value for the minute. Mandatory Field.                                                           |
| id               |           - | String | Existing Lists id. Obtain the value of the required Lists id using Lists - List API. Mandatory Field.        |

### Request Example

```json
{
    "data": {
        "agelimit_day": 0,
        "agelimit_hour": 0,
        "agelimit_minute": 30
    }
}
```

### Success Response

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

***

## Lists - EditStatic

Edits a collection of pre-defined values which can be used to search those values efficiently.

**PUT**

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

### Parameters

| Field |    Label in UI |      Type | Description                                                                                           |
| ----- | -------------: | --------: | ----------------------------------------------------------------------------------------------------- |
| id    |              - |    String | Existing Lists id. Obtain the value of the required Lists id using Lists - List API. Mandatory Field. |
| lists | List of Values | \[String] | List of values for s\_name. Mandatory Field.                                                          |

### Request Example

```json
{
    "data": {
        "lists": [
            "10.1.1.1",
            "10.2.2.2"
        ]
    }
}
```

### Success Response

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

## Lists - Get

Get list with given ID.

**GET**

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

### Parameters

| Field | Label in UI |   Type | Description        |
| ----- | ----------: | -----: | ------------------ |
| id    |           - | String | Existing list\_id. |

### Success Response

```json
{
   "name": "IP_BLACKLIST",
   "lists": [
       "10.1.1.1",
       "10.2.2.2"
   ],
   "user": "admin",
   "tid": "",
   "lists_vendor": [],
   "list_type": "static_list",
   "age_limit": 0,
   "last_updated": "",
   "active": true,
   "hidden": false,
   "vid": "",
   "id": "57591a2cd8aaa41bfef54888"
}
```

## Lists - Install

Install a given .pak, .txt or .csv file containing lists.

**POST**

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

### Parameters

| Field          | Label in UI |   Type | Description                                                                                     |
| -------------- | ----------: | -----: | ----------------------------------------------------------------------------------------------- |
| file\_location |           - | String | Location of the file uploaded to install. Can be either 'private' or 'public'. Mandatory Field. |
| file\_name     |           - | String | Name of the .pak, .csv or .txt file containing Lists. Mandatory Field.                          |

### Request Example

```json
{
    "data": {
        "file_location": "private",
        "file_name": "lists.pak"
    }
}
```

### Success Response

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

## Lists - List

Lists all lists.

**GET**

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

### Success Response

```json
[
   {
        "name": "IP_BLACKLIST",
        "lists": [
            "10.1.1.1",
            "10.2.2.2"
        ],
        "user": "admin",
        "tid": "",
        "lists_vendor": [],
        "list_type": "static_list",
        "age_limit": 0,
        "last_updated": "",
        "active": true,
        "hidden": false,
        "vid": "",
        "id": "57591a2cd8aaa41bfef54888"
    }
]
```

## Lists - ListPrivateUploads

List all the .pak, .csv or .txt files that contain list in private storage.

**GET**

```
https://api-server-host-name/configapi/{pool_UUID}/Lists/list
```

### Success Response

```json
[
    "lists.pak",
    "lists.csv",
    "lists.txt"
]
```

## Lists - ListPublicUploads

List all the .pak, .csv or .txt files that contain lists in public storage.

**GET**

```
https://api-server-host-name/configapi/Lists/list
```

### Success Response

```json
[
    "lists.pak",
    "lists.csv",
    "lists.txt"
]
```

## Lists - RefreshList

Syncs the current data of lists with LogPoint's lists.

**POST**

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

### Request Example

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

### Success Response

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

## Lists - Trash

Deletes list of given ID.

**DELETE**

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

### Parameters

| Field | Label in UI |   Type | Description                         |
| ----- | ----------: | -----: | ----------------------------------- |
| id    |           - | String | existing list\_id. Mandatory Field. |

### Success Response

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

## Lists - TrashPrivateUploads

Delete the file with given name from private storage.

**DELETE**

```
https://api-server-host-name/configapi/{pool_UUID}/Lists/{file_name}
```

### Parameters

| Field      | Label in UI |   Type | Description                                      |
| ---------- | ----------: | -----: | ------------------------------------------------ |
| file\_name |             | String | Name of the file to be deleted. Mandatory Field. |

### Success Response

```json
{
    "status": "Success",
    "message": "lists.pak successfully deleted"
}
```

## Lists - TrashPublicUploads

Delete the file with given name from public storage.

**DELETE**

```
https://api-server-host-name/configapi/Lists/{file_name}
```

### Parameters

| Field      | Label in UI |   Type | Description                                      |
| ---------- | ----------: | -----: | ------------------------------------------------ |
| file\_name |             | String | Name of the file to be deleted. Mandatory Field. |

### Success Response

```json
{
    "status": "Success",
    "message": "lists.pak successfully deleted"
}
```

## Lists - Upload

Upload .pak, .csv or .txt file containing lists to private storage.

**POST**

```
https://api-server-host-name/configapi/{pool_UUID}/Lists/upload
```

### Headers

| Field             | Label in UI | Description                                                                                                                                                                            |
| ----------------- | ----------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file\_name        |             | Name of the file to be uploaded.                                                                                                                                                       |
| Content-Type      |             | application/octet-stream                                                                                                                                                               |
| replace\_existing |             | Set the value of this parameter as 'true' to replace the existing file with the same name with the new file. Default value is 'false'. Value can be 'true' or 'false'. Optional Field. |

### Parameters

| Field | Label in UI |      Type | Description                                                |
| ----- | ----------: | --------: | ---------------------------------------------------------- |
| file  |             | \[Object] | (.pak, .csv or .txt file) to be uploaded. Mandatory Field. |

### Success Response

```json
{
    "status": "Success",
    "message": "lists.pak successfully uploaded in private storage. "
}
```

## Lists - UploadPublic

Upload .pak, .csv or .txt file containing lists to public storage.

**POST**

```
https://api-server-host-name/configapi/Lists/publicupload
```

### Headers

| Field             | Label in UI | Description                                                                                                                                                                            |
| ----------------- | ----------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file\_name        |             | Name of the file to be uploaded.                                                                                                                                                       |
| Content-Type      |             | application/octet-stream                                                                                                                                                               |
| replace\_existing |             | Set the value of this parameter as 'true' to replace the existing file with the same name with the new file. Default value is 'false'. Value can be 'true' or 'false'. Optional Field. |

### Parameters

| Field | Label in UI |      Type | Description                                                |
| ----- | ----------: | --------: | ---------------------------------------------------------- |
| file  |             | \[Object] | (.pak, .csv or .txt file) to be uploaded. Mandatory Field. |

### Success Response

```json
{
    "status": "Success",
    "message": "lists.pak successfully uploaded in public storage."
}
```
