Validations
Validate Python function source without uploading it
POST
/
compute
/
functions
/
validations
Validate Python function source without uploading it
curl --request POST \
--url https://api.mobilerun.ai/v1/compute/functions/validations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"source": "<string>",
"manifest": {
"hosts": [],
"credentials": [],
"scopes": []
}
}
'import requests
url = "https://api.mobilerun.ai/v1/compute/functions/validations"
payload = {
"source": "<string>",
"manifest": {
"hosts": [],
"credentials": [],
"scopes": []
}
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({source: '<string>', manifest: {hosts: [], credentials: [], scopes: []}})
};
fetch('https://api.mobilerun.ai/v1/compute/functions/validations', 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://api.mobilerun.ai/v1/compute/functions/validations",
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([
'source' => '<string>',
'manifest' => [
'hosts' => [
],
'credentials' => [
],
'scopes' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-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://api.mobilerun.ai/v1/compute/functions/validations"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
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.post("https://api.mobilerun.ai/v1/compute/functions/validations")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/compute/functions/validations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"errors": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"valid": true,
"inputSchema": {},
"outputSchema": {},
"outputKind": "value",
"datasetKey": "<string>",
"runtimeVersion": "<string>",
"finishedAt": "2023-11-07T05:31:56Z"
}
}{
"data": {
"errors": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"valid": true,
"inputSchema": {},
"outputSchema": {},
"outputKind": "value",
"datasetKey": "<string>",
"runtimeVersion": "<string>",
"finishedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_idempotency_key",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"retryAfterSeconds": 123,
"traceId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"retryAfterSeconds": 123,
"traceId": "<string>"
}{
"code": "validation_not_found",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "idempotency_request_in_progress",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "function_too_large",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "idempotency_key_reused",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "validation_rate_limited",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "executor_unavailable",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}Headers
Idempotency-Key: 1-255 printable ASCII characters. Same key with a different request body is a 422 idempotency_key_reused. A retryable in-flight duplicate is a 409 with Retry-After and x-should-retry: true; a terminal duplicate is a 409 with x-should-retry: false. A replay returns the current resource state with Idempotent-Replayed: true. Required.
Required string length:
1 - 255Pattern:
^[\x21-\x7E]{1,255}$Example:
"b3f6a9f0-6f1a-4e9a-9e7a-9c9b6b6a5a3f"
Query Parameters
Was this page helpful?
⌘I
Validate Python function source without uploading it
curl --request POST \
--url https://api.mobilerun.ai/v1/compute/functions/validations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"source": "<string>",
"manifest": {
"hosts": [],
"credentials": [],
"scopes": []
}
}
'import requests
url = "https://api.mobilerun.ai/v1/compute/functions/validations"
payload = {
"source": "<string>",
"manifest": {
"hosts": [],
"credentials": [],
"scopes": []
}
}
headers = {
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({source: '<string>', manifest: {hosts: [], credentials: [], scopes: []}})
};
fetch('https://api.mobilerun.ai/v1/compute/functions/validations', 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://api.mobilerun.ai/v1/compute/functions/validations",
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([
'source' => '<string>',
'manifest' => [
'hosts' => [
],
'credentials' => [
],
'scopes' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-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://api.mobilerun.ai/v1/compute/functions/validations"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
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.post("https://api.mobilerun.ai/v1/compute/functions/validations")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/compute/functions/validations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"manifest\": {\n \"hosts\": [],\n \"credentials\": [],\n \"scopes\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"errors": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"valid": true,
"inputSchema": {},
"outputSchema": {},
"outputKind": "value",
"datasetKey": "<string>",
"runtimeVersion": "<string>",
"finishedAt": "2023-11-07T05:31:56Z"
}
}{
"data": {
"errors": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"line": 123,
"repair": {
"action": "<string>",
"hint": "<string>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"createdAt": "2023-11-07T05:31:56Z",
"valid": true,
"inputSchema": {},
"outputSchema": {},
"outputKind": "value",
"datasetKey": "<string>",
"runtimeVersion": "<string>",
"finishedAt": "2023-11-07T05:31:56Z"
}
}{
"code": "invalid_idempotency_key",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"retryAfterSeconds": 123,
"traceId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<unknown>",
"retryAfterSeconds": 123,
"traceId": "<string>"
}{
"code": "validation_not_found",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "idempotency_request_in_progress",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "function_too_large",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "idempotency_key_reused",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "validation_rate_limited",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}{
"code": "executor_unavailable",
"message": "<string>",
"traceId": "<string>",
"retryAfterSeconds": 123
}