Merge lp://staging/~jimbaker/pyjuju/relation-info-command-spec into lp://staging/~juju/pyjuju/docs
Proposed by
Jim Baker
Status: | Merged |
---|---|
Approved by: | Kapil Thangavelu |
Approved revision: | 8 |
Merge reported by: | Mark Mims |
Merged at revision: | not available |
Proposed branch: | lp://staging/~jimbaker/pyjuju/relation-info-command-spec |
Merge into: | lp://staging/~juju/pyjuju/docs |
Diff against target: |
57 lines (+53/-0) 1 file modified
source/drafts/relation-info.rst (+53/-0) |
To merge this branch: | bzr merge lp://staging/~jimbaker/pyjuju/relation-info-command-spec |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+97736@code.staging.launchpad.net |
Description of the change
Add `relation-info` relation hook command.
To post a comment you must log in.
Reviewers: mp+97736_ code.launchpad. net,
Message:
Please take a look.
Description:
Add `relation-info` relation hook command.
https:/ /code.launchpad .net/~jimbaker/ juju/relation- info-command- spec/+merge/ 97736
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/5837050/
Affected files: drafts/ relation- info.rst
A [revision details]
A source/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: source/ drafts/ relation- info.rst drafts/ relation- info.rst' drafts/ relation- info.rst 1970-01-01 00:00:00 +0000 drafts/ relation- info.rst 2012-03-15 19:42:23 +0000 ------- ------- ------- ----- NAME_OR_ ID] OR_UNIT_ NAME] changed` hooks for service keystone) ; do
=== added file 'source/
--- source/
+++ source/
@@ -0,0 +1,68 @@
+New `relation-info` hook command
+------
+
+This proposal adds a new relation hook command to enumerate the
+relations a service participates in::
+
+ relation-info [--interface INTERFACE] [-r RELATION_
+ [SERVICE_
+
+The output is a whitespace separated list of relation ids, if any.
+
+The service name is defaulted to the one for which this hook is
+running. Using unit name instead is allowed as a convenience: only the
+service portion is meaningful. In the case of using this command
+outside of a relation hook, the service or unit name must be
+specified.
+
+Notes:
+
+ * Since the interface is encoded in the relation id, it is also
+ possible to filter that as desired without using the `--interface`
+ option.
+
+ * `relation-info` taking a relation id with `-r` can be used to
+ verify the continued existence of this relation id for the
+ service. If `-r` is specified with a relation name, all
+ corresponding relation ids for that name are returned.
+
+ * For any hook, the data for the `relation-info` for the the
+ corresponding default service is cached prior to calling the hook
+ script. Calling `relation-info` for other services is read at that
+ time and cached for the duration of the hook.
+
+Example. The keystone charm has the following definition in its
+`metadata.yaml`::
+
+ name: keystone
+ summary: Proposed OpenStack identity service - Daemons
+ description: |
+ Proposed OpenStack identity service - Daemons
+ provides:
+ identity-service:
+ interface: keystone
+ keystone-service:
+ interface: keystone
+ requires:
+ shared-db:
+ interface: mysql-shared
+
+For a keystone service unit, `relation-info` can be used to create a
+list of relation ids that provide the keystone interface, then
+enumerated over to set the ready for each relation. Setting this value
+will then trigger `<relation name>-relation-
+units on the opposite side of these relations::
+
+ for relation_id in $(relation-info --interface=
+ relation-set -r $relation_id ready=true
+ done
+
+In certain cases, this specific triggering could be initiated in this
+example as fo...