> This page is for version Latest (default).
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/fleet-intel/latest/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/fleet-intel/llms.txt.

# Get nodes overview and states

GET /v1/nodes

Get list of nodes with current state and overview. Use view=detail (default) for full response or view=basic for a lightweight nodeUUID + hostname/BMC identity list, including the optional OOB nodeName when OOB data is selected (see models.BasicNodesResponse). Detail responses include the preferred verification-check fields and the deprecated integrityCheck aliases for backward compatibility. All filter parameters are optional arrays - empty means no filter applied.

Reference: https://docs.nvidia.com/fleet-intel/api-explorer/nodes/get-v-1-nodes

## Request

### Query parameters

- `view` (enum, optional, default: detail) — View mode: 'detail' for full response (default) or 'basic' for nodeUUID + hostname + optional OOB nodeName + bmcMac/bmcIP only (lightweight query, does not support filtering or sorting by healthStatuses, verificationChecks, firmwareChecks, or agentStatuses).
  - Allowed values: `detail`, `basic`
- `dataSource` (enum, optional) — Select the in-band or OOB (BMC/Redfish) data source. Returns only nodes enrolled through that source. nodeName is OOB-specific metadata and is absent from in-band responses. In the OOB view, nodes expose collectorVersion, nodeName, bmcMac/bmcIP, optional gpuType/gpuCount and BMC-based verification, while publicIP/privateIP/kernelVersion/gpuDriverVersion/gpuFirmwareVersions are empty. Empty defaults to the in-band view for view=detail; for view=basic, omitting both dataSource and agentType returns a combined view that merges OOB and in-band identity.
  - Allowed values: `inband`, `oob`
- `agentType` (enum, optional, deprecated) — Deprecated: use dataSource. Alias for selecting the in-band or OOB data source; when both parameters are supplied, their values must match.
  - Allowed values: `inband`, `oob`
- `page` (integer, optional, default: 0) — Page number (0-indexed)
- `pageSize` (integer, optional, default: 10) — Page size
- `nodeUUIDs` (list of string, optional) — Filter by specific node UUIDs. Empty means all nodes
- `agentUUIDs` (list of string, optional) — Exact, case-sensitive match against agent-reported UUIDs. Repeat the parameter to match any supplied value. Applies to in-band and active in-band identities in the combined basic view; rejected for dataSource=oob. Omitted or empty array means no filter.
- `systemUUIDs` (list of string, optional) — Match any supplied system UUID in the selected source inventory: in-band system UUID or any OOB system UUID. Combined basic view matches either active source. Repeat the parameter for multiple values. Omitted or empty array means no filter.
- `healthStatuses` (list of enum, optional) — Filter by health status values
  - Allowed values: `Healthy`, `Degraded`, `Unhealthy`, `Unknown`
- `computeZoneIds` (list of string, optional) — Filter by computezone IDs. Empty means all computezones
- `computeZoneNames` (list of string, optional) — Filter by computezone names (partial match). Empty means all computezones
- `nodeGroupIds` (list of string, optional) — Filter by nodegroup IDs. Empty means all nodegroups
- `nodeGroupNames` (list of string, optional) — Filter by nodegroup names (partial match). Empty means all nodegroups
- `gpuTypes` (list of string, optional) — Filter by GPU type values from the selected source, or the shared GPU info in combined basic view. Empty means all GPU types.
- `gpuCounts` (list of integer, optional) — Filter by GPU count values from the selected source, or the shared GPU info in combined basic view. Empty means all GPU counts.
- `publicIPs` (list of string, optional) — Filter by public IP addresses in the in-band view. Empty means all public IPs; rejected for OOB and combined views.
- `privateIPs` (list of string, optional) — Filter by private IP addresses in the in-band view. Empty means all private IPs; rejected for OOB and combined views.
- `verificationChecks` (list of enum, optional) — Filter by verification-check status. Verified matches every passed result (Full Attestation, Partial Attestation, Verified) and Unverified every failed result (Verification Failed, Unverified). Takes precedence when both verificationChecks and deprecated integrityChecks are supplied.
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `integrityChecks` (list of enum, optional, deprecated) — Deprecated: use verificationChecks.
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `firmwareChecks` (list of enum, optional) — Filter by firmware check status
  - Allowed values: `Passed`, `Failed`, `Unknown`
