How to create a service using Icinga Director API?

Hi all

I am using python script to create a host

hostname = socket.gethostname()
ip_addr = socket.gethostbyname(hostname)
master_host = get_master_host()
 director_query = {
       'object_name': hostname+"-"+opt+"-"+dru,
        "object_type": "object",
        "address": ip_addr,
        "imports": [hostname+"-opt-dru-host-template"],
        "display_name": "Remote " + dru[3:],
        "vars": {
            "opt": opt[3:],
            "dru": dru[3:]
    request_url = "http://"+master_host+"/director/host"
    headers = {
        'Accept': 'application/json',
        'X-HTTP-Method-Override': 'POST'
    q =,
                      auth=(director_api_login, director_api_password),

The documentation says you have to use /director/service in order to create a service but I cant undestand how. Can you give me an example for creating a service to the prevois host ?