Fix typos (#5325)

Fix typos (#5325)

###
  # Get a list of applications
  #
  get:
    description:
      Get the list of running applications. Several filters can be applied via the following query parameters.
    is: [ secured ]
    queryParameters:
      cmd:
        required: false
        description: Filter the result to only return apps whose `cmd` field contains the given value
        example: java
      id:
        required: false
        description: Filter the result to only return apps whose `id` is or contains the given value
        example: /us-east/database/memsql
      label:
        required: false
        description:
          A label selector query contains one or more label selectors, which are comma separated.
          Marathon supports three types of selectors existence-based, equality-based and set-based.
          In the case of multiple selectors, all must be satisfied so comma separator acts as an AND logical operator.
          Labels and values must consist of alphanumeric characters plus `-` `_` and `.` `-A-Za-z0-9_.`.
          Any other character is possible, but must be escaped with a backslash character.

          * Existence based Selector Query Matches the existence of a label

            Example: my_label,environment

          * Equality based Selector Query Matches existence of labels and the (non) equality of the value.

            Example: environment==production, tier!=frontend

          * Set based Selector Query Matches existence of labels and the (non) existence of the value in a given set

            Example: environment in (stage,production), tier notin (frontend, service)

        example: my_label, environment==production, tier!=frontend\ tier, deployed in (us, eu), deployed notin (aa, bb)
      embed:
        required: false
        description:
          Embeds nested resources that match the supplied path.
          You can specify this parameter multiple times with different values.

          - apps.tasks embed all tasks of each application

          Note: if this embed is definded, it automatically sets apps.deployments but this will change in a future release.
          Please define all embeds explicitly.

          - apps.counts embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)

          Note: currently embedded by default but this will change in a future release.
          Please define all embeds explicitly.

          - apps.deployments embed all deployment identifier, if the related app currently is in deployment.

          - apps.readiness embed all readiness check results

          - apps.lastTaskFailure embeds the lastTaskFailure for the application if there is one.

          - apps.failures Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.

          Note: deprecated and will be removed in future versions
          Please define all embeds explicitly.

          - apps.taskStats exposes task statistics in the JSON.

        enum: [ apps.tasks, apps.count, apps.deployments, apps.lastTaskFailure, apps.failures, apps.taskStats ]
        example: apps.tasks
    responses:
      200:
        description: "The list of applications that match the defined filters"
        body:
          application/json:
            example: !include examples/app_list.json

  ###
  # update a list of applications
  #
  put:
    description:
      Change multiple applications either by upgrading existing ones or creating new ones.
      If there is an update to an already running application, the application gets upgraded.
      All instances of this application get replaced by the new version.
      The order of dependencies will be applied correctly.
      The upgradeStrategy defines the behaviour of the upgrade.

      If the id of the application is not known, the application gets started.
      The order of dependencies will be applied correctly.
      It is possible to mix upgrades and installs.

      If you have more complex scenarios with upgrades, use the groups endpoint.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    queryParameters:
      partialUpdate:
        required: false
        default: true
        description: |
          Without specifying this parameter, this method has a patch like semantic:
          All values that are not defined in the json, will not change existing values.
          This was the default behaviour in previous Marathon versions.
          For backward compatibility, we will not change this behaviour, but let users opt in for a proper PUT.
          Note: We will change the default behaviour in the next Marathon version to support PATCH and PUT as HTTP methods.
    body:
      application/json:
        example: !include examples/apps_create.json
        type: app.App[]
    responses:
      409:
        description: There is an already deployed application with this name
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"An app with id [/existing_app] already exists."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
               {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be preocessed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                    }
                  ]
                }

  ###
  # apply a patch update to a list of applications
  #
  patch:
    description:
      Change multiple existing applications by applying a patch.
      All instances of these applications get replaced by the new version.
      The order of dependencies will be applied correctly.
      Each upgradeStrategy defines the behaviour of the upgrade for the related app.

      The whole operation fails if the IDs of one or more applications are unknown.
      The order of dependencies will be applied correctly.

      If you have more complex scenarios with upgrades, use the groups endpoint.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    queryParameters:
    body:
      application/json:
        example: !include examples/apps_patch.json
        type: app.App[]
    responses:
      409:
        description: One or more specified applications is currently locked by a deployment
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"App is locked by one or more deployments."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
               {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be processed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                    }
                  ]
                }

  ###
  # Create application
  #
  post:
    description:
      Create and start a new application.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    body:
      application/json:
        example: !include examples/app.json
        type: app.App
    responses:
      201:
        description: The application has been created and a deployment is started.
        body:
          application/json:
            example: !include examples/app.json
      409:
        description: There is an already deployed application with this name
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"An app with id [/existing_app] already exists."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be preocessed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                "message": "Object is not valid",
                "details": [
                  {
                    "path": "/upgradeStrategy/minimumHealthCapacity",
                    "errors": [
                      "is greater than 1"
                    ]
                  }
                ]
                }

  /{app_id}:

    ###
    # Get a specific app
    #
    get:
      description:
        Get the application with id `app_id`.
        The response includes some status information besides the current configuration of the app.
        You can specify optional embed arguments, to get more embedded information.
      is: [ secured ]
      queryParameters:
        embed:
          description:
            Embeds nested resources that match the supplied path.
            You can specify this parameter multiple times with different values.

            - app.tasks. embed tasks
            Note: if this embed is definded, it automatically sets apps.deployments but this will change in a future release.
            Please define all embeds explicitly.

            - app.counts. embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)

            Note: currently embedded by default but this will change in a future release.
            Please define all embeds explicitly.

            - app.deployments. embed all deployment identifier, if the related app currently is in deployment.

            - app.readiness embed all readiness check results

            - app.lastTaskFailure embeds the lastTaskFailure for the application if there is one.

            - app.failures Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.

            Note: deprecated and will be removed in future versions
            Please define all embeds explicitly.

            - app.taskStats exposes task statistics in the JSON.

          enum: [ app.tasks, app.count, app.deployments, app.lastTaskFailure, app.failures, app.taskStats ]
          #example: embed=app.deployments&embed=app.lastTaskFailure
      responses:
        200:
          body:
            application/json:
              #type: app.AppList
              example: !include examples/app_list.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                { "message": "App '/not_existent' does not exist" }

    ###
    # Update a specific app
    #
    put:
      description:
        Replaces parameters of a running application. If no application with the given id
        exists, it will be created. If there is an application with this id, all running instances get
        upgraded to the new definition.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
         You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      queryParameters:
        partialUpdate:
          required: false
          default: true
          description: |
            Without specifying this parameter, this method has a patch like semantic:
            All values that are not defined in the json, will not change existing values.
            This was the default behaviour in previous Marathon versions.
            For backward compatibility, we will not change this behaviour, but let users opt in for a proper PUT.
            Note: We will change the default behaviour in the next Marathon version to support PATCH and PUT as HTTP methods.
      body:
        application/json:
          example: !include examples/app.json
          type: app.App
      responses:
        201:
          description: The application has been created and a deployment is started.
          body:
            application/json:
              example: !include examples/deployments_result.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                  { "message": "App '/not_existent' does not exist" }
        400:
          description: The application definition provided in the body is not valid.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
        422:
          description: The entity sent can not be preocessed, since there are validation errors
          body:
            application/json:
              type: error.Error
              example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                   }
                  ]
                }

    ###
    # Apply a patch update to a specific app.
    #
    patch:
      description:
        Replaces parameters of a running application. All running instances get upgraded to the new definition.
        Any given application ID will be ignored.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
         You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      queryParameters:
      body:
        application/json:
          example: !include examples/app_patch.json
          type: app.App
      responses:
        200:
          description: The application has been updated and a deployment is started.
          body:
            application/json:
              example: !include examples/deployments_result.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                  { "message": "App '/not_existent' does not exist" }
        400:
          description: The application definition provided in the body is not valid.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
        422:
          description: The entity sent can not be preocessed, since there are validation errors
          body:
            application/json:
              type: error.Error
              example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                   }
                  ]
                }

    ###
    # Delete a specific app
    #
    delete:
      description: Destroy an application. All data about that application will be deleted.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
        You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      responses:
        404:
          description: No app with this id known.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"App '/not-existing' does not exist"}

    /restart:
      ###
      # Restart this application
      #
      post:
        description: Restart all tasks of this application.
        is: [ secured, deployable ]
        responses:
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                type: error.Error
                example: |
                  { "message": "App '/not_existent' does not exist" }

    /tasks:
      ###
      # Get all tasks of an application
      #
      get:
        description: List all running tasks for application `app_id`.
        is: [ secured ]
        responses:
          200:
            description: The list of running tasks for application `app_id`.
            body:
              application/json:
                example: !include examples/app_tasks.json
              text/plain:
                example: |
                    minecraft_survival-world 10013 srv7.hw.ca1.mesosphere.com:31756
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                example: |
                  { "message": "App '/not_existent' does not exist" }

      ###
      # Kill tasks of an application
      #
      delete:
        description: Kill tasks that belong to the application `app_id`
        is: [ secured, deployable ]
        queryParameters:
          host:
            description: all tasks of that application on the supplied slave are killed
          scale:
            type: boolean
            description: If `scale=true` is specified, then the application is scaled down by the number of killed tasks. Only possible if `wipe=false` or not specified.
            default: false
          wipe:
            type: boolean
            description: If `wipe=true` is specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible if `scale=false` or not specified.
            default: false
        responses:

          200:
            description: If scale=false, all tasks that were killed are returned.
              If scale=true, than a deployment is triggered and the deployment is returned.
            body:
              application/json:
                example: !include examples/app_tasks.json
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                example: |
                  { "message": "App '/not_existent' does not exist" }

      /{task_id}:
        ###
        # Create application
        #
        delete:
          description: Kill the task with ID `task_id` that belongs to the application `app_id`.
          is: [ secured, deployable ]
          queryParameters:
            scale:
              type: boolean
              description: If `scale=true` is specified, then the application is scaled down by the number of killed tasks. Only possible if `wipe=false` or not specified.
              default: false
            wipe:
              type: boolean
              description: If `wipe=true` is specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible if `scale=false` or not specified.
              default: false
          responses:
            200:
              description: If scale=false, the task that was killed is returned.
                If scale=true, than a deployment is triggered and the deployment is returned.
              body:
                application/json:
                  example: !include examples/app_task.json
            404:
              description: No task found with this task_id.
              body:
                application/json:
                  type: error.Error
                  example: |
                    {"message":"Task 'not-existing' does not exist"}

    ###
    # List versions
    #
    /versions:
      get:
        description: List the versions of the application with id `app_id`
        is: [ secured ]
        responses:
          200:
            description: The list of versions of the application
            body:
              application/json:
                example: |
                  { "versions": [ "2014-03-01T23:42:20.938Z" ] }
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                type: error.Error
                example: |
                  { "message": "App '/not_existent' does not exist" }

      /{version}:
        get:
          description: List the configuration of the application with id `app_id` at version `version`.
          is: [ secured ]
          responses:
            200:
              description: The application definition at that point in time.
              body:
                application/json:
                  type: app.App
                  example: !include examples/app.json
            404:
              description: No task found with this `app_id`.
              body:
                application/json:
                  example: |
                    { "message": "App '/not_existent' does not exist" }

