JavaScript
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const networkPolicyView = await client.networkPolicies.retrieve('id');
console.log(networkPolicyView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
network_policy_view = client.network_policies.retrieve(
"id",
)
print(network_policy_view.id)curl --request GET \
--url https://api.runloop.ai/v1/network-policies/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/network-policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/network-policies/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.runloop.ai/v1/network-policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/network-policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"egress": {
"allow_all": true,
"allow_devbox_to_devbox": true,
"allowed_hostnames": [
"<string>"
],
"allowed_cidrs": [
{
"cidr": "<string>",
"ports": [
{
"port": 123,
"end_port": 123,
"protocol": "TCP"
}
]
}
],
"allow_agent_gateway": true,
"allow_mcp_gateway": true,
"allow_runloop_mirrors": true
},
"create_time_ms": 123,
"update_time_ms": 123,
"description": "<string>"
}network-policies
Get a NetworkPolicy.
Get a specific NetworkPolicy by its unique identifier.
GET
/
v1
/
network-policies
/
{id}
JavaScript
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const networkPolicyView = await client.networkPolicies.retrieve('id');
console.log(networkPolicyView.id);import os
from runloop_api_client import Runloop
client = Runloop(
bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted
)
network_policy_view = client.network_policies.retrieve(
"id",
)
print(network_policy_view.id)curl --request GET \
--url https://api.runloop.ai/v1/network-policies/{id} \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.runloop.ai/v1/network-policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.runloop.ai/v1/network-policies/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.runloop.ai/v1/network-policies/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runloop.ai/v1/network-policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"egress": {
"allow_all": true,
"allow_devbox_to_devbox": true,
"allowed_hostnames": [
"<string>"
],
"allowed_cidrs": [
{
"cidr": "<string>",
"ports": [
{
"port": 123,
"end_port": 123,
"protocol": "TCP"
}
]
}
],
"allow_agent_gateway": true,
"allow_mcp_gateway": true,
"allow_runloop_mirrors": true
},
"create_time_ms": 123,
"update_time_ms": 123,
"description": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the NetworkPolicy.
Response
Successfully retrieved the NetworkPolicy.
A NetworkPolicy defines egress network access rules for devboxes. Policies can be applied to blueprints, devboxes, and snapshot resumes.
The unique identifier of the NetworkPolicy.
The human-readable name of the NetworkPolicy. Unique per account.
The egress rules for this policy.
Show child attributes
Show child attributes
The creation time of the NetworkPolicy (Unix timestamp in milliseconds).
Last update time of the NetworkPolicy (Unix timestamp in milliseconds).
Optional description of the NetworkPolicy.
Was this page helpful?
