Skip to main content

Project Service

The ProjectService retrieves IBM watsonx platform project metadata via the Platform Projects API. It targets a dedicated endpoint (https://api.dataplatform.cloud.ibm.com) that is distinct from the watsonx.ai ML endpoint used by all other services.

Quick Start​

ProjectService service = ProjectService.builder()
.baseUrl(CloudRegion.DALLAS)
.apiKey(WATSONX_API_KEY)
.build();

Project project = service.findProject("c2d2f907-4dfd-49f3-ac88-3c23a3830728").orElseThrow();
System.out.println(project.name()); // → adm_project
System.out.println(project.type()); // → wx
System.out.println(project.scope().bssAccountId()); // → 4d86deaa53914d5894e275ab280afffa

Overview​

The ProjectService enables you to:

  • Retrieve full project metadata by project UUID.
  • Inspect the account scope, storage configuration, catalog, and compute instances linked to a project.
  • Access per-role COS credentials for the project's storage bucket.

Service Configuration​

Basic Setup​

ProjectService service = ProjectService.builder()
.baseUrl(CloudRegion.DALLAS)
.apiKey(WATSONX_API_KEY)
.build();

Builder Parameters​

ParameterTypeRequiredDescription
baseUrlString/CloudRegionYesPlatform Projects API base URL
apiKeyStringConditionalAPI key for IBM Cloud authentication
authenticatorAuthenticatorConditionalCustom authentication (alternative to apiKey)
timeoutDurationNoRequest timeout (default: 60 seconds)
logRequestsBooleanNoEnable request logging (default: false)
logResponsesBooleanNoEnable response logging (default: false)
httpClientHttpClientNoCustom HTTP client
verifySslBooleanNoSSL certificate verification (default: true)
versionStringNoAPI version override

Either apiKey or authenticator must be provided.


Examples​

Retrieving a Project​

findProject returns an Optional. It is present when the project exists and empty when the API returns 404.

// Throw if not found
Project project = service.findProject("c2d2f907-4dfd-49f3-ac88-3c23a3830728").orElseThrow();

System.out.println(project.guid()); // → c2d2f907-4dfd-49f3-ac88-3c23a3830728
System.out.println(project.name()); // → adm_project
System.out.println(project.type()); // → wx
System.out.println(project.createdAt()); // → 2026-09-17T10:10:29.450Z
// Handle absence gracefully
service.findProject("c2d2f907-4dfd-49f3-ac88-3c23a3830728")
.ifPresentOrElse(
project -> System.out.println("Found: " + project.name()),
() -> System.out.println("Project not found")
);

Inspecting the Project Scope​

Project project = service.findProject(PROJECT_ID).orElseThrow();
ProjectScope scope = project.scope();

System.out.println(scope.bssAccountId()); // → 4d86deaa53914d5894e275ab280afffa
System.out.println(scope.enforceMembers()); // → true
System.out.println(scope.samlInstanceName()); // → IBM w3id

Accessing Storage Credentials​

Project project = service.findProject(PROJECT_ID).orElseThrow();
ProjectStorageProperties props = project.storage().properties();

System.out.println(props.bucketName()); // → admproject-donotdelete-pr-ycdgaky8tfbui9
System.out.println(props.bucketRegion()); // → us-south
System.out.println(props.endpointUrl()); // → https://s3.us-south.cloud-object-storage.appdomain.cloud

ProjectStorageCredential editorCreds = props.credentials().get("editor");
System.out.println(editorCreds.accessKeyId()); // → 59312addf5da45f4b5b73d04d44e25fa
System.out.println(editorCreds.secretAccessKey()); // → 7b1f4b020052f7...

Listing Compute Instances​

Project project = service.findProject(PROJECT_ID).orElseThrow();
for (ProjectComputeInstance compute : project.compute()) {
System.out.println(compute.name() + " [" + compute.type() + "] → " + compute.guid());
// → wml-310002au2v [machine_learning] → 6a278d1e-85a6-4118-9091-9ea87676ca59
}

Project​

The response object promotes all fields from the API's metadata and entity envelope to the top level.

Metadata fields​

FieldTypeDescription
guid()StringProject UUID
url()StringResource URL path
createdAt()StringCreation timestamp (ISO 8601)
updatedAt()StringLast-updated timestamp (ISO 8601)

Entity fields​

FieldTypeDescription
name()StringHuman-readable project name
description()StringProject description, or null
type()StringProject type: wx, cpd, wca, dpx, wxbi
publicProject()booleanWhether the project is publicly accessible
creator()StringUsername of the project creator, or null
creatorIamId()StringIAM ID of the project creator, or null
generator()StringGenerator label used to create the project, or null
tags()List<String>Project tags, or null
scope()ProjectScopeAccount scope information, or null
storage()ProjectStorageStorage configuration, or null
catalog()ProjectCatalogAssociated catalog, or null
compute()List<ProjectComputeInstance>Compute instances, or null
settings()Map<String, Object>Project settings, or null
members()List<Map<String, Object>>Project members, or null
tools()List<String>Configured tool names, or null
github()Map<String, Object>GitHub integration config, or null

ProjectScope​

FieldTypeDescription
bssAccountId()StringIBM Cloud BSS account ID
enforceMembers()booleanWhether membership enforcement is active
samlInstanceName()StringSAML instance name (e.g. "IBM w3id"), or null

ProjectCatalog​

FieldTypeDescription
guid()StringCatalog GUID
publicCatalog()booleanWhether the catalog is publicly accessible

ProjectStorage​

FieldTypeDescription
type()StringStorage backend type (e.g. "bmcos_object_storage")
guid()StringCloud Object Storage instance GUID
properties()ProjectStoragePropertiesBucket properties including credentials

ProjectStorageProperties​

FieldTypeDescription
bucketName()StringCOS bucket name
bucketRegion()StringBucket region (e.g. "us-south")
endpointUrl()StringCOS endpoint URL
credentials()Map<String, ProjectStorageCredential>Credentials keyed by role: admin, editor, viewer

ProjectStorageCredential​

FieldTypeDescription
apiKey()StringIAM API key for this role
serviceId()StringIAM service ID
accessKeyId()StringHMAC access key ID
secretAccessKey()StringHMAC secret access key
resourceKeyCrn()StringCRN of the resource key, or null

ProjectComputeInstance​

FieldTypeDescription
name()StringInstance name
guid()StringInstance GUID
type()StringInstance type (e.g. "machine_learning")
crn()StringCRN of the compute instance, or null
credentials()Map<String, Object>Instance credentials map, or null