###
  # Get a list of applications
  #
  get:
    description:
      Get the list of running applications. Several filters can be applied via the following query parameters.
    is: [ secured ]
    queryParameters:
      cmd:
        required: false
        description: Filter the result to only return apps whose `cmd` field contains the given value
        example: java
      id:
        required: false
        description: Filter the result to only return apps whose `id` is or contains the given value
        example: /us-east/database/memsql
      label:
        required: false
        description:
          A label selector query contains one or more label selectors, which are comma separated.
          Marathon supports three types of selectors existence-based, equality-based and set-based.
          In the case of multiple selectors, all must be satisfied so comma separator acts as an AND logical operator.
          Labels and values must consist of alphanumeric characters plus `-` `_` and `.` `-A-Za-z0-9_.`.
          Any other character is possible, but must be escaped with a backslash character.

          * Existence based Selector Query Matches the existence of a label

            Example: my_label,environment

          * Equality based Selector Query Matches existence of labels and the (non) equality of the value.

            Example: environment==production, tier!=frontend

          * Set based Selector Query Matches existence of labels and the (non) existence of the value in a given set

            Example: environment in (stage,production), tier notin (frontend, service)

        example: my_label, environment==production, tier!=frontend\ tier, deployed in (us, eu), deployed notin (aa, bb)
      embed:
        required: false
        description:
          Embeds nested resources that match the supplied path.
          You can specify this parameter multiple times with different values.

          - apps.tasks embed all tasks of each application

          Note: if this embed is definded, it automatically sets apps.deployments but this will change in a future release.
          Please define all embeds explicitly.

          - apps.counts embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)

          Note: currently embedded by default but this will change in a future release.
          Please define all embeds explicitly.

          - apps.deployments embed all deployment identifier, if the related app currently is in deployment.

          - apps.readiness embed all readiness check results

          - apps.lastTaskFailure embeds the lastTaskFailure for the application if there is one.

          - apps.failures Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.

          Note: deprecated and will be removed in future versions
          Please define all embeds explicitly.

          - apps.taskStats exposes task statatistics in the JSON.

        enum: [ apps.tasks, apps.count, apps.deployments, apps.lastTaskFailure, apps.failures, apps.taskStats ]
        example: apps.tasks
    responses:
      200:
        description: "The list of applications that match the defined filters"
        body:
          application/json:
            example: !include examples/app_list.json

  ###
  # update a list of applications
  #
  put:
    description:
      Change multiple applications either by upgrading existing ones or creating new ones.
      If there is an update to an already running application, the application gets upgraded.
      All instances of this application get replaced by the new version.
      The order of dependencies will be applied correctly.
      The upgradeStrategy defines the behaviour of the upgrade.

      If the id of the application is not known, the application gets started.
      The order of dependencies will be applied correctly.
      It is possible to mix upgrades and installs.

      If you have more complex scenarios with upgrades, use the groups endpoint.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    queryParameters:
      partialUpdate:
        required: false
        default: true
        description: |
          Without specifying this parameter, this method has a patch like semantic:
          All values that are not defined in the json, will not change existing values.
          This was the default behaviour in previous Marathon versions.
          For backward compatibility, we will not change this behaviour, but let users opt in for a proper PUT.
          Note: We will change the default behaviour in the next Marathon version to support PATCH and PUT as HTTP methods.
    body:
      application/json:
        example: !include examples/apps_create.json
        type: app.App[]
    responses:
      409:
        description: There is an already deployed application with this name
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"An app with id [/existing_app] already exists."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
               {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be preocessed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                    }
                  ]
                }

  ###
  # apply a patch update to a list of applications
  #
  patch:
    description:
      Change multiple existing applications by applying a patch.
      All instances of these applications get replaced by the new version.
      The order of dependencies will be applied correctly.
      Each upgradeStrategy defines the behaviour of the upgrade for the related app.

      The whole operation fails if the IDs of one or more applications are unknown.
      The order of dependencies will be applied correctly.

      If you have more complex scenarios with upgrades, use the groups endpoint.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    queryParameters:
    body:
      application/json:
        example: !include examples/apps_patch.json
        type: app.App[]
    responses:
      409:
        description: One or more specified applications is currently locked by a deployment
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"App is locked by one or more deployments."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
               {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be processed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                    }
                  ]
                }

  ###
  # Create application
  #
  post:
    description:
      Create and start a new application.

      Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
       You can query the deployments endoint to see the status of the deployment.
    is: [ secured, deployable ]
    body:
      application/json:
        example: !include examples/app.json
        type: app.App
    responses:
      201:
        description: The application has been created and a deployment is started.
        body:
          application/json:
            example: !include examples/app.json
      409:
        description: There is an already deployed application with this name
        body:
          application/json:
            type: error.Error
            example: |
              {"message":"An app with id [/existing_app] already exists."}
      400:
        description: The application definition provided in the body is not valid.
        body:
          application/json:
            type: error.Error
            example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
      422:
        description: The entity send can not be preocessed, since there are validation errors
        body:
          application/json:
            type: error.Error
            example: |
                {
                "message": "Object is not valid",
                "details": [
                  {
                    "path": "/upgradeStrategy/minimumHealthCapacity",
                    "errors": [
                      "is greater than 1"
                    ]
                  }
                ]
                }

  /{app_id}:

    ###
    # Get a specific app
    #
    get:
      description:
        Get the application with id `app_id`.
        The response includes some status information besides the current configuration of the app.
        You can specify optional embed arguments, to get more embedded information.
      is: [ secured ]
      queryParameters:
        embed:
          description:
            Embeds nested resources that match the supplied path.
            You can specify this parameter multiple times with different values.

            - app.tasks. embed tasks
            Note: if this embed is definded, it automatically sets apps.deployments but this will change in a future release.
            Please define all embeds explicitly.

            - app.counts. embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)

            Note: currently embedded by default but this will change in a future release.
            Please define all embeds explicitly.

            - app.deployments. embed all deployment identifier, if the related app currently is in deployment.

            - app.readiness embed all readiness check results

            - app.lastTaskFailure embeds the lastTaskFailure for the application if there is one.

            - app.failures Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.

            Note: deprecated and will be removed in future versions
            Please define all embeds explicitly.

            - app.taskStats exposes task statatistics in the JSON.

          enum: [ app.tasks, app.count, app.deployments, app.lastTaskFailure, app.failures, app.taskStats ]
          #example: embed=app.deployments&embed=app.lastTaskFailure
      responses:
        200:
          body:
            application/json:
              #type: app.AppList
              example: !include examples/app_list.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                { "message": "App '/not_existent' does not exist" }

    ###
    # Update a specific app
    #
    put:
      description:
        Replaces parameters of a running application. If no application with the given id
        exists, it will be created. If there is an application with this id, all running instances get
        upgraded to the new definition.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
         You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      queryParameters:
        partialUpdate:
          required: false
          default: true
          description: |
            Without specifying this parameter, this method has a patch like semantic:
            All values that are not defined in the json, will not change existing values.
            This was the default behaviour in previous Marathon versions.
            For backward compatibility, we will not change this behaviour, but let users opt in for a proper PUT.
            Note: We will change the default behaviour in the next Marathon version to support PATCH and PUT as HTTP methods.
      body:
        application/json:
          example: !include examples/app.json
          type: app.App
      responses:
        201:
          description: The application has been created and a deployment is started.
          body:
            application/json:
              example: !include examples/deployments_result.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                  { "message": "App '/not_existent' does not exist" }
        400:
          description: The application definition provided in the body is not valid.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
        422:
          description: The entity sent can not be preocessed, since there are validation errors
          body:
            application/json:
              type: error.Error
              example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                   }
                  ]
                }

    ###
    # Apply a patch update to a specific app.
    #
    patch:
      description:
        Replaces parameters of a running application. All running instances get upgraded to the new definition.
        Any given application ID will be ignored.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
         You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      queryParameters:
      body:
        application/json:
          example: !include examples/app_patch.json
          type: app.App
      responses:
        200:
          description: The application has been updated and a deployment is started.
          body:
            application/json:
              example: !include examples/deployments_result.json
        404:
          description: No task found with this `app_id`.
          body:
            application/json:
              type: error.Error
              example: |
                  { "message": "App '/not_existent' does not exist" }
        400:
          description: The application definition provided in the body is not valid.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
        422:
          description: The entity sent can not be preocessed, since there are validation errors
          body:
            application/json:
              type: error.Error
              example: |
                {
                  "message": "Object is not valid",
                  "details": [
                    {
                      "path": "/upgradeStrategy/minimumHealthCapacity",
                      "errors": [
                        "is greater than 1"
                      ]
                   }
                  ]
                }

    ###
    # Delete a specific app
    #
    delete:
      description: Destroy an application. All data about that application will be deleted.

        Note:  This operation will create a deployment. The operation finishes, if the deployment succeeds.
        You can query the deployments endoint to see the status of the deployment.
      is: [ secured, deployable ]
      responses:
        404:
          description: No app with this id known.
          body:
            application/json:
              type: error.Error
              example: |
                {"message":"App '/not-existing' does not exist"}

    /restart:
      ###
      # Restart this application
      #
      post:
        description: Restart all tasks of this application.
        is: [ secured, deployable ]
        responses:
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                type: error.Error
                example: |
                  { "message": "App '/not_existent' does not exist" }

    /tasks:
      ###
      # Get all tasks of an application
      #
      get:
        description: List all running tasks for application `app_id`.
        is: [ secured ]
        responses:
          200:
            description: The list of running tasks for application `app_id`.
            body:
              application/json:
                example: !include examples/app_tasks.json
              text/plain:
                example: |
                    minecraft_survival-world 10013 srv7.hw.ca1.mesosphere.com:31756
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                example: |
                  { "message": "App '/not_existent' does not exist" }

      ###
      # Kill tasks of an application
      #
      delete:
        description: Kill tasks that belong to the application `app_id`
        is: [ secured, deployable ]
        queryParameters:
          host:
            description: all tasks of that application on the supplied slave are killed
          scale:
            type: boolean
            description: If `scale=true` is specified, then the application is scaled down by the number of killed tasks. Only possible if `wipe=false` or not specified.
            default: false
          wipe:
            type: boolean
            description: If `wipe=true` is specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible if `scale=false` or not specified.
            default: false
        responses:

          200:
            description: If scale=false, all tasks that were killed are returned.
              If scale=true, than a deployment is triggered and the deployment is returned.
            body:
              application/json:
                example: !include examples/app_tasks.json
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                example: |
                  { "message": "App '/not_existent' does not exist" }

      /{task_id}:
        ###
        # Create application
        #
        delete:
          description: Kill the task with ID `task_id` that belongs to the application `app_id`.
          is: [ secured, deployable ]
          queryParameters:
            scale:
              type: boolean
              description: If `scale=true` is specified, then the application is scaled down by the number of killed tasks. Only possible if `wipe=false` or not specified.
              default: false
            wipe:
              type: boolean
              description: If `wipe=true` is specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible if `scale=false` or not specified.
              default: false
          responses:
            200:
              description: If scale=false, the task that was killed is returned.
                If scale=true, than a deployment is triggered and the deployment is returned.
              body:
                application/json:
                  example: !include examples/app_task.json
            404:
              description: No task found with this task_id.
              body:
                application/json:
                  type: error.Error
                  example: |
                    {"message":"Task 'not-existing' does not exist"}

    ###
    # List versions
    #
    /versions:
      get:
        description: List the versions of the application with id `app_id`
        is: [ secured ]
        responses:
          200:
            description: The list of versions of the application
            body:
              application/json:
                example: |
                  { "versions": [ "2014-03-01T23:42:20.938Z" ] }
          404:
            description: No task found with this `app_id`.
            body:
              application/json:
                type: error.Error
                example: |
                  { "message": "App '/not_existent' does not exist" }

      /{version}:
        get:
          description: List the configuration of the application with id `app_id` at version `version`.
          is: [ secured ]
          responses:
            200:
              description: The application definition at that point in time.
              body:
                application/json:
                  type: app.App
                  example: !include examples/app.json
            404:
              description: No task found with this `app_id`.
              body:
                application/json:
                  example: |
                    { "message": "App '/not_existent' does not exist" }


