|
1032 | 1032 | "summary": "Ping the server (healthcheck)" |
1033 | 1033 | } |
1034 | 1034 | }, |
| 1035 | + "/api/quota": { |
| 1036 | + "get": { |
| 1037 | + "description": "This endpoint gets resource quota limits for a given user.", |
| 1038 | + "operationId": "list_quota_usage", |
| 1039 | + "parameters": [ |
| 1040 | + { |
| 1041 | + "description": "REANA access token.", |
| 1042 | + "in": "query", |
| 1043 | + "name": "access_token", |
| 1044 | + "required": true, |
| 1045 | + "type": "string" |
| 1046 | + }, |
| 1047 | + { |
| 1048 | + "description": "Get the quota limit by user ID (mutually exclusive with `email` and `user_access_token`)", |
| 1049 | + "in": "query", |
| 1050 | + "name": "user_id", |
| 1051 | + "required": false, |
| 1052 | + "type": "string" |
| 1053 | + }, |
| 1054 | + { |
| 1055 | + "description": "Get the quota limit by user email (mutually exclusive with `user_id` and `user_access_token`)", |
| 1056 | + "in": "query", |
| 1057 | + "name": "email", |
| 1058 | + "required": false, |
| 1059 | + "type": "string" |
| 1060 | + }, |
| 1061 | + { |
| 1062 | + "description": "Get the quota limit by user access token (mutually exclusive with `user_id` and `email`)", |
| 1063 | + "in": "query", |
| 1064 | + "name": "user_access_token", |
| 1065 | + "required": false, |
| 1066 | + "type": "string" |
| 1067 | + }, |
| 1068 | + { |
| 1069 | + "description": "The type of resource", |
| 1070 | + "in": "query", |
| 1071 | + "name": "resource_type", |
| 1072 | + "required": true, |
| 1073 | + "type": "string" |
| 1074 | + } |
| 1075 | + ], |
| 1076 | + "produces": [ |
| 1077 | + "application/json" |
| 1078 | + ], |
| 1079 | + "responses": { |
| 1080 | + "200": { |
| 1081 | + "description": "Request succeeded. Raw resource quota limit is returned.", |
| 1082 | + "examples": { |
| 1083 | + "application/json": { |
| 1084 | + "data": 1000000000, |
| 1085 | + "message": "", |
| 1086 | + "status": "200" |
| 1087 | + } |
| 1088 | + }, |
| 1089 | + "schema": { |
| 1090 | + "properties": { |
| 1091 | + "data": { |
| 1092 | + "type": "number" |
| 1093 | + }, |
| 1094 | + "message": { |
| 1095 | + "type": "string" |
| 1096 | + }, |
| 1097 | + "status": { |
| 1098 | + "type": "string" |
| 1099 | + } |
| 1100 | + }, |
| 1101 | + "type": "object" |
| 1102 | + } |
| 1103 | + }, |
| 1104 | + "400": { |
| 1105 | + "description": "Request failed. The incoming data specification seems malformed.", |
| 1106 | + "examples": { |
| 1107 | + "application/json": { |
| 1108 | + "message": "No user specified." |
| 1109 | + } |
| 1110 | + }, |
| 1111 | + "schema": { |
| 1112 | + "properties": { |
| 1113 | + "message": { |
| 1114 | + "type": "string" |
| 1115 | + } |
| 1116 | + }, |
| 1117 | + "type": "object" |
| 1118 | + } |
| 1119 | + }, |
| 1120 | + "404": { |
| 1121 | + "description": "Request failed. Not found.", |
| 1122 | + "examples": { |
| 1123 | + "application/json": { |
| 1124 | + "message": "Quota functionality is not enabled." |
| 1125 | + } |
| 1126 | + }, |
| 1127 | + "schema": { |
| 1128 | + "properties": { |
| 1129 | + "message": { |
| 1130 | + "type": "string" |
| 1131 | + } |
| 1132 | + }, |
| 1133 | + "type": "object" |
| 1134 | + } |
| 1135 | + }, |
| 1136 | + "500": { |
| 1137 | + "description": "Request failed. Internal server error.", |
| 1138 | + "examples": { |
| 1139 | + "application/json": { |
| 1140 | + "message": "Internal server error." |
| 1141 | + } |
| 1142 | + }, |
| 1143 | + "schema": { |
| 1144 | + "properties": { |
| 1145 | + "message": { |
| 1146 | + "type": "string" |
| 1147 | + } |
| 1148 | + }, |
| 1149 | + "type": "object" |
| 1150 | + } |
| 1151 | + } |
| 1152 | + }, |
| 1153 | + "summary": "Get resource quota limits." |
| 1154 | + }, |
| 1155 | + "post": { |
| 1156 | + "description": "This endpoint sets resource quota limits for a given set of users.", |
| 1157 | + "operationId": "set_quota_limit", |
| 1158 | + "parameters": [ |
| 1159 | + { |
| 1160 | + "description": "REANA access token.", |
| 1161 | + "in": "query", |
| 1162 | + "name": "access_token", |
| 1163 | + "required": true, |
| 1164 | + "type": "string" |
| 1165 | + }, |
| 1166 | + { |
| 1167 | + "description": "Data required to set quota limits.", |
| 1168 | + "in": "body", |
| 1169 | + "name": "data", |
| 1170 | + "required": true, |
| 1171 | + "schema": { |
| 1172 | + "additionalProperties": { |
| 1173 | + "description": "Quota limit definition.", |
| 1174 | + "properties": { |
| 1175 | + "emails": { |
| 1176 | + "description": "Emails of the target users (mutually exclusive with `user_ids`)", |
| 1177 | + "type": "string" |
| 1178 | + }, |
| 1179 | + "limit": { |
| 1180 | + "description": "Raw quota limit to set", |
| 1181 | + "type": "integer" |
| 1182 | + }, |
| 1183 | + "resource_type": { |
| 1184 | + "description": "Resource type to set", |
| 1185 | + "type": "string" |
| 1186 | + }, |
| 1187 | + "user_ids": { |
| 1188 | + "description": "IDs of the target users (mutually exclusive with `emails`)", |
| 1189 | + "type": "string" |
| 1190 | + } |
| 1191 | + }, |
| 1192 | + "type": "object" |
| 1193 | + }, |
| 1194 | + "type": "object" |
| 1195 | + } |
| 1196 | + } |
| 1197 | + ], |
| 1198 | + "produces": [ |
| 1199 | + "application/json" |
| 1200 | + ], |
| 1201 | + "responses": { |
| 1202 | + "200": { |
| 1203 | + "description": "Resource quotas successfully set.", |
| 1204 | + "examples": { |
| 1205 | + "application/json": { |
| 1206 | + "message": "Quota limit {limit} for '{resource_type} ({resource_name})' successfully set to user(s) {user_ids}." |
| 1207 | + } |
| 1208 | + }, |
| 1209 | + "schema": { |
| 1210 | + "properties": { |
| 1211 | + "message": { |
| 1212 | + "type": "string" |
| 1213 | + } |
| 1214 | + }, |
| 1215 | + "type": "object" |
| 1216 | + } |
| 1217 | + }, |
| 1218 | + "500": { |
| 1219 | + "description": "Request failed. Internal server error.", |
| 1220 | + "examples": { |
| 1221 | + "application/json": { |
| 1222 | + "message": "Quota could not be set: {error}" |
| 1223 | + } |
| 1224 | + }, |
| 1225 | + "schema": { |
| 1226 | + "properties": { |
| 1227 | + "message": { |
| 1228 | + "type": "string" |
| 1229 | + } |
| 1230 | + }, |
| 1231 | + "type": "object" |
| 1232 | + } |
| 1233 | + } |
| 1234 | + }, |
| 1235 | + "summary": "Set resource quota limits." |
| 1236 | + } |
| 1237 | + }, |
1035 | 1238 | "/api/secrets": { |
1036 | 1239 | "get": { |
1037 | 1240 | "description": "Get user secrets.", |
|
0 commit comments