- `agentStatuses` (list of enum, optional) — Filter by agent status for the selected dataSource. Healthy liveness is Online; every other, missing, or unrecognized liveness value is Offline.
  - Allowed values: `Online`, `Offline`
- `search` (string, optional) — Case-insensitive substring search across nodeUUID and source-appropriate node identity fields. Searches nodeUUID or hostname for dataSource=inband; nodeUUID, nodeName, or bmcMac for dataSource=oob; and nodeUUID plus all three identities for the combined basic view (view=basic with both source parameters omitted). Leading and trailing whitespace is ignored; blank means no search.
- `hostname` (string, optional) — Filter by the in-band OS hostname (case-insensitive partial match). Applies to the in-band view and to active in-band identities in the combined basic view; rejected for dataSource=oob.
- `nodeName` (string, optional) — Filter by the configured node name (case-insensitive partial match). Applies to the OOB view (dataSource=oob) and the combined basic view; rejected for the in-band view.
- `bmcMac` (string, optional) — Filter by BMC MAC identifier (case-insensitive partial match). Applies to the OOB view (dataSource=oob) and the combined basic view; rejected for the in-band view.
- `sortBy` (enum, optional, default: hostname) — Field to sort by. Use verificationCheck; integrityCheck remains a deprecated alias. Defaults to hostname (in-band view) or bmcMac (OOB view). nodeName and bmcMac apply only to OOB-capable views; the in-band-only GPU firmware/kernel/driver/agentVersion keys apply only to the in-band view. Combined basic view supports only hostname, nodeName, bmcMac, nodeUUID, nodeGroup, computeZone, gpuType, and gpuCount, matching its filterable fields. A key not valid for the selected dataSource is rejected. gpuFirmwareVersions pins nodes whose GPUs have mismatched vbios versions to the top, then sorts the remaining (uniform) nodes by that common vbios in the requested order.
  - Allowed values: `hostname`, `nodeName`, `nodeUUID`, `healthStatus`, `nodegroup`, `computezone`, `gpuType`, `gpuCount`, `verificationCheck`, `integrityCheck`, `agentStatus`, `agentVersion`, `kernelVersion`, `gpuDriverVersion`, `gpuFirmwareVersions`, `bmcMac`
- `order` (enum, optional, default: asc) — Sort order (asc, desc)
  - Allowed values: `asc`, `desc`

## Response

### 200

Basic view response (view=basic)

- `nodes_getV1Nodes_Response_200`
  - models.InbandNodesResponse: models.InbandNodesResponse
  - models.OobNodesResponse: models.OobNodesResponse
  - models.BasicNodesResponse: models.BasicNodesResponse

## Errors

### 400 Bad Request Error

Bad Request

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 401 Unauthorized Error

Unauthorized

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 403 Forbidden Error

Forbidden - UAM authorization denied

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 499 Client Closed Request Error

Client Closed Request - request was canceled by the client

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 500 Internal Server Error

Internal Server Error

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

### 503 Service Unavailable Error

Service Unavailable

- `details` (string, optional) — Detailed error information
- `error` (string, optional) — Error message or type
- `requestStatus` (models.KASRequestStatus, optional) — RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

## Types

### models.InbandNodesResponse

- `hasMore` (boolean, optional)
- `nodes` (list of models.InbandNode, optional)
- `page` (integer, optional)
- `pageSize` (integer, optional)
- `total` (integer, optional)

### models.OobNodesResponse

- `hasMore` (boolean, optional)
- `nodes` (list of models.OobNode, optional)
- `page` (integer, optional)
- `pageSize` (integer, optional)
- `total` (integer, optional)

### models.BasicNodesResponse

- `hasMore` (boolean, optional)
- `nodes` (list of models.SimpleNode, optional)
- `page` (integer, optional)
- `pageSize` (integer, optional)
- `total` (integer, optional)

### models.KASRequestStatus

RequestStatus contains KAS-specific error details This is added to reflect the field in OpenAPI docs for UI reference and not populated by our code If KAS returns an error, the request will not be forwarded to the backend