minor update to the raml spec

minor update to the raml spec

#%RAML 1.0
title: restful-zookeeper-properties
version: 1.0
description: The REST API to access property sets stored in ZooKeeper
/properties:
  get:
    description: List all property set names
    responses:
      200:
        description: Will return a list with all known property set names
        body:
          application/json:
            example: |
                ["system","my-props","some-other-props"]
  /{propertySetName}:
    get:
      description: Get all properties for named property set
      responses:
        200:
          description: A successful fetch of the properties
          body:
            application/json:
              example: |
                {port:"6969",host:"127.0.0.1"}
        404:
          description: No property set with the provided name exists
    delete:
      description: Delete an entire named property set
      responses:
        204:
          description: The property set was successfully deleted
    put:
      description: Sets all properties for a named property set
      body:
        application/json:
          example: |
            {port:"6969",host:"127.0.0.1"}
      responses:
        201:
          description: The property set was successfully created
        400:
          description: If no name is provided for the property set

#%RAML 1.0
title: restful-zookeeper-properties
version: 1.0
description: The REST API to access property sets stored in ZooKeeper
/properties:
  get:
    description: List all property set names
    responses:
      200:
        description: Will return a list with all known names
        body:
          application/json:
            example: |
                ["system","my-props","some-other-props"]
  /{propertyName}:
    get:
      description: Get all properties for named property set
      responses:
        200:
          description: A successful fetch of the properties
          body:
            application/json:
              example: |
                {port:"6969",host:"127.0.0.1"}
        404:
          description: No property set with the provided name exists
    delete:
      description: Delete an entire named property set
      responses:
        204:
          description: The property set was successfully deleted
    put:
      description: Sets all properties for a named property set
      body:
        application/json:
          example: |
            {port:"6969",host:"127.0.0.1"}
      responses:
        201:
          description: The property set was successfully created
        400:
          description: If no name is provided for the property set


