func Create(client *govmomi.Client, dvs *object.VmwareDistributedVirtualSwitch, spec types.DVPortgroupConfigSpec) (*object.Task, error) {
	req := &types.CreateDVPortgroup_Task{
		This: dvs.Reference(),
		Spec: spec,
	}

	ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout)
	defer cancel()
	resp, err := methods.CreateDVPortgroup_Task(ctx, client, req)
	if err != nil {
		return nil, err
	}

	return object.NewTask(client.Client, resp.Returnval.Reference()), nil
}
func Create(client *govmomi.Client, dvs *object.VmwareDistributedVirtualSwitch, spec types.DVPortgroupConfigSpec) (*object.Task, error) {
	req := &types.CreateDVPortgroup_Task{
		This: dvs.Reference(),
		Spec: spec,
	}

	ctx, cancel := context.WithTimeout(context.Background(), provider.DefaultAPITimeout)
	defer cancel()
	resp, err := methods.CreateDVPortgroup_Task(ctx, client, req)
	if err != nil {
		return nil, err
	}

	return object.NewTask(client.Client, resp.Returnval.Reference()), nil
}
func Create ( client * govmomi . Client , dvs * object . VmwareDistributedVirtualSwitch , spec types . DVPortgroupConfigSpec ) ( * object . Task , error ) { req := & types . CreateDVPortgroup_Task { This : dvs . Reference ( ) , Spec : spec , } ctx , cancel := context . WithTimeout ( context . Background ( ) , provider . DefaultAPITimeout ) defer cancel ( ) resp , err := methods . CreateDVPortgroup_Task ( ctx , client , req ) if err != nil { return nil , err } return object . NewTask ( client . Client , resp . Returnval . Reference ( ) ) , nil }
// Create exposes the CreateDVPortgroup_Task method of the
// DistributedVirtualSwitch MO.  This local implementation may go away if this
// is exposed in the higher-level object upstream.
Create exposes the CreateDVPortgroup_Task method of the DistributedVirtualSwitch MO . This local implementation may go away if this is exposed in the higher - level object upstream .