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.

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 to default 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.

Methods

Create a new WML deployment

Create a new model, function or Python Script application deployment.

POST /ml/v4/deployments

Request

Query Parameters

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

    Example: 2020-09-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": "autoai.kb",
                "hardware_spec": {
                    "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                    "rev": "2",
                    "name": "<string>",
                    "num_nodes": "<integer>"
                }
            },
            {
                "node_runtime_id": "autoai.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>"
        },
        "virtual": {
            "export_format": "coreml",
            "parameters": "<object>",
            "notification_system": {
                "type": "<string>",
                "location": "<object>",
                "id": "<string>",
                "connection": "<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"autoai.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>\"}, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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>\" }, \"virtual\": { \"export_format\": \"coreml\", \"parameters\": \"<object>\", \"notification_system\": { \"type\": \"<string>\", \"location\": \"<object>\", \"id\": \"<string>\", \"connection\": \"<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: 2020-09-01

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

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

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

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

  • 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 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: 2020-09-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: 2020-09-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
  • virtual.parameters
  • hardware_spec
  • hybrid_pipeline_hardware_specs
  • asset

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.
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: 2020-09-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.

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

Request

Path Parameters

  • The deployment id.

Query Parameters

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

    Example: 2020-09-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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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\": [ \"<string>\", \"<string>\" ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ \"<string>\", \"<string>\" ], \"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: 2020-09-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.

POST /ml/v4/deployment_jobs

Request

Query Parameters

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

    Example: 2020-09-01

The job description.

  • 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",
        "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>"
        }
    }'
    
  • import requests
    
    url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?deployment_job_definition=<string>&version=2020-09-01"
    
    payload = "{ \"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>\" }\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_jobs?deployment_job_definition=%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 = "{ \"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>\" }\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_jobs?deployment_job_definition=%3Cstring%3E&version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"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>\" }\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_jobs?deployment_job_definition=<string>&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\", \"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>\" }\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\", \"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>\" }\n}"
    let postData = parameters.data(using: .utf8)
    
    var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?deployment_job_definition=%3Cstring%3E&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_jobs?deployment_job_definition=<string>&version=",
      "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": "autoai.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 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: 2020-09-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: 2020-09-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: 2020-09-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\": \"autoai.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=2020-09-01"
    
    payload = "{ \"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>\" }\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?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\", \"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>\" }\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?version=%3Cdate%3E"
      method := "POST"
    
      payload := strings.NewReader("{ \"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>\" }\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?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\", \"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>\" }\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\", \"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>\" }\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?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?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": "autoai.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: 2020-09-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.

    Constraints: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag value.

    Example: tf2.0

  • 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: 2020-09-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: 2020-09-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: 2020-09-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: 2020-09-01

The details for the revision.

Example:
  • 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: 2020-09-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.

    Constraints: 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: 2020-09-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": "autoai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        },
                        {
                            "node_runtime_id": "autoai.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": "autoai.kb",
                            "hardware_spec": {
                                "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab",
                                "rev": "2",
                                "name": "<string>",
                                "num_nodes": "<integer>"
                            }
                        },
                        {
                            "node_runtime_id": "autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"autoai.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: 2020-09-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.

    Constraints: 1 ≤ value ≤ 200

    Default: 100

    Example: 50

  • Return only the resources with the given tag value.

    Example: tf2.0

  • 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: 2020-09-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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"autoai.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\": \"autoai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"autoai.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.