Create Model API version
Creates a Model API Version for a Model API.
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"logHttpRequestResponse": true,
"monitoringEnabled": true,
"projectId": "<string>",
"source": {
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": true,
"shouldDeploy": true
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions"
payload = {
"logHttpRequestResponse": True,
"monitoringEnabled": True,
"projectId": "<string>",
"source": {
"excludeFiles": ["<string>"],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": True,
"shouldDeploy": True
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
logHttpRequestResponse: true,
monitoringEnabled: true,
projectId: '<string>',
source: {
excludeFiles: ['<string>'],
file: '<string>',
function: '<string>',
registeredModelName: '<string>',
registeredModelVersion: 123
},
commitId: '<string>',
description: '<string>',
environmentId: '<string>',
predictionDatasetResourceId: '<string>',
provenanceCheckpointId: '<string>',
recordInvocation: true,
shouldDeploy: true
})
};
fetch('https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'logHttpRequestResponse' => true,
'monitoringEnabled' => true,
'projectId' => '<string>',
'source' => [
'excludeFiles' => [
'<string>'
],
'file' => '<string>',
'function' => '<string>',
'registeredModelName' => '<string>',
'registeredModelVersion' => 123
],
'commitId' => '<string>',
'description' => '<string>',
'environmentId' => '<string>',
'predictionDatasetResourceId' => '<string>',
'provenanceCheckpointId' => '<string>',
'recordInvocation' => true,
'shouldDeploy' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions"
payload := strings.NewReader("{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}"
response = http.request(request)
puts response.read_body{
"commitId": "<string>",
"dataPlaneId": "<string>",
"environmentRevisionId": "<string>",
"id": "<string>",
"labels": [
"<string>"
],
"logHttpRequestResponse": true,
"metadata": {
"created": 123,
"createdBy": "<string>",
"summary": "<string>"
},
"modelApiId": "<string>",
"monitoringEnabled": true,
"projectId": "<string>",
"recordInvocation": true,
"source": {
"type": "File",
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"bundleId": "<string>",
"deployment": {
"isPending": true,
"status": "<string>"
},
"description": "<string>",
"number": 123,
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>"
}Authorizations
Path Parameters
The id of the Model API to create the version for.
Body
Whether the Model API Version to create should log HTTP requests and responses.
Whether the Model API Version to create should have monitoring enabled.
The id of the project the Model API Version to create should belong to.
Show child attributes
Show child attributes
The id of the commit id of the Model API Version to create.
The description for the Model API Version to create.
The id of the environment to deploy the Model API Version with.
The id of the prediction dataset to be used by the Model API Version to create.
The id of the provenance checkpoint of the Model API Version to create.
Whether the Model API Version to create should record invocations.
Whether the Model API Version to create should be deployed.
Response
The created Model API Version.
The id of the commit of the Model API Version.
The id of the data plane the Model API Version is deployed to.
The id of the environment revision the Model API Version is deployed on.
The id of the Model API Version.
The labels of the Model API Version.
Whether the Model API Version should log the HTTP requests and responses.
Show child attributes
Show child attributes
The id of the Model API the version belongs to.
Whether monitoring is enabled for the Mode API Version.
The id of the project the Model API Version belongs to.
Whether the Model API Version should record invocations.
Show child attributes
Show child attributes
The ID of the bundle governing the model API to create.
^[0-9a-f]{24}$Show child attributes
Show child attributes
The description of the Model API Version.
The version number of the Model API Version.
The id of the prediction dataset used by the Model API Version.
The id of the provenance checkpoint of the Model API Version.
Was this page helpful?
curl --request POST \
--url https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions \
--header 'Content-Type: application/json' \
--header 'X-Domino-Api-Key: <api-key>' \
--data '
{
"logHttpRequestResponse": true,
"monitoringEnabled": true,
"projectId": "<string>",
"source": {
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": true,
"shouldDeploy": true
}
'import requests
url = "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions"
payload = {
"logHttpRequestResponse": True,
"monitoringEnabled": True,
"projectId": "<string>",
"source": {
"excludeFiles": ["<string>"],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"commitId": "<string>",
"description": "<string>",
"environmentId": "<string>",
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>",
"recordInvocation": True,
"shouldDeploy": True
}
headers = {
"X-Domino-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Domino-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
logHttpRequestResponse: true,
monitoringEnabled: true,
projectId: '<string>',
source: {
excludeFiles: ['<string>'],
file: '<string>',
function: '<string>',
registeredModelName: '<string>',
registeredModelVersion: 123
},
commitId: '<string>',
description: '<string>',
environmentId: '<string>',
predictionDatasetResourceId: '<string>',
provenanceCheckpointId: '<string>',
recordInvocation: true,
shouldDeploy: true
})
};
fetch('https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'logHttpRequestResponse' => true,
'monitoringEnabled' => true,
'projectId' => '<string>',
'source' => [
'excludeFiles' => [
'<string>'
],
'file' => '<string>',
'function' => '<string>',
'registeredModelName' => '<string>',
'registeredModelVersion' => 123
],
'commitId' => '<string>',
'description' => '<string>',
'environmentId' => '<string>',
'predictionDatasetResourceId' => '<string>',
'provenanceCheckpointId' => '<string>',
'recordInvocation' => true,
'shouldDeploy' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Domino-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions"
payload := strings.NewReader("{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Domino-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions")
.header("X-Domino-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mycluster.domino.tech/api/modelServing/v1/modelApis/{modelApiId}/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Domino-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"logHttpRequestResponse\": true,\n \"monitoringEnabled\": true,\n \"projectId\": \"<string>\",\n \"source\": {\n \"excludeFiles\": [\n \"<string>\"\n ],\n \"file\": \"<string>\",\n \"function\": \"<string>\",\n \"registeredModelName\": \"<string>\",\n \"registeredModelVersion\": 123\n },\n \"commitId\": \"<string>\",\n \"description\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"predictionDatasetResourceId\": \"<string>\",\n \"provenanceCheckpointId\": \"<string>\",\n \"recordInvocation\": true,\n \"shouldDeploy\": true\n}"
response = http.request(request)
puts response.read_body{
"commitId": "<string>",
"dataPlaneId": "<string>",
"environmentRevisionId": "<string>",
"id": "<string>",
"labels": [
"<string>"
],
"logHttpRequestResponse": true,
"metadata": {
"created": 123,
"createdBy": "<string>",
"summary": "<string>"
},
"modelApiId": "<string>",
"monitoringEnabled": true,
"projectId": "<string>",
"recordInvocation": true,
"source": {
"type": "File",
"excludeFiles": [
"<string>"
],
"file": "<string>",
"function": "<string>",
"registeredModelName": "<string>",
"registeredModelVersion": 123
},
"bundleId": "<string>",
"deployment": {
"isPending": true,
"status": "<string>"
},
"description": "<string>",
"number": 123,
"predictionDatasetResourceId": "<string>",
"provenanceCheckpointId": "<string>"
}