Introduction
Using IBM Watson Machine Learning, you can build analytic models and neural networks, trained with your own data, that you can deploy for use in applications. Watson Machine Learning provides a full range of tools and services so you can build, train, and deploy Machine Learning models. Choose from tools that fully automate the training process for rapid prototyping to tools that give you complete control to create a model that matches your needs.
Step by step instructions on how to use IBM Watson Machine Learning (WML) can be found here.
There is a specialized python library that is available to access this REST API here.
Endpoint URLs
The following URL represents the base URLs for the Watson Machine Learning API endpoints. When you call the API, use the URL and add the path for each method to form the complete API endpoint for your requests.
- Dallas:
https://us-south.ml.cloud.ibm.com
- London -
https://eu-gb.ml.cloud.ibm.com
- Frankfurt -
https://eu-de.ml.cloud.ibm.com
- Tokyo -
https://jp-tok.ml.cloud.ibm.com
Example request to a Dallas endpoint:
curl -H "Authorization: Bearer {token}" -X {request_method} "https://us-south.ml.cloud.ibm.com/{method_endpoint}"
Replace {request_method}
, and {method_endpoint}
in this example with the values
for your particular API call. See the Authentication
section below for more details about the bearer {token}
.
Example request to a Dallas endpoint:
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, {request_body})
Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/{method_endpoint}").method({request_method}, body).build();
Replace {request_method}
, and {method_endpoint}
in this example with the values
for your particular API call. See the Authentication
section below for more details about the bearer {token}
.
Authentication
In order to authenticate in WML on cloud, you need to generate an IAM token
.
To start working with the API, create an IAM token as described below:
The obtained IAM token
needs to be prepended with the word Bearer
, and it needs to be passed in the
Authorization
header for API calls.
Example of a curl API request with a 'Bearer' access token:
curl https://us-south.ml.cloud.ibm.com/ml/v4/models -H "Authorization: Bearer eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hb..."
Error handling
This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200
type response indicates success. A 400
type response indicates a failure, and a 500
type response indicates an internal system error.
HTTP Code | Description | Recovery |
---|---|---|
200 |
Success | The request was successful. |
400 |
Bad Request | The input parameters in the request body are either incomplete, or in the wrong format, or some other input validation failed. Be sure to include all required parameters in your request and check the request body. |
401 |
Unauthorized | You are not authorized to make this request. Log in and try again or provide a valid token. See Authenticating with IAM tokens for instructions on logging in. If this error persists, contact the account owner to check your permissions. |
403 |
Forbidden | The supplied authentication is not authorized. |
404 |
Not Found | The requested resource could not be found. |
Versioning
API requests require a version parameter that takes a date in the format version=YYYY-MM-DD
.
When there is a change to the API in a backwards-incompatible way,
there will be a new version date published. Send the version parameter with every API request.
The service uses the API version for the date you specify or the most recent version before that date. It is not recommended defaulting to the current date. Instead, specify a date that matches a version that is compatible with your app and do not change it until your app is ready for a later version.
2021-05-01
The creation of deployment jobs is now fully asynchronous.
What this means is that the creation of the job will not return the platform_jobs
section
in the response, instead poll the job using the deployment-jobs-get
operation until the platform_jobs
section is provided in the response.
Data References
Accessing data in a remote location (such as a Cloud Object Storage bucket, or an SQL/no-SQL database) now requires
the use of connection_asset
or data_asset
reference types.
These reference types are created within a space or a project and are referenced in WML requests to represent input
data and results locations. These types contain two parameter objects, connection
and location
, which require
different values to be supplied based on the reference type. Using a data_asset
, requires an href
to be supplied
to the location
object whereas using a connection_asset
requires the connection_id
for the connection
object
and different location
fields depending on the data source type, see
Data reference Description
for details.
See here for a reference API for connections.
Example data_asset
payload:
"input_data_references": [{
"type": "data_asset",
"location": {
"href":"/v2/assets/<asset_id>?space_id=<space_id>"
}
}]
Example connection_asset
payload:
"input_data_references": [{
"type": "connection_asset",
"connection": {
"id": <connection_guid>
},
"location": {
<wdp-properties depending on the type>
}
}]
Example url
payload (Decision Optimization only):
"input_data_references": {
"type": "url",
"id": "diet_food.csv",
"connection": {
"verb": "GET",
"url": "https://myserver.com/diet_food.csv",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
}
},
"location": {
}
}
Methods
Create a new WML deployment
Create a new deployment, the parameters specifying the deployment type are online
and batch
.
These parameters are mutually exclusive, specify only one of these when creating a deployment.
Use hybrid_pipeline_hardware_specs
only when creating a batch
deployment job of a hybrid pipeline
in order to specify compute configuration for each pipeline node. For all other batch
deployment
cases use hardware_spec
to specify compute configuration. The hybrid_pipeline_hardware_specs
and
hardware_spec
are mutually exclusive, specify only one of these when creating a deployment.
For batch
deployments, hardware_spec.num_nodes
parameter is not currently supported.
For online
deployments, hardware_spec
cannot be specified at the time of creation,
hardware_spec.num_nodes
parameter is not supported as part of
POST /ml/v4/deployments
API request, but it can be updated using PATCH /ml/v4/deployments/<deployment id>
.
For online
deployments, serving_name
can be provided in
online.parameters. The serving name can have the characters
[a-z,0-9,_]and must not be more than 36 characters. The
serving_namecan be used in the prediction URL in place of the
deployment_id`.
See the documentation supported frameworks for details about which frameworks can be used in a deployment.
POST /ml/v4/deployments
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The deployment entity.
The space that contains the resource.
Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
Tags that can be used when searching for resources.
Examples:ViewThe name of the deployment.
Example:
customer_churn
A description of the deployment.
Example:
Customer churn prediction model deployment
User defined properties specified as key-value pairs.
Examples:Viewcustom
A reference to a resource.
A hardware specification.
Hybrid pipeline hardware specification.
Indicates that this is an online deployment. An empty object has to be specified. More properties will be added later on to setup the online deployment. The
serving_name
can be provided in theonline.parameters
. The serving name can only have the characters [a-z,0-9,_] and the length should not be more than 36 characters. Theserving_name
can be used in the prediction URL in place of thedeployment_id
. If the online scoring schema has atype
ofDataFrame
then the scoring payload will be converted to aPandas
data frame.Examples:ViewA set of key-value pairs where
key
is the parameter name.
online
Indicates that this is a batch deployment. An empty object has to be specified. More properties will be added later on to setup the batch deployment.
A set of key-value pairs where
key
is the parameter name.
batch
curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01' --data-raw '{ "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f", "tags": [ "dev", "TF" ], "name": "customer_churn", "description": "Customer churn prediction model deployment", "custom": "<object>", "asset": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2" }, "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } }, { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } } ], "online": { "parameters": "<object>" }, "batch": { "parameters": "<object>" }, "r_shiny": { "authentication": "members_of_deployment_space", "parameters": "<object>" }, }'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\"], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\"}, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"}, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} } ], \"online\": { \"parameters\": \"<object>\"}, \"batch\": { \"parameters\": \"<object>\"}, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\"} } }"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01" payload = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}" headers= {} response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=%3Cdate%3E" method := "POST" payload := strings.NewReader("{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request.body = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}" response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "POST" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?version=<date>", "method": "POST", "timeout": 0, "data": "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"tags\": [ \"dev\", \"TF\" ], \"name\": \"customer_churn\", \"description\": \"Customer churn prediction model deployment\", \"custom\": \"<object>\", \"asset\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\" }, \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ], \"online\": { \"parameters\": \"<object>\" }, \"batch\": { \"parameters\": \"<object>\" }, \"r_shiny\": { \"authentication\": \"members_of_deployment_space\", \"parameters\": \"<object>\" } }\n}", }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe definition of the deployment.
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
Retrieve the deployments
Retrieve the list of deployments for the specified space.
GET /ml/v4/deployments
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieves the deployments that belong to this space.
Example:
2ae804f8-fa85-4106-8228-cbc7e408ad79
Retrieves the deployment, if any, that contains this
serving_name
.Example:
churn
Retrieves only the resources with the given tag value.
Retrieves only the resources with the given asset_id, asset_id would be either model_id or function_id.
Retrieves only the resources with the given name.
Retrieves the resources filtered with the given type. Allowed values are
model
,function
,py_script
anddo
.Retrieves the resources filtered by state. Allowed values are
initializing
,updating
,ready
andfailed
.Returns stats about deployments within a space or across spaces if it is set to true. This query parameter cannot be combined with any other except for 'space_id'.
Returns whether serving_name is available for use or not. This query parameter cannot be combined with any other except for 'serving_name'.
Default:
false
curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&asset_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments?space_id=<string>&tag.value=<string>&asset_id=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The deployment resources.
The number of items to return in each page.
Possible values: 1 ≤ value ≤ 200
Example:
10
The reference to the first item in the current page.
The uri of the first resource returned.
first
The total number of resources. Computed explicitly only when 'total_count=true' query parameter is present. This is in order to avoid performance penalties.
Example:
1
A reference to the first item of the next page, if any.
The uri of the next set of resources.
next
A list of deployment resources. This will be empty if 'stats' query parameter is passed with 'true'.
System details including warnings and stats. This will get populated only if 'stats' query parameter is passed with 'true'.
Optional details provided by the service about statistics of the number of deployments created with in a space or across all spaces.
system
Status Code
OK.
serving_name is available for use. Returned when serving_name and conflict query parameters are used.
Bad request, the response body should contain the reason.
Unauthorized.
Forbidden, an authentication error including trying to access a forbidden space.
The specified resource was not found.
Returned when serving_name and conflict query parameters are used. The response body will contain the reason.
No Sample Response
Retrieve the deployment details
Retrieve the deployment details with the specified identifier.
GET /ml/v4/deployments/{deployment_id}
Request
Path Parameters
The deployment id.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieves the deployments of assets that belong to this space.
Example:
2ae804f8-fa85-4106-8228-cbc7e408ad79
curl --location "{url}/v4/deployments/{deployment_id}"
OkHttpClient client = new OkHttpClient().newBuilder().build(); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01").method("GET", null).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);.
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe definition of the deployment.
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
Delete the deployment
Delete the deployment with the specified identifier.
DELETE /ml/v4/deployments/{deployment_id}
Request
Path Parameters
The deployment id.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieves the deployments of assets that belong to this space.
Example:
2ae804f8-fa85-4106-8228-cbc7e408ad79
curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "",); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01").method("DELETE", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=%3Cdate%3E" method := "DELETE" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "DELETE" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id?space_id=<string>&version=<date>", "method": "DELETE", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Update the deployment metadata
Update the deployment metadata. The following parameters of deployment metadata are supported for the patch operation.
/tags
/name
/description
/custom
/hardware_spec
/hybrid_pipeline_hardware_specs
/asset
/online/parameters
In case of online deployments, using PATCH operation of /ml/v4/deployments
,
users can update the number of copies of an online deployment.
Users can specify the desired value of number of copies in hardware_spec.num_nodes
parameter.
As hardware_spec.name
or hardware_spec.id
is mandatory for hardware_spec
schema,
a valid value such as XS
, S
must be specified for hardware_spec.name
parameter
as part of PATCH request. Alternatively, users can also specify a valid ID of a hardware
specification in hardware_spec.id
parameter. However, changes related to hardware_spec.name
or hardware_spec.id
specified in PATCH operation will not be applied for online deployments.
In case of batch deployments, using PATCH operation of /ml/v4/deployments
, users can update
the hardware specification so that subsequent batch deployment jobs can make use of the updated
compute configurations. To update the compute configuration, users must specify a valid value for
either hardware_spec.name
or hardware_spec.id
of the hardware specification that suits their
requirement. In the batch deployment context, hardware_spec.num_nodes
parameter is not currently supported.
When 'asset' is patched with id/rev:
- Deployment with the patched id/rev is started.
- If the deployment is asynchronous, 202 response code will be returned and one can poll the deployment status thereafter.
- If the deployment is synchronous, 200 response code will be returned with patched deployment response.
- If any failures, deployment will be reverted back to the previous id/rev and the failure message will be captured in 'failures' field in the response.
In the case of an online deployment, the PATCH operation with path specified as /online/parameters
can be used to update the serving_name
.
PATCH /ml/v4/deployments/{deployment_id}
Request
Path Parameters
The deployment id.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieves the deployments of assets that belong to this space.
Example:
2ae804f8-fa85-4106-8228-cbc7e408ad79
The json patch.
The operation to be performed.
Allowable values: [
add
,remove
,replace
]The pointer that identifies the field that is the target of the operation.
The value to be used within the operation.
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
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe definition of the deployment.
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
Execute a synchronous deployment prediction
Execute a synchronous prediction for the deployment with the specified identifier.
If a serving_name
is used then it must match the serving_name
that is returned in the serving_urls
.
POST /ml/v4/deployments/{deployment_id}/predictions
Request
Path Parameters
The
deployment_id
can be either thedeployment_id
that identifies the deployment or aserving_name
that allows a predefined URL to be used to post a prediction.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The scoring data.
The input data.
Discriminates the data for multi input data situation. For example in cases where multiple tensors are expected.
The names of the fields. The order of fields values must be consistent with the order of fields names.
Examples:ViewInput data as a a vector for a single record or a matrix representing a mini batch of records.
input_data
curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01' --data-raw '{ "input_data": [ { "id": "<string>", "fields": [ "<string>", "<string>" ], "values": [ [ "<object>", "<object>" ], [ "<object>", "<object>" ] ] }, { "id": "<string>", "fields": [ "<string>", "<string>" ], "values": [ [ "<object>", "<object>" ], [ "<object>", "<object>" ] ] } ] }'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01" payload = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}" headers= {} response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ { \"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=%3Cdate%3E" method := "POST" payload := strings.NewReader("{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request.body = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}" response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "POST" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployments/:deployment_id/predictions?version=<date>", "method": "POST", "timeout": 0, "data": "{ \"input_data\": [ { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] }, { \"id\": \"<string>\", \"fields\": [ {\"name\": \"duration\", \"type\": \"number\"} ], \"values\": [ [ \"<object>\", \"<object>\" ], [ \"<object>\", \"<object>\" ] ] } ]\n}", }; $.ajax(settings).done(function (response) { console.log(response); });
Retrieve the deployment jobs
Retrieve the status of the current jobs. The system will apply a max limit of jobs retained by the system as we cannot accumulate an infinite number of jobs. Only most recent 300 jobs (system configurable) will be preserved. Older jobs will be purged by the system.
GET /ml/v4/deployment_jobs
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieves the deployment jobs that belong to this space.
Retrieves only the jobs with these tags (comma separated).
Filter based on on the deployment job state: queued, running, completed, failed etc.
Filter based on the deployment_id.
Retrieves only fields from 'decision_optimization' and 'scoring' section mentioned as value(s) (comma separated) as output response fields. Retrieves all the fields if not mentioned.
curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=2020-09-01'
OkHttpClient client = new OkHttpClient().newBuilder().build(); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=2020-09-01").method("GET", null).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=%3Cstring%3E&tag.value=%3Cstring%3E&state=%3Cstring%3E&deployment_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?space_id=<string>&tag.value=<string>&state=<string>&deployment_id=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information related to the jobs.
The number of items to return in each page.
Possible values: 1 ≤ value ≤ 200
Example:
10
The reference to the first item in the current page.
The uri of the first resource returned.
first
The total number of resources. Computed explicitly only when 'total_count=true' query parameter is present. This is in order to avoid performance penalties.
Example:
1
A reference to the first item of the next page, if any.
The uri of the next set of resources.
next
A list of 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
Start an asynchronous deployment job
Start a deployment job asynchronously. This can perform batch scoring, streaming, or other types of batch
operations, such as solving a Decision Optimization problem.
Depending on the version
date passed, the platform_jobs
section in the response may or may not be populated.
Use the GET call to retrieve the deployment job, this GET call will eventually populate the platform_jobs
section.
Refer to the version date
description for more details.
POST /ml/v4/deployment_jobs
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Defines number of days to retain the job meta. Job meta will be auto deleted after that. Value '-1' sets the meta to be never auto deleted. accepted values are positive integer and '-1'. The default value if the parameter is not passed is '30' days.
The request body contains information about the batch deployment job that is described in more detail below.
The deployment
is a reference to the deployment associated with the deployment job or deployment job definition.
The scoring
and decision_optimization
properties are mutually exclusive.
Specify only one of these when submitting a batch deployment job, one of these fields
must be defined.
Use hybrid_pipeline_hardware_specs
only in a batch deployment job of a hybrid pipeline
in order to specify compute configuration for each pipeline node. For all other cases use hardware_spec
to specify compute configuration.
In case of output data references where the data asset is a remote database, users can specify if the batch
deployment output must be appended to the table or if the table is to be truncated and output data updated.
The output_data_references.location.write_mode
parameter can be used to for this purpose.
The values truncate
or append
can be specified for output_data_references.location.write_mode
parameter.
- Specifying
truncate
as value will truncate the table and the batch output data will be inserted. - Specifying
append
as value will insert the batch output data to the remote database table. - The
write_mode
parameter is applicable only foroutput_data_references
parameter. - The
write_mode
parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data assets or a COS based data asset.
The space that contains the resource.
Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The name of the resource.
Example:
my-resource
A reference to a resource.
A description of the resource.
Example:
This is my first resource.
A list of tags for this resource.
Examples:ViewUser defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01' --data-raw '{ "space_id":"3fc54cf1-252f-424b-b52d-5cdd9814987f", "name":"my-resource", "deployment":{ "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab" }, "hardware_spec":{ "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev":"2", "name":"string", "num_nodes":2 }, "scoring":{ "input_data":[ { "id":"string", "type":"target", "fields":[ "string" ], "values":[ [ { } ] ], "targets":[ [ { } ] ] } ], "output_data_reference":{ "id":"string", "type":"s3", "connection":{ } }, "evaluations":[ { "id":"string", "input_target":"string", "metrics_names":[ "auroc", "accuracy" ] } ] } }' echo "DO Payload Example" curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01' --data-raw '{ "name":"test-job", "space_id":"dcfb2ae2-1733-11ec-9621-0242ac130002", "deployment":{ "id":"e672c9e0-1733-11ec-9621-0242ac130002" }, "decision_optimization":{ "solve_parameters":{ "oaas.logAttachmentName":"log.txt", "oaas.logTailEnabled":"true" }, "input_data":[ { "id": "data.bin", "content": "VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=" }, { "id": "tuples.csv", "fields": ["Name", "Value"], "values": [ ["name1", 1], ["name2", 11934] ]} }, ], "input_data_references":[ { "id":"c1.mod", "type":"data_asset", "location":{ "href":"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002" } } ], "output_data":[ { "id":".*\\.*" } ] }'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"space_id\":\"3fc54cf1-252f-424b-b52d-5cdd9814987f\",\"name\":\"my-resource\",\"deployment\":{\"id\":\"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\"},\"hardware_spec\":{\"id\":\"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\",\"rev\":\"2\",\"name\":\"string\",\"num_nodes\":2},\"scoring\":{\"input_data\":[{\"id\":\"string\",\"type\":\"target\",\"fields\":[{\"name\": \"duration\", \"type\": \"number\"}],\"values\":[[{}]],\"targets\":[[{}]]}],\"output_data_reference\":{\"id\":\"string\",\"type\":\"s3\",\"connection\":{}},\"evaluations\":[{\"id\":\"string\",\"input_target\":\"string\",\"metrics_names\":[\"auroc\",\"accuracy\"]}]}}"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute(); /* DO Payload Example */ OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"name\":\"test-job\",\"space_id\":\"dcfb2ae2-1733-11ec-9621-0242ac130002\",\"deployment\":{\"id\":\"e672c9e0-1733-11ec-9621-0242ac130002\"},\"decision_optimization\":{\"solve_parameters\":{\"oaas.logAttachmentName\":\"log.txt\",\"oaas.logTailEnabled\":\"true\"},\"input_data\":[{\"id\":\"data.bin\",\"content\":\"VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=\"},{\"id\":\"tuples.csv\",\"fields\":['Name','Value'],\"values\":[['name1',1],['name2',11934]]}},],\"input_data_references\":[{\"id\":\"c1.mod\",\"type\":\"data_asset\",\"location\":{\"href\":\"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002\"}}],\"output_data\":[{\"id\":\".*\\.*\"}]}"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute();
"import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25" payload = { "space_id":"3fc54cf1-252f-424b-b52d-5cdd9814987f", "name":"my-resource", "deployment":{ "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab" }, "hardware_spec":{ "id":"4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev":"2", "name":"string", "num_nodes":2 }, "scoring":{ "input_data":[ { "id":"string", "type":"target", "fields":[ { "name":"string", "duration":"number" } ], "values":[ [ { } ] ], "targets":[ [ { } ] ] } ], "output_data_reference":{ "id":"string", "type":"s3", "connection":{ } }, "evaluations":[ { "id":"string", "input_target":"string", "metrics_names":[ "auroc", "accuracy" ] } ] } } headers = { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8')) ", #DO Payload Example import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25" payload = { "name":"test-job", "space_id":"dcfb2ae2-1733-11ec-9621-0242ac130002", "deployment":{ "id":"e672c9e0-1733-11ec-9621-0242ac130002" }, "decision_optimization":{ "solve_parameters":{ "oaas.logAttachmentName":"log.txt", "oaas.logTailEnabled":"true" }, "input_data":[ { "id": "data.bin", "content": "VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=" }, { "id": "tuples.csv", "fields": ['Name', 'Value'], "values": [ ['name1', 1], ['name2', 11934] ]} }, ], "input_data_references":[ { "id":"c1.mod", "type":"data_asset", "location":{ "href":"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002" } } ], "output_data":[ { "id":".*\\.*" } ] } headers = { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer <token>"); headers = curl_slist_append(headers, "Content-Type: application/json"); headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl); /* DO Payload Example */ CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer <token>"); headers = curl_slist_append(headers, "Content-Type: application/json"); headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{\"name\":\"test-job\",\"space_id\":\"dcfb2ae2-1733-11ec-9621-0242ac130002\",\"deployment\":{\"id\":\"e672c9e0-1733-11ec-9621-0242ac130002\"},\"decision_optimization\":{\"solve_parameters\":{\"oaas.logAttachmentName\":\"log.txt\",\"oaas.logTailEnabled\":\"true\"},\"input_data\":[{\"id\":\"data.bin\",\"content\":\"VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=\"},{\"id\":\"tuples.csv\",\"fields\":[{\"name\": \"duration\", \"type\": \"number\"}],\"values\":[['name1',1],['name2',11934]]}},],\"input_data_references\":[{\"id\":\"c1.mod\",\"type\":\"data_asset\",\"location\":{\"href\":\"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002\"}}],\"output_data\":[{\"id\":\".*\\.*\"}]}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "strings" "net/http" "io/ioutil") func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25" method := "POST" payload := strings.NewReader("{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json") req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841") res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body))} // DO Payload Example package main import ( "fmt" "strings" "net/http" "io/ioutil") func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25" method := "POST" payload := strings.NewReader("{\"name\":\"test-job\",\"space_id\":\"dcfb2ae2-1733-11ec-9621-0242ac130002\",\"deployment\":{\"id\":\"e672c9e0-1733-11ec-9621-0242ac130002\"},\"decision_optimization\":{\"solve_parameters\":{\"oaas.logAttachmentName\":\"log.txt\",\"oaas.logTailEnabled\":\"true\"},\"input_data\":[{\"id\":\"data.bin\",\"content\":\"VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=\"},{\"id\":\"tuples.csv\",\"fields\":[{\"name\": \"duration\", \"type\": \"number\"}],\"values\":[['name1',1],['name2',11934]]}},],\"input_data_references\":[{\"id\":\"c1.mod\",\"type\":\"data_asset\",\"location\":{\"href\":\"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002\"}}],\"output_data\":[{\"id\":\".*\\.*\"}]}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json") req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841") res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body))}
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25") https = Net::HTTP.new(url.host, url.port); https.use_ssl = truerequest = Net::HTTP::Post.new(url) request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}" response = https.request(request) puts response.read_body #DO Payload Example require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25") https = Net::HTTP.new(url.host, url.port); https.use_ssl = truerequest = Net::HTTP::Post.new(url) request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{\"name\":\"test-job\",\"space_id\":\"dcfb2ae2-1733-11ec-9621-0242ac130002\",\"deployment\":{\"id\":\"e672c9e0-1733-11ec-9621-0242ac130002\"},\"decision_optimization\":{\"solve_parameters\":{\"oaas.logAttachmentName\":\"log.txt\",\"oaas.logTailEnabled\":\"true\"},\"input_data\":[{\"id\":\"data.bin\",\"content\":\"VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=\"},{\"id\":\"tuples.csv\",\"fields\":['Name','Value'],\"values\":[['name1',1],['name2',11934]]}},],\"input_data_references\":[{\"id\":\"c1.mod\",\"type\":\"data_asset\",\"location\":{\"href\":\"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002\"}}],\"output_data\":[{\"id\":\".*\\.*\"}]}" response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "{\"tags\":[\"test\",\"frank\"],\"space_id\":\"d814cfc4-fba7-4130-b31a-06151b88ea38\",\"name\":\"testdeployment_job_definitiondef\",\"description\":\"testtd\",\"custom\":{\"test\":\"hi\"},\"deployment\":{\"id\":\"1223\"},\"decision_optimization\":{\"input_data\":[{\"id\":\"123\",\"fields\":[],\"values\":[]}],\"output_data\":[{\"id\":\"123\"}]},\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"string\",\"num_nodes\":2},\"hybrid_pipeline_hardware_specs\":[{\"node_runtime_id\":\"auto_ai.kb\",\"hardware_spec\":{\"id\":\"{{hardware_spec_id}}\",\"rev\":\"12\",\"name\":\"default_py3.6\",\"num_nodes\":2}}]}" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")!,timeoutInterval: Double.infinity) request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.httpMethod = "POST" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal()} task.resume() semaphore.wait() /* DO Payload Example */ import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "{\"name\":\"test-job\",\"space_id\":\"dcfb2ae2-1733-11ec-9621-0242ac130002\",\"deployment\":{\"id\":\"e672c9e0-1733-11ec-9621-0242ac130002\"},\"decision_optimization\":{\"solve_parameters\":{\"oaas.logAttachmentName\":\"log.txt\",\"oaas.logTailEnabled\":\"true\"},\"input_data\":[{\"id\":\"data.bin\",\"content\":\"VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=\"},{\"id\":\"tuples.csv\",\"fields\":['Name','Value'],\"values\":[['name1',1],['name2',11934]]}},],\"input_data_references\":[{\"id\":\"c1.mod\",\"type\":\"data_asset\",\"location\":{\"href\":\"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002\"}}],\"output_data\":[{\"id\":\".*\\.*\"}]}" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2019-10-25")!,timeoutInterval: Double.infinity) request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.httpMethod = "POST" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal()} task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs?version=2020-09-01", "method": "POST", "timeout": 0, "data": “{ "tags": [ "test", "frank" ], "space_id": "{{space_id}}", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }”}; $.ajax(settings).done(function (response) { console.log(response); }); /* DO Payload Example */ var settings = { "name":"test-job", "space_id":"dcfb2ae2-1733-11ec-9621-0242ac130002", "deployment":{ "id":"e672c9e0-1733-11ec-9621-0242ac130002" }, "decision_optimization":{ "solve_parameters":{ "oaas.logAttachmentName":"log.txt", "oaas.logTailEnabled":"true" }, "input_data":[ { "id": "data.bin", "content": "VGhlIGNvbnRlbnQgb2YgbXkgZGF0YSBmaWxlLgo=" }, { "id": "tuples.csv", "fields": ['Name', 'Value'], "values": [ ['name1', 1], ['name2', 11934] ]} }, ], "input_data_references":[ { "id":"c1.mod", "type":"data_asset", "location":{ "href":"/v2/assets/ec45babc-1733-11ec-9621-0242ac130002?space_id=dcfb2ae2-1733-11ec-9621-0242ac130002" } } ], "output_data":[ { "id":".*\\.*" } ] }”}; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information related to the job.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewInformation about the platform job assets related to this execution.
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
Cancel the deployment job
Cancel the specified deployment job.
DELETE /ml/v4/deployment_jobs/{job_id}
Request
Path Parameters
The id of the job.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Cancel the deployment job that belong to this space.
Set to true in order to also delete the job metadata information.
curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, ""); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01").method("DELETE", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01" payload = {} headers= {} response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=%3Cdate%3E" method := "DELETE" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&hard_delete=%3Cboolean%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "DELETE" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&hard_delete=<boolean>&version=<date>", "method": "DELETE", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Retrieve the deployment job
Retrieve the deployment job. The predicted data bound to this job_id is going to be kept around for a limited time based on the service configuration.
GET /ml/v4/deployment_jobs/{job_id}
Request
Path Parameters
The id of the job.
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Retrieve the deployment job that belong to this space.
Retrieves only fields from 'decision_optimization' and 'scoring' section mentioned as value(s) (comma separated) as output response fields. Retrieves all the fields if not mentioned.
curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_jobs/:job_id?space_id=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information related to the job.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewInformation about the platform job assets related to this execution.
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
Create a new deployment job definition
Create a new deployment job definition with the given payload. A deployment job definition represents the deployment metadata information in order to create a batch job in WML. This contains the same metadata used by the /ml/v4/deployment_jobs endpoint. This means that when submitting batch deployment jobs the user can either provide the job definition inline or reference a job definition in a query parameter.
POST /ml/v4/deployment_job_definitions
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Payload for creating the deployment job definition.
The space that contains the resource.
Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The name of the resource.
Example:
my-resource
A reference to a resource.
A description of the resource.
Example:
This is my first resource.
A list of tags for this resource.
Examples:ViewUser defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
curl -X POST 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2020-09-01' --data-raw '{ "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f", "name": "my-resource", "description": "This is my first resource.", "tags": [ "t1", "t2" ], "deployment": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "custom": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "hardware_spec": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "hybrid_pipeline_hardware_specs": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "scoring": { "value": "<Error: Too many levels of nesting to fake this schema>" }, "decision_optimization": { "value": "<Error: Too many levels of nesting to fake this schema>" } }'
OkHttpClient client = new OkHttpClient().newBuilder()build();MediaType mediaType = MediaType.parse("text/plain")RequestBody body = RequestBody.create(mediaType, "{ \"tags\": [ \"test\", \"frank\" ], \"space_id\": \"{{space_id}}\", \"name\": \"test deployment_job_definition def\", \"description\": \"test td\", \"custom\": { \"test\": \"hi\" }, \"deployment\": { \"id\": \"1223\" }, \"decision_optimization\": { \"input_data\": [ { \t\"id\": \"123\", \t\"fields\": [], \t\"values\": [] } ], \"output_data\": [{ \t \t\t\"id\": \"123\" \t }] }, \"hardware_spec\": { \"id\": \"{{hardware_spec_id}}\", \"rev\": \"12\", \"name\": \"string\", \"num_nodes\": 2 }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"{{hardware_spec_id}}\", \"rev\": \"12\", \"name\": \"default_py3.6\", \"num_nodes\": 2 } } ]\n}");Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25").method("POST", body).build();Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25" payload = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }" headers = { 'Authorization': 'Bearer <token>', 'Content-Type': 'application/json', 'Cookie': '__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841' } response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl;CURLcode res;curl = curl_easy_init();if(curl) {curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Bearer <token>"); headers = curl_slist_append(headers, "Content-Type: application/json"); headers = curl_slist_append(headers, "Cookie: __cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package mainimport ( "fmt" "strings" "net/http" "io/ioutil")func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25" method := "POST" payload := strings.NewReader("{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json") req.Header.Add("Cookie", "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841") res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body))}
require "uri"require "net/http"url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25")https = Net::HTTP.new(url.host, url.port);https.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Authorization"] = "Bearer <token>"request["Content-Type"] = "application/json"request["Cookie"] = "__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841"request.body = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }"response = https.request(request)puts response.read_body
import Foundationvar semaphore = DispatchSemaphore (value: 0)let parameters = "{ "tags": [ "test", "frank" ], "space_id": "d814cfc4-fba7-4130-b31a-06151b88ea38", "name": "test deployment_job_definition def", "description": "test td", "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123" }] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }"let postData = parameters.data(using: .utf8)var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25")!,timeoutInterval: Double.infinity)request.addValue("Bearer <token>", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type")request.addValue("__cfduid=dc6cd6997a0c08467ec30c4ecf7a8db7c1601476841", forHTTPHeaderField: "Cookie")request.httpMethod = "POST"request.httpBody = postDatalet task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal()}task.resume()semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?version=2019-10-25" "method": "POST" "timeout": 0 "data": "{ "tags": [ "test", "frank"], "space_id": "{{space_id}}", "name": "test deployment_job_definition def" "description": "test td" "custom": { "test": "hi" }, "deployment": { "id": "1223" }, "decision_optimization": { "input_data": [ { "id": "123", "fields": [], "values": [] } ], "output_data": [{ "id": "123"}] }, "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "string", "num_nodes": 2 }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "{{hardware_spec_id}}", "rev": "12", "name": "default_py3.6", "num_nodes": 2 } } ] }};$.ajax(settings).done(function (response) {console.log(response);});
Response
The information for a deployment job definition.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
Details about the batch deployment job.
The
deployment
is a reference to the deployment associated with the deployment job or deployment job definition.The
scoring
anddecision_optimization
properties are mutually exclusive. Specify only one of these when submitting a batch deployment job.Use
hybrid_pipeline_hardware_specs
only in a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other cases usehardware_spec
to specify compute configuration.In case of output data references where the data asset is a remote database, users can specify if the batch deployment output must be appended to the table or if the table is to be truncated and output data updated.
output_data_references.location.write_mode
parameter can be used to for this purpose. The valuestruncate
orappend
can be specified foroutput_data_references.location.write_mode
parameter.- Specifying
truncate
as value will truncate the table and the batch output data will be inserted. - Specifying
append
as value will insert the batch output data to the remote database table. - The
write_mode
parameter is applicable only foroutput_data_references
parameter. - The
write_mode
parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data asset or COS based data asset.
A reference to a resource.
User defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
entity
- Specifying
Optional details coming from the service and related to the API call or the associated resource.
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
Retrieve the deployment job definitions
Retrieve the deployment job definitions for the specified space.
GET /ml/v4/deployment_job_definitions
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the
next
field.How many resources should be returned. By default limit is 100. Max limit allowed is 200.
Possible values: 1 ≤ value ≤ 200
Default:
100
Example:
50
Return only the resources with the given tag values, separated by
or
orand
to support multiple tags.Example:
tf2.0 or tf2.1
Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.
Possible values: length ≥ 1
curl -X GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions?space_id=<string>&start=<string>&limit=100&tag.value=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
System details.
The number of items to return in each page.
Possible values: 1 ≤ value ≤ 200
Example:
10
The reference to the first item in the current page.
The uri of the first resource returned.
first
The total number of resources. Computed explicitly only when 'total_count=true' query parameter is present. This is in order to avoid performance penalties.
Example:
1
A reference to the first item of the next page, if any.
The uri of the next set of resources.
next
A list of deployment job definitions.
Optional details coming from the service and related to the API call or the associated resource.
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
Retrieve the deployment job definition
Retrieve the deployment job definition with the specified identifier. If rev
query parameter is provided,
rev=latest
will fetch the latest revision. A call with rev={revision_number}
will fetch the given
revision_number record.
GET /ml/v4/deployment_job_definitions/{job_definition_id}
Request
Path Parameters
Deployment job definition identifier.
Example:
212fadf1-252f-424b-b52d-5cdd98ecfa0
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The revision number of the resource.
Example:
2
curl -X GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01'
OkHttpClient client = new OkHttpClient().newBuilder().build(); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01").method("GET", null).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&rev=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information for a deployment job definition.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
Details about the batch deployment job.
The
deployment
is a reference to the deployment associated with the deployment job or deployment job definition.The
scoring
anddecision_optimization
properties are mutually exclusive. Specify only one of these when submitting a batch deployment job.Use
hybrid_pipeline_hardware_specs
only in a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other cases usehardware_spec
to specify compute configuration.In case of output data references where the data asset is a remote database, users can specify if the batch deployment output must be appended to the table or if the table is to be truncated and output data updated.
output_data_references.location.write_mode
parameter can be used to for this purpose. The valuestruncate
orappend
can be specified foroutput_data_references.location.write_mode
parameter.- Specifying
truncate
as value will truncate the table and the batch output data will be inserted. - Specifying
append
as value will insert the batch output data to the remote database table. - The
write_mode
parameter is applicable only foroutput_data_references
parameter. - The
write_mode
parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data asset or COS based data asset.
A reference to a resource.
User defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
entity
- Specifying
Optional details coming from the service and related to the API call or the associated resource.
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
Update the deployment job definition
Update the deployment job definition with the provided patch data. The following fields can be patched:
/tags
/name
/description
/custom
/deployment
PATCH /ml/v4/deployment_job_definitions/{job_definition_id}
Request
Path Parameters
Deployment job definition identifier.
Example:
212fadf1-252f-424b-b52d-5cdd98ecfa0
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).
The operation to be performed.
Allowable values: [
add
,remove
,replace
]The pointer that identifies the field that is the target of the operation.
The value to be used within the operation.
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.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
Details about the batch deployment job.
The
deployment
is a reference to the deployment associated with the deployment job or deployment job definition.The
scoring
anddecision_optimization
properties are mutually exclusive. Specify only one of these when submitting a batch deployment job.Use
hybrid_pipeline_hardware_specs
only in a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other cases usehardware_spec
to specify compute configuration.In case of output data references where the data asset is a remote database, users can specify if the batch deployment output must be appended to the table or if the table is to be truncated and output data updated.
output_data_references.location.write_mode
parameter can be used to for this purpose. The valuestruncate
orappend
can be specified foroutput_data_references.location.write_mode
parameter.- Specifying
truncate
as value will truncate the table and the batch output data will be inserted. - Specifying
append
as value will insert the batch output data to the remote database table. - The
write_mode
parameter is applicable only foroutput_data_references
parameter. - The
write_mode
parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data asset or COS based data asset.
A reference to a resource.
User defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
entity
- Specifying
Optional details coming from the service and related to the API call or the associated resource.
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
Delete the deployment job definition
Delete the deployment job definition with the specified identifier. This will delete all revisions of this deployment job definition as well. For each revision all attachments will also be deleted.
DELETE /ml/v4/deployment_job_definitions/{job_definition_id}
Request
Path Parameters
Deployment job definition identifier.
Example:
212fadf1-252f-424b-b52d-5cdd98ecfa0
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
curl -X DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=%3Cdate%3E" method := "DELETE" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "DELETE" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id?space_id=<string>&version=<date>", "method": "DELETE", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Create a new deployment job definition revision
Create a new deployment job definition revision. The current metadata and content for job_definition_id will be taken and a new revision created.
POST /ml/v4/deployment_job_definitions/{job_definition_id}/revisions
Request
Path Parameters
Deployment job definition identifier.
Example:
212fadf1-252f-424b-b52d-5cdd98ecfa0
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The details for the revision.
The space that contains the resource.
Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
An optional commit message for the revision.
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.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
Details about the batch deployment job.
The
deployment
is a reference to the deployment associated with the deployment job or deployment job definition.The
scoring
anddecision_optimization
properties are mutually exclusive. Specify only one of these when submitting a batch deployment job.Use
hybrid_pipeline_hardware_specs
only in a batch deployment job of a hybrid pipeline in order to specify compute configuration for each pipeline node. For all other cases usehardware_spec
to specify compute configuration.In case of output data references where the data asset is a remote database, users can specify if the batch deployment output must be appended to the table or if the table is to be truncated and output data updated.
output_data_references.location.write_mode
parameter can be used to for this purpose. The valuestruncate
orappend
can be specified foroutput_data_references.location.write_mode
parameter.- Specifying
truncate
as value will truncate the table and the batch output data will be inserted. - Specifying
append
as value will insert the batch output data to the remote database table. - The
write_mode
parameter is applicable only foroutput_data_references
parameter. - The
write_mode
parameter will be applicable only for remote database related data assets. This parameter will not be applicable for local data asset or COS based data asset.
A reference to a resource.
User defined properties.
A hardware specification.
Hybrid pipeline hardware specification.
Details about the input/output data and other properties to be used for a batch deployment job of a model, Python Function or a Python Scripts.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.input_data
property is not supported for batch deployment of Python Scripts.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these. Theinput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available.output_data_references
must be used withinput_data_references
. Theoutput_data_references
property is not supported for batch deployment job of Spark models and Python Functions.Details about the input/output data and other properties to be used for a batch deployment job of a decision optimization problem.
Use
input_data
property to specify the input data for batch processing as part of the job's payload. Theinput_data
property is mutually exclusive withinput_data_references
property, only use one of these. Wheninput_data
is specified, the processed output of batch deployment job will be available inscoring.predictions
parameter in the deployment job response.Use
input_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theinput_data_references
must be used withoutput_data_references
. Theinput_data_references
property is mutually exclusive withinput_data
property, only use one of these.Use
output_data_references
property to specify the details pertaining to the remote source where the input data for batch deployment job is available. Theoutput_data_references
must be used withinput_data_references
.
entity
- Specifying
Optional details coming from the service and related to the API call or the associated resource.
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
Retrieve the deployment job definition revisions
Retrieve the deployment job definition revisions.
GET /ml/v4/deployment_job_definitions/{job_definition_id}/revisions
Request
Path Parameters
Deployment job definition identifier.
Example:
212fadf1-252f-424b-b52d-5cdd98ecfa0
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the
next
field.How many resources should be returned. By default limit is 100. Max limit allowed is 200.
Possible values: 1 ≤ value ≤ 200
Default:
100
Example:
50
curl -X GET 'https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/deployment_job_definitions/:job_definition_id/revisions?space_id=<string>&start=<string>&limit=100&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
System details.
The number of items to return in each page.
Possible values: 1 ≤ value ≤ 200
Example:
10
The reference to the first item in the current page.
The uri of the first resource returned.
first
The total number of resources. Computed explicitly only when 'total_count=true' query parameter is present. This is in order to avoid performance penalties.
Example:
1
A reference to the first item of the next page, if any.
The uri of the next set of resources.
next
A list of deployment job definitions.
Optional details coming from the service and related to the API call or the associated resource.
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
Create a new experiment
Create a new experiment with the given payload. An experiment represents an asset that captures a set of pipeline
or model definition
assets that will be trained at the same time on the same data set.
POST /ml/v4/experiments
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
Payload for creating the experiment. Either space_id
or project_id
has to be provided and is mandatory.
The name of the resource.
Example:
my-resource
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
A description of the resource.
Example:
This is my first resource.
A list of tags for this resource.
Examples:ViewThe label column.
The optional evaluation definition.
The optional training references used by the experiment.
User defined properties specified as key-value pairs.
Examples:Viewcustom
curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01' --data-raw '{ "name": "my-resource", "project_id": "12ac4cf1-252f-424b-b52d-5cdd9814987f", "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f", "description": "This is my first resource.", "tags": [ "t1", "t2" ], "label_column": "<string>", "evaluation_definition": { "metrics": [ { "name": "<string>", "maximize": "<boolean>" }, { "name": "<string>", "maximize": "<boolean>" } ], "method": "binary" }, "training_references": [ { "pipeline": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "model_type": "<string>", "data_bindings": [ { "data_reference_name": "<string>", "node_id": "<string>" }, { "data_reference_name": "<string>", "node_id": "<string>" } ], "nodes_parameters": [ { "node_id": "<string>", "parameters": "<object>" }, { "node_id": "<string>", "parameters": "<object>" } ], "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } }, { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } } ] }, "model_definition": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab" }, "hyper_parameters_optimization": { "method": { "name": "random", "parameters": "<object>" }, "hyper_parameters": [ { "name": "learning_rate", "items": [ 0.005, 0.1, 0.11 ] }, { "name": "fc", "items": { "min_value": 9, "max_value": 10, "power": 2 } } ] } }, { "pipeline": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "model_type": "<string>", "data_bindings": [ { "data_reference_name": "<string>", "node_id": "<string>" }, { "data_reference_name": "<string>", "node_id": "<string>" } ], "nodes_parameters": [ { "node_id": "<string>", "parameters": "<object>" }, { "node_id": "<string>", "parameters": "<object>" } ], "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" }, "hybrid_pipeline_hardware_specs": [ { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } }, { "node_runtime_id": "auto_ai.kb", "hardware_spec": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab", "rev": "2", "name": "<string>", "num_nodes": "<integer>" } } ] }, "model_definition": { "id": "4cedab6d-e8e4-4214-b81a-2ddb122db2ab" }, "hyper_parameters_optimization": { "method": { "name": "random", "parameters": "<object>" }, "hyper_parameters": [ { "name": "learning_rate", "items": [ 0.005, 0.1, 0.11 ] }, { "name": "fc", "items": { "min_value": 9, "max_value": 10, "power": 2 } } ] } } ], "custom": "<object>" }'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\"], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\"}, { \"name\": \"<string>\", \"maximize\": \"<boolean>\"} ], \"method\": \"binary\"}, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"}, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"} ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\"}, { \"node_id\": \"<string>\", \"parameters\": \"<object>\"} ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"}, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\"}, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\"}, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"}, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"} ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\"}, { \"node_id\": \"<string>\", \"parameters\": \"<object>\"} ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"}, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\"}, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\"}, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"}"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01" payload = "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}" headers= {} response = requests.request("POST", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=%3Cdate%3E" method := "POST" payload := strings.NewReader("{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Post.new(url) request.body = "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}" response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "POST" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=<date>", "method": "POST", "timeout": 0, "data": "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\" ], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\" }, { \"name\": \"<string>\", \"maximize\": \"<boolean>\" } ], \"method\": \"binary\" }, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" }, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\" } ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\" }, { \"node_id\": \"<string>\", \"parameters\": \"<object>\" } ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" }, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\" } } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\" }, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\" }, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"\n}", }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information for an experiment.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
The details of the experiment to be created.
The label column.
The optional evaluation definition.
The optional training references used by the experiment.
User defined properties specified as key-value pairs.
Examples:Viewcustom
entity
Optional details coming from the service and related to the API call or the associated resource.
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
Retrieve the experiments
Retrieve the experiments for the specified space or project.
GET /ml/v4/experiments
Request
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Token required for token-based pagination. This token cannot be determined by end user. It is generated by the service and it is set in the href available in the
next
field.How many resources should be returned. By default limit is 100. Max limit allowed is 200.
Possible values: 1 ≤ value ≤ 200
Default:
100
Example:
50
Return only the resources with the given tag values, separated by
or
orand
to support multiple tags.Example:
tf2.0 or tf2.1
Returns only resources that match this search string. The path to the field must be the complete path to the field, and this field must be one of the indexed fields for this resource type. Note that the search string must be URL encoded.
Possible values: length ≥ 1
curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=%3Cstring%3E&project_id=%3Cstring%3E&start=%3Cstring%3E&limit=100&tag.value=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments?space_id=<string>&project_id=<string>&start=<string>&limit=100&tag.value=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
System details.
The number of items to return in each page.
Possible values: 1 ≤ value ≤ 200
Example:
10
The reference to the first item in the current page.
The uri of the first resource returned.
first
The total number of resources. Computed explicitly only when 'total_count=true' query parameter is present. This is in order to avoid performance penalties.
Example:
1
A reference to the first item of the next page, if any.
The uri of the next set of resources.
next
A list of experiments.
Optional details coming from the service and related to the API call or the associated resource.
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
Retrieve the experiment
Retrieve the experiment with the specified identifier. If rev
query parameter is provided,
rev=latest
will fetch the latest revision. A call with rev={revision_number}
will fetch the given
revision_number record. Either space_id
or project_id
has to be provided and is mandatory.
GET /ml/v4/experiments/{experiment_id}
Request
Path Parameters
Experiment identifier.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The revision number of the resource.
Example:
2
curl --location --request GET 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "{ \"name\": \"my-resource\", \"project_id\": \"12ac4cf1-252f-424b-b52d-5cdd9814987f\", \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"description\": \"This is my first resource.\", \"tags\": [ \"t1\", \"t2\"], \"label_column\": \"<string>\", \"evaluation_definition\": { \"metrics\": [ { \"name\": \"<string>\", \"maximize\": \"<boolean>\"}, { \"name\": \"<string>\", \"maximize\": \"<boolean>\"} ], \"method\": \"binary\"}, \"training_references\": [ { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"}, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"} ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\"}, { \"node_id\": \"<string>\", \"parameters\": \"<object>\"} ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"}, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\"}, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\"}, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } }, { \"pipeline\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"model_type\": \"<string>\", \"data_bindings\": [ { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"}, { \"data_reference_name\": \"<string>\", \"node_id\": \"<string>\"} ], \"nodes_parameters\": [ { \"node_id\": \"<string>\", \"parameters\": \"<object>\"}, { \"node_id\": \"<string>\", \"parameters\": \"<object>\"} ], \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"}, \"hybrid_pipeline_hardware_specs\": [ { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} }, { \"node_runtime_id\": \"auto_ai.kb\", \"hardware_spec\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\", \"rev\": \"2\", \"name\": \"<string>\", \"num_nodes\": \"<integer>\"} } ] }, \"model_definition\": { \"id\": \"4cedab6d-e8e4-4214-b81a-2ddb122db2ab\"}, \"hyper_parameters_optimization\": { \"method\": { \"name\": \"random\", \"parameters\": \"<object>\"}, \"hyper_parameters\": [ { \"name\": \"learning_rate\", \"items\": [ 0.005, 0.1, 0.11 ] }, { \"name\": \"fc\", \"items\": { \"min_value\": 9, \"max_value\": 10, \"power\": 2 } } ] } } ], \"custom\": \"<object>\"}"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("GET", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=%3Cdate%3E" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Get.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&rev=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&rev=<string>&version=<date>", "method": "GET", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information for an experiment.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
The details of the experiment to be created.
The label column.
The optional evaluation definition.
The optional training references used by the experiment.
User defined properties specified as key-value pairs.
Examples:Viewcustom
entity
Optional details coming from the service and related to the API call or the associated resource.
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
Update the experiment
Update the experiment with the provided patch data. The following fields can be patched:
/tags
/name
/description
/custom
PATCH /ml/v4/experiments/{experiment_id}
Request
Path Parameters
Experiment identifier.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Input For Patch. This is the patch body which corresponds to the JavaScript Object Notation (JSON) Patch standard (RFC 6902).
The operation to be performed.
Allowable values: [
add
,remove
,replace
]The pointer that identifies the field that is the target of the operation.
The value to be used within the operation.
curl --location --request PATCH 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01' --data-raw '[ { "op": "<string>", "path": "<string>", "value": "<object>" }, { "op": "<string>", "path": "<string>", "value": "<object>" } ]'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"}, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\"} ]"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01").method("PATCH", body).build(); Response response = client.newCall(request).execute();
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01" payload = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]" headers= {} response = requests.request("PATCH", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PATCH"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); const char *data = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]"; curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=%3Cdate%3E" method := "PATCH" payload := strings.NewReader("[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]") client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Patch.new(url) request.body = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]" response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) let parameters = "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]" let postData = parameters.data(using: .utf8) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "PATCH" request.httpBody = postData let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=<date>", "method": "PATCH", "timeout": 0, "data": "[ { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }, { \"op\": \"<string>\", \"path\": \"<string>\", \"value\": \"<object>\" }\n]", }; $.ajax(settings).done(function (response) { console.log(response); });
Response
The information for an experiment.
Common metadata for a resource where
project_id
orspace_id
must be present.Examples:ViewThe id of the resource.
The time when the resource was created.
The revision of the resource.
The user id which created this resource.
The time when the resource was last modified.
The id of the parent resource where applicable.
The name of the resource.
A description of the resource.
A list of tags for this resource.
Examples:ViewInformation related to the revision.
The time when the revision was committed.
The message that was provided when the revision was created.
commit_info
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
metadata
The details of the experiment to be created.
The label column.
The optional evaluation definition.
The optional training references used by the experiment.
User defined properties specified as key-value pairs.
Examples:Viewcustom
entity
Optional details coming from the service and related to the API call or the associated resource.
Status Code
Experiment has been patched successfully
Bad request, the response body should contain the reason.
Unauthorized.
Forbidden, an authentication error including trying to access a forbidden space.
The specified resource was not found.
No Sample Response
Delete the experiment
Delete the experiment with the specified identifier. This will delete all revisions of this experiment as well. For each revision all attachments will also be deleted.
DELETE /ml/v4/experiments/{experiment_id}
Request
Path Parameters
Experiment identifier.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The space that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
query parameter has to be given.Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
curl --location --request DELETE 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01'
import requests url = "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01" payload = {} headers= {} response = requests.request("DELETE", url, headers=headers, data = payload) print(response.text.encode('utf8'))
CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_easy_setopt(curl, CURLOPT_URL, "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https"); struct curl_slist *headers = NULL; curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); res = curl_easy_perform(curl); } curl_easy_cleanup(curl);
package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=%3Cdate%3E" method := "DELETE" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) } res, err := client.Do(req) defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) fmt.Println(string(body)) }
require "uri" require "net/http" url = URI("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=2020-09-01") https = Net::HTTP.new(url.host, url.port); https.use_ssl = true request = Net::HTTP::Delete.new(url) response = https.request(request) puts response.read_body
import Foundation var semaphore = DispatchSemaphore (value: 0) var request = URLRequest(url: URL(string: "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=%3Cstring%3E&project_id=%3Cstring%3E&version=2020-09-01")!,timeoutInterval: Double.infinity) request.httpMethod = "DELETE" let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { print(String(describing: error)) return } print(String(data: data, encoding: .utf8)!) semaphore.signal() } task.resume() semaphore.wait()
var settings = { "url": "https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id?space_id=<string>&project_id=<string>&version=<date>", "method": "DELETE", "timeout": 0, }; $.ajax(settings).done(function (response) { console.log(response); });
Create a new experiment revision
Create a new experiment revision.
The current metadata and content for
experiment_id will be taken and a new revision created.
Either space_id
or project_id
has to be provided and is mandatory.
POST /ml/v4/experiments/{experiment_id}/revisions
Request
Path Parameters
Experiment identifier.
Example:
63dc4cf1-252f-424b-b52d-5cdd9814987f
Query Parameters
The version date for the API of the form
YYYY-MM-DD
.Example:
2022-08-01
The details for the revision.
The space that contains the resource. Either
space_id
orproject_id
has to be given.Example:
3fc54cf1-252f-424b-b52d-5cdd9814987f
The project that contains the resource. Either
space_id
orproject_id
has to be given.Example:
12ac4cf1-252f-424b-b52d-5cdd9814987f
An optional commit message for the revision.
curl --location --request POST 'https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id/revisions?version=2020-09-01' --data-raw '{ "space_id": "3fc54cf1-252f-424b-b52d-5cdd9814987f", "commit_message": "Updated for TF 2.0" }'
OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("text/plain"); RequestBody body = RequestBody.create(mediaType, "{ \"space_id\": \"3fc54cf1-252f-424b-b52d-5cdd9814987f\", \"commit_message\": \"Updated for TF 2.0\"}"); Request request = new Request.Builder().url("https://us-south.ml.cloud.ibm.com/ml/v4/experiments/:experiment_id/revisions?version=2020-09-01").method("POST", body).build(); Response response = client.newCall(request).execute();