<commit_before>#%RAML 0.8
title: Okapi Core API
version: 0.1
baseUri: https://okapi.io
## mediaType:  application/json
schemas:
  - ModuleDescriptor: !include ModuleDescriptor.json
  - TenantDescriptor: !include TenantDescriptor.json
  - TenantModuleDescriptor: !include TenantModuleDescriptor.json
  - TenantModules: !include TenantModules.json

#resourceTypes:
#traits:

# The following are a set of APIs that module web service must accept/consume
# to allow okapi environment to orchestrate it
#
# This version assumes that a module instance may be shared by multiple
# tenants, e.g we have a global set of module instances

# TODO we will most likely need a web service to list and browse module types

/_/modules:
  post:
    description: Creates an instance of a given module type, includes all
      necessary mechanics to put the module into operation (launching
      a process, binding to a port, setting up routing)
     # most likely we will want to read some initial configuration
    body:
      application/json:
        schema: ModuleDescriptor
    responses:
      201:
        headers:
          Location:
            description: URI to the created module instance
  /{module_id}:
    get:
      description: Retrieve information about the module instance
      responses:
        200:
          body:
            application/json:
              schema: ModuleDescriptor
    delete:
      description: Remove module instance from operation
        (shutdown process etc)
      responses:
        204:


/_/tenants:
  post:
    description: create a new tenant
    body:
      application/json:
        schema: TenantDescriptor
    responses:
      201:
        description: tenant has been created
        headers:
          Location:
            description: URI to the created tenant

  /{tenant_id}:
    get:
      description: retrieve tenant
      responses:
        200:
          body:
            application/json:
              schema: TenantDescriptor
    delete:
      description: remove tenant

    /modules:
      get:
        description: Map of module instances accessible by the tenant
        responses:
          200:
            body:
              application/json:
                schema: TenantModules
      post:
        description: Link a module instance to the specified tenant
        body:
          application/json:
            schema: TenantModuleDescriptor

      /{module_tenant_id}:
        get:
          description: look up tenant-module mapping
          responses:
            200:
              body:
                application/json:
                  schema: TenantModuleDescriptor
        delete:
          description: remove tenant-module registration

/_/health:
  get:
    description: health status
    responses:
      200:
        description: guess what
<commit_msg>Towards #51: Add the PUT to RAML. Also, update POST response<commit_after>#%RAML 0.8
title: Okapi Core API
version: 0.1
baseUri: https://okapi.io
## mediaType:  application/json
schemas:
  - ModuleDescriptor: !include ModuleDescriptor.json
  - TenantDescriptor: !include TenantDescriptor.json
  - TenantModuleDescriptor: !include TenantModuleDescriptor.json
  - TenantModules: !include TenantModules.json

#resourceTypes:
#traits:

# The following are a set of APIs that module web service must accept/consume
# to allow okapi environment to orchestrate it
#
# This version assumes that a module instance may be shared by multiple
# tenants, e.g we have a global set of module instances

# TODO we will most likely need a web service to list and browse module types

/_/modules:
  post:
    description: Creates an instance of a given module type, includes all
      necessary mechanics to put the module into operation (launching
      a process, binding to a port, setting up routing)
     # most likely we will want to read some initial configuration
    body:
      application/json:
        schema: ModuleDescriptor
    responses:
      201:
        headers:
          Location:
            description: URI to the created module instance
        body:
          application/json:
            schema: ModuleDescriptor
  /{module_id}:
    get:
      description: Retrieve information about the module instance
      responses:
        200:
          body:
            application/json:
              schema: ModuleDescriptor
    put:
      description: Update the module instance.
      responses:
        200:
          body:
            application/json:
              schema: ModuleDescriptor
    delete:
      description: Remove module instance from operation
        (shutdown process etc)
      responses:
        204:


/_/tenants:
  post:
    description: create a new tenant
    body:
      application/json:
        schema: TenantDescriptor
    responses:
      201:
        description: tenant has been created
        headers:
          Location:
            description: URI to the created tenant
        body:
          application/json:
            schema: TenantDescriptor

  /{tenant_id}:
    get:
      description: retrieve tenant
      responses:
        200:
          body:
            application/json:
              schema: TenantDescriptor
    put:
      description: update tenant
      responses:
        200:
          body:
            application/json:
              schema: TenantDescriptor
    delete:
      description: remove tenant

    /modules:
      get:
        description: Map of module instances accessible by the tenant
        responses:
          200:
            body:
              application/json:
                schema: TenantModules
      post:
        description: Link a module instance to the specified tenant
        body:
          application/json:
            schema: TenantModuleDescriptor

      /{module_tenant_id}:
        get:
          description: look up tenant-module mapping
          responses:
            200:
              body:
                application/json:
                  schema: TenantModuleDescriptor
        delete:
          description: remove tenant-module registration

/_/health:
  get:
    description: health status
    responses:
      200:
        description: guess what

{'fraction_non_alphanumeric': 0.054598163955548396, 'fraction_numerical': 0.010307617973908842, 'mean_word_length': 2.033707865168539, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7040581', 'n_tokens_mistral': 1546, 'n_tokens_neox': 1493, 'n_words': 574}