Skip to content

Commit 9811503

Browse files
committed
Cluster user guide - first step
This is a first step to add user guide for cluster service. Will propose more contents in patches that follow. Change-Id: I1f9a8f45f00872c5d2f375b123260d32adaa6d66
1 parent b4b9104 commit 9811503

File tree

14 files changed

+427
-0
lines changed

14 files changed

+427
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
15+
=======================
16+
Using OpenStack Cluster
17+
=======================
18+
19+
Before working with the Cluster service, you'll need to create a connection
20+
to your OpenStack cloud by following the :doc:`connect` user guide. This will
21+
provide you with the ``conn`` variable used by all examples in this guide.
22+
23+
The primary abstractions/resources of the Cluster service are:
24+
25+
.. toctree::
26+
:maxdepth: 1
27+
28+
Profile Type <cluster/profile_type>
29+
Profile <cluster/profile>
30+
Cluster <cluster/cluster>
31+
Node <cluster/node>
32+
Policy Type <cluster/policy_type>
33+
Policy <cluster/policy>
34+
Receiver <cluster/receiver>
35+
Action <cluster/action>
36+
Event <cluster/event>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
====================
15+
Working with Actions
16+
====================
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
=================
15+
Managing Clusters
16+
=================
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
===================
15+
Working with Events
16+
===================
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
==============
15+
Managing Nodes
16+
==============
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
=================
15+
Managing Policies
16+
=================
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
=========================
15+
Working with Policy Types
16+
=========================
17+
18+
.. TODO(Qiming): Implement this guide
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
=================
15+
Managing Profiles
16+
=================
17+
18+
A **profile type** can be treated as the meta-type of a `Profile` object. A
19+
registry of profile types is built when the Cluster service starts. When
20+
creating a `Profile` object, you will indicate the profile type used in its
21+
`spec` property.
22+
23+
24+
List Profiles
25+
~~~~~~~~~~~~~
26+
27+
To examine the list of profiles:
28+
29+
.. literalinclude:: ../../examples/cluster/profile.py
30+
:pyobject: list_profiles
31+
32+
When listing profiles, you can specify the sorting option using the ``sort``
33+
parameter and you can do pagination using the ``limit`` and ``marker``
34+
parameters.
35+
36+
Full example: `manage profile`_
37+
38+
39+
Create Profile
40+
~~~~~~~~~~~~~~
41+
42+
When creating a profile, you will provide a dictionary with keys and values
43+
specified according to the profile type referenced.
44+
45+
.. literalinclude:: ../../examples/cluster/profile.py
46+
:pyobject: create_profile
47+
48+
Optionally, you can specify a ``metadata`` keyword argument that contains some
49+
key-value pairs to be associated with the profile.
50+
51+
Full example: `manage profile`_
52+
53+
54+
Find Profile
55+
~~~~~~~~~~~~
56+
57+
To find a profile based on its name or ID:
58+
59+
.. literalinclude:: ../../examples/cluster/profile.py
60+
:pyobject: find_profile
61+
62+
The Cluster service doesn't allow updating the ``spec`` of a profile. The only
63+
way to achieve that is to create a new profile.
64+
65+
Full example: `manage profile`_
66+
67+
68+
Get Profile
69+
~~~~~~~~~~~~
70+
71+
To get a profile based on its name or ID:
72+
73+
.. literalinclude:: ../../examples/cluster/profile.py
74+
:pyobject: get_profile
75+
76+
Full example: `manage profile`_
77+
78+
79+
Update Profile
80+
~~~~~~~~~~~~~~
81+
82+
After a profile is created, most of its properties are immutable. Still, you
83+
can update a profile's ``name`` and/or ``metadata``.
84+
85+
.. literalinclude:: ../../examples/cluster/profile.py
86+
:pyobject: update_profile
87+
88+
The Cluster service doesn't allow updating the ``spec`` of a profile. The only
89+
way to achieve that is to create a new profile.
90+
91+
Full example: `manage profile`_
92+
93+
94+
Delete Profile
95+
~~~~~~~~~~~~~~
96+
97+
A profile can be deleted after creation, provided that it is not referenced
98+
by any active clusters or nodes. If you attempt to delete a profile that is
99+
still in use, you will get an error message.
100+
101+
.. literalinclude:: ../../examples/cluster/profile.py
102+
:pyobject: delete_profile
103+
104+
105+
.. _manage profile: http://git.openstack.org/cgit/openstack/python-openstacksdk/tree/examples/cluster/profile.py
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
==========================
15+
Working with Profile Types
16+
==========================
17+
18+
A **profile** is a template used to create and manage nodes, i.e. objects
19+
exposed by other OpenStack services. A profile encodes the information needed
20+
for node creation in a property named ``spec``.
21+
22+
23+
List Profile Types
24+
~~~~~~~~~~~~~~~~~~
25+
26+
To examine the known profile types:
27+
28+
.. literalinclude:: ../../examples/cluster/profile_type.py
29+
:pyobject: list_profile_types
30+
31+
Full example: `manage profile type`_
32+
33+
34+
Get Profile Type
35+
~~~~~~~~~~~~~~~~
36+
37+
To get the details about a profile type, you need to provide the name of it.
38+
39+
.. literalinclude:: ../../examples/cluster/profile_type.py
40+
:pyobject: get_profile_type
41+
42+
Full example: `manage profile type`_
43+
44+
.. _manage profile type: http://git.openstack.org/cgit/openstack/python-openstacksdk/tree/examples/cluster/profile_type.py
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
..
2+
Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
not use this file except in compliance with the License. You may obtain
4+
a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
License for the specific language governing permissions and limitations
12+
under the License.
13+
14+
==================
15+
Managing Receivers
16+
==================
17+
18+
.. TODO(Qiming): Implement this guide

0 commit comments

Comments
 (0)