Introduction

Using IBM Watson Machine Learning, you can build analytic models and neural networks, trained with your own data, that you can deploy for use in applications. Watson Machine Learning 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.

Step by step instructions on how to use IBM Watson Machine Learning (WML) can be found 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 Watson Machine Learning 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

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}.

Example request to a Dallas endpoint:

OkHttpClient client = new OkHttpClient().newBuilder().build();

MediaType mediaType = MediaType.parse("text/plain");

RequestBody body = RequestBody.create(mediaType, {request_body})

Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/{method_endpoint}").method({request_method}, body).build();

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

In order to authenticate in WML on cloud, you need to generate an IAM token. To start working with the API, create an IAM token as described below:

The obtained IAM token needs to be prepended with the word Bearer, and it needs to be passed in the Authorization header for API calls.

Example of a curl API request with a 'Bearer' access token:

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

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.

Versioning

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. 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) now 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. See here for a reference API for connections.

Example data_asset payload:

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

Example connection_asset payload:

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

Example url payload (Decision Optimization only):

"input_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": {
  }
}

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. Theserving_namecan be used in the prediction URL in place of thedeployment_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: 2022-08-01

The deployment entity.

  • curl --location --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>"
        },
    }'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    
    MediaType mediaType = MediaType.parse("text/plain");
    
    RequestBody body = RequestBody.create(mediaType, "{ \"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>\"} }   }");
    
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01").method("POST", body).build();
    
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01"
    
    payload = "{ \"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>\" } }\n}"
    headers= {}
    
    response = requests.request("POST", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{ \"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>\" } }\n}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"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>\" } }\n}")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Post.new(url)
    request.body = "{ \"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>\" } }\n}"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{ \"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>\" } }\n}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "POST"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=<date>",
      "method": "POST",
      "timeout": 0,
      "data": "{ \"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>\" } }\n}",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

Status Code

  • Deployment created.

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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: 2022-08-01

  • 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 --location --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'
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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: 2022-08-01

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

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

  • curl --location "{url}/v4/deployments/{deployment_id}"
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01").method("GET", null).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);.
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

Status Code

  • Deployment details.

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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: 2022-08-01

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

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

  • curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01'
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "",);
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01").method("DELETE", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("DELETE", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "DELETE"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Delete.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "DELETE"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=<date>",
      "method": "DELETE",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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.
  • If the deployment is asynchronous, 202 response code will be returned and one can poll the deployment status thereafter.
  • If the deployment is synchronous, 200 response code will be returned with patched deployment response.
  • 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: 2022-08-01

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

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

The json patch.

  • curl --location --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>"
        }
    ]'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01"
    
    payload = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    headers= {}
    
    response = requests.request("PATCH", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "PATCH"
    
      payload := strings.NewReader("[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Patch.new(url)
    request.body = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "PATCH"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=<date>",
      "method": "PATCH",
      "timeout": 0,
      "data": "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

Status Code

  • Deployment updated.

  • Deployment accepted

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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 serving_urls.

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: 2022-08-01

The scoring data.

  • curl --location --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>"
                    ]
                ]
            }
        ]
    }'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01"
    
    payload = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}"
    headers= {}
    
    response = requests.request("POST", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ { \"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Post.new(url)
    request.body = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "POST"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=<date>",
      "method": "POST",
      "timeout": 0,
      "data": "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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: 2022-08-01

  • 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 value(s) (comma separated) as output response fields. Retrieves all the fields if not mentioned.

  • curl --location --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'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    Request request = new Request.Builder().url("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").method("GET", null).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "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"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("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")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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: 2022-08-01

  • 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 --location --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 --location --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":".*\\.*"
             }
          ]
    }'
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"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\":[{\"name\": \"duration\", \"type\": \"number\"}],\"values\":[[{}]],\"targets\":[[{}]]}],\"output_data_reference\":{\"id\":\"string\",\"type\":\"s3\",\"connection\":{}},\"evaluations\":[{\"id\":\"string\",\"input_target\":\"string\",\"metrics_names\":[\"auroc\",\"accuracy\"]}]}}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute(); 
     
    /* DO Payload Example */ 
    OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"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\":\".*\\.*\"}]}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute();
  • "import requests
     
     url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25"
     
     payload = {
       "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":[
                   {
                       "name":"string",
                       "duration":"number"
                   }
                ],
                "values":[
                   [ { } ]
                ],
                "targets":[
                   [ { } ]
                ]
             }
          ],
          "output_data_reference":{
             "id":"string",
             "type":"s3",
             "connection":{
             }
          },
          "evaluations":[
             {
                "id":"string",
                "input_target":"string",
                "metrics_names":[
                   "auroc",
                   "accuracy"
                ]
             }
          ]
       }
    }
     
     headers = {
     'Authorization': 'Bearer <token>',
     'Content-Type': 'application/json',
     }
     
     response = requests.request("POST", url, headers=headers, data = payload)
     
     print(response.text.encode('utf8')) 
     
    ",
    #DO Payload Example 
     import requests
     
     url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25"
     
     payload = {
       "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":".*\\.*"
             }
          ]
    }
     
     headers = {
     'Authorization': 'Bearer <token>',
     'Content-Type': 'application/json',
     }
     
     response = requests.request("POST", url, headers=headers, data = payload)
     
     print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      headers = curl_slist_append(headers, "Authorization: Bearer <token>");
      headers = curl_slist_append(headers, "Content-Type: application/json");
      headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841");
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
     
    /* DO Payload Example */ 
    CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      headers = curl_slist_append(headers, "Authorization: Bearer <token>");
      headers = curl_slist_append(headers, "Content-Type: application/json");
      headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841");
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{\"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\": \"duration\", \"type\": \"number\"}],\"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\":\".*\\.*\"}]}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main 
    import ( "fmt" "strings" "net/http" "io/ioutil") 
    func main() {
     
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25" 
      method := "POST"
      payload := strings.NewReader("{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}")
      client := &http.Client { }
      req, err := http.NewRequest(method, url, payload) 
      if err != nil {  fmt.Println(err) }
      req.Header.Add("Authorization", "Bearer <token>")
      req.Header.Add("Content-Type", "application/json")
      req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841")
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
     
      fmt.Println(string(body))} 
     
    // DO Payload Example 
    package main 
    import ( "fmt" "strings" "net/http" "io/ioutil") 
    func main() {
     
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25"
      method := "POST"
      payload := strings.NewReader("{\"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\": \"duration\", \"type\": \"number\"}],\"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\":\".*\\.*\"}]}")
      client := &http.Client { }
      req, err := http.NewRequest(method, url, payload)
      if err != nil {  fmt.Println(err) }
      req.Header.Add("Authorization", "Bearer <token>")
      req.Header.Add("Content-Type", "application/json")
      req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841")
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body) 
     
      fmt.Println(string(body))}
  • require "uri"
    require "net/http"
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = truerequest = Net::HTTP::Post.new(url)
    
    request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}"
    response = https.request(request)
    puts response.read_body 
     
    #DO Payload Example 
    require "uri"
    require "net/http"
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = truerequest = Net::HTTP::Post.new(url)
    
    request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{\"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 = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}"
    let postData = parameters.data(using: .utf8)
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")!,timeoutInterval: Double.infinity)
    request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type")
    request.httpMethod = "POST"
    request.httpBody = postData
    let task = URLSession.shared.dataTask(with: request) { data, response, error in   guard let data = data else {    print(String(describing: error))    return  }  print(String(data: data, encoding: .utf8)!)  semaphore.signal()}
    
    task.resume()
    semaphore.wait() 
     
    /* DO Payload Example */ 
    import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{\"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\":\".*\\.*\"}]}"
    let postData = parameters.data(using: .utf8)
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")!,timeoutInterval: Double.infinity)
    request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type")
    request.httpMethod = "POST"
    request.httpBody = postData
    let task = URLSession.shared.dataTask(with: request) { data, response, error in   guard let data = data else {    print(String(describing: error))    return  }  print(String(data: data, encoding: .utf8)!)  semaphore.signal()}
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01",
      "method": "POST",
      "timeout": 0,
      "data": “{
        "tags": [
            "test",
            "frank"
        ],
        "space_id": "{{space_id}}",
        "name": "test deployment_job_definition def",
        "description": "test td",
        "custom": {
            "test": "hi"
        },
        "deployment": {
            "id": "1223"
        },
        "hardware_spec": {
            "id": "{{hardware_spec_id}}",
            "rev": "12",
            "name": "string",
            "num_nodes": 2
        },
        "hybrid_pipeline_hardware_specs": [
            {
                "node_runtime_id": "auto_ai.kb",
                "hardware_spec": {
                    "id": "{{hardware_spec_id}}",
                    "rev": "12",
                    "name": "default_py3.6",
                    "num_nodes": 2
                }
            }
        ]
        }”};
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    }); 
     
    /* DO Payload Example */ 
     var settings = {
       "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":".*\\.*"
             }
          ]
    }”};
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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: 2022-08-01

  • Cancel the deployment job that belong to this space.

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

  • curl --location --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'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01").method("DELETE", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("DELETE", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=%3Cdate%3E"
      method := "DELETE"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Delete.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "DELETE"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=<date>",
      "method": "DELETE",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

