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