Remove allow auth create ACE

Remove allow auth create ACE

#%RAML 0.8
---
title: Example REST API
documentation:
    - title: Home
      content: |
        Welcome to the example API.
baseUri: http://{host}:{port}/{version}
version: v1
mediaType: application/json
protocols: [HTTP, HTTPS]
securitySchemes:
    - x_token_auth:
        description: Authorization header token policy
        type: x-ApiKey
    - x_ticket_auth:
        description: Standard Pyramid Auth Ticket policy
        type: x-Ticket
        settings:
            secret: auth_tkt_secret
            hashalg: sha512
            cookie_name: ramses_auth_tkt
            http_only: true
    - item_owner_acl:
        description: ACL that allows everyone to read, authenticated to create and item owners to edit item
        type: x-ACL
        settings:
            collection: |
                allow g:admin all
                allow everyone view,options
                allow authenticated create
            item: |
                allow g:admin all
                allow everyone view,options
                allow {{item_owner}} update
    - user_self_acl:
        description: ACL that allows everyone to read, authenticated to create and owner to edit
        type: x-ACL
        settings:
            collection: |
                allow g:admin all
                allow everyone view,options
            item: |
                allow g:admin all
                allow everyone view,options
                allow {{user_self}} update
securedBy: [x_ticket_auth]

