> This page is for version 0.7.3.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.8.0: https://docs.nvidia.com/nemo-helix/v0.8.0/llms.txt
> - 0.7.3: https://docs.nvidia.com/nemo-helix/v0.7.3/llms.txt
> - 0.7.2: https://docs.nvidia.com/nemo-helix/v0.7.2/llms.txt
> - 0.7.1: https://docs.nvidia.com/nemo-helix/v0.7.1/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo-helix/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo-helix/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo-helix/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo-helix/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo-helix/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo-helix/v0.3.0/llms.txt
> - 0.2.0: https://docs.nvidia.com/nemo-helix/v0.2.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server.

# Get Execution Profiles

GET /apis/jobs/v2/execution-profiles

Get all currently configured execution profiles.

Returns the capability-filtered merge from jobs config. In local standalone
the controller may prune the shared list further after registry boot; in
split topologies the API advertises its own merge result (not controller
process memory).

Reference: https://docs.nvidia.com/nemo-helix/documentation/reference/api-reference/jobs/get-execution-profiles-apis-jobs-v-2-execution-profiles-get

## Response

### 200

Successful Response

- `list of ApisJobsV2ExecutionProfilesGetResponsesContentApplicationJsonSchemaItems`

## Types

### ApisJobsV2ExecutionProfilesGetResponsesContentApplicationJsonSchemaItems

### DockerJobExecutionProfile

Execution configuration for a Docker Job. This is used to define the executor type, provider, profile, and any additional configuration required for the executor to run the job on Docker

- `config` (DockerJobExecutionProfileConfig, required) — Additional configuration for the docker executor
- `provider` (string, optional, default: cpu) — The compute provider for the executor, e.g., cpu, gpu
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("docker", optional, default: docker)

### KubernetesJobExecutionProfile

Execution configuration for a Kubernetes Job. This is used to define the executor type, provider, profile, and any additional configuration required for the executor to run the job on Kubernetes

- `config` (KubernetesJobExecutionProfileConfig, required) — Additional configuration for the kubernetes executor
- `provider` (string, optional, default: cpu) — The compute provider for the executor, e.g., cpu, gpu
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("kubernetes_job", optional, default: kubernetes_job)

### VolcanoJobExecutionProfile

Volcano Job Execution Profile

- `config` (VolcanoJobExecutionProfileConfig, required) — Additional configuration for the kubernetes executor
- `provider` (string, optional, default: cpu) — The compute provider for the executor, e.g., cpu, gpu
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("volcano_job", optional, default: volcano_job)

### SubprocessJobExecutionProfile

- `provider` ("subprocess", optional, default: subprocess)
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("subprocess", optional, default: subprocess)
- `config` (SubprocessJobExecutionProfileConfig, optional) — Additional configuration for the subprocess executor

### E2EJobExecutionProfile

Execution configuration for E2E testing. This backend auto-completes jobs without actually running containers, making tests fast and deterministic.

- `provider` (string, optional, default: cpu) — The compute provider for the executor, e.g., cpu, gpu
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("e2e", optional, default: e2e)
- `config` (JobExecutionProfileConfig, optional) — Configuration for the e2e test executor

### OpenShellJobExecutionProfile

Execution configuration for an OpenShell job.

- `config` (OpenShellJobExecutionProfileConfig, required) — Additional configuration for the OpenShell executor
- `provider` (string, optional, default: cpu) — The compute provider for the executor, e.g., cpu, gpu
- `profile` (string, optional, default: default) — The profile name for the executor, e.g., high_priority_a100, low_priority, etc.
- `backend` ("openshell", optional, default: openshell)

### DockerJobExecutionProfileConfig

Configuration for Docker Job execution profile.

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: true)
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.
- `storage` (DockerJobStorageConfig, optional) — Docker storage configuration
- `networking` (DockerJobNetworkConfig, optional) — Docker networking configuration

### KubernetesJobExecutionProfileConfig

