Esempio n. 1
0
def check_experiment_done(experiment_id, need_status):
    e = db_adapter.get_object(Experiment, experiment_id)
    need_ve_status = VEStatus.RUNNING
    if need_status == EStatus.STOPPED:
        need_ve_status = VEStatus.STOPPED
    if db_adapter.count_by(
            VirtualEnvironment, experiment_id=experiment_id,
            status=need_ve_status) == e.template.virtual_environment_count:
        update_experiment_status(experiment_id, need_status)
Esempio n. 2
0
def check_experiment_done(experiment_id, need_status):
    e = db_adapter.get_object(Experiment, experiment_id)
    need_ve_status = VEStatus.RUNNING
    if need_status == EStatus.STOPPED:
        need_ve_status = VEStatus.STOPPED
    if db_adapter.count_by(VirtualEnvironment,
                           experiment_id=experiment_id,
                           status=need_ve_status) == e.template.virtual_environment_count:
        update_experiment_status(experiment_id, need_status)
Esempio n. 3
0
def contain_azure_virtual_machine(cloud_service_name, deployment_name,
                                  virtual_machine_name):
    cs = db_adapter.find_first_object_by(AzureCloudService,
                                         name=cloud_service_name)
    dm = db_adapter.find_first_object_by(AzureDeployment,
                                         name=deployment_name,
                                         cloud_service=cs)
    return db_adapter.count_by(AzureVirtualMachine,
                               name=virtual_machine_name,
                               deployment_id=dm.id) != 0
def contain_azure_storage_account(name):
    return db_adapter.count_by(AzureStorageAccount, name=name) != 0
def contain_azure_virtual_machine(cloud_service_name, deployment_name, virtual_machine_name):
    cs = db_adapter.find_first_object_by(AzureCloudService, name=cloud_service_name)
    dm = db_adapter.find_first_object_by(AzureDeployment, name=deployment_name, cloud_service=cs)
    return db_adapter.count_by(AzureVirtualMachine, name=virtual_machine_name, deployment_id=dm.id) != 0
def contain_azure_deployment(cloud_service_name, deployment_slot):
    cs = db_adapter.find_first_object_by(AzureCloudService, name=cloud_service_name)
    return db_adapter.count_by(AzureDeployment, slot=deployment_slot, cloud_service_id=cs.id) != 0
def contain_azure_cloud_service(name):
    return db_adapter.count_by(AzureCloudService, name=name) != 0
Esempio n. 8
0
def contain_azure_deployment(cloud_service_name, deployment_slot):
    cs = db_adapter.find_first_object_by(AzureCloudService,
                                         name=cloud_service_name)
    return db_adapter.count_by(
        AzureDeployment, slot=deployment_slot, cloud_service_id=cs.id) != 0
Esempio n. 9
0
def contain_azure_cloud_service(name):
    return db_adapter.count_by(AzureCloudService, name=name) != 0
Esempio n. 10
0
def contain_azure_storage_account(name):
    return db_adapter.count_by(AzureStorageAccount, name=name) != 0