/users:
    securedBy: [user_self_acl]
    displayName: All users
    get:
        description: Get all users
    post:
        description: Create a new user
        body:
            application/json:
                schema: !include schemas/user.json
    patch:
        description: Update multiple users
    head:
        description: Determine whether a given resource is available
    options:
        description: Retrieve the available HTTP verbs for a given resource

    /{username}:
        displayName: One user
        get:
            description: Get a particular user
        patch:
        put:
            description: Update a particular user
        delete:
            description: Delete a particular user

        /settings:
            displayName: User settings
            get:
                description: Get all settings of a particular user
            post:
                description: Change a user's settings

        /groups:
            displayName: User groups
            get:
                description: Get all groups of a particular user
            post:
                description: Change a user's groups

        /profile:
            displayName: User profile
            get:
                description: Get a user's profile
            post:
                description: Create a user's profile
                body:
                    application/json:
                        schema: !include schemas/profile.json
            patch:
                description: Update a user's profile

/stories:
    securedBy: [item_owner_acl]
    displayName: All stories
    get:
        description: Get all stories
    post:
        description: Create a new story
        body:
            application/json:
                schema: !include schemas/story.json
    patch:
        description: Update multiple stories
    delete:
        description: Delete multiple stories
    head:
        description: Determine whether a given resource is available
    options:
        description: Retrieve the available HTTP verbs for a given resource

    /{id}:
        displayName: One story
        get:
            description: Get a particular story
        delete:
            description: Delete a particular story
        patch:
        put:
            description: Update a particular story
        head:
            description: Determine whether a given resource is available
        options:
            description: Retrieve the available HTTP verbs for a given resource

