[ [ '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. * * * @return ApiPayload * * @throws ValidationException * @throws DaemonConnectionException */ #[Endpoint('Update server startup', 'Updates startup command, image, egg, and environment variables for a server.')] #[ResponseFromTransformer(ServerTransformer::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): array { $server = $modification->update($server, $request->payload(), User::USER_LEVEL_ADMIN); return Fractal::item($server) ->transformWith($this->getTransformer(ServerTransformer::class)) ->toResponseArray(); } }