Extensibility: APIs

Meshery’s APIs

Each of Meshery’s APIs are subject to the following authentication and authorization system.

Authentication

Requests to any of the API endpoints must be authenticated and include a valid JWT access token in the HTTP headers. Type of authentication is determined by the selected Provider. Use of the Local Provider, “None”, puts Meshery into single-user mode and does not require authentication.

Authorization

Currently, Meshery only requires a valid token in order to allow clients to invoke its APIs.

Endpoints

Each of the API endpoints are exposed through server.go. Endpoints are grouped by function (e.g. /api/mesh or /api/perf).

Alternatively, Remote Providers can extend Meshery’s endpoints behind the /api/extensions/ endpoint.

GraphQL

Meshery provides its GraphQl API at localhost:9081/api/system/graphql/query. A GraphQL request can be made as a POST request to the endpoint with the query as the payload.

Explore the Meshery GraphQL API using the interactive Playground provided with meshery instance at localhost:9081/api/system/graphql/playground.

Meshery GrahphQL API can be used to perform three operations:

  • Queries for data retrieval.
  • Mutations for creating, updating, and deleting data.
  • Subscriptions for watching for any data changes.

Queries

getAvailableAddons

Returns AddonList object.

Arguments

Name Type Description
selector MeshType Returns AddonList for that Service Mesh.

getControlPlanes

Returns ControlPlane object (used in Meshey Dashboard).

Arguments

Name Type Description
filter ControlPlaneFilter Filters Control Plane query.

getOperatorStatus

Returns OperatorStatus of Meshery Operator.

No Arguments needed.

getAvailableNamespaces

Returns non-empty array of NameSpace object, containing all the ns in your cluster.

No Arguments needed.

Mutations

changeAddonStatus

Returns Status object on successful mutation of AddonStatus for the given mesh.

Arguments

Name Type Description
selector MeshType The Service Mesh to mutate change on.
targetStatus Status! The `status` you want to mutate.

changeOperatorStatus

Returns Status object on successful mutation of Operator Status.

Arguments

Name Type Description
targetStatus Status! The `status` you want to mutate.

Subscriptions

listenToAddonState

Create a subscription, to return AddonList object, whenever it changes.

Arguments

Name Type Description
selector MeshType Watch AddonList for that Service Mesh.

listenToControlPlaneState

Create a subscription, to return ControlPlane object (used in Meshey Dashboard), whenever it changes.

Arguments

Name Type Description
filter ControlPlaneFilter Filters Control Plane query.

listenToControlPlaneState

Create a subscription to watch for OperatorStatus changes of Meshery Operator.

No Arguments needed.

listenToMeshSyncEvents

Create a subscription to watch for changes in NameSpace objects in your cluster.

No Arguments needed.

Object Types

NameSpace

Used to define a k8s namespace resource.

Arguments

Field Type
namespace String!

OperatorStatus

Return type for getOperatorStatus and listenToOperatorState.

Arguments

Field Type
status Status!
version String!
controllers [OperatorControllerStatus!]!
error Error

OperatorControllerStatus

Used to define the status of controllers in Meshery Operator.

Arguments

Field Type
name String!
version String!
status Status!
error Error

ControlPlaneFilter

Input type for getControlPlanes and listenToControlPlaneState.

Arguments

Field Type
type MeshType!

ControlPlane

Return type for getControlPlanes and listenToControlPlaneState.

Arguments

Field Type
name String!
members [ControlPlaneMember!]!

ControlPlaneMember

Used to define various resource present in a Service Mesh.

Arguments

Field Type
name String!
component String!
version String!
namespace String!

AddonList

Return type for getAvailableAddons and listenToAddonState.

Arguments

Field Type
name String!
owner String!
endpoint String!

Error

Used to define an error.

Arguments

Field Type
code String!
description String!

Enumeration Types

MeshType

The type of the Service Mesh.

Arguments

Value Description
ISTIO `ISTIO` Service Mesh
LINKERD `LINKERD` Service Mesh
CONSUL `CONSUL` Service Mesh
OCTARINE `OCTARINE` Service Mesh
TRAEFIKMESH `TRAEFIKMESH` Service Mesh
OSM `OSM` Service Mesh
KUMA `KUMA` Service Mesh
NGINXSM `NGINXSM` Service Mesh
NSM `NSM` Service Mesh
CITRIX `CITRIX` Service Mesh

Status

State of a controller.

Arguments

Value Description
ENABLED Indicates whether the feature enabled.
DISABLED Indicates whether the feature disabled.
PROCESSING Indicates whether the feature is still processing.
UNKNOWN Indicates whether the feature is unknown.

REST

Meshery provides a REST API available through the default port of 9081/tcp.