logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

pleroma_instances_operation.ex (1168B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.ApiSpec.PleromaInstancesOperation do
  5. alias OpenApiSpex.Operation
  6. alias OpenApiSpex.Schema
  7. def open_api_operation(action) do
  8. operation = String.to_existing_atom("#{action}_operation")
  9. apply(__MODULE__, operation, [])
  10. end
  11. def show_operation do
  12. %Operation{
  13. tags: ["Instance misc"],
  14. summary: "Retrieve federation status",
  15. description: "Information about instances deemed unreachable by the server",
  16. operationId: "PleromaInstances.show",
  17. responses: %{
  18. 200 => Operation.response("PleromaInstances", "application/json", pleroma_instances())
  19. }
  20. }
  21. end
  22. def pleroma_instances do
  23. %Schema{
  24. type: :object,
  25. properties: %{
  26. unreachable: %Schema{
  27. type: :object,
  28. properties: %{hostname: %Schema{type: :string, format: :"date-time"}}
  29. }
  30. },
  31. example: %{
  32. "unreachable" => %{"consistently-unreachable.name" => "2020-10-14 22:07:58.216473"}
  33. }
  34. }
  35. end
  36. end