read the docscontents 1 installation 3 1.1 install from pypi. . . . . . . . . . . . . . . . . . . ....

298
Polemarch Documentation Release 1.8.2 VST Consulting Mar 05, 2021

Upload: others

Post on 17-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch DocumentationRelease 1.8.2

VST Consulting

Mar 05, 2021

Page 2: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker
Page 3: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CONTENTS

1 Installation 31.1 Install from PyPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Install from docker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Quickstart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.5 Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.6 Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.7 Update from any old version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.8 Migrate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.9 Create superuser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.10 Change password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 Configuration manual 112.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Polemarch clustering overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3 Main settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.4 Database settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5 Cache settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.6 Locks settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.7 Session cache settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.8 Rpc settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.9 Worker settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.10 Web settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.11 Git settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.12 Production web settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.13 Configuration options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.14 Installation of additional packages to Polemarch . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3 GUI workflow 173.1 Welcome to Polemarch GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2 Before you start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.3 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.4 Project variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.5 Module execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.6 Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.7 Periodic tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.8 Inventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503.9 Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.10 Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563.11 Variables for inventory, group, host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

i

Page 4: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

3.12 Import inventory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623.13 .polemarch.yaml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.14 Community project samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753.15 Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803.16 Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

4 API 894.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5 How to participate 287

6 VST Consulting contributor agreement 2896.1 1. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2896.2 2. Copyright Assignment, License and Waiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2896.3 3. Patent License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2906.4 4. Your Representation and Warranties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2906.5 5. Intellectual Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2906.6 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

HTTP Routing Table 291

ii

Page 5: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Polemarch is a service for infrastructure orchestration based on ansible. Simple WEB gui for infrastructure orches-tration using ansible playbooks.

You could find latest releases there. Also you could find source code in official repository.

Contact us on any questions or report bugs.

Official site: https://polemarch.org/

We also help you via:

Twitter - we post information about new releases and new features

Slack - support channel

Stack Overflow - tag for questions about our application on Stack Overflow

CONTENTS 1

Page 6: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

2 CONTENTS

Page 7: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

ONE

INSTALLATION

1.1 Install from PyPI

1. Install dependencies:

Required packages on Ubuntu/Debian:

sudo apt-get install python3-virtualenv python3.6 python3.6-dev gcc libffi-dev→˓libkrb5-dev libffi6 libssl-dev libyaml-dev libsasl2-dev libldap2-dev default-→˓libmysqlclient-dev sshpass git

Required packages on Red Hat/CentOS:

sudo yum install epel-releasesudo yum install https://$(rpm -E '%{?centos:centos}%{!?centos:rhel}%{rhel}').→˓iuscommunity.org/ius-release.rpmsudo yum install python36u python36u-devel python36-virtualenv openssl-devel→˓libyaml-devel krb5-devel krb5-libs openldap-devel mysql-devel git sshpass

2. Create user:

sudo useradd --user-group --create-home --shell /bin/bash polemarch

Hint: You can add this user to sudoers for easer instalation proccess and support.

3. Create virtualenv and activate it:

virtualenv --python=python3.6 /opt/polemarchsudo chown -R polemarch:polemarch /opt/polemarchsudo -u polemarch -isource /opt/polemarch/bin/activate

Note: If you have more then one Python version, recomended use Python 3.6 and create virtualenvwith Py3.6

Warning: We support Python 2.7 until Polemarch 2.0 release.

4. Install Polemarch:

3

Page 8: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

pip install -U polemarch[mysql]

5. Edit config file:

1. Open /etc/polemarch/settings.ini, if it does not exist, create it. Polemarch uses config from this directory.

2. The default database is SQLite3, but MariaDB is recommended. Settings needed for correct work Mari-aDB database:

[database]engine = django.db.backends.mysqlname = db_nameuser = db_userpassword = db_password

[database.options]connect_timeout = 20init_command = SET sql_mode='STRICT_TRANS_TABLES', default_storage_→˓engine=INNODB, NAMES 'utf8', CHARACTER SET 'utf8', SESSION collation_→˓connection = 'utf8_unicode_ci'

Note: Set host and port settings if you connect to remote server.

3. Create database in MariaDB with this commands:

sudo -H mysql <<QUERY_INPUTSET @@global.innodb_large_prefix = 1;create user db_user;create database db_name default CHARACTER set utf8 default COLLATE→˓utf8_general_ci;grant all on db_name.* to 'db_user'@'localhost' identified by 'db_→˓password';QUERY_INPUT

Note: You should do it on database host if you connect to remote server.

4. Then, if you use MariaDB and you have set timezone different from “UTC” you should run next command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo -H mysql mysql

Note: You should do it on database host if you connect to remote server.

5. The default cache system is file based cache, but RedisCache is recommended. Settings needed for correctRedisCache work:

[cache]backend = django_redis.cache.RedisCachelocation = redis://127.0.0.1:6379/1

[locks]backend = django_redis.cache.RedisCachelocation = redis://127.0.0.1:6379/2

4 Chapter 1. Installation

Page 9: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Note: Set host ip and port instead of 127.0.0.1:6379 if you connect to remote server.

6. The default celery broker is file Celery broker, but Redis is recommended. Settings needed for correctRedis work:

[rpc]connection = redis://127.0.0.1:6379/3heartbeat = 5concurrency = 8enable_worker = true

Note: Set host ip and port instead of 127.0.0.1:6379 if you connect to remote server.

Hint: Use RabbitMQ in case there can be a big network delay between the Polemarch nodes.

7. Create directory for log and pid files:

mkdir /opt/polemarch/logs /opt/polemarch/pid

8. For running Polemarch with worker, you need to create follow sections:

[uwsgi]processes = 4threads = 4harakiri = 120vacuum = Truehttp-keepalive = truehttp-auto-chunked = truethread-stacksize = 512pidfile = /opt/polemarch/pid/polemarch.pidlog_file = /opt/polemarch/logs/{PROG_NAME}_web.log# Uncomment it for HTTPS and install `uwsgi` pypi package to env:# addrport = 127.0.0.1:8080# https = 0.0.0.0:443,/etc/polemarch/polemarch.crt,/etc/polemarch/polemarch.→˓key

[worker]# output will be /opt/polemarch/logs/polemarch_worker.loglogfile = /opt/polemarch/logs/{PROG_NAME}_worker.log# output will be /opt/polemarch/pid/polemarch_worker.pidpidfile = /opt/polemarch/pid/{PROG_NAME}_worker.pidloglevel = INFO

Also if you need to set your own path for logfile or pidfile, different from the path from example, you cando it, but make sure, that user, which starts Polemarch has write-permissions for these directory and file.If you run it as root, we recommend to add in `[uwsig]` params `uid` and `gid` (read more).

Tip: More configuration settings you can find in Configuration manual.

6. Make migrations:

1.1. Install from PyPI 5

Page 10: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

polemarchctl migrate

7. Start Polemarch:

polemarchctl webserver

Polemarch starts with web interface on port 8080.

If you need to restart Polemarch use following command:

polemarchctl webserver reload=/opt/polemarch/pid/polemarch.pid

If you use another directory for storing Polemarch pid file, use path to this file.

If you need to stop Polemarch use following command:

polemarchctl webserver stop=/opt/polemarch/pid/polemarch.pid

If you use another directory for storing Polemarch pid file, use path to this file.

1.2 Install from docker

1.2.1 Run image

For run Polemarch docker image use command:

docker run -d --name polemarch --restart always -v /opt/polemarch/projects:/→˓projects -v /opt/polemarch/hooks:/hooks vstconsulting/polemarch

Using this command download official docker image and run it with default settings. Dont use default SQLite instal-lation with filecache in production.

Polemarch will be run with web interface on port 8080

1.2.2 Settings

1.2.3 Main section

• POLEMARCH_DEBUG - status of debug mode. Default value: false.

• POLEMARCH_LOG_LEVEL - log level. Default value: WARNING.

• TIMEZONE - timezone. Default value: UTC.

1.2.4 Database section

If you not set POLEMARCH_DB_HOST, default database would be SQLite3, path to database file: /db.sqlite3. Ifyou set POLEMARCH_DB_HOST, Polemarch would be use MYSQL with next variabls:

• POLEMARCH_DB_TYPE - name of database type. Support: mysql and postgres database. Needed only withPOLEMARCH_DB_HOST option.

• POLEMARCH_DB_NAME - name of database.

• POLEMARCH_DB_USER - user connected to database.

6 Chapter 1. Installation

Page 11: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• POLEMARCH_DB_PASSWORD - password for connection to database.

• POLEMARCH_DB_HOST - host for connection to database.

• POLEMARCH_DB_PORT - port for connection to database.

1.2.5 Database.Options section

• DB_INIT_CMD - command to start your database

1.2.6 Cache

• CACHE_LOCATION - path to cache, if you use /tmp/polemarch_django_cache path, then cache engine wouldbe FileBasedCache, else MemcacheCache. Default value: ‘‘/tmp/polemarch_django_cache‘

1.2.7 RPC section

• RPC_ENGINE - connection to rpc service. If not set, not used.

• RPC_HEARTBEAT - Timeout for RPC. Default value: 5.

• RPC_CONCURRENCY - Number of concurrently tasks. Default value: 4.

1.2.8 Web section

• POLEMARCH_WEB_REST_PAGE_LIMIT - Limit elements in answer, when send REST request. Defaultvalue: 1000.

1.2.9 UWSGI section

• POLEMARCH_UWSGI_PROCESSES - number of uwsgi processes. Default value: 4.

1.2.10 Other settings

If you set WORKER to ENABLE state, uwsgi run worker as daemon.

If you set SECRET_KEY,value of SECRET_KEY variable would be written to secret

1.3 Examples

Run latest version of Polemarch in docker and connect to MySQL on server:

docker run -d --name polemarch --restart always -v /opt/polemarch/projects:/→˓projects -v /opt/polemarch/hooks:/hooks --env POLEMARCH_DB_TYPE=mysql --→˓env POLEMARCH_DB_NAME=polemarch --env POLEMARCH_DB_USER=polemarch --env→˓POLEMARCH_DB_PASSWORD=polemarch --env POLEMARCH_DB_PORT=3306 --env→˓POLEMARCH_DB_HOST=polemarch_db vstconsulting/polemarch

Run Polemarch with Memcache and RabbitMQ and SQLite3. Polemarch log-level=INFO, secret-key=mysecretkey

1.3. Examples 7

Page 12: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

docker run -d --name polemarch --restart always -v /opt/polemarch/projects:/→˓projects -v /opt/polemarch/hooks:/hooks --env RPC_ENGINE=amqp://→˓polemarch:polemarch@rabbitmq-server:5672/polemarch --env CACHE_→˓LOCATION=memcached-server:11211 --env POLEMARCH_LOG_LEVEL=INFO --env→˓SECRET_KEY=mysecretkey vstconsulting/polemarch

Also you can use .env file with all variable you want use on run docker:

docker run -d --name polemarch --restart always -v /opt/polemarch/projects:/→˓projects -v /opt/polemarch/hooks:/hooks --env-file /path/to/file→˓vstconsulting/polemarch

Run from the sources with docker-compose (PoleMarch+MySQL+Redis):

docker-compose up -d --build

1.4 Quickstart

After you install Polemarch by instructions above you can use it without any further configuration. Interface is prettyintuitive and common for any web application. Read more in GUI workflow documentation.

Default installation is suitable for most simple and common cases, but Polemarch is highly configurable system. Ifyou need something more advanced (scalability, dedicated DB, custom cache, logging or directories) you can alwaysconfigure Polemarch like it is said in Configuration manual.

1.5 Backup

Regular uploading of backups is a guarantee of the reliability of the application. We recomended use SQL backup orcopy database.

There are examples of SQL backup for MySQL and PostgreSQL below.

Making backup in MySQL:

shell> mysqldump dbname > dump.sql

Here dbname is the name of your database, dump.sql is the file, where all SQL backup statements will be saved.

Uploading of backup in MySQL:

shell> mysqladmin create dbnameshell> mysql dbname < dump.sql

Making backup in PostgreSQL:

pg_dump dbname > dump.sql

Uploading of backup in PostgreSQL:

createdb dbnamepsql dbname < dump.sql

8 Chapter 1. Installation

Page 13: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

1.6 Update

Before updating of package of any type it is strongly recommended to stop all services and create backup for safety.

1.7 Update from any old version

1. Firstly, we strongly recommend you to create a database backup and to stop all Polemarch services for safety.

2. Secondly, if you are updating from 0.x.y to 1.x.y, you need to update you current 0.x.y version to 1.0.0 version.

3. Then update to the latest version. If you don’t know how to do it, look “Install from PyPI”.

1.8 Migrate

Migrations are Django’s way of propagating changes you make to your models (adding a field, deleting a model, etc.)into your database schema. They’re designed to be mostly automatic, but you need to know when to make migrations,when to run them, and the common problems you might run into.

To run a migrate command you should run follow code:

polemarchctl migrate

1.9 Create superuser

A superuser is the user, who has all permissions.

To create a superuser account use the follow command:

polemarchctl createsuperuser

This command prompts for all required user’s options.

1.10 Change password

To change password use the follow command:

polemarchctl changepassword [<username>]

It prompts you to enter a new password twice for the given user. If the entries are identical, this immediately becomesthe new password. If you do not supply a user, the command will attempt to change the password of user whoseusername matches the current user.

1.6. Update 9

Page 14: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

10 Chapter 1. Installation

Page 15: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

TWO

CONFIGURATION MANUAL

2.1 Introduction

Default installation is suitable for most simple and common cases, but Polemarch is highly configurable system. Ifyou need something more advanced (scalability, dedicated DB, custom cache, logging or directories) you can alwaysconfigure Polemarch deeply by tweaking /etc/polemarch/settings.ini.

This manual does not have purpose to describe all possible configuration options in details because settings.inihas commentary for every option which makes clear its purpose and possible values. But here is a brief overview ofthe most important settings to make clear for you big picture: what you can actually customize in Polemarch.

We advice you to read Polemarch clustering overview if you want to setup cluster of Polemarch nodes to maintainreliability or speedup things. It will give you understanding of services, which are included into Polemarch and howto distribute them between the nodes to reach your goal.

2.2 Polemarch clustering overview

Polemarch actually consists of two services: web-server and worker. Polemarch uses worker for long-running tasks(such as ansible-playbook runs, repo synchronizations and so on). Those services are designed as systemdservices you can control using regular distro-tools for service manipulation. You can run more than one server withthose services. In default configuration those services uses local file system to keep data and exchange with eachother, but for multiple nodes they must be configured to use shared client-server database, cache server and networkfilesystem (for multiple workers). All those settings are described in appropriate sections of this documentation. It isup to you to make sure that configuration identical on every node to prevent discordant behaviour of nodes. If youhave multiple web-servers, don’t forget to setup HAProxy or something similar for balancing load between them.

Lets assume, that you want to create 2 servers with web-part of Polemarch to maintain reliability of your admin-paneland 4 servers with workers to prevent denial for service because of overloading. Then briefly (it is mostly examplethan general howto) you must do such steps:

1. Install Polemarch from PyPI at every server with worker and web-server by installation instructions. We rec-ommend to install virtual environment in /opt/polemarch and set as owner user polemarch (need to becreated).

2. Setup some network filesystem (NFS, Samba, GlusterFS, Ceph). NFS, for example. Mount it in the samedirectory of all worker-intended nodes. Write this directory in Main settings. Example:

[main]projects_dir = /mnt/mystorage/projectshooks_dir = /mnt/mystorage/hooks

3. Setup some http-balancer. HAProxy, for example. Point it to web-intended nodes.

11

Page 16: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Hint: You can setup ssl for Polemarch endpoints in this step.

4. Create polemarch systemd service:

1. Firtsly, create a file /etc/systemd/system/polemarch.service:

[Unit]Description=Polemarch Service HTTP ServerAfter=network.target remote-fs.target nss-lookup.target redis.service

[Service]Type=forkingExecStart=/opt/polemarch/bin/polemarchctl webserverExecReload=/opt/polemarch/bin/polemarchctl webserver reload=/opt/→˓polemarch/run/polemarch/web.pidExecStop=/opt/polemarch/bin/polemarchctl webserver stop=/opt/polemarch/→˓run/polemarch/web.pidPIDFile=/opt/polemarch/run/polemarch/web.pidUser=polemarchGroup=polemarchKillSignal=SIGCONTRestart=always

[Install]WantedBy=multi-user.target

Note: Notice, that user and group ‘polemarch’ should exist in your system. If they don’t exist,create them.

2. Reload systemctl daemon:

systemctl daemon-reload

3. Add polemarch.service to autoload:

systemctl enable polemarch.service

4. Start polemarch.service:

systemctl start polemarch.service

5. Repeat all steps in other nodes and connect them to one DB, cache, MQ and storage.

Note: You don’t need migrate database on each node. This need only once when you in-stall/update first node in cluster.

Warning: Don’t forget to stop all Polemarch services when update polemarch package.

That’s it.

12 Chapter 2. Configuration manual

Page 17: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

2.3 Main settings

Section [main].

This section is for settings related to whole Polemarch (both worker and web). Here you can specify verbosity levelof Polemarch during work, which can be useful for troubleshoot problems (logging level etc). Also there are set-tings for changing of timezone for whole app and directory where Polemarch will store ansible projects cloned fromrepositories.

If you want to use LDAP protocol, you should create next settings in section [main].

ldap-server = ldap://server-ip-or-host:portldap-default-domain = domain.nameldap-auth_format = cn=<username>,ou=your-group-name,<domain>

ldap-default-domain is an optional argument, that is aimed to make user authorization easier (without input of domainname).

ldap-auth_format is an optional argument, that is aimed to customize LDAP authorization. Default value:cn=<username>,<domain>

So in this case authorization logic will be the following:

1. System checks combination of login:password in database;

2. System checks combination of login:password in LDAP:

• if domain was mentioned, it will be set during authorization (if user enter login without [email protected] or without DOMAIN\user );

• if authorization was successful and there is user with mentioned login in database, server creates sessionfor him.

• debug - Enable debug mode. Default: false.

• allowed_hosts - Comma separated list of domains, which allowed to serve. Default: *.

• ldap-server - LDAP server connection.

• ldap-default-domain - Default domain for auth.

• timezone - Timezone of web-application. Default: UTC.

• log_level - Logging level. Default: WARNING.

• enable_admin_panel - Enable or disable Django Admin panel. Defaul: false.

• projects_dir - Path where projects will be stored.

• hooks_dir - Path where hook scripts stored.

• executor_path - Path for polemarch-ansible wrapper binary.

2.4 Database settings

Section [database].

Here you can change settings related to database system, which Polemarch will use. Polemarch supports all databasessupported by django. List of supported out of the box: SQLite (default choice), MySQL, Oracle, or PostgreSQL.Configuration details you can look at Django database documentation. If you run Polemarch at multiple nodes (clus-terization), you should use some of client-server database (SQLite not suitable) shared for all nodes.

2.3. Main settings 13

Page 18: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

If you use MySQL there is a list of required settings, that you should create for correct database work.

Firstly, if you use MariaDB and you have set timezone different from “UTC” you should run next command:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

Secondly, for correct MariaDB work you should set next options in settings.ini file:

[database.options]connect_timeout = 10init_command = SET sql_mode='STRICT_TRANS_TABLES', default_storage_engine=INNODB,→˓NAMES 'utf8', CHARACTER SET 'utf8', SESSION collation_connection = 'utf8_unicode_ci'

Finally, you should add some options to MariaDB configuration:

[client]default-character-set=utf8init_command = SET collation_connection = @@collation_database

[mysqld]character-set-server=utf8collation-server=utf8_unicode_ci

2.5 Cache settings

Section [cache].

This section is for settings related to cache backend used by Polemarch. Polemarch supports all cache backendsthat Django supports. Currently is: filesystem, in-memory, memcached out of the box and many more by additionalplugins. You can find details about cache configuration at Django caches documentation. In clusterization scenario weadvice to share cache between nodes to speedup their work using client-server cache realizations. We recommend touse Redis in production environments.