Status Code

  • Success.

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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: 2022-08-01

  • Retrieve the deployment job that belong to this space.

  • Retrieves only fields from 'decision_optimization' and 'scoring' section mentioned as value(s) (comma separated) as output response fields. Retrieves all the fields if not mentioned.

  • curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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

Request

Query Parameters

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

    Example: 2022-08-01

Payload for creating the deployment job definition.

  • curl -X 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>"
        }
    }'
    
  • OkHttpClient client = new OkHttpClient().newBuilder()build();MediaType mediaType = MediaType.parse("text/plain")RequestBody body = RequestBody.create(mediaType, "{ \"tags\": [ \"test\", \"frank\" ], \"space_id\": \"{{space_id}}\", \"name\": \"test deployment_job_definition def\", \"description\": \"test td\", \"custom\": { \"test\": \"hi\" }, \"deployment\": { \"id\": \"1223\" }, \"decision_optimization\": { \"input_data\": [ { \t\"id\": \"123\", \t\"fields\": [], \t\"values\": [] } ], \"output_data\": [{ \t \t\t\"id\": \"123\" \t }] }, \"hardware_spec\": { \"id\": \"{{hardware_spec_id}}\", \"rev\": \"12\", \"name\": \"string\", \"num_nodes\": 2 }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"{{hardware_spec_id}}\", \"rev\": \"12\", \"name\": \"default_py3.6\", \"num_nodes\": 2 } } ]\n}");Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25").method("POST", body).build();Response response = client.newCall(request).execute();
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25"
    
    payload = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }"
    
    headers = {
      'Authorization': 'Bearer <token>',
      'Content-Type': 'application/json',
      'Cookie': '__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841'
    }
    
    response = requests.request("POST", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;CURLcode res;curl = curl_easy_init();if(curl) {curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25");
    curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
    curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
    struct curl_slist *headers = NULL;
    headers = curl_slist_append(headers, "Authorization: Bearer <token>");
    headers = curl_slist_append(headers, "Content-Type: application/json");
    headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    const char *data = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{  "id": "123"  }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ]
    }";
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
    res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
    
  • package mainimport ( "fmt" "strings" "net/http" "io/ioutil")func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25" method := "POST" payload := strings.NewReader("{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{  "id": "123"  }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ]
    }") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil {  fmt.Println(err) } req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json") req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841") res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body))}
  • require "uri"require "net/http"url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25")https = Net::HTTP.new(url.host, url.port);https.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { 	"id": "123", 	"fields": [], 	"values": [] } ], "output_data": [{ 	 		"id": "123" 	 }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ]
    }"response = https.request(request)puts response.read_body
  • import Foundationvar semaphore = DispatchSemaphore (value: 0)let parameters = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { 	"id": "123", 	"fields": [], 	"values": [] } ], "output_data": [{ 	 		"id": "123" 	 }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ]
    }"let postData = parameters.data(using: .utf8)var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25")!,timeoutInterval: Double.infinity)request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type")request.addValue("__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841", forHTTPHeaderField: "Cookie")request.httpMethod = "POST"request.httpBody = postDatalet task = URLSession.shared.dataTask(with: request) { data, response, error in   guard let data = data else {    print(String(describing: error))    return  }  print(String(data: data, encoding: .utf8)!)  semaphore.signal()}task.resume()semaphore.wait()
  • var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25" "method": "POST" "timeout": 0 "data": "{   "tags": [     "test",     "frank"],   "space_id": "{{space_id}}",   "name": "test deployment_job_definition def"   "description": "test td"   "custom": {     "test": "hi"   },   "deployment": {     "id": "1223"   },   "decision_optimization": {   "input_data": [     { "id": "123",       "fields": [],       "values": []     }   ],   "output_data": [{     "id": "123"}]  },  "hardware_spec": {  "id": "{{hardware_spec_id}}",  "rev": "12",  "name": "string",  "num_nodes": 2  },  "hybrid_pipeline_hardware_specs": [    {      "node_runtime_id": "auto_ai.kb",      "hardware_spec": {      "id": "{{hardware_spec_id}}",      "rev": "12",      "name": "default_py3.6",      "num_nodes": 2    }  }  ] }};$.ajax(settings).done(function (response) {console.log(response);});

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 a forbidden space.

  • 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

