Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions internal/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ info:
name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0
title: Cycle Internal API
description:
Inside every container running on Cycle, there is a Unix socket mounted at /var/run/cycle/api/api.sock. You can send HTTP requests over this socket to access information about the local environment, access secrets, and much more.
description: |
Inside every container running on Cycle, there is a Unix socket mounted at *`/var/run/cycle/api/api.sock`*. You can send HTTP requests over this socket to access information about the local environment, access secrets, and much more.
The way this internal API functions is very similar to how Cycle's main API works, though the purpose is different. The internal API is primarily used by instances to learn about their environment, and dynamically update as deployments change. In the future, we expect you'll be able to use the internal API to register service containers and much more.
The internal API returns identical JSON responses to the main API. There is also a websocket based API that you can tune into for streaming platform updates.
version: 1.0.0
Expand Down Expand Up @@ -103,6 +103,9 @@ paths:
$ref: paths/virtual-machine/virtual-machine.yml
/v1/virtual-machine/domains:
$ref: paths/virtual-machine/domains.yml
/v1/virtual-machine/gateways:
$ref: paths/virtual-machine/gateways.yml


# Object Cache
/v1/object-cache:
Expand Down
65 changes: 65 additions & 0 deletions internal/paths/virtual-machine/gateways.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
get:
operationId: "getVirtualMachineGateways"
summary: Get Virtual Machine Gateways
description: |
Returns a list of gateways applicable to the specified virtual machine.
tags:
- Virtual Machines
parameters:
- name: virtual-machine-id
in: query
required: true
description: The ID of the virtual machine.
schema:
type: string
responses:
default:
$ref: ../../../components/responses/errors/DefaultError.yml
200:
description: Returns a list of gateways applicable to the specified virtual machine.
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
items:
type: object
required:
- virtual_machine_id
- gateway_instance_id
properties:
virtual_machine_id:
$ref: ../../../components/schemas/ID.yml
gateway_instance_id:
$ref: ../../../components/schemas/ID.yml
ips:
type: array
items:
type: object
required:
- kind
- public_ip
properties:
kind:
type: string
description: The type of IP protocol this IP is.
enum:
- ipv4
- ipv6
public_ip:
type: string
description: The public IP attached to the gateway.
gateway_private_ip:
type:
- string
- "null"
description: The private IP of the gateway.
gateway_nat_ip:
type:
- string
- "null"
description: The NAT IP of the gateway.