create


Description

Create a new dynamic server.


Code Examples

# Write the request body to body.json before running
curl -X POST -d '@body.json' 'https://api.rivet.gg/games/{game_id}/environments/{environment_id}/servers'

Request Parameters

game_id

required path parameter

environment_id

required path parameter

Request Body

  • datacenter
    string
  • tags
    any value
  • runtime
    object
    • runtime.build
      string
    • runtime.arguments
      array of strings
    • runtime.environment
      union of empty object and string
  • network
    object
    • network.mode
      string
    • network.ports
      union of empty object and object
        • network.ports.protocol
          string
        • network.ports.internal_port
          number
        • network.ports.routing
          object
          • network.ports.routing.game_guard
            empty object
          • network.ports.routing.host
            empty object
  • resources
    object
    • resources.cpu
      number

      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.

    • resources.memory
      number

      The amount of memory in megabytes

  • lifecycle
    object
    • lifecycle.kill_timeout
      number

      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.


Response Body

  • server
    object

    The server that was created

    • server.id
      string
    • server.environment
      string
    • server.datacenter
      string
    • server.tags
      any value
    • server.runtime
      object
      • server.runtime.build
        string
      • server.runtime.arguments
        array of strings
      • server.runtime.environment
        union of empty object and string
    • server.network
      object
      • server.network.mode
        string
      • server.network.ports
        union of empty object and object
          • server.network.ports.protocol
            string
          • server.network.ports.internal_port
            number
          • server.network.ports.public_hostname
            string
          • server.network.ports.public_port
            number
          • server.network.ports.routing
            object
            • server.network.ports.routing.game_guard
              empty object
            • server.network.ports.routing.host
              empty object
    • server.resources
      object
      • server.resources.cpu
        number

        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.

      • server.resources.memory
        number

        The amount of memory in megabytes

    • server.lifecycle
      object
      • server.lifecycle.kill_timeout
        number

        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.

    • server.created_at
      number
    • server.started_at
      number
    • server.destroyed_at
      number