[ [ 'code' => 'DaemonConnectionException', 'status' => '504', 'detail' => 'Could not establish a connection to the machine running this server. Please try again.', ], ], ]; /** * Update the startup and environment settings for a specific server. * * @throws ValidationException * @throws DaemonConnectionException */ #[Endpoint('Update server startup', 'Updates startup command, image, egg, and environment variables for a server.')] #[ResponseFromResource(ServerResource::class, Server::class, factoryStates: ['withRelationships'], resourceKey: 'server')] #[ScribeResponse(self::DAEMON_CONNECTION_ERROR, status: 504, description: 'Wings could not be reached while syncing startup changes.')] public function index(UpdateServerStartupRequest $request, UpdatesServerStartup $modification, Server $server): ServerResource { $server = $modification->update($server, $request->actionInput(), User::USER_LEVEL_ADMIN); return ServerResource::make($server); } }