Logo
OpenScaler
API Documentation/Virtual Private Cloud (VPC)

List All VPC Resources

lists resources associated with given VPC

GET
/v1/vpcs/{vpc_id}/resources

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Path Parameters

vpc_idRequiredstring

A unique identifier for a VPC instance. See VPCs section for more details.

Query Parameters

resource_typestring

Resource type, one of :

  • vm (virtual machine)
  • db (database)
  • lb (load balancer)
Value in: "vm" | "db" | "lb"
summaryboolean

If set to true, the response will include a summary of number of resources per type.

Default: false
curl -X GET "https://api.alpha.openscaler.net/v1/vpcs/5/resources?resource_type=vm" \
  -H "Authorization: Bearer <token>"

VPC list based on requested filters

List of Resources in given VPC (NOTE: response in case of "summary" option is not documented yet it essentially returns something like this)

{
  "summary": {
    "vm": 2
    "db": 0,
    "lb": 0
  }
}

where each keys like vm and db etc. represent resource type and are omitted if count is 0.

{
  "resources": [
    {
      "resource_type": "vm",
      "resource_id": 1,
      "mac": "02:00:00:00:00:01",
      "private_ip": "10.0.2.2",
      "vpc_subnet": "10.0.2.0/24",
      "vpc_id": 2,
      "region": "alg1",
      "public_ip": "10.99.88.77",
      "public_ip_ports": [
        {
          "description": "SSH port for VM 35 (internal port 22)",
          "port": 9000,
          "internal_port": 22
        },
        {
          "description": "HTTP port for VM 35 (internal port 80)",
          "port": 9001,
          "internal_port": 80
        },
        {
          "description": "HTTPS port for VM 35 (internal port 443)",
          "port": 9002,
          "internal_port": 443
        }
      ]
    },
    {
      "resource_type": "vm",
      "resource_id": 2,
      "mac": "02:00:00:00:00:02",
      "private_ip": "10.0.2.3",
      "vpc_subnet": "10.0.2.0/24",
      "vpc_id": 2,
      "region": "alg1",
      "public_ip": "10.99.88.77",
      "public_ip_ports": [
        {
          "description": "SSH port for VM 36 (internal port 22)",
          "port": 9003,
          "internal_port": 22
        },
        {
          "description": "HTTP port for VM 36 (internal port 80)",
          "port": 9004,
          "internal_port": 80
        },
        {
          "description": "HTTPS port for VM 36 (internal port 443)",
          "port": 9005,
          "internal_port": 443
        }
      ]
    },
    {
      "resource_type": "vm",
      "resource_id": 3,
      "mac": "02:00:00:00:00:03",
      "private_ip": "10.0.2.4",
      "vpc_subnet": "10.0.2.0/24",
      "vpc_id": 2,
      "region": "alg1",
      "public_ip": "10.99.88.77",
      "public_ip_ports": [
        {
          "description": "SSH port for VM 37 (internal port 22)",
          "port": 9006,
          "internal_port": 22
        },
        {
          "description": "HTTP port for VM 37 (internal port 80)",
          "port": 9007,
          "internal_port": 80
        },
        {
          "description": "HTTPS port for VM 37 (internal port 443)",
          "port": 9008,
          "internal_port": 443
        }
      ]
    }
  ]
}