IBM Cloud API Docs

Introduction to IBM watsonx.ai Runtime

Using IBM watsonx.ai Runtime, you can build analytic models and neural networks, trained with your own data, that you can deploy for use in applications. IBM watsonx.ai Runtime provides a full range of tools and services, so you can build, train, and deploy Machine Learning models. Choose from tools that fully automate the training process for rapid prototyping to tools that give you complete control to create a model that matches your needs.

For more information about how to use IBM watsonx.ai Runtime, see here.

There is a specialized python library that is available to access this REST API here.

Endpoint URLs

The following URL represents the base URLs for the IBM watsonx.ai Runtime API endpoints. When you call the API, use the URL and add the path for each method to form the complete API endpoint for your requests.

  • Dallas: https://us-south.ml.cloud.ibm.com
  • London - https://eu-gb.ml.cloud.ibm.com
  • Frankfurt - https://eu-de.ml.cloud.ibm.com
  • Tokyo - https://jp-tok.ml.cloud.ibm.com
  • Sydney - https://au-syd.ml.cloud.ibm.com

Example request to a Dallas endpoint:

curl -H "Authorization: Bearer {token}" -X {request_method} "https://us-south.ml.cloud.ibm.com/{method_endpoint}"

Replace {request_method}, and {method_endpoint} in this example with the values for your particular API call. See the Authentication section below for more details about the bearer {token}.

Authentication

This API uses IBM Cloud Identity and Access Management (IAM) to authenticate requests.

To work with the API, authenticate your application or service by including your IBM Cloud IAM access token in API requests.

IAM authentication. Replace {token} and {url}/{method} with your service credentials.

curl -H "Authorization:Bearer {token}" -X "{url}/{method}"

Authorization: Bearer {token}

For example, if the token is tzLbqWhyALQawBg5TjRIf5sAznhrKQyvBFFaZbtF60m5 in the service credentials, include the credentials in your call like this:

curl -H "Authorization:Bearer tzLbqWhyALQawBg5TjRIf5sAznhrKQyvBFFaZbtF60m5" -X "https://us-south.ml.cloud.ibm.com/ml/v4/models"

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 type response indicates success. A 400 type response indicates a failure, and a 500 type response indicates an internal system error.

HTTP 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, or some other input validation failed. Be sure to include all required parameters in your request and check the request body.
401 Unauthorized You are not authorized to make this request. Log in and try again or provide a valid token. See Authenticating with IAM tokens for instructions on logging in. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized.
404 Not Found The requested resource could not be found.

Error response

Name Description
trace An identifier that can be used to trace the request. This can be set using X-Global-Transaction-Id.
errors The list of errors.

Errors

Name Description
code A simple string code that should convey the general sense of the error.
message The message that describes the error.
more_info A reference to a more detailed explanation when available.

Additional headers

Some additional headers might be required to make successful requests to the API. Those additional headers are described below.

An optional transaction ID can be passed to your request, which can be useful for tracking calls through multiple services using one identifier. The header key must be set to X-Global-Transaction-Id and the value is anything that you choose.

If there is not a transaction ID that is passed in, then one is generated randomly.

Versioning

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. See API Handbook for more details about date based API versioning. When there is a change to the API in a backwards-incompatible way, there will be a new version date published. Send the version parameter with every API request.

The service uses the API version for the date you specify or the most recent version before that date. It is not recommended defaulting to the current date. Instead, specify a date that matches a version that is compatible with your app and do not change it until your app is ready for a later version.

Deployed Version Dates

2021-05-01

The creation of deployment jobs is now fully asynchronous. What this means is that the creation of the job will not return the platform_jobs section in the response, instead poll the job using the deployment-jobs-get operation until the platform_jobs section is provided in the response.

Data References

Accessing data in a remote location (such as a Cloud Object Storage bucket, or an SQL/no-SQL database) requires the use of connection_asset or data_asset reference types. These reference types are created within a space or a project and are referenced in WML requests to represent input data and results locations. These types contain two parameter objects, connection and location, which require different values to be supplied based on the reference type. Using a data_asset, requires an href to be supplied to the location object whereas using a connection_asset requires the connection_id for the connection object and different location fields depending on the data source type, see Data reference Description for details.

Example data_asset payload:

{
  "training_data_references": [
    {
      "type": "data_asset",
      "location": {
        "href": "/v2/assets/<asset_id>?space_id=<space_id>"
      }
    }
  ]
}

Example connection_asset payload:

{
  "training_data_references": [
    {
      "type": "connection_asset",
      "connection": {
        "id": "<connection_guid>"
      },
      "location": {
        "<wdp-properties depending on the type>": "..."
      }
    }
  ]
}

Example url payload (Decision Optimization only):

{
  "training_data_references": {
    "type": "url",
    "id": "diet_food.csv",
    "connection": {
      "verb": "GET",
      "url": "https://myserver.com/diet_food.csv",
      "headers": {
        "Content-Type": "application/x-www-form-urlencoded"
      }
    },
    "location": {
    }
  }
}

Activity Tracker events

You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. Whenever an API method is called, an event is generated that you can then track and audit from within Activity Tracker. The specific event type is listed for each individual method.

For more information about how to track IBM watsonx.ai Runtime activity, see Auditing events for IBM watsonx.ai Runtime.

Methods

Create a new WML deployment

Create a new deployment, the parameters specifying the deployment type are online and batch. These parameters are mutually exclusive, specify only one of these when creating a deployment. Use hybrid_pipeline_hardware_specs only when creating a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other batch deployment cases use hardware_spec to specify compute configuration. The hybrid_pipeline_hardware_specs and hardware_spec are mutually exclusive, specify only one of these when creating a deployment. For batch deployments, hardware_spec.num_nodes parameter is not currently supported. For online deployments, hardware_spec cannot be specified at the time of creation, hardware_spec.num_nodes parameter is not supported as part of POST /ml/v4/deployments API request, but it can be updated using PATCH /ml/v4/deployments/<deployment id>. For online deployments, serving_name can be provided in online.parameters. The serving name can have the characters [a-z,0-9,_] and must not be more than 36 characters. The serving_name can be used in the prediction URL in place of the deployment_id. See the documentation supported frameworks for details about which frameworks can be used in a deployment.