#%RAML 0.8
---
title: Example REST API
documentation:
    - title: Home
      content: |
        Welcome to the example API.
baseUri: http://{host}:{port}/{version}
version: v1
mediaType: application/json
protocols: [HTTP, HTTPS]
securitySchemes:
    - x_token_auth:
        description: Authorization header token policy
        type: x-ApiKey
    - x_ticket_auth:
        description: Standard Pyramid Auth Ticket policy
        type: x-Ticket
        settings:
            secret: auth_tkt_secret
            hashalg: sha512
            cookie_name: ramses_auth_tkt
            http_only: true
    - item_owner_acl:
        description: ACL that allows everyone to read, authenticated to create and item owners to edit item
        type: x-ACL
        settings:
            collection: |
                allow g:admin all
                allow everyone view,options
                allow authenticated create
            item: |
                allow g:admin all
                allow everyone view,options
                allow {{item_owner}} update
    - user_self_acl:
        description: ACL that allows everyone to read, authenticated to create and owner to edit
        type: x-ACL
        settings:
            collection: |
                allow g:admin all
                allow everyone view,options
                allow authenticated create
            item: |
                allow g:admin all
                allow everyone view,options
                allow {{user_self}} update
securedBy: [x_ticket_auth]

/users:
    securedBy: [user_self_acl]
    displayName: All users
    get:
        description: Get all users
    post:
        description: Create a new user
        body:
            application/json:
                schema: !include schemas/user.json
    patch:
        description: Update multiple users
    head:
        description: Determine whether a given resource is available
    options:
        description: Retrieve the available HTTP verbs for a given resource

    /{username}:
        displayName: One user
        get:
            description: Get a particular user
        patch:
        put:
            description: Update a particular user
        delete:
            description: Delete a particular user

        /settings:
            displayName: User settings
            get:
                description: Get all settings of a particular user
            post:
                description: Change a user's settings

        /groups:
            displayName: User groups
            get:
                description: Get all groups of a particular user
            post:
                description: Change a user's groups

        /profile:
            displayName: User profile
            get:
                description: Get a user's profile
            post:
                description: Create a user's profile
                body:
                    application/json:
                        schema: !include schemas/profile.json
            patch:
                description: Update a user's profile