- `requestId` (string, optional) — Request ID for tracing
- `statusCode` (string, optional) — Status code from KAS
- `statusDescription` (string, optional) — Status description from KAS

### models.InbandNode

- `dataSource` (string, required)
- `nodeUUID` (string, required)
- `agentStatus` (enum, optional)
  - Allowed values: `Online`, `Offline`
- `agentUUID` (string, optional)
- `agentVersion` (string, optional)
- `computeZone` (string, optional)
- `firmwareCheck` (enum, optional)
  - Allowed values: `Passed`, `Failed`, `Unknown`
- `gpuCount` (integer, optional)
- `gpuDriverVersion` (string, optional)
- `gpuFirmwareVersions` (list of models.GPUFirmwareVersion, optional)
- `gpuType` (string, optional)
- `healthStatus` (enum, optional)
  - Allowed values: `Healthy`, `Degraded`, `Unhealthy`, `Unknown`, `Unsupported`, `Pending`
- `hostname` (string, optional)
- `kernelVersion` (string, optional)
- `lastUpdatedTS` (string, optional)
- `lastVerificationCheckTS` (string, optional)
- `nodeGroup` (string, optional)
- `privateIP` (string, optional)
- `publicIP` (string, optional)
- `verificationCheck` (enum, optional)
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `verificationCheckExtraInfo` (models.VerificationCheckExtraInfo, optional)
- `verificationCheckReason` (string, optional)
- `agentType` (string, optional, deprecated) — Deprecated: use dataSource.
- `integrityCheck` (enum, optional, deprecated) — Deprecated: use verificationCheck.
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `integrityCheckExtraInfo` (models.IntegrityCheckExtraInfo, optional, deprecated) — Deprecated: use verificationCheckExtraInfo.
- `integrityCheckReason` (string, optional, deprecated) — Deprecated: use verificationCheckReason.
- `lastIntegrityCheckTS` (string, optional, deprecated) — Deprecated: use lastVerificationCheckTS.

### models.OobNode

- `dataSource` (string, required)
- `nodeUUID` (string, required)
- `agentStatus` (enum, optional)
  - Allowed values: `Online`, `Offline`
- `bmcIP` (string, optional)
- `bmcMac` (string, optional) — BMC MAC identifier from collector source.mac; may be empty.
- `collectorVersion` (string, optional)
- `computeZone` (string, optional)
- `gpuCount` (integer, optional)
- `gpuType` (string, optional)
- `healthStatus` (enum, optional)
  - Allowed values: `Healthy`, `Degraded`, `Unhealthy`, `Unknown`, `Unsupported`, `Pending`
- `lastUpdatedTS` (string, optional)
- `lastVerificationCheckTS` (string, optional)
- `nodeGroup` (string, optional)
- `nodeKind` (enum, optional, default: unknown)
  - Allowed values: `unknown`, `compute`, `nvswitch`, `power_shelf`
- `nodeName` (string, optional) — NodeName is the optional machine name configured on the OOB collector.
- `verificationCheck` (enum, optional)
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `verificationCheckExtraInfo` (models.VerificationCheckExtraInfo, optional)
- `verificationCheckReason` (string, optional)
- `agentType` (string, optional, deprecated) — Deprecated: use dataSource.
- `integrityCheck` (enum, optional, deprecated) — Deprecated: use verificationCheck.
  - Allowed values: `Full Attestation`, `Partial Attestation`, `Verification Failed`, `Verified`, `Unverified`, `Degraded`, `Pending`, `Unsupported`, `Unknown`
- `integrityCheckExtraInfo` (models.IntegrityCheckExtraInfo, optional, deprecated) — Deprecated: use verificationCheckExtraInfo.
- `integrityCheckReason` (string, optional, deprecated) — Deprecated: use verificationCheckReason.
- `lastIntegrityCheckTS` (string, optional, deprecated) — Deprecated: use lastVerificationCheckTS.

### models.SimpleNode

- `nodeUUID` (string, required)
- `agentUUID` (string, optional)
- `bmcIP` (string, optional)
- `bmcMac` (string, optional) — BMC MAC identifier from collector source.mac; may be empty.
- `hostname` (string, optional)
- `nodeName` (string, optional) — NodeName is OOB collector metadata. It is populated for OOB and combined basic views and omitted from an explicitly in-band basic response.

