-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'github/ci' of github.com:mycloudnexus/kraken into githu…
…b/ci
- Loading branch information
Showing
41 changed files
with
1,823 additions
and
156 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
kraken-app/kraken-app-hub/src/test/resources/expected/expected-9-quote.uni.add.sync.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...com/consoleconnect/kraken/operator/controller/api/EnvAPIActivityStatisticsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package com.consoleconnect.kraken.operator.controller.api; | ||
|
||
import static com.consoleconnect.kraken.operator.core.model.HttpResponse.ok; | ||
|
||
import com.consoleconnect.kraken.operator.controller.dto.statistics.ApiRequestActivityStatistics; | ||
import com.consoleconnect.kraken.operator.controller.dto.statistics.ErrorApiRequestStatistics; | ||
import com.consoleconnect.kraken.operator.controller.dto.statistics.MostPopularEndpointStatistics; | ||
import com.consoleconnect.kraken.operator.controller.service.statistics.ApiActivityStatisticsService; | ||
import com.consoleconnect.kraken.operator.core.model.HttpResponse; | ||
import com.consoleconnect.kraken.operator.core.request.ApiStatisticsSearchRequest; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import java.time.ZonedDateTime; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@AllArgsConstructor | ||
@RestController() | ||
@RequestMapping( | ||
value = "/products/{productId}/envs/{envId}/statistics", | ||
produces = MediaType.APPLICATION_JSON_VALUE) | ||
@Tag(name = "API Activities Statistics", description = "API Activities Statistics") | ||
public class EnvAPIActivityStatisticsController { | ||
|
||
private final ApiActivityStatisticsService apiActivityStatisticsService; | ||
|
||
@Operation(summary = "Load api activity request statistics") | ||
@GetMapping("/api-activity-requests") | ||
public HttpResponse<ApiRequestActivityStatistics> getRequestStatistics( | ||
@PathVariable("productId") String productId, | ||
@PathVariable("envId") String envId, | ||
@RequestParam(value = "requestStartTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestStartTime, | ||
@RequestParam(value = "requestEndTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestEndTime, | ||
@RequestParam(value = "buyerId", required = false) String buyerId) { | ||
|
||
return ok( | ||
apiActivityStatisticsService.loadRequestStatistics( | ||
ApiStatisticsSearchRequest.builder() | ||
.env(envId) | ||
.buyerId(buyerId) | ||
.queryStart(requestStartTime) | ||
.queryEnd(requestEndTime) | ||
.build())); | ||
} | ||
|
||
@Operation(summary = "Load error request statistics") | ||
@GetMapping("/error-requests") | ||
public HttpResponse<ErrorApiRequestStatistics> getErrorStatistics( | ||
@PathVariable("productId") String productId, | ||
@PathVariable("envId") String envId, | ||
@RequestParam(value = "requestStartTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestStartTime, | ||
@RequestParam(value = "requestEndTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestEndTime, | ||
@RequestParam(value = "buyerId", required = false) String buyerId) { | ||
|
||
return ok( | ||
apiActivityStatisticsService.loadErrorsStatistics( | ||
ApiStatisticsSearchRequest.builder() | ||
.env(envId) | ||
.buyerId(buyerId) | ||
.queryStart(requestStartTime) | ||
.queryEnd(requestEndTime) | ||
.build())); | ||
} | ||
|
||
@Operation(summary = "Load most popular endpoint statistics") | ||
@GetMapping("/most-popular-endpoint") | ||
public HttpResponse<MostPopularEndpointStatistics> getMostPopularEndpointStatistics( | ||
@PathVariable("productId") String productId, | ||
@PathVariable("envId") String envId, | ||
@RequestParam(value = "requestStartTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestStartTime, | ||
@RequestParam(value = "requestEndTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) | ||
ZonedDateTime requestEndTime, | ||
@RequestParam(value = "buyerId", required = false) String buyerId) { | ||
|
||
return ok( | ||
apiActivityStatisticsService.loadMostPopularEndpointStatistics( | ||
ApiStatisticsSearchRequest.builder() | ||
.env(envId) | ||
.buyerId(buyerId) | ||
.queryStart(requestStartTime) | ||
.queryEnd(requestEndTime) | ||
.build())); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/consoleconnect/kraken/operator/controller/api/StartGuideController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.consoleconnect.kraken.operator.controller.api; | ||
|
||
import com.consoleconnect.kraken.operator.controller.dto.start.StartGuideInfoDto; | ||
import com.consoleconnect.kraken.operator.controller.service.start.StartGuideService; | ||
import com.consoleconnect.kraken.operator.core.model.HttpResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping(value = StartGuideController.URL, produces = MediaType.APPLICATION_JSON_VALUE) | ||
@RequiredArgsConstructor | ||
@Tag(name = "Start Guide APIs", description = "Portal APIs") | ||
public class StartGuideController { | ||
|
||
public static final String URL = "/start/guide"; | ||
private final StartGuideService service; | ||
|
||
@Operation(summary = "Get start guide info") | ||
@GetMapping("/{productId}") | ||
public HttpResponse<StartGuideInfoDto> getStartGuideInfo( | ||
@PathVariable("productId") String productId, @RequestParam(value = "kind") String kind) { | ||
return HttpResponse.ok(service.getStartGuideInfo(productId, kind)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../main/java/com/consoleconnect/kraken/operator/controller/dto/TemplateUpgradeCheckDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.Data; | ||
|
||
@Data | ||
public class TemplateUpgradeCheckDTO { | ||
Boolean compatible; | ||
Boolean mapperCompleted; | ||
Boolean newerTemplate; | ||
List<String> errorMessages = new ArrayList<>(); | ||
} |
13 changes: 13 additions & 0 deletions
13
.../main/java/com/consoleconnect/kraken/operator/controller/dto/start/ApiMappingInfoDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.start; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ApiMappingInfoDto { | ||
|
||
private Boolean atLeastOneMappingCompleted; | ||
} |
14 changes: 14 additions & 0 deletions
14
.../main/java/com/consoleconnect/kraken/operator/controller/dto/start/DeploymentInfoDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.start; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class DeploymentInfoDto { | ||
private Boolean atLeastOneApiDeployedToStage; | ||
private Boolean atLeastOneBuyerRegistered; | ||
private Boolean atLeastOneApiDeployedToProduction; | ||
} |
13 changes: 13 additions & 0 deletions
13
...nsoleconnect/kraken/operator/controller/dto/start/SellerApiServerRegistrationInfoDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.start; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SellerApiServerRegistrationInfoDto { | ||
|
||
private Boolean atLeastOneSellerApiRegistered; | ||
} |
14 changes: 14 additions & 0 deletions
14
.../main/java/com/consoleconnect/kraken/operator/controller/dto/start/StartGuideInfoDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.start; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class StartGuideInfoDto { | ||
private SellerApiServerRegistrationInfoDto sellerApiServerRegistrationInfo; | ||
private ApiMappingInfoDto apiMappingInfo; | ||
private DeploymentInfoDto deploymentInfo; | ||
} |
13 changes: 13 additions & 0 deletions
13
...onsoleconnect/kraken/operator/controller/dto/statistics/ApiRequestActivityStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ApiRequestActivityStatistics { | ||
private List<RequestStatistics> requestStatistics; | ||
} |
13 changes: 13 additions & 0 deletions
13
...main/java/com/consoleconnect/kraken/operator/controller/dto/statistics/EndpointUsage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class EndpointUsage { | ||
private String method; | ||
private String endpoint; | ||
private Long usage; | ||
private double popularity; | ||
} |
13 changes: 13 additions & 0 deletions
13
...m/consoleconnect/kraken/operator/controller/dto/statistics/ErrorApiRequestStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ErrorApiRequestStatistics { | ||
private List<ErrorBreakdown> errorBreakdowns; | ||
} |
15 changes: 15 additions & 0 deletions
15
...ain/java/com/consoleconnect/kraken/operator/controller/dto/statistics/ErrorBreakdown.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import java.time.LocalDate; | ||
import java.util.Map; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ErrorBreakdown { | ||
private LocalDate date; | ||
private Map<Integer, Long> errors; | ||
} |
13 changes: 13 additions & 0 deletions
13
...nsoleconnect/kraken/operator/controller/dto/statistics/MostPopularEndpointStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class MostPopularEndpointStatistics { | ||
private List<EndpointUsage> endpointUsages; | ||
} |
13 changes: 13 additions & 0 deletions
13
.../java/com/consoleconnect/kraken/operator/controller/dto/statistics/RequestStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.consoleconnect.kraken.operator.controller.dto.statistics; | ||
|
||
import java.time.LocalDate; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class RequestStatistics { | ||
private LocalDate date; | ||
private Long success; | ||
private Long error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.