diff --git a/runtime/config-deployer-service/ballerina/Dependencies.toml b/runtime/config-deployer-service/ballerina/Dependencies.toml index c22dbc68c..12cd0ab57 100644 --- a/runtime/config-deployer-service/ballerina/Dependencies.toml +++ b/runtime/config-deployer-service/ballerina/Dependencies.toml @@ -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"}, diff --git a/runtime/config-deployer-service/ballerina/Dependencies.toml.template b/runtime/config-deployer-service/ballerina/Dependencies.toml.template index 9b90576ba..a245d4f9b 100644 --- a/runtime/config-deployer-service/ballerina/Dependencies.toml.template +++ b/runtime/config-deployer-service/ballerina/Dependencies.toml.template @@ -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"}, diff --git a/runtime/config-deployer-service/ballerina/artifact-generator-api_service.bal b/runtime/config-deployer-service/ballerina/artifact-generator-api_service.bal index 0c8a0926a..db4e04009 100644 --- a/runtime/config-deployer-service/ballerina/artifact-generator-api_service.bal +++ b/runtime/config-deployer-service/ballerina/artifact-generator-api_service.bal @@ -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); } } diff --git a/runtime/config-deployer-service/ballerina/resources/artifact-generator-api.yaml b/runtime/config-deployer-service/ballerina/resources/artifact-generator-api.yaml index b2a52b8b4..07bede862 100644 --- a/runtime/config-deployer-service/ballerina/resources/artifact-generator-api.yaml +++ b/runtime/config-deployer-service/ballerina/resources/artifact-generator-api.yaml @@ -49,6 +49,8 @@ paths: summary: Generate K8s Resources description: | operationId: generateK8sResources + parameters: + - $ref: "#/components/parameters/organizationId" requestBody: content: multipart/form-data: @@ -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: