Create or update artifact version
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/artifact-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
}
}
'import requests
url = "https://{controlPlaneURL}/api/ml/v1/artifact-versions"
payload = { "manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
metadata: {},
ml_repo: '<string>',
source: {type: 'truefoundry', uri: '<string>'},
version: 2,
type: 'artifact-version',
description: '<string>',
version_alias: '<string>',
step: 0,
run_id: '<string>'
}
})
};
fetch('https://{controlPlaneURL}/api/ml/v1/artifact-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://{controlPlaneURL}/api/ml/v1/artifact-versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'metadata' => [
],
'ml_repo' => '<string>',
'source' => [
'type' => 'truefoundry',
'uri' => '<string>'
],
'version' => 2,
'type' => 'artifact-version',
'description' => '<string>',
'version_alias' => '<string>',
'step' => 0,
'run_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{controlPlaneURL}/api/ml/v1/artifact-versions"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://{controlPlaneURL}/api/ml/v1/artifact-versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/ml/v1/artifact-versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
},
"ml_repo_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"version_alias": "<string>",
"usage_code_snippet": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Artifacts
Create or update artifact version
Create or update an artifact version.
PUT
/
api
/
ml
/
v1
/
artifact-versions
Create or update artifact version
curl --request PUT \
--url https://{controlPlaneURL}/api/ml/v1/artifact-versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
}
}
'import requests
url = "https://{controlPlaneURL}/api/ml/v1/artifact-versions"
payload = { "manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
metadata: {},
ml_repo: '<string>',
source: {type: 'truefoundry', uri: '<string>'},
version: 2,
type: 'artifact-version',
description: '<string>',
version_alias: '<string>',
step: 0,
run_id: '<string>'
}
})
};
fetch('https://{controlPlaneURL}/api/ml/v1/artifact-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://{controlPlaneURL}/api/ml/v1/artifact-versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'metadata' => [
],
'ml_repo' => '<string>',
'source' => [
'type' => 'truefoundry',
'uri' => '<string>'
],
'version' => 2,
'type' => 'artifact-version',
'description' => '<string>',
'version_alias' => '<string>',
'step' => 0,
'run_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{controlPlaneURL}/api/ml/v1/artifact-versions"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://{controlPlaneURL}/api/ml/v1/artifact-versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/ml/v1/artifact-versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"metadata\": {},\n \"ml_repo\": \"<string>\",\n \"source\": {\n \"type\": \"truefoundry\",\n \"uri\": \"<string>\"\n },\n \"version\": 2,\n \"type\": \"artifact-version\",\n \"description\": \"<string>\",\n \"version_alias\": \"<string>\",\n \"step\": 0,\n \"run_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"fqn": "<string>",
"created_by_subject": {
"subjectId": "<string>",
"subjectSlug": "<string>",
"subjectDisplayName": "<string>",
"subjectPatName": "<string>",
"subjectControllerName": "<string>",
"subjectExternalIdentitySlug": "<string>"
},
"manifest": {
"name": "<string>",
"metadata": {},
"ml_repo": "<string>",
"source": {
"type": "truefoundry",
"uri": "<string>"
},
"version": 2,
"type": "artifact-version",
"description": "<string>",
"version_alias": "<string>",
"step": 0,
"run_id": "<string>"
},
"ml_repo_id": "<string>",
"artifact_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"tags": [
"<string>"
],
"version_alias": "<string>",
"usage_code_snippet": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Manifest containing metadata for the artifact to apply
Show child attributes
Show child attributes
Response
The created or updated artifact version
The artifact version data
Show child attributes
Show child attributes
Was this page helpful?
⌘I