Skip to main content
GET
/
v1
/
network-policies
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
});

// Automatically fetches more pages as needed.
for await (const networkPolicyView of client.networkPolicies.list()) {
  console.log(networkPolicyView.id);
}
{
  "network_policies": [
    {
      "id": "<string>",
      "name": "<string>",
      "egress": {
        "allow_all": true,
        "allow_devbox_to_devbox": true,
        "allowed_hostnames": [
          "<string>"
        ]
      },
      "create_time_ms": 123,
      "update_time_ms": 123,
      "description": "<string>"
    }
  ],
  "has_more": true,
  "total_count": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

name
string

Filter by name (partial match supported).

id
string

Filter by ID.

limit
integer<int32>

The limit of items to return. Default is 20. Max is 5000.

starting_after
string

Load the next page of data starting after the item with the given ID.

Response

Successfully retrieved list of NetworkPolicies.

A list of NetworkPolicies with pagination information.

network_policies
object[]
required

The list of NetworkPolicies.

has_more
boolean
required

Whether there are more results available.

total_count
integer<int32>
required

Total count of items in this response.