Hi, I am trying to write a Python script that will source the IP address of a new machine and then add it as a node to a pool, I am really new to Python and still getting my head around it. So far this is what I have, at the moment I am just entering the IP address as a command line argument #!/usr/bin/python import requests import json import sys pool_name = sys.argv[1] add_node = sys.argv[2] url = ' https:// <URL>/' + pool_name jsontype = {'content-type': 'application/json'} client = requests.Session() client.auth = ('<username>', '<password>') client.verify = 0 response = client.get(url) pools = json.loads(response.content) nodes = pools['properties']['basic']['nodes'] pools['properties']['basic']['nodes'].append(add_node) client.put(url, <place I am stuck in>, headers = jsontype) As you can see I have got to the point where I have everything I want but am having trouble putting the updated array back to the REST API. If anyone can point me in the right direction that would be great. Thanks, Darren
... View more