2.6 Locks settings

Section [locks].

Locks is system that Polemarch uses to prevent damage from parallel actions working on something simultaneously.It is based on Django cache, so there is another bunch of same settings as Cache settings. And why there is anothersection for them, you may ask. Because cache backend used for locking must provide some guarantees, which doesnot required to usual cache: it MUST be shared for all Polemarch threads and nodes. So, in-memory backend, forexample, is not suitable. In case of clusterization we strongly recommend to use Redis or Memcached as backend forthat purpose. Cache and locks backend can be same, but don’t forget about requirement we said above.

2.7 Session cache settings

Section [session].

Polemarch store sessions in Database settings, but for better performance, we use a cache-based session backend. It isbased on Django cache, so there is another bunch of same settings as Cache settings. By default, settings getted fromCache settings.

14 Chapter 2. Configuration manual

Page 19: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

2.8 Rpc settings

Section [rpc].

Polemarch uses Celery for long-running tasks (such as ansible-playbook runs, repo synchronizations and soon). Celery is based on message queue concept, so between web-service and workers running under Celery bust besome kind of message broker (RabbitMQ or something). Those settings relate to this broker and Celery itself. Thosekinds of settings: broker backend, number of worker-processes per node and some settings used for troubleshootserver-broker-worker interaction problems.

• connection - Celery broker connection. Read more: http://docs.celeryproject.org/en/latest/userguide/configuration.html#conf-broker-settings Default: filesystem:///var/tmp.

• concurrency - Count of celery worker threads. Default: 4.

• heartbeat - Interval between sending heartbeat packages, which says that connection still alive. Default: 10.

• enable_worker - Enable or disable worker with webserver. Default: true.

• clone_retry_count - Count of retrys on project sync operation.

2.9 Worker settings

Section [worker].

Celery worker options for start. Useful settings:

• loglevel - Celery worker logging level. Default: from main section log_level.

• pidfile - Celery worker pidfile. Default: /run/polemarch_worker.pid

• autoscale - Options for autoscaling. Two comma separated numbers: max,min.

• beat - Enable or disable celery beat scheduler. Default: true.

Other settings can be getted from command celery worker --help.

2.10 Web settings

Section [web].

Here placed settings related to web-server. Those settings like: session_timeout, static_files_url or pagination limit.

• session_timeout - Session life-cycle time. Default: 2w (two weeks).

• rest_page_limit - Default limit of objects in API list. Default: 1000.

• public_openapi - Allow to have access to OpenAPI schema from public. Default: false.

2.11 Git settings

Sections [git.fetch] and [git.clone].

Options for git commands. See options in git fetch --help or git clone --help.

2.8. Rpc settings 15

Page 20: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

2.12 Production web settings

Section [uwsgi].

Here placed settings related to web-server used by Polemarch in production (for deb and rpm packages by default).Most of them related to system paths (logging, PID-file and so on). More settings in uWSGI docs.

2.13 Configuration options

This section contains additional information for configure additional elements.

1. If you need set https for your web settings, you can do it using HAProxy, Nginx or configure it in settings.ini.

[uwsgi]https = 0.0.0.0:8443,foobar.crt,foobar.keyaddrport = 127.0.0.1:8080

2. We strictly do not recommend running the web server from root. Use HTTP proxy to run on privileged ports.

2.14 Installation of additional packages to Polemarch

Warning: .rpm or .deb installation methods are depracated.

If you want to install some additional package to Polemarch from .rpm or .deb, you should run next command:

sudo -U polemarch /opt/polemarch/bin/pip install package_name

For correct work all requirements for this package should be installed in your system. Notice, that after packagereinstallation or after package update you should set all this requirements again.

If you want to install some additional package from github or gitlab, you should just install this package to your systemor to your virtual environment.

16 Chapter 2. Configuration manual

Page 21: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

THREE

GUI WORKFLOW

3.1 Welcome to Polemarch GUI

In this section of our documentation we will tell you about Polemarch GUI’s opportunities.

Let’s begin with Dashboard page:

As you can see, Polemarch GUI provides user with 2 menus:

• the first one is located in the left sidebar and it is aimed to provide user with navigation between main systemobjects, like projects, inventories, history records and ect.

17

Page 22: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• the second one is located at the top of browser window and it is aimed to navigate user to API section, to user’spage and to logout page.

Also there are some widgets on content block of Dashboard page. User can customize Dashboard page as he wish.For example, user can change widgets’ position, hide some widgets or collapse them. To do it user should openUserSettings page from his profile page.

3.2 Before you start

Before you can do any job with Polemarch you should create at least one project, because all Polemarch’s functionsare linked to the project.

3.3 Projects

So, to start your work with Polemarch you should create project.

There are 3 project types in Polemarch:

• GIT - Polemarch can sync with your git project.

• TAR - If you don’t have git repository, you can upload tar archive with project files from any http url.

• MANUAL - Empty project. This kind of project will be appropriate for you, if you want run only moduleswithout any playbooks or something. Polemarch will create folder for your project files in projects_dir (you canspecify it in settings) named as project id (you can see at URL), where you place manually your project files(like playbooks or something).

Let’s look at the example of GIT project’s creation:

18 Chapter 3. GUI workflow

Page 23: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new project creation consists of 5 fields:

• name - name of your project.

• repo type - type of project repository (GIT, TAR, MANUAL).

• repo URL - URL to your repository.

• repo auth type - type of authentication (NONE, KEY, PASSWORD).

• repo auth data - key or password value.

Before continue we tell about structure of our project, we used ansible best practice and run playbooks from project.

• ansible.cfg - used to setup settings. For detailed information about configuration file read settings refer-ence.

If you setup modules directory, we import all modules from this directory and set namepolemarch.project.[module_name].

• Playbook - import all files with .yml extention from root directory of the Project

• If you need set variables global, not only for run, you can use group_vars and host_vars in root directoryof project

After project creation you will see the next page:

3.3. Projects 19

Page 24: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there are some new fields on this page:

• id - the unique key of object in database.

• status - Polemarch project status. Possible values are:

– NEW - newly created project,

– WAIT_SYNC - repository synchronization has been scheduled, but has not started to perform yet,

– SYNC - synchronization is in progress,

– ERROR - synchronization failed,

– OK - project is synchronized.

• revision - GIT project revision.

• branch - branch of your GIT project, to what your Polemarch project was synced.

• owner - user, who owns this project.

• notes - not required field for some user’s notes, for example, for what purpose this project was created orsomething like this.

• information - if project has “readme.md” or “readme.rst” file in it’s project directory, Polemarch will addcontent of this file to this field.

Also there are some new buttons:

20 Chapter 3. GUI workflow

Page 25: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Sublinks buttons:

• history - this button opens project executions’ history list.

• inventory - this button opens project’s inventory list.

• module - this button opens project’s module list.

• periodic task - this button opens project’s periodic task list.

• playbook - this button opens project’s playbook list.

• template - this button opens project’s template list.

• variables - this button opens project’s variables list.

Action buttons:

• edit - this button turns on edit mod for this page.

• copy - this button opens “copy” action page.

• execute module - this button opens “execute module” action page.

• execute playbook - this button opens “execute plabook” action page.

• set owner - this button opens “set owner” action page.

• sync - this button syncs your Polemarch project with GIT repository.

• remove - this button deletes project.

If you want to edit values of some fields on any page in Polemarch, you should click on “Edit” button to activate editmod.

3.3. Projects 21

Page 26: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, edit mod looks exactly the same as read only mod, except several points:

• you have opportunity to change values of editable fields;

• there are save button - this button saves all changes you have made on this page.

• and reload button - this button resets all changes that you have done on this page.

Now, let’s back to read only mod of our project page.

22 Chapter 3. GUI workflow

Page 27: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, now project’s status is “NEW”, so we need to click on “sync” button to get all needed data from yourGIT project.

3.3. Projects 23

Page 28: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

24 Chapter 3. GUI workflow

Page 29: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

After your project’s status has been changed into “OK” you can confidently start working with Polemarch.

Warning: If you update something in your GIT repository, don’t forget to run sync in Polemarch for pulling yourchanges.

3.4 Project variables

If you need to change some properties of your project (for example, branch, key or password of project), you can do iton the “variables” page of your project:

3.4. Project variables 25

Page 30: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, now current project has only 2 variables:

• repo_branch - branch of GIT repository;

• repo_type - type of Polemarch project.

Other available project variables, that you can add with clicking on “Create” button:

• repo_sync_on_run - boolean, if true, Polemarch will sync project before every task execution (dont use inconcurrent executions, experimental);

• repo_password - GIT repository password;

• repo_key - GIT repository key.

• Environment variables, with key starting from env_. For example env_test_var would create environmentvariable test_var on run tasks from this project.

Let’s edit repo_branch variable. To do it you need click on repo_branch item in list. Then you will see the followingpage:

26 Chapter 3. GUI workflow

Page 31: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

After clicking on “edit” button you will see:

3.4. Project variables 27

Page 32: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Then you need to change branch name of ‘value’ field and click on “save” button.

28 Chapter 3. GUI workflow

Page 33: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Note: If your need to choose branch with tag name you should use following format of branch name “tags/[tag_name]”.

After changing of repo_branch variable you need to sync your Polemarch project to get files from selected branch.After successful project synchronization you will see selected branch name in ‘branch’ field:

3.4. Project variables 29

Page 34: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.5 Module execution

The simplest way to start using Polemarch is to execute module. To make this action click on ‘execute module’ buttonon project page.

30 Chapter 3. GUI workflow

Page 35: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are 2 fields on this page:

• module - autocomplete field with the list of project’s modules.

• add field - select field, that provides user with new variables fields for module execution.

Also there is only one button on this page:

• execute - this button starts action execution.

For example, let’s execute module shell on localhost with argument uptime. To do it we need to add next fields:

• inventory - it can be inventory from Polemarch system or just list of hosts, that are separated by “,”.

• group - to which hosts from inventory execute this module.

• connection - type of connection.

• args - list of arguments for current module.

After all fields have been filled, our page started look like:

3.5. Module execution 31

Page 36: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

So, let’s execute our first task on Polemarch! To do it click on “execute” button.

When status of your module execution changes to “OK” you will see the next page:

32 Chapter 3. GUI workflow

Page 37: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.5. Module execution 33

Page 38: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.6 Template

In previous abstract to execute module we needed to fill several fields. To do it before every module/playbook executionis rather inconvenient. In this case Polemarch templates save our time and nerves. Polemarch template is an object,that saves all options that user used during task execution.

For example, let’s create task template (template that uses playbooks). To do it click on “template” button on projectpage.

34 Chapter 3. GUI workflow

Page 39: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are no templates in the project’s template list now.

There is only one button here:

• new - this button opens page for creation of new template.

To create template click on “new” button on this page.

3.6. Template 35

Page 40: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are several fields on this page:

• name - name of template.

• notes - not required field for some user’s notes, for example, for what purpose this template was created orsomething like this.

• type - type of template (MODULE or TASK).

• inventory - it can be inventory from Polemarch system or just list of hosts, that are separated by “,”.

• playbook - name of playbook, which template will use during execution.

After all fields have been filled, our page started look like:

36 Chapter 3. GUI workflow

Page 41: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

After template creation you will see the next page:

3.6. Template 37

Page 42: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there is only one new field on this page:

• id - the unique key of object in database.

Also there are several buttons here:

Sublinks buttons:

• option - this button opens template’s option list.

• variables - this button opens project’s variables list.

Action buttons:

• edit - this button turns on edit mod for this page.

• execute - this button opens “execute template” action page.

• remove - this button deletes template.

Before template execution we need to create variable “connection=local”, because we use “localhost” as inventory.

To do it, click on “variables” button.

38 Chapter 3. GUI workflow

Page 43: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are no variables in the template’s variables list now.

There is only one button here:

• new - this button opens page for creation of new variable.

To create variable click on “new” button on this page.

3.6. Template 39

Page 44: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are only 2 fields on this page:

• key - key of variable.

• value - value of variable.

There is only one button here:

• save - this button saves new variable.

To save our variable click on “save” button.

Now we are ready to execute our template. To do it come back to template page:

40 Chapter 3. GUI workflow

Page 45: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

And click on “execute” button.

3.6. Template 41

Page 46: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there is only 1 field on this page:

• option - autocomplete field with the list of template’s options.

Also there is only one button on this page:

• execute - this button starts action execution.

We do not have any template’s options in our system, so just click on “execute” button.

When status of your template execution changes to “OK” you will see the next page:

42 Chapter 3. GUI workflow

Page 47: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.6. Template 43

Page 48: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.7 Periodic tasks

Now let’s imagine, that you need to execute some task (module/playbook/template) with some interval or on the firstday of month, for example, and you do not want to execute it everytime by yourself.

In this case, Polemarch has such useful object type, as periodic task.

Periodic task - is a module/playbook/template execution which Polemarch makes by himself with some interval.

Let’s create periodic task, based on our “test-task-template”. To do it open project page:

44 Chapter 3. GUI workflow

Page 49: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

And click on “periodic task” button:

3.7. Periodic tasks 45

Page 50: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are no periodic tasks in the project’s periodic task list now.

There is only one button here:

• new - this button opens page for creation of new periodic task.

To create periodic task click on “new” button on this page.

46 Chapter 3. GUI workflow

Page 51: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new periodic task creation consists of following fields:

• name - name of your periodic task.

• task type - type of periodic task (PLAYBOOK, MODULE, TEMPLATE).

• mode - name of module or playbook (for periodic tasks with PLAYBOOK/MODULE type only).

• inventory - it can be inventory from Polemarch system or just list of hosts, that are separated by “,” (for periodictasks with PLAYBOOK/MODULE type only).

• template - name of template (for periodic tasks with TEMPLATE type only).

• template opt - name of template’s option (for periodic tasks with TEMPLATE type only).

• save result - boolean field, it means to save or not to save results of periodic tasks execution in history.

• enable - - boolean field, it means to activate or deactivate periodic task.

• interval type - type of execution interval (CRONTAB, INTERVAL).

• schedule - value of execution interval. If “interval type” = INTERVAL, value of this field means amount ofseconds. If “interval type” = CRONTAB, value of this field means CRONTAB interval.

• notes - not required field for some user’s notes, for example, for what purpose this periodic task was created orsomething like this.

After all fields have been filled, our page started look like:

3.7. Periodic tasks 47

Page 52: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

After periodic task creation you will see the next page:

48 Chapter 3. GUI workflow

Page 53: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there is only one new fields on this page:

• id - the unique key of object in database.

Also there are several buttons here:

Action buttons:

• edit - this button turns on edit mod for this page.

• execute - this button opens “execute periodic task” action page.

• remove - this button deletes periodic task.

Let’s start our periodic task execution. To do it click on “execute” button.

3.7. Periodic tasks 49

Page 54: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see on history page, our ‘test-periodic-task’ executes every 10 seconds, as we set it during periodic taskcreation.

3.8 Inventory

If you don’t want to use ‘inventory’ as just list of hosts separated by “,”, or do not have inventory file in you GITproject (“./inventory”, for example), you need to create it in Polemarch.

Warning: Do not forget to add you inventory to project after it’s creation. To do it click on “inventory” button onproject page.

By inventory’s creation, in this case, we understand creation of inventory, which includes at least one group, which, init’s turn, includes at least one host. In other words, beside inventory user should create host and group.

To understand it better let’s look at next images, which will explain you how to create inventory. Here you can see theform for inventory creation.

50 Chapter 3. GUI workflow

Page 55: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are only 2 fields on this page:

• name - name of inventory.

• notes - not required field for some user’s notes, for example, for what purpose this inventory was created orsomething like this.

Also there is only one button there:

• save - this button saves new inventory.

After inventory creation you will see the next page:

3.8. Inventory 51

Page 56: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there are 2 new fields on this page:

• id - the unique key of object in database.

• owner - user, who owns this inventory.

Also there are some new buttons here:

Sublinks buttons:

• all groups - this button opens inventory’s all groups list (list of groups, which includes also groups that arenested into inventory groups).

• all hosts - this button opens inventory’s all hosts list. (list of hosts, which includes also hosts that are nested intoinventory groups).

• group - this button opens inventory’s group list.

• host - this button opens inventory’s host list.

• variables - this button opens inventory’s variables list.

Action buttons:

• edit - this button turns on edit mod for this page.

• copy - this button opens “copy” action page.

• set owner - this button opens “set owner” action page.

52 Chapter 3. GUI workflow

Page 57: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• remove - this button deletes inventory.

Let’s look how you can create a group for this inventory. To do it, let’s click on “group” button.

3.9 Group

As you can see, there are no groups in the inventory’s group list now.

There are 2 buttons here:

• new - this button opens page for creation of new group.

• add - this button opens the all group list from database, from which you can choose group for this inventory.

We need to create group. To do it click on “new” button.

3.9. Group 53

Page 58: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new group creation consists of following fields:

• name - name of your group.

• contains groups - boolean field, it means ability of group to contain child groups.

• notes - not required field for some user’s notes, for example, for what purpose this group was created or some-thing like this.

After group creation you will see the next page:

54 Chapter 3. GUI workflow

Page 59: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there are 2 new fields on this page:

• id - the unique key of object in database.

• owner - user, who owns this group.

Also there are some new buttons here:

Sublinks buttons:

• host - this button opens group’s host list.

• variables - this button opens group’s variables list.

Action buttons:

• edit - this button turns on edit mod for this page.

• copy - this button opens “copy” action page.

• set owner - this button opens “set owner” action page.

• remove - this button deletes group.

Let’s look how you can create a host for this group. To do it, let’s click on “host” button.

3.9. Group 55

Page 60: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.10 Host

As you can see, there are no hosts in the group’s host list now.

There are 2 buttons here:

• new - this button opens page for creation of new host.

• add - this button opens the all host list from database, from which you can choose host for this group.

We need to create host. To do it click on “new” button.

56 Chapter 3. GUI workflow

Page 61: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new host creation consists of following fields:

• name - name of your host.

• notes - not required field for some user’s notes, for example, for what purpose this host was created or somethinglike this.

• type - type of host (RANGE, HOST).

– RANGE - range of IPs or hosts.

– HOST - single host.

After host creation you will see the next page:

3.10. Host 57

Page 62: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there are 2 new fields on this page:

• id - the unique key of object in database.

• owner - user, who owns this host.

Also there are some new buttons here:

Sublinks buttons:

• variables - this button opens host’s variables list.

Action buttons:

• edit - this button turns on edit mod for this page.

• copy - this button opens “copy” action page.

• set owner - this button opens “set owner” action page.

• remove - this button deletes host.

Let’s look how you can create a variables for host, group and inventory.

58 Chapter 3. GUI workflow

Page 63: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.11 Variables for inventory, group, host

The process of variable creation for inventory is the same as for group or host. So, let’s look it at the example ofvariable creation for host.

To do it click on the “variables” button on the host page:

3.11. Variables for inventory, group, host 59

Page 64: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are no variables in the host’s variables list now.

There is only 1 button here:

• new - this button opens page for creation of new variable.

To create variable click on “new” button:

60 Chapter 3. GUI workflow

Page 65: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new host variable creation consists of following fields:

• key - key of variable.

• value - value of variable.

After variable creation you will see the next page:

3.11. Variables for inventory, group, host 61

Page 66: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there is only 1 new field on this page:

• id - the unique key of object in database.

3.12 Import inventory

If you have some inventory file and you want to add objects from it to Polemarch you can do it in rather simple,convenient and quick way: let us introduce you very useful action - “Import inventory”.

For example, let’s use next inventory file:

[imported-test-group]imported-test-host ansible_host=10.10.10.17

[imported-test-group:vars]ansible_user=ubuntuansible_ssh_private_key_file=example_key

To import inventory you should open inventory list page:

62 Chapter 3. GUI workflow

Page 67: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

And click on “Import inventory” button. Then you will see the next page:

3.12. Import inventory 63