/stories:
    securedBy: [item_owner_acl]
    displayName: All stories
    get:
        description: Get all stories
    post:
        description: Create a new story
        body:
            application/json:
                schema: !include schemas/story.json
    patch:
        description: Update multiple stories
    delete:
        description: Delete multiple stories
    head:
        description: Determine whether a given resource is available
    options:
        description: Retrieve the available HTTP verbs for a given resource

    /{id}:
        displayName: One story
        get:
            description: Get a particular story
        delete:
            description: Delete a particular story
        patch:
        put:
            description: Update a particular story
        head:
            description: Determine whether a given resource is available
        options:
            description: Retrieve the available HTTP verbs for a given resource


Correcting RAML

Correcting RAML

#%RAML 0.8
---
title: Test RamlWrap API
description: A series of useful APIs that can be used to test RamlWrap functionality.
version:  v0.1
mediaType:  application/json
baseUri: http://example.com

protocols: [HTTP]

/api:
  displayName: API root
  post:
    body:
      application/json:
        schema: !include json/service_request.json
        example: !include json/service_request_example.json
    responses:
        200:
          body:
            application/json:
              example: !include json/service_response.json
        500:
          description: A really unhappy server error.
  /1:
    displayName: API 1
    description: Example API with a post request.
    post:
      body:
        application/json:
          schema: !include json/service_request.json
          example: !include json/service_request_example.json
      responses:
        200:
          body:
            application/json:
    /1.1:
      displayName: API 1.1
      get:
        responses:
        200:
          body:
            application/json:
      /1.1.1:
        displayName: API 1.1.1
        get:
          responses:
          200:
            body:
              application/json:
  /2:
    displayName: API 2
    description: Example API with get request.
    get:
      responses:
        200:
          body:
            application/json:
              example: !include json/example2.json
  /3:
    displayName: API 3
    description: Example API with get and post request with query parameters.
    get:
      queryParameters:
        param1:
          type: string
          required: false
        param2:
          type: string
          minLength: 5
          maxLength: 10
          required: true
        param3:
          type: number
          required: false
      responses:
        200:
          body:
            application/json:
              example: {"exampleData": "You just made a get!"}
    post:
      queryParameters:
        param1:
          type: string
          required: false
        param2:
          type: string
          minLength: 5
          maxLength: 10
          required: true
        param3:
          type: number
          required: false
      responses:
        200:
          body:
            application/json:
              example: {"exampleData": "You just made a post!"}
  /4:
    displayName: API 4
    description: Example API with empty post body.
    post:
      responses:
        200:
          description: Looks good.

