@@ -14,16 +14,16 @@ public class ConfluentCloudService {
14
14
private static org .slf4j .Logger log = LoggerFactory .getLogger (ConfluentCloudService .class );
15
15
16
16
private final ObjectMapper objectMapper ;
17
- private static final String ccloudExecutable ;
17
+ private static final String confluentExecutable ;
18
18
19
19
public ConfluentCloudService (ObjectMapper objectMapper ) {
20
20
this .objectMapper = objectMapper ;
21
21
}
22
22
23
23
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." );
25
25
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" });
27
27
return objectMapper .readValue (result , new TypeReference <List <ServiceAccount >>() {
28
28
});
29
29
} catch (IOException ex ) {
@@ -33,11 +33,11 @@ public List<ServiceAccount> getServiceAccounts() {
33
33
}
34
34
35
35
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 );
37
37
try {
38
38
String serviceName = isUser ? String .format ("user-%s" , name ) : name ;
39
39
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" });
41
41
return objectMapper .readValue (result , ServiceAccount .class );
42
42
} catch (IOException ex ) {
43
43
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 {
50
50
}
51
51
52
52
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 );
55
55
}
56
56
}
0 commit comments