OpenSearch · Capability

OpenSearch Security Plugin REST API — Tenants

OpenSearch Security Plugin REST API — Tenants. 5 operations. Lead operation: List all tenants. Self-contained Naftiko capability covering one Opensearch business surface.

Run with Naftiko OpensearchTenants

What You Can Do

GET
Listtenants — List all tenants
/v1/plugins/security/api/tenants
GET
Gettenant — Get tenant
/v1/plugins/security/api/tenants/{name}
PUT
Createorreplacetenant — Create or replace a tenant
/v1/plugins/security/api/tenants/{name}
DELETE
Deletetenant — Delete tenant
/v1/plugins/security/api/tenants/{name}
PATCH
Patchtenant — Patch tenant
/v1/plugins/security/api/tenants/{name}

MCP Tools

list-all-tenants

List all tenants

read-only idempotent
get-tenant

Get tenant

read-only idempotent
create-replace-tenant

Create or replace a tenant

idempotent
delete-tenant

Delete tenant

idempotent
patch-tenant

Patch tenant

idempotent

Capability Spec

security-tenants.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: OpenSearch Security Plugin REST API — Tenants
  description: 'OpenSearch Security Plugin REST API — Tenants. 5 operations. Lead operation: List all tenants. Self-contained
    Naftiko capability covering one Opensearch business surface.'
  tags:
  - Opensearch
  - Tenants
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    OPENSEARCH_API_KEY: OPENSEARCH_API_KEY
capability:
  consumes:
  - type: http
    namespace: security-tenants
    baseUri: https://{cluster-host}:9200
    description: OpenSearch Security Plugin REST API — Tenants business capability. Self-contained, no shared references.
    resources:
    - name: _plugins-_security-api-tenants
      path: /_plugins/_security/api/tenants
      operations:
      - name: listtenants
        method: GET
        description: List all tenants
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: _plugins-_security-api-tenants-name
      path: /_plugins/_security/api/tenants/{name}
      operations:
      - name: gettenant
        method: GET
        description: Get tenant
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createorreplacetenant
        method: PUT
        description: Create or replace a tenant
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletetenant
        method: DELETE
        description: Delete tenant
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: patchtenant
        method: PATCH
        description: Patch tenant
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    authentication:
      type: basic
      username: '{{env.OPENSEARCH_USER}}'
      password: '{{env.OPENSEARCH_PASS}}'
  exposes:
  - type: rest
    namespace: security-tenants-rest
    port: 8080
    description: REST adapter for OpenSearch Security Plugin REST API — Tenants. One Spectral-compliant resource per consumed
      operation, prefixed with /v1.
    resources:
    - path: /v1/plugins/security/api/tenants
      name: plugins-security-api-tenants
      description: REST surface for _plugins-_security-api-tenants.
      operations:
      - method: GET
        name: listtenants
        description: List all tenants
        call: security-tenants.listtenants
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/plugins/security/api/tenants/{name}
      name: plugins-security-api-tenants-name
      description: REST surface for _plugins-_security-api-tenants-name.
      operations:
      - method: GET
        name: gettenant
        description: Get tenant
        call: security-tenants.gettenant
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: createorreplacetenant
        description: Create or replace a tenant
        call: security-tenants.createorreplacetenant
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletetenant
        description: Delete tenant
        call: security-tenants.deletetenant
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: patchtenant
        description: Patch tenant
        call: security-tenants.patchtenant
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: security-tenants-mcp
    port: 9090
    transport: http
    description: MCP adapter for OpenSearch Security Plugin REST API — Tenants. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: list-all-tenants
      description: List all tenants
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: security-tenants.listtenants
      outputParameters:
      - type: object
        mapping: $.
    - name: get-tenant
      description: Get tenant
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: security-tenants.gettenant
      outputParameters:
      - type: object
        mapping: $.
    - name: create-replace-tenant
      description: Create or replace a tenant
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: security-tenants.createorreplacetenant
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-tenant
      description: Delete tenant
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: security-tenants.deletetenant
      outputParameters:
      - type: object
        mapping: $.
    - name: patch-tenant
      description: Patch tenant
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: security-tenants.patchtenant
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.