Configuration for Kubernetes execution environment.

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: true)
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.
- `ttl_seconds_image_pull` (integer, optional, default: 600) — How long a pod may spend in image-pull backoff before the pull is treated as unrecoverable and the step fails naming the image. 0 disables it.
- `namespace` (string, optional) — Kubernetes namespace to submit the job to. If not set, it will be determined from the environment.
- `service_account_name` (string, optional, default: default) — Kubernetes service account name for job pods. Uses the Kubernetes default service account when set to 'default'.
- `tolerations` (list of map from string to any, optional) — Tolerations for the Kubernetes job pods.
- `node_selector` (map from string to string, optional) — Node selector for the Kubernetes job pods.
- `affinity` (map from string to any, optional) — Affinity for the Kubernetes job pods.
- `resources` (ComputeResources, optional) — Resource requests and limits for the Kubernetes job pods.
- `pod_security_context` (map from string to any, optional) — Pod security context for the Kubernetes job pods.
- `image_pull_secrets` (list of ImagePullSecret, optional) — Image pull secrets for the Kubernetes job pods.
- `job_metadata` (KubernetesObjectMetadata, optional) — Metadata to add to each job object in the Kubernetes job.
- `pod_metadata` (KubernetesObjectMetadata, optional) — Metadata to add to each pod in the Kubernetes job.
- `storage` (KubernetesJobStorageConfig, optional) — Storage configuration for the Kubernetes job pods.
- `num_gpus` (integer, optional, default: 1) — Number of GPUs to request for the job
- `scheduler_name` (string, optional, default: ) — The scheduler name to use for the pod spec. When non-empty, this value is applied to the pod's schedulerName field, enabling custom schedulers such as KAI Scheduler. Empty string omits schedulerName so the cluster default scheduler is used.
- `launcher_image` (string, optional, default: nvcr.io/nvidia/nemo-microservices/jobs-launcher:latest) — Container image that contains the jobs-launcher binary.
- `workload_identity` (KubernetesWorkloadIdentityConfig, optional) — Kubernetes workload identity configuration.

### VolcanoJobExecutionProfileConfig

Configuration for Volcano Job Execution Profile

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: true)
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.
- `ttl_seconds_image_pull` (integer, optional, default: 600) — How long a pod may spend in image-pull backoff before the pull is treated as unrecoverable and the step fails naming the image. 0 disables it.
- `namespace` (string, optional) — Kubernetes namespace to submit the job to. If not set, it will be determined from the environment.
- `service_account_name` (string, optional, default: default) — Kubernetes service account name for job pods. Uses the Kubernetes default service account when set to 'default'.
- `tolerations` (list of map from string to any, optional) — Tolerations for the Kubernetes job pods.
- `node_selector` (map from string to string, optional) — Node selector for the Kubernetes job pods.
- `affinity` (map from string to any, optional) — Affinity for the Kubernetes job pods.
- `resources` (ComputeResources, optional) — Resource requests and limits for the Kubernetes job pods.
- `pod_security_context` (map from string to any, optional) — Pod security context for the Kubernetes job pods.
- `image_pull_secrets` (list of ImagePullSecret, optional) — Image pull secrets for the Kubernetes job pods.
- `job_metadata` (KubernetesObjectMetadata, optional) — Metadata to add to each job object in the Kubernetes job.
- `pod_metadata` (KubernetesObjectMetadata, optional) — Metadata to add to each pod in the Kubernetes job.
- `storage` (KubernetesJobStorageConfig, optional) — Storage configuration for the Kubernetes job pods.
- `num_gpus` (integer, optional, default: 1) — Number of GPUs to request for the job
- `scheduler_name` (string, optional, default: volcano) — The scheduler name to use for the Volcano job.
- `launcher_image` (string, optional, default: nvcr.io/nvidia/nemo-microservices/jobs-launcher:latest) — Container image that contains the jobs-launcher binary.
- `workload_identity` (KubernetesWorkloadIdentityConfig, optional) — Kubernetes workload identity configuration.
- `queue` (string, optional, default: default) — The Volcano queue to submit the job to.
- `max_retry` (integer, optional, default: 0) — maxRetry indicates the maximum number of retries allowed by the job
- `plugins` (map from string to any, optional) — plugins indicates the plugins used by Volcano when the job is scheduled. We always add the pytorch plugin if more than one node.
- `enable_multi_node_networking` (boolean, optional, default: true) — Enable multi-node networking injection. Sets annotations to trigger Kyverno policy mutations.

### SubprocessJobExecutionProfileConfig

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: false) — Keep subprocess working directories by default so runs remain inspectable.
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.
- `working_directory` (string, optional, default: /tmp/nhx-subprocess-jobs) — Root directory for subprocess job state, config, storage, and logs.
- `graceful_shutdown_timeout_seconds` (integer, optional, default: 10) — How long to wait after SIGTERM before force killing the process group.

### JobExecutionProfileConfig

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: true)
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.

### OpenShellJobExecutionProfileConfig

Configuration for the OpenShell job execution profile. Schedules job steps as OpenShell sandboxes via the gateway gRPC API. The sandbox runs the jobs-launcher as its canonical main process (``SandboxSpec.command``), which fetches the step config from the platform (``jobs-launcher run --fetch-step-config``) and then runs the task command.

