class PostgresEraSubstrate(Substrate): os_type = 'Linux' provider_type = 'EXISTING_VM' provider_spec = read_provider_spec('specs/postgres_era.yaml') readiness_probe = readiness_probe( connection_type='SSH', disabled=True, retries='5', connection_port=22, address='@@{ip_address}@@', delay_secs='60', credential=ref(CENTOS_CRED) ) @action def __pre_create__(self): CalmTask.SetVariable.escript(filename='scripts/era_get_profile_ids.py', name='get profile ids', variables=['CLUSTER_ID', 'SOFTWARE_ID', 'SOFTWARE_VERSION', 'COMPUTE_ID', 'NETWORK_ID', 'DB_PARAMETER', 'SLA_ID']) CalmTask.SetVariable.escript(filename='scripts/era_initiate_provision.py', name='initiate db provision', variables=['OPERATION_ID']) CalmTask.Exec.escript(filename='scripts/era_wait_for_operation.py', name='wait for operation') CalmTask.SetVariable.escript(filename='scripts/era_get_db_details.py', name='get db details', variables=['DB_ID', 'DBSERVER_ID', 'DBSERVER_IP']) @action def __post_delete__(self): CalmTask.Exec.escript(filename='scripts/era_delete_database.py', name='delete_postgres')
class AhvVmSmallProfile(VmProfile): """ Small Ahv Vm Profile""" # Profile variables nameserver = Var(DNS_SERVER, label="Local DNS resolver") # VM Spec for Substrate provider_spec = ahv_vm(resources=SmallAhvVmResources, name="SmallAhvVm") # Readiness probe for substrate (disabled is set to false, for enabling check login) readiness_probe = readiness_probe(credential=ref(Centos), disabled=False) # Only actions under Packages, Substrates and Profiles are allowed @action def __install__(): Task.Exec.ssh( name="Task1", filename=os.path.join("scripts", "mysql_install_script.sh") ) @action def __pre_create__(): Task.Exec.escript(name="Pre Create Task", script="print 'Hello!'") @action def test_profile_action(): Task.Exec.ssh(name="Task9", script='echo "Hello"')
class AhvVmSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = ahv_vm( resources=MyAhvLinuxVmResources, categories={"AppFamily": "Backup", "AppType": "Default"}, ) readiness_probe = readiness_probe(disabled=True)
class AhvVmSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = MyAhvVm readiness_probe = readiness_probe( connection_type="SSH", disabled=False, editables_list=["connection_port", "retries"], delay_secs="60", retries="5", )
class AhvSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = read_provider_spec("specs/ahv_provider_spec.yaml") provider_spec_editables = read_spec("specs/ahv_substrate_editable.yaml") readiness_probe = readiness_probe( connection_type="SSH", credential=ref(DefaultCred), disabled=True, editables_list=["connection_port", "retries"], )
class AHVVMforMySQL(Substrate): """AHV VM config given by reading a spec file""" name = "ahv vm for sql" provider_spec = MyAhvVm1 readiness_probe = readiness_probe( connection_type="SSH", disabled=False, retries="5", connection_port=22, address="@@{platform.status.resources.nic_list[0].ip_endpoint_list[0].ip}@@", delay_secs="0", )
class AristaSubstrate(Substrate): os_type = 'Linux' provider_type = 'EXISTING_VM' provider_spec = read_provider_spec('specs/arista_specs.yaml') readiness_probe = readiness_probe( connection_type='SSH', disabled=True, retries='5', connection_port=22, address='@@{ip_address}@@', delay_secs='60', credential=ref(ARISTA_CRED) )
class AHVVMforMySQL(Substrate): """AHV VM config given by reading a spec file""" name = "ahv vm for sql" provider_spec = MyAhvVm1 readiness_probe = readiness_probe( connection_type="SSH", disabled=False, retries="5", connection_port=22, address="@@{platform.status.resources.nic_list[0].ip_endpoint_list[0].ip}@@", delay_secs="0", ) @action def __pre_create__(): CalmTask.SetVariable.escript( name="Pre_create task1", script='nic_var={"uuid": "eab99eb7-302f-4e1a-a1a4-5cc901fb9259"}', target=ref(AHVVMforMySQL), variables=["nic_var"], )
class AhvWindowsVmSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = MyAhvWindowsVm os_type = "Windows" readiness_probe = readiness_probe(disabled=True)
class AhvVmSubstrate(Substrate): """AHV VM config given by reading a spec file""" provider_spec = MyAhvLinuxVm readiness_probe = readiness_probe(disabled=True)