POST /ml/v4/deployments

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The deployment entity.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "tags": [
            "dev",
            "TF"
        ],
        "name": "customer_churn",
        "description": "Customer churn prediction model deployment",
        "custom": "<object>",
        "asset": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2"
        },
        "hardware_spec": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "name": "<string>",
            "num_nodes": "<integer>"
        },
        "hybrid_pipeline_hardware_specs": [
            {
                "node_runtime_id": "auto_ai.kb",
                "hardware_spec": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                    "rev": "2",
                    "name": "<string>",
                    "num_nodes": "<integer>"
                }
            },
            {
                "node_runtime_id": "auto_ai.kb",
                "hardware_spec": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                    "rev": "2",
                    "name": "<string>",
                    "num_nodes": "<integer>"
                }
            }
        ],
        "online": {
            "parameters": "<object>"
        },
        "batch": {
            "parameters": "<object>"
        },
        "r_shiny": {
            "authentication": "members_of_deployment_space",
            "parameters": "<object>"
        },
    }'
    

Response

A deployment resource.

Status Code

  • Deployment created.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployments

Retrieve the list of deployments for the specified space.

GET /ml/v4/deployments

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieves the deployments that belong to this space.

    Example: 2ae804f8-fa85-4106-8228-cbc7e408ad79

  • Retrieves the deployment, if any, that contains this serving_name.

    Example: churn

  • Retrieves only the resources with the given tag value.

  • Retrieves only the resources with the given asset_id, asset_id would be either model_id or function_id.

  • Retrieves only the resources with the given name.

  • Retrieves the resources filtered with the given type. Allowed values are model, function, py_script and do.

  • Retrieves the resources filtered by state. Allowed values are initializing, updating, ready and failed.

  • Returns stats about deployments within a space or across spaces if it is set to true. This query parameter cannot be combined with any other except for 'space_id'.

  • Returns whether serving_name is available for use or not. This query parameter cannot be combined with any other except for 'serving_name'.

    Default: false

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01'

Response

The deployment resources.

Status Code

  • OK.

  • serving_name is available for use. Returned when serving_name and conflict query parameters are used.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

  • Returned when serving_name and conflict query parameters are used. The response body will contain the reason.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment details

Retrieve the deployment details with the specified identifier.

GET /ml/v4/deployments/{deployment_id}

Request

Path Parameters

  • The deployment id.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieves the deployments of assets that belong to this space.

    Example: 2ae804f8-fa85-4106-8228-cbc7e408ad79

  • curl --request GET "{url}/v4/deployments/{deployment_id}"

Response

A deployment resource.

Status Code

  • Deployment details.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the deployment

Delete the deployment with the specified identifier.

DELETE /ml/v4/deployments/{deployment_id}

Request

Path Parameters

  • The deployment id.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieves the deployments of assets that belong to this space.

    Example: 2ae804f8-fa85-4106-8228-cbc7e408ad79

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01'

Response

Status Code

  • Deployment deleted.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the deployment metadata

Update the deployment metadata. The following parameters of deployment metadata are supported for the patch operation.

  • /tags - /name - /description - /custom - /hardware_spec - /hybrid_pipeline_hardware_specs - /asset - /online/parameters In case of online deployments, using PATCH operation of /ml/v4/deployments, users can update the number of copies of an online deployment. Users can specify the desired value of number of copies in hardware_spec.num_nodes parameter. As hardware_spec.name or hardware_spec.id is mandatory for hardware_spec schema, a valid value such as XS, S must be specified for hardware_spec.name parameter as part of PATCH request. Alternatively, users can also specify a valid ID of a hardware specification in hardware_spec.id parameter. However, changes related to hardware_spec.name or hardware_spec.id specified in PATCH operation will not be applied for online deployments.
    In case of batch deployments, using PATCH operation of /ml/v4/deployments, users can update the hardware specification so that subsequent batch deployment jobs can make use of the updated compute configurations. To update the compute configuration, users must specify a valid value for either hardware_spec.name or hardware_spec.id of the hardware specification that suits their requirement. In the batch deployment context, hardware_spec.num_nodes parameter is not currently supported.
    When 'asset' is patched with id/rev:
  • Deployment with the patched id/rev is started. - With an asynchronous deployment (version greater than 2021-05-01), 202 response code will be returned and one can poll the deployment for the status.
  • If any failures, deployment will be reverted back to the previous id/rev and the failure message will be captured in 'failures' field in the response.

In the case of an online deployment, the PATCH operation with path specified as /online/parameters can be used to update the serving_name.

PATCH /ml/v4/deployments/{deployment_id}

Request

Path Parameters

  • The deployment id.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieves the deployments of assets that belong to this space.

    Example: 2ae804f8-fa85-4106-8228-cbc7e408ad79