Page 68: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of “Import inventory” action consists of 2 fields:

• name - name of your inventory.

• inventory file - content of your inventory file.

After filling of all fields you should click on “Exec” button and then you will see page of your imported inventory:

64 Chapter 3. GUI workflow

Page 69: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

This inventory includes “imported-test-group” from imported inventory file:

3.12. Import inventory 65

Page 70: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

And “imported-test-group” includes “imported-test-host” from imported inventory file:

66 Chapter 3. GUI workflow

Page 71: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

“imported-test-host” includes variable “ansible-host” from imported inventory file:

3.12. Import inventory 67

Page 72: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.13 .polemarch.yaml

.polemarch.yaml is a file for a quick deployment of Polemarch project. By quick deployment of Polemarchproject we mean automatic creation of some templates for this project (during project sync) and using of additionalinterface for quick task execution.

.polemarch.yaml is not required file for Polemarch work, but if you want to use features of .polemarch.yaml, you have to store it in the base directory of (GIT, MANUAL, TAR) project.

Structure of .polemarch.yaml consists of next fields:

• sync_on_run - boolean, it means to get or not to get settings from .polemarch.yaml during each projectsync.

• templates - dictionary, consists of template objects (their structure is similar to template’s API structure exceptthe ‘name’ field).

• templates_rewrite - boolean, it means to rewrite or not to rewrite templates in project with names equal totemplates’ names from .polemarch.yaml.

• view - dictionary, it is a description of web-form, that will be generated from .polemarch.yaml. It consistsof:

– fields - dictionary, it consists of objects, that describe fields properties:

68 Chapter 3. GUI workflow

Page 73: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

* title: title of field, that Polemarch will show in web-form.

* default: default value of field. Default: ‘’ - for strings, 0 - for numbers.

* format: format of field. For today next field formats are available: string, integer, float, boolean.Default: string.

* help: some help text for this field.

– playbooks - dictionary, it consists of objects, that describes playbook properties:

* title: title of playbook, that Polemarch will use during playbook execution.

* help: some help text for this playbook.

Example of .polemarch.yaml:

---sync_on_run: truetemplates:

test-module:notes: Module test templatekind: Moduledata:

group: allvars: {}args: ''module: pinginventory: localhost,

options:uptime:

args: uptimemodule: shell

test playbook:notes: Playbook test templatekind: Taskdata:

vars: {"become": true}playbook: main.ymlinventory: localhost,

options:update: {"playbook": "other.yml"}

templates_rewrite: trueview:

fields:string:

title: Field stringdefault: 0format: stringhelp: Some help text

integer:title: Field integerdefault: 0format: integerhelp: Some help text

float:title: Field floatdefault: 0format: floathelp: Some help text

(continues on next page)

3.13. .polemarch.yaml 69

Page 74: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

boolean:title: Field booleandefault: 0format: booleanhelp: Some help text

enum_string:title: Field enum_stringdefault: 0format: stringhelp: Some help textenum: ['Choice1', 'Choice2', 'Choice3']

unknown:title: Field unknowndefault: 0format: invalid_or_unknownhelp: Some help text

playbooks:main.yml:

title: Execute titlehelp: Some help text

In GUI process of working with .polemarch.yaml will be the following:

Firstly, you need to create a project with .polemarch.yaml (or to add .polemarch.yaml to existing project).For example, let’s create new GIT project, that has in its base directory .polemarch.yaml file from the exampleabove:

70 Chapter 3. GUI workflow

Page 75: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

In the field ‘repo url’ you should insert url of project that has in its base directory .polemarch.yaml file.

After project creation you will see the ordinary project page:

3.13. .polemarch.yaml 71

Page 76: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Then you need to click on “sync” button. After project synchronization and page update you will see the next page:

72 Chapter 3. GUI workflow

Page 77: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.13. .polemarch.yaml 73

Page 78: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, all fields that we mentioned in the exmaple .polemarch.yaml were added to this web-form intosection “Execute parameters”. Values of all these fields will be used as ansible extra_vars parameter during taskexecution.

The remaining fields mean following:

• inventory - it can be inventory from Polemarch system or just list of hosts, that are separated by “,”.

• user - set it if your do not have ansible_user variable in your inventory.

• key file - set it if your do not have ansible_ssh_private_key_file variable in your inventory.

Button “execute title” will execute playbook “main.yml”, as we mentioned in .polemarch.yaml file.

Also templates from .polemarch.yaml were added to just created Polemarch project.

74 Chapter 3. GUI workflow

Page 79: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

3.14 Community project samples

Polemarch has his own list of community repositories, which provide you with stuff, that is able to deploy differentservices in extremely quick and convenient way. Community project sample is an entity, that clones repository fromcommunity list into your Polemarch. Some community project samples have only list of playbooks, but most have.polemarch.yaml file, that helps you to deploy tasks even faster.

Let’s look how it works on examples.

Firstly, open page with community project samples list.

3.14. Community project samples 75

Page 80: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there is a table with list of community repositories, that consists of following columns:

• name - name of community repository.

• type - type of community repository.

• actions - actions that you can execute on community repository.

Let’s open “WordPress” community repository page.

76 Chapter 3. GUI workflow

Page 81: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the community repository page consists of following fields:

• id - id of community repository.

• name - name of community repository.

• description - Description of community repository.

• type - type of community repository.

• repository - url of community repository.

Also there is only one action button on this page:

• use it - this buttons open page of “use_it” action.

Let’s click on “use it” button.

3.14. Community project samples 77

Page 82: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, this action page has only one field:

• name - name of project, that will be clone of current community repository in your Polemarch.

After “use_it” action execution you will see the page of just created project:

78 Chapter 3. GUI workflow

Page 83: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see value of field “repository” is the same as in “WordPress” community repository.

Then you need to click on “sync” button. After project synchronization and page update you will see the next page:

3.14. Community project samples 79

Page 84: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

This page has “run playbook from” (because project has .polemarch.yaml file) and all that you need to do forWordPress deployment on your hosts is filling following fields:

• inventory - it can be inventory from Polemarch system or just list of hosts, that are separated by “,”.

• user - set it if your do not have ansible_user variable in your inventory.

• key file - set it if your do not have ansible_ssh_private_key_file variable in your inventory.

• mysql user - name of MySQL user of your wordpress site’s database.

• mysql password - password of MySQL user of your wordpress site’s database.

After all required fields have been filled, you need to click on “deploy wordpress” button to start wordpress deploymenton your hosts.

3.15 Hooks

Polemarch has his own system of hooks. Polemarch hooks are synchronous and you can appoint them on differentevents like “after task end”, “before task start” and so on.

WARNING: You should be accurate with hooks appointment, because the more hooks you have, the more time theyneed for execution and, finally, the more time Ansible needs for task execution.

80 Chapter 3. GUI workflow

Page 85: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, there are no hooks in the system now.

There is only one button here:

• new - this button opens page for creation of new hook.

To create hook click on “new” button.

3.15. Hooks 81

Page 86: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new hook creation consists of following fields:

• name - name of your hook.

• type - type of hook (HTTP, SCRIPT). * If type is “HTTP”, Polemarch will send “POST” request with JSON toall recipients. * If type is “SCRIPT”, Polemarch will execute script.

• when - event on each Polemarch have to execute hook.

• enable - boolean field, it means to activate or to deactivate hook.

• recipients - list of recipients, separated by ” | “. For example, “ex1.com | ex2.com | ex3.com”.

3.16 Users

Polemarch provides you with several types of user:

• superuser;

• staff.

If you need to create a superuser, you need to do it with terminal command. Look for more information here “Createsuperuser”.

If you need to create user with “staff” rights you can do it with Polemarch GUI:

82 Chapter 3. GUI workflow

Page 87: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

To create new user click on “new” button.

3.16. Users 83

Page 88: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of new user creation consists of following fields:

• username - name of new user.

• is active - boolean field, it means to activate or to deactivate user.

• first name - first name of user.

• last name - last name of user.

• email - email of user.

• password - password of user.

• repeat password - password of user.

After user creation you will see next page:

84 Chapter 3. GUI workflow

Page 89: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see there is only one new fields on this page:

• id - the unique key of object in database.

Also there are several buttons here:

Sublinks buttons:

• settings - this button opens interface settings of current user.

Action buttons:

• edit - this button turns on edit mod for this page.

• copy - this button opens “copy” action page.

• change password - this button opens “change password” action page.

• remove - this button deletes periodic task.

Let’s look on user settings page:

3.16. Users 85

Page 90: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

This page has fields for managing dashboard chart line settings and for managing dashboard settings.

Let’s look on “change password” action page.

86 Chapter 3. GUI workflow

Page 91: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

As you can see, the form of “change password” action consists of following fields:

• old password - current password of user.

• new password - new password of user.

• confirm new password - new password of user.

There is only one button here:

• execute - this button starts action execution.

3.16. Users 87

Page 92: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

88 Chapter 3. GUI workflow

Page 93: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

FOUR

API

Polemarch provides REST API for all it’s functionality accessible via web GUI, because our GUI also uses this APIto work. Below there is an information about every entity we have in Polemarch and methods applicable to it.

This is an example of api schema, but you can find actual schema on Polemarch host at /api/v2/openapi/.

4.1 Structure

In Polemarch we have some entities that can be nested to another entities. Below examples of such entites:

Inventory can be nested into Project

Group can be nested into Inventory or into another Group with children=true

Host can be nested into Inventory or into another Group with children=false

User can be nested into Team

For add entities into another, you only need send [{"id": [instance_id]}, ...] to subpath. Also you caninsert instead of data results of bulk request, inner mechanism add all entities in result to parent entity.

4.1.1 API Paths

GET /community_template/List of community project templates.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/community_template/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "example type"

}

(continues on next page)

89

Page 94: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

]}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (ProjectTemplate Schema)

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /community_template/{id}/Return a community project template instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","description": "example description","type": "example type","repository": "example repository"

}

JSON Parameters

• id (integer) – Id

• name (string) – Name(maxLength=1024, minLength=1)

• description (string) – Description(minLength=1)

• type (string) – Type(enum=[‘GIT’, ‘TAR’])

• repository (string) – Repository(maxLength=2048, minLength=1)

param integer id(required) A unique value identifying this project template.

POST /community_template/{id}/use_it/Create project based on this template.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

(continues on next page)

90 Chapter 4. API

Page 95: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"project_id": 1,"name": "example name"

}

JSON Parameters

• project_id (integer) – Project id(readOnly=True, additionalProper-ties=OrderedDict([(‘redirect’, True)]), x-nullable=True)

• name (string) – Name(minLength=1)

param integer id(required)

A unique value identifying this project template.

query schema data(required) ProjectTemplateCreate Schema

GET /group/Return all groups.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

4.1. Structure 91

Page 96: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/Create a new group.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Contains groups(default=False)

• owner (object) – (User Schema)

Query Parameters

• data(required) (schema) – GroupCreateMaster Schema