- `ttl_seconds_before_active` (integer, optional, default: 1800)
- `ttl_seconds_active` (integer, optional, default: 86400)
- `ttl_seconds_after_finished` (integer, optional, default: 3600)
- `cleanup_completed_jobs_immediately` (boolean, optional, default: true)
- `launcher_tool_path` (string, optional, default: /tools/jobs-launcher) — Path to the jobs launcher tool
- `default_task_image` (string, optional) — Default container image for job task pods. Used when a job step omits container.image. When unset, falls back to the platform CPU tasks image (platform.image_registry/nhx-tasks:platform.image_tag).
- `env` (map from string to string, optional) — Optional env vars applied to all jobs (e.g. HOME=/tmp). Keys must not conflict with platform-reserved names. Job steps may override these variables.
- `gateway_endpoint` (string, optional, default: http://127.0.0.1:17670) — OpenShell gateway endpoint as a URL (http://host:port or https://host:port). The gRPC target is the same host:port; http implies plaintext, https implies TLS.
- `workspace` (string, optional, default: default) — OpenShell gateway workspace that every sandbox RPC is scoped to. The gateway creates 'default'.
- `insecure` (boolean, optional) — Force plaintext (True) or TLS (False). When None, derived from the endpoint scheme.
- `tls` (OpenShellJobTLSConfig, optional) — mTLS material for an https gateway.
- `request_timeout_seconds` (integer, optional, default: 120) — Per-RPC deadline for control-plane calls (create/get/delete/list).
- `platform_egress` (OpenShellJobEgressConfig, optional) — Platform endpoint a job sandbox reaches directly. Drives the generated default sandbox policy and is injected into a policy_path policy as a mandatory egress rule. Set to null to grant the sandbox NO direct egress (breaks secrets fetch and OTLP log export).
- `policy_path` (string, optional) — Path to a hand-written OpenShell SandboxPolicy YAML applied to created sandboxes. When unset, a default-deny policy is generated from platform_egress plus the sandbox filesystem defaults.
- `image` (string, optional) — Sandbox image for job steps. When unset, falls back to the platform CPU tasks image (nhx-tasks); OpenShell needs the openshell variant (nhx-tasks-openshell).
- `default_entrypoint` (list of string, optional) — Entrypoint for job steps that do not declare one. The OpenShell supervisor ignores the image ENTRYPOINT, so the sandbox command must name the binary explicitly. When unset, defaults to the nhx-tasks entrypoint (/app/.venv/bin/nemo-helix).
- `egress_proxy` (string, optional) — HTTP proxy URL injected as HTTP_PROXY/HTTPS_PROXY for the sandbox workload. The docker driver gives sandboxes no network of their own: all egress goes through the supervisor's proxy at http://127.0.0.1:3128, which enforces the sandbox policy. The k8s driver fences with NetworkPolicies instead, so leave this unset there.

### DockerJobStorageConfig

Configuration for persistent storage in Docker jobs.

- `volume_name` (string, optional, default: nemo-jobs-storage) — Name of the Docker volume for persistent storage
- `volume_permissions_image` (string, optional, default: docker.io/library/busybox:stable) — Docker image used to set permissions on the volume
- `additional_volume_mounts` (list of DockerVolumeMount, optional) — List of additional Docker volume mounts for the job

### DockerJobNetworkConfig

- `job_container_network` (string, optional, default: host) — Docker network for the job container

### ComputeResources

Resource requirements matching k8s ResourceRequirements format.

- `requests` (ComputeResourceSpec, optional) — Minimum resources requested for the container.
- `limits` (ComputeResourceSpec, optional) — Maximum resources the container can use.
- `num_nodes` (integer, optional, default: 1) — Number of nodes to use.
- `num_gpus` (integer, optional) — Step requesting number of GPUs.
- `shm_size` (string, optional) — Shared memory (/dev/shm) size as a Kubernetes quantity (e.g. '1Gi', '4Gi'). Used for GPU and distributed-GPU job executors. When unset, defaults to 1Gi per allocated GPU.

### ImagePullSecret

Kubernetes image pull secret reference.

- `name` (string, required) — Kubernetes Secret name for pulling images

### KubernetesObjectMetadata

- `labels` (map from string to string, optional)
- `annotations` (map from string to string, optional)

### KubernetesJobStorageConfig

Configuration for persistent storage in Kubernetes jobs.

- `pvc_name` (string, optional, default: ) — Persistent Volume Claim Name to use for job storage.
- `volume_permissions_image` (string, optional, default: docker.io/library/busybox:stable) — Image used to set volume permissions
- `additional_volumes` (list of KubernetesVolume, optional) — Additional volumes to mount
- `additional_volume_mounts` (list of KubernetesVolumeMount, optional) — Additional volume mounts

### KubernetesWorkloadIdentityConfig

Kubernetes workload identity token projection configuration.

- `token_expiration_seconds` (integer, optional, default: 600) — Requested expirationSeconds for the projected service account token used as the workload identity subject token.
- `token_audience` (string, optional) — Audience for the projected service account token. Defaults to auth.oidc.workload.client_id, then 'nemo-helix'.

### OpenShellJobTLSConfig

mTLS material for an https OpenShell gateway. Unused for plaintext gateways.

- `ca_cert_path` (string, optional) — Path to the CA bundle that signed the gateway cert.
- `client_cert_path` (string, optional) — Path to the client certificate (mTLS).
- `client_key_path` (string, optional) — Path to the client private key (mTLS).

### OpenShellJobEgressConfig

The NeMo Helix endpoint a job sandbox must be able to reach directly. Becomes the platform egress rule in the generated sandbox policy. This shape is separate from the deployments plugin's ``HelixEgressConfig`` so the jobs service does not depend on that plugin; the values track it.

- `host` (string, optional, default: host.docker.internal) — Platform host reachable from inside a sandbox.
- `port` (integer, optional, default: 8080) — Platform port (the inference gateway / API listener).
- `protocol` (enum, optional, default: rest) — OpenShell L7 protocol: "rest", "websocket", "graphql", "sql", or "" for L4-only.
  - Allowed values: `rest`, `websocket`, `graphql`, `sql`, ``
- `tls` (enum, optional, default: ) — TLS handling: "" (default) for automatic inspection, "skip" to disable inspection.
  - Allowed values: ``, `skip`
- `access` (enum, optional, default: full) — OpenShell access preset: "read-only", "read-write", or "full".
  - Allowed values: `read-only`, `read-write`, `full`
- `binaries` (list of string, optional) — Binaries permitted to open the egress connection. Empty uses the backend default set, which must include the jobs-launcher and the task venv python.

### DockerVolumeMount

- `volume_name` (string, required) — Name of the Docker volume to mount
- `mount_path` (string, required) — Path inside the container where the volume will be mounted
- `kind` (enum, optional, default: volume) — Type of the Docker volume to mount. Options are 'volume' or 'tmpfs' (default: 'volume'). tmpfs volumes are only supported on Linux hosts.
  - Allowed values: `volume`, `tmpfs`
- `options` (map from string to any, optional) — Additional options for the volume
- `allow_create_volume` (boolean, optional, default: false) — Whether to allow the creation of the volume if it does not exist (default: false).

### ComputeResourceSpec

Resource specification.

- `cpu` (string, optional) — CPU specification (e.g., '250m', '1', '2.5').
- `memory` (string, optional) — Memory specification (e.g., '128Mi', '1Gi', '512M').

### KubernetesVolume

Kubernetes Volume definition with secret and config_map support.

### KubernetesVolumeMount

Kubernetes Volume Mount definition.

- `name` (string, required) — Volume Name
- `mount_path` (string, required) — Mount Path in the container
- `sub_path` (string, optional) — Sub-path within the volume to mount
- `read_only` (boolean, optional, default: false) — Whether the volume mount is read-only

### KubernetesVolume0

- `persistent_volume_claim` (any, required)

### KubernetesVolume1

- `empty_dir` (any, required)

### KubernetesVolume2

- `secret` (any, required)

### KubernetesVolume3

- `config_map` (any, required)

## Examples

**Response**

```json
[
  {
    "backend": "docker",
    "config": {
      "cleanup_completed_jobs_immediately": true,
      "default_task_image": "string",
      "env": {},
      "launcher_tool_path": "/tools/jobs-launcher",
      "networking": {
        "job_container_network": "host"
      },
      "storage": {
        "additional_volume_mounts": [
          {
            "allow_create_volume": false,
            "kind": "volume",
            "mount_path": "string",
            "options": {},
            "volume_name": "string"
          }
        ],
        "volume_name": "nemo-jobs-storage",
        "volume_permissions_image": "docker.io/library/busybox:stable"
      },
      "ttl_seconds_active": 86400,
      "ttl_seconds_after_finished": 3600,
      "ttl_seconds_before_active": 1800
    },
    "profile": "default",
    "provider": "cpu"
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/jobs/v2/execution-profiles"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/jobs/v2/execution-profiles';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/apis/jobs/v2/execution-profiles"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/apis/jobs/v2/execution-profiles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/apis/jobs/v2/execution-profiles")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/apis/jobs/v2/execution-profiles');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/jobs/v2/execution-profiles");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/jobs/v2/execution-profiles")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```