-
Notifications
You must be signed in to change notification settings - Fork 19
Home
This project includes a set of python scripts that leverage delphixpy module to interact with Delphix engines. To use these scripts, no knowledge of python or programming experience is required unless you wish to extend or modify these scripts.
In the most simplest answer, Delphix is an awesome software that allows you to provision full databases and applications anywhere (on-prem or cloud) in a matter of minutes. Delphix is far more than that, and you can learn more here
delphixpy is a python module created by Delphix to enable users to directly invoke the Delphix APIs using python.
delphixpy is available on PyPy, so you can install it by invoking pip
pip3 install delphixpy
Clone this repository to your system where python is installed. Then install the pip packages in the requirements.txt file as follows
pip3 install --upgrade -r requirements.txt
Once that is complete, you are ready to use the scripts with your Delphix environment. Each of the scripts have POSIX compliant help. The options are also explained along with examples.
Prerequisites
- python3 is required to run these scripts
- docopt to parse POSIX compliant help documentation as arguments
- delphixpy module to interact with the Delphix Engine APIs
The python scripts in this project read a configuration file in a JSON format. By default the scripts are looking for dxtools.conf file in under /config/ folder. A different configuration file can be specified by -configfile parameter.
Description of fields in dxtools.conf
- ip__address - Delphix appliance IP address or hostname
- hostname - Delphix identifier
- username - Delphix username
- password - Delphix username password
- port - Delphix Engine port number
- default - is this Delphix Engine, a default one - true | false
- protocol - what protocol will be used for communication - http|https
- timeout - API call timeout - default 60 sec
Default Engine In dxtools.conf file, the engine with "default":"true" is the default engine. At a time, there should only be one default engine.
Example
{
"myvirtualization":[
{
"hostname" : "myvirtualization",
"ip_address" : "10.0.1.20",
"username" : "admin",
"password" : "password123",
"port" : "80",
"default" : "false",
}
],
"mymasking":[
{
"hostname" : "mymasking",
"ip_address" : "10.0.1.50",
"username" : "admin",
"password" : "password123",
"port" : "80",
"default" : "true",
}
]
}
The scripts in this module can run an operation on one or all engines configured in configuration file. After successful connection using username and password to the Delphix Engine a session is saved for a future usage. Default expiration time for a session is set to 30 min and it's a Delphix Engine parameter.
- --engine enginename - Run the script for Delphix Engine specified by enginename
- --engine all - Run the script on all Delphix Engines in the dxtools.conf file
- --engine parameter not provided - Run the script on the default Delphix Engine
- -configfile file - Location of configuration file [ default: /config/dxtools.conf]
- -log file - Location of the log file including the file name [ default: /logs/scriptname.log]
- -single_thread - Run the operations synchronously or asynchronously on an engine
- -help - Display help
- -version - Display version
There are three groups of scripts in this project.
First group contains scripts to perform actions at the datasets (dsource or VDB) level. Examples are: Adding a dSource, Provisioning a VDB, Refreshing a VDB, etc.
Second group contains scripts to create and control Self Service objects (template or container). Examples are: Creating a container, Create a bookmark, etc.
Third group contains scripts to perform action on objects that are not datasets or containers. Examples are: Add an environment, Update an environment, etc
Runtime Logs: Every script will create a log file by the same name under the /logs/ directory.
Dataset Group:
- dx_provision_dsource.py - To create a dSource.
- dx_snapshot_db.py - To create a snapshot of a dSource or VDB
- dx_refresh_vdb.py - To refresh a VDB using snapshot or point in time
- dx_rewind_vdb.py - To rewind a VDB using snapshot or point in time
- dx_operations.py - To list, start, stop, enable, disable VDBs
- dx_delete_vdb.py - To delete a VDB or dSource
Self-Service Group:
- ss_template.py - To list, create, delete self service templates
- ss_container.py - To perform all container operations (excludes branch & bookmark)
- ss_bookmark.py - To perform all bookmark related operations
- ss_branch.py - To perform all branch related operations
Admin Group:
- dx_environment.py - To list, create, refresh, delete, update environments
A full list of scripts can be found in Inventory
To view additional details and usage examples for a script, click on the script name above or from the Inventory page