This branch adds the ability to forcefully remove a runner from GARM. When the operator wishes to manually remove a runner, the workflow is as follows: * Check that the runner exists in GitHub. If it does, attempt to remove it. An error here indicates that the runner may be processing a job. In this case, we don't continue and the operator gets immediate feedback from the API. * Mark the runner in the database as pending_delete * Allow the consolidate loop to reap it from the provider and remove it from the database. Removing the instance from the provider is async. If the provider errs out, GARM will keep trying to remove it in perpetuity until the provider succedes. In situations where the provider is misconfigured, this will never happen, leaving the instance in a permanent state of pending_delete. A provider may fail for various reasons. Either credentials have expired, the API endpoint has changed, the provider is misconfigured or the operator may just have removed it from the config before cleaning up the runners. While some cases are recoverable, some are not. We cannot have a situation in which we cannot clean resources in garm because of a misconfiguration. This change adds the pending_force_delete instance status. Instances marked with this status, will be removed from GARM even if the provider reports an error. The GARM cli has been modified to give new meaning to the --force-remove-runner option. This option in the CLI is no longer mandatory. Instead, setting it will mark the runner with the new pending_force_delete status. Omitting it will mark the runner with the old status of pending_delete. Fixes: #160 Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
1454 lines
49 KiB
YAML
1454 lines
49 KiB
YAML
basePath: /api/v1
|
|
consumes:
|
|
- application/json
|
|
definitions:
|
|
APIErrorResponse:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: apiserver_params
|
|
package: github.com/cloudbase/garm/apiserver/params
|
|
type: APIErrorResponse
|
|
ControllerInfo:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: ControllerInfo
|
|
CreateEnterpriseParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: CreateEnterpriseParams
|
|
CreateOrgParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: CreateOrgParams
|
|
CreatePoolParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: CreatePoolParams
|
|
CreateRepoParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: CreateRepoParams
|
|
Credentials:
|
|
items:
|
|
$ref: '#/definitions/GithubCredentials'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Credentials
|
|
Enterprise:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Enterprise
|
|
Enterprises:
|
|
items:
|
|
$ref: '#/definitions/Enterprise'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Enterprises
|
|
GithubCredentials:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: GithubCredentials
|
|
HookInfo:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: HookInfo
|
|
InstallWebhookParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: InstallWebhookParams
|
|
Instance:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Instance
|
|
Instances:
|
|
items:
|
|
$ref: '#/definitions/Instance'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Instances
|
|
JWTResponse:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: JWTResponse
|
|
Job:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Job
|
|
Jobs:
|
|
items:
|
|
$ref: '#/definitions/Job'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Jobs
|
|
NewUserParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: NewUserParams
|
|
Organization:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Organization
|
|
Organizations:
|
|
items:
|
|
$ref: '#/definitions/Organization'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Organizations
|
|
PasswordLoginParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: PasswordLoginParams
|
|
Pool:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Pool
|
|
Pools:
|
|
items:
|
|
$ref: '#/definitions/Pool'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Pools
|
|
Provider:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Provider
|
|
Providers:
|
|
items:
|
|
$ref: '#/definitions/Provider'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Providers
|
|
Repositories:
|
|
items:
|
|
$ref: '#/definitions/Repository'
|
|
type: array
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Repositories
|
|
Repository:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: Repository
|
|
UpdateEntityParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: UpdateEntityParams
|
|
UpdatePoolParams:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: UpdatePoolParams
|
|
User:
|
|
type: object
|
|
x-go-type:
|
|
import:
|
|
alias: garm_params
|
|
package: github.com/cloudbase/garm/params
|
|
type: User
|
|
info:
|
|
description: The Garm API generated using go-swagger.
|
|
license:
|
|
name: Apache 2.0
|
|
url: https://www.apache.org/licenses/LICENSE-2.0
|
|
title: Garm API.
|
|
version: 1.0.0
|
|
paths:
|
|
/auth/login:
|
|
post:
|
|
operationId: Login
|
|
parameters:
|
|
- description: Login information.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/PasswordLoginParams'
|
|
description: Login information.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: JWTResponse
|
|
schema:
|
|
$ref: '#/definitions/JWTResponse'
|
|
"400":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Logs in a user and returns a JWT token.
|
|
tags:
|
|
- login
|
|
/controller-info:
|
|
get:
|
|
operationId: ControllerInfo
|
|
responses:
|
|
"200":
|
|
description: ControllerInfo
|
|
schema:
|
|
$ref: '#/definitions/ControllerInfo'
|
|
"409":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get controller info.
|
|
tags:
|
|
- controllerInfo
|
|
/credentials:
|
|
get:
|
|
operationId: ListCredentials
|
|
responses:
|
|
"200":
|
|
description: Credentials
|
|
schema:
|
|
$ref: '#/definitions/Credentials'
|
|
"400":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List all credentials.
|
|
tags:
|
|
- credentials
|
|
/enterprises:
|
|
get:
|
|
operationId: ListEnterprises
|
|
responses:
|
|
"200":
|
|
description: Enterprises
|
|
schema:
|
|
$ref: '#/definitions/Enterprises'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List all enterprises.
|
|
tags:
|
|
- enterprises
|
|
post:
|
|
operationId: CreateEnterprise
|
|
parameters:
|
|
- description: Parameters used to create the enterprise.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreateEnterpriseParams'
|
|
description: Parameters used to create the enterprise.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Enterprise
|
|
schema:
|
|
$ref: '#/definitions/Enterprise'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create enterprise with the given parameters.
|
|
tags:
|
|
- enterprises
|
|
/enterprises/{enterpriseID}:
|
|
delete:
|
|
operationId: DeleteEnterprise
|
|
parameters:
|
|
- description: ID of the enterprise to delete.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete enterprise by ID.
|
|
tags:
|
|
- enterprises
|
|
get:
|
|
operationId: GetEnterprise
|
|
parameters:
|
|
- description: The ID of the enterprise to fetch.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Enterprise
|
|
schema:
|
|
$ref: '#/definitions/Enterprise'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get enterprise by ID.
|
|
tags:
|
|
- enterprises
|
|
put:
|
|
operationId: UpdateEnterprise
|
|
parameters:
|
|
- description: The ID of the enterprise to update.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the enterprise.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdateEntityParams'
|
|
description: Parameters used when updating the enterprise.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Enterprise
|
|
schema:
|
|
$ref: '#/definitions/Enterprise'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update enterprise with the given parameters.
|
|
tags:
|
|
- enterprises
|
|
/enterprises/{enterpriseID}/instances:
|
|
get:
|
|
operationId: ListEnterpriseInstances
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Instances
|
|
schema:
|
|
$ref: '#/definitions/Instances'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List enterprise instances.
|
|
tags:
|
|
- enterprises
|
|
- instances
|
|
/enterprises/{enterpriseID}/pools:
|
|
get:
|
|
operationId: ListEnterprisePools
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pools
|
|
schema:
|
|
$ref: '#/definitions/Pools'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List enterprise pools.
|
|
tags:
|
|
- enterprises
|
|
- pools
|
|
post:
|
|
operationId: CreateEnterprisePool
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when creating the enterprise pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreatePoolParams'
|
|
description: Parameters used when creating the enterprise pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create enterprise pool with the parameters given.
|
|
tags:
|
|
- enterprises
|
|
- pools
|
|
/enterprises/{enterpriseID}/pools/{poolID}:
|
|
delete:
|
|
operationId: DeleteEnterprisePool
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
- description: ID of the enterprise pool to delete.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete enterprise pool by ID.
|
|
tags:
|
|
- enterprises
|
|
- pools
|
|
get:
|
|
operationId: GetEnterprisePool
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
- description: Pool ID.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get enterprise pool by ID.
|
|
tags:
|
|
- enterprises
|
|
- pools
|
|
put:
|
|
operationId: UpdateEnterprisePool
|
|
parameters:
|
|
- description: Enterprise ID.
|
|
in: path
|
|
name: enterpriseID
|
|
required: true
|
|
type: string
|
|
- description: ID of the enterprise pool to update.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the enterprise pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdatePoolParams'
|
|
description: Parameters used when updating the enterprise pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update enterprise pool with the parameters given.
|
|
tags:
|
|
- enterprises
|
|
- pools
|
|
/first-run:
|
|
post:
|
|
operationId: FirstRun
|
|
parameters:
|
|
- description: Create a new user.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/NewUserParams'
|
|
description: Create a new user.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: User
|
|
schema:
|
|
$ref: '#/definitions/User'
|
|
"400":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Initialize the first run of the controller.
|
|
tags:
|
|
- first-run
|
|
/instances:
|
|
get:
|
|
operationId: ListInstances
|
|
responses:
|
|
"200":
|
|
description: Instances
|
|
schema:
|
|
$ref: '#/definitions/Instances'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get all runners' instances.
|
|
tags:
|
|
- instances
|
|
/instances/{instanceName}:
|
|
delete:
|
|
operationId: DeleteInstance
|
|
parameters:
|
|
- description: Runner instance name.
|
|
in: path
|
|
name: instanceName
|
|
required: true
|
|
type: string
|
|
- description: If true GARM will ignore any provider error when removing the runner and will continue to remove the runner from github and the GARM database.
|
|
in: query
|
|
name: forceRemove
|
|
type: boolean
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete runner instance by name.
|
|
tags:
|
|
- instances
|
|
get:
|
|
operationId: GetInstance
|
|
parameters:
|
|
- description: Runner instance name.
|
|
in: path
|
|
name: instanceName
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Instance
|
|
schema:
|
|
$ref: '#/definitions/Instance'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get runner instance by name.
|
|
tags:
|
|
- instances
|
|
/jobs:
|
|
get:
|
|
operationId: ListJobs
|
|
responses:
|
|
"200":
|
|
description: Jobs
|
|
schema:
|
|
$ref: '#/definitions/Jobs'
|
|
"400":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List all jobs.
|
|
tags:
|
|
- jobs
|
|
/metrics-token:
|
|
get:
|
|
operationId: GetMetricsToken
|
|
responses:
|
|
"200":
|
|
description: JWTResponse
|
|
schema:
|
|
$ref: '#/definitions/JWTResponse'
|
|
"401":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Returns a JWT token that can be used to access the metrics endpoint.
|
|
tags:
|
|
- metrics-token
|
|
/organizations:
|
|
get:
|
|
operationId: ListOrgs
|
|
responses:
|
|
"200":
|
|
description: Organizations
|
|
schema:
|
|
$ref: '#/definitions/Organizations'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List organizations.
|
|
tags:
|
|
- organizations
|
|
post:
|
|
operationId: CreateOrg
|
|
parameters:
|
|
- description: Parameters used when creating the organization.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreateOrgParams'
|
|
description: Parameters used when creating the organization.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Organization
|
|
schema:
|
|
$ref: '#/definitions/Organization'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create organization with the parameters given.
|
|
tags:
|
|
- organizations
|
|
/organizations/{orgID}:
|
|
delete:
|
|
operationId: DeleteOrg
|
|
parameters:
|
|
- description: ID of the organization to delete.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: If true and a webhook is installed for this organization, it will not be removed.
|
|
in: query
|
|
name: keepWebhook
|
|
type: boolean
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete organization by ID.
|
|
tags:
|
|
- organizations
|
|
get:
|
|
operationId: GetOrg
|
|
parameters:
|
|
- description: ID of the organization to fetch.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Organization
|
|
schema:
|
|
$ref: '#/definitions/Organization'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get organization by ID.
|
|
tags:
|
|
- organizations
|
|
put:
|
|
operationId: UpdateOrg
|
|
parameters:
|
|
- description: ID of the organization to update.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the organization.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdateEntityParams'
|
|
description: Parameters used when updating the organization.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Organization
|
|
schema:
|
|
$ref: '#/definitions/Organization'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update organization with the parameters given.
|
|
tags:
|
|
- organizations
|
|
/organizations/{orgID}/instances:
|
|
get:
|
|
operationId: ListOrgInstances
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Instances
|
|
schema:
|
|
$ref: '#/definitions/Instances'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List organization instances.
|
|
tags:
|
|
- organizations
|
|
- instances
|
|
/organizations/{orgID}/pools:
|
|
get:
|
|
operationId: ListOrgPools
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pools
|
|
schema:
|
|
$ref: '#/definitions/Pools'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List organization pools.
|
|
tags:
|
|
- organizations
|
|
- pools
|
|
post:
|
|
operationId: CreateOrgPool
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when creating the organization pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreatePoolParams'
|
|
description: Parameters used when creating the organization pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create organization pool with the parameters given.
|
|
tags:
|
|
- organizations
|
|
- pools
|
|
/organizations/{orgID}/pools/{poolID}:
|
|
delete:
|
|
operationId: DeleteOrgPool
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: ID of the organization pool to delete.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete organization pool by ID.
|
|
tags:
|
|
- organizations
|
|
- pools
|
|
get:
|
|
operationId: GetOrgPool
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: Pool ID.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get organization pool by ID.
|
|
tags:
|
|
- organizations
|
|
- pools
|
|
put:
|
|
operationId: UpdateOrgPool
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: ID of the organization pool to update.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the organization pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdatePoolParams'
|
|
description: Parameters used when updating the organization pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update organization pool with the parameters given.
|
|
tags:
|
|
- organizations
|
|
- pools
|
|
/organizations/{orgID}/webhook:
|
|
delete:
|
|
operationId: UninstallOrgWebhook
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Uninstall organization webhook.
|
|
tags:
|
|
- organizations
|
|
- hooks
|
|
get:
|
|
operationId: GetOrgWebhookInfo
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: HookInfo
|
|
schema:
|
|
$ref: '#/definitions/HookInfo'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get information about the GARM installed webhook on an organization.
|
|
tags:
|
|
- organizations
|
|
- hooks
|
|
post:
|
|
description: |-
|
|
Install the GARM webhook for an organization. The secret configured on the organization will
|
|
be used to validate the requests.
|
|
operationId: InstallOrgWebhook
|
|
parameters:
|
|
- description: Organization ID.
|
|
in: path
|
|
name: orgID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when creating the organization webhook.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/InstallWebhookParams'
|
|
description: Parameters used when creating the organization webhook.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: HookInfo
|
|
schema:
|
|
$ref: '#/definitions/HookInfo'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
tags:
|
|
- organizations
|
|
- hooks
|
|
/pools:
|
|
get:
|
|
operationId: ListPools
|
|
responses:
|
|
"200":
|
|
description: Pools
|
|
schema:
|
|
$ref: '#/definitions/Pools'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List all pools.
|
|
tags:
|
|
- pools
|
|
/pools/{poolID}:
|
|
delete:
|
|
operationId: DeletePool
|
|
parameters:
|
|
- description: ID of the pool to delete.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete pool by ID.
|
|
tags:
|
|
- pools
|
|
get:
|
|
operationId: GetPool
|
|
parameters:
|
|
- description: ID of the pool to fetch.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get pool by ID.
|
|
tags:
|
|
- pools
|
|
put:
|
|
operationId: UpdatePool
|
|
parameters:
|
|
- description: ID of the pool to update.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
- description: Parameters to update the pool with.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdatePoolParams'
|
|
description: Parameters to update the pool with.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update pool by ID.
|
|
tags:
|
|
- pools
|
|
/pools/{poolID}/instances:
|
|
get:
|
|
operationId: ListPoolInstances
|
|
parameters:
|
|
- description: Runner pool ID.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Instances
|
|
schema:
|
|
$ref: '#/definitions/Instances'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List runner instances in a pool.
|
|
tags:
|
|
- instances
|
|
/providers:
|
|
get:
|
|
operationId: ListProviders
|
|
responses:
|
|
"200":
|
|
description: Providers
|
|
schema:
|
|
$ref: '#/definitions/Providers'
|
|
"400":
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List all providers.
|
|
tags:
|
|
- providers
|
|
/repositories:
|
|
get:
|
|
operationId: ListRepos
|
|
responses:
|
|
"200":
|
|
description: Repositories
|
|
schema:
|
|
$ref: '#/definitions/Repositories'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List repositories.
|
|
tags:
|
|
- repositories
|
|
post:
|
|
operationId: CreateRepo
|
|
parameters:
|
|
- description: Parameters used when creating the repository.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreateRepoParams'
|
|
description: Parameters used when creating the repository.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Repository
|
|
schema:
|
|
$ref: '#/definitions/Repository'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create repository with the parameters given.
|
|
tags:
|
|
- repositories
|
|
/repositories/{repoID}:
|
|
delete:
|
|
operationId: DeleteRepo
|
|
parameters:
|
|
- description: ID of the repository to delete.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: If true and a webhook is installed for this repo, it will not be removed.
|
|
in: query
|
|
name: keepWebhook
|
|
type: boolean
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete repository by ID.
|
|
tags:
|
|
- repositories
|
|
get:
|
|
operationId: GetRepo
|
|
parameters:
|
|
- description: ID of the repository to fetch.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Repository
|
|
schema:
|
|
$ref: '#/definitions/Repository'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get repository by ID.
|
|
tags:
|
|
- repositories
|
|
put:
|
|
operationId: UpdateRepo
|
|
parameters:
|
|
- description: ID of the repository to update.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the repository.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdateEntityParams'
|
|
description: Parameters used when updating the repository.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Repository
|
|
schema:
|
|
$ref: '#/definitions/Repository'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update repository with the parameters given.
|
|
tags:
|
|
- repositories
|
|
/repositories/{repoID}/instances:
|
|
get:
|
|
operationId: ListRepoInstances
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Instances
|
|
schema:
|
|
$ref: '#/definitions/Instances'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List repository instances.
|
|
tags:
|
|
- repositories
|
|
- instances
|
|
/repositories/{repoID}/pools:
|
|
get:
|
|
operationId: ListRepoPools
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pools
|
|
schema:
|
|
$ref: '#/definitions/Pools'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: List repository pools.
|
|
tags:
|
|
- repositories
|
|
- pools
|
|
post:
|
|
operationId: CreateRepoPool
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when creating the repository pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/CreatePoolParams'
|
|
description: Parameters used when creating the repository pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Create repository pool with the parameters given.
|
|
tags:
|
|
- repositories
|
|
- pools
|
|
/repositories/{repoID}/pools/{poolID}:
|
|
delete:
|
|
operationId: DeleteRepoPool
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: ID of the repository pool to delete.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Delete repository pool by ID.
|
|
tags:
|
|
- repositories
|
|
- pools
|
|
get:
|
|
operationId: GetRepoPool
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: Pool ID.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get repository pool by ID.
|
|
tags:
|
|
- repositories
|
|
- pools
|
|
put:
|
|
operationId: UpdateRepoPool
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: ID of the repository pool to update.
|
|
in: path
|
|
name: poolID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when updating the repository pool.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/UpdatePoolParams'
|
|
description: Parameters used when updating the repository pool.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: Pool
|
|
schema:
|
|
$ref: '#/definitions/Pool'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Update repository pool with the parameters given.
|
|
tags:
|
|
- repositories
|
|
- pools
|
|
/repositories/{repoID}/webhook:
|
|
delete:
|
|
operationId: UninstallRepoWebhook
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Uninstall organization webhook.
|
|
tags:
|
|
- repositories
|
|
- hooks
|
|
get:
|
|
operationId: GetRepoWebhookInfo
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: HookInfo
|
|
schema:
|
|
$ref: '#/definitions/HookInfo'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
summary: Get information about the GARM installed webhook on a repository.
|
|
tags:
|
|
- repositories
|
|
- hooks
|
|
post:
|
|
description: |-
|
|
Install the GARM webhook for an organization. The secret configured on the organization will
|
|
be used to validate the requests.
|
|
operationId: InstallRepoWebhook
|
|
parameters:
|
|
- description: Repository ID.
|
|
in: path
|
|
name: repoID
|
|
required: true
|
|
type: string
|
|
- description: Parameters used when creating the repository webhook.
|
|
in: body
|
|
name: Body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/InstallWebhookParams'
|
|
description: Parameters used when creating the repository webhook.
|
|
type: object
|
|
responses:
|
|
"200":
|
|
description: HookInfo
|
|
schema:
|
|
$ref: '#/definitions/HookInfo'
|
|
default:
|
|
description: APIErrorResponse
|
|
schema:
|
|
$ref: '#/definitions/APIErrorResponse'
|
|
tags:
|
|
- repositories
|
|
- hooks
|
|
produces:
|
|
- application/json
|
|
security:
|
|
- Bearer: []
|
|
securityDefinitions:
|
|
Bearer:
|
|
description: 'The token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".'
|
|
in: header
|
|
name: Authorization
|
|
type: apiKey
|
|
swagger: "2.0"
|