Introduction
IBM Knowledge Catalog provides the capabilities for you to track data science models across the organization. View at a glance which models are in production and which need development or validation. Use the governance features to establish best practices to manage the communication flow from data scientists to ModelOps administrators.
Authentication
A bearer token from IBM Cloud Pak for Data is required to use any of the Watson Data APIs.
Visit the authorization section on Cloud Pak for Data for more information.
Curl command with API key to retrieve token
curl -k -X POST https://{cpd_cluster_host}/icp4d-api/v1/authorize -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{"username":"admin","password":"password"}'
Response
{
"_messageCode_": "200",
"message": "Success",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...."
}
- Use the value of the
token
property for your Factsheet API calls. Set thetoken
value as the authorization header parameter for requests to the Watson Data APIs. The format isAuthorization: Bearer <token_value_here>
. For example:Authorization: Bearer eyJraWQiOiIyMDE3MDgwOS0wMDowMDowMCIsImFsZyI6IlJTMjU2In0...
Versioning
Factsheet API has a major, minor, and patch version, following industry conventions on semantic versioning: Using the version number format MAJOR.MINOR.PATCH, the MAJOR version is incremented when incompatible API changes are made, the MINOR version is incremented when functionality is added in a backwards-compatible manner, and the PATCH version is incremented when backwards-compatible bug fixes are made. The service major version is represented in the URL path.
Error Handling
This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200
response indicates success. A 400
type response indicates a failure, and a 500
type response indicates an internal system error.
HTTP Error Code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
400 |
Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
401 |
Unauthorized | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions. |
403 |
Forbidden | The supplied authentication is not authorized to access '{namespace}'. |
404 |
Not Found | The requested resource could not be found. |
500 |
Internal Server Error | Service is currently unavailable. Your request could not be processed. Wait a few minutes and try again. |
Model Inventory
A model inventory tracks Watson Machine Learning and external models that you add to model entries. This allows you to control which models to track for an organization without all of the overhead of tracking samples and other models that are not significant to the organization.
The model inventory is a repository in IBM Knowledge Catalog where you can request a new model, then track it through its lifecycle. A typical flow might go as follows:
- A business user identifies a need for a machine learning model and creates a model entry to request a new model. The business owner assigns a potential name and states the basic parameters for the requested model.
- When the request is saved, a model entry is created in the inventory and the tracking begins. Initially, the entry will be in the Awaiting development state as there are no assets to accompany the request.
- When a data scientist creates a model for this business case, the data scientist chooses to track the model from the model details page of the project or deployment space, and associates it with the model entry.
- The model entry in the inventory can now be moved to an In progress state and stakeholders can review the assets for the entry, which now include the model.
- As the model advances in the lifecycle, the model entry will reflect all updates, including deployments and input data assets.
- If the data scientist chooses, challenger models can be added to the entry to compare performance.
- Validators and other stakeholders can review this and other model entries to ensure compliance with corporate protocols and to view and certify model progress from development to production.
External Models
You can add a model entry for a model that you trained outside of Watson Studio to the model inventory so that you can track the lifecycle details for the model.
The process to track external models is as follows:
- A user with Admin access to the IBM Knowledge Catalog must first set up a Platform Assets Catalog for registering external models, then enable tracking for external models in the model inventory.
- In the model notebook, use the API to define an external model asset to the Platform assets catalog.
- Associate the external model asset with a model entry in the model inventory to start preserving the facts.
Related API
Collect model training metrics automatically during model development in Notebooks. Using the AI Gov Facts Client Library, a model developer can enable collection of a rich set of model metrics, parameters and tags during training.
Methods
Delete Collaborators from an Inventory
Delete Collaborators from an Inventory
DELETE /v1/aigov/inventories/{inventory_id}/collaborators/{collaborator_id}
Authentication
Update Role of the Collaborator
Update Role of the Collaborator
PATCH /v1/aigov/inventories/{inventory_id}/collaborators/{collaborator_id}
Authentication
List all Collaborators of an Inventory
List all Collaborators of an Inventory
GET /v1/aigov/inventories/{inventory_id}/collaborators
Authentication
Add Collaborators to an Inventory
Add Collaborators to an Inventory
POST /v1/aigov/inventories/{inventory_id}/collaborators
Authentication
Add/Remove/Update Collaborator for an Asset
Add/Remove/Update Collaborator for an Asset
PATCH /v1/aigov/inventories/{inventory_id}/assets/{asset_id}/collaborators
Authentication
Updates AI Governance Configuration Settings
Updates AI Governance Configuration Settings
PUT /v1/aigov/factsheet/settings/{setting}
Gets all AI Governance Inventories Details
Gets all AI Governance Inventories Details
GET /v1/aigov/inventories
Authentication
Request
Query Parameters
Limited to use by accredited services. Must be supplied when caller is an accredited service. Used for listing catalogs, projects, or spaces for the account or for retrieving the number of public catalogs for the account.
limit
bookmark
skip
orderby
call_ref optional for caller reference
Create a Factsheet Inventory
Create a Factsheet Inventory
POST /v1/aigov/inventories
Authentication
Gets an AI Governance Inventory Details
Gets an AI Governance Inventory Details
GET /v1/aigov/inventories/{inventory_id}
Authentication
Deletes an AI Governance Inventory
Deletes an AI Governance Inventory
DELETE /v1/aigov/inventories/{inventory_id}
Authentication
Update an AI Governance Inventory properties
Update an AI Governance Inventory properties
PATCH /v1/aigov/inventories/{inventory_id}
Authentication
Get all deployments of external model
API supports only external models
GET /v1/aigov/model_inventory/models/{model_asset_id}/deployments
Add a deployment to external model
Add a deployment to external model
PUT /v1/aigov/model_inventory/models/{model_asset_id}/deployments
Get All Model use case assets
Returns all Model use case assets
GET /v1/aigov/model_inventory/model_entries
Create a Model use case asset for given catalog
Creates an asset of Type Model use case
POST /v1/aigov/model_inventory/model_entries
Create model use case approach
Create model use case approach
POST /v1/aigov/model_inventory/model_usecases/{model_usecase_asset_id}/version_approach
Delete external model deployment
This api supports only external models
DELETE /v1/aigov/model_inventory/models/{model_asset_id}/deployments/{deployment_id}
Fetch Model use case Asset for given assetId
Returns Model use case Asset for given assetId
GET /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}
Delete Model use case
Use this API to delete an existing Model use case and remove Model use case information.
DELETE /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}
Update Status and/or Risk Level of ModelEntry
Update Status and/or Risk Level of ModelEntry
PATCH /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}
Delete Model use case approach
Use this API to delete an existing Model use case approach if it's not being used by a model.
DELETE /v1/aigov/model_inventory/model_usecases/{model_usecase_asset_id}/version_approach/{approach_id}
Update Model use case approach
Use this API to update an existing Model use case approach if it's not being used by a model.
PATCH /v1/aigov/model_inventory/model_usecases/{model_usecase_asset_id}/version_approach/{approach_id}
Fetch System facts of the Model
Returns System Facts of the Model
GET /v1/aigov/model_inventory/models/{asset_id}/system_facts
Request
Path Parameters
Asset GUID
Query Parameters
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
Deployment GUID
exclude_basicFacts
exclude_additionalFacts
call_ref optional for caller reference
Update SystemFacts with openscale data
Model SystemFacts is updated with data from Openscale, Note: Only OpenScale MRM Service with a valid token is authorized to execute this endpoint
POST /v1/aigov/model_inventory/models/{asset_id}/system_facts
Authentication
Fetch Model use case Asset for given assetId
Returns Model use case Asset for given assetId
GET /v1/aigov/model_inventory/model_usecases/{model_usecase_asset_id}/tracked_model_versions
Gets the version details of a model
Gets the version details of a model
GET /v1/aigov/model_inventory/models/{model_asset_id}/version_details
Request
Path Parameters
model_asset_id
Query Parameters
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
call_ref optional for caller reference
Fetch all Physical Models for a logical Model
Returns all Physical Models for a logical Model
GET /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}/models
Link Model to Model use case
Link Model to Model use case
POST /v1/aigov/model_inventory/models/{asset_id}/model_entry
Request
Path Parameters
Model GUID
Query Parameters
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
call_ref optional for caller reference
ModelEntry Details
Move deployment from source to target environment
Move deployment from source to target environment
PUT /v1/aigov/model_inventory/models/{model_asset_id}/deployments/{deployment_id}/environment
Move model from source to target environment
Move model from source to target environment
PUT /v1/aigov/model_inventory/models/{model_asset_id}/environment
Save External Model
Creates an asset of type Model Stub
PUT /v1/aigov/model_inventory/model_stub
Update master_id for a model
Updates master_id of model
PATCH /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}/relatemodels
Update Model use case approach
Use this API to update an existing Model use case approach if it's not being used by a model.
PUT /v1/aigov/model_inventory/model_usecases/{model_usecase_asset_id}/version_approach/{approach_id}/versions/{version_number}
Get attachment facts for given type either model_usecase or model
Get attachment facts for given type either model_usecase or model
GET /v1/aigov/factsheet/attachment_fact_definitions/{type_name}
Create attachment group deifinition
Create attachment group deifinition
POST /v1/aigov/factsheet/attachment_fact_definitions/{type_name}
Get Attachmet details for the given attachment ID
Get Attachmet details for the given attachment ID
GET /v1/aigov/model_inventory/model_usecases/{asset_id}/facts
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
PUT /v1/aigov/factsheet/models/attachment/{asset_id}/content
Request
Path Parameters
asset_id
Query Parameters
Fact ID of Attachment
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
Name
description
mime
HTML rendering hint of Attachment
call_ref optional for caller reference
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
PUT /v1/aigov/factsheet/model_entries/attachment/{model_entry_asset_id}/content
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
GET /v1/aigov/report_templates
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
GET /v1/aigov/report_templates/{template_id}
Update report template
Update report template with ftl file to be used for report generation
PATCH /v1/aigov/report_templates/{template_id}
Download Model use case Asset for given assetId, format type and template type
Returns Model use case Asset data file for given assetId, format type and template type
GET /v1/aigov/model_inventory/model_entries/{model_entry_asset_id}/report
Download Model Asset for given assetId, format type and template type
Returns Model Asset data file for given assetId, format type and template type
GET /v1/aigov/model_inventory/models/{asset_id}/report
Request
Path Parameters
Model GUID
Query Parameters
Template Asset GUID
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
You must provide either a catalog id, a project id, or a space id, but not more than one
Format Type
Ignore Template Errors
call_ref optional for caller reference
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
Returns templates metadata, if scope is provided then it would provide only those scope specific template metadata
GET /v1/aigov/report_templates/{template_id}/content
Update specific report template content
Updates specified template id with template file name and content
POST /v1/aigov/report_templates/{template_id}/content