GET /group/{id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

(continues on next page)

92 Chapter 4. API

Page 97: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this group.

PUT /group/{id}/Update a group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneGroup Schema

4.1. Structure 93

Page 98: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

PATCH /group/{id}/Update one or more fields on an existing group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneGroup Schema

DELETE /group/{id}/Remove an existing group.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this group.

POST /group/{id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

(continues on next page)

94 Chapter 4. API

Page 99: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","children": true,"from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• children (boolean) – Children(readOnly=True)

• from_project (boolean) – Project Based(readOnly=True)

param integer id(required)

A unique integer value identifying this group.

query schema data(required) Group Schema

GET /group/{id}/group/Return all groups.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/1/group/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

param integer id(required) A unique integer value identifying this group.

query string id A unique integer value (or comma separated list) identifying this instance.

4.1. Structure 95

Page 100: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/{id}/group/Create a new group.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Contains groups(default=False)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this group.

query schema data(required) GroupCreateMaster Schema

GET /group/{id}/group/{group_id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

96 Chapter 4. API

Page 101: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

PUT /group/{id}/group/{group_id}/Update a group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

4.1. Structure 97

Page 102: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneGroup Schema

PATCH /group/{id}/group/{group_id}/Update one or more fields on an existing group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneGroup Schema

DELETE /group/{id}/group/{group_id}/Remove an existing group.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

(continues on next page)

98 Chapter 4. API

Page 103: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{}

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

POST /group/{id}/group/{group_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","children": true,"from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• children (boolean) – Children(readOnly=True)

• from_project (boolean) – Project Based(readOnly=True)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) Group Schema

POST /group/{id}/group/{group_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

4.1. Structure 99

Page 104: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) SetOwner Schema

GET /group/{id}/group/{group_id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/1/group/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/{id}/group/{group_id}/variables/Create a new variable of instance.

Example Response

100 Chapter 4. API

Page 105: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) InventoryVariable Schema

GET /group/{id}/group/{group_id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

4.1. Structure 101

Page 106: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /group/{id}/group/{group_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /group/{id}/group/{group_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host",

(continues on next page)

102 Chapter 4. API

Page 107: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"value": "test_dynamic"}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /group/{id}/group/{group_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /group/{id}/host/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/1/host/?limit=1&offset=1","previous": null,"results": [

(continues on next page)

4.1. Structure 103

Page 108: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","type": "HOST","from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

param integer id(required) A unique integer value identifying this group.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/{id}/host/Create a new host.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

104 Chapter 4. API

Page 109: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneHost Schema

GET /group/{id}/host/{host_id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

PUT /group/{id}/host/{host_id}/Update a host.

Example Response

4.1. Structure 105

Page 110: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneHost Schema

PATCH /group/{id}/host/{host_id}/Update one or more fields on an existing host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

106 Chapter 4. API

Page 111: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) OneHost Schema

DELETE /group/{id}/host/{host_id}/Remove an existing host.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

POST /group/{id}/host/{host_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","type": "HOST","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• from_project (boolean) – Project Based(readOnly=True)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

4.1. Structure 107

Page 112: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

A unique integer value identifying this group.

query schema data(required) Host Schema

POST /group/{id}/host/{host_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) SetOwner Schema

GET /group/{id}/host/{host_id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/1/host/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

108 Chapter 4. API

Page 113: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• results (array) – (InventoryVariable Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/{id}/host/{host_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this group.

query schema data(required) InventoryVariable Schema

GET /group/{id}/host/{host_id}/variables/{variables_id}/Return a variable of instance.

Example Response

4.1. Structure 109

Page 114: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /group/{id}/host/{host_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

110 Chapter 4. API

Page 115: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /group/{id}/host/{host_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /group/{id}/host/{host_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

4.1. Structure 111

Page 116: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

POST /group/{id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required)

A unique integer value identifying this group.

query schema data(required) SetOwner Schema

GET /group/{id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/group/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

112 Chapter 4. API

Page 117: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this group.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /group/{id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required)

A unique integer value identifying this group.

query schema data(required) InventoryVariable Schema

GET /group/{id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{

(continues on next page)

4.1. Structure 113

Page 118: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /group/{id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

114 Chapter 4. API

Page 119: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query schema data(required) InventoryVariable Schema

PATCH /group/{id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /group/{id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this group.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /history/Return all history of executions.

Example Response

4.1. Structure 115

Page 120: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/history/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"start_time": "2019-01-07T06:10:31+10:00","executor": 1,"initiator": 1,"initiator_type": "example initiator_type","project": 1,"inventory": 1,"kind": "example kind","mode": "example mode","options": "example options","status": "example status","stop_time": "2019-01-07T06:10:31+10:00"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (History Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string mode Module or playbook name.

query string kind Kind of execution.

query string status Status of execution.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string name A name string value (or comma separated list) of instance.

query string older Older then this time

query string newer Newer then this time

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /history/{id}/Return a execution history instance.

116 Chapter 4. API

Page 121: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"status": "example status","executor": 1,"project": 1,"revision": "example revision","inventory": 1,"kind": "example kind","mode": "example mode","execute_args": "example execute_args","execution_time": "22:11:34","start_time": "2019-01-07T06:10:31+10:00","stop_time": "2019-01-07T06:10:31+10:00","initiator": 1,"initiator_type": "example initiator_type","options": "example options","raw_args": "example raw_args","raw_stdout": "example raw_stdout","raw_inventory": "example raw_inventory"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• status (string) – Status(enum=[‘DELAY’, ‘RUN’, ‘OK’, ‘ERROR’, ‘OFFLINE’, ‘IN-TERRUPTED’])

• executor (integer) – Executor(x-nullable=True)

• project (integer) – Project(x-nullable=True)

• revision (string) – Revision(maxLength=256, x-nullable=True)

• inventory (integer) – Inventory(x-nullable=True)

• kind (string) – Kind(maxLength=50, minLength=1)

• mode (string) – Mode(maxLength=256, minLength=1)

• execute_args (string) – Execute args(readOnly=True)

• execution_time (uptime) – Execution time

• start_time (date-time) – Start time

• stop_time (date-time) – Stop time(x-nullable=True)

• initiator (integer) – Initiator

• initiator_type (string) – Initiator type(maxLength=50, minLength=1)

• options (string) – Options(readOnly=True)

• raw_args (string) – Raw args(minLength=1)

• raw_stdout (string) – Raw stdout(readOnly=True)

4.1. Structure 117

Page 122: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• raw_inventory (string) – Raw inventory(minLength=1)

param integer id(required) A unique integer value identifying this history.

DELETE /history/{id}/Remove an existing history record.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this history.

POST /history/{id}/cancel/Cencel working task.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"detail": "example detail"

}

JSON Parameters

• detail (string) – Detail(minLength=1)

param integer id(required)

A unique integer value identifying this history.

query schema data(required) Empty Schema

DELETE /history/{id}/clear/Clear history output.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this history.

GET /history/{id}/facts/Get compilated history facts (only for execution ‘module’ with module ‘setup’).

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

118 Chapter 4. API

Page 123: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{}

param integer id(required) A unique integer value identifying this history.

GET /hook/Return all hooks.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/hook/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "example type","when": "example when","enable": true,"recipients": "example recipients"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Hook Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /hook/Create a new hook.

Example Response

4.1. Structure 119

Page 124: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","type": "example type","when": "example when","enable": true,"recipients": "example recipients"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HTTP’, ‘SCRIPT’])

• when (string) – When(enum=[‘on_execution’, ‘after_execution’, ‘on_user_add’,‘on_user_upd’, ‘on_user_del’, ‘on_object_add’, ‘on_object_upd’, ‘on_object_del’])

• enable (boolean) – Enable

• recipients (string) – Recipients(minLength=1)

Query Parameters

• data(required) (schema) – Hook Schema

GET /hook/{id}/Return a hook instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","type": "example type","when": "example when","enable": true,"recipients": "example recipients"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HTTP’, ‘SCRIPT’])

120 Chapter 4. API

Page 125: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• when (string) – When(enum=[‘on_execution’, ‘after_execution’, ‘on_user_add’,‘on_user_upd’, ‘on_user_del’, ‘on_object_add’, ‘on_object_upd’, ‘on_object_del’])

• enable (boolean) – Enable

• recipients (string) – Recipients(minLength=1)

param integer id(required) A unique integer value identifying this hook.

PUT /hook/{id}/Update a hook.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","type": "example type","when": "example when","enable": true,"recipients": "example recipients"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HTTP’, ‘SCRIPT’])

• when (string) – When(enum=[‘on_execution’, ‘after_execution’, ‘on_user_add’,‘on_user_upd’, ‘on_user_del’, ‘on_object_add’, ‘on_object_upd’, ‘on_object_del’])

• enable (boolean) – Enable

• recipients (string) – Recipients(minLength=1)

param integer id(required)

A unique integer value identifying this hook.

query schema data(required) Hook Schema

PATCH /hook/{id}/Update one or more fields on an existing hook.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","type": "example type",

(continues on next page)

4.1. Structure 121

Page 126: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"when": "example when","enable": true,"recipients": "example recipients"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HTTP’, ‘SCRIPT’])

• when (string) – When(enum=[‘on_execution’, ‘after_execution’, ‘on_user_add’,‘on_user_upd’, ‘on_user_del’, ‘on_object_add’, ‘on_object_upd’, ‘on_object_del’])

• enable (boolean) – Enable

• recipients (string) – Recipients(minLength=1)

param integer id(required)

A unique integer value identifying this hook.

query schema data(required) Hook Schema

DELETE /hook/{id}/Remove an existing hook.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this hook.

GET /host/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/host/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "HOST","from_project": true

}

(continues on next page)

122 Chapter 4. API

Page 127: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

]}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /host/Create a new host.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

4.1. Structure 123

Page 128: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• owner (object) – (User Schema)

Query Parameters

• data(required) (schema) – OneHost Schema

GET /host/{id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this host.

PUT /host/{id}/Update a host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username",

(continues on next page)

124 Chapter 4. API

Page 129: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this host.

query schema data(required) OneHost Schema

PATCH /host/{id}/Update one or more fields on an existing host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this host.

query schema data(required) OneHost Schema

4.1. Structure 125

Page 130: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

DELETE /host/{id}/Remove an existing host.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this host.

POST /host/{id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","type": "HOST","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• from_project (boolean) – Project Based(readOnly=True)

param integer id(required)

A unique integer value identifying this host.

query schema data(required) Host Schema

POST /host/{id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

126 Chapter 4. API

Page 131: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required)

A unique integer value identifying this host.

query schema data(required) SetOwner Schema

GET /host/{id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/host/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param integer id(required) A unique integer value identifying this host.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /host/{id}/variables/Create a new variable of instance.

Example Response

4.1. Structure 127

Page 132: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required)

A unique integer value identifying this host.

query schema data(required) InventoryVariable Schema

GET /host/{id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

128 Chapter 4. API

Page 133: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this host.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /host/{id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this host.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /host/{id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

4.1. Structure 129

Page 134: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this host.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /host/{id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this host.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /inventory/Return all inventories.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/inventory/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","from_project": true

}]

}

JSON Parameters

• count (integer) – None

130 Chapter 4. API

Page 135: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Inventory Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/Create a new inventory.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

Query Parameters

• data(required) (schema) – OneInventory Schema

POST /inventory/import_inventory/Example Response

4.1. Structure 131

Page 136: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"inventory_id": 1,"name": "example name","raw_data": "example raw_data"

}

JSON Parameters

• inventory_id (integer) – Inventory id(readOnly=True, additionalProper-ties=OrderedDict([(‘redirect’, True)]), x-nullable=True)

• name (string) – Name(minLength=1)

• raw_data (string) – Raw data(minLength=1)

Query Parameters

• data(required) (schema) – InventoryImport Schema

GET /inventory/{id}/Return a inventory instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this inventory.

PUT /inventory/{id}/Update a inventory.

132 Chapter 4. API

Page 137: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneInventory Schema

PATCH /inventory/{id}/Update one or more fields on an existing inventory.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

4.1. Structure 133

Page 138: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneInventory Schema

DELETE /inventory/{id}/Remove an existing inventory.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this inventory.

GET /inventory/{id}/all_groups/Return all groups.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/inventory/1/all_groups/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

134 Chapter 4. API

Page 139: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /inventory/{id}/all_groups/{all_groups_id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param string all_groups_id(required)

param integer id(required) A unique integer value identifying this inventory.

GET /inventory/{id}/all_hosts/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,

(continues on next page)

4.1. Structure 135

Page 140: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"next": "http://localhost:8080/inventory/1/all_hosts/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "HOST","from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /inventory/{id}/all_hosts/{all_hosts_id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

(continues on next page)

136 Chapter 4. API

Page 141: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param string all_hosts_id(required)

param integer id(required) A unique integer value identifying this inventory.

POST /inventory/{id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• from_project (boolean) – Project Based(readOnly=True)

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) Inventory Schema

GET /inventory/{id}/group/Return all groups.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,

(continues on next page)

4.1. Structure 137

Page 142: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"next": "http://localhost:8080/inventory/1/group/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/{id}/group/Create a new group.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

138 Chapter 4. API

Page 143: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Contains groups(default=False)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) GroupCreateMaster Schema

GET /inventory/{id}/group/{group_id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

PUT /inventory/{id}/group/{group_id}/Update a group.

Example Response

4.1. Structure 139

Page 144: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneGroup Schema

PATCH /inventory/{id}/group/{group_id}/Update one or more fields on an existing group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

140 Chapter 4. API

Page 145: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneGroup Schema

DELETE /inventory/{id}/group/{group_id}/Remove an existing group.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

POST /inventory/{id}/group/{group_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","children": true,"from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• children (boolean) – Children(readOnly=True)

• from_project (boolean) – Project Based(readOnly=True)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

4.1. Structure 141

Page 146: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

A unique integer value identifying this inventory.

query schema data(required) Group Schema

POST /inventory/{id}/group/{group_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) SetOwner Schema

GET /inventory/{id}/group/{group_id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/inventory/1/group/1/variables/?limit=1&offset=1

→˓","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

142 Chapter 4. API

Page 147: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• results (array) – (InventoryVariable Schema)

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/{id}/group/{group_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) InventoryVariable Schema

GET /inventory/{id}/group/{group_id}/variables/{variables_id}/Return a variable of instance.

Example Response

4.1. Structure 143

Page 148: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /inventory/{id}/group/{group_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

144 Chapter 4. API

Page 149: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /inventory/{id}/group/{group_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /inventory/{id}/group/{group_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer group_id(required) A unique integer value identifying instance of this groups sublist.

4.1. Structure 145

Page 150: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /inventory/{id}/host/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/inventory/1/host/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "HOST","from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/{id}/host/Create a new host.

Example Response

146 Chapter 4. API

Page 151: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneHost Schema

GET /inventory/{id}/host/{host_id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

4.1. Structure 147

Page 152: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

PUT /inventory/{id}/host/{host_id}/Update a host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneHost Schema

PATCH /inventory/{id}/host/{host_id}/Update one or more fields on an existing host.

Example Response

148 Chapter 4. API

Page 153: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) OneHost Schema

DELETE /inventory/{id}/host/{host_id}/Remove an existing host.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

POST /inventory/{id}/host/{host_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

(continues on next page)

4.1. Structure 149

Page 154: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","type": "HOST","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• from_project (boolean) – Project Based(readOnly=True)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) Host Schema

POST /inventory/{id}/host/{host_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) SetOwner Schema

GET /inventory/{id}/host/{host_id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

150 Chapter 4. API

Page 155: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"count": 2,"next": "http://localhost:8080/inventory/1/host/1/variables/?limit=1&offset=1

→˓","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/{id}/host/{host_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

4.1. Structure 151

Page 156: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) InventoryVariable Schema

GET /inventory/{id}/host/{host_id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /inventory/{id}/host/{host_id}/variables/{variables_id}/Update variable value.

Example Response

152 Chapter 4. API

Page 157: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /inventory/{id}/host/{host_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,

4.1. Structure 153

Page 158: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /inventory/{id}/host/{host_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer host_id(required) A unique integer value identifying instance of this hosts sublist.

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

POST /inventory/{id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) SetOwner Schema

GET /inventory/{id}/variables/Return all variables of instance.

Example Response

154 Chapter 4. API

Page 159: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/inventory/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param integer id(required) A unique integer value identifying this inventory.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /inventory/{id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

4.1. Structure 155

Page 160: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required)

A unique integer value identifying this inventory.

query schema data(required) InventoryVariable Schema

GET /inventory/{id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /inventory/{id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

156 Chapter 4. API

Page 161: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /inventory/{id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

4.1. Structure 157

Page 162: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /inventory/{id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this inventory.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /project/Return all projects.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "example type","status": "example status"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Project Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string status Project sync status.

158 Chapter 4. API

Page 163: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string status__not Project sync status.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/Create a new project.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","status": "example status","type": "MANUAL","repository": "MANUAL","repo_auth": "NONE","auth_data": "test_dynamic","branch": "test_dynamic","additional_playbook_path": "example additional_playbook_path"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• status (string) – Status(readOnly=True, minLength=1)

• type (string) – Repo type(enum=[‘MANUAL’, ‘GIT’, ‘TAR’], default=MANUAL)

• repository (string) – Repo url(default=MANUAL, minLength=1)

• repo_auth (dynamic) – Repo auth type

• auth_data (dynamic) – Repo auth data

• branch (dynamic) – Branch for GIT(branch/tag/SHA) or TAR(subdir)

• additional_playbook_path (string) – Directory with playbooks(minLength=1,x-nullable=True)

Query Parameters

• data(required) (schema) – ProjectCreateMaster Schema

GET /project/{id}/Return a project instance.

Example Response

4.1. Structure 159

Page 164: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","repository": "MANUAL","status": "example status","revision": "example revision","branch": "example branch","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

},"notes": "example\ntext\narea\n","readme_content": "test_html","execute_view_data": {}

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• repository (string) – Repository(default=MANUAL, minLength=1)

• status (string) – Status(enum=[‘NEW’, ‘ERROR’, ‘OK’, ‘WAIT_SYNC’, ‘SYNC’],readOnly=True)

• revision (string) – Revision(readOnly=True)

• branch (string) – Branch(readOnly=True)

• owner (object) – (User Schema)

• notes (textarea) – Notes

• readme_content (html) – Information(readOnly=True)

• execute_view_data (object) – (Data Schema)

param integer id(required) A unique integer value identifying this project.

PUT /project/{id}/Update a project.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name",

(continues on next page)

160 Chapter 4. API

Page 165: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"repository": "MANUAL","status": "example status","revision": "example revision","branch": "example branch","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

},"notes": "example\ntext\narea\n","readme_content": "test_html","execute_view_data": {}

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• repository (string) – Repository(default=MANUAL, minLength=1)

• status (string) – Status(enum=[‘NEW’, ‘ERROR’, ‘OK’, ‘WAIT_SYNC’, ‘SYNC’],readOnly=True)

• revision (string) – Revision(readOnly=True)

• branch (string) – Branch(readOnly=True)

• owner (object) – (User Schema)

• notes (textarea) – Notes

• readme_content (html) – Information(readOnly=True)

• execute_view_data (object) – (Data Schema)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) OneProject Schema

PATCH /project/{id}/Update one or more fields on an existing project.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","repository": "MANUAL","status": "example status","revision": "example revision","branch": "example branch",

(continues on next page)

4.1. Structure 161

Page 166: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"owner": {"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

},"notes": "example\ntext\narea\n","readme_content": "test_html","execute_view_data": {}

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• repository (string) – Repository(default=MANUAL, minLength=1)

• status (string) – Status(enum=[‘NEW’, ‘ERROR’, ‘OK’, ‘WAIT_SYNC’, ‘SYNC’],readOnly=True)

• revision (string) – Revision(readOnly=True)

• branch (string) – Branch(readOnly=True)

• owner (object) – (User Schema)

• notes (textarea) – Notes

• readme_content (html) – Information(readOnly=True)

• execute_view_data (object) – (Data Schema)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) OneProject Schema

DELETE /project/{id}/Remove an existing project.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

POST /project/{id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

(continues on next page)

162 Chapter 4. API

Page 167: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","type": "example type","status": "example status"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(readOnly=True, minLength=1)

• status (string) – Status(enum=[‘NEW’, ‘ERROR’, ‘OK’, ‘WAIT_SYNC’, ‘SYNC’],readOnly=True)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) Project Schema

POST /project/{id}/execute_module/Execute ansible -m [module] with arguments.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"detail": "example detail","history_id": 1,"executor": 1

}

JSON Parameters

• detail (string) – Detail(minLength=1)

• history_id (integer) – History id(additionalProperties=OrderedDict([(‘redirect’,True)]), x-nullable=True)

• executor (integer) – Executor(x-nullable=True)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) AnsibleModule Schema

POST /project/{id}/execute_playbook/Execute ansible-playbook with arguments.

Example Response

4.1. Structure 163

Page 168: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"detail": "example detail","history_id": 1,"executor": 1

}

JSON Parameters

• detail (string) – Detail(minLength=1)

• history_id (integer) – History id(additionalProperties=OrderedDict([(‘redirect’,True)]), x-nullable=True)

• executor (integer) – Executor(x-nullable=True)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) AnsiblePlaybook Schema

GET /project/{id}/history/Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/history/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"start_time": "2019-01-07T06:10:31+10:00","executor": 1,"initiator": 1,"initiator_type": "example initiator_type","revision": "example revision","inventory": 1,"kind": "example kind","mode": "example mode","options": "example options","status": "example status","stop_time": "2019-01-07T06:10:31+10:00"

}]

}

JSON Parameters

• count (integer) – None

164 Chapter 4. API

Page 169: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (ProjectHistory Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string mode Module or playbook name.

query string kind Kind of execution.

query string status Status of execution.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string name A name string value (or comma separated list) of instance.

query string older Older then this time

query string newer Newer then this time

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /project/{id}/history/{history_id}/Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"status": "example status","executor": 1,"project": 1,"revision": "example revision","inventory": 1,"kind": "example kind","mode": "example mode","execute_args": "example execute_args","execution_time": "22:11:34","start_time": "2019-01-07T06:10:31+10:00","stop_time": "2019-01-07T06:10:31+10:00","initiator": 1,"initiator_type": "example initiator_type","options": "example options","raw_args": "example raw_args","raw_stdout": "example raw_stdout","raw_inventory": "example raw_inventory"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

4.1. Structure 165

Page 170: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• status (string) – Status(enum=[‘DELAY’, ‘RUN’, ‘OK’, ‘ERROR’, ‘OFFLINE’, ‘IN-TERRUPTED’])

• executor (integer) – Executor(x-nullable=True)

• project (integer) – Project(x-nullable=True)

• revision (string) – Revision(maxLength=256, x-nullable=True)

• inventory (integer) – Inventory(x-nullable=True)

• kind (string) – Kind(maxLength=50, minLength=1)

• mode (string) – Mode(maxLength=256, minLength=1)

• execute_args (string) – Execute args(readOnly=True)

• execution_time (uptime) – Execution time

• start_time (date-time) – Start time

• stop_time (date-time) – Stop time(x-nullable=True)

• initiator (integer) – Initiator

• initiator_type (string) – Initiator type(maxLength=50, minLength=1)

• options (string) – Options(readOnly=True)

• raw_args (string) – Raw args(minLength=1)

• raw_stdout (string) – Raw stdout(readOnly=True)

• raw_inventory (string) – Raw inventory(minLength=1)

param integer history_id(required) A unique integer value identifying instance of this history sublist.

param integer id(required) A unique integer value identifying this project.

DELETE /project/{id}/history/{history_id}/Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer history_id(required) A unique integer value identifying instance of this history sublist.

param integer id(required) A unique integer value identifying this project.

POST /project/{id}/history/{history_id}/cancel/Cencel working task.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"detail": "example detail"

}

166 Chapter 4. API

Page 171: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• detail (string) – Detail(minLength=1)

param integer history_id(required) A unique integer value identifying instance of this history sublist.

param integer id(required)

A unique integer value identifying this project.

query schema data(required) Empty Schema

DELETE /project/{id}/history/{history_id}/clear/Clear history output.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer history_id(required) A unique integer value identifying instance of this history sublist.

param integer id(required) A unique integer value identifying this project.

GET /project/{id}/history/{history_id}/facts/Get compilated history facts (only for execution ‘module’ with module ‘setup’).

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{}

param integer history_id(required) A unique integer value identifying instance of this history sublist.

param integer id(required) A unique integer value identifying this project.

GET /project/{id}/inventory/Return all inventories.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","from_project": true

(continues on next page)

4.1. Structure 167

Page 172: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Inventory Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/Create a new inventory.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

168 Chapter 4. API

Page 173: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required)

A unique integer value identifying this project.

query schema data(required) OneInventory Schema

POST /project/{id}/inventory/file_import_inventory/Create a new inventory.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"inventory_id": 1,"name": "example name","raw_data": "example raw_data"

}

JSON Parameters

• inventory_id (integer) – Inventory id(readOnly=True, additionalProper-ties=OrderedDict([(‘redirect’, True)]), x-nullable=True)

• name (string) – Name(pattern=(^[^.]+?$)|(^([.][\//])?([.]*[wd-_]+?[.]*[wd-_]*[\//]*)+?$), minLength=1)

• raw_data (string) – Raw data(readOnly=True, minLength=1)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) InventoryFileImport Schema

POST /project/{id}/inventory/import_inventory/Create a new inventory.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"inventory_id": 1,"name": "example name","raw_data": "example raw_data"

}

JSON Parameters

• inventory_id (integer) – Inventory id(readOnly=True, additionalProper-ties=OrderedDict([(‘redirect’, True)]), x-nullable=True)

• name (string) – Name(minLength=1)

• raw_data (string) – Raw data(minLength=1)

4.1. Structure 169

Page 174: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required)

A unique integer value identifying this project.

query schema data(required) InventoryImport Schema

GET /project/{id}/inventory/{inventory_id}/Return a inventory instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

PUT /project/{id}/inventory/{inventory_id}/Update a inventory.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,

(continues on next page)

170 Chapter 4. API

Page 175: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"email": "[email protected]"}

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneInventory Schema

PATCH /project/{id}/inventory/{inventory_id}/Update one or more fields on an existing inventory.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneInventory Schema

4.1. Structure 171

Page 176: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

DELETE /project/{id}/inventory/{inventory_id}/Remove an existing inventory.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

GET /project/{id}/inventory/{inventory_id}/all_groups/Return all groups.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/all_groups/?limit=1&

→˓offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

172 Chapter 4. API

Page 177: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /project/{id}/inventory/{inventory_id}/all_groups/{all_groups_id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param string all_groups_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

GET /project/{id}/inventory/{inventory_id}/all_hosts/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/all_hosts/?limit=1&

→˓offset=1", (continues on next page)

4.1. Structure 173

Page 178: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"previous": null,"results": [

{"id": 1,"name": "example name","type": "HOST","from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /project/{id}/inventory/{inventory_id}/all_hosts/{all_hosts_id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username",

(continues on next page)

174 Chapter 4. API

Page 179: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param string all_hosts_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

POST /project/{id}/inventory/{inventory_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• from_project (boolean) – Project Based(readOnly=True)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) Inventory Schema

GET /project/{id}/inventory/{inventory_id}/group/Return all groups.

Example Response

4.1. Structure 175

Page 180: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/group/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","children": true,"from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Group Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/{inventory_id}/group/Create a new group.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,

(continues on next page)

176 Chapter 4. API

Page 181: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Contains groups(default=False)

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) GroupCreateMaster Schema

GET /project/{id}/inventory/{inventory_id}/group/{group_id}/Return a group instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

4.1. Structure 177

Page 182: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

PUT /project/{id}/inventory/{inventory_id}/group/{group_id}/Update a group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneGroup Schema

PATCH /project/{id}/inventory/{inventory_id}/group/{group_id}/Update one or more fields on an existing group.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

178 Chapter 4. API

Page 183: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","children": true,"owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• children (boolean) – Children(readOnly=True)

• owner (object) – (User Schema)

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneGroup Schema

DELETE /project/{id}/inventory/{inventory_id}/group/{group_id}/Remove an existing group.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

POST /project/{id}/inventory/{inventory_id}/group/{group_id}/copy/Endpoint which copy instance with deps.

Example Response

4.1. Structure 179

Page 184: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","children": true,"from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• children (boolean) – Children(readOnly=True)

• from_project (boolean) – Project Based(readOnly=True)

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) Group Schema

POST /project/{id}/inventory/{inventory_id}/group/{group_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) SetOwner Schema

GET /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/Return all variables of instance.

180 Chapter 4. API

Page 185: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/group/1/variables/?

→˓limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{

(continues on next page)

4.1. Structure 181

Page 186: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) InventoryVariable Schema

GET /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string group_id(required)

182 Chapter 4. API

Page 187: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{

(continues on next page)

4.1. Structure 183

Page 188: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param string group_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /project/{id}/inventory/{inventory_id}/host/Return all hosts.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

184 Chapter 4. API

Page 189: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/host/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","type": "HOST","from_project": true

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Host Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string type Instance type.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string variables List of variables to filter. Comma separeted “key:value” list.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/{inventory_id}/host/Create a new host.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name",

(continues on next page)

4.1. Structure 185

Page 190: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneHost Schema

GET /project/{id}/inventory/{inventory_id}/host/{host_id}/Return a host instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

186 Chapter 4. API

Page 191: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• owner (object) – (User Schema)

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

PUT /project/{id}/inventory/{inventory_id}/host/{host_id}/Update a host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneHost Schema

PATCH /project/{id}/inventory/{inventory_id}/host/{host_id}/Update one or more fields on an existing host.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

4.1. Structure 187

Page 192: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","type": "HOST","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• owner (object) – (User Schema)

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) OneHost Schema

DELETE /project/{id}/inventory/{inventory_id}/host/{host_id}/Remove an existing host.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

POST /project/{id}/inventory/{inventory_id}/host/{host_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATED

(continues on next page)

188 Chapter 4. API

Page 193: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

Content-Type: application/json

{"id": 1,"name": "example name","type": "HOST","from_project": true

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• type (string) – Type(enum=[‘HOST’, ‘RANGE’], default=HOST)

• from_project (boolean) – Project Based(readOnly=True)

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) Host Schema

POST /project/{id}/inventory/{inventory_id}/host/{host_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) SetOwner Schema

GET /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/Return all variables of instance.

Example Response

4.1. Structure 189

Page 194: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/host/1/variables/?

→˓limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,

(continues on next page)

190 Chapter 4. API

Page 195: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) InventoryVariable Schema

GET /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string host_id(required)

4.1. Structure 191

Page 196: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

PATCH /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{

(continues on next page)

192 Chapter 4. API

Page 197: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param string host_id(required)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

POST /project/{id}/inventory/{inventory_id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

(continues on next page)

4.1. Structure 193

Page 198: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) SetOwner Schema

GET /project/{id}/inventory/{inventory_id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/inventory/1/variables/?limit=1&

→˓offset=1","previous": null,"results": [

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (InventoryVariable Schema)

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

194 Chapter 4. API

Page 199: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/inventory/{inventory_id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required)

A unique integer value identifying instance of this inventories sublist.

query schema data(required) InventoryVariable Schema

GET /project/{id}/inventory/{inventory_id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

4.1. Structure 195

Page 200: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /project/{id}/inventory/{inventory_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

196 Chapter 4. API

Page 201: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

PATCH /project/{id}/inventory/{inventory_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "ansible_host","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: ansible_host, ansible_port, ansi-ble_user, ansible_connection, ansible_ssh_pass, ansible_ssh_private_key_file, an-sible_ssh_common_args, ansible_sftp_extra_args, ansible_scp_extra_args, ansi-ble_ssh_extra_args, ansible_ssh_executable, ansible_ssh_pipelining, ansible_become,ansible_become_method, ansible_become_user, ansible_become_pass, ansi-ble_become_exe, ansible_become_flags, ansible_shell_type, ansible_python_interpreter,ansible_ruby_interpreter, ansible_perl_interpreter, ansible_shell_executable)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) InventoryVariable Schema

DELETE /project/{id}/inventory/{inventory_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

param integer inventory_id(required) A unique integer value identifying instance of this inventoriessublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /project/{id}/module/Return all available modules of project.

4.1. Structure 197

Page 202: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/module/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"path": "example path","name": "example name"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Module Schema)

param integer id(required) A unique integer value identifying this project.

query string path Full path to module.

query string name Name of module.

query string path__not Full path to module.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /project/{id}/module/{module_id}/Return a module details of project instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"path": "example path","name": "example name","data": {}

}

JSON Parameters

198 Chapter 4. API

Page 203: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• id (integer) – Id(readOnly=True)

• path (string) – Path(maxLength=1024, minLength=1)

• name (string) – Name(readOnly=True)

• data (object) – Data(readOnly=True)

param integer id(required) A unique integer value identifying this project.

param string module_id(required)

GET /project/{id}/periodic_task/Return all periodic tasks in project.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/periodic_task/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","kind": "PLAYBOOK","mode": "test_dynamic","inventory": "test_dynamic","save_result": true,"template": 1,"template_opt": "test_dynamic","enabled": true,"type": "CRONTAB","schedule": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Periodictask Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string mode Periodic task module or playbook name.

query string kind Kind of periodic task.

query string type Instance type.

query number template A unique integer id of template used in periodic task.

4.1. Structure 199

Page 204: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string name A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/periodic_task/Create a new periodic task.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","kind": "PLAYBOOK","mode": "test_dynamic","inventory": "test_dynamic","save_result": true,"template": 1,"template_opt": "test_dynamic","enabled": true,"type": "CRONTAB","schedule": "test_dynamic","notes": "example\ntext\narea\n"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• kind (string) – Task type(enum=[‘PLAYBOOK’, ‘MODULE’, ‘TEMPLATE’], de-fault=PLAYBOOK)

• mode (dynamic) – Mode

• inventory (dynamic) – Inventory

• save_result (boolean) – Save result

• template (integer) – Template(x-nullable=True)

• template_opt (dynamic) – Template opt

• enabled (boolean) – Enabled

• type (string) – Interval type(enum=[‘CRONTAB’, ‘INTERVAL’], default=CRONTAB)

• schedule (dynamic) – Schedule

• notes (textarea) – Notes

param integer id(required)

200 Chapter 4. API

Page 205: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

A unique integer value identifying this project.

query schema data(required) OnePeriodictask Schema

GET /project/{id}/periodic_task/{periodic_task_id}/Return a perodic task instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","kind": "PLAYBOOK","mode": "test_dynamic","inventory": "test_dynamic","save_result": true,"template": 1,"template_opt": "test_dynamic","enabled": true,"type": "CRONTAB","schedule": "test_dynamic","notes": "example\ntext\narea\n"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• kind (string) – Task type(enum=[‘PLAYBOOK’, ‘MODULE’, ‘TEMPLATE’], de-fault=PLAYBOOK)

• mode (dynamic) – Mode

• inventory (dynamic) – Inventory

• save_result (boolean) – Save result

• template (integer) – Template(x-nullable=True)

• template_opt (dynamic) – Template opt

• enabled (boolean) – Enabled

• type (string) – Interval type(enum=[‘CRONTAB’, ‘INTERVAL’], default=CRONTAB)

• schedule (dynamic) – Schedule

• notes (textarea) – Notes

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

PUT /project/{id}/periodic_task/{periodic_task_id}/Update a periodic task.

Example Response

4.1. Structure 201

Page 206: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","kind": "PLAYBOOK","mode": "test_dynamic","inventory": "test_dynamic","save_result": true,"template": 1,"template_opt": "test_dynamic","enabled": true,"type": "CRONTAB","schedule": "test_dynamic","notes": "example\ntext\narea\n"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• kind (string) – Task type(enum=[‘PLAYBOOK’, ‘MODULE’, ‘TEMPLATE’], de-fault=PLAYBOOK)

• mode (dynamic) – Mode

• inventory (dynamic) – Inventory

• save_result (boolean) – Save result

• template (integer) – Template(x-nullable=True)

• template_opt (dynamic) – Template opt

• enabled (boolean) – Enabled

• type (string) – Interval type(enum=[‘CRONTAB’, ‘INTERVAL’], default=CRONTAB)

• schedule (dynamic) – Schedule

• notes (textarea) – Notes

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required)

A unique integer value identifying instance of this periodic_task sublist.

query schema data(required) OnePeriodictask Schema

PATCH /project/{id}/periodic_task/{periodic_task_id}/Update one or more fields on an existing periodic task.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

202 Chapter 4. API

Page 207: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"name": "example name","kind": "PLAYBOOK","mode": "test_dynamic","inventory": "test_dynamic","save_result": true,"template": 1,"template_opt": "test_dynamic","enabled": true,"type": "CRONTAB","schedule": "test_dynamic","notes": "example\ntext\narea\n"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• kind (string) – Task type(enum=[‘PLAYBOOK’, ‘MODULE’, ‘TEMPLATE’], de-fault=PLAYBOOK)

• mode (dynamic) – Mode

• inventory (dynamic) – Inventory

• save_result (boolean) – Save result

• template (integer) – Template(x-nullable=True)

• template_opt (dynamic) – Template opt

• enabled (boolean) – Enabled

• type (string) – Interval type(enum=[‘CRONTAB’, ‘INTERVAL’], default=CRONTAB)

• schedule (dynamic) – Schedule

• notes (textarea) – Notes

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required)

A unique integer value identifying instance of this periodic_task sublist.

query schema data(required) OnePeriodictask Schema

DELETE /project/{id}/periodic_task/{periodic_task_id}/Remove an existing periodic task.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

4.1. Structure 203

Page 208: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

POST /project/{id}/periodic_task/{periodic_task_id}/execute/Ad-hoc execute periodic task.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"detail": "example detail","history_id": 1,"executor": 1

}

JSON Parameters

• detail (string) – Detail(minLength=1)

• history_id (integer) – History id(additionalProperties=OrderedDict([(‘redirect’,True)]), x-nullable=True)

• executor (integer) – Executor(x-nullable=True)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required)

A unique integer value identifying instance of this periodic_task sublist.

query schema data(required) Empty Schema

GET /project/{id}/periodic_task/{periodic_task_id}/variables/Return all variables of periodic task.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/periodic_task/1/variables/?limit=1&

→˓offset=1","previous": null,"results": [

{"id": 1,"key": "example key","value": "example value"

}]

}

204 Chapter 4. API

Page 209: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (PeriodicTaskVariable Schema)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/periodic_task/{periodic_task_id}/variables/Create a new variable of periodic task.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "example key","value": "example value"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (string) – Key(maxLength=512, minLength=1)

• value (string) – Value(default=)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required)

A unique integer value identifying instance of this periodic_task sublist.

query schema data(required) PeriodicTaskVariable Schema

GET /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/Return a variable of periodic task.

Example Response

4.1. Structure 205

Page 210: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "example key","value": "example value"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (string) – Key(maxLength=512, minLength=1)

• value (string) – Value(default=)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "example key","value": "example value"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (string) – Key(maxLength=512, minLength=1)

• value (string) – Value(default=)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) PeriodicTaskVariable Schema

206 Chapter 4. API

Page 211: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

PATCH /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "example key","value": "example value"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (string) – Key(maxLength=512, minLength=1)

• value (string) – Value(default=)

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) PeriodicTaskVariable Schema

DELETE /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

param integer periodic_task_id(required) A unique integer value identifying instance of this peri-odic_task sublist.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /project/{id}/playbook/Return all playbooks of project.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

4.1. Structure 207

Page 212: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"count": 2,"next": "http://localhost:8080/project/1/playbook/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","playbook": "example playbook"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Playbook Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string playbook Playbook filename.

query string pb_filter Playbook filename - filter for prefetch.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string playbook__not Playbook filename.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

GET /project/{id}/playbook/{playbook_id}/Return a playbook of project instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","playbook": "example playbook"

}

208 Chapter 4. API

Page 213: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=251, minLength=1)

• playbook (string) – Playbook(readOnly=True, minLength=1)

param integer id(required) A unique integer value identifying this project.

param integer playbook_id(required) A unique integer value identifying instance of this playbook sub-list.

POST /project/{id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required)

A unique integer value identifying this project.

query schema data(required) SetOwner Schema

POST /project/{id}/sync/Sync project with repository.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"detail": "example detail"

}

JSON Parameters

• detail (string) – Detail(minLength=1)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) Empty Schema

4.1. Structure 209

Page 214: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

GET /project/{id}/template/Return all execute templates in project.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/template/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name","kind": "Task","data": {},"options": {},"options_list": [

"array_example"]

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Template Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string kind A kind of template.

query string inventory The inventory id or path in project.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/template/Create a new execute template.

Example Response

210 Chapter 4. API

Page 215: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","kind": "Task","data": {},"options": {},"options_list": [

"array_example"]

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• kind (string) – Type(enum=[‘Task’, ‘Module’], default=Task)

• data (object) – (Data Schema)

• options (object) – (Data Schema)

• options_list (array) – (items=OrderedDict([(‘type’, ‘string’)]), readOnly=True)

param integer id(required)

A unique integer value identifying this project.

query schema data(required) OneTemplate Schema

GET /project/{id}/template/{template_id}/Return a execute template instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","kind": "Task","data": {},"options": {},"options_list": [

"array_example"]

}

4.1. Structure 211

Page 216: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• kind (string) – Type(enum=[‘Task’, ‘Module’], default=Task)

• data (object) – (Data Schema)

• options (object) – (Data Schema)

• options_list (array) – (items=OrderedDict([(‘type’, ‘string’)]), readOnly=True)

param integer id(required) A unique integer value identifying this project.

param integer template_id(required) A unique integer value identifying instance of this template sub-list.

PUT /project/{id}/template/{template_id}/Update a execute template.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","kind": "Task","data": {},"options": {},"options_list": [

"array_example"]

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• kind (string) – Type(enum=[‘Task’, ‘Module’], default=Task)

• data (object) – (Data Schema)

• options (object) – (Data Schema)

• options_list (array) – (items=OrderedDict([(‘type’, ‘string’)]), readOnly=True)

param integer id(required) A unique integer value identifying this project.

param integer template_id(required)

A unique integer value identifying instance of this template sublist.

query schema data(required) OneTemplate Schema

212 Chapter 4. API

Page 217: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

PATCH /project/{id}/template/{template_id}/Update one or more fields on an existing execute template.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","kind": "Task","data": {},"options": {},"options_list": [

"array_example"]

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• name (string) – Name(maxLength=512, minLength=1)

• notes (textarea) – Notes

• kind (string) – Type(enum=[‘Task’, ‘Module’], default=Task)

• data (object) – (Data Schema)

• options (object) – (Data Schema)

• options_list (array) – (items=OrderedDict([(‘type’, ‘string’)]), readOnly=True)

param integer id(required) A unique integer value identifying this project.

param integer template_id(required)

A unique integer value identifying instance of this template sublist.

query schema data(required) OneTemplate Schema

DELETE /project/{id}/template/{template_id}/Remove an existing execute template.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

param integer template_id(required) A unique integer value identifying instance of this template sub-list.

4.1. Structure 213

Page 218: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

POST /project/{id}/template/{template_id}/execute/Execute template with option.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"detail": "example detail","history_id": 1,"executor": 1

}

JSON Parameters

• detail (string) – Detail(minLength=1)

• history_id (integer) – History id(additionalProperties=OrderedDict([(‘redirect’,True)]), x-nullable=True)

• executor (integer) – Executor(x-nullable=True)

param integer id(required) A unique integer value identifying this project.

param integer template_id(required)

A unique integer value identifying instance of this template sublist.

query schema data(required) TemplateExec Schema

GET /project/{id}/variables/Return all variables of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/project/1/variables/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"key": "repo_type","value": "test_dynamic"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

214 Chapter 4. API

Page 219: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• previous (uri) – (x-nullable=True)

• results (array) – (ProjectVariable Schema)

param integer id(required) A unique integer value identifying this project.

query string id A unique integer value (or comma separated list) identifying this instance.

query string key A key name string value (or comma separated list) of instance.

query string value A value of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /project/{id}/variables/Create a new variable of instance.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"key": "repo_type","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: repo_type, repo_sync_on_run,repo_sync_on_run_timeout, repo_branch, repo_password, repo_key, playbook_path,ci_template)

• value (dynamic) – Value

param integer id(required)

A unique integer value identifying this project.

query schema data(required) ProjectVariable Schema

GET /project/{id}/variables/{variables_id}/Return a variable of instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,

(continues on next page)

4.1. Structure 215

Page 220: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"key": "repo_type","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: repo_type, repo_sync_on_run,repo_sync_on_run_timeout, repo_branch, repo_password, repo_key, playbook_path,ci_template)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

PUT /project/{id}/variables/{variables_id}/Update variable value.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"key": "repo_type","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: repo_type, repo_sync_on_run,repo_sync_on_run_timeout, repo_branch, repo_password, repo_key, playbook_path,ci_template)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) ProjectVariable Schema

PATCH /project/{id}/variables/{variables_id}/Update one or more fields on an existing variable.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

(continues on next page)

216 Chapter 4. API

Page 221: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

{"id": 1,"key": "repo_type","value": "test_dynamic"

}

JSON Parameters

• id (integer) – Id(readOnly=True)

• key (autocomplete) – Key(Example values: repo_type, repo_sync_on_run,repo_sync_on_run_timeout, repo_branch, repo_password, repo_key, playbook_path,ci_template)

• value (dynamic) – Value

param integer id(required) A unique integer value identifying this project.

param integer variables_id(required)

A unique integer value identifying instance of this variables sublist.

query schema data(required) ProjectVariable Schema

DELETE /project/{id}/variables/{variables_id}/Remove an existing variable.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this project.

param integer variables_id(required) A unique integer value identifying instance of this variables sub-list.

GET /team/Return all teams.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/team/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"name": "example name"

(continues on next page)

4.1. Structure 217

Page 222: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (Team Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string name A name string value (or comma separated list) of instance.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string name__not A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /team/Create a new team.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – ID(readOnly=True)

• name (string) – Name(maxLength=150, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

Query Parameters

• data(required) (schema) – OneTeam Schema

218 Chapter 4. API

Page 223: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

GET /team/{id}/Return a team instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – ID(readOnly=True)

• name (string) – Name(maxLength=150, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required) A unique integer value identifying this user group.

PUT /team/{id}/Update a team.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – ID(readOnly=True)

• name (string) – Name(maxLength=150, minLength=1)

4.1. Structure 219

Page 224: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this user group.

query schema data(required) OneTeam Schema

PATCH /team/{id}/Update one or more fields on an existing team.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"name": "example name","notes": "example\ntext\narea\n","owner": {

"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}}

JSON Parameters

• id (integer) – ID(readOnly=True)

• name (string) – Name(maxLength=150, minLength=1)

• notes (textarea) – Notes

• owner (object) – (User Schema)

param integer id(required)

A unique integer value identifying this user group.

query schema data(required) OneTeam Schema

DELETE /team/{id}/Remove an existing team.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this user group.

POST /team/{id}/copy/Endpoint which copy instance with deps.

220 Chapter 4. API

Page 225: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"name": "example name"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• name (string) – Name(maxLength=150, minLength=1)

param integer id(required)

A unique integer value identifying this user group.

query schema data(required) Team Schema

POST /team/{id}/set_owner/Change instance owner.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"user_id": 1

}

JSON Parameters

• user_id (fk) – New owner(additionalProperties=OrderedDict([(‘model’, Ordered-Dict([(‘$ref’, ‘#/definitions/User’)])), (‘value_field’, ‘id’), (‘view_field’, ‘username’)]))

param integer id(required)

A unique integer value identifying this user group.

query schema data(required) SetOwner Schema

GET /team/{id}/user/Return all users.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,

(continues on next page)

4.1. Structure 221

Page 226: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"next": "http://localhost:8080/team/1/user/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (User Schema)

param integer id(required) A unique integer value identifying this user group.

query string id A unique integer value (or comma separated list) identifying this instance.

query string username A name string value (or comma separated list) of instance.

query string is_active Boolean value meaning status of user.

query string first_name Users first name.

query string last_name Users last name.

query string email Users e-mail value.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string username__not A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /team/{id}/user/Create a new user.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"is_staff": true,"first_name": "example first_name",

(continues on next page)

222 Chapter 4. API

Page 227: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"last_name": "example last_name","email": "[email protected]","password": "example password","password2": "example password2"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• is_staff (boolean) – Is staff(default=False)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

• password (string) – Password(minLength=1)

• password2 (string) – Repeat password(minLength=1)

param integer id(required)

A unique integer value identifying this user group.

query schema data(required) CreateUser Schema

GET /team/{id}/user/{user_id}/Return a user instance.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

4.1. Structure 223

Page 228: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required) A unique integer value identifying instance of this users sublist.

PUT /team/{id}/user/{user_id}/Update a user.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required)

A unique integer value identifying instance of this users sublist.

query schema data(required) OneUser Schema

PATCH /team/{id}/user/{user_id}/Update one or more fields on an existing user.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username",

(continues on next page)

224 Chapter 4. API

Page 229: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required)

A unique integer value identifying instance of this users sublist.

query schema data(required) OneUser Schema

DELETE /team/{id}/user/{user_id}/Remove an existing user.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required) A unique integer value identifying instance of this users sublist.

POST /team/{id}/user/{user_id}/change_password/Create a new user.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"old_password": "example old_password","password": "example password","password2": "example password2"

}

JSON Parameters

4.1. Structure 225

Page 230: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• old_password (string) – Old password(minLength=1)

• password (string) – New password(minLength=1)

• password2 (string) – Confirm new password(minLength=1)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required)

A unique integer value identifying instance of this users sublist.

query schema data(required) ChangePassword Schema

POST /team/{id}/user/{user_id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• email (email) – Email(minLength=1)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required)

A unique integer value identifying instance of this users sublist.

query schema data(required) User Schema

GET /team/{id}/user/{user_id}/settings/from rest_framework.settings import api_settings print(api_settings.DEFAULT_RENDERER_CLASSES)

Any setting with string import paths will be automatically resolved and return the class, rather than the stringliteral.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{

(continues on next page)

226 Chapter 4. API

Page 231: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"lang": "en","autoupdateInterval": 15000,"chartLineSettings": {

"all_tasks": {"active": true

},"delay": {

"active": true},"ok": {

"active": true},"error": {

"active": true},"interrupted": {

"active": true},"offline": {

"active": true}

},"widgetSettings": {

"pmwUsersCounter": {"active": true,"collapse": true,"sort": 1

},"pmwProjectsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwTemplatesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwInventoriesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwGroupsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwHostsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwChartWidget": {

"active": true,"collapse": true,"sort": 1

(continues on next page)

4.1. Structure 227

Page 232: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

}},"selectedSkin": "example selectedSkin","skinsSettings": {}

}

JSON Parameters

• lang (string) – Lang(enum=[‘en’, ‘ru’], default=en)

• autoupdateInterval (integer) – Autoupdateinterval(default=15000)

• chartLineSettings (object) – (ChartLineSettings Schema)

• widgetSettings (object) – (WidgetSettings Schema)

• selectedSkin (string) – Selectedskin(minLength=1)

• skinsSettings (object) – (Data Schema)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required) A unique integer value identifying instance of this users sublist.

POST /team/{id}/user/{user_id}/settings/from rest_framework.settings import api_settings print(api_settings.DEFAULT_RENDERER_CLASSES)

Any setting with string import paths will be automatically resolved and return the class, rather than the stringliteral.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"lang": "en","autoupdateInterval": 15000,"chartLineSettings": {

"all_tasks": {"active": true

},"delay": {

"active": true},"ok": {

"active": true},"error": {

"active": true},"interrupted": {

"active": true},"offline": {

"active": true}

},

(continues on next page)

228 Chapter 4. API

Page 233: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"widgetSettings": {"pmwUsersCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwProjectsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwTemplatesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwInventoriesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwGroupsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwHostsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwChartWidget": {

"active": true,"collapse": true,"sort": 1

}},"selectedSkin": "example selectedSkin","skinsSettings": {}

}

JSON Parameters

• lang (string) – Lang(enum=[‘en’, ‘ru’], default=en)

• autoupdateInterval (integer) – Autoupdateinterval(default=15000)

• chartLineSettings (object) – (ChartLineSettings Schema)

• widgetSettings (object) – (WidgetSettings Schema)

• selectedSkin (string) – Selectedskin(minLength=1)

• skinsSettings (object) – (Data Schema)

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required)

A unique integer value identifying instance of this users sublist.

4.1. Structure 229

Page 234: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query schema data(required) UserSettings Schema

DELETE /team/{id}/user/{user_id}/settings/from rest_framework.settings import api_settings print(api_settings.DEFAULT_RENDERER_CLASSES)

Any setting with string import paths will be automatically resolved and return the class, rather than the stringliteral.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this user group.

param integer user_id(required) A unique integer value identifying instance of this users sublist.

GET /user/Return all users.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"count": 2,"next": "http://localhost:8080/user/?limit=1&offset=1","previous": null,"results": [

{"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}]

}

JSON Parameters

• count (integer) – None

• next (uri) – (x-nullable=True)

• previous (uri) – (x-nullable=True)

• results (array) – (User Schema)

query string id A unique integer value (or comma separated list) identifying this instance.

query string username A name string value (or comma separated list) of instance.

query string is_active Boolean value meaning status of user.

query string first_name Users first name.

query string last_name Users last name.

230 Chapter 4. API

Page 235: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query string email Users e-mail value.

query string id__not A unique integer value (or comma separated list) identifying this instance.

query string username__not A name string value (or comma separated list) of instance.

query string ordering Which field to use when ordering the results.

query integer limit Number of results to return per page.

query integer offset The initial index from which to return the results.

POST /user/Create a new user.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"is_staff": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]","password": "example password","password2": "example password2"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• is_staff (boolean) – Is staff(default=False)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

• password (string) – Password(minLength=1)

• password2 (string) – Repeat password(minLength=1)

Query Parameters

• data(required) (schema) – CreateUser Schema

GET /user/{id}/Return a user instance.

Example Response

4.1. Structure 231

Page 236: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

param integer id(required) A unique integer value identifying this user.

PUT /user/{id}/Update a user.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

232 Chapter 4. API

Page 237: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

• email (email) – Email(minLength=1)

param integer id(required)

A unique integer value identifying this user.

query schema data(required) OneUser Schema

PATCH /user/{id}/Update one or more fields on an existing user.

Example Response

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"first_name": "example first_name","last_name": "example last_name","email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• first_name (string) – First name(maxLength=30)

• last_name (string) – Last name(maxLength=150)

• email (email) – Email(minLength=1)

param integer id(required)

A unique integer value identifying this user.

query schema data(required) OneUser Schema

DELETE /user/{id}/Remove an existing user.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this user.

POST /user/{id}/change_password/Example Response

4.1. Structure 233

Page 238: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"old_password": "example old_password","password": "example password","password2": "example password2"

}

JSON Parameters

• old_password (string) – Old password(minLength=1)

• password (string) – New password(minLength=1)

• password2 (string) – Confirm new password(minLength=1)

param integer id(required)

A unique integer value identifying this user.

query schema data(required) ChangePassword Schema

POST /user/{id}/copy/Endpoint which copy instance with deps.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"id": 1,"username": "example username","is_active": true,"email": "[email protected]"

}

JSON Parameters

• id (integer) – ID(readOnly=True)

• username (string) – Username(description=Required. 150 characters or fewer. Let-ters, digits and @/./+/-/_ only., pattern=^[w.@+-]+$, maxLength=150, minLength=1)

• is_active (boolean) – Is active(default=True)

• email (email) – Email(minLength=1)

param integer id(required)

A unique integer value identifying this user.

query schema data(required) User Schema

GET /user/{id}/settings/Return user settings.

Example Response

234 Chapter 4. API

Page 239: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

HTTP/1.1 200 OKVary: OKContent-Type: application/json

{"lang": "en","autoupdateInterval": 15000,"chartLineSettings": {

"all_tasks": {"active": true

},"delay": {

"active": true},"ok": {

"active": true},"error": {

"active": true},"interrupted": {

"active": true},"offline": {

"active": true}

},"widgetSettings": {

"pmwUsersCounter": {"active": true,"collapse": true,"sort": 1

},"pmwProjectsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwTemplatesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwInventoriesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwGroupsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwHostsCounter": {

"active": true,"collapse": true,

(continues on next page)

4.1. Structure 235

Page 240: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"sort": 1},"pmwChartWidget": {

"active": true,"collapse": true,"sort": 1

}},"selectedSkin": "example selectedSkin","skinsSettings": {}

}

JSON Parameters

• lang (string) – Lang(enum=[‘en’, ‘ru’], default=en)

• autoupdateInterval (integer) – Autoupdateinterval(default=15000)

• chartLineSettings (object) – (ChartLineSettings Schema)

• widgetSettings (object) – (WidgetSettings Schema)

• selectedSkin (string) – Selectedskin(minLength=1)

• skinsSettings (object) – (Data Schema)

param integer id(required) A unique integer value identifying this user.

POST /user/{id}/settings/Return user settings.

Example Response

HTTP/1.1 201 CreatedVary: CREATEDContent-Type: application/json

{"lang": "en","autoupdateInterval": 15000,"chartLineSettings": {

"all_tasks": {"active": true

},"delay": {

"active": true},"ok": {

"active": true},"error": {

"active": true},"interrupted": {

"active": true},"offline": {

"active": true(continues on next page)

236 Chapter 4. API

Page 241: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

}},"widgetSettings": {

"pmwUsersCounter": {"active": true,"collapse": true,"sort": 1

},"pmwProjectsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwTemplatesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwInventoriesCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwGroupsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwHostsCounter": {

"active": true,"collapse": true,"sort": 1

},"pmwChartWidget": {

"active": true,"collapse": true,"sort": 1

}},"selectedSkin": "example selectedSkin","skinsSettings": {}

}

JSON Parameters

• lang (string) – Lang(enum=[‘en’, ‘ru’], default=en)

• autoupdateInterval (integer) – Autoupdateinterval(default=15000)

• chartLineSettings (object) – (ChartLineSettings Schema)

• widgetSettings (object) – (WidgetSettings Schema)

• selectedSkin (string) – Selectedskin(minLength=1)

• skinsSettings (object) – (Data Schema)

param integer id(required)

A unique integer value identifying this user.

4.1. Structure 237

Page 242: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

query schema data(required) UserSettings Schema

DELETE /user/{id}/settings/Return user settings.

Example Response

HTTP/1.1 204 No ContentVary: NO CONTENTContent-Type: application/json

{}

param integer id(required) A unique integer value identifying this user.

4.1.2 Schemas Description

ProjectTemplate Schema

{"id": {

"title": "Id","type": "integer"

},"name": {

"title": "Name","type": "string","maxLength": 1024,"minLength": 1

},"type": {

"title": "Type","type": "string","enum": [

"GIT","TAR"

]}

}

OneProjectTemplate Schema

{"id": {

"title": "Id","type": "integer"

},"name": {

"title": "Name","type": "string","maxLength": 1024,"minLength": 1

},"description": {

"title": "Description",

(continues on next page)

238 Chapter 4. API

Page 243: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string","minLength": 1

},"type": {

"title": "Type","type": "string","enum": [

"GIT","TAR"

]},"repository": {

"title": "Repository","type": "string","maxLength": 2048,"minLength": 1

}}

ProjectTemplateCreate Schema

{"project_id": {

"title": "Project id","type": "integer","readOnly": true,"additionalProperties": {

"redirect": true},"x-nullable": true

},"name": {

"title": "Name","type": "string","minLength": 1

}}

Group Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"children": {

(continues on next page)

4.1. Structure 239

Page 244: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Children","type": "boolean","readOnly": true

},"from_project": {

"title": "Project Based","type": "boolean","readOnly": true

}}

