---
swagger: "2.0"
info:
  version: "1"
  title: "Public API"
basePath: "/external"
tags:
- name: "configuration"
schemes:
- "http"
- "https"
paths:
  /external/configurations:
    post:
      tags:
      - "configuration"
      summary: "All configuration for the given applications in INI format"
      description: ""
      operationId: "getConfigurationsAsIni"
      produces:
      - "text/plain"
      - "application/x-ini"
      parameters:
      - in: "body"
        name: "requestConfiguration"
        description: "Configuration Request"
        required: false
        schema:
          $ref: "#/definitions/ConfigurationRequest"
      - name: "download"
        in: "query"
        description: "Should return as download"
        required: false
        type: "boolean"
      responses:
        200:
          description: "Successfully retrieved configurations"
          schema:
            $ref: "#/definitions/Resource"
        401:
          description: "You are not authorized to view the configurations"
        403:
          description: "Accessing the configurations you were trying to reach is forbidden"
        404:
          description: "At least one of the parameters passed are not known to the\
            \ system"
  /external/configurations/replace:
    post:
      tags:
      - "configuration"
      summary: "Replaces the contents of the given file with the values from ConfigSeeder"
      description: ""
      operationId: "templateReplace"
      consumes:
      - "multipart/form-data"
      parameters:
      - name: "configuration"
        in: "formData"
        description: "Configuration Request"
        required: true
        type: "ConfigurationRequestDto"
      - name: "variablePrefix"
        in: "query"
        description: "Prefix of the variable. Defaults to '${'"
        required: false
        type: "string"
      - name: "variablePostfix"
        in: "query"
        description: "Postfix of the variable. Defaults to '}'"
        required: false
        type: "string"
      - name: "template"
        in: "formData"
        description: "Template file where Variables should be replaced"
        required: true
        type: "file"
      - name: "variables"
        in: "formData"
        description: "Optional additional variables which should be used for the replacement"
        required: false
        type: "object"
      - name: "failOnMissing"
        in: "formData"
        description: "Optional hint if should fail on missing. Defaults to false"
        required: false
        type: "boolean"
        default: false
      responses:
        200:
          description: "Successfully retrieved configurations"
          schema:
            $ref: "#/definitions/Resource"
        401:
          description: "You are not authorized to view the configurations"
        403:
          description: "Accessing the configurations you were trying to reach is forbidden"
        404:
          description: "At least one of the parameters passed are not known to the\
            \ system"
  /external/configurations/replaceWithString:
    post:
      tags:
      - "configuration"
      summary: "Replaces the contents of the given file with the values from ConfigSeeder"
      description: ""
      operationId: "templateReplaceString"
      consumes:
      - "multipart/form-data"
      parameters:
      - name: "configuration"
        in: "formData"
        description: "Configuration Request"
        required: true
        type: "string"
      - name: "variablePrefix"
        in: "query"
        description: "Prefix of the variable. Defaults to '${'"
        required: false
        type: "string"
      - name: "variablePostfix"
        in: "query"
        description: "Postfix of the variable. Defaults to '}'"
        required: false
        type: "string"
      - name: "template"
        in: "formData"
        description: "Template file where Variables should be replaced"
        required: true
        type: "string"
      - name: "variables"
        in: "formData"
        description: "Optional additional variables which should be used for the replacement"
        required: false
        type: "string"
      - name: "failOnMissing"
        in: "formData"
        description: "Optional hint if should fail on missing. Defaults to false"
        required: false
        type: "boolean"
        default: false
      responses:
        200:
          description: "Successfully retrieved configurations"
          schema:
            type: "string"
        401:
          description: "You are not authorized to view the configurations"
        403:
          description: "Accessing the configurations you were trying to reach is forbidden"
        404:
          description: "At least one of the parameters passed are not known to the\
            \ system"
securityDefinitions:
  Authorization:
    type: "apiKey"
    name: "Authorization"
    in: "header"
definitions:
  ConfigurationRequest:
    type: "object"
    required:
    - "configurations"
    properties:
      tenantKey:
        description: "The key of the Tenant. Defaults to 'default'"
        $ref: "#/definitions/TenantKey"
      environmentKey:
        type: "string"
        description: "Filter values by the given key of the environment"
      context:
        type: "string"
        description: "Filters values by the given context. If empty, context specific\
          \ entries will be ignored."
      version:
        type: "string"
        description: "Filters values by the given version. If empty, version specific\
          \ entries will be ignored."
      dateTime:
        type: "string"
        format: "date-time"
        description: "Filters values by the given date time. If empty, date specific\
          \ entries will be ignored."
      configurations:
        type: "array"
        description: "All configuration groups from which values should be retrieved.\
          \ At least one."
        items:
          $ref: "#/definitions/ConfigurationRequestGroup"
      fullForNonFiltered:
        type: "boolean"
        description: "If enabled for all non filtered fields all values will be returned.\
          \ Note that then keys will be not unique."
    description: "Represents a configuration request"
  ConfigurationRequestGroup:
    type: "object"
    required:
    - "groupKey"
    properties:
      groupKey:
        type: "string"
        description: "The unique key defined on a ConfigurationGroup."
      versionNumber:
        type: "integer"
        format: "int32"
        description: "The version of the ConfigurationGroup to be retrieved. Only\
          \ needed if selectionMode is VERSION_NUMBER"
      selectionMode:
        type: "string"
        description: "The selection mode of the version of a ConfigurationGroup. Defaults\
          \ to LATEST."
        enum:
        - "LATEST"
        - "LATEST_RELEASED"
        - "VERSION_NUMBER"
    description: "Represents a configuration request of a specific configuration group"
  ConfigurationValue:
    type: "object"
    required:
    - "configurationValueId"
    - "key"
    - "type"
    - "value"
    properties:
      key:
        type: "string"
        description: "Key of the configuration value"
      value:
        type: "string"
        description: "Serialized configuration value"
      type:
        type: "string"
        description: "Type of the configuration value"
        enum:
        - "STRING"
        - "MULTILINE_STRING"
        - "INTEGER"
        - "NUMBER"
        - "BOOLEAN"
      configurationValueId:
        type: "string"
        description: "Internal id of the configuration value"
      secured:
        type: "boolean"
        description: "Hint if the attribute as flagged as secured"
      environment:
        type: "string"
        description: "For which environment the configuration value is designed. If\
          \ empty it's default for all"
      environmentId:
        description: "For which environment the configuration value is designed. If\
          \ empty it's default for all"
        $ref: "#/definitions/EnvironmentId"
      validFrom:
        type: "string"
        format: "date-time"
        description: "From which time on this entry is valid"
      validTo:
        type: "string"
        format: "date-time"
        description: "Until which time on this entry is valid"
      versionFrom:
        type: "string"
        description: "From which version this entry is valid"
      versionTo:
        type: "string"
        description: "From which version this entry is valid"
      context:
        type: "string"
        description: "To which context this value is bound"
      lastUpdateInMilliseconds:
        type: "integer"
        format: "int64"
        description: "Last update in milliseconds."
      lastUpdate:
        type: "string"
        format: "date-time"
        description: "Last update."
    description: "Representation of a configuration value."
  EnvironmentId:
    type: "object"
  InputStream:
    type: "object"
  Resource:
    type: "object"
    properties:
      readable:
        type: "boolean"
      url:
        type: "string"
        format: "url"
      file:
        type: "file"
      open:
        type: "boolean"
      description:
        type: "string"
      uri:
        type: "string"
        format: "uri"
      filename:
        type: "string"
      inputStream:
        $ref: "#/definitions/InputStream"
  TenantKey:
    type: "object"
