@@ -14,16 +14,16 @@ public class ConfluentCloudService {
1414 private static org .slf4j .Logger log = LoggerFactory .getLogger (ConfluentCloudService .class );
1515
1616 private final ObjectMapper objectMapper ;
17- private static final String ccloudExecutable ;
17+ private static final String confluentExecutable ;
1818
1919 public ConfluentCloudService (ObjectMapper objectMapper ) {
2020 this .objectMapper = objectMapper ;
2121 }
2222
2323 public List <ServiceAccount > getServiceAccounts () {
24- log .info ("Fetching service account list from Confluent Cloud via ccloud tool." );
24+ log .info ("Fetching service account list from Confluent Cloud via confluent tool." );
2525 try {
26- String result = execCmd (new String []{ccloudExecutable , "service-account" , "list" , "-o" , "json" });
26+ String result = execCmd (new String []{confluentExecutable , "iam" , "service-account" , "list" , "-o" , "json" });
2727 return objectMapper .readValue (result , new TypeReference <List <ServiceAccount >>() {
2828 });
2929 } catch (IOException ex ) {
@@ -33,11 +33,11 @@ public List<ServiceAccount> getServiceAccounts() {
3333 }
3434
3535 public ServiceAccount createServiceAccount (String name , boolean isUser ) {
36- log .info ("Creating service account {} in Confluent Cloud via ccloud tool." , name );
36+ log .info ("Creating service account {} in Confluent Cloud via confluent tool." , name );
3737 try {
3838 String serviceName = isUser ? String .format ("user-%s" , name ) : name ;
3939 String description = isUser ? String .format ("User: %s" , name ) : String .format ("Service account: %s" , name );
40- String result = execCmd (new String []{ccloudExecutable , "service-account" , "create" , serviceName , "--description" , description , "-o" , "json" });
40+ String result = execCmd (new String []{confluentExecutable , "iam" , "service-account" , "create" , serviceName , "--description" , description , "-o" , "json" });
4141 return objectMapper .readValue (result , ServiceAccount .class );
4242 } catch (IOException ex ) {
4343 throw new ConfluentCloudException (String .format ("There was an error creating Confluent Cloud service account: %s." , name ));
@@ -50,7 +50,7 @@ public static String execCmd(String[] cmd) throws java.io.IOException {
5050 }
5151
5252 static {
53- ccloudExecutable = System .getenv ("CCLOUD_EXECUTABLE_PATH " ) != null ? System .getenv ("CCLOUD_EXECUTABLE_PATH " ) : "ccloud " ;
54- log .info ("Using ccloud executable at: {}" , ccloudExecutable );
53+ confluentExecutable = System .getenv ("CONFLUENT_EXECUTABLE_PATH " ) != null ? System .getenv ("CONFLUENT_EXECUTABLE_PATH " ) : "confluent " ;
54+ log .info ("Using confluent executable at: {}" , confluentExecutable );
5555 }
5656}
0 commit comments