cloudmesh.management.configuration.name

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

Name

A convenient dot dict class:

class cloudmesh.management.configuration.name.Name(**kwargs)

Bases: cloudmesh.common.dotdict.dotdict

A convenient dot dict class:

a = dotdict({"argument": "value"})

print (a.argument)

Nested dot documentation is not supported.

property schema(self)
set(self, schema)
assign(self, data)
overwrite(self, d)
load(self, path)
flush(self, data=None)
__str__(self)

Return str(self).

dict(self)
reset(self)
incr(self)
name(self)
cloudmesh.management.configuration.name.name