Micros modifier

This modifier is intended to be used within Atlassian!

A short explanation of what this facilitates:

  • We have an internal PaaS
  • The PaaS lets service owners make their own infrastructure.
  • We run an “Open Service Broker” which allows a set of parameters to flow through so that people can create their own load-balancing on our Envoy proxies.

This modifier will match any data that contains an OSB Plan Id and then transform it into a format that suits the templates that we have configured as a default for this project.

To enable this modifier, add the following to your config:

modifiers:
  - micros
class sovereign.modifiers.micros.MergeByDomain(source_data: list)

Bases: sovereign.modifiers.lib.GlobalModifier

apply()

Instances with the same service name will be combined together and will share all domains, clusters, and so on.

match(data_instance: dict)

match is an abstract method which must be overwritten by all inheriting classes. This is run prior to applying a global modifier, and results in the given data source being sorted into ‘matched’ and ‘unmatched’ groups. Match must return something truthy or falsy.

Parameters:data_instance – dict object to be matched against
Returns:True if matched, or False if unmatched
class sovereign.modifiers.micros.Micros(instance: dict)

Bases: sovereign.modifiers.lib.Modifier

apply()

Performs some reshuffling and handling of the data. Inserts a new field ‘translated’ to avoid further modification.

match()

Returns true if the data contains the correct plan id + it has not yet been modified (denoted by a field ‘translated’)

sovereign.modifiers.micros.basic_plan_id = '7d57270a-0348-58d3-829d-447a98fe98d5'

The Plan Id that must be present in the data for this modifier to apply