The json patch.

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01' --data-raw '[
        {        "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

A deployment resource.

Status Code

  • Deployment accepted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Execute a synchronous deployment prediction

Execute a synchronous prediction for the deployment with the specified identifier. If a serving_name is used then it must match the serving_name that is returned in the inference field.

POST /ml/v4/deployments/{deployment_id}/predictions

Request

Path Parameters

  • The deployment_id can be either the deployment_id that identifies the deployment or a serving_name that allows a predefined URL to be used to post a prediction.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The scoring data.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01' --data-raw '{
        "input_data": [
            {
                "id": "<string>",
                "fields": [
                    "<string>",
                    "<string>"
                ],
                "values": [
                    [
                        "<object>",
                        "<object>"
                    ],
                    [
                        "<object>",
                        "<object>"
                    ]
                ]
            },
            {
                "id": "<string>",
                "fields": [
                    "<string>",
                    "<string>"
                ],
                "values": [
                    [
                        "<object>",
                        "<object>"
                    ],
                    [
                        "<object>",
                        "<object>"
                    ]
                ]
            }
        ]
    }'
    

Response

Scoring results.

Status Code

  • Scoring response.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment jobs

Retrieve the status of the current jobs. The system will apply a max limit of jobs retained by the system as we cannot accumulate an infinite number of jobs. Only most recent 300 jobs (system configurable) will be preserved. Older jobs will be purged by the system.

GET /ml/v4/deployment_jobs

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieves the deployment jobs that belong to this space.

  • Retrieves only the jobs with these tags (comma separated).

  • Filter based on on the deployment job state: queued, running, completed, failed etc.

  • Filter based on the deployment_id.

  • Retrieves only fields from decision_optimization and scoring section mentioned as comma separated values as output response fields. Retrieves all the fields if not mentioned.

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=2020-09-01'
    

Response

The information related to the jobs.

Status Code

  • Jobs response.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Start an asynchronous deployment job

Start a deployment job asynchronously. This can perform batch scoring, streaming, or other types of batch operations, such as solving a Decision Optimization problem. Depending on the version date passed, the platform_jobs section in the response may or may not be populated. Use the GET call to retrieve the deployment job, this GET call will eventually populate the platform_jobs section. Refer to the version date description for more details.

POST /ml/v4/deployment_jobs

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Defines number of days to retain the job meta. Job meta will be auto deleted after that. Value '-1' sets the meta to be never auto deleted. accepted values are positive integer and '-1'. The default value if the parameter is not passed is '30' days.

The request body contains information about the batch deployment job that is described in more detail below.

The deployment is a reference to the deployment associated with the deployment job or deployment job definition.

The scoring and decision_optimization properties are mutually exclusive. Specify only one of these when submitting a batch deployment job, one of these fields must be defined.

Use hybrid_pipeline_hardware_specs only in a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other cases use hardware_spec to specify compute configuration.

In case of output data references where the data asset is a remote database, users can specify if the batch deployment output must be appended to the table or if the table is to be truncated and output data updated. The output_data_references.location.write_mode parameter can be used to for this purpose. The values truncate or append can be specified for output_data_references.location.write_mode parameter.

  • Specifying truncate as value will truncate the table and the batch output data will be inserted.
  • Specifying append as value will insert the batch output data to the remote database table.
  • The write_mode parameter is applicable only for output_data_references parameter.
  • The write_mode parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data assets or a COS based data asset.
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01' --data-raw '{
       "space_id":"3fc54cf1-252f-424b-b52d-5cdd9814987f",
       "name":"my-resource",
       "deployment":{
          "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab"
       },
       "hardware_spec":{
          "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
          "rev":"2",
          "name":"string",
          "num_nodes":2
       },
       "scoring":{
          "input_data":[
             {
                "id":"string",
                "type":"target",
                "fields":[
                   "string"
                ],
                "values":[
                   [
                      {
                         
                      }
                   ]
                ],
                "targets":[
                   [
                      {
                         
                      }
                   ]
                ]
             }
          ],
          "output_data_reference":{
             "id":"string",
             "type":"s3",
             "connection":{
                
             }
          },
          "evaluations":[
             {
                "id":"string",
                "input_target":"string",
                "metrics_names":[
                   "auroc",
                   "accuracy"
                ]
             }
          ]
       }
    }' 
     
    echo "DO Payload Example" 
    curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01' --data-raw '{
       "name":"test-job",
       "space_id":"dcfb2ae2-1733-11ec-9621-0242ac130002",
       "deployment":{
          "id":"e672c9e0-1733-11ec-9621-0242ac130002"
       },
       "decision_optimization":{
          "solve_parameters":{
             "oaas.logAttachmentName":"log.txt",
             "oaas.logTailEnabled":"true"
          },
           "input_data":[
             {
                "id": "data.bin",
                "content": "VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo="
             },
             {
                "id": "tuples.csv",
                "fields": ["Name", "Value"],
                "values": [   ["name1", 1],
                              ["name2", 11934]
                ]}            
             },
          ],
          "input_data_references":[
             {
                "id":"c1.mod",
                "type":"data_asset",
                "location":{
                   "href":"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002"
                }
             }
          ],
          "output_data":[
             {
                "id":".*\\.*"
             }
          ]
    }'

Response

The information related to the job.

Status Code

  • Accepted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Cancel the deployment job

Cancel the specified deployment job.

DELETE /ml/v4/deployment_jobs/{job_id}

Request

Path Parameters

  • The id of the job.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Cancel the deployment job that belong to this space.

  • Set to true in order to also delete the job metadata information.

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01'
    

Response

Status Code

  • Success.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment job

Retrieve the deployment job. The predicted data bound to this job_id is going to be kept around for a limited time based on the service configuration.

GET /ml/v4/deployment_jobs/{job_id}

Request

Path Parameters

  • The id of the job.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Retrieve the deployment job that belong to this space.

  • Retrieves only fields from decision_optimization and scoring section mentioned as comma separated values as output response fields. Retrieves all the fields if not mentioned.

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01'
    

Response

The information related to the job.

Status Code

  • Jobs response.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new deployment job definition

Create a new deployment job definition with the given payload. A deployment job definition represents the deployment metadata information in order to create a batch job in WML. This contains the same metadata used by the /ml/v4/deployment_jobs endpoint. This means that when submitting batch deployment jobs the user can either provide the job definition inline or reference a job definition in a query parameter.

POST /ml/v4/deployment_job_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the deployment job definition.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "name": "my-resource",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "deployment": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        },
        "custom": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        },
        "hardware_spec": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        },
        "hybrid_pipeline_hardware_specs": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        },
        "scoring": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        },
        "decision_optimization": {
            "value": "<Error: Too many levels of nesting to fake this schema>"
        }
    }'
    

Response

The information for a deployment job definition.

Status Code

  • Deployment job definition created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment job definitions

Retrieve the deployment job definitions for the specified space.

GET /ml/v4/deployment_job_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of deployment job definitions.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment job definition

Retrieve the deployment job definition with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record.

