def privatecloud_create(cmd, client: AVSClient, resource_group_name, name, location, sku, cluster_size, network_block, circuit_primary_subnet=None, circuit_secondary_subnet=None, internet=None, vcenter_password=None, nsxt_password=None, tags=[]): from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku if circuit_primary_subnet is not None or circuit_secondary_subnet is not None: circuit = Circuit(primary_subnet=circuit_primary_subnet, secondary_subnet=circuit_secondary_subnet) else: circuit = None management_cluster = ManagementCluster(cluster_size=cluster_size) cloud = PrivateCloud(location=location, sku=Sku(name=sku), circuit=circuit, management_cluster=management_cluster, network_block=network_block, tags=tags) if internet is not None: cloud.internet = internet if vcenter_password is not None: cloud.vcenter_password = vcenter_password if nsxt_password is not None: cloud.nsxt_password = nsxt_password return client.private_clouds.begin_create_or_update( resource_group_name, name, cloud)
def privatecloud_update(cmd, client: AVSClient, resource_group_name, name, cluster_size=None, internet=None): from azext_vmware.vendored_sdks.avs_client.models import PrivateCloudUpdate, ManagementCluster private_cloud_update = PrivateCloudUpdate() if cluster_size is not None: private_cloud_update.management_cluster = ManagementCluster(cluster_size=cluster_size) if internet is not None: private_cloud_update.internet = internet return client.private_clouds.begin_update(resource_group_name, name, private_cloud_update)
def privatecloud_create(cmd, client: AVSClient, resource_group_name, name, location, sku, cluster_size, network_block, circuit_primary_subnet=None, circuit_secondary_subnet=None, internet=None, vcenter_password=None, nsxt_password=None, tags=[], accept_eula=False): from knack.prompting import prompt_y_n if not accept_eula: print(LEGAL_TERMS) msg = 'Do you agree to the above additional terms for AVS?' if not prompt_y_n(msg, default="n"): return from azext_vmware.vendored_sdks.avs_client.models import PrivateCloud, Circuit, ManagementCluster, Sku if circuit_primary_subnet is not None or circuit_secondary_subnet is not None: circuit = Circuit(primary_subnet=circuit_primary_subnet, secondary_subnet=circuit_secondary_subnet) else: circuit = None management_cluster = ManagementCluster(cluster_size=cluster_size) cloud = PrivateCloud(location=location, sku=Sku(name=sku), circuit=circuit, management_cluster=management_cluster, network_block=network_block, tags=tags) if internet is not None: cloud.internet = internet if vcenter_password is not None: cloud.vcenter_password = vcenter_password if nsxt_password is not None: cloud.nsxt_password = nsxt_password return client.private_clouds.begin_create_or_update( resource_group_name, name, cloud)