@PLUGIN@ - /projects/ 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 quota for a project.

Request

  GET /projects/customerX%2Fcalculator/@PLUGIN@~quota/ HTTP/1.0

As response a QuotaInfo entity is returned that describes the projects quota.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8

  )]}'
  {
    "repo_size": 386,
    "max_repo_size": 1048576,
    "namespace": {
      "name": "customerX/*",
      "total_size": 1874,
      "max_total_size": 10485760
    }
  }

Get quota for the projects accessible by the caller.

Request

  GET /config/server/@PLUGIN@~quota/ HTTP/1.0

As result a map is returned that maps the project names to QuotaInfo entries. The entries in the map are sorted by project name.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8

  )]}'
  {
    "external/bison": {
      "repo_size": 386,
      "max_repo_size": 1048576,
      "namespace": {
        "name": "external/*",
        "total_size": 1874,
        "max_total_size": 10485760
      }
    },
    "internal/gcc": {
      "repo_size": 386
    }
  }

Prefix(p) Option

Limit the results to those projects that start with the specified prefix.

Request
  GET /config/server/@PLUGIN@~quota/?p=external%2F HTTP/1.0

As result a map is returned that maps the project names to QuotaInfo entries. The entries in the map are sorted by project name.

Response
  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8

  )]}'
  {
    "external/bison": {
      "repo_size": 386,
      "max_repo_size": 1048576,
      "namespace": {
        "name": "external/*",
        "total_size": 1874,
        "max_total_size": 10485760
      }
    }
  }

The QuotaInfo entity contains information about a project's quota. It has the following fields:

  • repo_size: The disk space, in bytes, that is used by this project's Git repository
  • max_repo_size: The max allowed size of this project's Git repositoriy on the disk.
  • namespace: NamespaceInfo

The ‘NamespaceInfo’ entity contains the quota information for the whole namespace. This means that the sum of sizes of all repositories under that namespace is not allowed to exceed the namespace quota. It has the following fields:

  • name: the namepspace name
  • total_size: the total size of all repositories under this namespace
  • max_total_size: the maximum allowed total size of all repositories under this namespace