GET /ml/v4/deployment_job_definitions/{job_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.read

Request

Path Parameters

  • Deployment job definition identifier.

    Example: 212fadf1-252f-424b-b52d-5cdd98ecfa0

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for a deployment job definition.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the deployment job definition

Update the deployment job definition with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
  • /deployment
PATCH /ml/v4/deployment_job_definitions/{job_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.update

Request

Path Parameters

  • Deployment job definition identifier.

    Example: 212fadf1-252f-424b-b52d-5cdd98ecfa0

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a deployment job definition.

Status Code

  • Deployment job definition has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the deployment job definition

Delete the deployment job definition with the specified identifier. This will delete all revisions of this deployment job definition as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/deployment_job_definitions/{job_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.delete

Request

Path Parameters

  • Deployment job definition identifier.

    Example: 212fadf1-252f-424b-b52d-5cdd98ecfa0

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Deployment job definition deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new deployment job definition revision

Create a new deployment job definition revision. The current metadata and content for job_definition_id will be taken and a new revision created.

POST /ml/v4/deployment_job_definitions/{job_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.create

Request

Path Parameters

  • Deployment job definition identifier.

    Example: 212fadf1-252f-424b-b52d-5cdd98ecfa0

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a deployment job definition.

Status Code

  • Deployment job definition revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the deployment job definition revisions

Retrieve the deployment job definition revisions.

GET /ml/v4/deployment_job_definitions/{job_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.job.list

Request

Path Parameters

  • Deployment job definition identifier.

    Example: 212fadf1-252f-424b-b52d-5cdd98ecfa0

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of deployment job definitions.

Status Code

  • Deployment job definition revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new experiment

Create a new experiment with the given payload. An experiment represents an asset that captures a set of pipeline or model definition assets that will be trained at the same time on the same data set.

POST /ml/v4/experiments

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the experiment. Either space_id or project_id has to be provided and is mandatory.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01' --data-raw '{
        "name": "my-resource",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "label_column": "<string>",
        "evaluation_definition": {
            "metrics": [
                {
                    "name": "<string>",
                    "maximize": "<boolean>"
                },
                {
                    "name": "<string>",
                    "maximize": "<boolean>"
                }
            ],
            "method": "binary"
        },
        "training_references": [
            {
                "pipeline": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                    "rev": "2",
                    "model_type": "<string>",
                    "data_bindings": [
                        {
                            "data_reference_name": "<string>",
                            "node_id": "<string>"
                        },
                        {
                            "data_reference_name": "<string>",
                            "node_id": "<string>"
                        }
                    ],
                    "nodes_parameters": [
                        {
                            "node_id": "<string>",
                            "parameters": "<object>"
                        },
                        {
                            "node_id": "<string>",
                            "parameters": "<object>"
                        }
                    ],
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    },
                    "hybrid_pipeline_hardware_specs": [
                        {
                            "node_runtime_id": "auto_ai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        },
                        {
                            "node_runtime_id": "auto_ai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        }
                    ]
                },
                "model_definition": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab"
                },
                "hyper_parameters_optimization": {
                    "method": {
                        "name": "random",
                        "parameters": "<object>"
                    },
                    "hyper_parameters": [
                        {
                            "name": "learning_rate",
                            "items": [
                                0.005,
                                0.1,
                                0.11
                            ]
                        },
                        {
                            "name": "fc",
                            "items": {
                                "min_value": 9,
                                "max_value": 10,
                                "power": 2
                            }
                        }
                    ]
                }
            },
            {
                "pipeline": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                    "rev": "2",
                    "model_type": "<string>",
                    "data_bindings": [
                        {
                            "data_reference_name": "<string>",
                            "node_id": "<string>"
                        },
                        {
                            "data_reference_name": "<string>",
                            "node_id": "<string>"
                        }
                    ],
                    "nodes_parameters": [
                        {
                            "node_id": "<string>",
                            "parameters": "<object>"
                        },
                        {
                            "node_id": "<string>",
                            "parameters": "<object>"
                        }
                    ],
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    },
                    "hybrid_pipeline_hardware_specs": [
                        {
                            "node_runtime_id": "auto_ai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        },
                        {
                            "node_runtime_id": "auto_ai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        }
                    ]
                },
                "model_definition": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab"
                },
                "hyper_parameters_optimization": {
                    "method": {
                        "name": "random",
                        "parameters": "<object>"
                    },
                    "hyper_parameters": [
                        {
                            "name": "learning_rate",
                            "items": [
                                0.005,
                                0.1,
                                0.11
                            ]
                        },
                        {
                            "name": "fc",
                            "items": {
                                "min_value": 9,
                                "max_value": 10,
                                "power": 2
                            }
                        }
                    ]
                }
            }
        ],
        "custom": "<object>"
    }'
    

Response

The information for an experiment.

Status Code

  • Experiment created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the experiments

Retrieve the experiments for the specified space or project.

GET /ml/v4/experiments

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of experiments.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the experiment

Retrieve the experiment with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/experiments/{experiment_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.read

Request

Path Parameters

  • Experiment identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for an experiment.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the experiment

Update the experiment with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
PATCH /ml/v4/experiments/{experiment_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.update

Request

Path Parameters

  • Experiment identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for an experiment.

Status Code

  • Experiment has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the experiment

Delete the experiment with the specified identifier. This will delete all revisions of this experiment as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/experiments/{experiment_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.delete

Request

Path Parameters

  • Experiment identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Experiment deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new experiment revision

Create a new experiment revision. The current metadata and content for experiment_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/experiments/{experiment_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.create

Request

Path Parameters

  • Experiment identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for an experiment.

Status Code

  • Experiment revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the experiment revisions

Retrieve the experiment revisions.

GET /ml/v4/experiments/{experiment_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.experiment.list

Request

Path Parameters

  • Experiment identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of experiments.

Status Code

  • Experiment revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new function

Create a new function with the given payload. A function is some code that can be deployed as an online, or batch deployment.

POST /ml/v4/functions

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the function. Either space_id or project_id has to be provided and is mandatory.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/functions?version=2020-09-01' --data-raw '{
       "name": "my-resource",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "software_spec": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "name": "..."
        },
        "type": "python",
        "sample_scoring_input": {
            "input_data": [
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name",
                        "age",
                        "occupation"
                      {
                    ],
                    "values": [
                        [
                            "<object>",
                            "<object>"
                        ],
                        [
                            "<object>",
                            "<object>"
                        ]
                    ]
                },
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name",
                        "age",
                        "occupation"
                      {
                    ],
                    "values": [
                        [
                            "<object>",
                            "<object>"
                        ],
                        [
                            "<object>",
                            "<object>"
                        ]
                    ]
                }
            ]
        },
        "schemas": {
            "input": [
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                },
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                }
            ],
            "output": [
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                },
                {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                }
            ]
        },
        "custom": "<object>"
    }'
    

Response

The information for a function.

Status Code

  • Function created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the functions

Retrieve the functions for the specified space or project.

GET /ml/v4/functions

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/functions?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of functions.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the function

Retrieve the function with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/functions/{function_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.read

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for a function.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the function

Update the function with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
PATCH /ml/v4/functions/{function_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.update

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a function.

Status Code

  • Function has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the function

Delete the function with the specified identifier. This will delete all revisions of this function as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/functions/{function_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.delete

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Function deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new function revision

Create a new function revision. The current metadata and content for function_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/functions/{function_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.create

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a function.

Status Code

  • Function revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the function revisions

Retrieve the function revisions.

GET /ml/v4/functions/{function_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.list

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of functions.

Status Code

  • Function revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Upload the function code

Upload the function code. Functions expect a zip file that contains a python file that make up the function. Python functions specify what needs to be run when the function is deployed and what needs to be run when the scoring function is called. In other words, you are able to customize what preparation WML does in the environment when you deploy the function, as well as what steps WML takes to generate the output when you call the API later on. The function consists of the outer function (any place that is not within the score function) and the inner score function. The code that sits in the outer function runs when the function is deployed, and the environment is then frozen and ready to be used whenever the online scoring or batch inline job processing API is called. The code that sits in the inner score function runs when the online scoring or batch inline job processing API is called, in the environment customized by the outer function. See Deploying Python function for more details. This is illustrated in the example below:

 
...python code used to set up the environment...

def score(payload):
df_payload = pd.DataFrame(payload[values])
df_payload.columns = payload[fields]
...
output = {result : res}
return output

return score

PUT /ml/v4/functions/{function_id}/code

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.add

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

A gzip file containing code files.

  • curl --request PUT 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id/code?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

The metadata related to the attachment.

Status Code

  • Function code uploaded

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Download the function code

Download the function code. It is possible to get the code for a given revision of the function. Functions expect a zip file that contains a python file that make up the function. Python functions specify what needs to be run when the function is deployed and what needs to be run when the scoring function is called. In other words, you are able to customize what preparation WML does in the environment when you deploy the function, as well as what steps WML takes to generate the output when you call the API later on. The function consists of the outer function (any place that is not within the score function) and the inner score function. The code that sits in the outer function runs when the function is deployed, and the environment is then frozen and ready to be used whenever the online scoring or batch inline job processing API is called. The code that sits in the inner score function runs when the online scoring or batch inline job processing API is called, in the environment customized by the outer function. See Deploying Python function for more details. This is illustrated in the example below:

 
...python code used to set up the environment...

def score(payload):
df_payload = pd.DataFrame(payload[values])
df_payload.columns = payload[fields]
...
output = {result : res}
return output

return score

GET /ml/v4/functions/{function_id}/code

Auditing

Calling this method generates the following auditing event.

  • pm-20.function.read

Request

Path Parameters

  • Function identifier.

    Example: 64dc8921-345f-234b-462d-78e41246987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/functions/:function_id/code?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

Status Code

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the service instances

Retrieve the service instances. Either space_id or project_id query parameter is mandatory but both can be provided.

GET /ml/v4/instances

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Return resources pertaining to any space_id listed. Either space_id or project_id query parameter is mandatory but both can be provided.

  • Return resources pertaining to any project_id listed. Either space_id or project_id query parameter is mandatory but both can be provided.

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Only if consumption_details is set to true each instance entity.consumption.details part is available in response.

    Default: false

    Example: true

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/instances?space_id=<string>,<string>&project_id=<string>,<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

Information for paging when querying resources.

Status Code

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the service instance

Retrieve the service instance details.

GET /ml/v4/instances/{instance_id}

Request

Path Parameters

  • The instance identifier.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Defines authorization context that allows a space member to perform this operation.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Defines authorization context that allows a project member to perform this operation.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Only if consumption_details is set to true the instance entity.consumption.details part is available in response.

    Default: false

    Example: true

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/instances/:instance_id?space_id=63dc4cf1-252f-424b-b52d-5cdd9814987f&project_id=63dc4cf1-252f-424b-b52d-5cdd9814987f&version=2020-09-01'
    

Response

Status Code

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new model

Create a new model with the given payload. A model represents a machine learning model asset. If a 202 status is returned then the model will be ready when the content_import_state in the model status (/ml/v4/models/{model_id}) is completed. If content_import_state is not used then a 201 status is returned.

POST /ml/v4/models

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the model. Either space_id or project_id has to be provided and is mandatory.

Response

The information for a model.

Status Code

  • Model created

  • Model accepted, this is returned in the case that content_location was provided in the request entity and so the model was created but the attachments are still being uploaded. In this case the model will not be ready until the content_import_state in the model status (/ml/v4/models/{model_id}) is completed.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the models

Retrieve the models for the specified space or project.

GET /ml/v4/models

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&software_spec=<string>&version=2024-10-17'
    

Response

A paginated list of models.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model

Retrieve the model with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/models/{model_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.read

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id?space_id=<string>&project_id=<string>&rev=<string>&version=2024-10-17'
    

Response

The information for a model.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the model

Update the model with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
  • /software_spec (operation replace only)
  • /model_version (operation add and replace only)
PATCH /ml/v4/models/{model_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.update

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id?space_id=<string>&project_id=<string>&version=2024-10-17' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a model.

Status Code

  • Model has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the model

Delete the model with the specified identifier. This will delete all revisions of this model as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/models/{model_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.delete

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id?space_id=<string>&project_id=<string>&version=2024-10-17'
    

Response

Status Code

  • Model deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new model revision

Create a new model revision. The current metadata and content for model_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/models/{model_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.create

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/revisions?version=2024-10-17' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a model.

Status Code

  • Model revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model revisions

Retrieve the model revisions.

GET /ml/v4/models/{model_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.list

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2024-10-17'
    

Response

A paginated list of models.

Status Code

  • Model revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model content metadata list

Retrieve the content metadata list for the specified model attachments.

GET /ml/v4/models/{model_id}/content

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.list

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • List only attachments with the given name.

    Example: my_model

  • This is the format of the content. Any value can be used for the format and is there to be able to easily find content by format.

    Example: native

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/content?space_id=<string>&project_id=<string>&rev=<string>&name=<string>&content_format=<string>&version=2024-10-17'
    

Response

The metadata related to the attachments.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Upload the model content

Upload the content for the specified model.

PUT /ml/v4/models/{model_id}/content

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.add

Request

Custom Headers

  • Allowable values: [application/zip,application/json,text/plain,application/xml]

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • This is the format of the content. Any value can be used for the format and is there to be able to easily find content by format.

    Example: native

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Returns only resources that match this pipeline_node_id, this is only relevant if content_format is pipeline-node.

    Example: 62344cf1-252f-424b-b52d-5cdd9814aacd

  • Returns only resources that match this deployment_id, this is only relevant if content_format is coreml.

    Example: 62344cf1-252f-424b-b52d-5cdd9814aacd

  • Provide the name of the attachment.

    Example: my_models

models file

Examples:
  • curl --request PUT 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/content?content_format=<string>&space_id=<string>&project_id=<string>&pipeline_node_id=<string>&name=<string>&version=2024-10-17' --data-raw '"<object>"'
    

Response

The metadata related to the attachment.

Status Code

  • Model content uploaded

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Download the model content

Download the model content.

GET /ml/v4/models/{model_id}/content/{attachment_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.read

Request

Custom Headers

  • Allowable values: [application/zip,application/gzip,application/json,text/plain,application/xml]

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Identifier for the attachment for resources that support separate content.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/content/:attachment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2024-10-17'
    

Response

Arbitrary zip file.

Status Code

  • Downloaded

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

Example responses

Delete the model content

Delete the content for the specified model.

DELETE /ml/v4/models/{model_id}/content/{attachment_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.delete

Request

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • Identifier for the attachment for resources that support separate content.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/content/:attachment_id?space_id=<string>&project_id=<string>&version=2024-10-17'
    

Response

Status Code

  • Model content deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Download the model content that matches a certain criteria

Download the model content identified by the provided criteria. If more than one attachment is found for the given filter then a 400 error is returned. If there are no attachments that match the filter then a 404 error is returned. If there are no filters then, if there is a single attachment, the attachment content will be returned otherwise a 400 or 404 error will be returned as described above. This method is just a shortcut for getting the attachment metadata and then downloading by attachment id.

GET /ml/v4/models/{model_id}/download

Auditing

Calling this method generates the following auditing event.

  • pm-20.model.read

Request

Custom Headers

  • Allowable values: [application/zip,application/gzip,application/json,text/plain,application/xml]

Path Parameters

  • Model identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • Returns only resources that match this pipeline_node_id, this is only relevant if content_format is pipeline-node.

    Example: 62344cf1-252f-424b-b52d-5cdd9814aacd

  • Returns only resources that match this deployment_id, this is only relevant if content_format is coreml.

    Example: 62344cf1-252f-424b-b52d-5cdd9814aacd

  • Match an attachment with this name.

    Example: my_model

  • This is the format of the content. Any value can be used for the format and is there to be able to easily find content by format.

    Example: native

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/download?space_id=<string>&project_id=<string>&rev=<string>&pipeline_node_id=<string>&name=<string>&content_format=<string>&version=2024-10-17'
    

Response

Arbitrary zip file.

Status Code

  • Downloaded

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

Example responses

Create a new model definition

Create a new model definition with the given payload. A model definition represents the code that is used to train one or more models.

POST /ml/v4/model_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the model definition. Either space_id or project_id has to be provided and is mandatory.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions?version=2020-09-01' --data-raw '{
        "name": "my-resource",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "version": "<string>",
        "platform": {
            "name": "<string>",
            "versions": [
                "<string>",
                "<string>"
            ]
        },
        "command": "<string>",
        "custom": "<object>"
    }'
    

Response

The information for a model definition.

Status Code

  • Model definition created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model definitions

Retrieve the model definitions for the specified space or project.

GET /ml/v4/model_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of model definitions.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model definition

Retrieve the model definition with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/model_definitions/{model_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.read

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for a model definition.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the model definition

Update the model definition with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
PATCH /ml/v4/model_definitions/{model_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.update

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a model definition.

Status Code

  • Model definition has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the model definition

Delete the model definition with the specified identifier. This will delete all revisions of this model definition as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/model_definitions/{model_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.delete

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Model definition deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new model definition revision

Create a new model definition revision. The current metadata and content for model_definition_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/model_definitions/{model_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.create

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a model definition.

Status Code

  • Model definition revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the model definition revisions

Retrieve the model definition revisions.

GET /ml/v4/model_definitions/{model_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.list

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of model definitions.

Status Code

  • Model definition revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Upload the model definition model

Upload the model definition model. Model definitions for Deep Learning accept a zip file that contains one or more python files organized in any directory structure.

PUT /ml/v4/model_definitions/{model_definition_id}/model

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.add

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

A gzip file containing code files.

  • curl --request PUT 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id/model?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

The metadata related to the attachment.

Status Code

  • Model definition model uploaded

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Download the model definition model

Download the model definition model. It is possible to get the model for a given revision of the model definition. Model definitions for Deep Learning accept a zip file that contains one or more python files organized in any directory structure.

GET /ml/v4/model_definitions/{model_definition_id}/model

Auditing

Calling this method generates the following auditing event.

  • pm-20.model_definition.read

Request

Path Parameters

  • Model definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/model_definitions/:model_definition_id/model?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

Status Code

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new pipeline

Create a new pipeline with the given payload. A pipeline represents a hybrid-pipeline, as a JSON document, that is used to train one or more models.

POST /ml/v4/pipelines

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the pipeline. Either space_id or project_id has to be provided and is mandatory.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines?version=2020-09-01' --data-raw '{
        "name": "my-resource",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "document": "<object>",
        "custom": "<object>"
    }'
    

Response

The information for a pipeline.

Status Code

  • Pipeline created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the pipelines

Retrieve the pipelines for the specified space or project.

GET /ml/v4/pipelines

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of pipelines.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the pipeline

Retrieve the pipeline with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/pipelines/{pipeline_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.read

Request

Path Parameters

  • Pipeline identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines/:pipeline_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for a pipeline.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the pipeline

Update the pipeline with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
PATCH /ml/v4/pipelines/{pipeline_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.update

Request

Path Parameters

  • Pipeline identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines/:pipeline_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a pipeline.

Status Code

  • Pipeline has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the pipeline

Delete the pipeline with the specified identifier. This will delete all revisions of this pipeline as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/pipelines/{pipeline_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.delete

Request

Path Parameters

  • Pipeline identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines/:pipeline_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Pipeline deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new pipeline revision

Create a new pipeline revision. The current metadata and content for pipeline_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/pipelines/{pipeline_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.create

Request

Path Parameters

  • Pipeline identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines/:pipeline_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a pipeline.

Status Code

  • Pipeline revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the pipeline revisions

Retrieve the pipeline revisions.

GET /ml/v4/pipelines/{pipeline_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.pipeline.list

Request

Path Parameters

  • Pipeline identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/pipelines/:pipeline_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of pipelines.

Status Code

  • Pipeline revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new remote training system

Create a new remote training system with the given payload. A remote training system represents a remote system used by Federated Learning. This definition is necessary to control who can register to a federated learning job.

POST /ml/v4/remote_training_systems

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the remote training system. Either space_id or project_id has to be provided and is mandatory.

Response

The information for a remote training system.

Status Code

  • Remote training system created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the remote training systems

Retrieve the remote training systems for the specified space or project.

GET /ml/v4/remote_training_systems

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

Response

A paginated list of remote training systems.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the remote training system

Retrieve the remote training system with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/remote_training_systems/{remote_training_system_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.read

Request

Path Parameters

  • Remote training system identifier.

    Example: 3067fdf1-252f-424b-b52d-5cdd981cae3

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

Response

The information for a remote training system.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the remote training system

Update the remote training system with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
  • /organization
  • /allowed_identities
  • /remote_admin
PATCH /ml/v4/remote_training_systems/{remote_training_system_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.update

Request

Path Parameters

  • Remote training system identifier.

    Example: 3067fdf1-252f-424b-b52d-5cdd981cae3

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

Response

The information for a remote training system.

Status Code

  • Remote training system has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the remote training system

Delete the remote training system with the specified identifier. This will delete all revisions of this remote training system as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/remote_training_systems/{remote_training_system_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.delete

Request

Path Parameters

  • Remote training system identifier.

    Example: 3067fdf1-252f-424b-b52d-5cdd981cae3

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Response

Status Code

  • Remote training system deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new remote training system revision

Create a new remote training system revision. The current metadata and content for remote_training_system_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/remote_training_systems/{remote_training_system_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.create

Request

Path Parameters

  • Remote training system identifier.

    Example: 3067fdf1-252f-424b-b52d-5cdd981cae3

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}

Response

The information for a remote training system.

Status Code

  • Remote training system revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the remote training system revisions

Retrieve the remote training system revisions.

GET /ml/v4/remote_training_systems/{remote_training_system_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.remote_training_system.list

Request

Path Parameters

  • Remote training system identifier.

    Example: 3067fdf1-252f-424b-b52d-5cdd981cae3

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

Response

A paginated list of remote training systems.

Status Code

  • Remote training system revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new WML training

Create a new WML training.

POST /ml/v4/trainings

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The training_data_references contain the training datasets and the results_reference the connection where results will be stored.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/trainings?version=%3Cdate%3E' --data-raw '{
        "experiment": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2"
        },
        "pipeline": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "model_type": "<string>",
            "data_bindings": [
                {
                    "data_reference_name": "<string>",
                    "node_id": "<string>"
                },
                {
                    "data_reference_name": "<string>",
                    "node_id": "<string>"
                }
            ],
            "nodes_parameters": [
                {
                    "node_id": "<string>",
                    "parameters": "<object>"
                },
                {
                    "node_id": "<string>",
                    "parameters": "<object>"
                }
            ],
            "hardware_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "<string>",
                "num_nodes": "<integer>"
            },
            "hybrid_pipeline_hardware_specs": [
                {
                    "node_runtime_id": "auto_ai.kb",
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    }
                },
                {
                    "node_runtime_id": "auto_ai.kb",
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    }
                }
            ]
        },
        "model_definition": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "model_type": "<string>",
            "hardware_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "<string>",
                "num_nodes": "<integer>"
            },
            "software_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "..."
            },
            "command": "<string>",
            "parameters": "<object>"
        },
        "training_data_references": [
            {
                "type": "<string>",
                "id": "<string>",
                "connection": "<object>",
                "location": "<object>",
                "schema": {
                    "id": "<string>",
                    "fields": [
                        { "name": "duration",
                        "type": "number" }
                    ],
                    "name": "<string>"
                }
            },
            {
                "type": "<string>",
                "id": "<string>",
                "connection": "<object>",
                "location": "<object>",
                "schema": {
                    "id": "<string>",
                    "fields": [
                        { "name": "duration",
                        "type": "number" }
                    ],
                    "name": "<string>"
                }
            }
        ],
        "results_reference": {
            "type": "<string>",
            "location": "<object>",
            "id": "<string>",
            "connection": "<object>"
        },
        "tags": [
            "t1",
            "t2"
        ],
        "name": "my-training",
        "description": "My first training.",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f"
    }'

Response

Training resource.

Status Code

  • The training job has been created.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the list of trainings

Retrieve the list of trainings for the specified space or project.

GET /ml/v4/trainings

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. Default value is 100. Max value is 200.

    Default: 100

  • Compute the total count. May have performance impact.

  • Return only the resources with the given tag value.

  • Filter based on 'pipeline' or 'experiment' trainings. Example: type=pipeline. If not provided, returns all the trainings.

  • Filter based on on the training job state: queued, running, completed, failed etc.

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Return the training jobs that are sub-jobs of this parent_id job. The parent_id can be the experiment job ID.

  • curl --request GET'https://us-south.ml.cloud.ibm.com/ml/v4/trainings?start=<string>&limit=100&total_count=<boolean>&tag.value=<string>&type=<string>&state=<string>&space_id=<string>&project_id=<string>&parent_id=<string>&version=<string>'

Response

Information for paging when querying resources.

Status Code

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the training

Retrieve the training with the specified identifier. This call supports Web-Socket upgrade. However in order to preserve bandwidth, web-socket messages are not context complete. Meaning that a single web-socket message only reflects a message or metric happening in the context of a training job or sub-job (in case of experiment trainings or HPO/AutoML trainings). Hence the metadata property of a web-socket message contains a parent with the href information of the parent job that triggered this particular job. Also the metrics will be provided as they arrive from the backend runtime, and not as a cumulative list. In order to get the full view of the running training job the caller should do a regular GET call.

GET /ml/v4/trainings/{training_id}

Request

Path Parameters

  • The training identifier.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/trainings?start=<string>&limit=100&total_count=<boolean>&tag.value=<string>&type=<string>&state=<string>&space_id=<string>&project_id=<string>&parent_id=<string>&version=2020-09-01'

Response

Training resource.

Status Code

  • In case of web socket upgrade, the service messages emitted have the following shape.

  • OK.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Cancel the training

Cancel the specified training and remove it.

DELETE /ml/v4/trainings/{training_id}

Request

Path Parameters

  • The training identifier.

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Set to true in order to also delete the job metadata information.

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/trainings/:training_id?hard_delete=<boolean>&version=2020-09-01&space_id=<string>&project_id=<string>'

Response

Status Code

  • Training cancelled.

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new training definition

Create a new training definition with the given payload. A training definition represents the training meta-data necessary to start a training job.

POST /ml/v4/training_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.create

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

Payload for creating the training definition. Either space_id or project_id has to be provided and is mandatory.

  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions?version=2020-09-01' --data-raw '{
        "name": "my-resource",
        "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f",
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "description": "This is my first resource.",
        "tags": [
            "t1",
            "t2"
        ],
        "experiment": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2"
        },
        "pipeline": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "model_type": "<string>",
            "data_bindings": [
                {
                    "data_reference_name": "<string>",
                    "node_id": "<string>"
                },
                {
                    "data_reference_name": "<string>",
                    "node_id": "<string>"
                }
            ],
            "nodes_parameters": [
                {
                    "node_id": "<string>",
                    "parameters": "<object>"
                },
                {
                    "node_id": "<string>",
                    "parameters": "<object>"
                }
            ],
            "hardware_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "<string>",
                "num_nodes": "<integer>"
            },
            "hybrid_pipeline_hardware_specs": [
                {
                    "node_runtime_id": "auto_ai.kb",
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    }
                },
                {
                    "node_runtime_id": "auto_ai.kb",
                    "hardware_spec": {
                        "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                        "rev": "2",
                        "name": "<string>",
                        "num_nodes": "<integer>"
                    }
                }
            ]
        },
        "model_definition": {
            "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
            "rev": "2",
            "model_type": "<string>",
            "hardware_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "<string>",
                "num_nodes": "<integer>"
            },
            "software_spec": {
                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                "rev": "2",
                "name": "..."
            },
            "command": "<string>",
            "parameters": "<object>"
        },
        "training_data_references": [
            {
                "type": "<string>",
                "id": "<string>",
                "connection": "<object>",
                "location": "<object>",
                "schema": {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                }
            },
            {
                "type": "<string>",
                "id": "<string>",
                "connection": "<object>",
                "location": "<object>",
                "schema": {
                    "id": "<string>",
                    "fields": [
                      {
                        "name": "duration",
                        "type": "number"
                      }
                    ],
                    "name": "<string>"
                }
            }
        ],
        "results_reference": {
            "type": "<string>",
            "location": "<object>",
            "id": "<string>",
            "connection": "<object>"
        }
    }'
    

Response

The information for a training definition.

Status Code

  • Training definition created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the training definitions

Retrieve the training definitions for the specified space or project.

GET /ml/v4/training_definitions

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.list

Request

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag values, separated by or or and to support multiple tags.

    Example: tf2.0 or tf2.1

  • Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.

    Possible values: length ≥ 1

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
    

Response

A paginated list of training definitions.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the training definition

Retrieve the training definition with the specified identifier. If rev query parameter is provided, rev=latest will fetch the latest revision. A call with rev={revision_number} will fetch the given revision_number record. Either space_id or project_id has to be provided and is mandatory.

GET /ml/v4/training_definitions/{training_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.read

Request

Path Parameters

  • Training definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • The revision number of the resource.

    Example: 2

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions/:training_definition_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
    

Response

The information for a training definition.

Status Code

  • OK

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Update the training definition

Update the training definition with the provided patch data. The following fields can be patched:

  • /tags
  • /name
  • /description
  • /custom
  • /federated_learning
PATCH /ml/v4/training_definitions/{training_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.update

Request

Path Parameters

  • Training definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).

  • curl --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions/:training_definition_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        },
        {
            "op": "<string>",
            "path": "<string>",
            "value": "<object>"
        }
    ]'
    

Response

The information for a training definition.

Status Code

  • Training definition has been patched successfully

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Delete the training definition

Delete the training definition with the specified identifier. This will delete all revisions of this training definition as well. For each revision all attachments will also be deleted.

DELETE /ml/v4/training_definitions/{training_definition_id}

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.delete

Request

Path Parameters

  • Training definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • curl --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions/:training_definition_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    

Response

Status Code

  • Training definition deleted

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Create a new training definition revision

Create a new training definition revision. The current metadata and content for training_definition_id will be taken and a new revision created. Either space_id or project_id has to be provided and is mandatory.

POST /ml/v4/training_definitions/{training_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.create

Request

Path Parameters

  • Training definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

The details for the revision.

Examples:
{
  "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
  "commit_message": "Updated for TF 2.0"
}
  • curl --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions/:training_definition_id/revisions?version=2020-09-01' --data-raw '{
        "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f",
        "commit_message": "Updated for TF 2.0"
    }'
    

Response

The information for a training definition.

Status Code

  • Training definition revision created

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

Retrieve the training definition revisions

Retrieve the training definition revisions.

GET /ml/v4/training_definitions/{training_definition_id}/revisions

Auditing

Calling this method generates the following auditing event.

  • pm-20.training_definition.list

Request

Path Parameters

  • Training definition identifier.

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

Query Parameters

  • The version date for the API of the form YYYY-MM-DD.

    Example: 2023-07-07

  • The space that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: 63dc4cf1-252f-424b-b52d-5cdd9814987f

  • The project that contains the resource. Either space_id or project_id query parameter has to be given.

    Possible values: length = 36, Value must match regular expression ^[a-zA-Z0-9-]*$

    Example: a77190a2-f52d-4f2a-be3d-7867b5f46edc

  • Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the next field.

  • How many resources should be returned. By default limit is 100. Max limit allowed is 200.

    Possible values: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • curl --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/training_definitions/:training_definition_id/revisions?space_id=<string>&project_id=<string>&start=<string>&limit=100&version=2020-09-01'
    

Response

A paginated list of training definitions.

Status Code

  • Training definition revisions

  • Bad request, the response body should contain the reason.

  • Unauthorized.

  • Forbidden, an authentication error including trying to access an unauthorized space or project.

  • The specified resource was not found.

No Sample Response

This method does not specify any sample responses.

id=curlclassName=tab-item-selected