<!--
  This Install README.md is generated by running:
  "resilient-sdk docgen -p {{ name_underscore }} --install-guide"

  It is best edited using a Text Editor with a Markdown Previewer. VS Code
  is a good example. Checkout https://guides.github.com/features/mastering-markdown/
  for tips on writing with Markdown

  If you make manual edits and run docgen again, a .bak file will be created

  Store any screenshots in the "doc/screenshots" directory and reference them like:
  ![screenshot: screenshot_1](./doc/screenshots/screenshot_1.png)
-->

# {{ name_dash }} Functions for IBM Resilient

- [Release Notes](#release-notes)
- [Overview](#overview)
- [Requirements](#requirements)
- [Installation](#installation)
- [Uninstall](#uninstall)
- [Troubleshooting](#troubleshooting)
- [Support](#support)

---

## Release Notes
<!--
  Specify all changes in this release. Do not remove the release 
  notes of a previous release
-->
### v1.0.0
* Initial Release

---

## Overview
<!--
  Provide a high-level description of the function itself and its remote software or application.
  The text below is parsed from the "description" and "long_description" attributes in the setup.py file
-->
**{{ short_description }}**

 ![screenshot: main](./doc/screenshots/main.png)

{{ long_description }}

---

## Requirements
<!--
  List any Requirements 
-->
* Resilient platform >= `v{{ server_version }}`
* An Integration Server running `{{ res_circuits_dependency_str }}`
  * To set up an Integration Server see: [ibm.biz/res-int-server-guide](https://ibm.biz/res-int-server-guide)
  * If using API Keys, minimum required permissions are:
      * Org Data: Read, Edit
      * Function: Read
---

## Installation
* Download the `{{ name_underscore }}.zip`.
* Copy the `.zip` to your Integration Server and SSH into it.
* **Unzip** the package:
  ```
  $ unzip {{ name_underscore }}-x.x.x.zip
  ```
* **Change Directory** into the unzipped directory:
  ```
  $ cd {{ name_underscore }}-x.x.x
  ```
* **Install** the package:
  ```
  $ pip install {{ name_underscore }}-x.x.x.tar.gz
  ```
{% if app_configs %}
* Import the **configurations** into your app.config file:
  ```
  $ resilient-circuits config -u -l {{ name_dash }}
  ```
{% endif %}
* Import the {{ name_underscore }} **customizations** into the Resilient platform:
  ```
  $ resilient-circuits customize -y -l {{ name_dash }}
  ```
{% if app_configs %}
* Open the config file, scroll to the bottom and edit your {{ name_underscore }} configurations:
  ```
  $ nano ~/.resilient/app.config
  ```
  | Config | Required | Example | Description |
  | ------ | :------: | ------- | ----------- |
{% for app_config in app_configs %}
  | **{{ app_config.name }}** | Yes | `{{ app_config.placeholder }}` | *Enter a description of the config here* |
{% endfor %}

* **Save** and **Close** the app.config file.
{% endif %}
* [Optional]: Run selftest to test the Integration you configured:
  ```
  $ resilient-circuits selftest -l {{ name_dash }}
  ```
* **Run** resilient-circuits or restart the Service on Windows/Linux:
  ```
  $ resilient-circuits run
  ```

{% if datatables or custom_incident_fields %}
### Custom Layouts
<!--
  Use this section to provide guidance on where the user should add any custom fields and data tables.
  You may wish to recommend a new incident tab.
  You should save a screenshot "custom_layouts.png" in the doc/screenshots directory and reference it here
-->
* Import the Data Tables and Custom Fields like the screenshot below:

  ![screenshot: custom_layouts](./doc/screenshots/custom_layouts.png)
{% endif %}

---

## Uninstall
* SSH into your Integration Server.
* **Uninstall** the package:
  ```
  $ pip uninstall {{ name_dash }}
  ```
{% if app_configs %}
* Open the config file, scroll to the [{{ name_underscore }}] section and remove the section or prefix `#` to comment out the section.
* **Save** and **Close** the app.config file.
{% endif %}

---

## Troubleshooting
There are several ways to verify the successful operation of a function.

### Resilient Action Status
* When viewing an incident, use the Actions menu to view **Action Status**.
* By default, pending and errors are displayed.
* Modify the filter for actions to also show Completed actions.
* Clicking on an action displays additional information on the progress made or what error occurred.

### Resilient Scripting Log
* A separate log file is available to review scripting errors.
* This is useful when issues occur in the pre-processing or post-processing scripts.
* The default location for this log file is: `/var/log/resilient-scripting/resilient-scripting.log`.

### Resilient Logs
* By default, Resilient logs are retained at `/usr/share/co3/logs`.
* The `client.log` may contain additional information regarding the execution of functions.

### Resilient-Circuits
* The log is controlled in the `.resilient/app.config` file under the section [resilient] and the property `logdir`.
* The default file name is `app.log`.
* Each function will create progress information.
* Failures will show up as errors and may contain python trace statements.

---

<!--
  If necessary, use this section to describe how to configure your security application to work with the integration.
  Delete this section if the user does not need to perform any configuration procedures on your product.

## Configure <Product_Name>

* Step One
* Step Two
* Step Three

---
-->

## Support
| Name | Version | Author | Support URL |
| ---- | ------- | ------ | ----------- |
| {{ name_underscore }} | {{ version }} | {{ author }} | {{ support_url }} |
