Sort API docs endpoints alphabetically

Sort API docs endpoints alphabetically

#%RAML 0.8
# vim: set ft=yaml:
title: OpenShift 3
version: v1beta1
baseUri: http://localhost:8080/osapi/{version}
mediaType: application/json
documentation:
 - title: Overview
   content: |
    The OpenShift 3.x model attempts to expose underlying Docker and Kubernetes
    models as accurately as possible, with a focus on easy composition of
    applications by a developer (install Ruby, push code, add MySQL).

    Unlike 2.x, more flexibility of configuration is exposed after creation in
    all aspects of the model. Terminology is still being weighed, but the
    concept of an application as a separate object is being removed in favor of
    more flexible composition of "services" - allowing two web containers to
    reuse a DB, or expose a DB directly to the edge of the network. The
    existing API will continue to be supported through 3.x, with concepts
    mapped as closely as possible to the new model.

 - title: Kubernetes API
   content: |
    OpenShift exposes [Kubernetes API](http://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/kubernetes.html) at http://localhost:8080/api/v1beta1/.

/aliases:
  displayName: /aliases (NOT IMPLEMENTED)
  get:
    description: |
      List all aliases visible to you.

      Aliases in v3 perform the same function as aliases in v2. The main difference
      is that in v3 an alias is associated with a service, not an application.
    queryParameters:
      serviceID:
        description: filter aliases by associated service.
    responses:
      200:
        body:
          example: !include examples/aliases.json
  post:
    description: Create an alias for this service.
    body:
      example: !include examples/alias.json

  /{aliasID}:
    get:
      description: Get a specific alias.
      body:
        example: !include examples/alias.json
    put:
      description: Update a specific alias.
      body:
        example: !include examples/alias.json
    delete:
      description: Delete a specific alias.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/buildConfigHooks/{buildID}/{secret}/{plugin}:
  post:
    description: |
      Webhook on push event from external repository.

      buildID specifies which build to trigger, whereas plugin defines source of
      the request, this might be github, bitbucket or others.
    responses:
      204:
        description: No content

/buildConfigs:
  get:
    description: |
      List all BuildConfigs.

      BuildConfig contains the inputs needed to produce a new deployable image.
    responses:
      200:
        body:
          example: !include examples/buildConfigs.json
  post:
    description: Create a new build.
    body:
      example: !include examples/create_buildConfig.json

  /{configID}:
    get:
      description: Get a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/buildConfig.json
    put:
      description: Update a specific build configuration.
      body:
        example: !include examples/buildConfig.json
    delete:
      description: Delete a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/builds:
  get:
    description: |
      List all builds.

      Build encapsulates the inputs needed to produce a new deployable image, as well as
      the status of the operation and a reference to the Pod which runs the build.
    responses:
      200:
        body:
          example: !include examples/builds.json
  post:
    description: Create a new build.
    body:
      example: !include examples/create_build.json

  /{buildID}:
    get:
      description: Get details about a specific build.
      responses:
        200:
          body:
            example: !include examples/build.json
    put:
      description: Update a specific build.
      body:
        example: !include examples/build.json
    delete:
      description: Delete a specific build.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/configs:
  displayName: /configs (NOT IMPLEMENTED)
  get:
    description: |
      List all configs that your account has access to.

      A config defines 0..n Kubernetes resources.
    responses:
      200:
  post:
    description: Create a new config.
    body:
      schema: !include doc/config-schema.json
      example: !include examples/config.json
    responses:
      200:
        body:
          example: !include examples/status-success.json

  /{configID}:
    get:
      description: Get a specific config.
      responses:
        200:
          body:
            example: !include examples/config.json
    put:
      description: Update a specific config.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    delete:
      description: Delete a specific config.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/deploymentConfigs:
  get:
    description: |
      List all DeploymentConfigs.

      A DeploymentConfig represents a configuration for a single deployment
      of a replication controller: a template for the deployment, how new
      deployments are triggered, what the current deployed state is.
    responses:
      200:
        body:
          example: !include examples/deploymentConfigs.json
  post:
    description: Create a new build.
    body:
      example: !include examples/status-success.json

  /{configID}:
    get:
      description: Get a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/deploymentConfig.json
    put:
      description: Update a specific build configuration.
      body:
        example: !include examples/deploymentConfig.json
    delete:
      description: Delete a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/deployments:
  get:
    description: |
      List all deployments.

      A deployment represents a single unique realization of a deployment config.
    responses:
      200:
        body:
          example: !include examples/deployments.json
  post:
    description: Create a new deployment.
    body:
      example: !include examples/deployment.json

  /{deploymentID}:
    get:
      description: Get details about a specific deployment.
      responses:
        200:
          body:
            example: !include examples/deployment.json
    put:
      description: Update a specific deployment.
      body:
        example: !include examples/deployment.json
    delete:
      description: Delete a specific deployment.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/imageRepositories:
  get:
    description: |
      List all image repositories.

      An image repository is a collection of images that share the same metadata. It may
      reference a Docker image repository on a Docker registry, but this is optional. An
      image repository also contains a mapping of tags to images.
    responses:
      200:
        body:
          example: !include examples/image-repositories.json
  post:
    description: Create a new image repository.
    body:
      example: !include examples/create-image-repository.json

  /{repositoryID}:
      get:
        description: Get information about a specific image repository.
        body:
          example: !include examples/image-repository.json
      put:
        description: Update an image repository.
        body:
          example: !include examples/image-repository.json
      delete:
        description: Delete an image repository.
        responses:
          200:
            body:
              example: !include examples/status-success.json

/imageRepositoryMappings:
  post:
    description: |
      Create an image and update an image repository.

      This is designed as a webhook that a Docker registry can invoke when a
      new tag is created. The image repository mapping contains a reference
      to the repository, the image's metadata, and the name of the new tag.
      Upon execution, a new image is created if it doesn't already exist, and
      the image repository is updated with the new tag.
    body:
      example: !include examples/create-image-repository-mapping.json

/images:
  get:
    description: |
      List all images.

      An image is a reference to an image in a Docker image repository on a Docker
      registry, plus a set of metadata. The metadata that Openshift stores for an image
      will augment the metadata that has already been specified in the image through
      its Dockerfile.
    responses:
      200:
        body:
          example: !include examples/images.json
  post:
    description: Create a new image definition.
    body:
      example: !include examples/create-image.json

  /{imageID}:
      get:
        description: Get a specific image definition.
        body:
          example: !include examples/image.json
      delete:
        description: Delete a specific image.
        responses:
          200:
            body:
              example: !include examples/status-success.json

/links:
  displayName: /links (NOT IMPLEMENTED)
  get:
    description: |
      List of links between services in your account.

      Unlike a Docker link, a Link in OpenShift defines a relationship between services
      which may be composed by multiple Docker images. A link may include additional metadata
      about the relationship such as the algorithm to use to distribute requests.
    queryParameters:
      projectID:
        description: filter the links owned by a particular project.
      serviceID:
        description: filter the links attached to a particular service.
    responses:
      200:
        body:
          example: !include examples/links.json
  post:
    description: Create a new link between two services.
    body:
      example: !include examples/link.json

  /{linkID}:
    get:
      description: Get details about a specific link.
      body:
        example: !include examples/link.json
    put:
      description: Update a specific link.
      body:
        example: !include examples/link.json
    delete:
      description: Delete a specific link.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/projects:
  displayName: /projects (NOT IMPLEMENTED)
  get:
    description: |
      List all projects for your account.

      Projects are a similar concept to v2 domains. A project is a grouping of services
      with shared access control and resource limits. Applications can be assembled
      from services in a project by linking them together via service endpoints.
    responses:
      200:
        body:
          example: !include examples/project-list.json
  post:
    description: Create a new project.
    body:
      example: !include examples/project.json

  /{projectID}:
    get:
      description: Get a specific project.
      responses:
        200:
          body:
            example: !include examples/project.json
    put:
      description: Update a project.
      body:
        example: !include examples/project-put.json
    delete:
      description: Delete a project.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    post:
      description: Instantiate a template in the given project.
      body:
        example: !include examples/project-post.json

/templateConfigs:
  post:
    description: |
      Process a template into a config.
      See /templates endpoint for details on template transformation,
      parameters and generators.
    body:
      schema: !include doc/template-schema.json
      example: !include examples/template.json
    responses:
      200:
        body:
          example: !include examples/config.json

/templates:
  displayName: /templates (NOT IMPLEMENTED)
  get:
    description: |
      List all templates that your account has access to.

      A template represents generic config with parameters.

      Parameters:

        Example #1 - static paramater:

          {

            "name": "DB_NAME",

            "description": "PostgreSQL database name",

            "type": "string",

            "value": "mydb"

          }

        The above parameter can be referenced in the rest of the template
        as ${DB_NAME} expression, which is to be substituted by its value
        (the "mydb" string) during the transformation.

        Example #2 - parameter with generator:

          {

            "name": "DB_PASSWORD",

            "description": "PostgreSQL admin user password",

            "type": "string",

            "expression": "[a-zA-Z0-9]{8}"

          }

        The above parameter can be referenced in the rest of the template
        as ${DB_PASSWORD} expression, which is to be substituted by its
        newly generated value during the transformation.

      Generators:

        Generators generate random values based on the input. OpenShift 3
        currently support expression value generator only.

        Expression value generator generates random string based on the
        input expression. The input expression is a string, which may contain
        "[a-zA-Z0-9]{length}" expression constructs, defining range and length
        of the result random characters.

        Examples ("expression" => "value"):

          "test[0-9]{1}x" => "test7x"

          "[0-1]{8}" => "01001100"

          "0x[A-F0-9]{4}" => "0xB3AF"

          "[a-zA-Z0-9]{8}" => "hW4yQU5i"

  post:
    description: Create a new template.
    body:
      schema: !include doc/template-schema.json
      example: !include examples/template.json
    responses:
      200:
        body:
          example: !include examples/status-success.json

  /{templateID}:
    displayName: /template/{templateID}
    get:
      description: Get a specific template.
      responses:
        200:
          body:
           example: !include examples/template.json
    put:
      description: Update a specific template.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    delete:
      description: Delete a specific template.
      responses:
        200:
          body:
            example: !include examples/status-success.json

#%RAML 0.8
# vim: set ft=yaml:
title: OpenShift 3
version: v1beta1
baseUri: http://localhost:8080/osapi/{version}
mediaType: application/json
documentation:
 - title: Overview
   content: |
    The OpenShift 3.x model attempts to expose underlying Docker and Kubernetes
    models as accurately as possible, with a focus on easy composition of
    applications by a developer (install Ruby, push code, add MySQL).

    Unlike 2.x, more flexibility of configuration is exposed after creation in
    all aspects of the model. Terminology is still being weighed, but the
    concept of an application as a separate object is being removed in favor of
    more flexible composition of "services" - allowing two web containers to
    reuse a DB, or expose a DB directly to the edge of the network. The
    existing API will continue to be supported through 3.x, with concepts
    mapped as closely as possible to the new model.

 - title: Kubernetes API
   content: |
    OpenShift exposes [Kubernetes API](http://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/blob/master/api/kubernetes.html) at http://localhost:8080/api/v1beta1/.

/projects:
  displayName: /projects (NOT IMPLEMENTED)
  get:
    description: |
      List all projects for your account.

      Projects are a similar concept to v2 domains. A project is a grouping of services
      with shared access control and resource limits. Applications can be assembled
      from services in a project by linking them together via service endpoints.
    responses:
      200:
        body:
          example: !include examples/project-list.json
  post:
    description: Create a new project.
    body:
      example: !include examples/project.json

  /{projectID}:
    get:
      description: Get a specific project.
      responses:
        200:
          body:
            example: !include examples/project.json
    put:
      description: Update a project.
      body:
        example: !include examples/project-put.json
    delete:
      description: Delete a project.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    post:
      description: Instantiate a template in the given project.
      body:
        example: !include examples/project-post.json

/imageRepositories:
  get:
    description: |
      List all image repositories.

      An image repository is a collection of images that share the same metadata. It may
      reference a Docker image repository on a Docker registry, but this is optional. An
      image repository also contains a mapping of tags to images.
    responses:
      200:
        body:
          example: !include examples/image-repositories.json
  post:
    description: Create a new image repository.
    body:
      example: !include examples/create-image-repository.json

  /{repositoryID}:
      get:
        description: Get information about a specific image repository.
        body:
          example: !include examples/image-repository.json
      put:
        description: Update an image repository.
        body:
          example: !include examples/image-repository.json
      delete:
        description: Delete an image repository.
        responses:
          200:
            body:
              example: !include examples/status-success.json

/images:
  get:
    description: |
      List all images.

      An image is a reference to an image in a Docker image repository on a Docker
      registry, plus a set of metadata. The metadata that Openshift stores for an image
      will augment the metadata that has already been specified in the image through
      its Dockerfile.
    responses:
      200:
        body:
          example: !include examples/images.json
  post:
    description: Create a new image definition.
    body:
      example: !include examples/create-image.json

  /{imageID}:
      get:
        description: Get a specific image definition.
        body:
          example: !include examples/image.json
      delete:
        description: Delete a specific image.
        responses:
          200:
            body:
              example: !include examples/status-success.json

/imageRepositoryMappings:
  post:
    description: |
      Create an image and update an image repository.

      This is designed as a webhook that a Docker registry can invoke when a
      new tag is created. The image repository mapping contains a reference
      to the repository, the image's metadata, and the name of the new tag.
      Upon execution, a new image is created if it doesn't already exist, and
      the image repository is updated with the new tag.
    body:
      example: !include examples/create-image-repository-mapping.json

/deployments:
  get:
    description: |
      List all deployments.

      A deployment represents a single unique realization of a deployment config.
    responses:
      200:
        body:
          example: !include examples/deployments.json
  post:
    description: Create a new deployment.
    body:
      example: !include examples/deployment.json

  /{deploymentID}:
    get:
      description: Get details about a specific deployment.
      responses:
        200:
          body:
            example: !include examples/deployment.json
    put:
      description: Update a specific deployment.
      body:
        example: !include examples/deployment.json
    delete:
      description: Delete a specific deployment.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/deploymentConfigs:
  get:
    description: |
      List all DeploymentConfigs.

      A DeploymentConfig represents a configuration for a single deployment
      of a replication controller: a template for the deployment, how new
      deployments are triggered, what the current deployed state is.
    responses:
      200:
        body:
          example: !include examples/deploymentConfigs.json
  post:
    description: Create a new build.
    body:
      example: !include examples/status-success.json

  /{configID}:
    get:
      description: Get a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/deploymentConfig.json
    put:
      description: Update a specific build configuration.
      body:
        example: !include examples/deploymentConfig.json
    delete:
      description: Delete a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/links:
  displayName: /links (NOT IMPLEMENTED)
  get:
    description: |
      List of links between services in your account.

      Unlike a Docker link, a Link in OpenShift defines a relationship between services
      which may be composed by multiple Docker images. A link may include additional metadata
      about the relationship such as the algorithm to use to distribute requests.
    queryParameters:
      projectID:
        description: filter the links owned by a particular project.
      serviceID:
        description: filter the links attached to a particular service.
    responses:
      200:
        body:
          example: !include examples/links.json
  post:
    description: Create a new link between two services.
    body:
      example: !include examples/link.json

  /{linkID}:
    get:
      description: Get details about a specific link.
      body:
        example: !include examples/link.json
    put:
      description: Update a specific link.
      body:
        example: !include examples/link.json
    delete:
      description: Delete a specific link.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/aliases:
  displayName: /aliases (NOT IMPLEMENTED)
  get:
    description: |
      List all aliases visible to you.

      Aliases in v3 perform the same function as aliases in v2. The main difference
      is that in v3 an alias is associated with a service, not an application.
    queryParameters:
      serviceID:
        description: filter aliases by associated service.
    responses:
      200:
        body:
          example: !include examples/aliases.json
  post:
    description: Create an alias for this service.
    body:
      example: !include examples/alias.json

  /{aliasID}:
    get:
      description: Get a specific alias.
      body:
        example: !include examples/alias.json
    put:
      description: Update a specific alias.
      body:
        example: !include examples/alias.json
    delete:
      description: Delete a specific alias.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/builds:
  get:
    description: |
      List all builds.

      Build encapsulates the inputs needed to produce a new deployable image, as well as
      the status of the operation and a reference to the Pod which runs the build.
    responses:
      200:
        body:
          example: !include examples/builds.json
  post:
    description: Create a new build.
    body:
      example: !include examples/create_build.json

  /{buildID}:
    get:
      description: Get details about a specific build.
      responses:
        200:
          body:
            example: !include examples/build.json
    put:
      description: Update a specific build.
      body:
        example: !include examples/build.json
    delete:
      description: Delete a specific build.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/buildConfigs:
  get:
    description: |
      List all BuildConfigs.

      BuildConfig contains the inputs needed to produce a new deployable image.
    responses:
      200:
        body:
          example: !include examples/buildConfigs.json
  post:
    description: Create a new build.
    body:
      example: !include examples/create_buildConfig.json

  /{configID}:
    get:
      description: Get a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/buildConfig.json
    put:
      description: Update a specific build configuration.
      body:
        example: !include examples/buildConfig.json
    delete:
      description: Delete a specific build configuration.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/buildConfigHooks/{buildID}/{secret}/{plugin}:
  post:
    description: |
      Webhook on push event from external repository.

      buildID specifies which build to trigger, whereas plugin defines source of
      the request, this might be github, bitbucket or others.
    responses:
      204:
        description: No content

/templates:
  displayName: /templates (NOT IMPLEMENTED)
  get:
    description: |
      List all templates that your account has access to.

      A template represents generic config with parameters.

      Parameters:

        Example #1 - static paramater:

          {

            "name": "DB_NAME",

            "description": "PostgreSQL database name",

            "type": "string",

            "value": "mydb"

          }

        The above parameter can be referenced in the rest of the template
        as ${DB_NAME} expression, which is to be substituted by its value
        (the "mydb" string) during the transformation.

        Example #2 - parameter with generator:

          {

            "name": "DB_PASSWORD",

            "description": "PostgreSQL admin user password",

            "type": "string",

            "expression": "[a-zA-Z0-9]{8}"

          }

        The above parameter can be referenced in the rest of the template
        as ${DB_PASSWORD} expression, which is to be substituted by its
        newly generated value during the transformation.

      Generators:

        Generators generate random values based on the input. OpenShift 3
        currently support expression value generator only.

        Expression value generator generates random string based on the
        input expression. The input expression is a string, which may contain
        "[a-zA-Z0-9]{length}" expression constructs, defining range and length
        of the result random characters.

        Examples ("expression" => "value"):

          "test[0-9]{1}x" => "test7x"

          "[0-1]{8}" => "01001100"

          "0x[A-F0-9]{4}" => "0xB3AF"

          "[a-zA-Z0-9]{8}" => "hW4yQU5i"

  post:
    description: Create a new template.
    body:
      schema: !include doc/template-schema.json
      example: !include examples/template.json
    responses:
      200:
        body:
          example: !include examples/status-success.json

  /{templateID}:
    displayName: /template/{templateID}
    get:
      description: Get a specific template.
      responses:
        200:
          body:
           example: !include examples/template.json
    put:
      description: Update a specific template.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    delete:
      description: Delete a specific template.
      responses:
        200:
          body:
            example: !include examples/status-success.json

/templateConfigs:
  post:
    description: |
      Process a template into a config.
      See /templates endpoint for details on template transformation,
      parameters and generators.
    body:
      schema: !include doc/template-schema.json
      example: !include examples/template.json
    responses:
      200:
        body:
          example: !include examples/config.json

/configs:
  displayName: /configs (NOT IMPLEMENTED)
  get:
    description: |
      List all configs that your account has access to.

      A config defines 0..n Kubernetes resources.
    responses:
      200:
  post:
    description: Create a new config.
    body:
      schema: !include doc/config-schema.json
      example: !include examples/config.json
    responses:
      200:
        body:
          example: !include examples/status-success.json

  /{configID}:
    get:
      description: Get a specific config.
      responses:
        200:
          body:
            example: !include examples/config.json
    put:
      description: Update a specific config.
      responses:
        200:
          body:
            example: !include examples/status-success.json
    delete:
      description: Delete a specific config.
      responses:
        200:
          body:
            example: !include examples/status-success.json


fix postal code for germany

fix postal code for germany

#%RAML 1.0
---
title: Postal Code API
baseUri: https://api.bring.com/pickuppoint/api

documentation:
- title: Introduction
  content: |
      With the Postal Code API you can

      * validate a postal code
      * look up the city of a postal code
      * get the postal code type, e.g. normal or P.O. Box (for Norway)

      The API has two interfaces: XML and JSON.

      It is NOT possible to get data in batch or get list of valid postal codes for a given country at a regular interval.

- title: Authentication
  content: |
      To make API requests, you will need an API key from Mybring. Steps for getting a key and description of headers can be found on the general API [Getting Started / Authentication](/api/#authentication) page.

- title: Supported Countries
  content: |
      The following countries are supported:

      * NO - Norway
      * DK - Denmark
      * SE - Sweden
      * FI - Finland
      * NL - Netherlands
      * DE - Germany
      * US - United States
      * BE - Belgium
      * FO - Faroe Islands
      * GL - Greenland

      The service uses [GeoNames](http://www.geonames.org/) as source for most countries except Norway.

      For unsupported countries (countries not in the list above), all postal codes will be marked as valid with no city name returned. In these cases it is recommended to prompt the user to input the city name themselves.

      For countries that have multiple results (cities) for a given postal code, a list of cities will be returned. See example below.

      ### Postal Code type for Norway

      For Norway, you also get information about the postal code type. This is set in the `postalCodeType` in the response:

      | `postalCodeType` | Description |
      |:-----------------|:------------|
      | NORMAL | Normal postal code suitable for delivering packages. Contains street addresses or mix of street and other postal code types. |
      | POBOX | Postal code contains only P.O. Box addresses. Only certain Bring services can be delivered to these addresses (see the [Shipping Guide](/api/shipping-guide_2/)). |
      | SPECIALCUSTOMER | Special, e.g special return postal codes for selected customers. |
      | SPECIALNOSTREET | Special, e.g special postal codes for customers with old "serviceboks". |
      | UNKNOWN | Unknown postal code type. Used for e.g. international postal codes. |

- title: Support CORS
  content: |

      CORS headers will be added to response only for authenticated requests.

/postalCode/{countryCode}/getCityAndType/{postalCode}{mediaTypeExtension}:
  displayName: Lookup Postal Code

  uriParameters:
    postalCode:
      displayName: Postal code
      type: string
      required: true
      example: 1337
    countryCode:
      displayName: Country
      required: true
      type: string
      default: "NO"
      example: SE
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: Lookup Postal Code
    queryParameters:

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                value: !include examples/response.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                value: !include examples/response.xml

/postalCode/{countryCode}/getCitiesAndTypes/{postalCode}{mediaTypeExtension}:
  displayName: Lookup Postal Code having Multiple Cities

  uriParameters:
    postalCode:
      displayName: Postal code
      type: string
      required: true
      example: '01156'
    countryCode:
      displayName: Country
      required: true
      type: string
      default: "NO"
      example: DE
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: Lookup Postal Code having Multiple Cities
    queryParameters:

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                value: !include examples/responseForMultipleCities.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                value: !include examples/responseForMultipleCities.xml

#%RAML 1.0
---
title: Postal Code API
baseUri: https://api.bring.com/pickuppoint/api

documentation:
- title: Introduction
  content: |
      With the Postal Code API you can

      * validate a postal code
      * look up the city of a postal code
      * get the postal code type, e.g. normal or P.O. Box (for Norway)

      The API has two interfaces: XML and JSON.

      It is NOT possible to get data in batch or get list of valid postal codes for a given country at a regular interval.

- title: Authentication
  content: |
      To make API requests, you will need an API key from Mybring. Steps for getting a key and description of headers can be found on the general API [Getting Started / Authentication](/api/#authentication) page.

- title: Supported Countries
  content: |
      The following countries are supported:

      * NO - Norway
      * DK - Denmark
      * SE - Sweden
      * FI - Finland
      * NL - Netherlands
      * DE - Germany
      * US - United States
      * BE - Belgium
      * FO - Faroe Islands
      * GL - Greenland

      The service uses [GeoNames](http://www.geonames.org/) as source for most countries except Norway.

      For unsupported countries (countries not in the list above), all postal codes will be marked as valid with no city name returned. In these cases it is recommended to prompt the user to input the city name themselves.

      For countries that have multiple results (cities) for a given postal code, a list of cities will be returned. See example below.

      ### Postal Code type for Norway

      For Norway, you also get information about the postal code type. This is set in the `postalCodeType` in the response:

      | `postalCodeType` | Description |
      |:-----------------|:------------|
      | NORMAL | Normal postal code suitable for delivering packages. Contains street addresses or mix of street and other postal code types. |
      | POBOX | Postal code contains only P.O. Box addresses. Only certain Bring services can be delivered to these addresses (see the [Shipping Guide](/api/shipping-guide_2/)). |
      | SPECIALCUSTOMER | Special, e.g special return postal codes for selected customers. |
      | SPECIALNOSTREET | Special, e.g special postal codes for customers with old "serviceboks". |
      | UNKNOWN | Unknown postal code type. Used for e.g. international postal codes. |

- title: Support CORS
  content: |

      CORS headers will be added to response only for authenticated requests.

/postalCode/{countryCode}/getCityAndType/{postalCode}{mediaTypeExtension}:
  displayName: Lookup Postal Code

  uriParameters:
    postalCode:
      displayName: Postal code
      type: string
      required: true
      example: 1337
    countryCode:
      displayName: Country
      required: true
      type: string
      default: "NO"
      example: SE
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: Lookup Postal Code
    queryParameters:

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                value: !include examples/response.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                value: !include examples/response.xml

/postalCode/{countryCode}/getCitiesAndTypes/{postalCode}{mediaTypeExtension}:
  displayName: Lookup Postal Code having Multiple Cities

  uriParameters:
    postalCode:
      displayName: Postal code
      type: string
      required: true
      example: 01156
    countryCode:
      displayName: Country
      required: true
      type: string
      default: "NO"
      example: DE
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to get application/json or .xml to get application/xml.
  get:
    description: Lookup Postal Code having Multiple Cities
    queryParameters:

    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            examples:
              successful:
                displayName: Successful
                value: !include examples/responseForMultipleCities.json
          application/xml:
            examples:
              successful:
                displayName: Successful
                value: !include examples/responseForMultipleCities.xml


Incorporated review comments- changing texts

#%RAML 0.8
---
title: Invoice API
baseUri: https://www.mybring.com

documentation:
- title: Introduction
  content: |
      The Invoice API is used to download the invoice pdfs same as in Mybring.

- title: Authentication
  content: |
    The Invoice API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be present for authenticating requests.

/invoicearchive/pdf/{invoiceType}/{customerNumberUnique}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  securedBy: [mybring_headers, null]
  description: |
      This link is used to download the invoice pdf for the customer by providing the type of invoice (NORMAL or SPECIFIED) based on customer type along with API Customer Id and invoice number in URI params

  uriParameters:
    invoiceType:
      description: Type can be NORMAL and SPECIFIED for particular customers
    customerNumberUnique:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.

  get:
    description: Download pdf for invoice

/reports/api/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List of all Invoices
  description: |
    Use the existing [Reports Api List invoice numbers](/api/reports/#list-invoice-numbers) for this feature.
  uriParameters:
      customerOrGroupId:
        description: Id for customer or customer group. Customer group id should have the prefix `GROUP_` e.g. GROUP_12345
        type: string
        required: true
      mediaTypeExtension:
        enum: [ .json, .xml ]
        description: Use .json to specify application/json or .xml to specify application/xml

  get:
    description: List invoice numbers

#%RAML 0.8
---
title: Invoice API
baseUri: https://www.mybring.com

documentation:
- title: Introduction
  content: |
      The Invoice API is used to download the invoice pdfs same as in Mybring.

- title: Authentication
  content: |
    The Invoice API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be present for authenticating requests.

/invoicearchive/pdf/{invoiceType}/{customerNumberUnique}/{invoiceNumber}.pdf:
  displayName: Invoice PDF download endpoint
  securedBy: [mybring_headers, null]
  description: |
      This link is used to download the invoice pdf for the customer by providing the type of invoice (NORMAL or SPECIFIED) based on customer type along with API Customer Id and invoice number in URI params

  uriParameters:
    invoiceType:
      description: Type can be NORMAL and SPECIFIED for particular customers
    customerNumberUnique:
      description: Unique API Customer Number for each customer.
    invoiceNumber:
      description: Invoice number of the particular invoice to be downloaded.

  get:
    description: Download pdf for invoice

/reports/api/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List of all Invoice
  description: |
    Use the existing [Reports Api List invoice numbers](/api/reports/#list-invoice-numbers) for this feature.
  uriParameters:
      customerOrGroupId:
        description: Id for customer or customer group. Customer group id should have the prefix `GROUP_`.  For e.g. GROUP_12345
        type: string
        required: true
      mediaTypeExtension:
        enum: [ .json, .xml ]
        description: Use .json to specify application/json or .xml to specify application/xml

  get:
    description: List invoice numbers


added missing traits

added missing traits

#%RAML 0.8
---
title: RPooli API
baseUri: ${baseUri}/api/{version}
version: v1
mediaType:  application/json

documentation:
  - title: RPooli API
    content: |
      <pre>
       ___ ___          _ _
      | _ \ _ \___  ___| (_)
      |   /  _/ _ \/ _ \ | |
      |_|_\_| \___/\___/_|_|
      </pre>
      _A pool of R nodes, exposed over RMI and managed over HTTP_

schemas:
 - error.json:  !include schema/error.json
 - pool.json:   !include schema/pool.json
 - node.json:   !include schema/node.json
 - nodes.json:  !include schema/nodes.json
 - conf-r.json: !include schema/conf-r.json

traits:
 - erroring:
     usage: Defines errors that yield a JSON response body.
     responses:
       400:
         body:
           schema: error.json
       500:
         body:
           schema: error.json

/pool:
  is: [ erroring ]
  description: Manage the pool of RServi nodes.
  get:
    description: Retrieve information about the pool.
    responses:
      200:
        body:
          schema: pool.json

/nodes:
  is: [ erroring ]
  description: Manage the RServi nodes.
  get:
    description: Retrieve the list of nodes.
    responses:
      200:
        body:
          schema: nodes.json
  /{nodeId}:
    is: [ erroring ]
    description: Manage a single RServi node.
    uriParameters:
      nodeId:
        type: string
        required: true
    get:
      description: Retrieve a single node.
      responses:
        200:
          body:
            schema: node.json
        404:
          description: The node ID doesn't exist.
          body:
            schema: error.json
    delete:
      description: Evict a node
      queryParameters:
        kill:
          description: If true, the node is immediately evicted.
          type: boolean
          required: false
          default: false
      responses:
        204:
          description: The node has been evicted.
    /console:
      is: [ erroring ]
      description: Control the debug console.
      post:
        description: Enable the debug console.
        responses:
          204:
            description: The debug console is active.
      delete:
        description: The debug console is inactive.
        responses:
          204:
            description: The command has been successfully executed.
  /test:
    is: [ erroring ]
    description: Simulate client actions.
    post:
      description: Acquire a node from the pool.
      responses:
        204:
          description: A node has been acquired.
    delete:
      description: Release all the acquired nodes to the pool.
      responses:
        204:
          description: All acquired nodes have been released.

/config:
  is: [ erroring ]
  description: Configure RPooli.
  /r:
    is: [ erroring ]
    description: R/Rj nodes configuration.
    get:
      description: Retrieve the current configuration.
      responses:
        200:
          body:
            schema: conf-r.json
    put:
      description: Configure the parameters to start R.
      queryParameters:
        save:
          description: If true, the configuration will be applied and saved, otherwise it will only be applied.
          type: boolean
          required: false
          default: false
      body:
        schema: conf-r.json
      responses:
        204:
          description: The configuration has been accepted.
    /default:
      is: [ erroring ]
      description: The default configuration.
      get:
        description: Get the default configuration.
        responses:
          200:
            body:
              schema: conf-r.json

#%RAML 0.8
---
title: RPooli API
baseUri: ${baseUri}/api/{version}
version: v1
mediaType:  application/json

documentation:
  - title: RPooli API
    content: |
      <pre>
       ___ ___          _ _
      | _ \ _ \___  ___| (_)
      |   /  _/ _ \/ _ \ | |
      |_|_\_| \___/\___/_|_|
      </pre>
      _A pool of R nodes, exposed over RMI and managed over HTTP_

schemas:
 - error.json:  !include schema/error.json
 - pool.json:   !include schema/pool.json
 - node.json:   !include schema/node.json
 - nodes.json:  !include schema/nodes.json
 - conf-r.json: !include schema/conf-r.json

traits:
 - erroring:
     usage: Defines errors that yield a JSON response body.
     responses:
       400:
         body:
           schema: error.json
       500:
         body:
           schema: error.json

/pool:
  is: [ erroring ]
  description: Manage the pool of RServi nodes.
  get:
    description: Retrieve information about the pool.
    responses:
      200:
        body:
          schema: pool.json

/nodes:
  is: [ erroring ]
  description: Manage the RServi nodes.
  get:
    description: Retrieve the list of nodes.
    responses:
      200:
        body:
          schema: nodes.json
  /{nodeId}:
    description: Manage a single RServi node.
    uriParameters:
      nodeId:
        type: string
        required: true
    get:
      description: Retrieve a single node.
      responses:
        200:
          body:
            schema: node.json
        404:
          description: The node ID doesn't exist.
          body:
            schema: error.json
    delete:
      description: Evict a node
      queryParameters:
        kill:
          description: If true, the node is immediately evicted.
          type: boolean
          required: false
          default: false
      responses:
        204:
          description: The node has been evicted.
    /console:
      description: Control the debug console.
      post:
        description: Enable the debug console.
        responses:
          204:
            description: The debug console is active.
      delete:
        description: The debug console is inactive.
        responses:
          204:
            description: The command has been successfully executed.
  /test:
    description: Simulate client actions.
    post:
      description: Acquire a node from the pool.
      responses:
        204:
          description: A node has been acquired.
    delete:
      description: Release all the acquired nodes to the pool.
      responses:
        204:
          description: All acquired nodes have been released.

/config:
  is: [ erroring ]
  description: Configure RPooli.
  /r:
    description: R/Rj nodes configuration.
    get:
      description: Retrieve the current configuration.
      responses:
        200:
          body:
            schema: conf-r.json
    put:
      description: Configure the parameters to start R.
      queryParameters:
        save:
          description: If true, the configuration will be applied and saved, otherwise it will only be applied.
          type: boolean
          required: false
          default: false
      body:
        schema: conf-r.json
      responses:
        204:
          description: The configuration has been accepted.
    /default:
      description: The default configuration.
      get:
        description: Get the default configuration.
        responses:
          200:
            body:
              schema: conf-r.json


Update Reports API URL (no longer mybring!)

#%RAML 0.8
---
title: Reports API
baseUri: https://api.bring.com/reports/api

documentation:
- title: Introduction
  content: |
    The Reports API is used to generate shipment reports, the same set of reports that are available in mybring.

    Each Mybring user is associated with a set of customers and has access to specific set of report types for which they can generate a report.

    The following steps (which will be API calls) enables you to generate a report:

    1. Get the customers associated with the mybring user.
    2. Get the report types allowed for a customer.
    3. Initiate report creation and get report ID. The Report ID is initially used to monitor reports creation progress, later to get the actual report (XML or Excel file).
    4. After initiating report creation, you can check the status if the job. I.e. if it is in progress, completed or failed. When status is completed, a URL for fetching the actual report is returned.
    5. The report can then be downloaded.

    For all the above APIs we need to identify and authenticate the user. This is done by passing the following header information. These are described in Reference section:

    - Mybring username (email address)
    - API Key

    All these APIs are available in json and xml formats.

- title: How to use
  content: |
    The Reports API is a logged-in service and you need to get an API-key and authenticate before being able to use the API.

    The two first steps in the process is only necessary to find customer numbers and report types for the user. You can save these IDs, and perform the generation-step without verifying the IDs. The response may get added information, so implementation should ignore new elements added to the response.

    1. Get customer IDs
    2. Get list of available reports
    3. Generate report
    4. Check status of report
    5. Download report
    6. Get list of invoice numbers for given customer or group

- title: Authentication
  content: |
    The Reports API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

/generate{mediaTypeExtension}:
  displayName: List available customers
  description: |
    List available customers for the provided API credentials.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available customers
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_customers.json
          application/xml:
            example: !include examples/list_customers.xml

/generate/{customerId}{mediaTypeExtension}:
  displayName: List available reports for a customer
  description: |
    Each customer has a set of reports available. This endpoint lists all available reports for a given customer.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available reports for a customer
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_reports.json
          application/xml:
            example: !include examples/list_reports.xml

/generate/{customerId}/{reportTypeId}{mediaTypeExtension}:
  displayName: Generate a report
  description: |
    To generate a report do a GET to the supplied URL, and include the parameters described in the previous response. You need not invoke the two first steps for every report generation if customer id and report type are known.

    This is asynchronous request. So the GET-call will return 202, telling the caller the that the request for a report is put on the queue. The URL to query to get the status for the request if provided as an HTTP header and also in the response.

    The example below shows how to generate a PARCELS-DELIVERED report for PARCELS_NORWAY-00012341234 in the period 01.07.2014 to 01.08.2014.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    reportTypeId:
      description: A report type ID from the 'list of available reports' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Generate a report
    queryParameters:
      parameterName:
        description: The different report types have different params. The params are doucmented in the list of available reports, for example `fromDate` and `toDate`.
        type: string
        required: true
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      202:
        displayName: Successful response
        headers:
          Location:
            description: URL to get status of the generated report
            required: true
            type: string
            example: https://www.mybring.com/reports/api/report/db285042-6e8d-4563-94ca-eb1100706a73/status/
        body:
          application/json:
            example: !include examples/generate_report.json
          application/xml:
            example: !include examples/generate_report.xml

/reports/{reportId}/status{mediaTypeExtension}:
  displayName: Check the status of a report
  description: |
    Since the generation of reports may take several minutes, we supply a status address to check the status of the report generation. The status page will display `NOT_DONE`, until the report is ready to be downloaded. When the report is ready, URLs to download the report will be in the response
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Check the status of a report
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report status
        description: Examples show different statuses.
        body:
          application/json+notdone:
            example: !include examples/status_not_done.json
          application/json+done:
            example: !include examples/status_done.json
          application/json+failed:
            example: !include examples/status_failed.json
          application/xml+notdone:
            example: !include examples/status_not_done.xml
          application/xml+done:
            example: !include examples/status_done.xml
          application/xml+failed:
            example: !include examples/status_failed.xml

/reports/{reportId}{mediaTypeExtension}:
  displayName: Get report
  description: |
    Returns the generated report.
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .xls, .xml ]
      description: Use .xls to get Excel file or .xml to get XML file.
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report
        description: Examples show different statuses.
        body:
          application/xml:
            example: !include examples/empty_report.xml

/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List invoice numbers
  description: |
    Get the list of invoice numbers for a customer id or a customer group.
  uriParameters:
    customerOrGroupId:
      description: Id for customer or customer group. Customer group id should have the prefix `GROUP_`.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_invoices.json
          application/xml:
            example: !include examples/list_invoices.xml

#%RAML 0.8
---
title: Reports API
baseUri: https://www.mybring.com/reports/api

documentation:
- title: Introduction
  content: |
    The Reports API is used to generate shipment reports, the same set of reports that are available in mybring.

    Each Mybring user is associated with a set of customers and has access to specific set of report types for which they can generate a report.

    The following steps (which will be API calls) enables you to generate a report:

    1. Get the customers associated with the mybring user.
    2. Get the report types allowed for a customer.
    3. Initiate report creation and get report ID. The Report ID is initially used to monitor reports creation progress, later to get the actual report (XML or Excel file).
    4. After initiating report creation, you can check the status if the job. I.e. if it is in progress, completed or failed. When status is completed, a URL for fetching the actual report is returned.
    5. The report can then be downloaded.

    For all the above APIs we need to identify and authenticate the user. This is done by passing the following header information. These are described in Reference section:

    - Mybring username (email address)
    - API Key

    All these APIs are available in json and xml formats.

- title: How to use
  content: |
    The Reports API is a logged-in service and you need to get an API-key and authenticate before being able to use the API.

    The two first steps in the process is only necessary to find customer numbers and report types for the user. You can save these IDs, and perform the generation-step without verifying the IDs. The response may get added information, so implementation should ignore new elements added to the response.

    1. Get customer IDs
    2. Get list of available reports
    3. Generate report
    4. Check status of report
    5. Download report
    6. Get list of invoice numbers for given customer or group

- title: Authentication
  content: |
    The Reports API requires authentication for all its endpoints. See the [getting started guide on authentication](/api/#authentication) if you're not sure what this means.

    | Header | Example | Comment |
    |:-------|:--------|:--------|
    | `X-MyBring-API-Uid` | `john.doe@example.com` | Mybring login ID |
    | `X-MyBring-API-Key` | `1234abc-abcd-1234-5678-abcd1234abcd ` | Mybring login's API key |
    | `X-Bring-Client-URL` | `https://example.com/ ` | A URL that sort of identifies where you're using the APIs. |

    Those headers must be set for all endpoints documented below.

/generate{mediaTypeExtension}:
  displayName: List available customers
  description: |
    List available customers for the provided API credentials.
  uriParameters:
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available customers
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_customers.json
          application/xml:
            example: !include examples/list_customers.xml

/generate/{customerId}{mediaTypeExtension}:
  displayName: List available reports for a customer
  description: |
    Each customer has a set of reports available. This endpoint lists all available reports for a given customer.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: List available reports for a customer
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_reports.json
          application/xml:
            example: !include examples/list_reports.xml

/generate/{customerId}/{reportTypeId}{mediaTypeExtension}:
  displayName: Generate a report
  description: |
    To generate a report do a GET to the supplied URL, and include the parameters described in the previous response. You need not invoke the two first steps for every report generation if customer id and report type are known.

    This is asynchronous request. So the GET-call will return 202, telling the caller the that the request for a report is put on the queue. The URL to query to get the status for the request if provided as an HTTP header and also in the response.

    The example below shows how to generate a PARCELS-DELIVERED report for PARCELS_NORWAY-00012341234 in the period 01.07.2014 to 01.08.2014.
  uriParameters:
    customerId:
      description: A customer ID from the 'list of available customers' call.
      type: string
      required: true
    reportTypeId:
      description: A report type ID from the 'list of available reports' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Generate a report
    queryParameters:
      parameterName:
        description: The different report types have different params. The params are doucmented in the list of available reports, for example `fromDate` and `toDate`.
        type: string
        required: true
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      202:
        displayName: Successful response
        headers:
          Location:
            description: URL to get status of the generated report
            required: true
            type: string
            example: https://www.mybring.com/reports/api/report/db285042-6e8d-4563-94ca-eb1100706a73/status/
        body:
          application/json:
            example: !include examples/generate_report.json
          application/xml:
            example: !include examples/generate_report.xml

/reports/{reportId}/status{mediaTypeExtension}:
  displayName: Check the status of a report
  description: |
    Since the generation of reports may take several minutes, we supply a status address to check the status of the report generation. The status page will display `NOT_DONE`, until the report is ready to be downloaded. When the report is ready, URLs to download the report will be in the response
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    description: Check the status of a report
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report status
        description: Examples show different statuses.
        body:
          application/json+notdone:
            example: !include examples/status_not_done.json
          application/json+done:
            example: !include examples/status_done.json
          application/json+failed:
            example: !include examples/status_failed.json
          application/xml+notdone:
            example: !include examples/status_not_done.xml
          application/xml+done:
            example: !include examples/status_done.xml
          application/xml+failed:
            example: !include examples/status_failed.xml

/reports/{reportId}{mediaTypeExtension}:
  displayName: Get report
  description: |
    Returns the generated report.
  uriParameters:
    reportId:
      description: A report ID from a 'generate a report' call.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .xls, .xml ]
      description: Use .xls to get Excel file or .xml to get XML file.
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Report
        description: Examples show different statuses.
        body:
          application/xml:
            example: !include examples/empty_report.xml

/invoices/{customerOrGroupId}{mediaTypeExtension}:
  displayName: List invoice numbers
  description: |
    Get the list of invoice numbers for a customer id or a customer group.
  uriParameters:
    customerOrGroupId:
      description: Id for customer or customer group. Customer group id should have the prefix `GROUP_`.
      type: string
      required: true
    mediaTypeExtension:
      enum: [ .json, .xml ]
      description: Use .json to specify application/json or .xml to specify application/xml
  get:
    headers:
      Accept-Language:
        description: A comma-separated list of language codes, `no` for Norwegian, `en` for English, etc.
        type: string
        required: false
    responses:
      200:
        displayName: Successful response
        body:
          application/json:
            example: !include examples/list_invoices.json
          application/xml:
            example: !include examples/list_invoices.xml


define examples in YAML

define examples in YAML

#%RAML 1.0
title: Docker Registry HTTP API V2
documentation:
- title: Specification
  content: |
    The official API specification is located on [GitHub](https://github.com/docker/distribution/blob/master/docs/spec/api.md).
mediaType: application/json
baseUri: https://localhost:5000
version: v2
securitySchemes:
  basic:
    type: Basic Authentication
securedBy: [basic]
/v2/:
  displayName: Registry
  get:
    displayName: Find API version
    responses:
      200:
        headers:
          Docker-Distribution-API-Version:
            type: string
            enum:
            - registry/2.0
      401:
        description: Unauthorized
        headers:
          Docker-Distribution-API-Version:
            type: string
            enum:
            - registry/2.0
        body:
          type: Errors
      404:
        description: Endpoint does not implement registry v2 protocol
/v2/_catalog:
  displayName: Catalog
  get:
    displayName: Find Repositories
    description: |
      Returns a list of all existing repositories. A repository
      is a set of images with the same name and different tags.
    queryParameters:
      n:
        type: integer
        required: false
        description: Maximum number of results
      last:
        type: string
        required: false
        description: Last result from previous response
    responses:
      200:
        headers:
          Link:
            description:
            pattern: "</v2/_catalog?last=\\S+&n=\\d+>; rel=\"next\""
            required: false
        body:
          type: Repositories

/v2/{repository}:
  displayName: Repository
  uriParameters:
    repository:
      type: RepositoryName
  /tags/list:
    get:
      displayName: Find Tags
      responses:
        200:
          body:
            type: Tags
  /manifests/{reference}:
    uriParameters:
      reference:
        type: Reference
    get:
      displayName: find manifest
      responses:
        200:
          body:
            application/vnd.docker.distribution.manifest.v2+json:
              type: Manifest
    put:
      displayName: update manifest
    delete:
      displayName: delete manifest
  /blobs/{digest}:
    displayName: Blob
    uriParameters:
      digest:
        type: Digest
    get:
      displayName: find blob
    delete:
      displayName: delete blob
      responses:
        202:
          headers:
            Content-Length:
              type: string
              pattern: "None"
  /blobs/uploads:
    displayName: Upload
    post:
      displayName: create upload
  /blobs/uploads/{uuid}:
    uriParameters:
      uuid:
        type: string
    displayName: Upload
    get:
      displayName: find upload
    #patch:
    put:
      displayName: update upload
    delete:
      displayName: delete upload
types:
  Configuration:
    properties:
      mediaType:
        type: string
        enum:
        -  application/vnd.docker.container.image.v1+json
      size:
        type: integer
      digest:
        type: Digest
  Digest:
    type: string
    pattern: "[A-Za-z0-9_+.-]+:[A-Fa-f0-9]+"
  Error:
    properties:
      code: ErrorCode
      message: string
      detail: any
    description: |
      The error codes encountered via the API are enumerated in the following table:

      |Code|Message|Description|
      |----|-------|-----------|
       `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload.
       `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed.
       `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned.
       `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest.
       `MANIFEST_BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a manifest blob is  unknown to the registry.
       `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation.
       `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository.
       `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned.
       `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation.
       `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry.
       `SIZE_INVALID` | provided length did not match content length | When a layer is uploaded, the provided size will be checked against the uploaded content. If they do not match, this error will be returned.
       `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned.
       `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate.
       `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource.
       `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters.
  ErrorCode:
    type: string
    enum:
    - BLOB_UNKNOWN
    - BLOB_UPLOAD_INVALID
    - BLOB_UPLOAD_UNKNOWN
    - DIGEST_INVALID
    - MANIFEST_BLOB_UNKNOWN
    - MANIFEST_INVALID
    - MANIFEST_UNKNOWN
    - MANIFEST_UNVERIFIED
    - NAME_INVALID
    - NAME_UNKNOWN
    - SIZE_INVALID
    - TAG_INVALID
    - UNAUTHORIZED
    - DENIED
    - UNSUPPORTED
  Errors:
    properties:
      errors:
        type: array
        items: Error
    description: List of errors.
    example:
      errors:
      - code: "NAME_UNKNOWN"
        message: "repository not known to registry"
        detail: "i-do-not-exist"
  Layer:
    properties:
      mediaType:
        type: string
        enum:
        - application/vnd.docker.image.rootfs.diff.tar.gzip
      size:
        type: integer
      digest:
        type: string
      urls:
        type: array
        items: string
        required: false
    example:
      mediaType: "application/vnd.docker.image.rootfs.diff.tar.gzip"
      size: 1605
      digest: "sha256:c39b7f8739a4278307195461d3f7e9d4751f446c55822356a941d2a15a4008c4"
  Manifest:
    properties:
      schemaVersion:
        type: integer
        minimum: 2
        maximum: 2
      mediaType:
        type: string
        enum:
        - application/vnd.docker.distribution.manifest.v2+json
      config:
        type: Configuration
      layers:
        type: array
        items: Layer
    example:
      schemaVersion: 2
      mediaType: "application/vnd.docker.distribution.manifest.v2+json"
      config:
        mediaType: "application/vnd.docker.container.image.v1+json"
        size: 7023
        digest: "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7"
      layers:
      - mediaType: "application/vnd.docker.image.rootfs.diff.tar.gzip"
        size: 32654
        digest: "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f"
      - mediaType: "application/vnd.docker.image.rootfs.diff.tar.gzip"
        size: 16724
        digest: "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b"
      - "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip"
        "size": 73109
        "digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
  Reference:
    description: Name or digest
    type: string
  Repositories:
    description: List of repositories.
    properties:
      repositories:
        type: array
        items: string
  RepositoryName:
    type: string
    pattern: "([a-z0-9]+([._-][a-z0-9]+)*)(/([a-z0-9]+([._-][a-z0-9]+)*))*"
    maxLength: 255
  Tags:
    description: List of tags of a given repository
    properties:
      name:
        type: string
        description: Repository name
      tags:
        type: array
        items: string
        description: List of tags

#%RAML 1.0
title: Docker Registry HTTP API V2
documentation:
- title: Specification
  content: |
    The official API specification is located on [GitHub](https://github.com/docker/distribution/blob/master/docs/spec/api.md).
mediaType: application/json
baseUri: https://localhost:5000
version: v2
securitySchemes:
  basic:
    type: Basic Authentication
securedBy: [basic]
/v2/:
  displayName: Registry
  get:
    displayName: find API version
    responses:
      200:
        headers:
          Docker-Distribution-API-Version:
            type: string
            enum:
            - registry/2.0
      401:
        description: Unauthorized
        headers:
          Docker-Distribution-API-Version:
            type: string
            enum:
            - registry/2.0
        body:
          type: Errors
      404:
        description: Endpoint does not implement registry v2 protocol
/v2/_catalog:
  displayName: Catalog
  get:
    displayName: find repositories
    description: |
      Returns a list of all existing repositories. A repository
      is a set of images with the same name and different tags.
    queryParameters:
      n:
        type: integer
        required: false
        description: Maximum number of results
      last:
        type: string
        required: false
        description: Last result from previous response
    responses:
      200:
        headers:
          Link:
            description:
            pattern: "</v2/_catalog?last=\\S+&n=\\d+>; rel=\"next\""
            required: false
        body:
          type: Repositories

/v2/{repository}:
  displayName: Repository
  uriParameters:
    repository:
      type: RepositoryName
  /tags/list:
    get:
      displayName: find tags
      responses:
        200:
          body:
            type: Tags
  /manifests/{reference}:
    uriParameters:
      reference:
        type: Reference
    get:
      displayName: find manifest
      responses:
        200:
          body:
            application/vnd.docker.distribution.manifest.v2+json:
              type: Manifest
    put:
      displayName: update manifest
    delete:
      displayName: delete manifest
  /blobs/{digest}:
    displayName: Blob
    uriParameters:
      digest:
        type: Digest
    get:
      displayName: find blob
    delete:
      displayName: delete blob
      responses:
        202:
          headers:
            Content-Length:
              type: string
              pattern: "None"
  /blobs/uploads:
    displayName: Upload
    post:
      displayName: create upload
  /blobs/uploads/{uuid}:
    uriParameters:
      uuid:
        type: string
    displayName: Upload
    get:
      displayName: find upload
    #patch:
    put:
      displayName: update upload
    delete:
      displayName: delete upload
types:
  Configuration:
    properties:
      mediaType:
        type: string
        enum:
        -  application/vnd.docker.container.image.v1+json
      size:
        type: integer
      digest:
        type: Digest
  Digest:
    type: string
    pattern: "[A-Za-z0-9_+.-]+:[A-Fa-f0-9]+"
  Error:
    properties:
      code: ErrorCode
      message: string
      detail: any
    description: |
      The error codes encountered via the API are enumerated in the following table:

      |Code|Message|Description|
      |----|-------|-----------|
       `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload.
       `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed.
       `BLOB_UPLOAD_UNKNOWN` | blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned.
       `DIGEST_INVALID` | provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest.
       `MANIFEST_BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a manifest blob is  unknown to the registry.
       `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation.
       `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository.
       `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned.
       `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation.
       `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry.
       `SIZE_INVALID` | provided length did not match content length | When a layer is uploaded, the provided size will be checked against the uploaded content. If they do not match, this error will be returned.
       `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned.
       `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate.
       `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource.
       `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters.
  ErrorCode:
    type: string
    enum:
    - BLOB_UNKNOWN
    - BLOB_UPLOAD_INVALID
    - BLOB_UPLOAD_UNKNOWN
    - DIGEST_INVALID
    - MANIFEST_BLOB_UNKNOWN
    - MANIFEST_INVALID
    - MANIFEST_UNKNOWN
    - MANIFEST_UNVERIFIED
    - NAME_INVALID
    - NAME_UNKNOWN
    - SIZE_INVALID
    - TAG_INVALID
    - UNAUTHORIZED
    - DENIED
    - UNSUPPORTED
  Errors:
    properties:
      errors:
        type: array
        items: Error
    description: List of errors.
    example: |
      {
         "errors": [{
            "code": "NAME_UNKNOWN",
            "message": "repository not known to registry",
            "detail": "i-do-not-exist"
          }]
      }
  Layer:
    properties:
      mediaType:
        type: string
        enum:
        - application/vnd.docker.image.rootfs.diff.tar.gzip
      size:
        type: integer
      digest:
        type: string
      urls:
        type: array
        items: string
        required: false
    example: |
        {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 1605,
         "digest": "sha256:c39b7f8739a4278307195461d3f7e9d4751f446c55822356a941d2a15a4008c4"
        }
  Manifest:
    properties:
      schemaVersion:
        type: integer
        minimum: 2
        maximum: 2
      mediaType:
        type: string
        enum:
        - application/vnd.docker.distribution.manifest.v2+json
      config:
        type: Configuration
      layers:
        type: array
        items: Layer
    example: |
      {
        "schemaVersion": 2,
        "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
        "config": {
          "mediaType": "application/vnd.docker.container.image.v1+json",
          "size": 7023,
          "digest": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7"
        },
        "layers": [
          {
            "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "size": 32654,
            "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f"
          },
          {
            "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "size": 16724,
            "digest": "sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b"
          },
          {
            "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
            "size": 73109,
            "digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
          }
        ]
      }
  Reference:
    description: Name or digest
    type: string
  Repositories:
    description: List of repositories.
    properties:
      repositories:
        type: array
        items: string
  RepositoryName:
    type: string
    pattern: "([a-z0-9]+([._-][a-z0-9]+)*)(/([a-z0-9]+([._-][a-z0-9]+)*))*"
    maxLength: 255
  Tags:
    description: List of tags of a given repository
    properties:
      name:
        type: string
        description: Repository name
      tags:
        type: array
        items: string
        description: List of tags