Code Monkey home page Code Monkey logo

interface-bind-client's Introduction

Overview

This interface supports integration between designate-bind and prometheus-bind-exporter-operator.

Usage

metadata

To consume this interface in your charm or layer, add the following to layer.yaml:

includes: ['interface:bind-client']

and add a requires interface of type bind-client to your charm or layers metadata.yaml:

requires:
  bind-stats:
    interface: bind-client

flag: {relation_name}.available

This flag is set when the subordinate unit is joined and removes when departed.

For example, the following code will update the relation just when the relation is estabilished and the configuration changed:

if reactive.is_flag_set('bind-stats.available'):
        config = hookenv.config()
        if config.changed("stats-port") or config.changed("stats-listen-net"):
            relation_settings = {
                'stats-listen-net': hookenv.config('stats-listen-net'),
                'stats-port': hookenv.config('stats-port')
            }
            for rel_id in hookenv.relation_ids('bind-stats'):
                hookenv.relation_set(
                    rel_id,
                    relation_settings=relation_settings
                )

When this flag is set, it will create a new file /etc/bind/stats.conf in charm-designate-bind with the following content:

statistics-channels {
  inet <stats-listen-net> port <stats-port> allow { <client-ip>; };
};

It will also include this new file at etc/bind/named.conf. This will open a statistics channel in bind that prometheus-bind-exporter can expose metrics for prometheus to collect.

When the flag is not set, the statistics channel is closed.

interface-bind-client's People

Contributors

gabrielcocenza avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.