Sonatype Nexus · Capability

Sonatype Nexus Repository Manager — Cleanup policies

Sonatype Nexus Repository Manager — Cleanup policies. 5 operations. Lead operation: Get a list of existing policies. Self-contained Naftiko capability covering one Sonatype Nexus business surface.

Run with Naftiko Sonatype NexusCleanup policies

What You Can Do

GET
Getall — Get a list of existing policies
/v1/v1/cleanup-policies
POST
Create1 — Create a new policy
/v1/v1/cleanup-policies
DELETE
Deletepolicybyname — Delete cleanup policy
/v1/v1/cleanup-policies/{name}
GET
Getcleanuppolicybyname — Get a policy by name
/v1/v1/cleanup-policies/{name}
PUT
Update2 — Update existing policy
/v1/v1/cleanup-policies/{policyname}

MCP Tools

get-list-existing-policies

Get a list of existing policies

read-only idempotent
create-new-policy

Create a new policy

delete-cleanup-policy

Delete cleanup policy

idempotent
get-policy-name

Get a policy by name

read-only idempotent
update-existing-policy

Update existing policy

idempotent

Capability Spec

repository-cleanup-policies.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Sonatype Nexus Repository Manager — Cleanup policies
  description: 'Sonatype Nexus Repository Manager — Cleanup policies. 5 operations. Lead operation: Get a list of existing
    policies. Self-contained Naftiko capability covering one Sonatype Nexus business surface.'
  tags:
  - Sonatype Nexus
  - Cleanup policies
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    SONATYPE_NEXUS_API_KEY: SONATYPE_NEXUS_API_KEY
capability:
  consumes:
  - type: http
    namespace: repository-cleanup-policies
    baseUri: ''
    description: Sonatype Nexus Repository Manager — Cleanup policies business capability. Self-contained, no shared references.
    resources:
    - name: v1-cleanup-policies
      path: /v1/cleanup-policies
      operations:
      - name: getall
        method: GET
        description: Get a list of existing policies
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: create1
        method: POST
        description: Create a new policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: v1-cleanup-policies-name
      path: /v1/cleanup-policies/{name}
      operations:
      - name: deletepolicybyname
        method: DELETE
        description: Delete cleanup policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: name
          in: path
          type: string
          required: true
      - name: getcleanuppolicybyname
        method: GET
        description: Get a policy by name
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: name
          in: path
          type: string
          required: true
    - name: v1-cleanup-policies-policyName
      path: /v1/cleanup-policies/{policyName}
      operations:
      - name: update2
        method: PUT
        description: Update existing policy
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: policyName
          in: path
          type: string
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: basic
      username: '{{env.SONATYPE_NEXUS_USER}}'
      password: '{{env.SONATYPE_NEXUS_PASS}}'
  exposes:
  - type: rest
    namespace: repository-cleanup-policies-rest
    port: 8080
    description: REST adapter for Sonatype Nexus Repository Manager — Cleanup policies. One Spectral-compliant resource per
      consumed operation, prefixed with /v1.
    resources:
    - path: /v1/v1/cleanup-policies
      name: v1-cleanup-policies
      description: REST surface for v1-cleanup-policies.
      operations:
      - method: GET
        name: getall
        description: Get a list of existing policies
        call: repository-cleanup-policies.getall
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: create1
        description: Create a new policy
        call: repository-cleanup-policies.create1
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/cleanup-policies/{name}
      name: v1-cleanup-policies-name
      description: REST surface for v1-cleanup-policies-name.
      operations:
      - method: DELETE
        name: deletepolicybyname
        description: Delete cleanup policy
        call: repository-cleanup-policies.deletepolicybyname
        with:
          name: rest.name
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: getcleanuppolicybyname
        description: Get a policy by name
        call: repository-cleanup-policies.getcleanuppolicybyname
        with:
          name: rest.name
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/v1/cleanup-policies/{policyname}
      name: v1-cleanup-policies-policyname
      description: REST surface for v1-cleanup-policies-policyName.
      operations:
      - method: PUT
        name: update2
        description: Update existing policy
        call: repository-cleanup-policies.update2
        with:
          policyName: rest.policyName
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: repository-cleanup-policies-mcp
    port: 9090
    transport: http
    description: MCP adapter for Sonatype Nexus Repository Manager — Cleanup policies. One tool per consumed operation, routed
      inline through this capability's consumes block.
    tools:
    - name: get-list-existing-policies
      description: Get a list of existing policies
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repository-cleanup-policies.getall
      outputParameters:
      - type: object
        mapping: $.
    - name: create-new-policy
      description: Create a new policy
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: repository-cleanup-policies.create1
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-cleanup-policy
      description: Delete cleanup policy
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: repository-cleanup-policies.deletepolicybyname
      with:
        name: tools.name
      outputParameters:
      - type: object
        mapping: $.
    - name: get-policy-name
      description: Get a policy by name
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: repository-cleanup-policies.getcleanuppolicybyname
      with:
        name: tools.name
      outputParameters:
      - type: object
        mapping: $.
    - name: update-existing-policy
      description: Update existing policy
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: repository-cleanup-policies.update2
      with:
        policyName: tools.policyName
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.