2.6.11.2 Python

For this request, we must obtain the server ID object for the server to which we wish to present the repository. To achieve this, we use the get_id_from_name function that we defined in Obtaining the Server Pool ID Value.

...
servid=get_id_from_name(s,baseUri,'Server',"1.example.com")
uri='{base}/Repository/{rid}/present'.format(base=baseUri, rid=repo_id['value'])
r=s.put(uri,data=json.dumps(servid))
job=r.json()
# wait for the job to complete
wait_for_job(job['id']['uri'],s)