Docs Home
Viewing docs for
Self-ManagedNot available for BYOC

REST API

On this page

This page covers the general structure of the deployment-related API resources for Ververica Platform: Self-Managed version 2.x. The API endpoints for these resources start with the /api prefix.

Swagger

We ship a Swagger web client that covers all of the Ververica Platform APIs.

  • Swagger web client: /swagger

The API is split into two parts with separate OpenAPI specifications:

  • Ververica Platform: /swagger.json
  • Application Manager: /api/swagger.json

You can select which spec you want to operate against in the upper right corner of the Swagger web client.

Resource Objects

All Deployment-related resources are scoped to a Namespace. Each resource is identified by a unique ID. If a resource is not addressable by name, it has to be addressed by its ID.

APIs

The following tables show which resources are available and how they are addressed for each of the APIs:

AppManager API

ResourceName-Addressable
Deployment
DeploymentDefaults
DeploymentTarget
Event
Job
Savepoint
SecretValue
SessionCluster

Platform API

ResourceName-Addressable
ApiTokens
Catalogs
CatalogConnectors
Connectors
Formats
SqlScripts
UdfArtifacts

Names

Any resource that can be addressed by name requires their name to be non-empty, unique within a Namespace and immutable. Furthermore, the following naming schemes apply:

  • DeploymentTarget & SecretValue
    • The maximum length of the name is 250 characters.
    • Alphanumeric characters (lower- and upper-case), hyphens, and underscores are allowed ([0-9a-zA-Z-_]).
    • Examples:
      • Resource_Name_01
      • resource-name-01
  • Any other resource
    • The maximum length of the name is 63 characters.
    • Only lower-case alphanumeric characters and hyphens are allowed to be used ([-0-9a-z]).
    • The name is not allowed to start or end with a hyphen.
    • Examples:
      • resource-name-01

Single Objects

Each managed resource object has the following structure:

YAML
1kind: ResourceKind
2apiVersion: v1
3metadata:
4...
5spec:
6...
7status:
8...

The metadata and spec parts of resources are managed by users whereas the status is fully managed by the system.

List Objects

List objects are returned via a List wrapper kind that holds objects in an items array, e.g. when listing Deployments you will receive a resource of kind DeploymentList with each Deployment being part of the items array.

YAML
1kind: KindList
2apiVersion: v1
3items:
4  - kind: Kind
5    metadata:
6      # ...
7    spec:
8      # ...

Content-Types

The API server expects requests to be made as JSON or YAML and responds as JSON or YAML, respectively. Please use the following media types for request content types (Content-Type header) and accepted responses (Accept header).

  • JSON: application/json
  • YAML: application/yaml

By default, the API will return JSON.

Resource Versions

The metadata.resourceVersion attribute of a Deployment resources specifies the current logical version of the resource. You can use this field to check whether a resource has been updated since your last request.

API Versioning

Each resource includes an apiVersion attribute that specifies the version of the object.

Any structural changes (such as renaming) to a resource require a major version upgrade. Therefore, you can assume that your API resources will not break as long as the version is not upgraded.

Minor changes to the API such as adding optional fields or deprecating fields may happen without a version upgrade. Such changes are treated as non-breaking by the API server and therefore do not require any intervention on your side.

Verbs

The Deployment-related APIs use traditional HTTP verbs for CRUD operations on resources. Currently, there is only support for PUT requests on certain resources.

GET

List resources or request a single resource.

BASH
1GET /api/v1/namespaces/<namespaceName>/<resourcePlural>
2
3GET /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceId>
4
5GET /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceName>

POST

Create a resource.

BASH
1POST /api/v1/namespaces/<namespaceName>/<resourcePlural>

PUT

Create or replace a resource (AKA upsert).

BASH
1PUT /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceName>

Currently, the only supported resources for this method are Deployment, DeploymentTarget, and SessionCluster.

PATCH

Selectively modify an existing resource.

BASH
1PATCH /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceId>
2
3PATCH /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceName>

Patch requests follow RFC 7386 by default. Specified attributes in the patch request are merged with existing attributes. If you want to remove an attribute, set it to null.

Example: Remove entries from flinkConfiguration

YAML
1spec:
2  template:
3    spec:
4      flinkConfiguration:
5        foo: null
6        bar: baz

The above request will modify the flinkConfiguration of a Deployment resource as follows:

  • Remove entry with key foo.
  • Add entry bar: baz.

DELETE

Delete a resource.

BASH
1DELETE /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceId>
2
3DELETE /api/v1/namespaces/<namespaceName>/<resourcePlural>/<resourceName>

Note that you can only delete resources that are managed by users.

Furthermore, certain resources will require the resource to be in a certain state before you can actually delete them (for instance a Deployment cannot be in state RUNNING when you try to delete it).

Responses

Validation Errors

Validation errors are wrapped in ApiValidationException resources.

YAML
1kind: ApiValidationException
2apiVersion: v1
3message: <message>
4statusCode: <statusCode>
5errors:
6  - attribute: <attribute>
7    message: <message>

The errors array contains each validation error.

API Errors

Generic API errors such as a not found resource or a bad request are wrapped in ApiException resources.

YAML
1kind: ApiException
2apiVersion: v1
3message: <message>
4reason: <reason>
5statusCode: <statusCode>
6context:
7  key1: value1

Reason is a short String describing the cause of the error. The context map provides optional context to the error.

Status Codes

  • 200: Successful GET request (get single resource or list).
  • 201: Successful POST request (resource created)
  • 400: Bad request (typically due to an ApiValidationException)
  • 401: Unauthorized (request needs authentication)
  • 403: Forbidden (request is not authorized)
  • 404: Resource not found (wrapped in ApiException)
  • 409: Conflict due to resource-specific constraints (wrapped in ApiException)
  • 500: Internal error (wrapped in ApiException)
  • 501: Not implemented due to configuration (wrapped in ApiException)
Was this helpful?