Skip to main content
MeshModel components represent infrastructure and application building blocks in Meshery. They define Kubernetes resources, service mesh configurations, and other cloud native primitives.

List All Components

curl http://localhost:9081/api/meshmodels/components?page=0&pagesize=25
Method: GET Endpoint: /api/meshmodels/components

Query Parameters

page
integer
default:"0"
Page number for pagination
pagesize
string
default:"25"
Number of components per page. Use all to return all results.
Search term for component name
order
string
Field to order by
sort
string
default:"asc"
Sort direction: asc or desc
annotations
string
Filter by annotation components:
  • true - Only return annotation components
  • false - Exclude annotation components
  • Any other value - Return all components

Response

page
integer
Current page number
page_size
integer
Number of items per page
total_count
integer
Total number of components
components
array
Array of component objects
Example Response:
{
  "page": 0,
  "page_size": 25,
  "total_count": 5432,
  "components": [
    {
      "id": "component-uuid",
      "component": {
        "kind": "Deployment",
        "schema": "...",
        "version": "v1.0.0"
      },
      "displayName": "Deployment",
      "kind": "Deployment",
      "apiVersion": "apps/v1",
      "model": {
        "name": "kubernetes",
        "version": "v1.28.0",
        "category": "Orchestration & Management"
      }
    }
  ]
}

Get Components by Name

curl http://localhost:9081/api/meshmodels/components/{name}
Method: GET Endpoint: /api/meshmodels/components/{name}

Path Parameters

name
string
required
Component name (e.g., Deployment, Service, VirtualService)

Query Parameters

Same as List All Components endpoint.

Response

Returns all versions and variants of components matching the name.

Get Components by Category

curl "http://localhost:9081/api/meshmodels/categories/{category}/components?page=0&pagesize=25"
Method: GET Endpoint: /api/meshmodels/categories/{category}/components

Path Parameters

category
string
required
Category name (e.g., orchestration-and-management, observability)

Query Parameters

Same as List All Components endpoint.

Get Components by Model

curl "http://localhost:9081/api/meshmodels/models/{model}/components?page=0&pagesize=25"
Method: GET Endpoint: /api/meshmodels/models/{model}/components

Path Parameters

model
string
required
Model name (e.g., kubernetes, istio, nginx-ingress)

Query Parameters

version
string
Filter by model version
page
integer
default:"0"
Page number
pagesize
string
default:"25"
Page size
annotations
string
Filter annotation components

Get Components by Category and Model

curl "http://localhost:9081/api/meshmodels/categories/{category}/models/{model}/components"
Method: GET Endpoint: /api/meshmodels/categories/{category}/models/{model}/components

Path Parameters

category
string
required
Category name
model
string
required
Model name

Get Specific Component by Name, Model, and Category

curl "http://localhost:9081/api/meshmodels/categories/{category}/models/{model}/components/{name}"
Method: GET Endpoint: /api/meshmodels/categories/{category}/models/{model}/components/{name}

Path Parameters

category
string
required
Category name
model
string
required
Model name
name
string
required
Component name

Register Components

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "modelName": "my-model",
    "components": [
      {
        "kind": "MyComponent",
        "apiVersion": "v1",
        "schema": {...}
      }
    ]
  }' \
  http://localhost:9081/api/meshmodels/components
Method: POST Endpoint: /api/meshmodels/components

Request Body

modelName
string
required
Model name for the components
components
array
required
Array of component definitions to register

Response

Status: 200 OK Returns the registered components.

Update Component Status

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "id": "component-uuid",
    "status": "enabled"
  }' \
  http://localhost:9081/api/meshmodels/component/status
Method: POST Endpoint: /api/meshmodels/{entityType}/status

Path Parameters

entityType
string
required
Entity type (e.g., component, model, relationship)

Request Body

id
string
required
Component ID
status
string
required
New status: enabled or disabled

Validate Component

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "component": {...},
    "model": "kubernetes"
  }' \
  http://localhost:9081/api/meshmodels/validate
Method: POST Endpoint: /api/meshmodels/validate

Request Body

component
object
required
Component definition to validate
model
string
Model name

Response

Returns validation results including errors and warnings.

Generate Components

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "source": "kubernetes",
    "config": {...}
  }' \
  http://localhost:9081/api/meshmodels/generate
Method: POST Endpoint: /api/meshmodels/generate

Request Body

source
string
required
Source to generate components from (e.g., kubernetes, helm, openapi)
config
object
Configuration for component generation

Component Schema

Get the JSON schema for a specific component:
curl http://localhost:9081/api/schema/resource/{resourceName}
Method: GET Endpoint: /api/schema/resource/{resourceName}

Path Parameters

resourceName
string
required
Resource/component name

Response

Returns the JSON schema definition for the component.

Error Codes

400 Bad Request
error
Invalid request parameters or malformed JSON
404 Not Found
error
Component not found
500 Internal Server Error
error
Server error occurred

Build docs developers (and LLMs) love