1package atc
2
3import "github.com/tedsuo/rata"
4
5const (
6	SaveConfig = "SaveConfig"
7	GetConfig  = "GetConfig"
8
9	GetBuild            = "GetBuild"
10	GetBuildPlan        = "GetBuildPlan"
11	CreateBuild         = "CreateBuild"
12	ListBuilds          = "ListBuilds"
13	BuildEvents         = "BuildEvents"
14	BuildResources      = "BuildResources"
15	AbortBuild          = "AbortBuild"
16	GetBuildPreparation = "GetBuildPreparation"
17
18	GetCheck = "GetCheck"
19
20	GetJob         = "GetJob"
21	CreateJobBuild = "CreateJobBuild"
22	RerunJobBuild  = "RerunJobBuild"
23	ListAllJobs    = "ListAllJobs"
24	ListJobs       = "ListJobs"
25	ListJobBuilds  = "ListJobBuilds"
26	ListJobInputs  = "ListJobInputs"
27	GetJobBuild    = "GetJobBuild"
28	PauseJob       = "PauseJob"
29	UnpauseJob     = "UnpauseJob"
30	ScheduleJob    = "ScheduleJob"
31	GetVersionsDB  = "GetVersionsDB"
32	JobBadge       = "JobBadge"
33	MainJobBadge   = "MainJobBadge"
34
35	ClearTaskCache = "ClearTaskCache"
36
37	ListAllResources     = "ListAllResources"
38	ListResources        = "ListResources"
39	ListResourceTypes    = "ListResourceTypes"
40	GetResource          = "GetResource"
41	CheckResource        = "CheckResource"
42	CheckResourceWebHook = "CheckResourceWebHook"
43	CheckResourceType    = "CheckResourceType"
44
45	ListResourceVersions          = "ListResourceVersions"
46	GetResourceVersion            = "GetResourceVersion"
47	EnableResourceVersion         = "EnableResourceVersion"
48	DisableResourceVersion        = "DisableResourceVersion"
49	PinResourceVersion            = "PinResourceVersion"
50	UnpinResource                 = "UnpinResource"
51	SetPinCommentOnResource       = "SetPinCommentOnResource"
52	ListBuildsWithVersionAsInput  = "ListBuildsWithVersionAsInput"
53	ListBuildsWithVersionAsOutput = "ListBuildsWithVersionAsOutput"
54	GetResourceCausality          = "GetResourceCausality"
55
56	GetCC = "GetCC"
57
58	ListAllPipelines    = "ListAllPipelines"
59	ListPipelines       = "ListPipelines"
60	GetPipeline         = "GetPipeline"
61	DeletePipeline      = "DeletePipeline"
62	OrderPipelines      = "OrderPipelines"
63	PausePipeline       = "PausePipeline"
64	ArchivePipeline     = "ArchivePipeline"
65	UnpausePipeline     = "UnpausePipeline"
66	ExposePipeline      = "ExposePipeline"
67	HidePipeline        = "HidePipeline"
68	RenamePipeline      = "RenamePipeline"
69	ListPipelineBuilds  = "ListPipelineBuilds"
70	CreatePipelineBuild = "CreatePipelineBuild"
71	PipelineBadge       = "PipelineBadge"
72
73	RegisterWorker  = "RegisterWorker"
74	LandWorker      = "LandWorker"
75	RetireWorker    = "RetireWorker"
76	PruneWorker     = "PruneWorker"
77	HeartbeatWorker = "HeartbeatWorker"
78	ListWorkers     = "ListWorkers"
79	DeleteWorker    = "DeleteWorker"
80
81	SetLogLevel = "SetLogLevel"
82	GetLogLevel = "GetLogLevel"
83
84	DownloadCLI  = "DownloadCLI"
85	GetInfo      = "GetInfo"
86	GetInfoCreds = "GetInfoCreds"
87
88	ListContainers           = "ListContainers"
89	GetContainer             = "GetContainer"
90	HijackContainer          = "HijackContainer"
91	ListDestroyingContainers = "ListDestroyingContainers"
92	ReportWorkerContainers   = "ReportWorkerContainers"
93
94	ListVolumes           = "ListVolumes"
95	ListDestroyingVolumes = "ListDestroyingVolumes"
96	ReportWorkerVolumes   = "ReportWorkerVolumes"
97
98	ListTeams      = "ListTeams"
99	GetTeam        = "GetTeam"
100	SetTeam        = "SetTeam"
101	RenameTeam     = "RenameTeam"
102	DestroyTeam    = "DestroyTeam"
103	ListTeamBuilds = "ListTeamBuilds"
104
105	CreateArtifact     = "CreateArtifact"
106	GetArtifact        = "GetArtifact"
107	ListBuildArtifacts = "ListBuildArtifacts"
108
109	GetUser              = "GetUser"
110	ListActiveUsersSince = "ListActiveUsersSince"
111
112	SetWall   = "SetWall"
113	GetWall   = "GetWall"
114	ClearWall = "ClearWall"
115)
116
117const (
118	ClearTaskCacheQueryPath = "cache_path"
119	SaveConfigCheckCreds    = "check_creds"
120)
121
122var Routes = rata.Routes([]rata.Route{
123	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "PUT", Name: SaveConfig},
124	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "GET", Name: GetConfig},
125
126	{Path: "/api/v1/teams/:team_name/builds", Method: "POST", Name: CreateBuild},
127
128	{Path: "/api/v1/builds", Method: "GET", Name: ListBuilds},
129	{Path: "/api/v1/builds/:build_id", Method: "GET", Name: GetBuild},
130	{Path: "/api/v1/builds/:build_id/plan", Method: "GET", Name: GetBuildPlan},
131	{Path: "/api/v1/builds/:build_id/events", Method: "GET", Name: BuildEvents},
132	{Path: "/api/v1/builds/:build_id/resources", Method: "GET", Name: BuildResources},
133	{Path: "/api/v1/builds/:build_id/abort", Method: "PUT", Name: AbortBuild},
134	{Path: "/api/v1/builds/:build_id/preparation", Method: "GET", Name: GetBuildPreparation},
135	{Path: "/api/v1/builds/:build_id/artifacts", Method: "GET", Name: ListBuildArtifacts},
136
137	{Path: "/api/v1/checks/:check_id", Method: "GET", Name: GetCheck},
138
139	{Path: "/api/v1/jobs", Method: "GET", Name: ListAllJobs},
140	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs", Method: "GET", Name: ListJobs},
141	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name", Method: "GET", Name: GetJob},
142	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "GET", Name: ListJobBuilds},
143	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "POST", Name: CreateJobBuild},
144	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds/:build_name", Method: "POST", Name: RerunJobBuild},
145	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/inputs", Method: "GET", Name: ListJobInputs},
146	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds/:build_name", Method: "GET", Name: GetJobBuild},
147	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/pause", Method: "PUT", Name: PauseJob},
148	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/unpause", Method: "PUT", Name: UnpauseJob},
149	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/schedule", Method: "PUT", Name: ScheduleJob},
150	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: JobBadge},
151	{Path: "/api/v1/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: MainJobBadge},
152
153	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/tasks/:step_name/cache", Method: "DELETE", Name: ClearTaskCache},
154
155	{Path: "/api/v1/pipelines", Method: "GET", Name: ListAllPipelines},
156	{Path: "/api/v1/teams/:team_name/pipelines", Method: "GET", Name: ListPipelines},
157	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "GET", Name: GetPipeline},
158	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "DELETE", Name: DeletePipeline},
159	{Path: "/api/v1/teams/:team_name/pipelines/ordering", Method: "PUT", Name: OrderPipelines},
160	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/pause", Method: "PUT", Name: PausePipeline},
161	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/archive", Method: "PUT", Name: ArchivePipeline},
162	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/unpause", Method: "PUT", Name: UnpausePipeline},
163	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/expose", Method: "PUT", Name: ExposePipeline},
164	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/hide", Method: "PUT", Name: HidePipeline},
165	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/versions-db", Method: "GET", Name: GetVersionsDB},
166	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/rename", Method: "PUT", Name: RenamePipeline},
167	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "GET", Name: ListPipelineBuilds},
168	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "POST", Name: CreatePipelineBuild},
169	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/badge", Method: "GET", Name: PipelineBadge},
170
171	{Path: "/api/v1/resources", Method: "GET", Name: ListAllResources},
172	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources", Method: "GET", Name: ListResources},
173	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types", Method: "GET", Name: ListResourceTypes},
174	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name", Method: "GET", Name: GetResource},
175	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check", Method: "POST", Name: CheckResource},
176	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check/webhook", Method: "POST", Name: CheckResourceWebHook},
177	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types/:resource_type_name/check", Method: "POST", Name: CheckResourceType},
178
179	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions", Method: "GET", Name: ListResourceVersions},
180	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id", Method: "GET", Name: GetResourceVersion},
181	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/enable", Method: "PUT", Name: EnableResourceVersion},
182	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/disable", Method: "PUT", Name: DisableResourceVersion},
183	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/pin", Method: "PUT", Name: PinResourceVersion},
184	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/unpin", Method: "PUT", Name: UnpinResource},
185	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/pin_comment", Method: "PUT", Name: SetPinCommentOnResource},
186	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/input_to", Method: "GET", Name: ListBuildsWithVersionAsInput},
187	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/output_of", Method: "GET", Name: ListBuildsWithVersionAsOutput},
188	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/causality", Method: "GET", Name: GetResourceCausality},
189
190	{Path: "/api/v1/teams/:team_name/cc.xml", Method: "GET", Name: GetCC},
191
192	{Path: "/api/v1/workers", Method: "GET", Name: ListWorkers},
193	{Path: "/api/v1/workers", Method: "POST", Name: RegisterWorker},
194	{Path: "/api/v1/workers/:worker_name/land", Method: "PUT", Name: LandWorker},
195	{Path: "/api/v1/workers/:worker_name/retire", Method: "PUT", Name: RetireWorker},
196	{Path: "/api/v1/workers/:worker_name/prune", Method: "PUT", Name: PruneWorker},
197	{Path: "/api/v1/workers/:worker_name/heartbeat", Method: "PUT", Name: HeartbeatWorker},
198	{Path: "/api/v1/workers/:worker_name", Method: "DELETE", Name: DeleteWorker},
199
200	{Path: "/api/v1/log-level", Method: "GET", Name: GetLogLevel},
201	{Path: "/api/v1/log-level", Method: "PUT", Name: SetLogLevel},
202
203	{Path: "/api/v1/cli", Method: "GET", Name: DownloadCLI},
204	{Path: "/api/v1/info", Method: "GET", Name: GetInfo},
205	{Path: "/api/v1/info/creds", Method: "GET", Name: GetInfoCreds},
206
207	{Path: "/api/v1/user", Method: "GET", Name: GetUser},
208	{Path: "/api/v1/users", Method: "GET", Name: ListActiveUsersSince},
209
210	{Path: "/api/v1/containers/destroying", Method: "GET", Name: ListDestroyingContainers},
211	{Path: "/api/v1/containers/report", Method: "PUT", Name: ReportWorkerContainers},
212	{Path: "/api/v1/teams/:team_name/containers", Method: "GET", Name: ListContainers},
213	{Path: "/api/v1/teams/:team_name/containers/:id", Method: "GET", Name: GetContainer},
214	{Path: "/api/v1/teams/:team_name/containers/:id/hijack", Method: "GET", Name: HijackContainer},
215
216	{Path: "/api/v1/teams/:team_name/volumes", Method: "GET", Name: ListVolumes},
217	{Path: "/api/v1/volumes/destroying", Method: "GET", Name: ListDestroyingVolumes},
218	{Path: "/api/v1/volumes/report", Method: "PUT", Name: ReportWorkerVolumes},
219
220	{Path: "/api/v1/teams", Method: "GET", Name: ListTeams},
221	{Path: "/api/v1/teams/:team_name", Method: "GET", Name: GetTeam},
222	{Path: "/api/v1/teams/:team_name", Method: "PUT", Name: SetTeam},
223	{Path: "/api/v1/teams/:team_name/rename", Method: "PUT", Name: RenameTeam},
224	{Path: "/api/v1/teams/:team_name", Method: "DELETE", Name: DestroyTeam},
225	{Path: "/api/v1/teams/:team_name/builds", Method: "GET", Name: ListTeamBuilds},
226
227	{Path: "/api/v1/teams/:team_name/artifacts", Method: "POST", Name: CreateArtifact},
228	{Path: "/api/v1/teams/:team_name/artifacts/:artifact_id", Method: "GET", Name: GetArtifact},
229
230	{Path: "/api/v1/wall", Method: "GET", Name: GetWall},
231	{Path: "/api/v1/wall", Method: "PUT", Name: SetWall},
232	{Path: "/api/v1/wall", Method: "DELETE", Name: ClearWall},
233})
234