Skip to content

Content Tagged "python"

Page 1 of 5

Content Tagged "python"

Delete Executions in Rundeck - Wrapping it all Up

October 9, 2018Categories: IT, Software, Tutorial
The previous posts have built the components to allow us to get projects , jobs , executions and remove executions from a Rundeck instance via its API. Now, we can just wrap them up :) The list of packages we need is: For convenience, I've declared a bunch of constants we can use…

Remove Executions in Rundeck

October 8, 2018Categories: IT, Tutorial
TL;DR: You have to get the executions' list and remove the appropriate ones using hte API. Once we've managed to get the list of job executions , we can use the API to remove the relevant executions. The command is rather simple: This method requires: server - the Rundeck's server address port…

List Rundeck Jobs for a Project

September 6, 2018Categories: IT, Software, Tutorial
Now that we Rundeck have a list of project names , we might want to see which jobs were created for each project. To do this, we need: The Rundeck instance's address ( server , port ) The API key ( api_key ) A project's name ( project_name ) First, we need to get the list of jobs for a project…

List Rundeck Projects

September 6, 2018Categories: IT, Software, Tutorial
The other day I found out that Rundeck has an API which allows it to be controlled remotely by scripts. I've decided to write a script to list all the projects defined in a rundeck instance. Prerequisites Before you start, you need: The instance's URL ( server and port ) An api key for the…

Build Update Statements with Oracle SQL Developer and Python

June 18, 2018Categories: Software, Tutorial
By default, SQL Developer can only export INSERT statements. This is quite unfortunate when one needs to build UPDATE statements because their syntax is different. I've tried to use regexp to convert the statements but I didn't find it not straight forward at all. So, I cam up with the following…

Initialise Python with GoCD

November 10, 2017Categories: IT, Tutorial
Following the deployment of a python-aware agent , we can start creating a pipeline. The first stage would be to: Clean up any previous data Create a virtual environment for python Install all dependencies from a requirements.txt file in our project Note: we assume the global pipeline settings…

Create a Python-friendly GoCD Agent in Docker

November 10, 2017Categories: IT, Tutorial
I've got two requirements to make GoCD useful: Run both the server and agent(s) in Docker Make it python-friendly Fortunately, GoCD offers Docker images (and Dockerfile s) for both, so it's just a matter of extending it: Unfortunately, pip is not quite adequate, so we re-install it from source…

Handler for Global Logger in Python

October 11, 2017Categories: Software, Tutorial
While writing a command line tool, I've stumbled upon a strange situation: Some logs were written to a file while some others were printed to console . Quite annoying, particularly since every module I use has its own logger via logging.getLogger(__name__) . After some investigation I found out…

DRF: What is 'source' in Fields?

September 30, 2017Categories: Software, Tutorial
For a couple of days I've been trying to de-serialise a JSON to a model. My problem is the model and the JSON have different fields, mainly to keep the model pythonic and independent of a specific JSON source. So... I've been trying to use the source parameter for each Field in my serialiser to…

Timestamp to DateTime Serializer Field for DRF

September 29, 2017Categories: Software, Tutorial
I'm currently trying to deserialize JSON data to a Django model. This is quite straight forward for most numeric fields, but I have a DateTime field which is stored as a timestamp in the original JSON. At first, I thought I should read the timestamp as an integer and convert it through post…
Next

All tags