Skip to content

Commit

Permalink
Add: APICTL Project export Endpoint Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
BLasan committed Sep 19, 2024
1 parent bcc8414 commit 4823c10
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import static org.wso2.carbon.apimgt.impl.APIConstants.API_DATA_PRODUCTION_ENDPOINTS;
Expand Down Expand Up @@ -227,9 +228,24 @@ public static File exportApi(APIProvider apiProvider, APIIdentifier apiIdentifie
String prodSequenceName = null;
if (endpointConfig.get("sandbox") != null) {
sandSequenceName = endpointConfig.get("sandbox").getAsString();
} else {
sandSequenceName = apiProvider.getCustomBackendSequenceOfAPIByUUID(currentApiUuid,
APIConstants.API_KEY_TYPE_SANDBOX);
}
if (endpointConfig.get("production") != null) {
prodSequenceName = endpointConfig.get("production").getAsString();
} else {
prodSequenceName = apiProvider.getCustomBackendSequenceOfAPIByUUID(currentApiUuid,
APIConstants.API_KEY_TYPE_PRODUCTION);
}
if (apiDtoToReturn.getEndpointConfig() != null) {
Map endpointConf = (Map) apiDtoToReturn.getEndpointConfig();
if (endpointConf != null && APIConstants.ENDPOINT_TYPE_SEQUENCE.equals(
endpointConf.get(API_ENDPOINT_CONFIG_PROTOCOL_TYPE))) {
endpointConf.put("sandbox", sandSequenceName);
endpointConf.put("production", prodSequenceName);
apiDtoToReturn.setEndpointConfig(endpointConf);
}
}
addCustomBackendToArchive(archivePath, apiProvider, currentApiUuid, sandSequenceName, prodSequenceName);
}
Expand Down

0 comments on commit 4823c10

Please sign in to comment.