User Schema

{"id": {

"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters, digits

→˓and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

GroupCreateMaster Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,

(continues on next page)

240 Chapter 4. API

Page 245: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"minLength": 1},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"children": {

"title": "Contains groups","type": "boolean","default": false

},"owner": {

"id": {"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

}

OneGroup Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},(continues on next page)

4.1. Structure 241

Page 246: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"notes": {"title": "Notes","type": "string","format": "textarea"

},"children": {

"title": "Children","type": "boolean","readOnly": true

},"owner": {

"id": {"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

}

SetOwner Schema

{"user_id": {

"title": "New owner","type": "integer","format": "fk","additionalProperties": {

"model": {"id": {

"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username",(continues on next page)

242 Chapter 4. API

Page 247: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"description": "Required. 150 characters or fewer.→˓Letters, digits and @/./+/-/_ only.",

"type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}},"value_field": "id","view_field": "username"

}}

}

InventoryVariable Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"key": {

"title": "Key","type": "string","format": "autocomplete","enum": [

"ansible_host","ansible_port","ansible_user","ansible_connection","ansible_ssh_pass","ansible_ssh_private_key_file","ansible_ssh_common_args","ansible_sftp_extra_args","ansible_scp_extra_args","ansible_ssh_extra_args","ansible_ssh_executable","ansible_ssh_pipelining","ansible_become","ansible_become_method","ansible_become_user","ansible_become_pass","ansible_become_exe",

(continues on next page)

4.1. Structure 243

Page 248: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"ansible_become_flags","ansible_shell_type","ansible_python_interpreter","ansible_ruby_interpreter","ansible_perl_interpreter","ansible_shell_executable"

]},"value": {

"title": "Value","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "key","types": {

"ansible_become": "boolean","ansible_become_pass": "password","ansible_port": "integer","ansible_ssh_pass": "password","ansible_ssh_private_key_file": "secretfile"

}}

}}

Host Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"type": {

"title": "Type","type": "string","enum": [

"HOST","RANGE"

],"default": "HOST"

},"from_project": {

"title": "Project Based","type": "boolean","readOnly": true

}}

244 Chapter 4. API

Page 249: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

OneHost Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"type": {

"title": "Type","type": "string","enum": [

"HOST","RANGE"

],"default": "HOST"

},"owner": {

"id": {"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

}

4.1. Structure 245

Page 250: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

History Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"start_time": {

"title": "Start time","type": "string","format": "date-time"

},"executor": {

"title": "Executor","type": "integer","x-nullable": true

},"initiator": {

"title": "Initiator","type": "integer"

},"initiator_type": {

"title": "Initiator type","type": "string","maxLength": 50,"minLength": 1

},"project": {

"title": "Project","type": "integer","x-nullable": true

},"inventory": {

"title": "Inventory","type": "integer","x-nullable": true

},"kind": {

"title": "Kind","type": "string","maxLength": 50,"minLength": 1

},"mode": {

"title": "Mode","type": "string","maxLength": 256,"minLength": 1

},"options": {

"title": "Options","type": "string","readOnly": true

},"status": {

"title": "Status",

(continues on next page)

246 Chapter 4. API

Page 251: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string","enum": [

"DELAY","RUN","OK","ERROR","OFFLINE","INTERRUPTED"

]},"stop_time": {

"title": "Stop time","type": "string","format": "date-time","x-nullable": true

}}

OneHistory Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"status": {

"title": "Status","type": "string","enum": [

"DELAY","RUN","OK","ERROR","OFFLINE","INTERRUPTED"

]},"executor": {

"title": "Executor","type": "integer","x-nullable": true

},"project": {

"title": "Project","type": "integer","x-nullable": true

},"revision": {

"title": "Revision","type": "string","maxLength": 256,"x-nullable": true

},"inventory": {

(continues on next page)

4.1. Structure 247

Page 252: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Inventory","type": "integer","x-nullable": true

},"kind": {

"title": "Kind","type": "string","maxLength": 50,"minLength": 1

},"mode": {

"title": "Mode","type": "string","maxLength": 256,"minLength": 1

},"execute_args": {

"title": "Execute args","type": "string","readOnly": true

},"execution_time": {

"title": "Execution time","type": "integer","format": "uptime"

},"start_time": {

"title": "Start time","type": "string","format": "date-time"

},"stop_time": {

"title": "Stop time","type": "string","format": "date-time","x-nullable": true

},"initiator": {

"title": "Initiator","type": "integer"

},"initiator_type": {

"title": "Initiator type","type": "string","maxLength": 50,"minLength": 1

},"options": {

"title": "Options","type": "string","readOnly": true

},"raw_args": {

"title": "Raw args","type": "string","minLength": 1

},(continues on next page)

248 Chapter 4. API

Page 253: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"raw_stdout": {"title": "Raw stdout","type": "string","readOnly": true

},"raw_inventory": {

"title": "Raw inventory","type": "string","minLength": 1

}}

Empty Schema

{}

ActionResponse Schema

{"detail": {

"title": "Detail","type": "string","minLength": 1

}}

Data Schema

{}

Hook Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"type": {

"title": "Type","type": "string","enum": [

"HTTP",

(continues on next page)

4.1. Structure 249

Page 254: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"SCRIPT"]

},"when": {

"title": "When","type": "string","enum": [

"on_execution","after_execution","on_user_add","on_user_upd","on_user_del","on_object_add","on_object_upd","on_object_del"

]},"enable": {

"title": "Enable","type": "boolean"

},"recipients": {

"title": "Recipients","type": "string","minLength": 1

}}

Inventory Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"from_project": {

"title": "Project Based","type": "boolean","readOnly": true

}}

OneInventory Schema

