# (C) Copyright 2014 Riverbed Technology, Inc.
# All rights reserved.

name: sh.optimization
version: "1.0"
title: SteelHead Optimization Service
description: REST API for managing the SteelHead optimization service.
$schema: 'http://support.riverbed.com/apis/service_def/2.2'
id: 'http://support.riverbed.com/apis/sh.optimization/1.0'
provider: 'riverbed'

resources:
    optimization:
        description: Settings for the SteelHead optimization service
        type: object
        properties:
            service_state:
                type: string
                enum: ['running','stopped','stopping','unknown']
                readOnly: true
            restart_needed:
                description: >
                    Some settings may not take effect until the optimization
                    service is restarted.
                type: boolean
                readOnly: true

        links:
            self:
                path: '$/optimization'

            get:
                method: GET
                response:
                    $ref: '#/resources/optimization'

            stop:
                description: Stop the optimization service.
                method: POST
                path: '$/optimization/stop'

            restart:
                description: >
                    Start/Restart the optimization service.  Can be used whether the
                    optimization service is currently running or not.
                method: POST
                path: '$/optimization/restart'
                request:
                    type: object
                    properties:
                        clear_cache:
                            type: boolean