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);{
"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>"
}Get a specific NetworkPolicy by its unique identifier.
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);{
"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>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The unique identifier of the NetworkPolicy.
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
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?