· 7 years ago · Mar 28, 2018, 12:58 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 "produces": [
871 "application/json"
872 ],
873 "responses": {
874 "200": {
875 "description": "Successful operation"
876 }
877 },
878 "summary": "Kill jobs",
879 "tags": [
880 "jobs"
881 ]
882 }
883 },
884 "/jobs/{job_id}/kill": {
885 "post": {
886 "consumes": [
887 "application/json"
888 ],
889 "description": "Kills jobs",
890 "operationId": "killJobsWithDeployments",
891 "parameters": [
892 {
893 "description": "The associated job's id",
894 "in": "path",
895 "name": "job_id",
896 "required": true,
897 "type": "string"
898 }
899 ],
900 "produces": [
901 "application/json"
902 ],
903 "responses": {
904 "200": {
905 "description": "Successful operation"
906 }
907 },
908 "summary": "Kill jobs with deployments",
909 "tags": [
910 "jobs"
911 ]
912 }
913 },
914 "/last_deployment/{project_token}": {
915 "get": {
916 "description": "Returns the last run deployment for the specified project",
917 "operationId": "getLastDeployment",
918 "parameters": [
919 {
920 "description": "The associated project's token",
921 "in": "path",
922 "name": "project_token",
923 "required": true,
924 "type": "string"
925 }
926 ],
927 "produces": [
928 "application/json"
929 ],
930 "responses": {
931 "200": {
932 "description": "Successful operation. Only deployment `id` and `inserted_at` are returned",
933 "schema": {
934 "$ref": "#/definitions/deployment"
935 }
936 },
937 "404": {
938 "description": "The project was not found",
939 "schema": {
940 "example": "Not Found",
941 "type": "string"
942 }
943 }
944 },
945 "summary": "Get last run deployment",
946 "tags": [
947 "last_deployment"
948 ]
949 }
950 },
951 "/organizations": {
952 "get": {
953 "description": "Returns a list of organizations (with it's data access) associated with the currently logged in user",
954 "operationId": "getOrganizations",
955 "responses": {
956 "200": {
957 "description": "Successful operation",
958 "schema": {
959 "items": {
960 "$ref": "#/definitions/organization"
961 },
962 "type": "array"
963 }
964 }
965 },
966 "summary": "List organizations",
967 "tags": [
968 "organizations"
969 ]
970 },
971 "post": {
972 "consumes": [
973 "application/json"
974 ],
975 "description": "Returns a list of organizations associated with the user with the specified email address",
976 "operationId": "getOrganizationsByEmail",
977 "parameters": [
978 {
979 "description": "body",
980 "in": "body",
981 "name": "body",
982 "required": true,
983 "schema": {
984 "example": {
985 "email": "email@example.com"
986 },
987 "properties": {
988 "email": {
989 "type": "string"
990 }
991 },
992 "type": "object"
993 }
994 }
995 ],
996 "produces": [
997 "application/json"
998 ],
999 "responses": {
1000 "200": {
1001 "description": "Successful operation",
1002 "schema": {
1003 "items": {
1004 "properties": {
1005 "display_name": {
1006 "type": "string"
1007 },
1008 "id": {
1009 "type": "string"
1010 },
1011 "inserted_at": {
1012 "type": "string"
1013 },
1014 "owner_id": {
1015 "type": "string"
1016 },
1017 "updated_at": {
1018 "type": "string"
1019 }
1020 },
1021 "type": "object"
1022 },
1023 "type": "array"
1024 }
1025 }
1026 },
1027 "summary": "List organizations by email",
1028 "tags": [
1029 "organizations"
1030 ]
1031 }
1032 },
1033 "/projects": {
1034 "get": {
1035 "description": "Returns a list of all projects associated with the currently logged in user",
1036 "operationId": "getProjects",
1037 "responses": {
1038 "200": {
1039 "description": "Successful operation",
1040 "schema": {
1041 "items": {
1042 "$ref": "#/definitions/project"
1043 },
1044 "type": "array"
1045 }
1046 }
1047 },
1048 "summary": "List projects",
1049 "tags": [
1050 "projects"
1051 ]
1052 },
1053 "post": {
1054 "consumes": [
1055 "application/json"
1056 ],
1057 "description": "Creates and returns a new project",
1058 "operationId": "createProject",
1059 "parameters": [
1060 {
1061 "description": "The project to create. Only the `name` field is required",
1062 "in": "body",
1063 "name": "body",
1064 "required": true,
1065 "schema": {
1066 "$ref": "#/definitions/project"
1067 }
1068 }
1069 ],
1070 "produces": [
1071 "application/json"
1072 ],
1073 "responses": {
1074 "200": {
1075 "description": "Successful operation",
1076 "schema": {
1077 "$ref": "#/definitions/project"
1078 }
1079 },
1080 "400": {
1081 "description": "Invalid name",
1082 "schema": {
1083 "example": {
1084 "name": [
1085 "is invalid"
1086 ]
1087 },
1088 "type": "object"
1089 }
1090 }
1091 },
1092 "summary": "Create new project",
1093 "tags": [
1094 "projects"
1095 ]
1096 }
1097 },
1098 "/projects/{token}": {
1099 "delete": {
1100 "description": "Deletes the specified project",
1101 "operationId": "deleteProject",
1102 "parameters": [
1103 {
1104 "description": "The project's token",
1105 "in": "path",
1106 "name": "token",
1107 "required": true,
1108 "type": "string"
1109 }
1110 ],
1111 "produces": [
1112 "application/json"
1113 ],
1114 "responses": {
1115 "200": {
1116 "description": "Successful operation",
1117 "schema": {
1118 "example": {
1119 "success": "Deleted"
1120 },
1121 "type": "object"
1122 }
1123 }
1124 },
1125 "summary": "Delete project",
1126 "tags": [
1127 "projects"
1128 ]
1129 },
1130 "get": {
1131 "description": "Returns the project with the specified token",
1132 "operationId": "getProject",
1133 "parameters": [
1134 {
1135 "description": "The project's token",
1136 "in": "path",
1137 "name": "token",
1138 "required": true,
1139 "type": "string"
1140 }
1141 ],
1142 "produces": [
1143 "application/json"
1144 ],
1145 "responses": {
1146 "200": {
1147 "description": "Successful operation",
1148 "schema": {
1149 "$ref": "#/definitions/project"
1150 }
1151 }
1152 },
1153 "summary": "Get project",
1154 "tags": [
1155 "projects"
1156 ]
1157 },
1158 "patch": {
1159 "description": "Updates the specified projects description, name, and repo_url",
1160 "operationId": "updateProject",
1161 "parameters": [
1162 {
1163 "description": "The updated project values. Can only change description, name, and repo_url",
1164 "in": "body",
1165 "name": "body",
1166 "required": true,
1167 "schema": {
1168 "$ref": "#/definitions/project"
1169 }
1170 },
1171 {
1172 "description": "The project's token",
1173 "in": "path",
1174 "name": "token",
1175 "required": true,
1176 "type": "string"
1177 }
1178 ],
1179 "produces": [
1180 "application/json"
1181 ],
1182 "responses": {
1183 "200": {
1184 "description": "Successful operation",
1185 "schema": {
1186 "$ref": "#/definitions/project"
1187 }
1188 }
1189 },
1190 "summary": "Update project",
1191 "tags": [
1192 "projects"
1193 ]
1194 }
1195 },
1196 "/projects/{project_token}/deployments": {
1197 "get": {
1198 "description": "Get deployments for the specified project",
1199 "operationId": "getDeployments",
1200 "parameters": [
1201 {
1202 "description": "The associated project's token",
1203 "in": "path",
1204 "name": "project_token",
1205 "required": true,
1206 "type": "string"
1207 }
1208 ],
1209 "produces": [
1210 "application/json"
1211 ],
1212 "responses": {
1213 "200": {
1214 "description": "Successful operation",
1215 "schema": {
1216 "type": "array",
1217 "items": {
1218 "$ref": "#/definitions/deployment"
1219 }
1220 }
1221 }
1222 },
1223 "summary": "Get deployments",
1224 "tags": [
1225 "deployments"
1226 ]
1227 }
1228 },
1229 "/projects/{project_token}/jobs": {
1230 "get": {
1231 "description": "Returns a list of all jobs associated with the project",
1232 "operationId": "getJobsForProject",
1233 "parameters": [
1234 {
1235 "description": "The associated project's token",
1236 "in": "path",
1237 "name": "project_token",
1238 "required": true,
1239 "type": "string"
1240 }
1241 ],
1242 "responses": {
1243 "200": {
1244 "description": "Successful operation",
1245 "schema": {
1246 "items": {
1247 "$ref": "#/definitions/job"
1248 },
1249 "type": "array"
1250 }
1251 }
1252 },
1253 "summary": "List jobs",
1254 "tags": [
1255 "jobs"
1256 ]
1257 },
1258 "post": {
1259 "consumes": [
1260 "application/json"
1261 ],
1262 "description": "Creates and returns a new job",
1263 "operationId": "createJobsForProject",
1264 "parameters": [
1265 {
1266 "description": "The job attributes to update",
1267 "in": "body",
1268 "name": "body",
1269 "required": true,
1270 "schema": {
1271 "example": {
1272 "name": "ingestor"
1273 },
1274 "properties": {
1275 "name": {
1276 "type": "string"
1277 },
1278 "config": {
1279 "type": "object"
1280 }
1281 },
1282 "type": "object"
1283 }
1284 },
1285 {
1286 "description": "The associated project's token",
1287 "in": "path",
1288 "name": "project_token",
1289 "required": true,
1290 "type": "string"
1291 }
1292 ],
1293 "produces": [
1294 "application/json"
1295 ],
1296 "responses": {
1297 "200": {
1298 "description": "Successful operation",
1299 "schema": {
1300 "$ref": "#/definitions/job"
1301 }
1302 },
1303 "400": {
1304 "description": "Invalid name",
1305 "schema": {
1306 "example": {
1307 "name": [
1308 "is invalid"
1309 ]
1310 },
1311 "type": "object"
1312 }
1313 }
1314 },
1315 "summary": "Create new job",
1316 "tags": [
1317 "jobs"
1318 ]
1319 }
1320 },
1321 "/projects/{project_token}/kill": {
1322 "post": {
1323 "consumes": [
1324 "application/json"
1325 ],
1326 "description": "Kills project",
1327 "operationId": "killProject",
1328 "parameters": [
1329 {
1330 "description": "The ids to kill",
1331 "in": "body",
1332 "name": "body",
1333 "required": true,
1334 "schema": {
1335 "properties": {
1336 "deployments": {
1337 "type": "array",
1338 "items": {
1339 "type": "object",
1340 "properties": {
1341 "deployment_id": {
1342 "type": "string"
1343 },
1344 "job_ids": {
1345 "type": "array",
1346 "items": {
1347 "type": "string"
1348 }
1349 }
1350 }
1351 }
1352 }
1353 },
1354 "type": "object"
1355 }
1356 },
1357 {
1358 "description": "The associated project's token",
1359 "in": "path",
1360 "name": "project_token",
1361 "required": true,
1362 "type": "string"
1363 }
1364 ],
1365 "produces": [
1366 "application/json"
1367 ],
1368 "responses": {
1369 "200": {
1370 "description": "Successful operation"
1371 }
1372 },
1373 "summary": "Kill project",
1374 "tags": [
1375 "projects"
1376 ]
1377 }
1378 },
1379 "/projects/{token}/regenerate": {
1380 "post": {
1381 "consumes": [
1382 "application/json"
1383 ],
1384 "description": "Regenerates the specified project's secret token",
1385 "operationId": "regenerateProject",
1386 "parameters": [
1387 {
1388 "description": "Empty request body",
1389 "in": "body",
1390 "name": "body",
1391 "required": true,
1392 "schema": {
1393 "example": {},
1394 "type": "object"
1395 }
1396 },
1397 {
1398 "description": "The project's token",
1399 "in": "path",
1400 "name": "token",
1401 "required": true,
1402 "type": "string"
1403 }
1404 ],
1405 "produces": [
1406 "application/json"
1407 ],
1408 "responses": {
1409 "200": {
1410 "description": "Successful operation"
1411 }
1412 },
1413 "summary": "Regenerate project secret",
1414 "tags": [
1415 "projects"
1416 ]
1417 }
1418 },
1419 "/status": {
1420 "get": {
1421 "description": "Returns the status of the server",
1422 "operationId": "getStatus",
1423 "produces": [
1424 "application/json"
1425 ],
1426 "responses": {
1427 "200": {
1428 "description": "Successful operation",
1429 "schema": {
1430 "properties": {
1431 "alive": {
1432 "type": "boolean"
1433 },
1434 "services": {
1435 "type": "object",
1436 "properties": {
1437 "<service_name>": {
1438 "$ref": "#/definitions/service_status"
1439 }
1440 }
1441 },
1442 "start_date": {
1443 "type": "string"
1444 },
1445 "version": {
1446 "type": "string"
1447 }
1448 },
1449 "type": "object"
1450 }
1451 }
1452 },
1453 "summary": "Get server status",
1454 "tags": [
1455 "status"
1456 ]
1457 }
1458 },
1459 "/users/change_password": {
1460 "post": {
1461 "consumes": [
1462 "application/json"
1463 ],
1464 "description": "Changes the currently logged in users password",
1465 "operationId": "changeUserPassword",
1466 "parameters": [
1467 {
1468 "description": "The user's passwords",
1469 "in": "body",
1470 "name": "body",
1471 "required": true,
1472 "schema": {
1473 "example": {
1474 "old_password": "old_password",
1475 "password": "password"
1476 },
1477 "type": "object"
1478 }
1479 }
1480 ],
1481 "produces": [
1482 "application/json"
1483 ],
1484 "responses": {
1485 "200": {
1486 "description": "Successful operation",
1487 "schema": {
1488 "example": {
1489 "success": true
1490 },
1491 "type": "object"
1492 }
1493 }
1494 },
1495 "summary": "Change password",
1496 "tags": [
1497 "users"
1498 ]
1499 }
1500 },
1501 "/users/login": {
1502 "post": {
1503 "consumes": [
1504 "application/json"
1505 ],
1506 "description": "Logs in a user",
1507 "operationId": "logInUser",
1508 "parameters": [
1509 {
1510 "description": "The user's information",
1511 "in": "body",
1512 "name": "body",
1513 "required": true,
1514 "schema": {
1515 "example": {
1516 "client_id": "6bc512522fb16a849ca7",
1517 "email": "example@domain.com",
1518 "grant_type": "password",
1519 "password": "password"
1520 },
1521 "type": "object"
1522 }
1523 }
1524 ],
1525 "produces": [
1526 "application/json"
1527 ],
1528 "responses": {
1529 "200": {
1530 "description": "Successful operation",
1531 "schema": {
1532 "example": {
1533 "expires_at": 1515777675,
1534 "profile": {},
1535 "token": "6bc512522fb16a849ca7",
1536 "user_id": "D01D6572-758A-4C68-A331-943B8F7A3681"
1537 },
1538 "type": "object"
1539 }
1540 }
1541 },
1542 "summary": "Log in user",
1543 "tags": [
1544 "users"
1545 ]
1546 }
1547 },
1548 "/users/logout": {
1549 "delete": {
1550 "description": "Logs out the currently logged in user",
1551 "operationId": "logOutUser",
1552 "produces": [
1553 "application/json"
1554 ],
1555 "responses": {
1556 "200": {
1557 "description": "Successful operation",
1558 "schema": {
1559 "example": {
1560 "success": true
1561 },
1562 "type": "object"
1563 }
1564 }
1565 },
1566 "summary": "Log out user",
1567 "tags": [
1568 "users"
1569 ]
1570 }
1571 },
1572 "/users/me": {
1573 "get": {
1574 "description": "Returns the currently logged in user's information",
1575 "operationId": "user",
1576 "produces": [
1577 "application/json"
1578 ],
1579 "responses": {
1580 "200": {
1581 "description": "Successful operation"
1582 }
1583 },
1584 "summary": "User information",
1585 "tags": [
1586 "users"
1587 ]
1588 }
1589 },
1590 "/users/register": {
1591 "post": {
1592 "consumes": [
1593 "application/json"
1594 ],
1595 "description": "Signs up a new user",
1596 "operationId": "registerUser",
1597 "parameters": [
1598 {
1599 "description": "",
1600 "in": "body",
1601 "name": "body",
1602 "required": true,
1603 "schema": {
1604 "example": {
1605 "email": "example@domain.com",
1606 "password": "password",
1607 "setting": {}
1608 },
1609 "type": "object"
1610 }
1611 }
1612 ],
1613 "produces": [
1614 "application/json"
1615 ],
1616 "responses": {
1617 "200": {
1618 "description": "Successful operation"
1619 }
1620 },
1621 "summary": "Register user",
1622 "tags": [
1623 "users"
1624 ]
1625 }
1626 },
1627 "/users/reset_password": {
1628 "post": {
1629 "consumes": [
1630 "application/json"
1631 ],
1632 "description": "Generates and sends the user an email with a link to reset their password",
1633 "operationId": "emailResetPasswordLink",
1634 "parameters": [
1635 {
1636 "description": "The user's email and information used to generate reset email",
1637 "in": "body",
1638 "name": "body",
1639 "required": true,
1640 "schema": {
1641 "example": {
1642 "email": "example@domain.com",
1643 "new_link_url": "link_to_request_another_email.com",
1644 "redirect_url": "link_to_password_reset_fields.com"
1645 },
1646 "type": "object"
1647 }
1648 }
1649 ],
1650 "produces": [
1651 "application/json"
1652 ],
1653 "responses": {
1654 "200": {
1655 "description": "Successful operation",
1656 "schema": {
1657 "example": {
1658 "success": true
1659 },
1660 "type": "object"
1661 }
1662 },
1663 "400": {
1664 "description": "Redirect url is missing",
1665 "schema": {
1666 "example": {
1667 "error": "Redirect url is required"
1668 },
1669 "type": "object"
1670 }
1671 }
1672 },
1673 "summary": "Request reset link",
1674 "tags": [
1675 "users"
1676 ]
1677 }
1678 },
1679 "/users/reset_password/{token}": {
1680 "post": {
1681 "consumes": [
1682 "application/json"
1683 ],
1684 "description": "Resets a user's password to the specified values",
1685 "operationId": "resetPassword",
1686 "parameters": [
1687 {
1688 "description": "The user's information",
1689 "in": "body",
1690 "name": "body",
1691 "required": true,
1692 "schema": {
1693 "example": {
1694 "email": "example@domain.com",
1695 "password": "new_password"
1696 },
1697 "type": "object"
1698 }
1699 },
1700 {
1701 "description": "The token generated and sent in reset email as part of link",
1702 "in": "path",
1703 "name": "token",
1704 "required": true,
1705 "type": "string"
1706 }
1707 ],
1708 "produces": [
1709 "application/json"
1710 ],
1711 "responses": {
1712 "200": {
1713 "description": "Successful operation"
1714 }
1715 },
1716 "summary": "Reset password",
1717 "tags": [
1718 "users"
1719 ]
1720 }
1721 }
1722 },
1723 "definitions": {
1724 "api_token": {
1725 "type": "object",
1726 "properties": {
1727 "id": {
1728 "type": "string"
1729 },
1730 "inserted_at": {
1731 "type": "string"
1732 },
1733 "is_active": {
1734 "type": "boolean"
1735 },
1736 "settings": {
1737 "type": "object"
1738 },
1739 "updated_at": {
1740 "type": "string"
1741 },
1742 "user_id": {
1743 "type": "string"
1744 }
1745 }
1746 },
1747 "data": {
1748 "type": "object",
1749 "properties": {
1750 "cursor": {
1751 "type": "string"
1752 },
1753 "data": {
1754 "items": {
1755 "type": "object"
1756 },
1757 "type": "array"
1758 }
1759 }
1760 },
1761 "data_access": {
1762 "type": "object",
1763 "properties": {
1764 "granted_org_id": {
1765 "type": "string"
1766 },
1767 "grantor_org_id": {
1768 "type": "string"
1769 },
1770 "project_token": {
1771 "type": "string"
1772 },
1773 "permissions": {
1774 "items": {
1775 "type": "string"
1776 },
1777 "type": "array"
1778 },
1779 "table_name": {
1780 "type": "string"
1781 }
1782 }
1783 },
1784 "deployment": {
1785 "type": "object",
1786 "properties": {
1787 "company_id": {
1788 "type": "string"
1789 },
1790 "context": {
1791 "type": "string"
1792 },
1793 "id": {
1794 "type": "string"
1795 },
1796 "image_url": {
1797 "type": "string"
1798 },
1799 "inserted_at": {
1800 "type": "string"
1801 },
1802 "installation_id": {
1803 "type": "integer"
1804 },
1805 "max_retry_count": {
1806 "type": "string"
1807 },
1808 "name": {
1809 "type": "string"
1810 },
1811 "project_token": {
1812 "type": "string"
1813 },
1814 "repo_branch": {
1815 "type": "string"
1816 },
1817 "repo_id": {
1818 "type": "string"
1819 },
1820 "repo_url": {
1821 "type": "string"
1822 },
1823 "retry_count": {
1824 "type": "string"
1825 },
1826 "token": {
1827 "type": "string"
1828 },
1829 "type": {
1830 "type": "string"
1831 },
1832 "version": {
1833 "type": "string"
1834 }
1835 }
1836 },
1837 "deployment_metric": {
1838 "type": "object",
1839 "properties": {
1840 "metric": {
1841 "type": "string"
1842 },
1843 "values": {
1844 "items": {
1845 "type": "object",
1846 "properties": {
1847 "timestamp": {
1848 "type": "number"
1849 },
1850 "value": {
1851 "type": "string"
1852 }
1853 }
1854 },
1855 "type": "array"
1856 }
1857 }
1858 },
1859 "env_var": {
1860 "type": "object",
1861 "properties": {
1862 "id": {
1863 "type": "integer"
1864 },
1865 "inserted_at": {
1866 "type": "string"
1867 },
1868 "name": {
1869 "type": "string"
1870 },
1871 "secret_key": {
1872 "type": "string"
1873 },
1874 "secret_name": {
1875 "type": "string"
1876 },
1877 "token": {
1878 "type": "string"
1879 },
1880 "updated_at": {
1881 "type": "string"
1882 },
1883 "value": {
1884 "type": "string"
1885 }
1886 }
1887 },
1888 "job": {
1889 "type": "object",
1890 "properties": {
1891 "config": {
1892 "type": "object"
1893 },
1894 "id": {
1895 "type": "string"
1896 },
1897 "name": {
1898 "type": "string"
1899 },
1900 "project_token": {
1901 "type": "string"
1902 },
1903 "status": {
1904 "type": "string"
1905 }
1906 }
1907 },
1908 "organization": {
1909 "type": "object",
1910 "properties": {
1911 "display_name": {
1912 "type": "string"
1913 },
1914 "id": {
1915 "type": "integer"
1916 },
1917 "inserted_at": {
1918 "type": "string"
1919 },
1920 "granted_data_access": {
1921 "items": {
1922 "$ref": "#/definitions/data_access"
1923 },
1924 "type": "array"
1925 },
1926 "owner_id": {
1927 "type": "string"
1928 },
1929 "received_data_access": {
1930 "items": {
1931 "$ref": "#/definitions/data_access"
1932 },
1933 "type": "array"
1934 },
1935 "updated_at": {
1936 "type": "string"
1937 }
1938 }
1939 },
1940 "project": {
1941 "type": "object",
1942 "properties": {
1943 "company_id": {
1944 "type": "string"
1945 },
1946 "config": {
1947 "type": "object"
1948 },
1949 "confirmed": {
1950 "type": "boolean"
1951 },
1952 "creator_id": {
1953 "type": "string"
1954 },
1955 "description": {
1956 "type": "string"
1957 },
1958 "id": {
1959 "type": "integer"
1960 },
1961 "inserted_at": {
1962 "type": "string"
1963 },
1964 "name": {
1965 "type": "string"
1966 },
1967 "repo_url": {
1968 "type": "string"
1969 },
1970 "secret": {
1971 "type": "string"
1972 },
1973 "token": {
1974 "type": "string"
1975 },
1976 "updated_at": {
1977 "type": "string"
1978 }
1979 }
1980 },
1981 "service_status": {
1982 "type": "object",
1983 "properties": {
1984 "alive": {
1985 "type": "boolean"
1986 }
1987 }
1988 }
1989 },
1990 "tags": [
1991 {
1992 "name": "api_tokens",
1993 "description": "Manage api access tokens"
1994 },
1995 {
1996 "name": "data",
1997 "description": "Access user generated data"
1998 },
1999 {
2000 "name": "data_access",
2001 "description": "Manage data access"
2002 },
2003 {
2004 "name": "deployment_metrics",
2005 "description": "View deployment metrics"
2006 },
2007 {
2008 "name": "deployments",
2009 "description": "Manage deployments"
2010 },
2011 {
2012 "name": "env_vars",
2013 "description": "Manage environment variables"
2014 },
2015 {
2016 "name": "jobs",
2017 "description": "Manage jobs"
2018 },
2019 {
2020 "name": "last_deployment",
2021 "description": "Query last run deployment metrics"
2022 },
2023 {
2024 "name": "organizations",
2025 "description": "Manage organizations"
2026 },
2027 {
2028 "name": "projects",
2029 "description": "Manage projects"
2030 },
2031 {
2032 "name": "status",
2033 "description": "Query service metrics"
2034 },
2035 {
2036 "name": "users",
2037 "description": "Manage users and their sessions"
2038 }
2039 ],
2040 "externalDocs": {
2041 "description": "Find other Metis Machine docs here",
2042 "url": "https://docs.metismachine.io"
2043 }
2044}