Request

Query Parameters

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

    Example: 2022-08-01

  • The space that contains the resource.

    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 -X 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'
    
  • import requests
    
    url = "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"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("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")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

System details.

Status Code

  • OK

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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}

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: 2022-08-01

  • The space that contains the resource.

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

  • The revision number of the resource.

    Example: 2

  • curl -X 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'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01").method("GET", null).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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}

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: 2022-08-01

  • The space that contains the resource.

    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 -X 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>"
        }
    ]'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"}, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"}   ]");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01").method("PATCH", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01"
    
    payload = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    headers= {}
    
    response = requests.request("PATCH", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "PATCH"
    
      payload := strings.NewReader("[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Patch.new(url)
    request.body = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "PATCH"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=<date>",
      "method": "PATCH",
      "timeout": 0,
      "data": "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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}

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: 2022-08-01

  • The space that contains the resource.

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

  • curl -X DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("DELETE", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "DELETE"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Delete.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "DELETE"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=<date>",
      "method": "DELETE",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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

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: 2022-08-01

The details for the revision.

Examples:
View
  • curl -X 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"
    }'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01"
    
    payload = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}"
    headers= {}
    
    response = requests.request("POST", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Post.new(url)
    request.body = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "POST"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?version=<date>",
      "method": "POST",
      "timeout": 0,
      "data": "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"\n}",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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

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: 2022-08-01

  • The space that contains the resource.

    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 -X 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'
    
  • import requests
    
    url = "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"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("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")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

System details.

Status Code

  • Deployment job definition revisions

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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

Request

Query Parameters

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

    Example: 2022-08-01

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

  • curl --location --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>"
    }'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "{ \"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>\"}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01"
    
    payload = "{ \"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>\"\n}"
    headers= {}
    
    response = requests.request("POST", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "{ \"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>\"\n}";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"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>\"\n}")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Post.new(url)
    request.body = "{ \"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>\"\n}"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "{ \"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>\"\n}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "POST"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=<date>",
      "method": "POST",
      "timeout": 0,
      "data": "{ \"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>\"\n}",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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