{"id": {

(continues on next page)

250 Chapter 4. API

Page 255: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"owner": {

"id": {"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

}

InventoryImport Schema

{"inventory_id": {

"title": "Inventory id","type": "integer","readOnly": true,"additionalProperties": {

"redirect": true},"x-nullable": true

(continues on next page)

4.1. Structure 251

Page 256: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"name": {

"title": "Name","type": "string","minLength": 1

},"raw_data": {

"title": "Raw data","type": "string","minLength": 1

}}

Project Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"type": {

"title": "Type","type": "string","readOnly": true,"minLength": 1

},"status": {

"title": "Status","type": "string","enum": [

"NEW","ERROR","OK","WAIT_SYNC","SYNC"

],"readOnly": true

}}

ProjectCreateMaster Schema

{"id": {

"title": "Id","type": "integer",

(continues on next page)

252 Chapter 4. API

Page 257: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"readOnly": true},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"status": {

"title": "Status","type": "string","readOnly": true,"minLength": 1

},"type": {

"title": "Repo type","type": "string","enum": [

"MANUAL","GIT","TAR"

],"default": "MANUAL"

},"repository": {

"title": "Repo url","type": "string","default": "MANUAL","minLength": 1

},"repo_auth": {

"title": "Repo auth type","type": "string","format": "dynamic","default": "NONE","additionalProperties": {

"choices": {"GIT": [

"NONE","KEY","PASSWORD"

]},"field": "type","types": {

"GIT": "string","MANUAL": "hidden","TAR": "hidden"

}}

},"auth_data": {

"title": "Repo auth data","type": "string","format": "dynamic","default": "","additionalProperties": {

(continues on next page)

4.1. Structure 253

Page 258: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"choices": {},"field": "repo_auth","types": {

"KEY": "secretfile","NONE": "hidden","PASSWORD": "password"

}}

},"branch": {

"title": "Branch for GIT(branch/tag/SHA) or TAR(subdir)","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "type","types": {

"GIT": "string","MANUAL": "hidden","TAR": "string"

}},"x-nullable": true

},"additional_playbook_path": {

"title": "Directory with playbooks","type": "string","minLength": 1,"x-nullable": true

}}

OneProject Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"repository": {

"title": "Repository","type": "string","default": "MANUAL","minLength": 1

},"status": {

"title": "Status","type": "string",

(continues on next page)

254 Chapter 4. API

Page 259: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"enum": ["NEW","ERROR","OK","WAIT_SYNC","SYNC"

],"readOnly": true

},"revision": {

"title": "Revision","type": "string","readOnly": true

},"branch": {

"title": "Branch","type": "string","readOnly": true

},"owner": {

"id": {"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"readme_content": {

"title": "Information","type": "string","format": "html","readOnly": true

},(continues on next page)

4.1. Structure 255

Page 260: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"execute_view_data": {}}

AnsibleModule Schema

{"module": {

"title": "Module","type": "string","format": "autocomplete","additionalProperties": {

"model": {"id": {

"title": "Id","type": "integer","readOnly": true

},"path": {

"title": "Path","type": "string","maxLength": 1024,"minLength": 1

},"name": {

"title": "Name","type": "string","readOnly": true

}},"value_field": "name","view_field": "path"

}},"args": {

"title": "Args","description": "host pattern","type": "string"

},"background": {

"title": "Background","description": "run asynchronously, failing after X seconds

→˓(default=N/A)","type": "integer"

},"become": {

"title": "Become","description": "run operations with become (does not imply password

→˓prompting)","type": "boolean","default": false

},"become_method": {

"title": "Become method","description": "privilege escalation method to use (default=sudo),

→˓use `ansible-doc -t become -l` to list valid choices.",(continues on next page)

256 Chapter 4. API

Page 261: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string"},"become_user": {

"title": "Become user","description": "run operations as this user (default=root)","type": "string"

},"check": {

"title": "Check","description": "don't make any changes; instead, try to predict some

→˓of the changes that may occur","type": "boolean","default": false

},"connection": {

"title": "Connection","description": "connection type to use (default=smart)","type": "string"

},"diff": {

"title": "Diff","description": "when changing (small) files and templates, show the

→˓differences in those files; works great with --check","type": "boolean","default": false

},"extra_vars": {

"title": "Extra vars","description": "set additional variables as key=value or YAML/JSON,

→˓if filename prepend with @","type": "string"

},"forks": {

"title": "Forks","description": "specify number of parallel processes to use

→˓(default=5)","type": "integer"

},"inventory": {

"title": "Inventory","description": "specify inventory host path or comma separated host

→˓list. --inventory-file is deprecated","type": "string","format": "autocomplete","additionalProperties": {

"model": {"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},(continues on next page)

4.1. Structure 257

Page 262: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"from_project": {"title": "Project Based","type": "boolean","readOnly": true

}},"value_field": "id","view_field": "name"

}},"limit": {

"title": "Limit","description": "further limit selected hosts to an additional pattern

→˓","type": "string"

},"list_hosts": {

"title": "List hosts","description": "outputs a list of matching hosts; does not execute

→˓anything else","type": "boolean","default": false

},"module_path": {

"title": "Module path","description": "prepend colon-separated path(s) to module library

→˓(default=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules)","type": "string"

},"one_line": {

"title": "One line","description": "condense output","type": "boolean","default": false

},"playbook_dir": {

"title": "Playbook dir","description": "Since this tool does not use playbooks, use this as

→˓a substitute playbook directory.This sets the relative path for many→˓features including roles/ group_vars/ etc.",

"type": "string"},"poll": {

"title": "Poll","description": "set the poll interval if using -B (default=15)","type": "integer"

},"private_key": {

"title": "Private key","description": "use this file to authenticate the connection","type": "string","format": "secretfile"

},"scp_extra_args": {

"title": "Scp extra args","description": "specify extra arguments to pass to scp only (e.g. -l)

→˓",(continues on next page)

258 Chapter 4. API

Page 263: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string"},"sftp_extra_args": {

"title": "Sftp extra args","description": "specify extra arguments to pass to sftp only (e.g. -

→˓f, -l)","type": "string"

},"ssh_common_args": {

"title": "Ssh common args","description": "specify common arguments to pass to sftp/scp/ssh (e.

→˓g. ProxyCommand)","type": "string"

},"ssh_extra_args": {

"title": "Ssh extra args","description": "specify extra arguments to pass to ssh only (e.g. -R)

→˓","type": "string"

},"syntax_check": {

"title": "Syntax check","description": "perform a syntax check on the playbook, but do not

→˓execute it","type": "boolean","default": false

},"timeout": {

"title": "Timeout","description": "override the connection timeout in seconds

→˓(default=10)","type": "integer"

},"tree": {

"title": "Tree","description": "log output to this directory","type": "string"

},"user": {

"title": "User","description": "connect as this user (default=None)","type": "string"

},"vault_id": {

"title": "Vault id","description": "the vault identity to use","type": "string"

},"vault_password_file": {

"title": "Vault password file","description": "vault password file","type": "string","format": "secretfile"

},"verbose": {

"title": "Verbose","description": "verbose mode (-vvv for more, -vvvv to enable

→˓connection debugging)", (continues on next page)

4.1. Structure 259

Page 264: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "integer","default": 0,"maximum": 4

},"group": {

"title": "Group","type": "string","default": "all"

}}

ExecuteResponse Schema

{"detail": {

"title": "Detail","type": "string","minLength": 1

},"history_id": {

"title": "History id","type": "integer","additionalProperties": {

"redirect": true},"x-nullable": true

},"executor": {

"title": "Executor","type": "integer","x-nullable": true

}}

AnsiblePlaybook Schema

{"playbook": {

"title": "Playbook","type": "string","format": "autocomplete","additionalProperties": {

"model": {"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 251,"minLength": 1

(continues on next page)

260 Chapter 4. API

Page 265: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"playbook": {

"title": "Playbook","type": "string","maxLength": 256,"minLength": 1

}},"value_field": "playbook","view_field": "name"

}},"args": {

"title": "Args","description": "Playbook(s)","type": "string"

},"become": {

"title": "Become","description": "run operations with become (does not imply password

→˓prompting)","type": "boolean","default": false

},"become_method": {

"title": "Become method","description": "privilege escalation method to use (default=sudo),

→˓use `ansible-doc -t become -l` to list valid choices.","type": "string"

},"become_user": {

"title": "Become user","description": "run operations as this user (default=root)","type": "string"

},"check": {

"title": "Check","description": "don't make any changes; instead, try to predict some

→˓of the changes that may occur","type": "boolean","default": false

},"connection": {

"title": "Connection","description": "connection type to use (default=smart)","type": "string"

},"diff": {

"title": "Diff","description": "when changing (small) files and templates, show the

→˓differences in those files; works great with --check","type": "boolean","default": false

},"extra_vars": {

"title": "Extra vars","description": "set additional variables as key=value or YAML/JSON,

→˓if filename prepend with @", (continues on next page)

4.1. Structure 261

Page 266: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string"},"flush_cache": {

"title": "Flush cache","description": "clear the fact cache for every host in inventory","type": "boolean","default": false

},"force_handlers": {

"title": "Force handlers","description": "run handlers even if a task fails","type": "boolean","default": false

},"forks": {

"title": "Forks","description": "specify number of parallel processes to use

→˓(default=5)","type": "integer"

},"inventory": {

"title": "Inventory","description": "specify inventory host path or comma separated host

→˓list. --inventory-file is deprecated","type": "string","format": "autocomplete","additionalProperties": {

"model": {"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"from_project": {

"title": "Project Based","type": "boolean","readOnly": true

}},"value_field": "id","view_field": "name"

}},"limit": {

"title": "Limit","description": "further limit selected hosts to an additional pattern

→˓","type": "string"

},"list_hosts": {

"title": "List hosts",(continues on next page)

262 Chapter 4. API

Page 267: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"description": "outputs a list of matching hosts; does not execute→˓anything else",

"type": "boolean","default": false

},"list_tags": {

"title": "List tags","description": "list all available tags","type": "boolean","default": false

},"list_tasks": {

"title": "List tasks","description": "list all tasks that would be executed","type": "boolean","default": false

},"module_path": {

"title": "Module path","description": "prepend colon-separated path(s) to module library

→˓(default=~/.ansible/plugins/modules:/usr/share/ansible/plugins/modules)","type": "string"

},"private_key": {

"title": "Private key","description": "use this file to authenticate the connection","type": "string","format": "secretfile"

},"scp_extra_args": {

"title": "Scp extra args","description": "specify extra arguments to pass to scp only (e.g. -l)

→˓","type": "string"

},"sftp_extra_args": {

"title": "Sftp extra args","description": "specify extra arguments to pass to sftp only (e.g. -

→˓f, -l)","type": "string"

},"skip_tags": {

"title": "Skip tags","description": "only run plays and tasks whose tags do not match

→˓these values","type": "string"

},"ssh_common_args": {

"title": "Ssh common args","description": "specify common arguments to pass to sftp/scp/ssh (e.

→˓g. ProxyCommand)","type": "string"

},"ssh_extra_args": {

"title": "Ssh extra args","description": "specify extra arguments to pass to ssh only (e.g. -R)

→˓",(continues on next page)

4.1. Structure 263

Page 268: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string"},"start_at_task": {

"title": "Start at task","description": "start the playbook at the task matching this name","type": "string"

},"step": {

"title": "Step","description": "one-step-at-a-time: confirm each task before running

→˓","type": "boolean","default": false

},"syntax_check": {

"title": "Syntax check","description": "perform a syntax check on the playbook, but do not

→˓execute it","type": "boolean","default": false

},"tags": {

"title": "Tags","description": "only run plays and tasks tagged with these values","type": "string"

},"timeout": {

"title": "Timeout","description": "override the connection timeout in seconds

→˓(default=10)","type": "integer"

},"user": {

"title": "User","description": "connect as this user (default=None)","type": "string"

},"vault_id": {

"title": "Vault id","description": "the vault identity to use","type": "string"

},"vault_password_file": {

"title": "Vault password file","description": "vault password file","type": "string","format": "secretfile"

},"verbose": {

"title": "Verbose","description": "verbose mode (-vvv for more, -vvvv to enable

→˓connection debugging)","type": "integer","default": 0,"maximum": 4

}}

264 Chapter 4. API

Page 269: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

ProjectHistory Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"start_time": {

"title": "Start time","type": "string","format": "date-time"

},"executor": {

"title": "Executor","type": "integer","x-nullable": true

},"initiator": {

"title": "Initiator","type": "integer"

},"initiator_type": {

"title": "Initiator type","type": "string","maxLength": 50,"minLength": 1

},"revision": {

"title": "Revision","type": "string","maxLength": 256,"x-nullable": true

},"inventory": {

"title": "Inventory","type": "integer","x-nullable": true

},"kind": {

"title": "Kind","type": "string","maxLength": 50,"minLength": 1

},"mode": {

"title": "Mode","type": "string","maxLength": 256,"minLength": 1

},"options": {

"title": "Options","type": "string","readOnly": true

},"status": {

(continues on next page)

4.1. Structure 265

Page 270: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Status","type": "string","enum": [

"DELAY","RUN","OK","ERROR","OFFLINE","INTERRUPTED"

]},"stop_time": {

"title": "Stop time","type": "string","format": "date-time","x-nullable": true

}}

InventoryFileImport Schema

{"inventory_id": {

"title": "Inventory id","type": "integer","readOnly": true,"additionalProperties": {

"redirect": true},"x-nullable": true

},"name": {

"title": "Name","type": "string","pattern": "(^[^\\.]+?$)|(^([\\.][\\\\//])?([\\.]*[\\w\\d\\-_]+?[\\.

→˓]*[\\w\\d\\-_]*[\\\\//]*)+?$)","minLength": 1

},"raw_data": {

"title": "Raw data","type": "string","readOnly": true,"minLength": 1

}}

Module Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

(continues on next page)

266 Chapter 4. API

Page 271: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"path": {

"title": "Path","type": "string","maxLength": 1024,"minLength": 1

},"name": {

"title": "Name","type": "string","readOnly": true

}}

OneModule Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"path": {

"title": "Path","type": "string","maxLength": 1024,"minLength": 1

},"name": {

"title": "Name","type": "string","readOnly": true

},"data": {

"title": "Data","type": "object","readOnly": true

}}

Periodictask Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

(continues on next page)

4.1. Structure 267

Page 272: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"kind": {

"title": "Task type","type": "string","enum": [

"PLAYBOOK","MODULE","TEMPLATE"

],"default": "PLAYBOOK"

},"mode": {

"title": "Mode","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "fk_autocomplete","PLAYBOOK": "fk_autocomplete","TEMPLATE": "hidden"

}}

},"inventory": {

"title": "Inventory","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "fk_autocomplete","PLAYBOOK": "fk_autocomplete","TEMPLATE": "hidden"

}}

},"save_result": {

"title": "Save result","type": "boolean"

},"template": {

"title": "Template","type": "integer","x-nullable": true

},"template_opt": {

"title": "Template opt","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "hidden",(continues on next page)

268 Chapter 4. API

Page 273: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"PLAYBOOK": "hidden","TEMPLATE": "autocomplete"

}},"x-nullable": true

},"enabled": {

"title": "Enabled","type": "boolean"

},"type": {

"title": "Interval type","type": "string","enum": [

"CRONTAB","INTERVAL"

],"default": "CRONTAB"

},"schedule": {

"title": "Schedule","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "type","types": {

"CRONTAB": "crontab","INTERVAL": "integer"

}}

}}

OnePeriodictask Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"kind": {

"title": "Task type","type": "string","enum": [

"PLAYBOOK","MODULE","TEMPLATE"

(continues on next page)

4.1. Structure 269

Page 274: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

],"default": "PLAYBOOK"

},"mode": {

"title": "Mode","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "fk_autocomplete","PLAYBOOK": "fk_autocomplete","TEMPLATE": "hidden"

}}

},"inventory": {

"title": "Inventory","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "fk_autocomplete","PLAYBOOK": "fk_autocomplete","TEMPLATE": "hidden"

}}

},"save_result": {

"title": "Save result","type": "boolean"

},"template": {

"title": "Template","type": "integer","x-nullable": true

},"template_opt": {

"title": "Template opt","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "kind","types": {

"MODULE": "hidden","PLAYBOOK": "hidden","TEMPLATE": "autocomplete"

}},"x-nullable": true

},"enabled": {

"title": "Enabled",(continues on next page)

270 Chapter 4. API

Page 275: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "boolean"},"type": {

"title": "Interval type","type": "string","enum": [

"CRONTAB","INTERVAL"

],"default": "CRONTAB"

},"schedule": {

"title": "Schedule","type": "string","format": "dynamic","additionalProperties": {

"choices": {},"field": "type","types": {

"CRONTAB": "crontab","INTERVAL": "integer"

}}

},"notes": {

"title": "Notes","type": "string","format": "textarea"

}}

PeriodicTaskVariable Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"key": {

"title": "Key","type": "string","maxLength": 512,"minLength": 1

},"value": {

"title": "Value","type": "string","default": ""

}}

4.1. Structure 271

Page 276: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

Playbook Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 251,"minLength": 1

},"playbook": {

"title": "Playbook","type": "string","maxLength": 256,"minLength": 1

}}

OnePlaybook Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 251,"minLength": 1

},"playbook": {

"title": "Playbook","type": "string","readOnly": true,"minLength": 1

}}

Template Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name",

(continues on next page)

272 Chapter 4. API

Page 277: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "string","maxLength": 512,"minLength": 1

},"kind": {

"title": "Type","type": "string","enum": [

"Task","Module"

],"default": "Task"

},"data": {},"options": {},"options_list": {

"type": "array","items": {

"type": "string"},"readOnly": true

}}

OneTemplate Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 512,"minLength": 1

},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"kind": {

"title": "Type","type": "string","enum": [

"Task","Module"

],"default": "Task"

},"data": {},"options": {},"options_list": {

(continues on next page)

4.1. Structure 273

Page 278: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "array","items": {

"type": "string"},"readOnly": true

}}

TemplateExec Schema

{"option": {

"title": "Option","description": "Option name from template options.","type": "string","minLength": 0

}}

ProjectVariable Schema

{"id": {

"title": "Id","type": "integer","readOnly": true

},"key": {

"title": "Key","type": "string","format": "autocomplete","enum": [

"repo_type","repo_sync_on_run","repo_sync_on_run_timeout","repo_branch","repo_password","repo_key","playbook_path","ci_template"

]},"value": {

"title": "Value","type": "string","format": "dynamic","additionalProperties": {

"choices": {"repo_sync_on_run": [

true,false

],"repo_type": [

(continues on next page)

274 Chapter 4. API

Page 279: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"MANUAL","GIT","TAR"

]},"field": "key","types": {

"ci_template": "fk","repo_key": "secretfile","repo_password": "password","repo_sync_on_run_timeout": "uptime"

}}

}}

Team Schema

{"id": {

"title": "ID","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 150,"minLength": 1

}}

OneTeam Schema

