:mod:`cloudmesh.management.configuration.name` ============================================== .. py:module:: cloudmesh.management.configuration.name .. autoapi-nested-parse:: We use a uniform naming convention method. The name is defined by different kinds of objects. The name is a string its syntax is defined in a yaml file located at ``~/.cloudmesh/name.yaml`` :: order: - experiment - group - user - kind - counter schema: '{experiment}-{group}-{user}-{kind}-{counter}' experiment: exp group: grp user: gregor kind: container counter: 2 This file is automatically generated if it does not exists by a simple `Name` object that can include an ordered number of dictionary keys such as :Experiment: is an experiment that all cloud objects can be placed under. :Group: A group formulates a number of objects that logically build an entity, such as a number of virtual machines building a cluster :User: A user name that may control the group :Kind: A kind that identifies which kind of resource this is The last is a counter which is always increased and written into this file in order to assure that the latest value is safely included in it. A typical use is :: config = Config() directory = config.location path=f"{directory}/name.yaml", n = Name(experiment="exp", group="grp", user="gregor", kind="vm", path=path counter=1) n.incr() counter = n.get() Which will return :: exp-grp-gregor-vm-1 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: cloudmesh.management.configuration.name.Name .. class:: Name(**kwargs) Bases: :class:`cloudmesh.common.dotdict.dotdict` A convenient dot dict class:: a = dotdict({"argument": "value"}) print (a.argument) Nested dot documentation is not supported. .. method:: schema(self) :property: .. method:: set(self, schema) .. method:: assign(self, data) .. method:: overwrite(self, d) .. method:: load(self, path) .. method:: flush(self, data=None) .. method:: __str__(self) Return str(self). .. method:: dict(self) .. method:: reset(self) .. method:: incr(self) .. method:: name(self) .. data:: name