Skip to content

Commit

Permalink
Merge pull request #2126 from CrowleyRajapakse/new-main4
Browse files Browse the repository at this point in the history
Adding organization as query param to k8s generation resource
  • Loading branch information
CrowleyRajapakse authored Mar 14, 2024
2 parents e163ea2 + 554f8b4 commit 53ce8af
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.8"
version = "2.10.10"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.10.8"
version = "2.10.10"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ isolated service /api/configurator on ep0 {
}
# Generate K8s Resources
#
# + organization - **Organization ID** of the organization the API belongs to.
# + request - parameter description
# + return - returns can be any of following types
# BadRequestError (Bad Request. Invalid request or validation error.)
# InternalServerErrorError (Internal Server Error.)
isolated resource function post apis/'generate\-k8s\-resources(http:Request request) returns http:Response|BadRequestError|InternalServerErrorError|commons:APKError {
isolated resource function post apis/'generate\-k8s\-resources(string? organization, http:Request request) returns http:Response|BadRequestError|InternalServerErrorError|commons:APKError {
ConfigGeneratorClient apiclient = new ;
commons:Organization organization = {displayName: "default",
commons:Organization organizationObj = {displayName: "default",
name: "wso2-apk-default",
organizationClaimValue: "default",
uuid: "",
enabled: true};
return check apiclient.getGeneratedK8sResources(request,organization);
if (organization is string) {
organizationObj.name = organization;
}
return check apiclient.getGeneratedK8sResources(request,organizationObj);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ paths:
summary: Generate K8s Resources
description: |
operationId: generateK8sResources
parameters:
- $ref: "#/components/parameters/organizationId"
requestBody:
content:
multipart/form-data:
Expand Down Expand Up @@ -123,11 +125,11 @@ components:
schema:
type: string
organizationId:
name: X-WSO2-Organization
in: header
name: organization
in: query
description: |
**Organization ID** of the organization the API belongs to.
required: true
required: false
style: simple
explode: false
schema:
Expand Down

0 comments on commit 53ce8af

Please sign in to comment.