### models.GPUFirmwareVersion

- `firmwareVersion` (string, optional)
- `gpuIndex` (string, optional)

### models.VerificationCheckExtraInfo

- `ear` (ModelsVerificationCheckExtraInfoEar, optional) — EAR is the attestation result issued by the attestation service; only node details returns it.
- `errorDetails` (string, optional)
- `gpuEvidencePresent` (boolean, optional)
- `gpuResults` (map from string to models.JWTClaims, optional) — Per-GPU NRAS v4 claims. Set only by the NRAS v4 service; the full-attest service sets policy and ear.
- `nrasCallResult` (string, optional)
- `overallAttestationResult` (boolean, optional)
- `policy` (models.VerificationPolicy, optional) — Policy is the verification policy's decision on the attestation result.

### models.IntegrityCheckExtraInfo

Deprecated: use VerificationCheckExtraInfo.

- `ear` (ModelsIntegrityCheckExtraInfoEar, optional) — EAR is the attestation result issued by the attestation service; only node details returns it.
- `errorDetails` (string, optional)
- `gpuEvidencePresent` (boolean, optional)
- `gpuResults` (map from string to models.JWTClaims, optional) — Per-GPU NRAS v4 claims. Set only by the NRAS v4 service; the full-attest service sets policy and ear.
- `nrasCallResult` (string, optional)
- `overallAttestationResult` (boolean, optional)
- `policy` (models.VerificationPolicy, optional) — Policy is the verification policy's decision on the attestation result.

### ModelsVerificationCheckExtraInfoEar

EAR is the attestation result issued by the attestation service; only node details returns it.

### models.JWTClaims

- `eat_nonce` (string, optional)
- `exp` (integer, optional)
- `hwmodel` (string, optional) — Hardware info
- `iat` (integer, optional)
- `iss` (string, optional) — Standard JWT claims
- `jti` (string, optional)
- `measres` (string, optional)
- `nbf` (integer, optional)
- `sub` (string, optional)
- `ueid` (string, optional)
- `x-nvidia-attestation-warning` (string, optional)
- `x-nvidia-error-details` (list of models.NRASErrorDetail, optional)
- `x-nvidia-gpu-arch-check` (boolean, optional) — NVIDIA attestation claims - GPU specific
- `x-nvidia-gpu-attestation-report-cert-chain` (models.CertChainStatus, optional)
- `x-nvidia-gpu-attestation-report-nonce-match` (boolean, optional)
- `x-nvidia-gpu-attestation-report-parsed` (boolean, optional)
- `x-nvidia-gpu-attestation-report-signature-verified` (boolean, optional)
- `x-nvidia-gpu-vbios-rim-fetched` (boolean, optional)
- `x-nvidia-gpu-vbios-rim-measurements-available` (boolean, optional)
- `x-nvidia-gpu-vbios-version` (string, optional)
- `x-nvidia-mismatch-measurement-records` (list of any, optional)
- `x-nvidia-overall-att-result` (boolean, optional) — NVIDIA attestation claims - overall result (for overall JWT)

### models.VerificationPolicy

Policy is the verification policy's decision on the attestation result.

- `approved` (boolean, optional)
- `denials` (list of string, optional) — Denials lists why the policy rejected the attestation result.
- `gpus` (map from string to models.VerificationPolicyVerdict, optional)
- `policyVersion` (string, optional) — PolicyVersion identifies the policy revision that produced the verdict.
- `reason` (string, optional) — Reason explains the verdict; for tier 3 it is the policy's failure detail.
- `tier` (enum, optional) — Tier 1 passed every check, 2 passed without a reference integrity manifest (RIM), 3 was rejected.
  - Allowed values: `1`, `2`, `3`

### ModelsIntegrityCheckExtraInfoEar

EAR is the attestation result issued by the attestation service; only node details returns it.

### models.NRASErrorDetail

- `code` (integer, optional)
- `description` (string, optional)
- `fieldName` (string, optional)
- `httpStatus` (string, optional)
- `message` (string, optional)

### models.CertChainStatus

