Table of Contents

Class ISwitchPortsExtensions

Namespace
Meraki.Api.Extensions
Assembly
Meraki.Api.dll

Provides extension methods for managing switch ports on network devices.

public static class ISwitchPortsExtensions
Inheritance
ISwitchPortsExtensions
Inherited Members

Remarks

This static class contains methods that extend the functionality of the ISwitchPorts interface, allowing for operations such as updating port schedules on network switches.

Methods

UpdateDeviceSwitchPortSetPortScheduleIdAsync(ISwitchPorts, string, string, string?, CancellationToken)

Updates the port schedule ID for a specified switch port on a device.

public static Task<SwitchPort> UpdateDeviceSwitchPortSetPortScheduleIdAsync(this ISwitchPorts switchPorts, string serial, string portId, string? portScheduleId, CancellationToken cancellationToken = default)

Parameters

switchPorts ISwitchPorts

The interface for managing switch ports.

serial string

The serial number of the device containing the switch port. Cannot be null or empty.

portId string

The identifier of the switch port to update. Cannot be null or empty.

portScheduleId string

The new port schedule ID to assign to the switch port. Can be null to remove the schedule.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<SwitchPort>

A task representing the asynchronous operation, with a SwitchPort result containing the updated switch port details.

Remarks

This method allows you to update the schedule associated with a specific port on a network switch device. If portScheduleId is null, any existing schedule will be removed from the port.

UpdateDeviceSwitchPortSetVlanAsync(ISwitchPorts, string, string, int?, CancellationToken)

Updates the VLAN setting for a specified switch port on a device asynchronously.

public static Task<SwitchPort> UpdateDeviceSwitchPortSetVlanAsync(this ISwitchPorts switchPorts, string serial, string portId, int? vlan, CancellationToken cancellationToken = default)

Parameters

switchPorts ISwitchPorts

The interface for managing switch ports.

serial string

The serial number of the device containing the switch port.

portId string

The identifier of the switch port to update.

vlan int?

The VLAN ID to set for the switch port. Can be null to remove the VLAN setting.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<SwitchPort>

A task that represents the asynchronous operation. The task result contains the updated SwitchPort object.

Remarks

This method allows you to change the VLAN configuration of a specific port on a network switch device. The operation is performed asynchronously and can be cancelled using the provided cancellationToken.