· 7 years ago · Mar 28, 2018, 12:56 PM
1{
2 "swagger": "2.0",
3 "x-api-id": "skafos",
4 "info": {
5 "description": "Skafos Platform API",
6 "title": "Skafos",
7 "version": "1.0.0"
8 },
9 "host": "api.metismachine.io",
10 "basePath": "/v1",
11 "schemes": [
12 "https",
13 "http"
14 ],
15 "paths": {
16 "/api_tokens": {
17 "delete": {
18 "consumes": [
19 "application/json"
20 ],
21 "description": "Deletes the specified api token for the currently logged in user",
22 "operationId": "deleteApiToken",
23 "parameters": [
24 {
25 "description": "Token id",
26 "in": "body",
27 "name": "id",
28 "required": true,
29 "schema": {
30 "example": "D01D6572-758A-4C68-A331-943B8F7A3681",
31 "type": "string"
32 }
33 }
34 ],
35 "produces": [
36 "application/json"
37 ],
38 "responses": {
39 "200": {
40 "description": "Successful operation",
41 "schema": {
42 "example": {
43 "success": "Deleted"
44 }
45 }
46 },
47 "404": {
48 "description": "The api token was not found",
49 "schema": {
50 "example": {
51 "error": "Not Found"
52 },
53 "type": "object"
54 }
55 }
56 },
57 "summary": "Delete api token",
58 "tags": [
59 "api_tokens"
60 ]
61 },
62 "get": {
63 "description": "Returns a list of api tokens that are associated with the currently logged in user",
64 "operationId": "getApiTokens",
65 "produces": [
66 "application/json"
67 ],
68 "responses": {
69 "200": {
70 "description": "Successful operation",
71 "schema": {
72 "items": {
73 "$ref": "#/definitions/api_token"
74 },
75 "type": "array"
76 }
77 }
78 },
79 "summary": "List api tokens",
80 "tags": [
81 "api_tokens"
82 ]
83 },
84 "post": {
85 "consumes": [
86 "application/json"
87 ],
88 "description": "Creates and returns a new api token for the currently logged in user",
89 "operationId": "createApiToken",
90 "parameters": [
91 {
92 "description": "Empty request body",
93 "in": "body",
94 "name": "body",
95 "required": true,
96 "schema": {
97 "example": {},
98 "type": "object"
99 }
100 }
101 ],
102 "produces": [
103 "application/json"
104 ],
105 "responses": {
106 "200": {
107 "description": "Successful operation",
108 "schema": {
109 "$ref": "#/definitions/api_token"
110 }
111 }
112 },
113 "summary": "Create new api token",
114 "tags": [
115 "api_tokens"
116 ]
117 }
118 },
119 "/api_tokens/regenerate": {
120 "post": {
121 "consumes": [
122 "application/json"
123 ],
124 "description": "Replaces the passed in api token with a newly generated token",
125 "operationId": "regenerateApiToken",
126 "parameters": [
127 {
128 "description": "The api token to regenerate",
129 "in": "body",
130 "name": "body",
131 "required": true,
132 "schema": {
133 "example": {
134 "token": "6bc512522fb16a849ca7"
135 },
136 "properties": {
137 "token": {
138 "type": "string"
139 }
140 },
141 "type": "object"
142 }
143 }
144 ],
145 "produces": [
146 "application/json"
147 ],
148 "responses": {
149 "200": {
150 "description": "Successful operation",
151 "schema": {
152 "$ref": "#/definitions/api_token"
153 }
154 },
155 "404": {
156 "description": "The api token was not found",
157 "schema": {
158 "example": {
159 "error": "Not Found"
160 },
161 "type": "object"
162 }
163 }
164 },
165 "summary": "Regenerate an api token",
166 "tags": [
167 "api_tokens"
168 ]
169 }
170 },
171 "/data/{namespace}/{tablename}": {
172 "get": {
173 "description": "Gets requested data from the specified authorized namespace and table name",
174 "operationId": "getData",
175 "parameters": [
176 {
177 "description": "Name of the namespace. For user specific data, the namespace is the corresponding project id",
178 "in": "path",
179 "name": "namespace",
180 "required": true,
181 "type": "string"
182 },
183 {
184 "description": "Name of the table located in the namespace",
185 "in": "path",
186 "name": "tablename",
187 "required": true,
188 "type": "string"
189 },
190 {
191 "description": "Results offset cursor. Enables paging of data",
192 "in": "query",
193 "name": "cursor",
194 "required": false,
195 "type": "string"
196 },
197 {
198 "description": "The maximum count of rows to receive in a single page",
199 "in": "query",
200 "name": "per_page",
201 "required": false,
202 "type": "integer"
203 }
204 ],
205 "produces": [
206 "application/json"
207 ],
208 "responses": {
209 "200": {
210 "description": "Successful operation",
211 "schema": {
212 "$ref": "#/definitions/data"
213 }
214 },
215 "404": {
216 "description": "Invalid namespace or table name",
217 "schema": {
218 "example": {
219 "error": "Invalid namespace"
220 },
221 "type": "object"
222 }
223 }
224 },
225 "summary": "List user data",
226 "tags": [
227 "data"
228 ]
229 }
230 },
231 "/data_access": {
232 "put": {
233 "consumes": [
234 "application/json"
235 ],
236 "description": "Grants data access to an organization",
237 "operationId": "grantDataAccess",
238 "parameters": [
239 {
240 "description": "The updated data access",
241 "in": "body",
242 "name": "body",
243 "required": true,
244 "schema": {
245 "$ref": "#/definitions/data_access"
246 }
247 }
248 ],
249 "produces": [
250 "application/json"
251 ],
252 "responses": {
253 "200": {
254 "description": "Successful operation",
255 "schema": {
256 "$ref": "#/definitions/organization"
257 }
258 }
259 },
260 "summary": "Grant data access",
261 "tags": [
262 "data_access"
263 ]
264 }
265 },
266 "/deployment_metrics": {
267 "get": {
268 "description": "Returns deployment metrics",
269 "operationId": "getDeploymentMetrics",
270 "parameters": [
271 {
272 "description": "The updated data access",
273 "in": "body",
274 "name": "body",
275 "required": true,
276 "schema": {
277 "type": "object",
278 "properties": {
279 "deployment_id": {
280 "type": "string"
281 },
282 "job_ids": {
283 "type": "string",
284 "example": "<job_id>,<job_id>"
285 }
286 }
287 }
288 }
289 ],
290 "produces": [
291 "application/json"
292 ],
293 "responses": {
294 "200": {
295 "description": "Successful operation",
296 "schema": {
297 "properties": {
298 "<job_id>": {
299 "$ref": "#/definitions/deployment_metric"
300 }
301 },
302 "type": "object"
303 }
304 }
305 },
306 "summary": "Get deployment metrics",
307 "tags": [
308 "deployment_metrics"
309 ]
310 }
311 },
312 "/deployments": {
313 "post": {
314 "consumes": [
315 "application/json"
316 ],
317 "description": "Creates a new deployment",
318 "operationId": "createDeployment",
319 "parameters": [
320 {
321 "description": "The new deployment. Not all fields are required",
322 "in": "body",
323 "name": "body",
324 "required": true,
325 "schema": {
326 "$ref": "#/definitions/deployment"
327 }
328 }
329 ],
330 "produces": [
331 "application/json"
332 ],
333 "responses": {
334 "200": {
335 "description": "Successful operation",
336 "schema": {
337 "$ref": "#/definitions/deployment"
338 }
339 }
340 },
341 "summary": "Create deployment",
342 "tags": [
343 "deployments"
344 ]
345 }
346 },
347 "/deployments/{uuid}": {
348 "get": {
349 "description": "Returns a deployment that matches the specified `uuid`",
350 "operationId": "getDeployment",
351 "parameters": [
352 {
353 "description": "The deployment id",
354 "in": "path",
355 "name": "uuid",
356 "required": true,
357 "type": "string"
358 }
359 ],
360 "produces": [
361 "application/json"
362 ],
363 "responses": {
364 "200": {
365 "description": "Successful operation",
366 "schema": {
367 "$ref": "#/definitions/deployment"
368 }
369 }
370 },
371 "summary": "Get deployment",
372 "tags": [
373 "deployments"
374 ]
375 },
376 "patch": {
377 "consumes": [
378 "application/json"
379 ],
380 "description": "Update the deployment with the specified `uuid` with that values in the request body",
381 "operationId": "updateDeployment",
382 "parameters": [
383 {
384 "description": "The updated deployment values. Not all fields are required",
385 "in": "body",
386 "name": "body",
387 "required": true,
388 "schema": {
389 "$ref": "#/definitions/deployment"
390 }
391 },
392 {
393 "description": "The deployment id",
394 "in": "path",
395 "name": "uuid",
396 "required": true,
397 "type": "string"
398 }
399 ],
400 "produces": [
401 "application/json"
402 ],
403 "responses": {
404 "200": {
405 "description": "Successful operation",
406 "schema": {
407 "$ref": "#/definitions/deployment"
408 }
409 }
410 },
411 "summary": "Update deployment",
412 "tags": [
413 "deployments"
414 ]
415 },
416 "put": {
417 "consumes": [
418 "application/json"
419 ],
420 "description": "Update the deployment with the specified `uuid` with that values in the request body and regenerate the token",
421 "operationId": "regenerateDeployment",
422 "parameters": [
423 {
424 "description": "The updated deployment values. Not all fields are required",
425 "in": "body",
426 "name": "body",
427 "required": true,
428 "schema": {
429 "$ref": "#/definitions/deployment"
430 }
431 },
432 {
433 "description": "The deployment id",
434 "in": "path",
435 "name": "uuid",
436 "required": true,
437 "type": "string"
438 }
439 ],
440 "produces": [
441 "application/json"
442 ],
443 "responses": {
444 "200": {
445 "description": "Successful operation",
446 "schema": {
447 "$ref": "#/definitions/deployment"
448 }
449 }
450 },
451 "summary": "Regenerate deployment",
452 "tags": [
453 "deployments"
454 ]
455 }
456 },
457 "/deployments/{uuid}/retry": {
458 "post": {
459 "consumes": [
460 "application/json"
461 ],
462 "description": "Retry the deployment with the specified `uuid`",
463 "operationId": "retryDeployment",
464 "parameters": [
465 {
466 "description": "Empty request body",
467 "in": "body",
468 "name": "body",
469 "required": true,
470 "schema": {
471 "example": {},
472 "type": "object"
473 }
474 },
475 {
476 "description": "The deployment id",
477 "in": "path",
478 "name": "uuid",
479 "required": true,
480 "type": "string"
481 }
482 ],
483 "produces": [
484 "application/json"
485 ],
486 "responses": {
487 "200": {
488 "description": "Successful operation",
489 "schema": {
490 "type": "object",
491 "properties": {
492 "deployment_id": {
493 "type": "string"
494 }
495 }
496 }
497 }
498 },
499 "summary": "Retry deployment",
500 "tags": [
501 "deployments"
502 ]
503 }
504 },
505 "/env_vars/{project_token}": {
506 "get": {
507 "description": "Gets the environment variables that belong to the specified project",
508 "operationId": "getEnvVars",
509 "parameters": [
510 {
511 "description": "The associated project's token",
512 "in": "path",
513 "name": "project_token",
514 "required": true,
515 "type": "string"
516 }
517 ],
518 "produces": [
519 "application/json"
520 ],
521 "responses": {
522 "200": {
523 "description": "Successful operation",
524 "schema": {
525 "items": {
526 "$ref": "#/definitions/env_var"
527 },
528 "type": "array"
529 }
530 },
531 "404": {
532 "description": "The project was not found",
533 "schema": {
534 "example": "Not Found",
535 "type": "string"
536 }
537 }
538 },
539 "summary": "List environment variables",
540 "tags": [
541 "env_vars"
542 ]
543 },
544 "post": {
545 "consumes": [
546 "application/json"
547 ],
548 "description": "Upserts an environment variable",
549 "operationId": "upsertEnvVar",
550 "parameters": [
551 {
552 "description": "The environment variable",
553 "in": "body",
554 "name": "body",
555 "required": true,
556 "schema": {
557 "$ref": "#/definitions/env_var"
558 }
559 },
560 {
561 "description": "The associated project's token",
562 "in": "path",
563 "name": "project_token",
564 "required": true,
565 "type": "string"
566 }
567 ],
568 "produces": [
569 "application/json"
570 ],
571 "responses": {
572 "200": {
573 "description": "Successful operation",
574 "schema": {
575 "$ref": "#/definitions/env_var"
576 }
577 },
578 "400": {
579 "description": "The environment variable name is already taken",
580 "schema": {
581 "example": {
582 "error": "Environment variable name already taken"
583 },
584 "type": "object"
585 }
586 },
587 "404": {
588 "description": "The project was not found",
589 "schema": {
590 "example": "Not Found",
591 "type": "string"
592 }
593 }
594 },
595 "summary": "Upsert environment variable",
596 "tags": [
597 "env_vars"
598 ]
599 }
600 },
601 "/env_vars/{project_token}/{env_var_name}": {
602 "delete": {
603 "description": "Deletes the specified environment variable. Returns the deleted environment variable if the operation is successful",
604 "operationId": "deleteEnvVar",
605 "parameters": [
606 {
607 "description": "The associated project's token",
608 "in": "path",
609 "name": "project_token",
610 "required": true,
611 "type": "string"
612 },
613 {
614 "description": "The environment variable's name",
615 "in": "path",
616 "name": "env_var_name",
617 "required": true,
618 "type": "string"
619 }
620 ],
621 "produces": [
622 "application/json"
623 ],
624 "responses": {
625 "200": {
626 "description": "Successful operation",
627 "schema": {
628 "$ref": "#/definitions/env_var"
629 }
630 },
631 "404": {
632 "description": "The environment variable or project was not found",
633 "schema": {
634 "example": "Not Found",
635 "type": "string"
636 }
637 }
638 },
639 "summary": "Delete environment variable",
640 "tags": [
641 "env_vars"
642 ]
643 },
644 "get": {
645 "description": "Returns an environment variable that matches the specified name",
646 "operationId": "getEnvVar",
647 "parameters": [
648 {
649 "description": "The associated project's token",
650 "in": "path",
651 "name": "project_token",
652 "required": true,
653 "type": "string"
654 },
655 {
656 "description": "The environment variable's name",
657 "in": "path",
658 "name": "env_var_name",
659 "required": true,
660 "type": "string"
661 }
662 ],
663 "produces": [
664 "application/json"
665 ],
666 "responses": {
667 "200": {
668 "description": "Successful operation",
669 "schema": {
670 "$ref": "#/definitions/env_var"
671 }
672 },
673 "404": {
674 "description": "The environment variable or project was not found",
675 "schema": {
676 "example": "Not Found",
677 "type": "string"
678 }
679 }
680 },
681 "summary": "Get environment variable",
682 "tags": [
683 "env_vars"
684 ]
685 }
686 },
687 "/jobs": {
688 "get": {
689 "description": "Returns the jobs associated with the logged in user",
690 "operationId": "getJobs",
691 "produces": [
692 "application/json"
693 ],
694 "responses": {
695 "200": {
696 "description": "Successful operation",
697 "schema": {
698 "type": "array",
699 "items": {
700 "$ref": "#/definitions/job"
701 }
702 }
703 }
704 },
705 "summary": "Get jobs",
706 "tags": [
707 "jobs"
708 ]
709 },
710 "post": {
711 "description": "Create a new job",
712 "operationId": "createJob",
713 "parameters": [
714 {
715 "description": "The job values",
716 "in": "body",
717 "name": "body",
718 "required": true,
719 "schema": {
720 "properties": {
721 "project_token": {
722 "type": "string"
723 }
724 },
725 "type": "object"
726 }
727 }
728 ],
729 "produces": [
730 "application/json"
731 ],
732 "responses": {
733 "200": {
734 "description": "Successful operation",
735 "schema": {
736 "$ref": "#/definitions/job"
737 }
738 }
739 },
740 "summary": "Create job",
741 "tags": [
742 "jobs"
743 ]
744 }
745 },
746 "/jobs/{id}": {
747 "delete": {
748 "description": "Deletes the specified project",
749 "operationId": "deleteJob",
750 "parameters": [
751 {
752 "description": "The job's id",
753 "in": "path",
754 "name": "id",
755 "required": true,
756 "type": "string"
757 }
758 ],
759 "produces": [
760 "application/json"
761 ],
762 "responses": {
763 "200": {
764 "description": "Successful operation",
765 "schema": {
766 "example": {
767 "success": "Deleted"
768 },
769 "type": "object"
770 }
771 }
772 },
773 "summary": "Delete job",
774 "tags": [
775 "jobs"
776 ]
777 },
778 "get": {
779 "description": "Returns the job with the specified id",
780 "operationId": "getJob",
781 "parameters": [
782 {
783 "description": "The job's id",
784 "in": "path",
785 "name": "id",
786 "required": true,
787 "type": "string"
788 }
789 ],
790 "produces": [
791 "application/json"
792 ],
793 "responses": {
794 "200": {
795 "description": "Successful operation",
796 "schema": {
797 "$ref": "#/definitions/job"
798 }
799 }
800 },
801 "summary": "Get job",
802 "tags": [
803 "jobs"
804 ]
805 },
806 "patch": {
807 "description": "Updates the specified job's name and config",
808 "operationId": "updateJob",
809 "parameters": [
810 {
811 "description": "The job's id",
812 "in": "path",
813 "name": "id",
814 "required": true,
815 "type": "string"
816 },
817 {
818 "description": "The updated job values. Not all fields are required",
819 "in": "body",
820 "name": "body",
821 "required": true,
822 "schema": {
823 "$ref": "#/definitions/job"
824 }
825 }
826 ],
827 "produces": [
828 "application/json"
829 ],
830 "responses": {
831 "200": {
832 "description": "Successful operation",
833 "schema": {
834 "$ref": "#/definitions/job"
835 }
836 }
837 },
838 "summary": "Update project",
839 "tags": [
840 "jobs"
841 ]
842 }
843 },
844 "/jobs/kill": {
845 "post": {
846 "consumes": [
847 "application/json"
848 ],
849 "description": "Kills jobs",
850 "operationId": "killJobs",
851 "parameters": [
852 {
853 "description": "The ids to kill",
854 "in": "body",
855 "name": "body",
856 "required": true,
857 "schema": {
858 "properties": {
859 "job_ids": {
860 "type": "array",
861 "items": {
862 "type": "string"
863 }
864 }
865 },
866 "type": "object"
867 }
868 },
869 {
870 "description": "The associated job's id",
871 "in": "path",
872 "name": "job_id",
873 "required": true,
874 "type": "string"
875 }
876 ],
877 "produces": [
878 "application/json"
879 ],
880 "responses": {
881 "200": {
882 "description": "Successful operation"
883 }
884 },
885 "summary": "Kill jobs",
886 "tags": [
887 "jobs"
888 ]
889 }
890 },
891 "/jobs/{job_id}/kill": {
892 "post": {
893 "consumes": [
894 "application/json"
895 ],
896 "description": "Kills jobs",
897 "operationId": "killJobsWithDeployments",
898 "parameters": [
899 {
900 "description": "The associated job's id",
901 "in": "path",
902 "name": "job_id",
903 "required": true,
904 "type": "string"
905 }
906 ],
907 "produces": [
908 "application/json"
909 ],
910 "responses": {
911 "200": {
912 "description": "Successful operation"
913 }
914 },
915 "summary": "Kill jobs with deployments",
916 "tags": [
917 "jobs"
918 ]
919 }
920 },
921 "/last_deployment/{project_token}": {
922 "get": {
923 "description": "Returns the last run deployment for the specified project",
924 "operationId": "getLastDeployment",
925 "parameters": [
926 {
927 "description": "The associated project's token",
928 "in": "path",
929 "name": "project_token",
930 "required": true,
931 "type": "string"
932 }
933 ],
934 "produces": [
935 "application/json"
936 ],
937 "responses": {
938 "200": {
939 "description": "Successful operation. Only deployment `id` and `inserted_at` are returned",
940 "schema": {
941 "$ref": "#/definitions/deployment"
942 }
943 },
944 "404": {
945 "description": "The project was not found",
946 "schema": {
947 "example": "Not Found",
948 "type": "string"
949 }
950 }
951 },
952 "summary": "Get last run deployment",
953 "tags": [
954 "last_deployment"
955 ]
956 }
957 },
958 "/organizations": {
959 "get": {
960 "description": "Returns a list of organizations (with it's data access) associated with the currently logged in user",
961 "operationId": "getOrganizations",
962 "responses": {
963 "200": {
964 "description": "Successful operation",
965 "schema": {
966 "items": {
967 "$ref": "#/definitions/organization"
968 },
969 "type": "array"
970 }
971 }
972 },
973 "summary": "List organizations",
974 "tags": [
975 "organizations"
976 ]
977 },
978 "post": {
979 "consumes": [
980 "application/json"
981 ],
982 "description": "Returns a list of organizations associated with the user with the specified email address",
983 "operationId": "getOrganizationsByEmail",
984 "parameters": [
985 {
986 "description": "body",
987 "in": "body",
988 "name": "body",
989 "required": true,
990 "schema": {
991 "example": {
992 "email": "email@example.com"
993 },
994 "properties": {
995 "email": {
996 "type": "string"
997 }
998 },
999 "type": "object"
1000 }
1001 }
1002 ],
1003 "produces": [
1004 "application/json"
1005 ],
1006 "responses": {
1007 "200": {
1008 "description": "Successful operation",
1009 "schema": {
1010 "items": {
1011 "properties": {
1012 "display_name": {
1013 "type": "string"
1014 },
1015 "id": {
1016 "type": "string"
1017 },
1018 "inserted_at": {
1019 "type": "string"
1020 },
1021 "owner_id": {
1022 "type": "string"
1023 },
1024 "updated_at": {
1025 "type": "string"
1026 }
1027 },
1028 "type": "object"
1029 },
1030 "type": "array"
1031 }
1032 }
1033 },
1034 "summary": "List organizations by email",
1035 "tags": [
1036 "organizations"
1037 ]
1038 }
1039 },
1040 "/projects": {
1041 "get": {
1042 "description": "Returns a list of all projects associated with the currently logged in user",
1043 "operationId": "getProjects",
1044 "responses": {
1045 "200": {
1046 "description": "Successful operation",
1047 "schema": {
1048 "items": {
1049 "$ref": "#/definitions/project"
1050 },
1051 "type": "array"
1052 }
1053 }
1054 },
1055 "summary": "List projects",
1056 "tags": [
1057 "projects"
1058 ]
1059 },
1060 "post": {
1061 "consumes": [
1062 "application/json"
1063 ],
1064 "description": "Creates and returns a new project",
1065 "operationId": "createProject",
1066 "parameters": [
1067 {
1068 "description": "The project to create. Only the `name` field is required",
1069 "in": "body",
1070 "name": "body",
1071 "required": true,
1072 "schema": {
1073 "$ref": "#/definitions/project"
1074 }
1075 }
1076 ],
1077 "produces": [
1078 "application/json"
1079 ],
1080 "responses": {
1081 "200": {
1082 "description": "Successful operation",
1083 "schema": {
1084 "$ref": "#/definitions/project"
1085 }
1086 },
1087 "400": {
1088 "description": "Invalid name",
1089 "schema": {
1090 "example": {
1091 "name": [
1092 "is invalid"
1093 ]
1094 },
1095 "type": "object"
1096 }
1097 }
1098 },
1099 "summary": "Create new project",
1100 "tags": [
1101 "projects"
1102 ]
1103 }
1104 },
1105 "/projects/{token}": {
1106 "delete": {
1107 "description": "Deletes the specified project",
1108 "operationId": "deleteProject",
1109 "parameters": [
1110 {
1111 "description": "The project's token",
1112 "in": "path",
1113 "name": "token",
1114 "required": true,
1115 "type": "string"
1116 }
1117 ],
1118 "produces": [
1119 "application/json"
1120 ],
1121 "responses": {
1122 "200": {
1123 "description": "Successful operation",
1124 "schema": {
1125 "example": {
1126 "success": "Deleted"
1127 },
1128 "type": "object"
1129 }
1130 }
1131 },
1132 "summary": "Delete project",
1133 "tags": [
1134 "projects"
1135 ]
1136 },
1137 "get": {
1138 "description": "Returns the project with the specified token",
1139 "operationId": "getProject",
1140 "parameters": [
1141 {
1142 "description": "The project's token",
1143 "in": "path",
1144 "name": "token",
1145 "required": true,
1146 "type": "string"
1147 }
1148 ],
1149 "produces": [
1150 "application/json"
1151 ],
1152 "responses": {
1153 "200": {
1154 "description": "Successful operation",
1155 "schema": {
1156 "$ref": "#/definitions/project"
1157 }
1158 }
1159 },
1160 "summary": "Get project",
1161 "tags": [
1162 "projects"
1163 ]
1164 },
1165 "patch": {
1166 "description": "Updates the specified projects description, name, and repo_url",
1167 "operationId": "updateProject",
1168 "parameters": [
1169 {
1170 "description": "The updated project values. Can only change description, name, and repo_url",
1171 "in": "body",
1172 "name": "body",
1173 "required": true,
1174 "schema": {
1175 "$ref": "#/definitions/project"
1176 }
1177 },
1178 {
1179 "description": "The project's token",
1180 "in": "path",
1181 "name": "token",
1182 "required": true,
1183 "type": "string"
1184 }
1185 ],
1186 "produces": [
1187 "application/json"
1188 ],
1189 "responses": {
1190 "200": {
1191 "description": "Successful operation",
1192 "schema": {
1193 "$ref": "#/definitions/project"
1194 }
1195 }
1196 },
1197 "summary": "Update project",
1198 "tags": [
1199 "projects"
1200 ]
1201 }
1202 },
1203 "/projects/{project_token}/deployments": {
1204 "get": {
1205 "description": "Get deployments for the specified project",
1206 "operationId": "getDeployments",
1207 "parameters": [
1208 {
1209 "description": "The associated project's token",
1210 "in": "path",
1211 "name": "project_token",
1212 "required": true,
1213 "type": "string"
1214 }
1215 ],
1216 "produces": [
1217 "application/json"
1218 ],
1219 "responses": {
1220 "200": {
1221 "description": "Successful operation",
1222 "schema": {
1223 "type": "array",
1224 "items": {
1225 "$ref": "#/definitions/deployment"
1226 }
1227 }
1228 }
1229 },
1230 "summary": "Get deployments",
1231 "tags": [
1232 "deployments"
1233 ]
1234 }
1235 },
1236 "/projects/{project_token}/jobs": {
1237 "get": {
1238 "description": "Returns a list of all jobs associated with the project",
1239 "operationId": "getJobsForProject",
1240 "parameters": [
1241 {
1242 "description": "The associated project's token",
1243 "in": "path",
1244 "name": "project_token",
1245 "required": true,
1246 "type": "string"
1247 }
1248 ],
1249 "responses": {
1250 "200": {
1251 "description": "Successful operation",
1252 "schema": {
1253 "items": {
1254 "$ref": "#/definitions/job"
1255 },
1256 "type": "array"
1257 }
1258 }
1259 },
1260 "summary": "List jobs",
1261 "tags": [
1262 "jobs"
1263 ]
1264 },
1265 "post": {
1266 "consumes": [
1267 "application/json"
1268 ],
1269 "description": "Creates and returns a new job",
1270 "operationId": "createJobsForProject",
1271 "parameters": [
1272 {
1273 "description": "The job attributes to update",
1274 "in": "body",
1275 "name": "body",
1276 "required": true,
1277 "schema": {
1278 "example": {
1279 "name": "ingestor"
1280 },
1281 "properties": {
1282 "name": {
1283 "type": "string"
1284 },
1285 "config": {
1286 "type": "object"
1287 }
1288 },
1289 "type": "object"
1290 }
1291 },
1292 {
1293 "description": "The associated project's token",
1294 "in": "path",
1295 "name": "project_token",
1296 "required": true,
1297 "type": "string"
1298 }
1299 ],
1300 "produces": [
1301 "application/json"
1302 ],
1303 "responses": {
1304 "200": {
1305 "description": "Successful operation",
1306 "schema": {
1307 "$ref": "#/definitions/job"
1308 }
1309 },
1310 "400": {
1311 "description": "Invalid name",
1312 "schema": {
1313 "example": {
1314 "name": [
1315 "is invalid"
1316 ]
1317 },
1318 "type": "object"
1319 }
1320 }
1321 },
1322 "summary": "Create new job",
1323 "tags": [
1324 "jobs"
1325 ]
1326 }
1327 },
1328 "/projects/{project_token}/kill": {
1329 "post": {
1330 "consumes": [
1331 "application/json"
1332 ],
1333 "description": "Kills project",
1334 "operationId": "killProject",
1335 "parameters": [
1336 {
1337 "description": "The ids to kill",
1338 "in": "body",
1339 "name": "body",
1340 "required": true,
1341 "schema": {
1342 "properties": {
1343 "deployments": {
1344 "type": "array",
1345 "items": {
1346 "type": "object",
1347 "properties": {
1348 "deployment_id": {
1349 "type": "string"
1350 },
1351 "job_ids": {
1352 "type": "array",
1353 "items": {
1354 "type": "string"
1355 }
1356 }
1357 }
1358 }
1359 }
1360 },
1361 "type": "object"
1362 }
1363 },
1364 {
1365 "description": "The associated project's token",
1366 "in": "path",
1367 "name": "project_token",
1368 "required": true,
1369 "type": "string"
1370 }
1371 ],
1372 "produces": [
1373 "application/json"
1374 ],
1375 "responses": {
1376 "200": {
1377 "description": "Successful operation"
1378 }
1379 },
1380 "summary": "Kill project",
1381 "tags": [
1382 "projects"
1383 ]
1384 }
1385 },
1386 "/projects/{token}/regenerate": {
1387 "post": {
1388 "consumes": [
1389 "application/json"
1390 ],
1391 "description": "Regenerates the specified project's secret token",
1392 "operationId": "regenerateProject",
1393 "parameters": [
1394 {
1395 "description": "Empty request body",
1396 "in": "body",
1397 "name": "body",
1398 "required": true,
1399 "schema": {
1400 "example": {},
1401 "type": "object"
1402 }
1403 },
1404 {
1405 "description": "The project's token",
1406 "in": "path",
1407 "name": "token",
1408 "required": true,
1409 "type": "string"
1410 }
1411 ],
1412 "produces": [
1413 "application/json"
1414 ],
1415 "responses": {
1416 "200": {
1417 "description": "Successful operation"
1418 }
1419 },
1420 "summary": "Regenerate project secret",
1421 "tags": [
1422 "projects"
1423 ]
1424 }
1425 },
1426 "/status": {
1427 "get": {
1428 "description": "Returns the status of the server",
1429 "operationId": "getStatus",
1430 "produces": [
1431 "application/json"
1432 ],
1433 "responses": {
1434 "200": {
1435 "description": "Successful operation",
1436 "schema": {
1437 "properties": {
1438 "alive": {
1439 "type": "boolean"
1440 },
1441 "services": {
1442 "type": "object",
1443 "properties": {
1444 "<service_name>": {
1445 "$ref": "#/definitions/service_status"
1446 }
1447 }
1448 },
1449 "start_date": {
1450 "type": "string"
1451 },
1452 "version": {
1453 "type": "string"
1454 }
1455 },
1456 "type": "object"
1457 }
1458 }
1459 },
1460 "summary": "Get server status",
1461 "tags": [
1462 "status"
1463 ]
1464 }
1465 },
1466 "/users/change_password": {
1467 "post": {
1468 "consumes": [
1469 "application/json"
1470 ],
1471 "description": "Changes the currently logged in users password",
1472 "operationId": "changeUserPassword",
1473 "parameters": [
1474 {
1475 "description": "The user's passwords",
1476 "in": "body",
1477 "name": "body",
1478 "required": true,
1479 "schema": {
1480 "example": {
1481 "old_password": "old_password",
1482 "password": "password"
1483 },
1484 "type": "object"
1485 }
1486 }
1487 ],
1488 "produces": [
1489 "application/json"
1490 ],
1491 "responses": {
1492 "200": {
1493 "description": "Successful operation",
1494 "schema": {
1495 "example": {
1496 "success": true
1497 },
1498 "type": "object"
1499 }
1500 }
1501 },
1502 "summary": "Change password",
1503 "tags": [
1504 "users"
1505 ]
1506 }
1507 },
1508 "/users/login": {
1509 "post": {
1510 "consumes": [
1511 "application/json"
1512 ],
1513 "description": "Logs in a user",
1514 "operationId": "logInUser",
1515 "parameters": [
1516 {
1517 "description": "The user's information",
1518 "in": "body",
1519 "name": "body",
1520 "required": true,
1521 "schema": {
1522 "example": {
1523 "client_id": "6bc512522fb16a849ca7",
1524 "email": "example@domain.com",
1525 "grant_type": "password",
1526 "password": "password"
1527 },
1528 "type": "object"
1529 }
1530 }
1531 ],
1532 "produces": [
1533 "application/json"
1534 ],
1535 "responses": {
1536 "200": {
1537 "description": "Successful operation",
1538 "schema": {
1539 "example": {
1540 "expires_at": 1515777675,
1541 "profile": {},
1542 "token": "6bc512522fb16a849ca7",
1543 "user_id": "D01D6572-758A-4C68-A331-943B8F7A3681"
1544 },
1545 "type": "object"
1546 }
1547 }
1548 },
1549 "summary": "Log in user",
1550 "tags": [
1551 "users"
1552 ]
1553 }
1554 },
1555 "/users/logout": {
1556 "delete": {
1557 "description": "Logs out the currently logged in user",
1558 "operationId": "logOutUser",
1559 "produces": [
1560 "application/json"
1561 ],
1562 "responses": {
1563 "200": {
1564 "description": "Successful operation",
1565 "schema": {
1566 "example": {
1567 "success": true
1568 },
1569 "type": "object"
1570 }
1571 }
1572 },
1573 "summary": "Log out user",
1574 "tags": [
1575 "users"
1576 ]
1577 }
1578 },
1579 "/users/me": {
1580 "get": {
1581 "description": "Returns the currently logged in user's information",
1582 "operationId": "user",
1583 "produces": [
1584 "application/json"
1585 ],
1586 "responses": {
1587 "200": {
1588 "description": "Successful operation"
1589 }
1590 },
1591 "summary": "User information",
1592 "tags": [
1593 "users"
1594 ]
1595 }
1596 },
1597 "/users/register": {
1598 "post": {
1599 "consumes": [
1600 "application/json"
1601 ],
1602 "description": "Signs up a new user",
1603 "operationId": "registerUser",
1604 "parameters": [
1605 {
1606 "description": "",
1607 "in": "body",
1608 "name": "body",
1609 "required": true,
1610 "schema": {
1611 "example": {
1612 "email": "example@domain.com",
1613 "password": "password",
1614 "setting": {}
1615 },
1616 "type": "object"
1617 }
1618 }
1619 ],
1620 "produces": [
1621 "application/json"
1622 ],
1623 "responses": {
1624 "200": {
1625 "description": "Successful operation"
1626 }
1627 },
1628 "summary": "Register user",
1629 "tags": [
1630 "users"
1631 ]
1632 }
1633 },
1634 "/users/reset_password": {
1635 "post": {
1636 "consumes": [
1637 "application/json"
1638 ],
1639 "description": "Generates and sends the user an email with a link to reset their password",
1640 "operationId": "emailResetPasswordLink",
1641 "parameters": [
1642 {
1643 "description": "The user's email and information used to generate reset email",
1644 "in": "body",
1645 "name": "body",
1646 "required": true,
1647 "schema": {
1648 "example": {
1649 "email": "example@domain.com",
1650 "new_link_url": "link_to_request_another_email.com",
1651 "redirect_url": "link_to_password_reset_fields.com"
1652 },
1653 "type": "object"
1654 }
1655 }
1656 ],
1657 "produces": [
1658 "application/json"
1659 ],
1660 "responses": {
1661 "200": {
1662 "description": "Successful operation",
1663 "schema": {
1664 "example": {
1665 "success": true
1666 },
1667 "type": "object"
1668 }
1669 },
1670 "400": {
1671 "description": "Redirect url is missing",
1672 "schema": {
1673 "example": {
1674 "error": "Redirect url is required"
1675 },
1676 "type": "object"
1677 }
1678 }
1679 },
1680 "summary": "Request reset link",
1681 "tags": [
1682 "users"
1683 ]
1684 }
1685 },
1686 "/users/reset_password/{token}": {
1687 "post": {
1688 "consumes": [
1689 "application/json"
1690 ],
1691 "description": "Resets a user's password to the specified values",
1692 "operationId": "resetPassword",
1693 "parameters": [
1694 {
1695 "description": "The user's information",
1696 "in": "body",
1697 "name": "body",
1698 "required": true,
1699 "schema": {
1700 "example": {
1701 "email": "example@domain.com",
1702 "password": "new_password"
1703 },
1704 "type": "object"
1705 }
1706 },
1707 {
1708 "description": "The token generated and sent in reset email as part of link",
1709 "in": "path",
1710 "name": "token",
1711 "required": true,
1712 "type": "string"
1713 }
1714 ],
1715 "produces": [
1716 "application/json"
1717 ],
1718 "responses": {
1719 "200": {
1720 "description": "Successful operation"
1721 }
1722 },
1723 "summary": "Reset password",
1724 "tags": [
1725 "users"
1726 ]
1727 }
1728 }
1729 },
1730 "definitions": {
1731 "api_token": {
1732 "type": "object",
1733 "properties": {
1734 "id": {
1735 "type": "string"
1736 },
1737 "inserted_at": {
1738 "type": "string"
1739 },
1740 "is_active": {
1741 "type": "boolean"
1742 },
1743 "settings": {
1744 "type": "object"
1745 },
1746 "updated_at": {
1747 "type": "string"
1748 },
1749 "user_id": {
1750 "type": "string"
1751 }
1752 }
1753 },
1754 "data": {
1755 "type": "object",
1756 "properties": {
1757 "cursor": {
1758 "type": "string"
1759 },
1760 "data": {
1761 "items": {
1762 "type": "object"
1763 },
1764 "type": "array"
1765 }
1766 }
1767 },
1768 "data_access": {
1769 "type": "object",
1770 "properties": {
1771 "granted_org_id": {
1772 "type": "string"
1773 },
1774 "grantor_org_id": {
1775 "type": "string"
1776 },
1777 "project_token": {
1778 "type": "string"
1779 },
1780 "permissions": {
1781 "items": {
1782 "type": "string"
1783 },
1784 "type": "array"
1785 },
1786 "table_name": {
1787 "type": "string"
1788 }
1789 }
1790 },
1791 "deployment": {
1792 "type": "object",
1793 "properties": {
1794 "company_id": {
1795 "type": "string"
1796 },
1797 "context": {
1798 "type": "string"
1799 },
1800 "id": {
1801 "type": "string"
1802 },
1803 "image_url": {
1804 "type": "string"
1805 },
1806 "inserted_at": {
1807 "type": "string"
1808 },
1809 "installation_id": {
1810 "type": "integer"
1811 },
1812 "max_retry_count": {
1813 "type": "string"
1814 },
1815 "name": {
1816 "type": "string"
1817 },
1818 "project_token": {
1819 "type": "string"
1820 },
1821 "repo_branch": {
1822 "type": "string"
1823 },
1824 "repo_id": {
1825 "type": "string"
1826 },
1827 "repo_url": {
1828 "type": "string"
1829 },
1830 "retry_count": {
1831 "type": "string"
1832 },
1833 "token": {
1834 "type": "string"
1835 },
1836 "type": {
1837 "type": "string"
1838 },
1839 "version": {
1840 "type": "string"
1841 }
1842 }
1843 },
1844 "deployment_metric": {
1845 "type": "object",
1846 "properties": {
1847 "metric": {
1848 "type": "string"
1849 },
1850 "values": {
1851 "items": {
1852 "type": "object",
1853 "properties": {
1854 "timestamp": {
1855 "type": "number"
1856 },
1857 "value": {
1858 "type": "string"
1859 }
1860 }
1861 },
1862 "type": "array"
1863 }
1864 }
1865 },
1866 "env_var": {
1867 "type": "object",
1868 "properties": {
1869 "id": {
1870 "type": "integer"
1871 },
1872 "inserted_at": {
1873 "type": "string"
1874 },
1875 "name": {
1876 "type": "string"
1877 },
1878 "secret_key": {
1879 "type": "string"
1880 },
1881 "secret_name": {
1882 "type": "string"
1883 },
1884 "token": {
1885 "type": "string"
1886 },
1887 "updated_at": {
1888 "type": "string"
1889 },
1890 "value": {
1891 "type": "string"
1892 }
1893 }
1894 },
1895 "job": {
1896 "type": "object",
1897 "properties": {
1898 "config": {
1899 "type": "object"
1900 },
1901 "id": {
1902 "type": "string"
1903 },
1904 "name": {
1905 "type": "string"
1906 },
1907 "project_token": {
1908 "type": "string"
1909 },
1910 "status": {
1911 "type": "string"
1912 }
1913 }
1914 },
1915 "organization": {
1916 "type": "object",
1917 "properties": {
1918 "display_name": {
1919 "type": "string"
1920 },
1921 "id": {
1922 "type": "integer"
1923 },
1924 "inserted_at": {
1925 "type": "string"
1926 },
1927 "granted_data_access": {
1928 "items": {
1929 "$ref": "#/definitions/data_access"
1930 },
1931 "type": "array"
1932 },
1933 "owner_id": {
1934 "type": "string"
1935 },
1936 "received_data_access": {
1937 "items": {
1938 "$ref": "#/definitions/data_access"
1939 },
1940 "type": "array"
1941 },
1942 "updated_at": {
1943 "type": "string"
1944 }
1945 }
1946 },
1947 "project": {
1948 "type": "object",
1949 "properties": {
1950 "company_id": {
1951 "type": "string"
1952 },
1953 "config": {
1954 "type": "object"
1955 },
1956 "confirmed": {
1957 "type": "boolean"
1958 },
1959 "creator_id": {
1960 "type": "string"
1961 },
1962 "description": {
1963 "type": "string"
1964 },
1965 "id": {
1966 "type": "integer"
1967 },
1968 "inserted_at": {
1969 "type": "string"
1970 },
1971 "name": {
1972 "type": "string"
1973 },
1974 "repo_url": {
1975 "type": "string"
1976 },
1977 "secret": {
1978 "type": "string"
1979 },
1980 "token": {
1981 "type": "string"
1982 },
1983 "updated_at": {
1984 "type": "string"
1985 }
1986 }
1987 },
1988 "service_status": {
1989 "type": "object",
1990 "properties": {
1991 "alive": {
1992 "type": "boolean"
1993 }
1994 }
1995 }
1996 },
1997 "tags": [
1998 {
1999 "name": "api_tokens",
2000 "description": "Manage api access tokens"
2001 },
2002 {
2003 "name": "data",
2004 "description": "Access user generated data"
2005 },
2006 {
2007 "name": "data_access",
2008 "description": "Manage data access"
2009 },
2010 {
2011 "name": "deployment_metrics",
2012 "description": "View deployment metrics"
2013 },
2014 {
2015 "name": "deployments",
2016 "description": "Manage deployments"
2017 },
2018 {
2019 "name": "env_vars",
2020 "description": "Manage environment variables"
2021 },
2022 {
2023 "name": "jobs",
2024 "description": "Manage jobs"
2025 },
2026 {
2027 "name": "last_deployment",
2028 "description": "Query last run deployment metrics"
2029 },
2030 {
2031 "name": "organizations",
2032 "description": "Manage organizations"
2033 },
2034 {
2035 "name": "projects",
2036 "description": "Manage projects"
2037 },
2038 {
2039 "name": "status",
2040 "description": "Query service metrics"
2041 },
2042 {
2043 "name": "users",
2044 "description": "Manage users and their sessions"
2045 }
2046 ],
2047 "externalDocs": {
2048 "description": "Find other Metis Machine docs here",
2049 "url": "https://docs.metismachine.io"
2050 }
2051}