Merge ~powersj/cloud-init:docs/datasource into cloud-init:master

Proposed by Joshua Powers
Status: Merged
Approved by: Chad Smith
Approved revision: 59c6911df9eec387113275f4b7771f579f30e606
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~powersj/cloud-init:docs/datasource
Merge into: cloud-init:master
Diff against target: 218 lines (+92/-94)
1 file modified
doc/rtd/topics/datasources.rst (+92/-94)
Reviewer Review Type Date Requested Status
Chad Smith Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+372647@code.launchpad.net

Commit message

docs: cleanup output & order of datasource page

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:59c6911df9eec387113275f4b7771f579f30e606
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1129/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/1129//rebuild

review: Approve (continuous-integration)
Revision history for this message
Chad Smith (chad.smith) wrote :

let's bring some of these home. Thanks Josh

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/rtd/topics/datasources.rst b/doc/rtd/topics/datasources.rst
2index 2148cd5..8e58be9 100644
3--- a/doc/rtd/topics/datasources.rst
4+++ b/doc/rtd/topics/datasources.rst
5@@ -1,89 +1,57 @@
6 .. _datasources:
7
8-***********
9 Datasources
10 ***********
11
12-What is a datasource?
13-=====================
14-
15 Datasources are sources of configuration data for cloud-init that typically
16-come from the user (aka userdata) or come from the stack that created the
17-configuration drive (aka metadata). Typical userdata would include files,
18+come from the user (e.g. userdata) or come from the cloud that created the
19+configuration drive (e.g. metadata). Typical userdata would include files,
20 yaml, and shell scripts while typical metadata would include server name,
21-instance id, display name and other cloud specific details. Since there are
22-multiple ways to provide this data (each cloud solution seems to prefer its
23-own way) internally a datasource abstract class was created to allow for a
24-single way to access the different cloud systems methods to provide this data
25-through the typical usage of subclasses.
26-
27-Any metadata processed by cloud-init's datasources is persisted as
28-``/run/cloud-init/instance-data.json``. Cloud-init provides tooling
29-to quickly introspect some of that data. See :ref:`instance_metadata` for
30-more information.
31-
32-
33-Datasource API
34---------------
35-The current interface that a datasource object must provide is the following:
36-
37-.. sourcecode:: python
38+instance id, display name and other cloud specific details.
39
40- # returns a mime multipart message that contains
41- # all the various fully-expanded components that
42- # were found from processing the raw userdata string
43- # - when filtering only the mime messages targeting
44- # this instance id will be returned (or messages with
45- # no instance id)
46- def get_userdata(self, apply_filter=False)
47-
48- # returns the raw userdata string (or none)
49- def get_userdata_raw(self)
50+Since there are multiple ways to provide this data (each cloud solution seems
51+to prefer its own way) internally a datasource abstract class was created to
52+allow for a single way to access the different cloud systems methods to provide
53+this data through the typical usage of subclasses.
54
55- # returns a integer (or none) which can be used to identify
56- # this instance in a group of instances which are typically
57- # created from a single command, thus allowing programmatic
58- # filtering on this launch index (or other selective actions)
59- @property
60- def launch_index(self)
61-
62- # the data sources' config_obj is a cloud-config formatted
63- # object that came to it from ways other than cloud-config
64- # because cloud-config content would be handled elsewhere
65- def get_config_obj(self)
66-
67- #returns a list of public ssh keys
68- def get_public_ssh_keys(self)
69-
70- # translates a device 'short' name into the actual physical device
71- # fully qualified name (or none if said physical device is not attached
72- # or does not exist)
73- def device_name_to_device(self, name)
74+Any metadata processed by cloud-init's datasources is persisted as
75+``/run/cloud-init/instance-data.json``. Cloud-init provides tooling to quickly
76+introspect some of that data. See :ref:`instance_metadata` for more
77+information.
78
79- # gets the locale string this instance should be applying
80- # which typically used to adjust the instances locale settings files
81- def get_locale(self)
82+Known Sources
83+=============
84
85- @property
86- def availability_zone(self)
87+The following is a list of documents for each supported datasource:
88
89- # gets the instance id that was assigned to this instance by the
90- # cloud provider or when said instance id does not exist in the backing
91- # metadata this will return 'iid-datasource'
92- def get_instance_id(self)
93+.. toctree::
94+ :titlesonly:
95
96- # gets the fully qualified domain name that this host should be using
97- # when configuring network or hostname releated settings, typically
98- # assigned either by the cloud provider or the user creating the vm
99- def get_hostname(self, fqdn=False)
100+ datasources/aliyun.rst
101+ datasources/altcloud.rst
102+ datasources/ec2.rst
103+ datasources/azure.rst
104+ datasources/cloudsigma.rst
105+ datasources/cloudstack.rst
106+ datasources/configdrive.rst
107+ datasources/digitalocean.rst
108+ datasources/exoscale.rst
109+ datasources/fallback.rst
110+ datasources/gce.rst
111+ datasources/maas.rst
112+ datasources/nocloud.rst
113+ datasources/opennebula.rst
114+ datasources/openstack.rst
115+ datasources/oracle.rst
116+ datasources/ovf.rst
117+ datasources/smartos.rst
118
119- def get_package_mirror_info(self)
120
121+Creation
122+========
123
124-Adding a new Datasource
125------------------------
126 The datasource objects have a few touch points with cloud-init. If you
127-are interested in adding a new datasource for your cloud platform you'll
128+are interested in adding a new datasource for your cloud platform you will
129 need to take care of the following items:
130
131 * **Identify a mechanism for positive identification of the platform**:
132@@ -139,31 +107,61 @@ need to take care of the following items:
133 file in ``doc/datasources/<cloudplatform>.rst``
134
135
136-Datasource Documentation
137-========================
138-The following is a list of the implemented datasources.
139-Follow for more information.
140+API
141+===
142
143-.. toctree::
144- :maxdepth: 2
145+The current interface that a datasource object must provide is the following:
146
147- datasources/aliyun.rst
148- datasources/altcloud.rst
149- datasources/azure.rst
150- datasources/cloudsigma.rst
151- datasources/cloudstack.rst
152- datasources/configdrive.rst
153- datasources/digitalocean.rst
154- datasources/ec2.rst
155- datasources/exoscale.rst
156- datasources/maas.rst
157- datasources/nocloud.rst
158- datasources/opennebula.rst
159- datasources/openstack.rst
160- datasources/oracle.rst
161- datasources/ovf.rst
162- datasources/smartos.rst
163- datasources/fallback.rst
164- datasources/gce.rst
165+.. sourcecode:: python
166+
167+ # returns a mime multipart message that contains
168+ # all the various fully-expanded components that
169+ # were found from processing the raw user data string
170+ # - when filtering only the mime messages targeting
171+ # this instance id will be returned (or messages with
172+ # no instance id)
173+ def get_userdata(self, apply_filter=False)
174+
175+ # returns the raw userdata string (or none)
176+ def get_userdata_raw(self)
177+
178+ # returns a integer (or none) which can be used to identify
179+ # this instance in a group of instances which are typically
180+ # created from a single command, thus allowing programmatic
181+ # filtering on this launch index (or other selective actions)
182+ @property
183+ def launch_index(self)
184+
185+ # the data sources' config_obj is a cloud-config formatted
186+ # object that came to it from ways other than cloud-config
187+ # because cloud-config content would be handled elsewhere
188+ def get_config_obj(self)
189+
190+ #returns a list of public ssh keys
191+ def get_public_ssh_keys(self)
192+
193+ # translates a device 'short' name into the actual physical device
194+ # fully qualified name (or none if said physical device is not attached
195+ # or does not exist)
196+ def device_name_to_device(self, name)
197+
198+ # gets the locale string this instance should be applying
199+ # which typically used to adjust the instances locale settings files
200+ def get_locale(self)
201+
202+ @property
203+ def availability_zone(self)
204+
205+ # gets the instance id that was assigned to this instance by the
206+ # cloud provider or when said instance id does not exist in the backing
207+ # metadata this will return 'iid-datasource'
208+ def get_instance_id(self)
209+
210+ # gets the fully qualified domain name that this host should be using
211+ # when configuring network or hostname related settings, typically
212+ # assigned either by the cloud provider or the user creating the vm
213+ def get_hostname(self, fqdn=False)
214+
215+ def get_package_mirror_info(self)
216
217-.. vi: textwidth=78
218+.. vi: textwidth=79

Subscribers

People subscribed via source and target branches