code: def post_task(task_data, task_uri='/tasks'):
      
      url = '{}/{}'.format(API_URL, task_uri.lstrip('/'))
  
      if isinstance(task_data, str):
          task_json = task_data
      else:
          task_json = json.dumps(task_data)
  
      resp = requests.post(url, data=task_json, headers=HEADERS, verify=GATE_CA_BUNDLE, cert=GATE_CLIENT_CERT)
      resp_json = resp.json()
  
      LOG.debug(resp_json)
  
      assert resp.ok, 'Spinnaker communication error: {0}'.format(resp.text)
  
      return resp_json['ref']
docs: Create Spinnaker Task.
  
      Args:
          task_data (str): Task JSON definition.
  
      Returns:
          str: Spinnaker Task ID.
  
      Raises:
          AssertionError: Error response from Spinnaker.