Esempio n. 1
0
class SampleDslProject(Project):
    """Sample DSL Project with environments"""

    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_1_NAME),
            subnets=[
                Ref.Subnet(
                    name=NTNX_ACCOUNT_1_SUBNET_2,
                    cluster=NTNX_ACCOUNT_1_SUBNET_2_CLUSTER,
                )
            ],
        ),
        Provider.Gcp(account=Ref.Account(GCP_ACCOUNT_NAME)),
        Provider.Vmware(account=Ref.Account(VMWARE_ACCOUNT_NAME)),
        Provider.K8s(account=Ref.Account(K8S_ACCOUNT_NAME)),
    ]

    users = [Ref.User(USER_NAME)]

    envs = [ProjEnvironment1, ProjEnvironment2]
    default_environment = ref(ProjEnvironment1)
    quotas = {
        "vcpus": 1,
        "storage": 2,
        "memory": 1,
    }
class SampleDslProject(Project):
    """
    Sample DSL Project with environments
    NOTE: AWS account is added to environment module and not to project module, 
        By default project command will also attach the accounts attached to any environment
        to this project
    """

    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_NAME),
            subnets=[
                Ref.Subnet(
                    name=NTNX_SUBNET,
                    cluster=NTNX_SUBNET_CLUSTER,
                )
            ],
        ),
        Provider.Gcp(account=Ref.Account(GCP_ACCOUNT_NAME)),
        Provider.Vmware(account=Ref.Account(VMWARE_ACCOUNT_NAME)),
        Provider.K8s(account=Ref.Account(K8S_ACCOUNT_NAME)),
    ]

    users = [Ref.User(USER)]

    envs = [ProjEnvironment1]
    default_environment = ref(ProjEnvironment1)
    quotas = {
        "vcpus": 1,
        "storage": 2,
        "memory": 1,
    }
Esempio n. 3
0
class ProjEnvironment2(Environment):

    substrates = [AhvWindowsVmSubstrate]
    credentials = [Centos]
    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_2_NAME),
            subnets=[
                Ref.Subnet(
                    name=NTNX_ACCOUNT_2_SUBNET_1,
                    cluster=NTNX_ACCOUNT_2_SUBNET_1_CLUSTER,
                )
            ],
        ),
        Provider.Gcp(account=Ref.Account(GCP_ACCOUNT_NAME)),
    ]
Esempio n. 4
0
class ProjEnvironment1(Environment):

    substrates = [AhvVmSubstrate]
    credentials = [Centos]
    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_1_NAME),
            subnets=[
                Ref.Subnet(
                    name=NTNX_ACCOUNT_1_SUBNET_1,
                    cluster=NTNX_ACCOUNT_1_SUBNET_1_CLUSTER,
                )
            ],
        ),
        Provider.Aws(account=Ref.Account(AWS_ACCOUNT_NAME)),
        Provider.Azure(account=Ref.Account(AZURE_ACCOUNT_NAME)),
    ]
Esempio n. 5
0
class SampleDslEnvironment(Environment):

    substrates = [AhvVmSubstrate]
    credentials = [Centos]
    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_1_NAME),
            subnets=[
                Ref.Subnet(
                    name=NTNX_ACCOUNT_1_SUBNET_1,
                    cluster=NTNX_ACCOUNT_1_SUBNET_1_CLUSTER,
                )
            ],
        ),
        Provider.Aws(account=Ref.Account(AWS_ACCOUNT_NAME)),
        Provider.Gcp(account=Ref.Account(GCP_ACCOUNT_NAME)),
        Provider.Vmware(account=Ref.Account(VMWARE_ACCOUNT_NAME)),
    ]
class DSL_PROJECT(Project):
    """Test project"""

    providers = [
        Provider.Ntnx(
            account=Ref.Account(ACCOUNT_NAME),
            subnets=[Ref.Subnet(name=SUBNET_NAME, cluster=CLUSTER_NAME)],
        )
    ]

    quotas = {"vcpus": VCPUS, "storage": STORAGE, "memory": MEMORY}
Esempio n. 7
0
class TestDslProjectWithEnv(Project):
    """Sample DSL Project with environments"""

    providers = [
        Provider.Ntnx(
            account=Ref.Account("NTNX_LOCAL_AZ"),
            subnets=[Ref.Subnet(name="vlan.0", cluster="calmdev1")],
        ),
        Provider.Aws(account=Ref.Account("AWS account")),
        Provider.Azure(account=Ref.Account("AZURE_account")),
        Provider.Gcp(account=Ref.Account("GCP Account")),
        Provider.Vmware(account=Ref.Account("Vmware Account")),
        Provider.K8s(account=Ref.Account("K8S_account_basic_auth")),
    ]

    users = [
        Ref.User(name="*****@*****.**"),
    ]

    envs = [ProjEnvironment]

    groups = [
        Ref.Group(name="cn=sspgroup1,ou=pc,dc=systest,dc=nutanix,dc=com"),
    ]

    quotas = {
        "vcpus": 1,
        "storage": 2,
        "memory": 1,
    }
Esempio n. 8
0
class TestDslProjectWithEnv1(Project):
    """Sample DSL Project with environments"""

    providers = [
        Provider.Ntnx(
            account=Ref.Account(NTNX_ACCOUNT_NAME),
            subnets=[
                Ref.Subnet(name=NTNX_SUBNET, cluster=NTNX_SUBNET_CLUSTER)
            ],
        ),
        Provider.Aws(account=Ref.Account(AWS_ACCOUNT_NAME)),
        Provider.Azure(account=Ref.Account(AZURE_ACCOUNT_NAME)),
        Provider.Gcp(account=Ref.Account(GCP_ACCOUNT_NAME)),
        Provider.Vmware(account=Ref.Account(VMWARE_ACCOUNT_NAME)),
        Provider.K8s(account=Ref.Account(K8S_ACCOUNT_NAME)),
    ]

    users = [Ref.User(name=USER_NAME)]

    envs = [ProjEnvironment]

    quotas = {
        "vcpus": 1,
        "storage": 2,
        "memory": 1,
    }
Esempio n. 9
0
class TestDemoProject(Project):
    """Test project"""

    providers = [
        Provider.Ntnx(
            account=Ref.Account(ACCOUNT),
            subnets=[Ref.Subnet(name=SUBNET, cluster=CLUSTER)],
        )
    ]

    users = [Ref.User(name=USER)]

    groups = [Ref.Group(name=GROUP)]

    quotas = {"vcpus": VCPUS, "storage": STORAGE, "memory": MEMORY}