Apache Ranger · Capability

Apache Ranger REST API — Policies

Apache Ranger REST API — Policies. 5 operations. Lead operation: Apache Ranger List Policies. Self-contained Naftiko capability covering one Apache Ranger business surface.

Run with Naftiko Apache RangerPolicies

What You Can Do

GET
Listpolicies — Apache Ranger List Policies
/v1/plugins/policies
POST
Createpolicy — Apache Ranger Create Policy
/v1/plugins/policies
GET
Getpolicy — Apache Ranger Get Policy
/v1/plugins/policies/{id}
PUT
Updatepolicy — Apache Ranger Update Policy
/v1/plugins/policies/{id}
DELETE
Deletepolicy — Apache Ranger Delete Policy
/v1/plugins/policies/{id}

MCP Tools

apache-ranger-list-policies

Apache Ranger List Policies

read-only idempotent
apache-ranger-create-policy

Apache Ranger Create Policy

apache-ranger-get-policy

Apache Ranger Get Policy

read-only idempotent
apache-ranger-update-policy

Apache Ranger Update Policy

idempotent
apache-ranger-delete-policy

Apache Ranger Delete Policy

idempotent

Capability Spec

rest-policies.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Apache Ranger REST API — Policies
  description: 'Apache Ranger REST API — Policies. 5 operations. Lead operation: Apache Ranger List Policies. Self-contained
    Naftiko capability covering one Apache Ranger business surface.'
  tags:
  - Apache Ranger
  - Policies
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    APACHE_RANGER_API_KEY: APACHE_RANGER_API_KEY
capability:
  consumes:
  - type: http
    namespace: rest-policies
    baseUri: https://ranger.example.com/service
    description: Apache Ranger REST API — Policies business capability. Self-contained, no shared references.
    resources:
    - name: plugins-policies
      path: /plugins/policies
      operations:
      - name: listpolicies
        method: GET
        description: Apache Ranger List Policies
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: serviceType
          in: query
          type: string
          description: Filter by service type (hdfs, hive, hbase, etc.)
        - name: serviceName
          in: query
          type: string
      - name: createpolicy
        method: POST
        description: Apache Ranger Create Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: plugins-policies-id
      path: /plugins/policies/{id}
      operations:
      - name: getpolicy
        method: GET
        description: Apache Ranger Get Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
      - name: updatepolicy
        method: PUT
        description: Apache Ranger Update Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
      - name: deletepolicy
        method: DELETE
        description: Apache Ranger Delete Policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
    authentication:
      type: basic
      username: '{{env.APACHE_RANGER_USER}}'
      password: '{{env.APACHE_RANGER_PASS}}'
  exposes:
  - type: rest
    namespace: rest-policies-rest
    port: 8080
    description: REST adapter for Apache Ranger REST API — Policies. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/plugins/policies
      name: plugins-policies
      description: REST surface for plugins-policies.
      operations:
      - method: GET
        name: listpolicies
        description: Apache Ranger List Policies
        call: rest-policies.listpolicies
        with:
          serviceType: rest.serviceType
          serviceName: rest.serviceName
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: createpolicy
        description: Apache Ranger Create Policy
        call: rest-policies.createpolicy
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/plugins/policies/{id}
      name: plugins-policies-id
      description: REST surface for plugins-policies-id.
      operations:
      - method: GET
        name: getpolicy
        description: Apache Ranger Get Policy
        call: rest-policies.getpolicy
        with:
          id: rest.id
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatepolicy
        description: Apache Ranger Update Policy
        call: rest-policies.updatepolicy
        with:
          id: rest.id
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: deletepolicy
        description: Apache Ranger Delete Policy
        call: rest-policies.deletepolicy
        with:
          id: rest.id
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: rest-policies-mcp
    port: 9090
    transport: http
    description: MCP adapter for Apache Ranger REST API — Policies. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: apache-ranger-list-policies
      description: Apache Ranger List Policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-policies.listpolicies
      with:
        serviceType: tools.serviceType
        serviceName: tools.serviceName
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-ranger-create-policy
      description: Apache Ranger Create Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: rest-policies.createpolicy
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-ranger-get-policy
      description: Apache Ranger Get Policy
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-policies.getpolicy
      with:
        id: tools.id
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-ranger-update-policy
      description: Apache Ranger Update Policy
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: rest-policies.updatepolicy
      with:
        id: tools.id
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: apache-ranger-delete-policy
      description: Apache Ranger Delete Policy
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: rest-policies.deletepolicy
      with:
        id: tools.id
      outputParameters:
      - type: object
        mapping: $.