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

# Materialise resource attribution

> Persist one complete attribution observation from an OpenStack agent.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml post /api/v1/inventory/resource-attributions/materialise/
openapi: 3.0.3
info:
  title: Fleet Manager API
  version: 1.0.0
  description: API for the Nscale Fleet Manager
servers: []
security: []
paths:
  /api/v1/inventory/resource-attributions/materialise/:
    post:
      tags:
        - Inventory
      summary: Materialise resource attribution
      description: Persist one complete attribution observation from an OpenStack agent.
      operationId: materialise_resource_attribution
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceAttributionMaterialise'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ResourceAttributionMaterialise'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ResourceAttributionMaterialise'
        required: true
      responses:
        '204':
          description: No response body
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication credentials were not provided or are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAttributionMaterialiseError'
          description: ''
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceAttributionMaterialiseError'
          description: ''
      security:
        - oauth2:
            - resource-attribution:write
        - cookieAuth: []
components:
  schemas:
    ResourceAttributionMaterialise:
      type: object
      description: Write contract used by the OpenStack agent for one attribution snapshot.
      properties:
        device_id:
          type: string
          format: uuid
        nova_server_uuid:
          type: string
        environment:
          type: string
        openstack_region_name:
          type: string
        resolution_status:
          allOf:
            - $ref: '#/components/schemas/ResolutionStatusEnum'
          default: unresolved
        source_observed_at:
          type: string
          format: date-time
        last_attempted_at:
          type: string
          format: date-time
          nullable: true
        last_resolved_at:
          type: string
          format: date-time
          nullable: true
        stale_since:
          type: string
          format: date-time
          nullable: true
        failure_code:
          type: string
          default: ''
        diagnostic_detail:
          type: string
          default: ''
        issues:
          type: array
          items:
            $ref: '#/components/schemas/ResourceAttributionIssueWrite'
        uni_instance:
          allOf:
            - $ref: '#/components/schemas/UNIInstanceWrite'
          nullable: true
        placement:
          allOf:
            - $ref: '#/components/schemas/PlacementWrite'
          nullable: true
        kubernetes_clusters:
          type: array
          items:
            $ref: '#/components/schemas/KubernetesClusterWrite'
      required:
        - device_id
        - environment
        - nova_server_uuid
        - openstack_region_name
        - source_observed_at
    ErrorResponse:
      type: object
      description: >-
        Uniform error body for every 4xx/5xx response. `detail` is a
        human-readable message, always present, safe to display to end users.
        `code` is the machine-readable identifier. `field_errors` lists
        per-input-field validation messages and is empty for non-field errors
        (auth, permission, not-found, conflict, server).
      required:
        - detail
        - code
        - field_errors
      properties:
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCodeEnum'
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    ResourceAttributionMaterialiseError:
      type: object
      description: Error returned when an attribution write is obsolete.
      properties:
        detail:
          type: string
      required:
        - detail
    ResolutionStatusEnum:
      enum:
        - pending
        - unassigned
        - resolved
        - partially_resolved
        - unresolved
        - stale
      type: string
      description: |-
        * `pending` - Pending
        * `unassigned` - Unassigned
        * `resolved` - Resolved
        * `partially_resolved` - Partially resolved
        * `unresolved` - Unresolved
        * `stale` - Stale
    ResourceAttributionIssueWrite:
      type: object
      description: Machine-readable attribution issue supplied by an agent.
      properties:
        resource_kind:
          $ref: '#/components/schemas/ResourceKindEnum'
        code:
          type: string
          maxLength: 100
        retryable:
          type: boolean
          default: false
        diagnostic_detail:
          type: string
          default: ''
      required:
        - code
        - resource_kind
    UNIInstanceWrite:
      type: object
      description: Common freshness fields for an observed resource in a write payload.
      properties:
        status:
          $ref: '#/components/schemas/ObservedResourceStatusEnum'
        observed_at:
          type: string
          format: date-time
          nullable: true
        last_attempted_at:
          type: string
          format: date-time
          nullable: true
        last_resolved_at:
          type: string
          format: date-time
          nullable: true
        stale_since:
          type: string
          format: date-time
          nullable: true
        uni_instance_id:
          type: string
          maxLength: 255
        uni_server_id:
          type: string
          maxLength: 255
        organisation_id:
          type: string
          maxLength: 255
        region_id:
          type: string
          maxLength: 255
        project_id:
          type: string
          default: ''
          maxLength: 255
      required:
        - organisation_id
        - region_id
        - uni_instance_id
        - uni_server_id
    PlacementWrite:
      type: object
      description: Common freshness fields for an observed resource in a write payload.
      properties:
        status:
          $ref: '#/components/schemas/ObservedResourceStatusEnum'
        observed_at:
          type: string
          format: date-time
          nullable: true
        last_attempted_at:
          type: string
          format: date-time
          nullable: true
        last_resolved_at:
          type: string
          format: date-time
          nullable: true
        stale_since:
          type: string
          format: date-time
          nullable: true
        placement_id:
          type: string
          maxLength: 255
        placement_server_id:
          type: string
          maxLength: 255
        reservation_id:
          type: string
          default: ''
          maxLength: 255
        managed_by:
          type: string
          default: ''
          maxLength: 255
        owner_id:
          type: string
          default: ''
          maxLength: 255
        organisation_id:
          type: string
          default: ''
          maxLength: 255
        region_id:
          type: string
          default: ''
          maxLength: 255
        project_id:
          type: string
          default: ''
          maxLength: 255
      required:
        - placement_id
        - placement_server_id
    KubernetesClusterWrite:
      type: object
      description: Common freshness fields for an observed resource in a write payload.
      properties:
        status:
          $ref: '#/components/schemas/ObservedResourceStatusEnum'
        observed_at:
          type: string
          format: date-time
          nullable: true
        last_attempted_at:
          type: string
          format: date-time
          nullable: true
        last_resolved_at:
          type: string
          format: date-time
          nullable: true
        stale_since:
          type: string
          format: date-time
          nullable: true
        cluster_id:
          type: string
          maxLength: 255
        organisation_id:
          type: string
          maxLength: 255
        project_id:
          type: string
          maxLength: 255
        project_name:
          type: string
          maxLength: 255
        region_id:
          type: string
          default: ''
          maxLength: 255
      required:
        - cluster_id
        - organisation_id
        - project_id
        - project_name
    ErrorCodeEnum:
      type: string
      description: >-
        Stable machine-readable error identifier. New members may be added
        within this API version; clients must tolerate unknown values.
      enum:
        - error
        - invalid
        - parse_error
        - authentication_failed
        - not_authenticated
        - permission_denied
        - not_found
        - method_not_allowed
        - not_acceptable
        - unsupported_media_type
        - conflict
        - enrollment_infrastructure_reference_pending
        - enrollment_infrastructure_reference_changed
        - unprocessable_entity
        - throttled
        - service_unavailable
    FieldError:
      type: object
      description: One input field's validation messages.
      required:
        - field
        - messages
      properties:
        field:
          type: string
          description: >-
            Dotted path to the offending input field, or to the collection row
            when the whole row is invalid (e.g. `filters.end_date`,
            `memberships.0.role`, `memberships.0`).
        messages:
          type: array
          minItems: 1
          items:
            type: string
    ResourceKindEnum:
      enum:
        - uni_instance
        - placement
        - kubernetes_cluster
      type: string
      description: |-
        * `uni_instance` - UNI instance
        * `placement` - Placement
        * `kubernetes_cluster` - Kubernetes cluster
    ObservedResourceStatusEnum:
      enum:
        - resolved
        - stale
      type: string
      description: |-
        * `resolved` - Resolved
        * `stale` - Stale
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.