File: watcher-api-v1-strategies.inc

package info (click to toggle)
watcher 14.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,764 kB
  • sloc: python: 48,904; xml: 312; sh: 265; makefile: 75
file content (164 lines) | stat: -rw-r--r-- 3,318 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
.. -*- rst -*-

==========
Strategies
==========

A ``Strategy`` is an algorithm implementation which is able to find a
``Solution`` for a given ``Goal``. To get more information about strategies
that are shipped along with Watcher, visit `strategies page`_.

There may be several potential strategies which are able to achieve the same
``Goal``. This is why it is possible to configure which specific ``Strategy``
should be used for each goal.

Some strategies may provide better optimization results but may take more time
to find an optimal ``Solution``.

.. _`strategies page`: https://docs.openstack.org/watcher/latest/strategies/index.html

List Strategy
=============

.. rest_method::  GET /v1/strategies

Returns a list of Strategy resources.

Normal response codes: 200

Error codes: 400,401

Request
-------

.. rest_parameters:: parameters.yaml

   - goal: r_goal
   - limit: limit
   - sort_dir: sort_dir
   - sort_key: sort_key

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: strategy_name
    - display_name: strategy_display_name
    - goal_name: goal_name
    - goal_uuid: goal_uuid
    - links: links

**Example JSON representation of a Strategy:**

.. literalinclude:: samples/strategy-list-response.json
   :language: javascript

List Strategy Detailed
======================

.. rest_method::  GET /v1/strategies/detail

Returns a list of Strategy resources with complete details.

Normal response codes: 200

Error codes: 400,401

Request
-------

.. rest_parameters:: parameters.yaml

   - goal: r_goal
   - limit: limit
   - sort_dir: sort_dir
   - sort_key: sort_key

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: strategy_name
    - display_name: strategy_display_name
    - parameters_spec: strategy_parameters_spec
    - goal_name: goal_name
    - goal_uuid: goal_uuid
    - links: links

**Example JSON representation of a Strategy:**

.. literalinclude:: samples/strategy-list-detailed-response.json
   :language: javascript

Show Strategy
=============

.. rest_method::  GET /v1/strategies/{strategy_ident}

Shows details for a Strategy resource.

Normal response codes: 200

Error codes: 404

Request
-------

.. rest_parameters:: parameters.yaml

   - strategy_ident: strategy_ident

Response
--------

.. rest_parameters:: parameters.yaml

    - uuid: uuid
    - name: strategy_name
    - display_name: strategy_display_name
    - parameters_spec: strategy_parameters_spec
    - goal_name: goal_name
    - goal_uuid: goal_uuid
    - links: links

**Example JSON representation of a Strategy:**

.. literalinclude:: samples/strategy-show-response.json
   :language: javascript

Show Strategy State
===================

.. rest_method::  GET /v1/strategies/{strategy_ident}/state

Retrieve an information about strategy requirements.

Normal response codes: 200

Error codes: 404

Request
-------

.. rest_parameters:: parameters.yaml

   - strategy_ident: strategy_ident

Response
--------

.. rest_parameters:: parameters.yaml

    - state: strategy_check_state
    - comment: strategy_check_comment
    - mandatory: strategy_check_mandatory
    - type: strategy_check_type

**Example JSON representation of a Strategy:**

.. literalinclude:: samples/strategy-state-response.json
   :language: javascript