#%RAML 1.0

title: API-Vitam Version Alpha - Metadata interne
version: v1
baseUri: http://metadata.internal.vitam.gouv.fr/{version}
protocols: [ HTTP ]

uses:
  StandardTypes: libraries/StandardTypes.raml
  StandardTraits: libraries/StandardTraits.raml
  AccessTypes: libraries/AccessTypes.raml
  AccessTraits: libraries/AccessTraits.raml
  DslTypes: libraries/DslTypes.raml

securitySchemes:
  VitamPlatform: !include securitySchemes/SecuritySchemeVitamInternal.raml

securedBy: [ VitamPlatform ]

mediaType: application/json

types:
  _reserved:
    type: string

documentation:
  - title: Avertissements
    content: !include docs-fr/avertissement.md

  - title: Licence
    content: !include docs-fr/license.md

  - title: API Metadata
    content: API Metadata

/units:
  displayName: ArchiveUnits
  description: |
   API qui définit les requêtes pour accéder aux Unités d'archives.
   La requête utilise le langage de requête (DSL) de Vitam en entrée et retourne une liste d'Unités d'archives selon le DSL Vitam en cas de succès.
  get:
    description: Request that will return results composed of Units
    is: [AccessTraits.AccessUnitResponse]
  post:
    description: |
      Request that will return results composed of Units. The request is using POST with X-Http-Method-Override: GET
    is: [AccessTraits.AccessUnitResponse, StandardTraits.OverrideGet]
    headers:
      X-Http-Method-Override:
        required: true
  put:
    description: Request that will update a set of Units according to the query and the filter parts. The actions to be applied on the set of Units are specified in the action part of the request.
    is: [AccessTraits.AccessUpdateUnitResponse]

  /{idu}:
    displayName: ArchiveUnit
    description: |
     API qui définit les requêtes pour accéder aux Unités d'archives à partir d'une Unité donnée (racine).
     La requête utilise le langage de requête (DSL) de Vitam en entrée et retourne une liste d'Unités d'archives selon le DSL Vitam en cas de succès.
    get:
      description: Request that will return results composed of Units
      is: [AccessTraits.AccessUnitResponse]
    post:
      description: |
        Request that will return results composed of Units. The request is using POST with X-Http-Method-Override: GET
      is: [AccessTraits.CreateOrSelectUnitResponse, StandardTraits.OverrideGet]
      headers:
        X-Http-Method-Override:
          required: true
    head:
      description: Test the existence of this Unit
      is: [StandardTraits.StandardOptionalHeader, StandardTraits.StandardHeadHeader,
        StandardTraits.StandardHeader204, StandardTraits.StandardHeader404,
        StandardTraits.StandardHeader417]
    put:
      description: Request that will update a set of Units according to the query and the filter parts. The actions to be applied on the set of Units are specified in the action part of the request. In this case this update is to be applied for only one Unit (the one specified in the URI).
      is: [AccessTraits.AccessUpdateUnitResponse]
    delete:
      description: Request to destroy one Unit
      is: [AccessTraits.AccessDeleteUnitResponse]

    /objectgroup:
      displayName: ObjectGroup of 1 ArchiveUnit
      description: |
       API qui définit les requêtes pour accéder à l'Objet d'archives associé à l'Unité  d'archives s'il existe.
       La requête utilise le langage de requête (DSL) de Vitam en entrée et retourne l'objet d'archives selon le DSL Vitam en cas de succès.
      get:
        description: Request that will return results composed of Objects (generally 1)
        is: [AccessTraits.AccessUniqueObjectQualifierResponse, AccessTraits.AccessUniqueObjectResponse]
      post:
        description: |
          Request that will return results composed of Objects (generally 1). The request is using POST with X-Http-Method-Override: GET
        is: [AccessTraits.AccessUniqueObjectQualifierResponse, AccessTraits.AccessUniqueObjectResponse, StandardTraits.OverrideGet]
        headers:
          X-Http-Method-Override:
            required: true
      head:
        description: Test the existence of this Object
        is: [AccessTraits.AccessUniqueObjectQualifierHeadResponse, StandardTraits.StandardHeadHeader,
        StandardTraits.StandardHeader204,
        StandardTraits.StandardHeader417]
      put:
        description: Request to add one ObjectGroup to this Unit
        is: [AccessTraits.AccessUpdateObjectResponse]


/objects:
  displayName: Objects
  description: |
   API qui définit les requêtes pour accéder aux Objets d'archives.
   La requête utilise le langage de requête (DSL) de Vitam en entrée et retourne une liste d'Objets d'archives selon le DSL Vitam en cas de succès.
  get:
    description: Request that will return results composed of Objects
    is: [AccessTraits.AccessObjectResponse]
  post:
    description: |
      Request that will return results composed of Objects. The request is using POST with X-Http-Method-Override: GET
    is: [AccessTraits.AccessObjectResponse, StandardTraits.OverrideGet]
    headers:
      X-Http-Method-Override:
        required: true

  /{ido}:
    displayName: Object
    description: |
     API qui définit les requêtes pour accéder aux Objets d'archives à partir d'un Objet d'archives donné (racine).
     La requête utilise le langage de requête (DSL) de Vitam en entrée et retourne une liste d'Objets d'archives selon le DSL Vitam en cas de succès.
    get:
      description: Request that will return results composed of Objects (generally 1)
      is: [AccessTraits.AccessUniqueObjectQualifierResponse, AccessTraits.AccessObjectResponse]
    post:
      description: |
        Request that will return results composed of Objects (generally 1). The request is using POST with X-Http-Method-Override: GET
      is: [AccessTraits.AccessUniqueObjectQualifierResponse, AccessTraits.CreateOrSelectObjectResponse, StandardTraits.OverrideGet]
      headers:
        X-Http-Method-Override:
          required: true
    head:
      description: Test the existence of this Object
      is: [AccessTraits.AccessUniqueObjectQualifierHeadResponse, StandardTraits.StandardHeadHeader,
      StandardTraits.StandardHeader204,
      StandardTraits.StandardHeader417]
    put:
      description: Request to update one ObjectGroup
      is: [AccessTraits.AccessUpdateObjectResponse]
    delete:
      description: Request to delete one ObjectGroup
      is: [AccessTraits.AccessDeleteObjectResponse]

/raw:
  displayName: Raw
  description: |
    API d'accès aux métadonnées en mode brut (pas de traduction Vitam).

  /units/{id_unit}:
    displayName: Unit access by id
    description:  |
     Récupère un Unit.

    get:
      description : |
        Get a Unit
      is: [AccessTraits.AccessUnitRawResponse]

  /objectgroups/{id_og}:
    displayName: Object Group access by id
    description:  |
     Récupère un Groupe d'Objet.

    get:
      description : |
        Get an Object
      is: [AccessTraits.AccessObjectRawResponse]

/status:
  get:
    is: [ StandardTraits.Status, StandardTraits.StandardHeader200,
      StandardTraits.StandardHeader401, StandardTraits.StandardHeader404, StandardTraits.StandardHeader503 ]