#%RAML 0.8
---
title: Test RamlWrap API
description: A series of useful APIs that can be used to test RamlWrap functionality.
version:  v0.1
mediaType:  application/json
baseUri: http://example.com

protocols: [HTTP]

/api:
  displayName: API root
  post:
    body:
      application/json:
        schema: !include json/service_request.json
        example: !include json/service_request_example.json
    responses:
        200:
          body:
            application/json:
              example: !include json/service_response.json
        500:
          description: A really unhappy server error.
  /1:
    displayName: API 1
    description: Example API with a post request.
    post:
      body:
        application/json:
          schema: !include json/service_request.json
          example: !include json/service_request_example.json
      responses:
        200:
          body:
            application/json:
    /1.1:
      displayName: API 1.1
      get:
        responses:
        200:
          body:
            application/json:
      /1.1.1:
        displayName: API 1.1.1
        get:
          responses:
          200:
            body:
              application/json:
  /2:
    displayName: API 2
    description: Example API with get request.
    get:
      responses:
        200:
          body:
            application/json:
              example: !include json/example2.json
  /3:
    displayName: API 3
    description: Example API with get and post request with query parameters.
    get:
      queryParameters:
        param1:
          type: string
          required: false
        param2:
          type: string
          minLength: 5
          maxLength: 10
          required: true
        param3:
          type: number
          required: false
      responses:
        200:
          body:
            application/json:
              example: {"exampleData": "You just made a get!"}
    post:
      queryParameters:
        param1:
          type: string
          required: false
        param2:
          type: string
          minLength: 5
          maxLength: 10
          required: true
        param3:
          type: number
          required: false
      responses:
        200:
          body:
            application/json:
              example: '{"exampleData": "You just made a post!"}'
  /4:
    displayName: API 4
    description: Example API with empty post body.
    post:
      responses:
        200:
          description: Looks good.