Skip to content

Commit b85f07f

Browse files
committed
feat: dynamic server nomad calls
1 parent 8760618 commit b85f07f

File tree

176 files changed

+19973
-2035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+19973
-2035
lines changed

.vscode/rivet.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
{
77
"path": "../lib/bolt",
88
},
9+
{
10+
"path": "../svc",
11+
}
912
],
1013
}
File renamed without changes.
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name = "SERVERS_MUST_SPECIFY_ROUTING_TYPE"
3+
description = "Must specify routing type."
4+
http_status = 400
5+
---
6+
7+
# Must Specify Routing Type
8+
9+
Must specify either `game_guard` or `host` routing type.
10+
File renamed without changes.
File renamed without changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name = "SERVERS_SERVER_NOT_FOUND"
3+
description = "Server not found."
4+
http_status = 400
5+
---
6+
7+
# Server Not Found
8+
9+
Server not found for the given ID.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name = "SERVERS_UNSUPPORTED_HOST_PROTOCOL"
3+
description = "Unsupported host protocol."
4+
http_status = 400
5+
---
6+
7+
# Unsupported Host Protocol
8+
9+
Host protocol must use the TCP or UDP protocol.
10+

fern/definition/servers/servers.yml renamed to fern/definition/servers/__package__.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ imports:
55

66
service:
77
auth: true
8-
base-path: /servers/servers
8+
base-path: /servers
99
endpoints:
10+
get:
11+
path: "/{server_id}"
12+
method: GET
13+
docs: Gets a dynamic server.
14+
path-parameters:
15+
server_id:
16+
docs: The id of the server to destroy
17+
type: uuid
18+
response: GetServerResponse
1019
create:
1120
path: ""
1221
method: POST
@@ -34,20 +43,38 @@ service:
3443
response: DestroyServerResponse
3544

3645
types:
46+
GetServerResponse:
47+
properties:
48+
server: commons.Server
3749
CreateServerRequest:
3850
properties:
3951
datacenter:
4052
docs: The name ID of the datacenter
4153
type: string
4254
metadata: unknown
55+
image_id: uuid
56+
arguments: optional<list<string>>
57+
environment: optional<map<string, string>>
58+
network: CreateServerNetworkRequest
4359
resources: commons.Resources
4460
kill_timeout:
4561
docs: >-
4662
The duration to wait for in milliseconds before killing the server.
4763
This should be set to a safe default, and can be overridden during a
4864
DELETE request if needed.
4965
type: optional<long>
50-
runtime: commons.Runtime
66+
67+
CreateServerNetworkRequest:
68+
properties:
69+
mode: optional<commons.NetworkMode>
70+
ports: map<string, CreateServerPortRequest>
71+
72+
CreateServerPortRequest:
73+
properties:
74+
protocol: commons.PortProtocol
75+
server_port: optional<integer>
76+
routing: optional<commons.PortRouting>
77+
5178
CreateServerResponse:
5279
properties:
5380
server:

fern/definition/servers/common.yml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ types:
88
datacenter_id: uuid
99
cluster_id: uuid
1010
metadata: unknown
11+
image_id: uuid
12+
arguments: optional<list<string>>
13+
environment: optional<map<string, string>>
14+
network: Network
1115
resources: Resources
1216
kill_timeout:
1317
docs: >-
1418
The duration to wait for in milliseconds before killing the server.
1519
This should be set to a safe default, and can be overridden during a
1620
DELETE request if needed.
1721
type: optional<long>
18-
runtime: Runtime
1922
create_ts: long
2023
destroy_ts: optional<long>
2124

@@ -31,48 +34,40 @@ types:
3134
docs: The amount of memory in megabytes
3235
type: integer
3336

34-
Runtime:
35-
properties:
36-
docker: optional<DockerRuntime>
37-
38-
DockerRuntime:
39-
properties:
40-
image_id: uuid
41-
args: optional<list<string>>
42-
environment: optional<map<string, string>>
43-
network: DockerNetwork
44-
45-
DockerNetwork:
37+
Network:
4638
properties:
47-
mode: optional<DockerNetworkMode>
48-
ports: map<string, DockerPort>
39+
mode: optional<NetworkMode>
40+
ports: map<string, Port>
4941

50-
DockerNetworkMode:
42+
NetworkMode:
5143
enum:
5244
- bridge
5345
- host
5446

55-
DockerPort:
47+
Port:
5648
properties:
57-
port: optional<integer>
58-
routing: DockerPortRouting
49+
protocol: PortProtocol
50+
server_port: optional<integer>
51+
public_hostname: optional<string>
52+
public_port: optional<integer>
53+
routing: PortRouting
5954

60-
DockerPortRouting:
61-
properties:
62-
game_guard: optional<DockerGameGuardRouting>
63-
host: optional<DockerHostRouting>
64-
65-
DockerGameGuardRouting:
66-
properties:
67-
protocol: optional<GameGuardProtocol>
68-
69-
GameGuardProtocol:
55+
PortProtocol:
7056
enum:
7157
- http
7258
- https
7359
- tcp
7460
- tcp_tls
7561
- udp
7662

77-
DockerHostRouting:
78-
properties: {}
63+
PortRouting:
64+
properties:
65+
game_guard: optional<GameGuardRouting>
66+
host: optional<HostRouting>
67+
68+
GameGuardRouting:
69+
properties: {}
70+
71+
HostRouting:
72+
properties: {}
73+

0 commit comments

Comments
 (0)