def GetCurlCommand(action, url, args=None):

  cmd = [
      FLAGS.curl_path,
      '--request', action,
      '--url', DIGITALOCEAN_API + url,
      '--include',
      '--silent',
  ]

  if action == 'GET':
    # Disable pagination
    cmd.extend(['--form', 'per_page=999999999'])

  if args is not None:
    cmd.extend([
        '--header', 'Content-Type: application/json',
        '--data', json.dumps(args, separators=(',', ':'))])

  return cmd
Issue one query and return a L{Deferred} which fires with its response.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/providers/digitalocean/util.py/GetCurlCommand--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/names/root.py/Resolver._query