-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.raml
727 lines (669 loc) · 21.8 KB
/
api.raml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
#%RAML 1.0
title: Semaphore
baseUri: https://api.semaphoreci.com/v2
mediaType: application/json
annotationTypes:
stability:
enum: [prototype, development, production]
types:
UUID:
type: string
pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
time:
type: datetime
format: rfc3339
Error:
type: object
properties:
message: string
Org:
type: object
properties:
id:
type: UUID
description: "Unique ID of the organization."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
name:
type: string
description: "Name of the organization."
example: "Rendered Text"
url:
type: string
description: "Show URL for the organization."
example: "https://api.semaphoreci.com/v2/orgs/renderedtext"
projects_url:
type: string
description: "Projects URL for the organization"
example: "https://api.semaphoreci.com/v2/orgs/renderedtext/projects"
secrets_url:
type: string
description: "Secrets URL for the organization"
example: "https://api.semaphoreci.com/v2/orgs/renderedtext/secrets"
users_url:
type: string
description: "Users URL for the organization"
example: "https://api.semaphoreci.com/v2/orgs/renderedtext/users"
teams_url:
type: string
description: "Teams URL for the organization"
example: "https://api.semaphoreci.com/v2/orgs/renderedtext/teams"
username:
type: string
description: "Unique username of the organization."
example: "renderedtext"
created_at: time
updated_at: time
TeamPatch:
type: object
properties:
name?:
type: string
description: "Name of the team. The name must be unique in the organization."
example: "developers"
permission?:
description: "The permission level for team members in the organization."
enum: [read, edit, admin]
example: "edit"
description?:
type: string
description: "Description for the team."
example: "Developers team"
TeamPost:
type: object
properties:
name:
type: string
description: "Name of the team. The name must be unique in the organization."
example: "developers"
permission:
enum: [read, edit, admin]
description: "The permission level for team members in the organization."
example: "edit"
description?:
type: string
description: "Description for the team."
example: "Developers team"
Team:
type: TeamPost
properties:
id:
type: UUID
description: "Unique ID of the team."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
url:
type: string
description: "Show URL for the team."
example: "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
users_url:
type: string
description: "Users URL for the team"
example: "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users"
projects_url:
type: string
description: "Projects URL for the team"
example: "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects"
secrets_url:
type: string
description: "Secrets URL for the team"
example: "https://api.semaphoreci.com/v2/teams/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets"
updated_at: time
created_at: time
ProjectPost:
type: object
properties:
name:
type: string
description: "Name of the project on Semaphore"
example: "cli"
repo_name:
type: string
description: "Name of the repository on GitHub or BitBucket"
example: "cli"
repo_owner:
type: string
description: "Name of the repository owner on GitHub or BitBucket"
example: "renderedtext"
repo_provider:
enum: [github, bitbucket]
description: "Repository Host"
example: "github"
Project:
type: object
properties:
id:
type: UUID
description: "Unique ID of the project."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
name:
type: string
description: "Name of the project."
example: "elixir-lang"
html_url:
type: string
description: "Project's HTML URL"
example: "https://semaphoreci.com/renderedtext/elixir-lang"
users_url:
type: string
description: "Users URL for the project"
example: "https://api.semaphoreci.com/v2/projects/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/users"
secrets_url:
type: string
description: "Secrets URL for the project"
example: "https://api.semaphoreci.com/v2/projects/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/secrets"
updated_at: time
created_at: time
SecretPatch:
type: object
properties:
name?:
type: string
description: "Name of the secret."
example: "AWS Tokens"
description?:
type: string
description: "Description for the secrets."
example: "AWS tokens for deployment"
SecretPost:
type: object
properties:
name:
type: string
description: "Name of the secret."
example: "AWS Tokens"
description?:
type: string
description: "Description for the secret."
example: "AWS tokens for deployment"
Secret:
type: SecretPost
properties:
id:
type: UUID
description: "Unique ID of the secret."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
url:
type: string
description: "Show URL for the secret."
example: "https://api.semaphoreci.com/v2/secrets/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
projects_url:
type: string
description: "Projects URL for the secret"
example: "https://api.semaphoreci.com/v2/secrets/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/projects"
teams_url:
type: string
description: "Teams URL for the secret"
example: "https://api.semaphoreci.com/v2/secrets/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/teams"
env_vars_url:
type: string
description: "Environment Variables URL for the secret"
example: "https://api.semaphoreci.com/v2/secrets/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/env_vars"
config_files_url:
type: string
description: "Config Files URL for the the secret"
example: "https://api.semaphoreci.com/v2/secrets/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5/config_files"
created_at: time
updated_at: time
EnvVarPatch:
type: object
properties:
name?:
type: string
description: "Name of the environment variable."
example: "API_TOKEN"
content?:
type: string
description: "Content of the environment variable."
example: "8CgLAxXn"
EnvVarPost:
type: object
properties:
name:
type: string
description: "Name of the environment variable."
example: "API_TOKEN"
content:
type: string
description: "Content of the environment variable."
example: "8CgLAxXn"
encrypted:
type: boolean
example: false
EnvVar:
type: object
properties:
id:
type: UUID
description: "Unique ID of the environment variable."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
name:
type: string
description: "Name of the environment variable."
example: "API_TOKEN"
url:
type: string
description: "Show URL for the environment variable."
example: "https://api.semaphoreci.com/v2/env_vars/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
content:
type: string
description: "Content of the environment variable. Will be `null` if encrypted."
example: "8CgLAxXn"
shared:
type: boolean
description: "True if the environment variable belongs to a secret."
example: true
encrypted:
type: boolean
description: "True if the environment variable is encrypted."
example: false
created_at: time
updated_at: time
ConfigFilePatch:
type: object
properties:
path?:
type: string
description: "Path of the configuration file."
example: ".credentials"
content?:
type: string
description: "Content of the configuration file."
example: "password: ec2c9f6f64b5"
ConfigFilePost:
type: object
properties:
path:
type: string
description: "Path of the configuration file."
example: ".credentials"
content:
type: string
description: "Content of the configuration file. Will be `null` if the file is encrypted."
example: "password: ec2c9f6f64b5"
encrypted:
type: boolean
description: "True if the file is encrypted."
example: false
ConfigFile:
type: object
properties:
id:
type: UUID
description: "Unique ID of the configuration file."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
path:
type: string
description: "Path of the configuration file."
example: ".credentials"
url:
type: string
description: "Show URL for the configuration file."
example: "https://api.semaphoreci.com/v2/config_files/86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
content:
type: string
description: "Content of the configuration file. Will be `null` if the file is encrypted."
example: "password: ec2c9f6f64b5"
shared:
type: boolean
description: "True if the configuration file belongs to a secret."
example: true
encrypted:
type: boolean
description: "True if the file is encrypted."
example: false
created_at: time
updated_at: time
User:
type: object
properties:
uid:
type: UUID
description: "Unique ID of the user."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
username:
type: string
description: "Unique username of the user."
example: "johndoe"
name:
type: string
description: "Name of the user."
example: "John Doe"
created_at: time
updated_at: time
Pipeline:
type: object
properties:
id:
type: UUID
description: "Unique ID of the pipeline."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
PipelineRepo:
type: object
properties:
owner:
type: string
required: true
description: "Repo owner."
example: "renderedtext"
repo_name:
type: string
required: true
description: "Repo name."
example: "wormhole"
branch_name:
type: string
required: true
description: "Git branch."
example: "master"
commit_sha:
type: string
required: true
description: "Git commit SHA."
example: "78ce7905cb571ea13d3785c1197f851d757df72c"
PipelinePost:
type: object
properties:
project_uuid:
type: UUID
description: "Project the pipeline is building."
example: "86e78b7e-2f9c-45a7-9939-ec2c9f6f64b5"
repo:
type: PipelineRepo
required: true
description: "The repository."
service:
enum: [git_hub]
required: true
description: "The repository type."
pipeline_request_token:
type: string
required: true
maxLength: 64
description: "Idempotency key."
example: "86e78b7e2f9c45a79939ec2c9f6f64b5"
PipelineDescription:
type: object
properties:
description:
type: string
description: "Pipeline description."
example: ""
PipelinePatch:
type: object
properties:
terminate_request:
enum: ["true"]
required: true
example: "true"
traits:
withRequestItem:
body:
application/json:
type: <<item>>
withResponseItem:
responses:
200:
body:
application/json:
type: <<item>>
withResponseItems:
responses:
200:
body:
application/json:
type: <<item>>[]
withCreateResponse:
responses:
201:
body:
application/json:
type: <<item>>
withNoBodyResponse:
responses:
204:
withClientError:
responses:
400:
body:
application/json:
type: Error
withNotFoundError:
responses:
404:
body:
application/json:
type: Error
withPreconditionFailedError:
responses:
412:
body:
application/json:
type: Error
/users:
(stability): "development"
displayName: "Users"
/orgs:
(stability): "development"
displayName: "Organizations"
get:
displayName: List your organizations
is: [withResponseItems: {item : Org}]
/{username}:
get:
displayName: Get an organization
is: [withResponseItem: {item : Org}, withNotFoundError]
/{org_username}:
/teams:
get:
displayName: List teams in an organization
is: [withResponseItems: {item : Team}]
post:
displayName: Create a team in an organization
description: Only organization owners can create new teams.
is: [withRequestItem: {item : TeamPost},
withResponseItem: {item : Team},
withNotFoundError,
withPreconditionFailedError]
/projects:
get:
displayName: List projects in an organization
is: [withResponseItems: {item : Project}]
post:
displayName: Create a project in an organization
description: Only organization admin can create new projects.
is: [withRequestItem: {item : ProjectPost},
withResponseItem: {item : Project},
withNotFoundError,
withPreconditionFailedError]
/secrets:
get:
displayName: List secrets in an organization
is: [withResponseItems: {item : Secret}]
post:
displayName: Create secret in an organization
is: [withRequestItem: {item : SecretPost},
withResponseItem: {item : Secret},
withNotFoundError,
withPreconditionFailedError]
/users:
get:
displayName: List all users for a organization
is: [withResponseItems: {item : User}, withNotFoundError]
/teams:
(stability): "development"
displayName: "Teams"
/{id}:
get:
displayName: Get a team
is: [withResponseItem: {item : Team}, withNotFoundError]
delete:
displayName: Delete a team
description: Only organization owners can delete teams.
is: [withNoBodyResponse, withNotFoundError]
patch:
displayName: Update a team
description: Only organization owners can update teams.
is: [withRequestItem: {item : TeamPatch}, withResponseItem: {item : Team}, withNotFoundError]
/{team_id}:
/secrets:
get:
displayName: List secrets in a team
is: [withResponseItems: {item : Secret}, withNotFoundError]
/{secret_id}:
post:
displayName: Add a secret to a team
description: The user needs to be a member of the team, and to have admin permissions in the organization.
is: [withNoBodyResponse, withNotFoundError]
delete:
displayName: Remove secret from a team
description: The user needs to be a member of the team, and to have admin permissions in the organization.
is: [withNoBodyResponse, withNotFoundError]
/users:
get:
displayName: List members of a team
is: [withResponseItems: {item : User}, withNotFoundError]
/{user_username}:
post:
displayName: Add user to a team
is: [withNoBodyResponse, withNotFoundError]
delete:
displayName: Remove user from a team
is: [withNoBodyResponse, withNotFoundError]
/projects:
get:
displayName: List project added to a team
is: [withResponseItems: {item : Project}, withNotFoundError]
/{project_id}:
post:
displayName: Add project to a team
is: [withNoBodyResponse, withNotFoundError]
delete:
displayName: Remove project from a team
is: [withNoBodyResponse, withNotFoundError]
/projects:
(stability): "development"
displayName: "Projects"
/{project_id}:
/secrets:
get:
displayName: List secrets attached to a project
is: [withResponseItems: {item : Secret}, withNotFoundError]
/{secret_id}:
post:
displayName: Attach a secret to a project
is: [withResponseItem: {item : Secret}, withNotFoundError]
delete:
displayName: Dettach a secret from a project
is: [withNoBodyResponse, withNotFoundError]
/env_vars:
get:
displayName: List environment variables connected to a project
is: [withResponseItems: {item : EnvVar}, withNotFoundError]
/config_files:
get:
displayName: List config files connected to a project
is: [withResponseItems: {item : ConfigFile}, withNotFoundError]
/teams:
get:
displayName: List all teams connected to project
is: [withResponseItems: {item : Team}, withNotFoundError]
/users:
get:
displayName: List all users for a project
is: [withResponseItems: {item : User}, withNotFoundError]
/secrets:
(stability): "development"
displayName: "Secrets"
/{id}:
get:
displayName: Get a secret
is: [withResponseItem: {item : Secret}, withNotFoundError]
delete:
displayName: Delete a secret
description: Deleting secret will remove it from all projects it is used on. Deleting a secret requires at least admin permissions in the organization.
is: [withNoBodyResponse, withNotFoundError]
patch:
displayName: Update a secret
description: To update the secret you need to be an admin or owner in your organization.
is: [withRequestItem: {item : SecretPatch},
withResponseItem: {item : Secret}, withNotFoundError]
/{secret_id}:
/projects:
get:
displayName: List projects for a secret
is: [withResponseItems: {item : Project}, withNotFoundError]
/teams:
get:
displayName: List teams for a secret
is: [withResponseItems: {item : Team}, withNotFoundError]
/env_vars:
get:
displayName: List environment variables belonging to a secret
is: [withResponseItems: {item : EnvVar}, withNotFoundError]
post:
displayName: Create environment variable within a secret
description: Environment variables can be only created by users who can edit the secret.
is: [withRequestItem: {item : EnvVarPost},
withResponseItem: {item : EnvVar}, withNotFoundError]
/config_files:
get:
displayName: List config files belonging to a secret
is: [withResponseItems: {item : ConfigFile}, withNotFoundError]
post:
displayName: Create a config file within a secret
description: Configuration files can be only created by users who can edit the secret.
is: [withRequestItem: {item : ConfigFilePost},
withResponseItem: {item : ConfigFile}, withNotFoundError]
/env_vars:
(stability): "development"
displayName: "Environment Variables"
/{id}:
get:
displayName: Get an environment variable
description: Displays the environment variable. Encrypted configuration files will have `null` as content.
is: [withResponseItem: {item : EnvVar}, withNotFoundError]
delete:
displayName: Delete an environment variable
description: Environment variables can be only deleted by users who has edit access on the project or the secret.
is: [withNoBodyResponse, withNotFoundError]
patch:
displayName: Update an environment variable
description: |
Environment variables can be only updated by users who has edit access on the project or the secret. Encrypted environment variables can't be edited.
is: [withRequestItem: {item : EnvVarPatch},
withResponseItem: {item : EnvVar}, withNotFoundError]
/config_files:
(stability): "development"
displayName: "Configuration Files"
/{id}:
get:
displayName: Get a config file
description: Displays the configuration file. Encrypted configuration files will have `null` as content.
is: [withResponseItem: {item : ConfigFile}, withNotFoundError]
delete:
displayName: Delete a config file
description: Configuration files can be only deleted by users who has edit access on the project or the secret.
is: [withNoBodyResponse, withNotFoundError]
patch:
displayName: Update a config file
description: |
Configuration files can be only updated by users who has edit access on the project or the secret. Encrypted environment variables can't be edited.
is: [withRequestItem: {item : ConfigFilePatch},
withResponseItem: {item : ConfigFile}, withNotFoundError]
/pipelines:
(stability): "prototype"
displayName: Pipelines
get:
displayName: List pipelines
is: [withResponseItems: {item : Pipeline}, withNotFoundError]
post:
displayName: Schedule pipeline execution
is: [withRequestItem: {item : PipelinePost},
withCreateResponse: {item : Pipeline}, withNotFoundError]
/{pipeline_id}:
get:
displayName: Describe pipeline
is: [withResponseItem: {item : PipelineDescription}, withNotFoundError]
patch:
displayName: Terminate pipeline
is: [withRequestItem: {item : PipelinePatch},
withNoBodyResponse, withNotFoundError]