API

RepoStat

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/stats/refresh create Repository statistics snapshot with a downsampled history series
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/stats load Repository statistics snapshot with a downsampled history series

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

repo_stat, err := client.RepoStat(nil).Load(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
    panic(err)
}
fmt.Println(repo_stat)

Lua

Construct client as shown in the Lua setup, then call the operations:

local repo_stat, err = client:RepoStat():load({ organization_id = "example", repo_id = "example" })

PHP

Construct client as shown in the PHP setup, then call the operations:

$repo_stat = $client->RepoStat()->load(["organization_id" => "example", "repo_id" => "example"]);

Python

Construct client as shown in the Python setup, then call the operations:

repo_stat = client.RepoStat().load({"organization_id": "example", "repo_id": "example"})

Ruby

Construct client as shown in the Ruby setup, then call the operations:

repo_stat = client.RepoStat.load({ "organization_id" => "example", "repo_id" => "example" })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const repo_stat = await client.RepoStat().load({ organization_id: "example", repo_id: "example" })

Fields

Field Type Required Description
backend string Yes Backend
can_refresh boolean Yes Can Refresh
freshness object Yes Freshness
note string Yes Note
physical object Yes Physical
series array Yes Series

create

POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/stats/refresh

Operation ID: post_api_v1_organizations_org_slug_repos_repo_slug_stats_refresh.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes

Responses

200: Repository statistics snapshot with a downsampled history series

application/json

Property Type Required Description
repository_stats object Yes
repository_stats.backend enum: git Yes
repository_stats.can_refresh boolean Yes
repository_stats.freshness object Yes
repository_stats.freshness.collection_duration_ms integer Yes
repository_stats.freshness.collector_version string Yes
repository_stats.freshness.computed_at string (date-time) Yes
repository_stats.freshness.from_cache boolean Yes
repository_stats.freshness.stale boolean Yes
repository_stats.note string Yes
repository_stats.physical object Yes
repository_stats.physical.backend_generation integer Yes
repository_stats.physical.kinds array of object Yes
repository_stats.physical.kinds[].kind enum: blob, tree, commit, tag Yes
repository_stats.physical.kinds[].largest_object_bytes integer Yes
repository_stats.physical.kinds[].object_bytes integer Yes
repository_stats.physical.kinds[].objects integer Yes
repository_stats.physical.object_bytes integer Yes
repository_stats.physical.objects integer Yes
repository_stats.physical.pack_count integer Yes
repository_stats.physical.pack_entries integer Yes
repository_stats.physical.revision integer Yes
repository_stats.series array of object Yes
repository_stats.series[].captured_at string (date-time) Yes
repository_stats.series[].physical object Yes
repository_stats.series[].physical.backend_generation integer Yes
repository_stats.series[].physical.kinds array of object Yes
repository_stats.series[].physical.kinds[].kind enum: blob, tree, commit, tag Yes
repository_stats.series[].physical.kinds[].largest_object_bytes integer Yes
repository_stats.series[].physical.kinds[].object_bytes integer Yes
repository_stats.series[].physical.kinds[].objects integer Yes
repository_stats.series[].physical.object_bytes integer Yes
repository_stats.series[].physical.objects integer Yes
repository_stats.series[].physical.pack_count integer Yes
repository_stats.series[].physical.pack_entries integer Yes
repository_stats.series[].physical.revision integer Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
429: A recompute was spent for this repository too recently

application/json

Property Type Required Description
error string Yes
502: Bad gateway
503: Git inventory is unavailable for this repository

application/json

Property Type Required Description
error string Yes

load

GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/stats

Operation ID: get_api_v1_organizations_org_slug_repos_repo_slug_stats.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
org_slug path string Yes
repo_slug path string Yes

Responses

200: Repository statistics snapshot with a downsampled history series

application/json

Property Type Required Description
repository_stats object Yes
repository_stats.backend enum: git Yes
repository_stats.can_refresh boolean Yes
repository_stats.freshness object Yes
repository_stats.freshness.collection_duration_ms integer Yes
repository_stats.freshness.collector_version string Yes
repository_stats.freshness.computed_at string (date-time) Yes
repository_stats.freshness.from_cache boolean Yes
repository_stats.freshness.stale boolean Yes
repository_stats.note string Yes
repository_stats.physical object Yes
repository_stats.physical.backend_generation integer Yes
repository_stats.physical.kinds array of object Yes
repository_stats.physical.kinds[].kind enum: blob, tree, commit, tag Yes
repository_stats.physical.kinds[].largest_object_bytes integer Yes
repository_stats.physical.kinds[].object_bytes integer Yes
repository_stats.physical.kinds[].objects integer Yes
repository_stats.physical.object_bytes integer Yes
repository_stats.physical.objects integer Yes
repository_stats.physical.pack_count integer Yes
repository_stats.physical.pack_entries integer Yes
repository_stats.physical.revision integer Yes
repository_stats.series array of object Yes
repository_stats.series[].captured_at string (date-time) Yes
repository_stats.series[].physical object Yes
repository_stats.series[].physical.backend_generation integer Yes
repository_stats.series[].physical.kinds array of object Yes
repository_stats.series[].physical.kinds[].kind enum: blob, tree, commit, tag Yes
repository_stats.series[].physical.kinds[].largest_object_bytes integer Yes
repository_stats.series[].physical.kinds[].object_bytes integer Yes
repository_stats.series[].physical.kinds[].objects integer Yes
repository_stats.series[].physical.object_bytes integer Yes
repository_stats.series[].physical.objects integer Yes
repository_stats.series[].physical.pack_count integer Yes
repository_stats.series[].physical.pack_entries integer Yes
repository_stats.series[].physical.revision integer Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
503: Git inventory is unavailable for this repository

application/json

Property Type Required Description
error string Yes