Request

Query Parameters

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

    Example: 2022-08-01

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

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

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

    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 --location --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'
    
  • import requests
    
    url = "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"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("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")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

System details.

Status Code

  • OK

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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}

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: 2022-08-01

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

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

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

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

  • The revision number of the resource.

    Example: 2

  • curl --location --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'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "{ \"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>\"}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("GET", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=%3Cdate%3E"
      method := "GET"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "GET"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=<date>",
      "method": "GET",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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}

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: 2022-08-01

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

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

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

    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 --location --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>"
        }
    ]'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"}, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"}   ]");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01").method("PATCH", body).build();
    Response response = client.newCall(request).execute();
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01"
    
    payload = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    headers= {}
    
    response = requests.request("PATCH", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      const char *data = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]";
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "strings"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "PATCH"
    
      payload := strings.NewReader("[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]")
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, payload)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Patch.new(url)
    request.body = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    let parameters = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "PATCH"
    request.httpBody = postData
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=<date>",
      "method": "PATCH",
      "timeout": 0,
      "data": "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]",
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

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 a forbidden space.

  • 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}

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: 2022-08-01

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

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

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

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

  • curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01"
    
    payload = {}
    headers= {}
    
    response = requests.request("DELETE", url, headers=headers, data = payload)
    
    print(response.text.encode('utf8'))
  • CURL *curl;
    CURLcode res;
    curl = curl_easy_init();
    if(curl) {
      curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
      curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01");
      curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
      curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
      struct curl_slist *headers = NULL;
      curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
      res = curl_easy_perform(curl);
    }
    curl_easy_cleanup(curl);
  • package main
    
    import (
      "fmt"
      "net/http"
      "io/ioutil"
    )
    
    func main() {
    
      url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=%3Cdate%3E"
      method := "DELETE"
    
      client := &http.Client {
      }
      req, err := http.NewRequest(method, url, nil)
    
      if err != nil {
        fmt.Println(err)
      }
      res, err := client.Do(req)
      defer res.Body.Close()
      body, err := ioutil.ReadAll(res.Body)
    
      fmt.Println(string(body))
    }
  • require "uri"
    require "net/http"
    
    url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Delete.new(url)
    
    response = https.request(request)
    puts response.read_body
  • import Foundation
    
    var semaphore = DispatchSemaphore (value: 0)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity)
    request.httpMethod = "DELETE"
    
    let task = URLSession.shared.dataTask(with: request) { data, response, error in 
      guard let data = data else {
        print(String(describing: error))
        return
      }
      print(String(data: data, encoding: .utf8)!)
      semaphore.signal()
    }
    
    task.resume()
    semaphore.wait()
  • var settings = {
      "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=<date>",
      "method": "DELETE",
      "timeout": 0,
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });

Response

Status Code

  • Experiment deleted

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

  • Unauthorized.

  • Forbidden, an authentication error including trying to access a forbidden space.

  • 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

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: 2022-08-01

The details for the revision.

Examples:
View
  • curl --location --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"
    }'
    
  • OkHttpClient client = new OkHttpClient().newBuilder().build();
    MediaType mediaType = MediaType.parse("text/plain");
    RequestBody body = RequestBody.create(mediaType, "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"}");
    Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id/revisions?version=2020-09-01").method("POST", body).build();
    Response response = client.newCall(request).execute();