{"id": {

"title": "ID","type": "integer","readOnly": true

},"name": {

"title": "Name","type": "string","maxLength": 150,"minLength": 1

},"notes": {

"title": "Notes","type": "string","format": "textarea"

},"owner": {

"id": {

(continues on next page)

4.1. Structure 275

Page 280: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters,

→˓digits and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

}

CreateUser Schema

{"id": {

"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters, digits

→˓and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"is_staff": {

"title": "Is staff","type": "boolean","default": false

},"first_name": {

(continues on next page)

276 Chapter 4. API

Page 281: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "First name","type": "string","maxLength": 30

},"last_name": {

"title": "Last name","type": "string","maxLength": 150

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

},"password": {

"title": "Password","type": "string","minLength": 1

},"password2": {

"title": "Repeat password","type": "string","minLength": 1

}}

OneUser Schema

{"id": {

"title": "ID","type": "integer","readOnly": true

},"username": {

"title": "Username","description": "Required. 150 characters or fewer. Letters, digits

→˓and @/./+/-/_ only.","type": "string","pattern": "^[\\w.@+-]+$","maxLength": 150,"minLength": 1

},"is_active": {

"title": "Is active","type": "boolean","default": true

},"first_name": {

"title": "First name","type": "string","maxLength": 30

},"last_name": {

(continues on next page)

4.1. Structure 277

Page 282: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Last name","type": "string","maxLength": 150

},"email": {

"title": "Email","type": "string","format": "email","minLength": 1

}}

ChangePassword Schema

{"old_password": {

"title": "Old password","type": "string","minLength": 1

},"password": {

"title": "New password","type": "string","minLength": 1

},"password2": {

"title": "Confirm new password","type": "string","minLength": 1

}}

ChartLineSetting Schema

{"active": {

"title": "Active","type": "boolean","default": true

}}

ChartLineSettings Schema

{"all_tasks": {

"active": {"title": "Active","type": "boolean","default": true

}

(continues on next page)

278 Chapter 4. API

Page 283: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"delay": {

"active": {"title": "Active","type": "boolean","default": true

}},"ok": {

"active": {"title": "Active","type": "boolean","default": true

}},"error": {

"active": {"title": "Active","type": "boolean","default": true

}},"interrupted": {

"active": {"title": "Active","type": "boolean","default": true

}},"offline": {

"active": {"title": "Active","type": "boolean","default": true

}}

}

CounterWidgetSetting Schema

{"active": {

"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer",

(continues on next page)

4.1. Structure 279

Page 284: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"default": 0}

}

WidgetSetting Schema

{"active": {

"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}}

WidgetSettings Schema

{"pmwUsersCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwProjectsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse",

(continues on next page)

280 Chapter 4. API

Page 285: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwTemplatesCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwInventoriesCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwGroupsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

(continues on next page)

4.1. Structure 281

Page 286: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwHostsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwChartWidget": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}}

}

UserSettings Schema

{"lang": {

"title": "Lang","type": "string","enum": [

"en","ru"

],"default": "en"

(continues on next page)

282 Chapter 4. API

Page 287: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

},"autoupdateInterval": {

"title": "Autoupdateinterval","type": "integer","default": 15000

},"chartLineSettings": {

"all_tasks": {"active": {

"title": "Active","type": "boolean","default": true

}},"delay": {

"active": {"title": "Active","type": "boolean","default": true

}},"ok": {

"active": {"title": "Active","type": "boolean","default": true

}},"error": {

"active": {"title": "Active","type": "boolean","default": true

}},"interrupted": {

"active": {"title": "Active","type": "boolean","default": true

}},"offline": {

"active": {"title": "Active","type": "boolean","default": true

}}

},"widgetSettings": {

"pmwUsersCounter": {"active": {

"title": "Active","type": "boolean","default": true

},(continues on next page)

4.1. Structure 283

Page 288: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"collapse": {"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwProjectsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwTemplatesCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwInventoriesCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean",

(continues on next page)

284 Chapter 4. API

Page 289: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwGroupsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwHostsCounter": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","readOnly": true,"default": false

},"sort": {

"title": "Sort","type": "integer","default": 0

}},"pmwChartWidget": {

"active": {"title": "Active","type": "boolean","default": true

},"collapse": {

"title": "Collapse","type": "boolean","default": false

},"sort": {

(continues on next page)

4.1. Structure 285

Page 290: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

(continued from previous page)

"title": "Sort","type": "integer","default": 0

}}

},"selectedSkin": {

"title": "Selectedskin","type": "string","minLength": 1

},"skinsSettings": {}

}

286 Chapter 4. API

Page 291: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

FIVE

HOW TO PARTICIPATE

If you found some bug in the codebase or documentation, or you want some improvement in ‘Polemarch’ project, youcan easily inform us about it. Here is how to proceed:

1. Create (or find if it already exists) an issue for problem you want to solve. Maybe somebody is already workingon it or maybe during discussion becomes clear that it is not a problem at all.

2. To investigate problem, you probably must be able to run cloned project. To do so install required dependencies.See “Install from PyPI” for more detailed explanation, which dependencies and why they are needed. Systempackages (example for Ubuntu 16.04):

sudo apt-get install python-pip python-dev libffi-dev libssl-dev git sshpass→˓libyaml-dev

Note: Your patch must work at Python 2 and Python 3. For Python 3 you should have at least Python 3.5,because older Python 3 may not work correctly with Polemarch.

3. Make sure you have latest pip and tox in your system. You can do it with those commands:

sudo pip install --upgrade pipsudo pip install --upgrade tox==3.0.0

5. Make fork of our repository and clone it to your local development machine.

git clone https://gitlab.com/vstconsulting/polemarch.git

6. Create a branch for your work named with number of issue:

cd polemarchgit checkout -b issue/1

7. Create and activate virtualenv:

tox -e contribsource env/bin/activate

8. Initialize empty database with all required stuff (tables and so on) for Polemarch:

python -m polemarch migrate

9. Enable debug in settings.ini. You can edit polemarch/main/settings.ini but make sure that changesin that file does not goes to you commit. Or you can copy polemarch/main/settings.ini to /etc/polemarch/settings.ini (default settings location for Polemarch). Type debug = true in section[main]. Otherwise there will be no available static files and debug features when you start developmentweb-server.

287

Page 292: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

10. Run Polemarch GUI with web-server and investigate with your debugger how it works to find out what need tobe changed:

# run web-serverpython -m polemarch webserver

This command also starts worker, if you have added worker options in /etc/polemarch/settings.ini.More about worker section you can find on “Install from PyPI”.

If you want to see console output of Polemarch webserver during it work, you need to add following option in/etc/polemarch/settings.ini:

[uwsgi]daemon = false

11. You may also want to change ./polemarch/main/settings.ini to change log_level for easy de-bugging.

12. Write tests for your changes (we prefer TDD approach). Execute those tests with all other Polemarch’s tests by:

make test ENVS=flake,pylint,py27-install,py36-coverage

This command do PEP8 check of codebase and static analyzing with pylint and flake and run main python tests.Make sure that your code meets those checks.

13. Reflect your changes in documentation (if needed). Build documentation, read what you have changed andmake sure that all is right. To build documentation use:

make docs

14. Make commit. We prefer commit messages with briefly explanations of your changes. Unacceptable: “issue#1” or “fix”. Acceptable: “fix end slashes for GET in docs”.

15. Create pull request and refer it in issue.

Attention: You must agree to our contributor agreement to prevent any license problems to project in future withyour contribution.

That’s it. Thank you for your contribution.

288 Chapter 5. How to participate

Page 293: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

CHAPTER

SIX

VST CONSULTING CONTRIBUTOR AGREEMENT

This VST Consulting contributor Agreement (this “Agreement”) applies to any Contribution you make to any Work.

This is a binding legal agreement on you and any organization you represent. If you are signing this Agreement onbehalf of your employer or other organization, you represent and warrant that you have the authority to agree to thisAgreement on behalf of the organization.

6.1 1. Definitions

“Contribution” means any original work, including any modification of or addition to an existing work, that yousubmit to VST Consulting in any manner for inclusion in any Work.

“VST Consulting”, “we” and “us” means OOO VST Consulting.

“Work” means any project, work or materials owned or managed by OOO VST Consulting.

“You” and “your” means you and any organization on whose behalf you are entering this Agreement.

6.2 2. Copyright Assignment, License and Waiver

(a) Assignment. By submitting a Contribution, you assign to VST Consulting all right, title and interest in anycopyright you have in the Contribution, and you waive any rights, including any moral rights, database rights, etc.,that may affect your ownership of the copyright in the Contribution.

(b) License to VST Consulting. If your assignment in Section 2(a) is ineffective for any reason, you grant to usand to any recipient of any Work distributed by us, a perpetual, worldwide, transferable, non-exclusive, no-charge,royalty-free, irrevocable, and sublicensable licence to use, reproduce, prepare derivative works of, publicly display,publicly perform, sublicense, and distribute Contributions and any derivative work created based on a Contribution. Ifyour license grant is ineffective for any reason, you irrevocably waive and covenant to not assert any claim you mayhave against us, our successors in interest, and any of our direct or indirect licensees and customers, arising out of our,our successors in interest’s, or any of our direct or indirect licensees’ or customers’ use, reproduction, preparation ofderivative works, public display, public performance, sublicense, and distribution of a Contribution. You also agreethat we may publicly use your name and the name of any organization on whose behalf you’re entering into thisAgreement in connection with publicizing the Work.

(c) License to you. We grant to you a perpetual, worldwide, transferable, non-exclusive, no-charge, royalty-free, irre-vocable, and sublicensable license to use, reproduce, prepare derivative works of, publicly display, publicly perform,sublicense, and distribute a Contribution and any derivative works you create based on a Contribution.

289

Page 294: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

6.3 3. Patent License

You grant to us and to any recipient of any Work distributed by us, a perpetual, worldwide, transferable, non-exclusive,no-charge, royalty-free, irrevocable, and sublicensable patent license to make, have made, use, sell, offer to sell,import, and otherwise transfer the Contribution in whole or in part, along or included in any Work under any patentyou own, or license from a third party, that is necessarily infringed by the Contribution or by combination of theContribution with any Work.

6.4 4. Your Representation and Warranties.

By submitting a Contribution, you represent and warrant that: (a) each Contribution you submit is an original workand you can legally grant the rights set out in this Agreement; (b) the Contribution does not, and any exercise of therights granted by you will not, infringe any third party’s intellectual property or other right; and (c) you are not awareof any claims, suits, or actions pertaining to the Contribution. You will notify us immediately if you become aware orhave reason to believe that any of your representations and warranties is or becomes inaccurate.

6.5 5. Intellectual Property

Except for the assignment and licenses set forth in this Agreement, this Agreement does not transfer any right, titleor interest in any intellectual property right of either party to the other. If you choose to provide us with suggestions,ideas for improvement, recommendations or other feedback, on any Work we may use your feedback without anyrestriction or payment.

6.6 Miscellaneous

Russian law governs this Agreement, excluding any applicable conflict of laws rules or principles, and the parties agreeto the exclusive jurisdiction of the courts in Russian Federation. This Agreement does not create a partnership, agencyrelationship, or joint venture between the parties. We may assign this Agreement without notice or restriction. Ifany provision of this Agreement is unenforcable, that provision will be modified to render it enforceable to the extentpossible to effect the parties’ intention and the remaining provisions will not be affected. The parties may amendthis Agreement only in a written amendment signed by both parties. This Agreement comprises the parties’ entireagreement relating to the subject matter of this Agreement.

Agreed and accepted on my behalf and on behalf of my organization

Our contributor agreement is based on the mongoDB contributor agreement: https://www.mongodb.com/legal/contributor-agreement.

290 Chapter 6. VST Consulting contributor agreement

Page 295: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

HTTP ROUTING TABLE

/community_templateGET /community_template/, 89GET /community_template/{id}/, 90POST /community_template/{id}/use_it/,

90

/groupGET /group/, 91GET /group/{id}/, 92GET /group/{id}/group/, 95GET /group/{id}/group/{group_id}/, 96GET /group/{id}/group/{group_id}/variables/,

100GET /group/{id}/group/{group_id}/variables/{variables_id}/,

101GET /group/{id}/host/, 103GET /group/{id}/host/{host_id}/, 105GET /group/{id}/host/{host_id}/variables/,

108GET /group/{id}/host/{host_id}/variables/{variables_id}/,

109GET /group/{id}/variables/, 112GET /group/{id}/variables/{variables_id}/,

113POST /group/, 92POST /group/{id}/copy/, 94POST /group/{id}/group/, 96POST /group/{id}/group/{group_id}/copy/,

99POST /group/{id}/group/{group_id}/set_owner/,

99POST /group/{id}/group/{group_id}/variables/,

100POST /group/{id}/host/, 104POST /group/{id}/host/{host_id}/copy/,

107POST /group/{id}/host/{host_id}/set_owner/,

108POST /group/{id}/host/{host_id}/variables/,

109POST /group/{id}/set_owner/, 112POST /group/{id}/variables/, 113

PUT /group/{id}/, 93PUT /group/{id}/group/{group_id}/, 97PUT /group/{id}/group/{group_id}/variables/{variables_id}/,

102PUT /group/{id}/host/{host_id}/, 105PUT /group/{id}/host/{host_id}/variables/{variables_id}/,

110PUT /group/{id}/variables/{variables_id}/,

114DELETE /group/{id}/, 94DELETE /group/{id}/group/{group_id}/,

98DELETE /group/{id}/group/{group_id}/variables/{variables_id}/,

103DELETE /group/{id}/host/{host_id}/, 107DELETE /group/{id}/host/{host_id}/variables/{variables_id}/,

111DELETE /group/{id}/variables/{variables_id}/,

115PATCH /group/{id}/, 93PATCH /group/{id}/group/{group_id}/, 98PATCH /group/{id}/group/{group_id}/variables/{variables_id}/,

102PATCH /group/{id}/host/{host_id}/, 106PATCH /group/{id}/host/{host_id}/variables/{variables_id}/,

111PATCH /group/{id}/variables/{variables_id}/,

115

/historyGET /history/, 115GET /history/{id}/, 116GET /history/{id}/facts/, 118POST /history/{id}/cancel/, 118DELETE /history/{id}/, 118DELETE /history/{id}/clear/, 118

/hookGET /hook/, 119GET /hook/{id}/, 120POST /hook/, 119PUT /hook/{id}/, 121

291

Page 296: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

DELETE /hook/{id}/, 122PATCH /hook/{id}/, 121

/hostGET /host/, 122GET /host/{id}/, 124GET /host/{id}/variables/, 127GET /host/{id}/variables/{variables_id}/,

128POST /host/, 123POST /host/{id}/copy/, 126POST /host/{id}/set_owner/, 126POST /host/{id}/variables/, 127PUT /host/{id}/, 124PUT /host/{id}/variables/{variables_id}/,

129DELETE /host/{id}/, 126DELETE /host/{id}/variables/{variables_id}/,

130PATCH /host/{id}/, 125PATCH /host/{id}/variables/{variables_id}/,

129

/inventoryGET /inventory/, 130GET /inventory/{id}/, 132GET /inventory/{id}/all_groups/, 134GET /inventory/{id}/all_groups/{all_groups_id}/,

135GET /inventory/{id}/all_hosts/, 135GET /inventory/{id}/all_hosts/{all_hosts_id}/,

136GET /inventory/{id}/group/, 137GET /inventory/{id}/group/{group_id}/,

139GET /inventory/{id}/group/{group_id}/variables/,

142GET /inventory/{id}/group/{group_id}/variables/{variables_id}/,

143GET /inventory/{id}/host/, 146GET /inventory/{id}/host/{host_id}/, 147GET /inventory/{id}/host/{host_id}/variables/,

150GET /inventory/{id}/host/{host_id}/variables/{variables_id}/,

152GET /inventory/{id}/variables/, 154GET /inventory/{id}/variables/{variables_id}/,

156POST /inventory/, 131POST /inventory/import_inventory/, 131POST /inventory/{id}/copy/, 137POST /inventory/{id}/group/, 138POST /inventory/{id}/group/{group_id}/copy/,

141

POST /inventory/{id}/group/{group_id}/set_owner/,142

POST /inventory/{id}/group/{group_id}/variables/,143

POST /inventory/{id}/host/, 146POST /inventory/{id}/host/{host_id}/copy/,

149POST /inventory/{id}/host/{host_id}/set_owner/,

150POST /inventory/{id}/host/{host_id}/variables/,

151POST /inventory/{id}/set_owner/, 154POST /inventory/{id}/variables/, 155PUT /inventory/{id}/, 132PUT /inventory/{id}/group/{group_id}/,

139PUT /inventory/{id}/group/{group_id}/variables/{variables_id}/,

144PUT /inventory/{id}/host/{host_id}/, 148PUT /inventory/{id}/host/{host_id}/variables/{variables_id}/,

152PUT /inventory/{id}/variables/{variables_id}/,

156DELETE /inventory/{id}/, 134DELETE /inventory/{id}/group/{group_id}/,

141DELETE /inventory/{id}/group/{group_id}/variables/{variables_id}/,

145DELETE /inventory/{id}/host/{host_id}/,

149DELETE /inventory/{id}/host/{host_id}/variables/{variables_id}/,

154DELETE /inventory/{id}/variables/{variables_id}/,

158PATCH /inventory/{id}/, 133PATCH /inventory/{id}/group/{group_id}/,

140PATCH /inventory/{id}/group/{group_id}/variables/{variables_id}/,

145PATCH /inventory/{id}/host/{host_id}/,

148PATCH /inventory/{id}/host/{host_id}/variables/{variables_id}/,

153PATCH /inventory/{id}/variables/{variables_id}/,

157

/projectGET /project/, 158GET /project/{id}/, 159GET /project/{id}/history/, 164GET /project/{id}/history/{history_id}/,

165GET /project/{id}/history/{history_id}/facts/,

167

292 HTTP Routing Table

Page 297: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

GET /project/{id}/inventory/, 167GET /project/{id}/inventory/{inventory_id}/,

170GET /project/{id}/inventory/{inventory_id}/all_groups/,

172GET /project/{id}/inventory/{inventory_id}/all_groups/{all_groups_id}/,

173GET /project/{id}/inventory/{inventory_id}/all_hosts/,

173GET /project/{id}/inventory/{inventory_id}/all_hosts/{all_hosts_id}/,

174GET /project/{id}/inventory/{inventory_id}/group/,

175GET /project/{id}/inventory/{inventory_id}/group/{group_id}/,

177GET /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/,

180GET /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/,

182GET /project/{id}/inventory/{inventory_id}/host/,

184GET /project/{id}/inventory/{inventory_id}/host/{host_id}/,

186GET /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/,

189GET /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/,

191GET /project/{id}/inventory/{inventory_id}/variables/,

194GET /project/{id}/inventory/{inventory_id}/variables/{variables_id}/,

195GET /project/{id}/module/, 197GET /project/{id}/module/{module_id}/,

198GET /project/{id}/periodic_task/, 199GET /project/{id}/periodic_task/{periodic_task_id}/,

201GET /project/{id}/periodic_task/{periodic_task_id}/variables/,

204GET /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/,

205GET /project/{id}/playbook/, 207GET /project/{id}/playbook/{playbook_id}/,

208GET /project/{id}/template/, 209GET /project/{id}/template/{template_id}/,

211GET /project/{id}/variables/, 214GET /project/{id}/variables/{variables_id}/,

215POST /project/, 159POST /project/{id}/copy/, 162POST /project/{id}/execute_module/, 163POST /project/{id}/execute_playbook/,

163POST /project/{id}/history/{history_id}/cancel/,

166POST /project/{id}/inventory/, 168POST /project/{id}/inventory/file_import_inventory/,

169POST /project/{id}/inventory/import_inventory/,

169POST /project/{id}/inventory/{inventory_id}/copy/,

175POST /project/{id}/inventory/{inventory_id}/group/,

176POST /project/{id}/inventory/{inventory_id}/group/{group_id}/copy/,

179POST /project/{id}/inventory/{inventory_id}/group/{group_id}/set_owner/,

180POST /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/,

181POST /project/{id}/inventory/{inventory_id}/host/,

185POST /project/{id}/inventory/{inventory_id}/host/{host_id}/copy/,

188POST /project/{id}/inventory/{inventory_id}/host/{host_id}/set_owner/,

189POST /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/,

190POST /project/{id}/inventory/{inventory_id}/set_owner/,

193POST /project/{id}/inventory/{inventory_id}/variables/,

195POST /project/{id}/periodic_task/, 200POST /project/{id}/periodic_task/{periodic_task_id}/execute/,

204POST /project/{id}/periodic_task/{periodic_task_id}/variables/,

205POST /project/{id}/set_owner/, 209POST /project/{id}/sync/, 209POST /project/{id}/template/, 210POST /project/{id}/template/{template_id}/execute/,

213POST /project/{id}/variables/, 215PUT /project/{id}/, 160PUT /project/{id}/inventory/{inventory_id}/,

170PUT /project/{id}/inventory/{inventory_id}/group/{group_id}/,

178PUT /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/,

183PUT /project/{id}/inventory/{inventory_id}/host/{host_id}/,

187PUT /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/,

192PUT /project/{id}/inventory/{inventory_id}/variables/{variables_id}/,

196

HTTP Routing Table 293

Page 298: Read the DocsCONTENTS 1 Installation 3 1.1 Install from PyPI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.2 Install from docker

Polemarch Documentation, Release 1.8.2

PUT /project/{id}/periodic_task/{periodic_task_id}/,201

PUT /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/,206

PUT /project/{id}/template/{template_id}/,212

PUT /project/{id}/variables/{variables_id}/,216

DELETE /project/{id}/, 162DELETE /project/{id}/history/{history_id}/,

166DELETE /project/{id}/history/{history_id}/clear/,

167DELETE /project/{id}/inventory/{inventory_id}/,

171DELETE /project/{id}/inventory/{inventory_id}/group/{group_id}/,

179DELETE /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/,

184DELETE /project/{id}/inventory/{inventory_id}/host/{host_id}/,

188DELETE /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/,

193DELETE /project/{id}/inventory/{inventory_id}/variables/{variables_id}/,

197DELETE /project/{id}/periodic_task/{periodic_task_id}/,

203DELETE /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/,

207DELETE /project/{id}/template/{template_id}/,

213DELETE /project/{id}/variables/{variables_id}/,

217PATCH /project/{id}/, 161PATCH /project/{id}/inventory/{inventory_id}/,

171PATCH /project/{id}/inventory/{inventory_id}/group/{group_id}/,

178PATCH /project/{id}/inventory/{inventory_id}/group/{group_id}/variables/{variables_id}/,

183PATCH /project/{id}/inventory/{inventory_id}/host/{host_id}/,

187PATCH /project/{id}/inventory/{inventory_id}/host/{host_id}/variables/{variables_id}/,

192PATCH /project/{id}/inventory/{inventory_id}/variables/{variables_id}/,

196PATCH /project/{id}/periodic_task/{periodic_task_id}/,

202PATCH /project/{id}/periodic_task/{periodic_task_id}/variables/{variables_id}/,

206PATCH /project/{id}/template/{template_id}/,

212PATCH /project/{id}/variables/{variables_id}/,

216

/teamGET /team/, 217GET /team/{id}/, 219GET /team/{id}/user/, 221GET /team/{id}/user/{user_id}/, 223GET /team/{id}/user/{user_id}/settings/,

226POST /team/, 218POST /team/{id}/copy/, 220POST /team/{id}/set_owner/, 221POST /team/{id}/user/, 222POST /team/{id}/user/{user_id}/change_password/,

225POST /team/{id}/user/{user_id}/copy/,

226POST /team/{id}/user/{user_id}/settings/,

228PUT /team/{id}/, 219PUT /team/{id}/user/{user_id}/, 224DELETE /team/{id}/, 220DELETE /team/{id}/user/{user_id}/, 225DELETE /team/{id}/user/{user_id}/settings/,

230PATCH /team/{id}/, 220PATCH /team/{id}/user/{user_id}/, 224

/userGET /user/, 230GET /user/{id}/, 231GET /user/{id}/settings/, 234POST /user/, 231POST /user/{id}/change_password/, 233POST /user/{id}/copy/, 234POST /user/{id}/settings/, 236PUT /user/{id}/, 232DELETE /user/{id}/, 233DELETE /user/{id}/settings/, 238PATCH /user/{id}/, 233

294 HTTP Routing Table