use of com.openshift.cloud.api.connector.models.DeploymentLocation in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ConnectorsApiClientImpl method createConnector.
@Override
public Connector createConnector(ConnectorEntity connectorEntity) {
ConnectorRequest createConnectorRequest = new ConnectorRequest();
String newConnectorName = connectorEntity.getName();
createConnectorRequest.setName(newConnectorName);
DeploymentLocation deploymentLocation = new DeploymentLocation();
deploymentLocation.setKind("addon");
deploymentLocation.setClusterId(mcClusterId);
createConnectorRequest.setDeploymentLocation(deploymentLocation);
String connectorType = connectorEntity.getConnectorType();
JsonNode payload = connectorEntity.getDefinition();
createConnectorRequest.setConnectorTypeId(connectorType);
createConnectorRequest.setConnector(payload);
ServiceAccount serviceAccount = new ServiceAccount();
serviceAccount.setClientId(serviceAccountId);
serviceAccount.setClientSecret(serviceAccountSecret);
createConnectorRequest.setServiceAccount(serviceAccount);
KafkaConnectionSettings kafka = new KafkaConnectionSettings();
kafka.setUrl(kafkaBootstrapServer);
// https://issues.redhat.com/browse/MGDOBR-198
// this is currently ignored in the Connectors API
kafka.setId(KAFKA_ID_IGNORED);
createConnectorRequest.setKafka(kafka);
return createConnector(createConnectorRequest);
}
Aggregations