Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
review feedback
  • Loading branch information
marceljk committed Sep 16, 2025
commit df1b27dc24328f68d8e261382d057ddf6dd7be8b
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public static void main(String[] args) throws IOException {
///////////////////////////////////////////////////////
// Option 1: setting the paths to service account key (and private key) as configuration
///////////////////////////////////////////////////////
String SERVICE_ACCOUNT_KEY_PATH = "/path/to/sa_key.json";
String PRIVATE_KEY_PATH = "/path/to/private_key.pem";
String SERVICE_ACCOUNT_MAIL = "name-1234@sa.stackit.cloud";
final String SERVICE_ACCOUNT_KEY_PATH = "/path/to/sa_key.json";
final String PRIVATE_KEY_PATH = "/path/to/private_key.pem";
final String SERVICE_ACCOUNT_MAIL = "name-1234@sa.stackit.cloud";

try {
ResourceManagerApi api =
Expand Down Expand Up @@ -64,16 +64,16 @@ public static void main(String[] args) throws IOException {
throw new RuntimeException(e);
}

String SERVICE_ACCOUNT_KEY = serviceAccountKeyContent.toString();
String PRIVATE_KEY = privateKeyContent.toString();
String serviceAccountKey = serviceAccountKeyContent.toString();
String privateKey = privateKeyContent.toString();

try {
ResourceManagerApi api =
new ResourceManagerApi(
new CoreConfiguration()
.serviceAccountKey(SERVICE_ACCOUNT_KEY)
.serviceAccountKey(serviceAccountKey)
// Optional: if private key not included in service account key
.privateKey(PRIVATE_KEY));
.privateKey(privateKey));

/* list all organizations */
ListOrganizationsResponse response =
Expand Down