> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenfactory.nebius.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search file contents in image

> Regex content search inside the image's root filesystem, powered by ripgrep.

Symlinks are never followed during traversal, hidden files are searched,
`.gitignore`-style files inside the image are ignored, and binary files
(containing a NUL byte) are skipped. Rust regex syntax, linear-time matching.




## OpenAPI

````yaml https://eu-north.nebius.computer/static/api.yaml get /inspect/{image_uuid}/grep
openapi: 3.0.0
info:
  title: Contree API
  description: >
    Contree is a container management system combining virtual machine isolation
    with container operational efficiency. 

    Designed for security-sensitive workloads requiring hardware-enforced
    boundaries while maintaining

    container workflow compatibility.
  version: 1.0.0
servers:
  - url: '{baseUrl}/v1'
    description: |
      Nebius IAM-fronted endpoint (use `IAMBearerAuth` + `IAMProjectHeader`).
      Override `baseUrl` to point at a different deployment.
    variables:
      baseUrl:
        default: https://api.tokenfactory.nebius.com/sandboxes
        description: |
          Base URL of the contree service. Defaults to the public Nebius
          IAM-fronted endpoint; set to your self-hosted contree origin
          (e.g. `https://contree.example.com`) when running elsewhere.
security:
  - IAMBearerAuth: []
    IAMProjectHeader: []
tags:
  - name: images
    description: Operations related to container images
  - name: files
    description: Operations related to file uploads
  - name: instances
    description: Operations related to container instances
  - name: inspect
    description: Operations related to inspecting container images
  - name: operations
    description: Operations related to long-running operations
  - name: auth
    description: Authentication and token introspection
paths:
  /inspect/{image_uuid}/grep:
    get:
      tags:
        - inspect
      summary: Search file contents in image
      description: >
        Regex content search inside the image's root filesystem, powered by
        ripgrep.


        Symlinks are never followed during traversal, hidden files are searched,

        `.gitignore`-style files inside the image are ignored, and binary files

        (containing a NUL byte) are skipped. Rust regex syntax, linear-time
        matching.
      operationId: inspectImageGrep
      parameters:
        - name: image_uuid
          in: path
          required: true
          description: The UUID of the image to inspect
          schema:
            $ref: '#/components/schemas/UUIDSchema'
        - name: pattern
          in: query
          required: true
          allowReserved: true
          description: >-
            Regex pattern to search for. May be repeated (max 16); patterns are
            OR-ed. Max 1024 characters each.
          schema:
            type: string
            example: ^PermitRootLogin
        - name: path
          in: query
          required: false
          allowReserved: true
          description: >-
            File or directory to search inside the image. Defaults to the rootfs
            root.
          schema:
            type: string
            default: /
            example: /etc
        - name: glob
          in: query
          required: false
          allowReserved: true
          description: >-
            Glob to filter files (ripgrep -g semantics, "!" negates). May be
            repeated.
          schema:
            type: string
            example: '*.conf'
        - name: max_count
          in: query
          required: false
          description: Maximum matches per file (hard cap 10000).
          schema:
            type: integer
            minimum: 1
            maximum: 10000
        - name: max_total
          in: query
          required: false
          description: >-
            Maximum total matches across all files (default 1000, hard cap
            10000).
          schema:
            type: integer
            minimum: 1
            maximum: 10000
            default: 1000
        - name: case
          in: query
          required: false
          description: Case sensitivity mode.
          schema:
            type: string
            enum:
              - sensitive
              - insensitive
              - smart
            default: sensitive
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GrepResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            Not Found - The path does not exist in the image or image does not
            exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UUIDSchema:
      type: string
      format: uuid
      description: A UUID string
      example: 12345678-9abc-baba-deda-0123456789ab
    GrepResult:
      type: object
      required:
        - path
        - patterns
        - matches
        - truncated
      properties:
        path:
          type: string
          description: The path inside the image that was searched
          example: /etc
        patterns:
          type: array
          description: The patterns that were searched for
          items:
            type: string
          example:
            - ^PermitRootLogin
        matches:
          type: array
          items:
            $ref: '#/components/schemas/GrepMatch'
        truncated:
          type: boolean
          description: True when max_total or the search deadline stopped the search early
          example: false
    Error:
      type: object
      required:
        - error
      properties:
        error:
          oneOf:
            - type: string
            - type: object
            - type: array
              items:
                type: object
          description: Error message or structured validation errors
          example: Some error occurred, this is an example of error message
        status:
          type: integer
          description: HTTP status code
          example: 500
        traceback:
          type: array
          items:
            type: string
    GrepMatch:
      type: object
      required:
        - path
        - line_number
        - absolute_offset
        - line_text
        - line_bytes
        - submatches
      properties:
        path:
          type: string
          description: File path relative to the image rootfs
          example: /etc/ssh/sshd_config
        line_number:
          type: integer
          description: 1-based line number of the match
          example: 57
        absolute_offset:
          type: integer
          description: Byte offset of the line from the start of the file
          example: 1712
        line_text:
          type: string
          description: >-
            The matching line, including the line terminator (truncated at 4096
            bytes)
          example: |
            #PermitRootLogin prohibit-password
        line_bytes:
          type: integer
          description: >-
            Real byte length of the matching line; greater than line_text length
            when the line was capped
          example: 8192
        submatches:
          type: array
          items:
            $ref: '#/components/schemas/GrepSubmatch'
    GrepSubmatch:
      type: object
      required:
        - text
        - start
        - end
      properties:
        text:
          type: string
          description: The matched text
          example: PermitRootLogin
        start:
          type: integer
          description: Byte offset of the match start within the line
          example: 1
        end:
          type: integer
          description: Byte offset of the match end within the line
          example: 16
  responses:
    BadRequest:
      description: Bad Request - Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: |
        Unauthorized - Invalid or missing authentication credentials.
        Either the `Authorization` bearer token is missing or invalid, or
        the `Project` header is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden - Token does not have sufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IAMBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: IAM
      description: |
        IAM bearer token issued by the Nebius IAM service. Sent as
        `Authorization: Bearer <iam-token>`. Must be combined with the
        `Project` header (see `IAMProjectHeader`).

        This is the recommended authentication scheme for new clients.
    IAMProjectHeader:
      type: apiKey
      in: header
      name: Project
      description: |
        Nebius project ID associated with the IAM token. Required together
        with `IAMBearerAuth`. Identifies the project context the request is
        scoped to.

````