- `x-nvidia-cert-expiration-date` (string, optional)
- `x-nvidia-cert-ocsp-nonce-matches` (boolean, optional)
- `x-nvidia-cert-ocsp-response-valid` (boolean, optional)
- `x-nvidia-cert-ocsp-status` (string, optional)
- `x-nvidia-cert-revocation-reason` (string, optional)
- `x-nvidia-cert-status` (string, optional)

### models.VerificationPolicyVerdict

- `approved` (boolean, optional)
- `denials` (list of string, optional) — Denials lists why the policy rejected the attestation result.
- `reason` (string, optional) — Reason explains the verdict; for tier 3 it is the policy's failure detail.
- `tier` (enum, optional) — Tier 1 passed every check, 2 passed without a reference integrity manifest (RIM), 3 was rejected.
  - Allowed values: `1`, `2`, `3`

## Examples

**Response**

```json
{
  "hasMore": false,
  "nodes": [
    {
      "agentStatus": "Online",
      "agentType": "inband",
      "agentUUID": "550e8400-e29b-41d4-a716-446655440000",
      "agentVersion": "1.2.3",
      "computeZone": "compute-zone-1",
      "dataSource": "inband",
      "firmwareCheck": "Passed",
      "gpuCount": 4,
      "gpuDriverVersion": "550.120",
      "gpuFirmwareVersions": [
        {
          "firmwareVersion": "90.17.A9.00.0B",
          "gpuIndex": "0"
        }
      ],
      "gpuType": "NVIDIA-T400-4GB",
      "healthStatus": "Healthy",
      "hostname": "node-001",
      "integrityCheck": "Full Attestation",
      "integrityCheckExtraInfo": {
        "ear": {},
        "errorDetails": "SDK error: code=13, message=nonce refresh failed",
        "gpuEvidencePresent": true,
        "gpuResults": {},
        "nrasCallResult": "tier 3: failure: gpu_0: eat_nonce does not match the issued nonce",
        "overallAttestationResult": false,
        "policy": {
          "approved": true,
          "denials": [
            "gpu_0: eat_nonce does not match the issued nonce"
          ],
          "gpus": {},
          "policyVersion": "sha256:30e2195f32ba54652ed7b5a09da49edbb97274aa4aebb9dddc6d9f2662ba3b23",
          "reason": "This GPU passed the verification check. Evidence signature, nonce, certificate chain, and revocation status (OCSP) were verified. The reference integrity manifest (RIM) for this GPU's firmware is not yet available, so firmware measurements were not compared against it.",
          "tier": 2
        }
      },
      "integrityCheckReason": "Attestation verification unavailable: SDK error",
      "kernelVersion": "6.8.0-49-generic",
      "lastIntegrityCheckTS": "2024-01-15T10:30:00Z",
      "lastUpdatedTS": "2024-01-15T10:30:00Z",
      "lastVerificationCheckTS": "2024-01-15T10:30:00Z",
      "nodeGroup": "node-group-1",
      "nodeUUID": "node-123",
      "privateIP": "10.0.0.100",
      "publicIP": "203.0.113.100",
      "verificationCheck": "Full Attestation",
      "verificationCheckExtraInfo": {
        "ear": {},
        "errorDetails": "SDK error: code=13, message=nonce refresh failed",
        "gpuEvidencePresent": true,
        "gpuResults": {},
        "nrasCallResult": "tier 3: failure: gpu_0: eat_nonce does not match the issued nonce",
        "overallAttestationResult": false,
        "policy": {
          "approved": true,
          "denials": [
            "gpu_0: eat_nonce does not match the issued nonce"
          ],
          "gpus": {},
          "policyVersion": "sha256:30e2195f32ba54652ed7b5a09da49edbb97274aa4aebb9dddc6d9f2662ba3b23",
          "reason": "This GPU passed the verification check. Evidence signature, nonce, certificate chain, and revocation status (OCSP) were verified. The reference integrity manifest (RIM) for this GPU's firmware is not yet available, so firmware measurements were not compared against it.",
          "tier": 2
        }
      },
      "verificationCheckReason": "Attestation verification unavailable: SDK error"
    }
  ],
  "page": 0,
  "pageSize": 10,
  "total": 100
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/nodes"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/nodes';
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/v1/nodes"

	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/v1/nodes")

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/v1/nodes")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/nodes');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/nodes");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/nodes")! 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()
```