> ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a new Function ## OpenAPI ````json POST /functions { "openapi": "3.0.3", "info": { "title": "VAST DataEngine API", "description": "Combined OpenAPI specification for Document360: Provisioning, Telemetries Query, Telemetries Collector, and shared common components.", "version": "1.4.0" }, "servers": [ { "url": "http://localhost:3000", "description": "Provisioning Service (Local development server)" }, { "url": "http://localhost:8080/query_telemetries", "description": "Telemetries Query Service (Local development server)" }, { "url": "http://localhost:8080/telemetries", "description": "Telemetries Collector Service (Local development server)" } ], "tags": [ { "name": "Provisioning Service v1.4.0", "description": "Provisioning Service API" }, { "name": "Provisioning Service v1.4.0 > dataEngine", "description": "Data Engine lifecycle" }, { "name": "Provisioning Service v1.4.0 > setup_provisioning", "description": "Deprecated provisioning setup" }, { "name": "Provisioning Service v1.4.0 > pipelines", "description": "Pipelines" }, { "name": "Provisioning Service v1.4.0 > pipelineRevisions", "description": "Pipeline revisions" }, { "name": "Provisioning Service v1.4.0 > functions", "description": "Functions" }, { "name": "Provisioning Service v1.4.0 > functionRevisions", "description": "Function revisions" }, { "name": "Provisioning Service v1.4.0 > functionRevisionsDeprecated", "description": "Deprecated function revision endpoints" }, { "name": "Provisioning Service v1.4.0 > triggers", "description": "Triggers" }, { "name": "Provisioning Service v1.4.0 > topics", "description": "Topics" }, { "name": "Provisioning Service v1.4.0 > containerRegistries", "description": "Container registries" }, { "name": "Provisioning Service v1.4.0 > kubernetesClusters", "description": "Kubernetes clusters" }, { "name": "Provisioning Service v1.4.0 > kubernetesSecrets", "description": "Kubernetes secrets" }, { "name": "Provisioning Service v1.4.0 > mtlsAuthenticationCredentials", "description": "mTLS authentication credentials" }, { "name": "Provisioning Service v1.4.0 > dashboard", "description": "Dashboard" }, { "name": "Provisioning Service v1.4.0 > reports", "description": "Saved reports" }, { "name": "Telemetries Collector Service v1.4.0", "description": "API for collecting OTEL signals (traces, logs and metrics)" }, { "name": "Telemetries Collector Service v1.4.0 > collect_telemetries", "description": "Collect OTEL signals" }, { "name": "Telemetries Query Service v1.4.0", "description": "API for querying traces, logs and metrics" }, { "name": "Telemetries Query Service v1.4.0 > query_telemetries", "description": "Query traces and logs" }, { "name": "Telemetries Query Service v1.4.0 > metrics", "description": "Query metrics" }, { "name": "Telemetries Query Service v1.4.0 > reports", "description": "Saved reports" } ], "paths": { "/functions": { "post": { "summary": "Create a new Function", "operationId": "createFunction", "tags": [ "Provisioning Service v1.4.0 > functions" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FunctionCreate" } } } }, "responses": { "201": { "description": "The created Function", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Function" } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/ConflictError" }, "422": { "$ref": "#/components/responses/ValidationError" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "components": { "schemas": { "FunctionCreate": { "allOf": [ { "$ref": "#/components/schemas/FunctionRevisionCreate" }, { "$ref": "#/components/schemas/FunctionBase" }, { "type": "object", "properties": { "revision_alias": { "type": "string", "description": "Alias for the revision. If not provided, the revision number will be used." }, "revision_description": { "type": "string", "description": "Description of the revision." }, "skip_image_validation": { "type": "boolean", "default": false, "description": "Skip image reachability validation when creating the function. Useful when the container registry uses authentication that the provisioning service cannot access (e.g., ECR with IRSA where only the K8s cluster has credentials)." } } } ] }, "Function": { "allOf": [ { "$ref": "#/components/schemas/Resource" }, { "$ref": "#/components/schemas/FunctionBase" }, { "type": "object", "properties": { "last_revision_number": { "type": "integer", "minimum": 0, "description": "The latest revision number", "example": 69 }, "last_published_revision_number": { "type": "integer", "readOnly": true, "minimum": 0, "description": "The latest published revision number, or null if no revisions have been published", "example": 59 }, "container_registry_vrn": { "$ref": "#/components/schemas/VastRN" } } } ] }, "FunctionRevisionCreate": { "allOf": [ { "$ref": "#/components/schemas/ResourceCreate" }, { "type": "object", "properties": { "architecture": { "type": "string", "enum": [ "x86", "arm" ] }, "runtime": { "type": "string", "enum": [ "python-3.6", "python-3.7", "python-3.8", "python-3.9", "python-3.10", "python-3.11" ] }, "artifact_type": { "type": "string", "enum": [ "image" ], "default": "image", "description": "The type of the artifact provided with which the provisioning service is expected to run.\nRight now the only supported type is \"image\". Only relevant when function is created using source code and not container image.\n" }, "artifact_source": { "type": "string", "example": "docker.io/vast/helloworld-python", "description": "URL for user image or S3 bucket path to source code, Depending on Artifact type" }, "image_tag": { "type": "string", "description": "Tag of the container image in the container registry.", "example": "34" }, "container_registry_vrn": { "$ref": "#/components/schemas/VastRN" }, "is_published": { "type": "boolean", "default": false, "description": "If the function revision was not published yet, other users can't use it." } }, "required": [ "artifact_source", "container_registry_vrn" ] } ] }, "FunctionBase": { "properties": { "default_revision_number": { "type": "integer", "minimum": 0, "description": "The default revision number. If not provided, the latest revision will be used.", "example": 59 } } }, "Resource": { "allOf": [ { "$ref": "#/components/schemas/ResourceCreate" }, { "type": "object", "properties": { "id": { "$ref": "#/components/schemas/ReadOnlyID" }, "guid": { "$ref": "#/components/schemas/ReadOnlyGUID" }, "tenant_guid": { "$ref": "#/components/schemas/TenantID" }, "owner": { "$ref": "#/components/schemas/UserID" }, "created_at": { "type": "string", "readOnly": true, "format": "date-time", "description": "Timestamp when the resource was created.", "example": "2024-12-25 15:30:00+00:00" }, "updated_at": { "type": "string", "readOnly": true, "format": "date-time", "description": "Timestamp when the resource was last updated.", "example": "2024-12-28 18:00:00+00:00" }, "vrn": { "$ref": "#/components/schemas/VastRN" } } } ], "description": "Extends ResourceCreate with read-only fields." }, "VastRN": { "type": "string", "description": "A logical path for resource grouping and policy assignment. The structure of the logical path is: vast:dataengine::\nwhere resource type is one of: triggers / functions / pipelines / topics / kubernetes-clusters / container-registries / mtls-authentication-credentials.\n", "example": "vast:dataengine:functions:foo" }, "ErrorResponse": { "type": "object", "properties": { "detail": { "type": "string" }, "source": { "$ref": "#/components/schemas/ErrorSource" }, "code": { "type": "string", "description": "Optional machine-readable error code for clients to branch on instead of parsing `detail`." } } }, "ValidationErrorResponse": { "type": "object", "properties": { "detail": { "type": "string", "description": "String representation of a mapping between field names and error messages", "example": "{\"url\": \"URL must include a protocol\", \"port\": \"Port must be an integer\"}" } } }, "ResourceCreate": { "allOf": [ { "$ref": "#/components/schemas/ResourceUpdate" } ], "required": [ "name" ] }, "ReadOnlyID": { "type": "integer", "format": "int64", "readOnly": true, "description": "A globally unique identifier (ID) for the resource." }, "ReadOnlyGUID": { "type": "string", "readOnly": true, "format": "uuid", "description": "A globally unique identifier (GUID) for the resource.", "example": "a7f4aa24-a00d-4dc5-a113-2031eb8c2c79" }, "TenantID": { "$ref": "#/components/schemas/ReadOnlyGUID" }, "UserID": { "type": "object", "readOnly": true, "properties": { "id": { "type": "string", "description": "The unique identifier for the owner." }, "id_type": { "type": "string", "description": "The type of identifier for the owner.", "enum": [ "uid", "vid", "sid", "access_key", "sid_str", "login_name", "username" ] }, "name": { "type": "string", "description": "The presentable name of the owner" } }, "required": [ "id", "id_type" ], "description": "Represents the owner of the resource." }, "ErrorSource": { "type": "object", "description": "Represents the underlying problem that made Data Engine raise the error", "properties": { "source_type": { "type": "string", "description": "The component where the error happened", "example": "kubernetes | vms | vdb | registry" }, "source_name": { "type": "string", "description": "The name of the source compoenent", "example": "my-cluster" }, "inner_error": { "type": "string", "description": "The error message from the source component", "example": "Failed to connect to the cluster" } } }, "ResourceUpdate": { "additionalProperties": false, "type": "object", "properties": { "name": { "type": "string", "description": "A name for the resource.", "example": "naomis-resource" }, "description": { "type": "string", "description": "A description of the resource.", "example": "A good and detailed description that makes everyone understand." }, "tags": { "type": "array", "maxItems": 32, "description": "Custom tags for organizing and categorizing resources in the GUI.", "items": { "type": "string" }, "example": [ "tagA", "tagB", "tagC" ] } }, "description": "Defines a shared group of attributes to be found in all API resources." } }, "responses": { "BadRequestError": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "UnauthorizedError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "ForbiddenError": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "NotFoundError": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "ConflictError": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "ValidationError": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" } } } }, "InternalServerError": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } ````