Charm Interface - Ceph Client
Go to file
Chris MacNaughton 68c2d0ca1d update interface.yaml with ignores and maintainer
The ignores removes all files that are not relevant to
the interface from the built charm, and thus, the
runtime imports of the interface bits

Change-Id: I4d5c58fff7d05dc10eea54567fbabb579a9ddd71
2019-02-20 09:43:49 +01:00
unit_tests Add request_access_to_group method 2019-01-08 14:00:13 +00:00
.gitignore Refactor create_pool. 2019-01-08 11:33:03 +00:00
.gitreview Add support for ceph-proxy dataset 2017-09-26 08:07:11 +01:00
.project Add initial requires 2017-07-03 15:17:35 +01:00
.pydevproject Add initial requires 2017-07-03 15:17:35 +01:00
.testr.conf Add unit tests 2018-12-07 19:54:10 +00:00
.zuul.yaml Add unit tests 2018-12-07 19:54:10 +00:00
README.md Add initial requires 2017-07-03 15:17:35 +01:00
interface.yaml update interface.yaml with ignores and maintainer 2019-02-20 09:43:49 +01:00
provides.py do not need empty key 2016-05-26 16:43:12 -04:00
requires.py Add request_access_to_group method 2019-01-08 14:00:13 +00:00
test-requirements.txt Add unit tests 2018-12-07 19:54:10 +00:00
tox.ini Add unit tests 2018-12-07 19:54:10 +00:00

README.md

Overview

This interface layer handles the communication between the Ceph Monitor cluster and a client that requires an access key and a pool to use.

Usage

Requires

This interface layer will set the following states, as appropriate:

  • {relation_name}.available The ceph client has been related to a provider.

The following accessors will be available:

  • key - The cephx access key
  • auth - Whether or not strict auth is supported
  • mon_hosts - The public addresses list of the monitor cluster

Client example:

@when('ceph-client.connected')
def ceph_connected(ceph_client):
  ceph_client.create_pool('newpool')

@when('ceph-client.available')
def ceph_ready(ceph_client):
  charm_ceph_conf= os.path.join(os.sep, 'etc', 'ceph', 'ceph.conf')
  cephx_key = os.path.join(os.sep, 'etc', 'ceph', 'ceph.client.charm.keyring')

  ceph_context = {
      'auth_supported': ceph_client.auth,
      'mon_hosts': ceph_client.mon_hosts,
  }

  with open(charm_ceph_conf, 'w') as cephconf:
    cephconf.write(render_template('ceph.conf', ceph_context))

  # Write out the cephx_key also
  with open(cephx_key, 'w') as cephconf:
    cephconf.write(ceph_client.key)