-
Notifications
You must be signed in to change notification settings - Fork 134
feat(svc): add servers create endpoint #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,5 +6,8 @@ | |
| { | ||
| "path": "../lib/bolt", | ||
| }, | ||
| { | ||
| "path": "../svc", | ||
| } | ||
| ], | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name = "SERVERS_MULTIPLE_PORT_ROUTERS" | ||
| description = "Multiple server port routers were provided." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # Multiple Server Port Routers | ||
|
|
||
| Multiple server port routers were provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name = "SERVERS_MULTIPLE_RUNTIMES" | ||
| description = "Multiple server runtimes were provided." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # Multiple Server Runtimes | ||
|
|
||
| Multiple server runtimes were provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| name = "SERVERS_MUST_SPECIFY_ROUTING_TYPE" | ||
| description = "Must specify routing type." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # Must Specify Routing Type | ||
|
|
||
| Must specify either `game_guard` or `host` routing type. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name = "SERVERS_NO_PORT_ROUTERS" | ||
| description = "No port routers were provided." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # No Port Routers | ||
|
|
||
| No port routers were provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name = "SERVERS_NO_RUNTIME" | ||
| description = "No server runtime were provided." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # No Server Runtime | ||
|
|
||
| No server runtime were provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| name = "SERVERS_SERVER_NOT_FOUND" | ||
| description = "Server not found." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # Server Not Found | ||
|
|
||
| Server not found for the given ID. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| name = "SERVERS_UNSUPPORTED_HOST_PROTOCOL" | ||
| description = "Unsupported host protocol." | ||
| http_status = 400 | ||
| --- | ||
|
|
||
| # Unsupported Host Protocol | ||
|
|
||
| Host protocol must use the TCP or UDP protocol. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| imports: | ||
| commons: common.yml | ||
|
|
||
| service: | ||
| auth: true | ||
| base-path: /servers | ||
| endpoints: | ||
| get: | ||
| path: /{server_id} | ||
| method: GET | ||
| docs: Gets a dynamic server. | ||
| path-parameters: | ||
| server_id: | ||
| docs: The id of the server to destroy | ||
| type: uuid | ||
| response: GetServerResponse | ||
|
|
||
| create: | ||
| path: "" | ||
| method: POST | ||
| docs: Create a new dynamic server. | ||
| request: | ||
| body: CreateServerRequest | ||
| response: CreateServerResponse | ||
|
|
||
| destroy: | ||
| path: /{server_id} | ||
| method: DELETE | ||
| docs: Destroy a dynamic server. | ||
| path-parameters: | ||
| server_id: | ||
| docs: The id of the server to destroy | ||
| type: uuid | ||
| request: | ||
| name: DestroyServerRequest | ||
| query-parameters: | ||
| override_kill_timeout: | ||
| docs: >- | ||
| The duration to wait for in milliseconds before killing the server. | ||
| This should be used to override the default kill timeout if a faster | ||
| time is needed, say for ignoring a graceful shutdown. | ||
| type: optional<long> | ||
| response: DestroyServerResponse | ||
|
|
||
| list: | ||
| path: /list | ||
| method: GET | ||
| docs: >- | ||
| Lists all servers associated with the token used. Can be filtered by | ||
| tags in the query string. | ||
| request: | ||
| name: GetServersRequest | ||
| query-parameters: | ||
| tags: optional<string> | ||
| response: ListServersResponse | ||
|
|
||
| types: | ||
| GetServerResponse: | ||
| properties: | ||
| server: commons.Server | ||
|
|
||
| CreateServerRequest: | ||
| properties: | ||
| datacenter: | ||
| docs: The name ID of the datacenter | ||
| type: string | ||
| tags: unknown | ||
| image_id: uuid | ||
| arguments: optional<list<string>> | ||
| environment: optional<map<string, string>> | ||
| network: CreateServerNetworkRequest | ||
| resources: commons.Resources | ||
| kill_timeout: | ||
| docs: >- | ||
| The duration to wait for in milliseconds before killing the server. | ||
| This should be set to a safe default, and can be overridden during a | ||
| DELETE request if needed. | ||
| type: optional<long> | ||
| webhook_url: | ||
| docs: >- | ||
| A url to send to which events from the server running will be sent | ||
| type: optional<string> | ||
|
|
||
| CreateServerNetworkRequest: | ||
| properties: | ||
| mode: optional<commons.NetworkMode> | ||
| ports: map<string, CreateServerPortRequest> | ||
|
|
||
| CreateServerPortRequest: | ||
| properties: | ||
| protocol: commons.PortProtocol | ||
| internal_port: optional<integer> | ||
| routing: optional<commons.PortRouting> | ||
|
|
||
| CreateServerResponse: | ||
| properties: | ||
| server: | ||
| docs: The server that was created | ||
| type: commons.Server | ||
|
|
||
| DestroyServerResponse: | ||
| properties: | ||
| server_id: | ||
| type: uuid | ||
|
|
||
| ListServersResponse: | ||
| properties: | ||
| servers: | ||
| docs: A list of servers for the game associated with the token. | ||
| type: list<commons.Server> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json | ||
|
|
||
| imports: | ||
| commons: ../common.yml | ||
| uploadCommons: ../upload/common.yml | ||
| cloudCommons: ../cloud/common.yml | ||
|
|
||
| service: | ||
| auth: true | ||
| base-path: /servers | ||
| endpoints: | ||
| listBuilds: | ||
| path: /builds | ||
| method: GET | ||
| docs: >- | ||
| Lists all builds of the game associated with the token used. Can be | ||
| filtered by tags in the query string. | ||
| request: | ||
| name: GetBuildsRequest | ||
| query-parameters: | ||
| tags: optional<string> | ||
| response: ListBuildsResponse | ||
|
|
||
| prepareBuild: | ||
| path: /builds | ||
| method: POST | ||
| docs: Creates a new game build for the given game. | ||
| request: | ||
| body: CreateBuildRequest | ||
| response: CreateBuildResponse | ||
|
|
||
| completeBuild: | ||
| path: /uploads/{upload_id}/complete | ||
| method: POST | ||
| docs: Marks an upload as complete. | ||
| path-parameters: | ||
| upload_id: | ||
| type: uuid | ||
|
|
||
| types: | ||
| ListBuildsResponse: | ||
| properties: | ||
| builds: | ||
| docs: A list of builds for the game associated with the token. | ||
| type: list<cloudCommons.BuildSummary> | ||
|
|
||
| CreateBuildRequest: | ||
| properties: | ||
| display_name: commons.DisplayName | ||
| tags: unknown | ||
| image_tag: | ||
| docs: A tag given to the game build. | ||
| type: string | ||
| image_file: uploadCommons.PrepareFile | ||
| multipart_upload: | ||
| type: optional<boolean> | ||
| kind: optional<BuildKind> | ||
| compression: optional<BuildCompression> | ||
|
|
||
| CreateBuildResponse: | ||
| properties: | ||
| build_id: | ||
| type: uuid | ||
| upload_id: | ||
| type: uuid | ||
| image_presigned_request: optional<uploadCommons.PresignedRequest> | ||
| image_presigned_requests: optional<list<uploadCommons.PresignedRequest>> | ||
|
|
||
| BuildKind: | ||
| enum: | ||
| - value: docker_image | ||
| docs: Docker image archive generated by `docker save`. | ||
| - value: oci_bundle | ||
| docs: OCI-compliant bundle. | ||
|
|
||
| BuildCompression: | ||
| enum: | ||
| - value: none | ||
| docs: None compression. | ||
| - value: lz4 | ||
| docs: LZ4 compression. Use the minimum compression level. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json | ||
|
|
||
| types: | ||
| Server: | ||
| properties: | ||
| server_id: uuid | ||
| game_id: uuid | ||
| datacenter_id: uuid | ||
| cluster_id: uuid | ||
| tags: unknown | ||
| image_id: uuid | ||
| arguments: optional<list<string>> | ||
| environment: optional<map<string, string>> | ||
| network: Network | ||
| resources: Resources | ||
| kill_timeout: | ||
| docs: >- | ||
| The duration to wait for in milliseconds before killing the server. | ||
| This should be set to a safe default, and can be overridden during a | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DELETE request if needed. | ||
| type: optional<long> | ||
| create_ts: long | ||
| destroy_ts: optional<long> | ||
|
|
||
| Resources: | ||
| properties: | ||
| cpu: | ||
| docs: | | ||
| The number of CPU cores in millicores, or 1/1000 of a core. For example, | ||
| 1/8 of a core would be 125 millicores, and 1 core would be 1000 | ||
| millicores. | ||
| type: integer | ||
| memory: | ||
| docs: The amount of memory in megabytes | ||
| type: integer | ||
|
|
||
| Network: | ||
| properties: | ||
| mode: optional<NetworkMode> | ||
| ports: map<string, Port> | ||
|
|
||
| NetworkMode: | ||
| enum: | ||
| - bridge | ||
AngelOnFira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - host | ||
|
|
||
| Port: | ||
| properties: | ||
| protocol: PortProtocol | ||
| internal_port: optional<integer> | ||
| public_hostname: optional<string> | ||
| public_port: optional<integer> | ||
| routing: PortRouting | ||
|
|
||
| PortProtocol: | ||
| enum: | ||
| - http | ||
| - https | ||
| - tcp | ||
| - tcp_tls | ||
| - udp | ||
|
|
||
| PortRouting: | ||
| properties: | ||
| game_guard: optional<GameGuardRouting> | ||
| host: optional<HostRouting> | ||
|
|
||
| GameGuardRouting: | ||
| properties: {} | ||
|
|
||
| HostRouting: | ||
| properties: {} | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.