itlook-hosts-app 0.2.6
Manage inventory and access to hosts
Requires Python: >=3.8

# app hosts_app

This repo was autogenerated using:
```sh
itlook generate repo --type app --name hosts_app
```

## STEP 1: Setup CLI tool

Install itlook CLI

```sh
pip install --extra-index-url https://pypi.itlook.io/simple itlook
```

ITLook CLI requires active connections with ITLook SaaS for most operations.
In other words, configure ITLook Client:

```sh
itlook login --uri https://my.itlook.io --org boris --user ITLook
```

## STEP 2: Find models and generate code for them

Find ITLook models using next command:

```sh
itlook catalog list models
```

Pick model names using full names or regular expressions

```sh
itlook generate models-code [list-of-models-or-patterns, ...]
```

You can re-run this command any time

## Step 3: Implement your app

### Code structure

<table>
<thead>
    <th>Path</th>
    <th>What's there</th>
</thead>
<tr>
    <td>/hosts_app/main.py</td>
    <td> Entry point of code is here </td>
</tr>
<tr>
    <td>/hosts_app/lib/</td>
    <td>All auto generated models are placed here.</td>
</tr>
<tr>
    <td> /Dockerfile </td>
    <td> Dockerfile do build docker image </td>
</tr>
<tr>
    <td> /requirements.txt </td>
    <td> If you need to add extra python requirements </td>
</tr>
<tr>
    <td> /.itlook/* </td>
    <td> Files related to itlook </td>
</tr>
<tr>
    <td> /tests/* </td>
    <td> Put your unit tests under this directory </td>
</tr>

</table>


### Writing minimal app

*TBD*

### Run unit tests

```sh
tox
```

### Run locally connector app

Go to root directory and execute

```sh
itlook run [--config=.itlook/run_config.json] [--no-publish]
```

Be aware by default itlook will publish new dev version, if autogenerated models
are not matching meta records in itlook catalog.

## Step 4: Publish app meta information

Before using connector, it's meta information shall be published.
There are few options used during publishing:

```sh
itlook publish app --release=[major,minor,dev] [--public]]
```

Version of app is managed by automatically for you.
- major releases: 1, 2, 3, ..., every release bumps version
- minor releases: 1.1, 1.2, 1.3, will bump minor version, keep current major
- dev releases: <current_major_version + 1>.dev-<hash>

### Publishing options

<table>
    <thead>
        <th>Option</th>
        <th>Description</th>
    </thead>
    <tr>
        <td>release=dev</td>
        <td>Publish development version. Use it <b>ONLY FOR DEVELOPMENT:</b>
            <ul>
                <li> <b>ITLook will purge ALL DATA</b> created by app when
                any changes in models, connectors or system occurs.
                Development mode is designed to help developers to iterate quicker,
                not to run anything in production, so everything is EPHEMERAL and
                cleaned by system.</b>
                </li>
                <li> Only app development versions are allowed to use models in development status</li>
                <li> When development is finished, major release shall be cut</li>
            </ul>
        </td>
    </tr>
        <td>release=major</td>
        <td>
            <ul>
                <li> Major releases is general availability of app.</li>
                <li> Any changes in list of models used, or actions requires major release</li>
                <li> Major releases can be made public (available for other organizations)</li>
            </ul>
        </td>
    </tr>
    <tr>
        <td> release=minor</td>
        <td>Use it only from small bug fixes, typos, security patching and meta data updating</td>
    </tr>
    <tr>
        <td> public </td>
        <td>Whatever app is available for other organization. Public repos have limitations:
        <ul>
            <li>Public app can't be deleted without deprecation period</li>
            <li>Public app can't be make private</li>
            <li>All used models are required to be public available</li>
        </ul>
        </td>
    </tr>
</table>