@PLUGIN@ - REST API

This page describes the REST endpoints that are added by the @PLUGIN@ plugin.

Please also take note of the general information on the REST API.

Get project configuration

GET /projects/project_name/@PLUGIN@:config-project

Gets the LFS configuration for a specified project.

  GET /projects/myproject/@PLUGIN@:config-project HTTP/1.0

As response an LfsProjectConfigInfo entity is returned that describes the LFS configuration for the project.

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  {
    "enabled": true,
    "max_object_size": 102400
    "read_only": true,
    "backend": "foo"
  }

Get global configuration

GET /projects/All-Projects/@PLUGIN@:config-global

Gets the global LFS configuration. May only be called on All-Projects by users having the ‘Administrate Server’ capability.

  GET /projects/All-Projects/@PLUGIN@:config-global HTTP/1.0

As response an LfsGlobalConfigInfo entity is returned that describes the global LFS configuration.

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  {
    "default_backend_type": "FS",
    "backends": {
      "foo": "FS"
    },
    "namespaces": {
      "test-project": {
        "enabled": true,
        "max_object_size": 102400,
        "read_only": false,
        "backend": "foo"
      }
    }
  }

Set global configuration

PUT /projects/All-Projects/@PLUGIN@:config-global

Sets the global LFS project configuration. The configuration must be provided in the request body in an LfsGlobalConfigInput entity. If an empty body is sent, all current project settings are removed. May only be called on All-Projects by users having the ‘Administrate Server’ capability.

  PUT /projects/All-Projects/@PLUGIN@:config-global HTTP/1.0
  Content-Type: application/json;charset=UTF-8
  {
    "namespaces": {
      "test-project": {
        "enabled": false
      }
    }
  }

As response an LfsGlobalConfigInfo entity is returned that describes the updated global LFS configuration.

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  {
    "default_backend_type": "FS",
    "backends": {
      "foo": "FS"
    },
    "namespaces": {
      "test-project": {
        "enabled": false,
      }
    }
  }

JSON Entities

LfsProjectConfigInfo

The LfsProjectConfigInfo entity describes the LFS configuration for a project.

  • enabled: Whether LFS is enabled for this project. Not set if false.
  • max_object_size: Maximum LFS object size for this project. Only set when enabled is true. 0 means no limit is set.
  • read_only: Whether LFS is in read-only mode for this project. Only set when enabled is true.
  • backend: LFS storage backend that is used by this project. Only set when enabled is true.

LfsGlobalConfigInfo

The LfsGlobalConfigInfo entity describes the global configuration for LFS.

  • default_backend_type: The default LFS backend in use. Can be FS or S3.
  • backends: List of storage backends that might be used in namespaces; map of backend name to storage type (either FS or S3).
  • namespaces: Configured namespaces as a map of [LfsProjectConfigInfo] (#lfs-project-config-info) entities.

LfsGlobalConfigInput

The LfsGlobalConfigInput entity describes the global configuration to set for LFS.

  • namespaces: Configured namespaces as a map of [LfsProjectConfigInfo] (#lfs-project-config-info) entities.