Skip to main content
GET
/
vpc
/
security-groups
List security groups
curl --request GET \
  --url https://v1.api.altostrat.io/vpc/security-groups \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://v1.api.altostrat.io/vpc/security-groups"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://v1.api.altostrat.io/vpc/security-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/vpc/security-groups",
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://v1.api.altostrat.io/vpc/security-groups"

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://v1.api.altostrat.io/vpc/security-groups")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/vpc/security-groups")

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": "sec_grp_0ujsswThIGTUYm2K8FjOOfxcYpw",
    "name": "Default Web Servers",
    "description": "Allows inbound HTTP/HTTPS traffic from anywhere.",
    "status": "active",
    "sites": [],
    "rules": []
  },
  {
    "id": "sec_grp_0ujsswThIGTUYm2K8FjOOfxcYpz",
    "name": "Internal Management",
    "description": "Allows SSH and RDP from the main office prefix list.",
    "status": "syncing",
    "sites": [],
    "rules": []
  }
]
{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "The 'name' parameter is required for this request.",
"doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}

Authorizations

Authorization
string
header
required

Authentication is performed via an Auth0-issued JSON Web Token (JWT). Provide the token in the Authorization header with the Bearer scheme.

Response

A list of security groups.

id
string
read-only

The unique identifier for the security group, prefixed with sec_grp_.

Example:

"sec_grp_0ujsswThIGTUYm2K8FjOOfxcYpw"

name
string

A human-readable name for the security group.

Example:

"Default Web Servers"

description
string

An optional description for the security group, providing more context.

Example:

"Allows inbound HTTP/HTTPS traffic from anywhere."

status
enum<string>
read-only

The current synchronization status of the security group. syncing means changes are being deployed and the resource is locked from modification.

Available options:
active,
syncing,
failed
Example:

"active"

sites
string[]

A list of site IDs to which this security group is currently applied.

rules
object[]

An ordered list of firewall rules that define the security policy.