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